diff options
| author | Dax Raad <[email protected]> | 2025-10-05 07:00:29 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-10-05 07:00:29 -0400 |
| commit | f3c2d1b6c23f50aae9e60a61f283ac9eaf5bccb6 (patch) | |
| tree | 3ebcd281c51be0a6e214c69ac762e1183caf3439 /script/publish.ts | |
| parent | 71a7e8ef3668a94325ba5d641b84051d7cfe5163 (diff) | |
| download | opencode-f3c2d1b6c23f50aae9e60a61f283ac9eaf5bccb6.tar.gz opencode-f3c2d1b6c23f50aae9e60a61f283ac9eaf5bccb6.zip | |
sdk: simplify getting started with single createOpencode function
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
Diffstat (limited to 'script/publish.ts')
| -rwxr-xr-x | script/publish.ts | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/script/publish.ts b/script/publish.ts index 142981171..6d162d66f 100755 --- a/script/publish.ts +++ b/script/publish.ts @@ -1,12 +1,12 @@ #!/usr/bin/env bun import { $ } from "bun" -import { createOpencodeClient, createOpencodeServer } from "@opencode-ai/sdk" +import { createOpencode } from "@opencode-ai/sdk" if (process.versions.bun !== "1.2.21") { throw new Error("This script requires [email protected]") } -let notes = [] +const notes = [] as string[] console.log("=== publishing ===\n") @@ -35,11 +35,10 @@ if (!snapshot) { }) .then((data) => data.tag_name) - const server = await createOpencodeServer() - const client = createOpencodeClient({ baseUrl: server.url }) - const session = await client.session.create() + const opencode = await createOpencode() + const session = await opencode.client.session.create() console.log("generating changelog since " + previous) - const raw = await client.session + const raw = await opencode.client.session .prompt({ path: { id: session.data!.id, @@ -85,7 +84,7 @@ if (!snapshot) { } } console.log(notes) - server.close() + opencode.server.close() } const pkgjsons = await Array.fromAsync( |
