chore: generate
This commit is contained in:
@@ -12,11 +12,7 @@ import { Flag } from "@opencode-ai/core/flag/flag"
|
|||||||
import { DialogSessionRename } from "./dialog-session-rename"
|
import { DialogSessionRename } from "./dialog-session-rename"
|
||||||
import { createDebouncedSignal } from "../util/signal"
|
import { createDebouncedSignal } from "../util/signal"
|
||||||
import { useToast } from "../ui/toast"
|
import { useToast } from "../ui/toast"
|
||||||
import {
|
import { openWorkspaceSelect, type WorkspaceSelection, warpWorkspaceSession } from "./dialog-workspace-create"
|
||||||
openWorkspaceSelect,
|
|
||||||
type WorkspaceSelection,
|
|
||||||
warpWorkspaceSession,
|
|
||||||
} from "./dialog-workspace-create"
|
|
||||||
import { Spinner } from "./spinner"
|
import { Spinner } from "./spinner"
|
||||||
import { errorMessage } from "@/util/error"
|
import { errorMessage } from "@/util/error"
|
||||||
import { DialogSessionDeleteFailed } from "./dialog-session-delete-failed"
|
import { DialogSessionDeleteFailed } from "./dialog-session-delete-failed"
|
||||||
|
|||||||
@@ -166,7 +166,9 @@ export async function confirmWorkspaceFileChanges(input: {
|
|||||||
sourceWorkspaceID?: string
|
sourceWorkspaceID?: string
|
||||||
}) {
|
}) {
|
||||||
const status = await input.sdk.client.vcs.status({ workspace: input.sourceWorkspaceID }).catch(() => undefined)
|
const status = await input.sdk.client.vcs.status({ workspace: input.sourceWorkspaceID }).catch(() => undefined)
|
||||||
const fileChangeChoice = status?.data?.length ? await DialogWorkspaceFileChanges.show(input.dialog, status.data) : "no"
|
const fileChangeChoice = status?.data?.length
|
||||||
|
? await DialogWorkspaceFileChanges.show(input.dialog, status.data)
|
||||||
|
: "no"
|
||||||
if (!fileChangeChoice) return
|
if (!fileChangeChoice) return
|
||||||
return fileChangeChoice === "yes"
|
return fileChangeChoice === "yes"
|
||||||
}
|
}
|
||||||
@@ -262,7 +264,9 @@ export function DialogWorkspaceSelect(props: {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.replace(() => <DialogExistingWorkspaceSelect omitWorkspaceID={omittedWorkspaceID()} onSelect={props.onSelect} />)
|
dialog.replace(() => (
|
||||||
|
<DialogExistingWorkspaceSelect omitWorkspaceID={omittedWorkspaceID()} onSelect={props.onSelect} />
|
||||||
|
))
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|||||||
+250
-2
@@ -1897,6 +1897,54 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/vcs/status": {
|
||||||
|
"get": {
|
||||||
|
"tags": ["instance"],
|
||||||
|
"operationId": "vcs.status",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "directory",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "workspace",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "VCS status",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/VcsFileStatus"
|
||||||
|
},
|
||||||
|
"description": "VCS status"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Retrieve changed files in the current working tree without patches.",
|
||||||
|
"summary": "Get VCS status",
|
||||||
|
"x-codeSamples": [
|
||||||
|
{
|
||||||
|
"lang": "js",
|
||||||
|
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.status({\n ...\n})"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/vcs/diff": {
|
"/vcs/diff": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": ["instance"],
|
"tags": ["instance"],
|
||||||
@@ -1954,6 +2002,128 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/vcs/diff/raw": {
|
||||||
|
"get": {
|
||||||
|
"tags": ["instance"],
|
||||||
|
"operationId": "vcs.diff.raw",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "directory",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "workspace",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Raw VCS diff",
|
||||||
|
"content": {
|
||||||
|
"text/x-diff; charset=utf-8": {
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Retrieve a raw patch for current uncommitted changes.",
|
||||||
|
"summary": "Get raw VCS diff",
|
||||||
|
"x-codeSamples": [
|
||||||
|
{
|
||||||
|
"lang": "js",
|
||||||
|
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff.raw({\n ...\n})"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/vcs/apply": {
|
||||||
|
"post": {
|
||||||
|
"tags": ["instance"],
|
||||||
|
"operationId": "vcs.apply",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "directory",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "workspace",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "VCS patch applied",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"applied": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["applied"],
|
||||||
|
"additionalProperties": false,
|
||||||
|
"description": "VCS patch applied"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "VcsApplyError",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/VcsApplyError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Apply a raw patch to the current working tree.",
|
||||||
|
"summary": "Apply VCS patch",
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"patch": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["patch"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-codeSamples": [
|
||||||
|
{
|
||||||
|
"lang": "js",
|
||||||
|
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.apply({\n ...\n})"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/command": {
|
"/command": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": ["instance"],
|
"tags": ["instance"],
|
||||||
@@ -8396,11 +8566,18 @@
|
|||||||
"description": "Session warped"
|
"description": "Session warped"
|
||||||
},
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad request",
|
"description": "WorkspaceWarpError | VcsApplyError",
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/components/schemas/BadRequestError"
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/WorkspaceWarpError"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/VcsApplyError"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8426,6 +8603,9 @@
|
|||||||
},
|
},
|
||||||
"sessionID": {
|
"sessionID": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"copyChanges": {
|
||||||
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["id", "sessionID"],
|
"required": ["id", "sessionID"],
|
||||||
@@ -12665,6 +12845,28 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"VcsFileStatus": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"file": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"additions": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 0
|
||||||
|
},
|
||||||
|
"deletions": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 0
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["added", "deleted", "modified"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["file", "additions", "deletions", "status"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"VcsFileDiff": {
|
"VcsFileDiff": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -12690,6 +12892,31 @@
|
|||||||
"required": ["file", "patch", "additions", "deletions"],
|
"required": ["file", "patch", "additions", "deletions"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"VcsApplyError": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["VcsApplyError"]
|
||||||
|
},
|
||||||
|
"data": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"message": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"reason": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["non-git", "not-clean"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["message", "reason"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["name", "data"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"Command": {
|
"Command": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -13431,6 +13658,27 @@
|
|||||||
"required": ["id", "type", "name", "branch", "directory", "extra", "projectID"],
|
"required": ["id", "type", "name", "branch", "directory", "extra", "projectID"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"WorkspaceWarpError": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["WorkspaceWarpError"]
|
||||||
|
},
|
||||||
|
"data": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"message": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["message"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["name", "data"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"SyncEventMessageUpdated": {
|
"SyncEventMessageUpdated": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
Reference in New Issue
Block a user