summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop/src/components
diff options
context:
space:
mode:
authorDax <[email protected]>2025-12-07 19:04:14 -0500
committerGitHub <[email protected]>2025-12-07 19:04:14 -0500
commitea7ec60f51f9fe3c6382f644c328188a43545b7b (patch)
tree5204cbc059fe10b87c54ffd25782ad83710bdcdb /packages/desktop/src/components
parent6667856ba5dac3e5dd77c7008cee2d09be894472 (diff)
downloadopencode-ea7ec60f51f9fe3c6382f644c328188a43545b7b.tar.gz
opencode-ea7ec60f51f9fe3c6382f644c328188a43545b7b.zip
v2 SDK (#5216)
Co-authored-by: GitHub Action <[email protected]>
Diffstat (limited to 'packages/desktop/src/components')
-rw-r--r--packages/desktop/src/components/prompt-input.tsx30
-rw-r--r--packages/desktop/src/components/terminal.tsx20
2 files changed, 21 insertions, 29 deletions
diff --git a/packages/desktop/src/components/prompt-input.tsx b/packages/desktop/src/components/prompt-input.tsx
index a311ae763..dd1e00c6f 100644
--- a/packages/desktop/src/components/prompt-input.tsx
+++ b/packages/desktop/src/components/prompt-input.tsx
@@ -235,9 +235,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
const abort = () =>
sdk.client.session.abort({
- path: {
- id: session.id!,
- },
+ sessionID: session.id!,
})
const handleKeyDown = (event: KeyboardEvent) => {
@@ -329,21 +327,19 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
session.prompt.set([{ type: "text", content: "", start: 0, end: 0 }], 0)
sdk.client.session.prompt({
- path: { id: existing.id },
- body: {
- agent: local.agent.current()!.name,
- model: {
- modelID: local.model.current()!.id,
- providerID: local.model.current()!.provider.id,
- },
- parts: [
- {
- type: "text",
- text,
- },
- ...attachmentParts,
- ],
+ sessionID: existing.id,
+ agent: local.agent.current()!.name,
+ model: {
+ modelID: local.model.current()!.id,
+ providerID: local.model.current()!.provider.id,
},
+ parts: [
+ {
+ type: "text",
+ text,
+ },
+ ...attachmentParts,
+ ],
})
}
diff --git a/packages/desktop/src/components/terminal.tsx b/packages/desktop/src/components/terminal.tsx
index b312c3589..15302f152 100644
--- a/packages/desktop/src/components/terminal.tsx
+++ b/packages/desktop/src/components/terminal.tsx
@@ -74,12 +74,10 @@ export const Terminal = (props: TerminalProps) => {
term.onResize(async (size) => {
if (ws && ws.readyState === WebSocket.OPEN) {
await sdk.client.pty.update({
- path: { id: local.pty.id },
- body: {
- size: {
- cols: size.cols,
- rows: size.rows,
- },
+ ptyID: local.pty.id,
+ size: {
+ cols: size.cols,
+ rows: size.rows,
},
})
}
@@ -100,12 +98,10 @@ export const Terminal = (props: TerminalProps) => {
ws.addEventListener("open", () => {
console.log("WebSocket connected")
sdk.client.pty.update({
- path: { id: local.pty.id },
- body: {
- size: {
- cols: term.cols,
- rows: term.rows,
- },
+ ptyID: local.pty.id,
+ size: {
+ cols: term.cols,
+ rows: term.rows,
},
})
})