Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
49f20b6
feat(opencode): add experimental code mode execute tool
rekram1-node Jun 29, 2026
b0aa6bf
feat(opencode): namespace code mode tools by MCP server
rekram1-node Jun 29, 2026
cad83ab
feat(opencode): progressive tool discovery for code mode
rekram1-node Jun 29, 2026
caa5f28
refactor(opencode): simplify code mode namespace listing
rekram1-node Jun 29, 2026
3a6621c
chore(opencode): vendor rune interpreter for code mode
rekram1-node Jun 30, 2026
14527d2
feat(opencode): code mode result+attachments envelope and typed describe
rekram1-node Jun 30, 2026
71ffc73
feat(opencode): run code mode on the vendored rune interpreter
rekram1-node Jun 30, 2026
1448f24
feat(opencode): budgeted tool preview in code mode description
rekram1-node Jun 30, 2026
acc1742
test(opencode): end-to-end code mode test over a real MCP server
rekram1-node Jun 30, 2026
ba12049
feat(opencode): tokenized, ranked tool search in code mode
rekram1-node Jun 30, 2026
a3bfba8
feat(opencode): unify code mode discovery under tools.$rune
rekram1-node Jun 30, 2026
cbcc67b
refactor(opencode): single source of discovery docs, clearer attachme…
rekram1-node Jun 30, 2026
79275e6
fix(opencode): describe attachments as routable values, not opaque
rekram1-node Jun 30, 2026
394c370
docs(opencode): add rune.md (how it works, what's missing)
rekram1-node Jun 30, 2026
55aa8cc
feat(opencode): inline budgeted call signatures in code mode preview
rekram1-node Jun 30, 2026
dc75ea0
feat(opencode): state whether the code mode tool list is complete or …
rekram1-node Jun 30, 2026
bc427b1
feat: live code-mode execute UI in the TUI
rekram1-node Jun 30, 2026
2726a74
fix(tui): normalize execute tool styling
rekram1-node Jun 30, 2026
05b9346
fix(tui): surface execute child call details
rekram1-node Jul 1, 2026
5085a13
feat(opencode): render code-mode types as TypeScript, not JSON Schema
rekram1-node Jul 1, 2026
c16bba8
feat(opencode): JSDoc tags, Result<T> return hints, and opaque attach…
rekram1-node Jul 1, 2026
2d9015c
fix(tui): simplify execute running state
rekram1-node Jul 1, 2026
064c34b
feat(opencode): capture console output and surface it to the model
rekram1-node Jul 1, 2026
cc437b9
fix(opencode): make Rune tolerate idiomatic defensive JavaScript
rekram1-node Jul 1, 2026
e06a099
fix(opencode): let NaN/Infinity flow in Rune, normalize to null at th…
rekram1-node Jul 1, 2026
51ea0ac
feat(codemode): add @opencode-ai/codemode confined execution package
rekram1-node Jul 2, 2026
90b4af6
feat(opencode): rebuild code mode as an MCP adapter over @opencode-ai…
rekram1-node Jul 2, 2026
2a13900
feat(codemode): simplify limits, enrich search, condense instructions
rekram1-node Jul 2, 2026
cafcec4
feat(opencode): run code mode without execution limits
rekram1-node Jul 2, 2026
560fc7f
feat(codemode): expand JS parity and make output truncation opt-in
rekram1-node Jul 3, 2026
27fbf7c
feat(opencode): rely on native tool-output truncation for code mode
rekram1-node Jul 3, 2026
231144f
docs(codemode): fix stale claims, log wiring-review findings
rekram1-node Jul 3, 2026
9a6fdc4
fix(opencode): interrupt code mode execution on cancel
rekram1-node Jul 3, 2026
9be249a
refactor(opencode): align code mode module with session conventions
rekram1-node Jul 3, 2026
8f330de
feat(codemode): render bracket notation for non-identifier tool names
rekram1-node Jul 3, 2026
9431ba3
refactor(opencode): promote code mode to a registry tool service
rekram1-node Jul 3, 2026
3b3c6d6
Merge remote-tracking branch 'origin/dev' into codemode-v2
rekram1-node Jul 3, 2026
fedae57
fix(codemode): quote non-identifier keys in signatures; unify compoun…
rekram1-node Jul 3, 2026
1b7f565
refactor(opencode): share the MCP invocation middle between direct an…
rekram1-node Jul 3, 2026
8ca700f
fix(opencode): isolate the code-mode integration suite from bun modul…
rekram1-node Jul 3, 2026
dca428c
fix(ci): pin node-gyp so native install scripts stop resolving node-g…
rekram1-node Jul 3, 2026
16f3c8e
fix(codemode): align code-mode catalog filtering and schema union ren…
rekram1-node Jul 3, 2026
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
76 changes: 61 additions & 15 deletions bun.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"@typescript/native-preview": "catalog:",
"glob": "13.0.5",
"husky": "9.1.7",
"node-gyp": "12.4.0",
"oxlint": "1.60.0",
"oxlint-tsgolint": "0.21.0",
"prettier": "3.6.2",
Expand Down
15 changes: 15 additions & 0 deletions packages/codemode/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# @opencode-ai/codemode

- This local package owns confined execution over explicit schema-described tools. Applications own authorization, persistence, external authority, and tool-specific delivery semantics.
- Do not add a speculative generic permission or approval policy. A host omits tools it does not expose and enforces domain authorization inside each provided tool.
- Keep Code Mode unaware of host session, channel, and conversation models. The hosting application supplies trusted execution scope around it.
- Tool schemas are the model-facing Interface. Keep arguments minimal and natural to the operation; never add unrelated IDs as ambient capability tokens.

## Future Design Notes

- If a captured user-visible output channel returns (an earlier `output.text`/`output.file`/`output.image` API was removed from v1), keep `output` as its name, distinct from the program return value: `return` stays the structured result for the model, while `output.*` describes artifacts the host may render into a conversation or UI after execution. Keep this host-neutral and let applications decide how captured output is delivered. In v1, hosts collect media host-side (outside the sandbox) instead.
- Improve the sandbox failure taxonomy. Distinguish parse/compile mistakes, unsupported syntax, user-thrown errors, invalid returned data, tool refusal, tool internal failure, timeout, and genuine runtime defects so agents can recover accurately instead of treating everything as a generic execution failure.
- Preserve the public/private error split. Tool authors should be able to return a safe model-visible message while retaining a private cause for host diagnostics. Unknown host failures must remain sanitized by default.
- Think deliberately about richer binary boundaries before allowing `Blob`, `File`, `ArrayBuffer`, streams, or typed arrays beyond today’s JSON-like values. If CodeMode supports binary tool args/results, use explicit tagged data shapes and clear size limits rather than relying on ambient runtime serialization.
- Keep host capabilities explicit. Globals such as `fetch`, `crypto`, filesystem handles, extra modules, or network clients should be opt-in runtime capabilities with obvious policy defaults, not ambient authority. Default to unavailable unless a host deliberately provides the capability.
- If `fetch` is added, model it as a host-provided outbound capability with policy controls: allowed origins, methods, headers, response size, timeout, and whether response bodies may be returned, emitted, or only summarized through a tool.
337 changes: 337 additions & 0 deletions packages/codemode/README.md

Large diffs are not rendered by default.

1,188 changes: 1,188 additions & 0 deletions packages/codemode/codemode.md

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions packages/codemode/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/codemode",
"version": "0.0.1",
"description": "Effect-native confined code execution over schema-described tools",
"private": true,
"type": "module",
"license": "MIT",
"exports": {
".": "./src/index.ts"
},
"scripts": {
"typecheck": "tsgo --noEmit",
"test": "bun test"
},
"dependencies": {
"acorn": "8.15.0",
"effect": "catalog:",
"typescript": "catalog:"
},
"devDependencies": {
"@tsconfig/bun": "catalog:",
"@types/bun": "catalog:",
"@typescript/native-preview": "catalog:"
}
}
Loading
Loading