Skip to content

Commit 98e0917

Browse files
chore: generate
1 parent 3c4b4d5 commit 98e0917

3 files changed

Lines changed: 257 additions & 9 deletions

File tree

packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ import { Flag } from "@opencode-ai/core/flag/flag"
1212
import { DialogSessionRename } from "./dialog-session-rename"
1313
import { createDebouncedSignal } from "../util/signal"
1414
import { useToast } from "../ui/toast"
15-
import {
16-
openWorkspaceSelect,
17-
type WorkspaceSelection,
18-
warpWorkspaceSession,
19-
} from "./dialog-workspace-create"
15+
import { openWorkspaceSelect, type WorkspaceSelection, warpWorkspaceSession } from "./dialog-workspace-create"
2016
import { Spinner } from "./spinner"
2117
import { errorMessage } from "@/util/error"
2218
import { DialogSessionDeleteFailed } from "./dialog-session-delete-failed"

packages/opencode/src/cli/cmd/tui/component/dialog-workspace-create.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ export async function confirmWorkspaceFileChanges(input: {
166166
sourceWorkspaceID?: string
167167
}) {
168168
const status = await input.sdk.client.vcs.status({ workspace: input.sourceWorkspaceID }).catch(() => undefined)
169-
const fileChangeChoice = status?.data?.length ? await DialogWorkspaceFileChanges.show(input.dialog, status.data) : "no"
169+
const fileChangeChoice = status?.data?.length
170+
? await DialogWorkspaceFileChanges.show(input.dialog, status.data)
171+
: "no"
170172
if (!fileChangeChoice) return
171173
return fileChangeChoice === "yes"
172174
}
@@ -262,7 +264,9 @@ export function DialogWorkspaceSelect(props: {
262264
return
263265
}
264266

265-
dialog.replace(() => <DialogExistingWorkspaceSelect omitWorkspaceID={omittedWorkspaceID()} onSelect={props.onSelect} />)
267+
dialog.replace(() => (
268+
<DialogExistingWorkspaceSelect omitWorkspaceID={omittedWorkspaceID()} onSelect={props.onSelect} />
269+
))
266270
}}
267271
/>
268272
)

packages/sdk/openapi.json

