Skip to content
Merged
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
2 changes: 1 addition & 1 deletion pkgs/mcpx/docs/compare/matrix-code-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ https://developers.cloudflare.com/dynamic-workers/examples/codemode/, **blog** =
| B7 | answer without `console.log` | — | stdout only for snippets (`internal/execsvc/execsvc.go:607-625`) | — | last expression is the result (`v2:packages/codemode/README.md:20`) | auto-returns the last expression (dwex "`createCodeTool`") |
| B8 | discovery ergonomics | — | catalogue on request; search without paging (`internal/codegen/emit.go:1121`) | catalogue in the tool description automatically; paged search (`v1:packages/opencode/src/tool/registry.ts:283-289`; `v1:packages/codemode/README.md:206`) | catalogue in instructions, deltas, pinned tools (`v2:packages/core/src/codemode/catalog.ts:79-84`) | search also finds vetted snippets (how "Platform SDK") |
| B9 | tool names | `mcp_` prefix keeps namespaces clear of reserved words (`.lootbox/src/lib/type_system/client_generator.ts:654`) | no reserved-word, prelude or collision checks (`internal/codegen/ts.go:397-418`; `internal/config/config.go:407-416`) | real names, bracket notation, no collisions (`v1:packages/opencode/src/mcp/catalog.ts:117`) | same (`v2:packages/codemode/README.md:77-78`) | reserved words suffixed, collisions throw, namespaces validated (mcp, step 2; api "DynamicWorkerExecutor") |
| B10 | harness integration | — | plugin `mcpx_exec`: no abort, session, cwd or live status; reads a missing field (`plugin/opencode/mcpx/daemon.ts:452-455`; `plugin/opencode/mcpx-session.ts:621-623`) | permission check and hooks per child call, live status, cancel (`v1:packages/opencode/src/tool/code-mode.ts:141-147`, `:216-217`, `:262-274`) | same, plus the session id on every child call (`v2:packages/core/src/tool/mcp.ts:51-69`) | approval per connector method (how "Approvals through abort and replay") |
| B10 | harness integration | — | plugin `mcpx_exec`: no abort, session, cwd or live status; reads a missing field (`plugin/core/daemon.ts:452-455`; `plugin/opencode/mcpx-session.ts:621-623`) | permission check and hooks per child call, live status, cancel (`v1:packages/opencode/src/tool/code-mode.ts:141-147`, `:216-217`, `:262-274`) | same, plus the session id on every child call (`v2:packages/core/src/tool/mcp.ts:51-69`) | approval per connector method (how "Approvals through abort and replay") |
| B11 | long upstream calls | — | fixed 120 s, no progress token (`internal/defaults/defaults.json:6`; `internal/mcpclient/client.go:438`) | progress token resets the timeout (`v1:packages/opencode/src/tool/code-mode.ts:154-158`) | 12 h call timeout (`v2:packages/core/src/mcp/client.ts:34`) | — |
| B12 | questions from upstream servers | — | broker and policy; no script hook (`internal/daemon/server.go:422-424`; `docs/protocol.md:379`) | — | UI form, form and URL modes (`v2:packages/core/src/mcp/client.ts:143`) | agent handlers on both paths (client "Elicitation") |
| B13 | images for a vision model | — | artifacts by reference; model needs `resources/read` (`docs/exec.md:259-275`) | attached to the model as files (`v1:packages/opencode/src/tool/code-mode.ts:89-100`) | same (`v2:packages/core/src/codemode/tool.ts:139-147`) | — |
Expand Down
2 changes: 1 addition & 1 deletion pkgs/mcpx/docs/compare/register/content-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
a `resources/read`.
- **Effort.** S.
- **Risk.** Med: the plugin's `mcpx_exec` never declares `artifacts`, so its images are not intercepted and must be
printed as base64 to be seen (inferred from `plugin/opencode/mcpx/daemon.ts:452-455`).
printed as base64 to be seen (inferred from `plugin/core/daemon.ts:452-455`).
- **Detail.** Artifacts are served by a random 128-bit id, not the content hash, because a hash is guessable
(`docs/exec.md:200-207`).
- **Sources.** `v1:packages/opencode/src/tool/code-mode.ts:89-100`; `v2:packages/core/src/codemode/tool.ts:139-147`; `docs/exec.md:259-275`
Expand Down
22 changes: 11 additions & 11 deletions pkgs/mcpx/docs/compare/register/plugin-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
process (v1 the server Worker, v2 the daemon).
- **Where.** opencode v1 and v2.
- **mcpx @ 05c78b2.** The plugin reaches the daemon socket with Bun's `fetch(url, {unix})`; its own comment notes that
Node's fetch ignores the option (`plugin/opencode/mcpx/daemon.ts:348-351`).
Node's fetch ignores the option (`plugin/core/daemon.ts:348-351`).
- **Value to mcpx.** + low: holds for the nix build installed here.
- **Effort.** S.
- **Risk.** Low: a Node build of v2 would break unix-socket fetch.
Expand Down Expand Up @@ -224,15 +224,15 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
`create.before` hook).
- **Where.** opencode v1 only.
- **mcpx @ 05c78b2.** Already independent of `$`: it spawns with `node:child_process` `execFile`
(`plugin/opencode/mcpx/daemon.ts:41`) and talks to the daemon over the unix socket
(`plugin/opencode/mcpx/daemon.ts:352`).
(`plugin/core/daemon.ts:41`) and talks to the daemon over the unix socket
(`plugin/core/daemon.ts:352`).
- **Value to mcpx.** + low: nothing to port.
- **Effort.** S.
- **Risk.** Low.
- **Detail.** `docs/opencode-plugin.md:103` says mcpx's plugin "uses `$` for exactly two things"; the source at 05c78b2
uses `execFile` and the socket, and does not destructure `$`. `import("node:child_process")` still works in v2 because
plugins are imported unsandboxed.
- **Sources.** `v1:packages/plugin/src/index.ts:65` "$: BunShell"; `v2:packages/plugin/src/promise/shell.ts:12` "readonly \"create.before\": ShellCreateBefore"; `plugin/opencode/mcpx/daemon.ts:41`; `docs/opencode-plugin.md:103`
- **Sources.** `v1:packages/plugin/src/index.ts:65` "$: BunShell"; `v2:packages/plugin/src/promise/shell.ts:12` "readonly \"create.before\": ShellCreateBefore"; `plugin/core/daemon.ts:41`; `docs/opencode-plugin.md:103`

