mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-24 19:24:22 +01:00
Makes it easier for developers to get started by providing a single function that creates both server and client, removing the need to manually coordinate separate server and client creation
22 lines
453 B
TypeScript
22 lines
453 B
TypeScript
export * from "./client.js"
|
|
export * from "./server.js"
|
|
|
|
import { createOpencodeClient } from "./client.js"
|
|
import { createOpencodeServer } from "./server.js"
|
|
import type { ServerOptions } from "./server.js"
|
|
|
|
export async function createOpencode(options?: ServerOptions) {
|
|
const server = await createOpencodeServer({
|
|
...options,
|
|
})
|
|
|
|
const client = createOpencodeClient({
|
|
baseUrl: server.url,
|
|
})
|
|
|
|
return {
|
|
client,
|
|
server,
|
|
}
|
|
}
|