@@ -5,7 +5,7 @@ import { useSync } from "./sync"
55import { makePersisted } from "@solid-primitives/storage"
66import { TextSelection } from "./local"
77import { pipe , sumBy } from "remeda"
8- import { AssistantMessage , UserMessage } from "@opencode-ai/sdk"
8+ import { AssistantMessage , UserMessage } from "@opencode-ai/sdk/v2 "
99import { useParams } from "@solidjs/router"
1010import { base64Encode } from "@/utils"
1111import { useSDK } from "./sdk"
@@ -198,7 +198,7 @@ export const { use: useSession, provider: SessionProvider } = createSimpleContex
198198 all : createMemo ( ( ) => Object . values ( store . terminals . all ) ) ,
199199 active : createMemo ( ( ) => store . terminals . active ) ,
200200 new ( ) {
201- sdk . client . pty . create ( { body : { title : `Terminal ${ store . terminals . all . length + 1 } ` } } ) . then ( ( pty ) => {
201+ sdk . client . pty . create ( { title : `Terminal ${ store . terminals . all . length + 1 } ` } ) . then ( ( pty ) => {
202202 const id = pty . data ?. id
203203 if ( ! id ) return
204204 setStore ( "terminals" , "all" , [
@@ -214,18 +214,17 @@ export const { use: useSession, provider: SessionProvider } = createSimpleContex
214214 update ( pty : Partial < LocalPTY > & { id : string } ) {
215215 setStore ( "terminals" , "all" , ( x ) => x . map ( ( x ) => ( x . id === pty . id ? { ...x , ...pty } : x ) ) )
216216 sdk . client . pty . update ( {
217- path : { id : pty . id } ,
218- body : { title : pty . title , size : pty . cols && pty . rows ? { rows : pty . rows , cols : pty . cols } : undefined } ,
217+ ptyID : pty . id ,
218+ title : pty . title ,
219+ size : pty . cols && pty . rows ? { rows : pty . rows , cols : pty . cols } : undefined ,
219220 } )
220221 } ,
221222 async clone ( id : string ) {
222223 const index = store . terminals . all . findIndex ( ( x ) => x . id === id )
223224 const pty = store . terminals . all [ index ]
224225 if ( ! pty ) return
225226 const clone = await sdk . client . pty . create ( {
226- body : {
227- title : pty . title ,
228- } ,
227+ title : pty . title ,
229228 } )
230229 if ( ! clone . data ) return
231230 setStore ( "terminals" , "all" , index , {
@@ -252,7 +251,7 @@ export const { use: useSession, provider: SessionProvider } = createSimpleContex
252251 setStore ( "terminals" , "active" , previous )
253252 }
254253 } )
255- await sdk . client . pty . remove ( { path : { id } } )
254+ await sdk . client . pty . remove ( { ptyID : id } )
256255 } ,
257256 move ( id : string , to : number ) {
258257 const index = store . terminals . all . findIndex ( ( f ) => f . id === id )
0 commit comments