Split workspace into electron and ui packages

This commit is contained in:
Shantur Rathore
2025-11-17 12:06:58 +00:00
parent aa77ca2931
commit 89bd32814f
137 changed files with 407 additions and 1371 deletions

View File

@@ -0,0 +1,32 @@
import { createOpencodeClient, type OpencodeClient } from "@opencode-ai/sdk/client"
class SDKManager {
private clients = new Map<number, OpencodeClient>()
createClient(port: number): OpencodeClient {
if (this.clients.has(port)) {
return this.clients.get(port)!
}
const client = createOpencodeClient({
baseUrl: `http://localhost:${port}`,
})
this.clients.set(port, client)
return client
}
getClient(port: number): OpencodeClient | null {
return this.clients.get(port) || null
}
destroyClient(port: number): void {
this.clients.delete(port)
}
destroyAll(): void {
this.clients.clear()
}
}
export const sdkManager = new SDKManager()