@khalilgharbaoui/opencode-claude-code-plugin 0.27.1 → 0.27.2
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/dist/index.d.ts +6 -64
- package/dist/index.js +772 -732
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -953,67 +953,21 @@ declare class ClaudeCodeLanguageModel implements LanguageModelV3 {
|
|
|
953
953
|
private toFinishReason;
|
|
954
954
|
/**
|
|
955
955
|
* Whether this call only names the session, which gets the synthetic stub
|
|
956
|
-
* rather than a `claude` spawn.
|
|
957
|
-
* tools, and that is the whole test there. opencode 2 sends its tool set
|
|
958
|
-
* along with it (measured on 2.0.11: `scope: "tools"`, agent `title`), so
|
|
959
|
-
* every new V2 session paid for a second `claude` process just to title
|
|
960
|
-
* itself; for a V2 model the request kind, carried as the `title` agent,
|
|
961
|
-
* decides instead.
|
|
956
|
+
* rather than a `claude` spawn. See `isTitleRequest` in title.ts.
|
|
962
957
|
*/
|
|
963
958
|
private isTitleRequest;
|
|
964
959
|
private requestScope;
|
|
965
960
|
/**
|
|
966
961
|
* Build the combined `--mcp-config` list and return both the list and the
|
|
967
|
-
* hash of the bridged opencode MCP block
|
|
968
|
-
*
|
|
969
|
-
* and respawn the underlying claude process.
|
|
970
|
-
*
|
|
971
|
-
* `runtimeStatus` is a snapshot of opencode's `client.mcp.status()`. When
|
|
972
|
-
* provided it overlays opencode's UI-toggled state on top of disk config
|
|
973
|
-
* so `/mcps` toggles propagate without a config file write.
|
|
962
|
+
* hash of the bridged opencode MCP block. See `effectiveMcpConfig` in
|
|
963
|
+
* spawn-planning.ts.
|
|
974
964
|
*/
|
|
975
965
|
private effectiveMcpConfig;
|
|
976
966
|
/** Resolve ProxyToolDef[] for the configured proxyTools names. */
|
|
977
967
|
private resolvedProxyTools;
|
|
978
|
-
/**
|
|
979
|
-
* Resolve ProxyToolDef[] for opencode's MCP-backed tools so they go
|
|
980
|
-
* through the in-process proxy instead of being bridged into Claude CLI's
|
|
981
|
-
* `--mcp-config`. Routing through the proxy keeps a single execution site
|
|
982
|
-
* (opencode), so the call is permission-prompted and rendered as an
|
|
983
|
-
* opencode tool call.
|
|
984
|
-
*
|
|
985
|
-
* Opt-in (`proxyOpencodeMcpTools: true`) and off by default. It used to
|
|
986
|
-
* default to true while finding nothing, because it discovered tools via
|
|
987
|
-
* `client.tool.list()`, which enumerates opencode's `ToolRegistry` and not
|
|
988
|
-
* the MCP tools merged into the model's tool set afterwards. Discovery now
|
|
989
|
-
* reads that merged set, the `tools` array opencode passes `doStream`, so
|
|
990
|
-
* the option does what it says. Turning it on by default at the same time
|
|
991
|
-
* would have silently moved every existing user's MCP traffic off the
|
|
992
|
-
* working direct bridge, so the default went to false instead: today's
|
|
993
|
-
* behaviour is preserved exactly and crossing over is the operator's call.
|
|
994
|
-
*
|
|
995
|
-
* Returns null when the feature is off or nothing matched, which leaves
|
|
996
|
-
* every server on the direct bridge.
|
|
997
|
-
*/
|
|
968
|
+
/** Resolve ProxyToolDef[] for opencode's MCP-backed tools. */
|
|
998
969
|
private resolvedProxyMcpTools;
|
|
999
|
-
/**
|
|
1000
|
-
* Live tool info derived from a single `client.tool.list()` fetch:
|
|
1001
|
-
*
|
|
1002
|
-
* - `taskDescription`: opencode's `task` tool description exactly as the
|
|
1003
|
-
* registry renders it for native models, including the "Available
|
|
1004
|
-
* agent types" list. Overlaid onto the static `task` proxy def so
|
|
1005
|
-
* Claude sees the same subagent catalog native models see, instead
|
|
1006
|
-
* of hunting through config files.
|
|
1007
|
-
* - `questionDescription` / `hasQuestion`: opencode's `question` tool
|
|
1008
|
-
* description and whether the registry has the entry at all. Older
|
|
1009
|
-
* builds lack it, in which case a `mcp__opencode_proxy__question`
|
|
1010
|
-
* call resolves to `⚙ invalid`; the version gate drops the def.
|
|
1011
|
-
*
|
|
1012
|
-
* Returns undefined/false when the SDK client is unavailable (direct
|
|
1013
|
-
* AI-SDK use, tests) so the static defs stand. `resolved` distinguishes
|
|
1014
|
-
* "the registry answered and has no `question` entry" from "nobody
|
|
1015
|
-
* answered": only the former is a real version-gate signal.
|
|
1016
|
-
*/
|
|
970
|
+
/** One `client.tool.list()` fetch, shaped for this turn's gates. */
|
|
1017
971
|
private fetchLiveToolInfo;
|
|
1018
972
|
/**
|
|
1019
973
|
* Whether dcp-style context reminders should be stripped from this turn's
|
|
@@ -1024,8 +978,7 @@ declare class ClaudeCodeLanguageModel implements LanguageModelV3 {
|
|
|
1024
978
|
/**
|
|
1025
979
|
* Arguments the skill bridge needs beyond `cwd` / `cliPath`: which
|
|
1026
980
|
* `CLAUDE_CONFIG_DIR` this spawn reads its native skills from, and whether
|
|
1027
|
-
* to drop the ones it already loads.
|
|
1028
|
-
* account, and therefore to that account's config dir.
|
|
981
|
+
* to drop the ones it already loads.
|
|
1029
982
|
*/
|
|
1030
983
|
private skillBridgeSpawn;
|
|
1031
984
|
/** Share one lazy registry request within a turn without making it stale. */
|
|
@@ -1042,17 +995,6 @@ declare class ClaudeCodeLanguageModel implements LanguageModelV3 {
|
|
|
1042
995
|
* The process lifecycle owns the server lifecycle via session-manager.
|
|
1043
996
|
*/
|
|
1044
997
|
private ensureProxyServer;
|
|
1045
|
-
private extractPendingProxyResult;
|
|
1046
|
-
/**
|
|
1047
|
-
* The result opencode produced for a pending proxy call, if the prompt
|
|
1048
|
-
* carries it. For `task_batch` that means every child's result gathered
|
|
1049
|
-
* back onto the parent: opencode runs the children in one step and hands
|
|
1050
|
-
* all their results to the next call together, so a partial set is not
|
|
1051
|
-
* expected. If it ever happens the batch still resolves, with the gap
|
|
1052
|
-
* named in the text, because leaving the parent pending would send this
|
|
1053
|
-
* turn down the fresh-envelope path and reject the call as orphaned.
|
|
1054
|
-
*/
|
|
1055
|
-
private extractPendingProxyResultForCall;
|
|
1056
998
|
/**
|
|
1057
999
|
* Resolve the session affinity token for this LLM call. Delegates to the
|
|
1058
1000
|
* exported `resolveSessionAffinity` helper so the logic is unit-testable.
|