## PLG-13 `shell.env` hook vs `shell.hook("create.before")` without session

Expand Down Expand Up @@ -604,7 +604,7 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
- **Where.** opencode v1 and v2. mcpx's daemon has an event stream and `/v1/exec` can stream frames, but the plugin does
not use them; lootbox has nothing.
- **mcpx @ 05c78b2.** The plugin's `mcpx_exec` makes one blocking POST and publishes nothing; its `execute(args)` does
not even take the tool context (`plugin/opencode/mcpx-session.ts:615-625`; `plugin/opencode/mcpx/daemon.ts:451-455`).
not even take the tool context (`plugin/opencode/mcpx-session.ts:615-625`; `plugin/core/daemon.ts:451-455`).
- **Value to mcpx.** + med: a user watching a two-minute browser script sees nothing until it ends.
- **Effort.** S — read `/v1/exec` with `output: "stream"` and map log and emit frames to metadata.
- **Risk.** Low.
Expand All @@ -619,13 +619,13 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
- **Where.** opencode v1 and v2. mcpx CLI: a killed CLI process kills its local script's process group. lootbox: the
CLI's WebSocket closes but the daemon's `deno` keeps running. Cloudflare: unverified.
- **mcpx @ 05c78b2.** `postRaw` takes only an optional timeout, and `exec()` passes neither timeout nor signal
(`plugin/opencode/mcpx/daemon.ts:380-386`, `:452-455`). The daemon would cancel on client disconnect
(`plugin/core/daemon.ts:380-386`, `:452-455`). The daemon would cancel on client disconnect
(`internal/daemon/routes_exec.go:252`), but the plugin never disconnects.
- **Value to mcpx.** + med: Esc on a runaway browser script should stop it.
- **Effort.** S — pass the tool context's abort signal to `fetch`.
- **Risk.** Med: runaway scripts keep holding pooled browsers.
- **Detail.** The progress-cancellation area records how an HTTP disconnect propagates to the upstream call.
- **Sources.** `v1:packages/opencode/src/tool/code-mode.ts:262-274`; `v1:packages/opencode/src/tool/code-mode.ts:155` "signal: input.ctx.abort,"; `plugin/opencode/mcpx/daemon.ts:380-386`; `internal/daemon/routes_exec.go:252`
- **Sources.** `v1:packages/opencode/src/tool/code-mode.ts:262-274`; `v1:packages/opencode/src/tool/code-mode.ts:155` "signal: input.ctx.abort,"; `plugin/core/daemon.ts:380-386`; `internal/daemon/routes_exec.go:252`