Lines changed: 250 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,6 +1897,54 @@
18971897
]
18981898
}
18991899
},
1900+
"/vcs/status": {
1901+
"get": {
1902+
"tags": ["instance"],
1903+
"operationId": "vcs.status",
1904+
"parameters": [
1905+
{
1906+
"name": "directory",
1907+
"in": "query",
1908+
"required": false,
1909+
"schema": {
1910+
"type": "string"
1911+
}
1912+
},
1913+
{
1914+
"name": "workspace",
1915+
"in": "query",
1916+
"required": false,
1917+
"schema": {
1918+
"type": "string"
1919+
}
1920+
}
1921+
],
1922+
"responses": {
1923+
"200": {
1924+
"description": "VCS status",
1925+
"content": {
1926+
"application/json": {
1927+
"schema": {
1928+
"type": "array",
1929+
"items": {
1930+
"$ref": "#/components/schemas/VcsFileStatus"
1931+
},
1932+
"description": "VCS status"
1933+
}
1934+
}
1935+
}
1936+
}
1937+
},
1938+
"description": "Retrieve changed files in the current working tree without patches.",
1939+
"summary": "Get VCS status",
1940+
"x-codeSamples": [
1941+
{
1942+
"lang": "js",
1943+
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.status({\n ...\n})"
1944+
}
1945+
]
1946+
}
1947+
},
19001948
"/vcs/diff": {
19011949
"get": {
19021950
"tags": ["instance"],
@@ -1954,6 +2002,128 @@
19542002
]
19552003
}
19562004
},
2005+
"/vcs/diff/raw": {
2006+
"get": {
2007+
"tags": ["instance"],
2008+
"operationId": "vcs.diff.raw",
2009+
"parameters": [
2010+
{
2011+
"name": "directory",
2012+
"in": "query",
2013+
"required": false,
2014+
"schema": {
2015+
"type": "string"
2016+
}
2017+
},
2018+
{
2019+
"name": "workspace",
2020+
"in": "query",
2021+
"required": false,
2022+
"schema": {
2023+
"type": "string"
2024+
}
2025+
}
2026+
],
2027+
"responses": {
2028+
"200": {
2029+
"description": "Raw VCS diff",
2030+
"content": {
2031+
"text/x-diff; charset=utf-8": {
2032+
"schema": {
2033+
"type": "string"
2034+
}
2035+
}
2036+
}
2037+
}
2038+
},
2039+
"description": "Retrieve a raw patch for current uncommitted changes.",
2040+
"summary": "Get raw VCS diff",
2041+
"x-codeSamples": [
2042+
{
2043+
"lang": "js",
2044+
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff.raw({\n ...\n})"
2045+
}
2046+
]
2047+
}
2048+
},
2049+
"/vcs/apply": {
2050+
"post": {
2051+
"tags": ["instance"],
2052+
"operationId": "vcs.apply",
2053+
"parameters": [
2054+
{
2055+
"name": "directory",
2056+
"in": "query",
2057+
"required": false,
2058+
"schema": {
2059+
"type": "string"
2060+
}
2061+
},
2062+
{
2063+
"name": "workspace",
2064+
"in": "query",
2065+
"required": false,
2066+
"schema": {
2067+
"type": "string"
2068+
}
2069+
}
2070+
],
2071+
"responses": {
2072+
"200": {
2073+
"description": "VCS patch applied",
2074+
"content": {
2075+
"application/json": {
2076+
"schema": {
2077+
"type": "object",
2078+
"properties": {
2079+
"applied": {
2080+
"type": "boolean"
2081+
}
2082+
},
2083+
"required": ["applied"],
2084+
"additionalProperties": false,
2085+
"description": "VCS patch applied"
2086+
}
2087+
}
2088+
}
2089+
},
2090+
"400": {
2091+
"description": "VcsApplyError",
2092+
"content": {
2093+
"application/json": {
2094+
"schema": {
2095+
"$ref": "#/components/schemas/VcsApplyError"
2096+
}
2097+
}
2098+
}
2099+
}
2100+
},
2101+
"description": "Apply a raw patch to the current working tree.",
2102+
"summary": "Apply VCS patch",
2103+
"requestBody": {
2104+
"content": {
2105+
"application/json": {
2106+
"schema": {
2107+
"type": "object",
2108+
"properties": {
2109+
"patch": {
2110+
"type": "string"
2111+
}
2112+
},
2113+
"required": ["patch"],
2114+
"additionalProperties": false
2115+
}
2116+
}
2117+
}
2118+
},
2119+
"x-codeSamples": [
2120+
{
2121+
"lang": "js",
2122+
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.apply({\n ...\n})"
2123+
}
2124+
]
2125+
}
2126+
},
19572127
"/command": {
19582128
"get": {
19592129
"tags": ["instance"],
@@ -8396,11 +8566,18 @@
83968566
"description": "Session warped"
83978567
},
83988568
"400": {
8399-
"description": "Bad request",
8569+
"description": "WorkspaceWarpError | VcsApplyError",
84008570
"content": {
84018571
"application/json": {
84028572
"schema": {
8403-
"$ref": "#/components/schemas/BadRequestError"
8573+
"anyOf": [
8574+
{
8575+
"$ref": "#/components/schemas/WorkspaceWarpError"
8576+
},
8577+
{
8578+
"$ref": "#/components/schemas/VcsApplyError"
8579+
}
8580+
]
84048581
}
84058582
}
84068583
}
@@ -8426,6 +8603,9 @@
84268603
},
84278604
"sessionID": {
84288605
"type": "string"
8606+
},
8607+
"copyChanges": {
8608+
"type": "boolean"
84298609
}
84308610
},
84318611
"required": ["id", "sessionID"],
@@ -12665,6 +12845,28 @@
1266512845
},
1266612846
"additionalProperties": false
1266712847
},
12848+
"VcsFileStatus": {
12849+
"type": "object",
12850+
"properties": {
12851+
"file": {
12852+
"type": "string"
12853+
},
12854+
"additions": {
12855+
"type": "integer",
12856+
"minimum": 0
12857+
},
12858+
"deletions": {
12859+
"type": "integer",
12860+
"minimum": 0
12861+
},
12862+
"status": {
12863+
"type": "string",
12864+
"enum": ["added", "deleted", "modified"]
12865+
}
12866+
},
12867+
"required": ["file", "additions", "deletions", "status"],
12868+
"additionalProperties": false
12869+
},
1266812870
"VcsFileDiff": {
1266912871
"type": "object",
1267012872
"properties": {
@@ -12690,6 +12892,31 @@
1269012892
"required": ["file", "patch", "additions", "deletions"],
1269112893
"additionalProperties": false
1269212894
},
12895+
"VcsApplyError": {
12896+
"type": "object",
12897+
"properties": {
12898+
"name": {
12899+
"type": "string",
12900+
"enum": ["VcsApplyError"]
12901+
},
12902+
"data": {
12903+
"type": "object",
12904+
"properties": {
12905+
"message": {
12906+
"type": "string"
12907+
},
12908+
"reason": {
12909+
"type": "string",
12910+
"enum": ["non-git", "not-clean"]
12911+
}
12912+
},
12913+
"required": ["message", "reason"],
12914+
"additionalProperties": false
12915+
}
12916+
},
12917+
"required": ["name", "data"],
12918+
"additionalProperties": false
12919+
},
1269312920
"Command": {
1269412921
"type": "object",
1269512922
"properties": {
@@ -13431,6 +13658,27 @@
1343113658
"required": ["id", "type", "name", "branch", "directory", "extra", "projectID"],
1343213659
"additionalProperties": false
1343313660
},
13661+
"WorkspaceWarpError": {
13662+
"type": "object",
13663+
"properties": {
13664+
"name": {
13665+
"type": "string",
13666+
"enum": ["WorkspaceWarpError"]
13667+
},
13668+
"data": {
13669+
"type": "object",
13670+
"properties": {
13671+
"message": {
13672+
"type": "string"
13673+
}
13674+
},
13675+
"required": ["message"],
13676+
"additionalProperties": false
13677+
}
13678+
},
13679+
"required": ["name", "data"],
13680+
"additionalProperties": false
13681+
},
1343413682
"SyncEventMessageUpdated": {
1343513683
"type": "object",
1343613684
"properties": {

0 commit comments

Comments
 (0)