The open source coding agent.
TypeScript
ci
Dax Raadd58661d4fb4b
diff --git a/bun.lock b/bun.lockindex 14d9565b280..99d35168f30 100644--- a/bun.lock+++ b/bun.lock@@ -18,7 +18,9 @@"prettier": "3.6.2","semver": "^7.6.0","sst": "3.17.23",+ "stackback": "0.0.2","turbo": "2.5.6",+ "why-is-node-running": "2.2.2",},},"packages/app": {@@ -3899,7 +3901,7 @@"which-typed-array": ["[email protected]", "", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.4", "for-each": "^0.3.5", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" } }, "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg=="],- "why-is-node-running": ["[email protected]", "", { "bin": { "why-is-node-running": "cli.js" } }, "sha512-NKUzAelcoCXhXL4dJzKIwXeR8iEVqsA0Lq6Vnd0UXvgaKbzVo4ZTHROF2Jidrv+SgxOQ03fMinnNhzZATxOD3A=="],+ "why-is-node-running": ["[email protected]", "", { "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": { "why-is-node-running": "cli.js" } }, "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA=="],"widest-line": ["[email protected]", "", { "dependencies": { "string-width": "^7.0.0" } }, "sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA=="],@@ -4387,6 +4389,8 @@"opencode/@ai-sdk/openai-compatible": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-thubwhRtv9uicAxSWwNpinM7hiL/0CkhL/ymPaHuKvI494J7HIzn8KQZQ2ymRz284WTIZnI7VMyyejxW4RMM6w=="],+ "opencode/why-is-node-running": ["[email protected]", "", { "bin": { "why-is-node-running": "cli.js" } }, "sha512-NKUzAelcoCXhXL4dJzKIwXeR8iEVqsA0Lq6Vnd0UXvgaKbzVo4ZTHROF2Jidrv+SgxOQ03fMinnNhzZATxOD3A=="],+"opencontrol/@modelcontextprotocol/sdk": ["@modelcontextprotocol/[email protected]", "", { "dependencies": { "content-type": "^1.0.5", "cors": "^2.8.5", "eventsource": "^3.0.2", "express": "^5.0.1", "express-rate-limit": "^7.5.0", "pkce-challenge": "^4.1.0", "raw-body": "^3.0.0", "zod": "^3.23.8", "zod-to-json-schema": "^3.24.1" } }, "sha512-oxzMzYCkZHMntzuyerehK3fV6A2Kwh5BD6CGEJSVDU2QNEhfLOptf2X7esQgaHZXHZY0oHmMsOtIDLP71UJXgA=="],"opencontrol/@tsconfig/bun": ["@tsconfig/[email protected]", "", {}, "sha512-udGrGJBNQdXGVulehc1aWT73wkR9wdaGBtB6yL70RJsqwW/yJhIg6ZbRlPOfIUiFNrnBuYLBi9CSmMKfDC7dvA=="],diff --git a/script/changelog.ts b/script/changelog.tsindex 0c8d65ba18e..0043cd3d626 100755--- a/script/changelog.ts+++ b/script/changelog.ts@@ -1,7 +1,7 @@#!/usr/bin/env bunimport { $ } from "bun"-import { createOpencode } from "@opencode-ai/sdk"+import { createOpencode } from "@opencode-ai/sdk/v2"import { parseArgs } from "util"export const team = [@@ -153,9 +153,9 @@ async function summarizeCommit(opencode: Awaited<ReturnType<typeof createOpencodconsole.log("summarizing commit:", message)const session = await opencode.client.session.create()const result = await opencode.client.session- .prompt({- path: { id: session.data!.id },- body: {+ .prompt(+ {+ sessionID: session.data!.id,model: { providerID: "opencode", modelID: "claude-sonnet-4-5" },tools: {"*": false,@@ -169,8 +169,10 @@ Commit: ${message}`,},],},- signal: AbortSignal.timeout(120_000),- })+ {+ signal: AbortSignal.timeout(120_000),+ },+ ).then((x) => x.data?.parts?.find((y) => y.type === "text")?.text ?? message)return result.trim()}@@ -238,7 +240,7 @@ export async function buildNotes(from: string, to: string) {console.log("generating changelog since " + from)- const opencode = await createOpencode({ port: 5044 })+ const opencode = await createOpencode({ port: 0 })const notes: string[] = []try {@@ -258,8 +260,9 @@ export async function buildNotes(from: string, to: string) {throw error}} finally {- opencode.server.close()+ await opencode.server.close()}+ console.log("changelog generation complete")const contributors = await getContributors(from, to)diff --git a/script/version.ts b/script/version.tsindex 2c158d22228..1b7eac5d918 100755--- a/script/version.ts+++ b/script/version.ts@@ -7,12 +7,14 @@ import { buildNotes, getLatestRelease } from "./changelog"const output = [`version=${Script.version}`]if (!Script.preview) {- await $`gh release create v${Script.version} -d --title "v${Script.version}" ${Script.preview ? "--prerelease" : ""}`- const release = await $`gh release view v${Script.version} --json id,tagName`.json()- const previous = await getLatestRelease(Script.version)+ const previous = await getLatestRelease()const notes = await buildNotes(previous, "HEAD")const body = notes.join("\n") || "No notable changes"- await $`gh release edit v${Script.version} --title "v${Script.version}" --notes ${body}`+ const dir = process.env.RUNNER_TEMP ?? "/tmp"+ const file = `${dir}/opencode-release-notes.txt`+ await Bun.write(file, body)+ await $`gh release create v${Script.version} -d --title "v${Script.version}" --notes-file ${file}`+ const release = await $`gh release view v${Script.version} --json id,tagName`.json()output.push(`release=${release.id}`)output.push(`tag=${release.tagName}`)}@@ -20,3 +22,5 @@ if (!Script.preview) {if (process.env.GITHUB_OUTPUT) {await Bun.write(process.env.GITHUB_OUTPUT, output.join("\n"))}++process.exit(0)