Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 16 additions & 20 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/app",
"version": "1.1.43",
"version": "1.1.45",
"description": "",
"type": "module",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/console/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/console-app",
"version": "1.1.43",
"version": "1.1.45",
"type": "module",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/console/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/console-core",
"version": "1.1.43",
"version": "1.1.45",
"private": true,
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/console/function/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/console-function",
"version": "1.1.43",
"version": "1.1.45",
"$schema": "https://json.schemastore.org/package.json",
"private": true,
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/console/mail/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/console-mail",
"version": "1.1.43",
"version": "1.1.45",
"dependencies": {
"@jsx-email/all": "2.2.3",
"@jsx-email/cli": "1.4.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@opencode-ai/desktop",
"private": true,
"version": "1.1.43",
"version": "1.1.45",
"type": "module",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/enterprise/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/enterprise",
"version": "1.1.43",
"version": "1.1.45",
"private": true,
"type": "module",
"license": "MIT",
Expand Down
12 changes: 6 additions & 6 deletions packages/extensions/zed/extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id = "opencode"
name = "OpenCode"
description = "The open source coding agent."
version = "1.1.43"
version = "1.1.45"
schema_version = 1
authors = ["Anomaly"]
repository = "https://github.com/anomalyco/opencode"
Expand All @@ -11,26 +11,26 @@ name = "OpenCode"
icon = "./icons/opencode.svg"

[agent_servers.opencode.targets.darwin-aarch64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.43/opencode-darwin-arm64.zip"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.45/opencode-darwin-arm64.zip"
cmd = "./opencode"
args = ["acp"]

[agent_servers.opencode.targets.darwin-x86_64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.43/opencode-darwin-x64.zip"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.45/opencode-darwin-x64.zip"
cmd = "./opencode"
args = ["acp"]

[agent_servers.opencode.targets.linux-aarch64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.43/opencode-linux-arm64.tar.gz"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.45/opencode-linux-arm64.tar.gz"
cmd = "./opencode"
args = ["acp"]

[agent_servers.opencode.targets.linux-x86_64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.43/opencode-linux-x64.tar.gz"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.45/opencode-linux-x64.tar.gz"
cmd = "./opencode"
args = ["acp"]

[agent_servers.opencode.targets.windows-x86_64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.43/opencode-windows-x64.zip"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.1.45/opencode-windows-x64.zip"
cmd = "./opencode.exe"
args = ["acp"]
2 changes: 1 addition & 1 deletion packages/function/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/function",
"version": "1.1.43",
"version": "1.1.45",
"$schema": "https://json.schemastore.org/package.json",
"private": true,
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "1.1.43",
"version": "1.1.45",
"name": "opencode",
"type": "module",
"license": "MIT",
Expand Down
7 changes: 6 additions & 1 deletion packages/opencode/src/config/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export namespace ConfigMarkdown {
export const FILE_REGEX = /(?<![\w`])@(\.?[^\s`,.]*(?:\.[^\s`,.]+)*)/g
export const SHELL_REGEX = /!`([^`]+)`/g

export function substituteEnv(content: string) {
return content.replace(/\{env:([^}]+)\}/g, (_, varName) => process.env[varName] || "")
}

export function files(template: string) {
return Array.from(template.matchAll(FILE_REGEX))
}
Expand Down Expand Up @@ -68,7 +72,8 @@ export namespace ConfigMarkdown {
}

export async function parse(filePath: string) {
const template = await Bun.file(filePath).text()
const raw = await Bun.file(filePath).text()
const template = substituteEnv(raw)

try {
const md = matter(template)
Expand Down
3 changes: 0 additions & 3 deletions packages/opencode/src/session/llm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os from "os"
import { Installation } from "@/installation"
import { Provider } from "@/provider/provider"
import { Log } from "@/util/log"
Expand All @@ -9,7 +8,6 @@ import {
type StreamTextResult,
type Tool,
type ToolSet,
extractReasoningMiddleware,
tool,
jsonSchema,
} from "ai"
Expand Down Expand Up @@ -261,7 +259,6 @@ export namespace LLM {
return args.params
},
},
extractReasoningMiddleware({ tagName: "think", startWithReasoning: false }),
],
}),
experimental_telemetry: {
Expand Down
7 changes: 7 additions & 0 deletions packages/opencode/test/config/fixtures/env-frontmatter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
description: "Token is {env:TEST_MCP_TOKEN}"
note: "{env:EMPTY_ENV_VAR}"
---

Token: {env:TEST_MCP_TOKEN}
Missing: {env:EMPTY_ENV_VAR}
36 changes: 35 additions & 1 deletion packages/opencode/test/config/markdown.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, test, describe } from "bun:test"
import { expect, test, describe, beforeAll, afterAll } from "bun:test"
import { ConfigMarkdown } from "../../src/config/markdown"

describe("ConfigMarkdown: normal template", () => {
Expand Down Expand Up @@ -226,3 +226,37 @@ describe("ConfigMarkdown: frontmatter has weird model id", async () => {
expect(result.content.trim()).toBe("Strictly follow da rules")
})
})

describe("ConfigMarkdown: env substitution", () => {
const tokenKey = "TEST_MCP_TOKEN"
const emptyKey = "EMPTY_ENV_VAR"
const prevToken = process.env[tokenKey]
const prevEmpty = process.env[emptyKey]
let parsed: Awaited<ReturnType<typeof ConfigMarkdown.parse>>

beforeAll(async () => {
process.env[tokenKey] = "abc123"
delete process.env[emptyKey]
parsed = await ConfigMarkdown.parse(import.meta.dir + "/fixtures/env-frontmatter.md")
})

afterAll(() => {
if (prevToken === undefined) delete process.env[tokenKey]
else process.env[tokenKey] = prevToken
if (prevEmpty === undefined) delete process.env[emptyKey]
else process.env[emptyKey] = prevEmpty
})

test("should substitute env vars in frontmatter", () => {
expect(parsed.data.description).toBe("Token is abc123")
})

test("should substitute missing env vars with empty string in frontmatter", () => {
expect(parsed.data.note).toBe("")
})

test("should substitute env vars in content", () => {
expect(parsed.content).toContain("Token: abc123")
expect(parsed.content).toContain("Missing: ")
})
})
2 changes: 1 addition & 1 deletion packages/plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/plugin",
"version": "1.1.43",
"version": "1.1.45",
"type": "module",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/js/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/sdk",
"version": "1.1.43",
"version": "1.1.45",
"type": "module",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/slack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/slack",
"version": "1.1.43",
"version": "1.1.45",
"type": "module",
"license": "MIT",
"scripts": {
Expand Down
Loading
Loading