## PLG-39 Harness session and working directory reach the script

Expand All @@ -635,15 +635,15 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
directory.
- **Where.** opencode v2; mcpx bash path yes, plugin tool path no.
- **mcpx @ 05c78b2.** `exec()` sends only `{source, options: {output: "structured"}}`
(`plugin/opencode/mcpx/daemon.ts:452-455`); with `options.session` empty the service falls back to `"exec-"+runID`
(`plugin/core/daemon.ts:452-455`); with `options.session` empty the service falls back to `"exec-"+runID`
(`internal/execsvc/execsvc.go:382`).
- **Value to mcpx.** + high: with the session, a browser persists across `mcpx_exec` calls in one opencode session, which
`AGENTS.md:87-89` promises; with `cwd`, `repo` and `cwd` scopes resolve to the right repository.
- **Effort.** S — pass `ctx.sessionID` and `ctx.directory` as `options.session` and `options.cwd`.
- **Risk.** High: repo-scoped servers resolve against the daemon's directory, and session-scoped browsers are recreated
on every call and linger (process-model area).
- **Detail.** `call()` in the same class already accepts a session (`plugin/opencode/mcpx/daemon.ts:462-467`).
- **Sources.** `plugin/opencode/mcpx/daemon.ts:452-455`; `internal/execsvc/execsvc.go:382` "session := firstNonEmpty(opts.Session, ropts.Env[\"MCPX_SESSION\"], \"exec-\"+runID)"; `plugin/opencode/mcpx-session.ts:664-670`; `v2:packages/core/src/tool/mcp.ts:69` "sessionID: context.sessionID,"
- **Detail.** `call()` in the same class already accepts a session (`plugin/core/daemon.ts:462-467`).
- **Sources.** `plugin/core/daemon.ts:452-455`; `internal/execsvc/execsvc.go:382` "session := firstNonEmpty(opts.Session, ropts.Env[\"MCPX_SESSION\"], \"exec-\"+runID)"; `plugin/opencode/mcpx-session.ts:664-670`; `v2:packages/core/src/tool/mcp.ts:69` "sessionID: context.sessionID,"

## PLG-40 Plugin `mcpx_exec` reads a field the daemon never returns

Expand All @@ -652,7 +652,7 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m
the entire envelope instead of the script's stdout.
- **Where.** mcpx plugin only. opencode's own `execute` returns the value, then warnings, then logs.
- **mcpx @ 05c78b2.** `plugin/opencode/mcpx-session.ts:619-623`; `Result` fields at `internal/execsvc/execsvc.go:201-213`.
The client type even declares `output?: string` (`plugin/opencode/mcpx/daemon.ts:451`).
The client type even declares `output?: string` (`plugin/core/daemon.ts:451`).
- **Value to mcpx.** + med: the model should see stdout, then error, then compact logs, not `runId`, `emits: []`,
`artifacts: []` and `durationMs` on every call.
- **Effort.** S — use `out.stdout` (or `out.error`).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ they must, since an enforced row without its case fails test 2.
The unix socket stays as it is. Then "file permissions are the access
control" is true of both listeners. The fix is in
`internal/daemon/server.go` and the clients that read the record
(`internal/cli/client.go`, `plugin/opencode/mcpx/daemon.ts`,
(`internal/cli/client.go`, `plugin/core/daemon.ts`,
`docs/plugin-discovery.md`).
- **`script.permissions`**: a profile other than `all` on a runtime with no
permission model is refused before anything runs, naming the runtime and the
Expand Down
Loading