Compare commits

..

9 Commits

Author SHA1 Message Date
opencode
cc2201b900 release: v0.3.124 2025-08-03 19:38:51 +00:00
Dax Raad
ea85fdf3cd fix bash tool not showing stderr 2025-08-03 15:34:52 -04:00
Aiden Cline
edda26ab33 tweak: filter out duplicate instructions (#1567) 2025-08-03 15:10:21 -04:00
Dax Raad
ea4e1913c0 increase models.dev polling interval to hourly 2025-08-03 14:58:35 -04:00
Aiden Cline
5eebc8ab51 docs: fix mixed up documentation (#1564) 2025-08-03 13:01:09 -05:00
Dax Raad
21c52fd5cb fix bash tool getting stuck on interactive commands 2025-08-03 13:52:50 -04:00
opencode
5e8634afaf release: v0.3.123 2025-08-03 17:13:33 +00:00
Dax Raad
d4bac5cdbd ci: ignore 2025-08-03 13:12:35 -04:00
opencode
263b266476 release: v0.3.122 2025-08-03 16:19:09 +00:00
15 changed files with 80 additions and 56 deletions

View File

@@ -10,7 +10,7 @@
},
"packages/function": {
"name": "@opencode/function",
"version": "0.3.113",
"version": "0.3.123",
"dependencies": {
"@octokit/auth-app": "8.0.1",
"@octokit/rest": "22.0.0",
@@ -25,7 +25,7 @@
},
"packages/opencode": {
"name": "opencode",
"version": "0.3.113",
"version": "0.3.123",
"bin": {
"opencode": "./bin/opencode",
},
@@ -78,7 +78,7 @@
},
"packages/plugin": {
"name": "@opencode-ai/plugin",
"version": "0.3.113",
"version": "0.3.123",
"devDependencies": {
"@hey-api/openapi-ts": "0.80.1",
"@opencode-ai/sdk": "workspace:*",
@@ -88,7 +88,7 @@
},
"packages/sdk/js": {
"name": "@opencode-ai/sdk",
"version": "0.3.113",
"version": "0.3.123",
"devDependencies": {
"@hey-api/openapi-ts": "0.80.1",
"@tsconfig/node22": "catalog:",
@@ -97,7 +97,7 @@
},
"packages/web": {
"name": "@opencode/web",
"version": "0.3.113",
"version": "0.3.123",
"dependencies": {
"@astrojs/cloudflare": "^12.5.4",
"@astrojs/markdown-remark": "6.3.1",

View File

@@ -5,7 +5,7 @@
"type": "module",
"packageManager": "bun@1.2.14",
"scripts": {
"dev": "bun run packages/opencode/src/index.ts",
"dev": "bun run --conditions=development packages/opencode/src/index.ts",
"typecheck": "bun run --filter='*' typecheck",
"stainless": "./scripts/stainless",
"postinstall": "./script/hooks"

View File

@@ -1,6 +1,6 @@
{
"name": "@opencode/function",
"version": "0.3.120",
"version": "0.3.124",
"$schema": "https://json.schemastore.org/package.json",
"private": true,
"type": "module",

View File

@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "0.3.120",
"version": "0.3.124",
"name": "opencode",
"type": "module",
"private": true,

View File

@@ -77,4 +77,4 @@ export namespace ModelsDev {
}
}
setInterval(() => ModelsDev.refresh(), 60 * 1000).unref()
setInterval(() => ModelsDev.refresh(), 60 * 1000 * 60).unref()

View File

@@ -737,7 +737,7 @@ export namespace Session {
)
const result = await item.execute(args, {
sessionID: input.sessionID,
abort: abort.signal,
abort: options.abortSignal!,
messageID: assistantMsg.id,
callID: options.toolCallId,
metadata: async (val) => {
@@ -779,7 +779,7 @@ export namespace Session {
}
for (const [key, item] of Object.entries(await MCP.tools())) {
if (mode.tools[key] === false) continue
if (enabledTools[key] === false) continue
const execute = item.execute
if (!execute) continue
item.execute = async (args, opts) => {

View File

@@ -60,33 +60,28 @@ export namespace SystemPrompt {
export async function custom() {
const { cwd, root } = App.info().path
const config = await Config.get()
const found = []
const paths = new Set<string>()
for (const item of CUSTOM_FILES) {
const matches = await Filesystem.findUp(item, cwd, root)
found.push(...matches.map((x) => Bun.file(x).text()))
matches.forEach((path) => paths.add(path))
}
found.push(
Bun.file(path.join(Global.Path.config, "AGENTS.md"))
.text()
.catch(() => ""),
)
found.push(
Bun.file(path.join(os.homedir(), ".claude", "CLAUDE.md"))
.text()
.catch(() => ""),
)
paths.add(path.join(Global.Path.config, "AGENTS.md"))
paths.add(path.join(os.homedir(), ".claude", "CLAUDE.md"))
if (config.instructions) {
for (const instruction of config.instructions) {
try {
const matches = await Filesystem.globUp(instruction, cwd, root)
found.push(...matches.map((x) => Bun.file(x).text()))
} catch {
continue // Skip invalid glob patterns
}
const matches = await Filesystem.globUp(instruction, cwd, root).catch(() => [])
matches.forEach((path) => paths.add(path))
}
}
const found = Array.from(paths).map((p) =>
Bun.file(p)
.text()
.catch(() => ""),
)
return Promise.all(found).then((result) => result.filter(Boolean))
}

View File

@@ -1,4 +1,6 @@
import { z } from "zod"
import { exec } from "child_process"
import { text } from "stream/consumers"
import { Tool } from "./tool"
import DESCRIPTION from "./bash.txt"
import { App } from "../app/app"
@@ -116,19 +118,25 @@ export const BashTool = Tool.define("bash", {
})
}
const process = Bun.spawn({
cmd: ["bash", "-c", params.command],
const process = exec(params.command, {
cwd: app.path.cwd,
maxBuffer: MAX_OUTPUT_LENGTH,
signal: ctx.abort,
timeout: timeout,
stdin: "pipe",
stdout: "pipe",
stderr: "pipe",
maxBuffer: MAX_OUTPUT_LENGTH,
timeout,
})
await process.exited
const stdout = await new Response(process.stdout).text()
const stderr = await new Response(process.stderr).text()
const stdoutPromise = text(process.stdout!)
const stderrPromise = text(process.stderr!)
await new Promise<void>((resolve) => {
process.on("close", () => {
resolve()
})
})
const stdout = await stdoutPromise
const stderr = await stderrPromise
console.log({ stderr, stdout })
return {
title: params.command,

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/plugin",
"version": "0.3.120",
"version": "0.3.124",
"type": "module",
"scripts": {
"typecheck": "tsc --noEmit"

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/sdk",
"version": "0.3.120",
"version": "0.3.124",
"type": "module",
"scripts": {
"typecheck": "tsc --noEmit"

View File

@@ -6,9 +6,6 @@ process.chdir(dir)
import { $ } from "bun"
import path from "path"
console.log("=== Generating JS SDK ===")
console.log()
import { createClient } from "@hey-api/openapi-ts"
await $`bun dev generate > ${dir}/openapi.json`.cwd(path.resolve(dir, "../../opencode"))

View File

@@ -1,7 +1,7 @@
{
"name": "@opencode/web",
"type": "module",
"version": "0.3.120",
"version": "0.3.124",
"scripts": {
"dev": "astro dev",
"dev:remote": "sst shell --stage=dev --target=Web astro dev",

View File

@@ -236,6 +236,14 @@ The `disabled_providers` option accepts an array of provider IDs. When a provide
- It won't be loaded even if API keys are configured through `opencode auth login`
- The provider's models won't appear in the model selection list
```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"disabled_providers": ["openai", "gemini"]
}
```
---
### Formatters
@@ -245,7 +253,18 @@ You can configure code formatters through the `formatter` option. See [Formatter
```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"disabled_providers": ["openai", "gemini"]
"formatter": {
"prettier": {
"disabled": true
},
"custom-prettier": {
"command": ["npx", "prettier", "--write", "$FILE"],
"environment": {
"NODE_ENV": "development"
},
"extensions": [".js", ".ts", ".jsx", ".tsx"]
}
}
}
```

View File

@@ -2,6 +2,8 @@
import { $ } from "bun"
console.log("=== publishing ===\n")
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
const version = snapshot
? `0.0.0-${new Date().toISOString().slice(0, 16).replace(/[-:T]/g, "")}`
@@ -10,24 +12,29 @@ if (!version) {
throw new Error("OPENCODE_VERSION is required")
}
process.env["OPENCODE_VERSION"] = version
console.log("version:", version)
const pkgjsons = await Array.fromAsync(
new Bun.Glob("**/package.json").scan({
absolute: true,
}),
)
).then((arr) => arr.filter((x) => !x.includes("node_modules") && !x.includes("dist")))
const tree = await $`git add . && git write-tree`.text().then((x) => x.trim())
for await (const file of new Bun.Glob("**/package.json").scan({
absolute: true,
})) {
for (const file of pkgjsons) {
let pkg = await Bun.file(file).text()
pkg = pkg.replaceAll(/"version": "[^"]+"/g, `"version": "${version}"`)
console.log("updated:", file)
await Bun.file(file).write(pkg)
}
await import(`../packages/opencode/script/publish.ts`)
console.log("\n=== opencode ===\n")
// await import(`../packages/opencode/script/publish.ts`)
console.log("\n=== sdk ===\n")
await import(`../packages/sdk/js/script/publish.ts`)
console.log("\n=== plugin ===\n")
await import(`../packages/plugin/script/publish.ts`)
// await import(`../packages/sdk/stainless/generate.ts`)
@@ -43,9 +50,7 @@ if (snapshot) {
await $`git push origin v${version} --no-verify`
await $`git checkout dev`
await $`git branch -D snapshot-${version}`
for await (const file of new Bun.Glob("**/package.json").scan({
absolute: true,
})) {
$`await git checkout ${tree} ${file}`
for (const file of pkgjsons) {
await $`git checkout ${tree} ${file}`
}
}

View File

@@ -2,7 +2,7 @@
"name": "opencode",
"displayName": "opencode",
"description": "opencode for VS Code",
"version": "0.3.120",
"version": "0.3.124",
"publisher": "sst-dev",
"repository": {
"type": "git",