@khalilgharbaoui/opencode-claude-code-plugin 0.4.21 → 0.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +32 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -213,8 +213,11 @@ By default, when Claude Code's CLI uses `Bash`, `Edit`, `Write`, etc., it execut
|
|
|
213
213
|
| `"Edit"` | `Edit`, `MultiEdit` | `mcp__opencode_proxy__edit` |
|
|
214
214
|
| `"Write"` | `Write` | `mcp__opencode_proxy__write` |
|
|
215
215
|
| `"WebFetch"` | `WebFetch` | `mcp__opencode_proxy__webfetch` |
|
|
216
|
+
| `"Task"` | `Agent` | `mcp__opencode_proxy__task` |
|
|
216
217
|
|
|
217
|
-
|
|
218
|
+
The `Task` proxy is the way to let Claude orchestrate opencode's configured subagents (`build`, `general`, custom subagents defined in `opencode.json`) instead of Claude CLI's internal-only general-purpose / Explore / Plan options. With `"Task"` in `proxyTools` and `permission.task: allow` granted to the calling agent, a Claude session can invoke `task(subagent_type="build", prompt="...")` and the subagent runs natively under opencode (with its own permission UI, lifecycle, model assignment, and Tab visibility). Without `"Task"`, Claude's built-in `Agent` tool stays enabled and Claude orchestrates subagents internally with no opencode visibility.
|
|
219
|
+
|
|
220
|
+
Only those five values are actually proxied; anything else you put in `proxyTools` is ignored. Proxying `Edit` also disables `MultiEdit` — opencode has no batched-edit equivalent, so Claude is forced to fan out into single `Edit` calls that each flow through the permission UI.
|
|
218
221
|
|
|
219
222
|
To turn off proxying entirely:
|
|
220
223
|
|
package/dist/index.d.ts
CHANGED
|
@@ -229,7 +229,15 @@ interface ClaudeCodeProviderSettings {
|
|
|
229
229
|
* opencode's tool executor (with its native permission UI) and returns
|
|
230
230
|
* the result.
|
|
231
231
|
*
|
|
232
|
-
* Supported: `bash`, `write`, `edit`, `webfetch`. Leave empty or unset to disable proxying.
|
|
232
|
+
* Supported: `bash`, `write`, `edit`, `webfetch`, `task`. Leave empty or unset to disable proxying.
|
|
233
|
+
*
|
|
234
|
+
* `task` proxies Claude CLI's `Agent` (subagent dispatch) tool through
|
|
235
|
+
* opencode's `task` tool, so subagent calls run under opencode's
|
|
236
|
+
* configured subagent set (build/general/custom) with opencode's
|
|
237
|
+
* permission and lifecycle handling, instead of Claude CLI's
|
|
238
|
+
* internal-only general-purpose / Explore / Plan options. The calling
|
|
239
|
+
* agent must have `permission.task: allow` for the target subagent
|
|
240
|
+
* (see opencode's agent docs).
|
|
233
241
|
*/
|
|
234
242
|
proxyTools?: string[];
|
|
235
243
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1406,6 +1406,36 @@ var DEFAULT_PROXY_TOOLS = [
|
|
|
1406
1406
|
},
|
|
1407
1407
|
required: ["url"]
|
|
1408
1408
|
}
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
name: "task",
|
|
1412
|
+
description: "Launch an opencode subagent to handle a complex multi-step task autonomously. Routed through opencode's task tool so subagent orchestration, permission, and lifecycle are handled by opencode. Use `subagent_type` to pick which configured subagent runs (e.g. `build`, `general`, `explore`, or any custom subagent declared in opencode.json). The call blocks until the subagent finishes; the 10-minute proxy timeout applies.",
|
|
1413
|
+
inputSchema: {
|
|
1414
|
+
type: "object",
|
|
1415
|
+
properties: {
|
|
1416
|
+
description: {
|
|
1417
|
+
type: "string",
|
|
1418
|
+
description: "A short (3-5 words) description of the task"
|
|
1419
|
+
},
|
|
1420
|
+
prompt: {
|
|
1421
|
+
type: "string",
|
|
1422
|
+
description: "The task for the agent to perform"
|
|
1423
|
+
},
|
|
1424
|
+
subagent_type: {
|
|
1425
|
+
type: "string",
|
|
1426
|
+
description: "The type of specialized agent to use for this task"
|
|
1427
|
+
},
|
|
1428
|
+
task_id: {
|
|
1429
|
+
type: "string",
|
|
1430
|
+
description: "Set this only if you mean to resume a previous task \u2014 pass the prior task_id to continue the same subagent session instead of creating a fresh one."
|
|
1431
|
+
},
|
|
1432
|
+
command: {
|
|
1433
|
+
type: "string",
|
|
1434
|
+
description: "The command that triggered this task"
|
|
1435
|
+
}
|
|
1436
|
+
},
|
|
1437
|
+
required: ["description", "prompt", "subagent_type"]
|
|
1438
|
+
}
|
|
1409
1439
|
}
|
|
1410
1440
|
];
|
|
1411
1441
|
async function createProxyMcpServer(tools = DEFAULT_PROXY_TOOLS) {
|
|
@@ -1642,7 +1672,8 @@ function disallowedToolFlags(tools) {
|
|
|
1642
1672
|
edit: ["Edit", "MultiEdit"],
|
|
1643
1673
|
glob: ["Glob"],
|
|
1644
1674
|
grep: ["Grep"],
|
|
1645
|
-
webfetch: ["WebFetch"]
|
|
1675
|
+
webfetch: ["WebFetch"],
|
|
1676
|
+
task: ["Agent"]
|
|
1646
1677
|
};
|
|
1647
1678
|
const out = [];
|
|
1648
1679
|
const seen = /* @__PURE__ */ new Set();
|