@khalilgharbaoui/opencode-claude-code-plugin 0.29.0 → 0.29.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/README.md CHANGED
@@ -401,9 +401,8 @@ never moves a turn onto a model nobody picked.
401
401
 
402
402
  Not applied to compaction turns (a second model would rewrite the summary
403
403
  opencode stores), to title stubs, or to the
404
- [interactive transport](#interactive-transport-experimental). `doGenerate`
405
- (titles and no-tools calls) does not fall back either: it bills the picked model
406
- once and reports its own error.
404
+ [interactive transport](#interactive-transport-experimental). A title stub never
405
+ reaches the CLI, so there is nothing there to fall back from.
407
406
 
408
407
  ### Options reference
409
408
 
@@ -908,7 +907,7 @@ Use the claude-code-plugin skill to configure a work account and idle worker cle
908
907
 
909
908
  It covers accounts, models and agent effort, proxy tools, permissions, MCP/skill bridging, timeouts, logging, upgrades and troubleshooting. It directs the agent to preserve JSONC comments, change only requested settings, validate the result, protect credentials and ask before paid probes or broader permissions.
910
909
 
911
- The plugin registers the bundled directory with opencode's `skills.paths`, making it available to other providers too on supporting opencode versions. For Claude turns it also loads through Claude's native Skill tool as `opencode-skills:claude-code-plugin`, even when `bridgeOpencodeSkills` is `false`. This requires CLI `--plugin-dir` support and applies to the headless, interactive and direct `doGenerate` spawns; compaction never loads the native bridge.
910
+ The plugin registers the bundled directory with opencode's `skills.paths`, making it available to other providers too on supporting opencode versions. For Claude turns it also loads through Claude's native Skill tool as `opencode-skills:claude-code-plugin`, even when `bridgeOpencodeSkills` is `false`. This requires CLI `--plugin-dir` support and applies to the headless and interactive spawns; compaction never loads the native bridge.
912
911
 
913
912
  No separate skill installation or copying is needed. It ships with each package version, so upgrading updates the reference. Fully restart opencode to load it. `test-configure-skill.ts` checks coverage of provider/logging options, model ids, proxy tools and environment variables; maintainers must update behavior and default guidance in the same change as the implementation.
914
913
 
@@ -951,7 +950,7 @@ One limitation worth knowing: the plugin scan reads `installed_plugins.json` and
951
950
 
952
951
  ### Enabling it
953
952
 
954
- The bridge itself is **off by default**: every bridged skill's name and description is also in the system prompt opencode already forwards, so a large skill set is paid for twice on every turn. Set `bridgeOpencodeSkills: true` when the model tries `Skill("<name>")` for a skill opencode advertises and gets `Unknown skill`; the bundled configuration skill is staged either way. When on, the bridge applies to the headless, interactive and direct `doGenerate` spawns alike, never to compaction, and it is skipped on a Claude CLI without `--plugin-dir` (the plugin probes `claude --help` and logs a notice).
953
+ The bridge itself is **off by default**: every bridged skill's name and description is also in the system prompt opencode already forwards, so a large skill set is paid for twice on every turn. Set `bridgeOpencodeSkills: true` when the model tries `Skill("<name>")` for a skill opencode advertises and gets `Unknown skill`; the bundled configuration skill is staged either way. When on, the bridge applies to the headless and interactive spawns alike, never to compaction, and it is skipped on a Claude CLI without `--plugin-dir` (the plugin probes `claude --help` and logs a notice).
955
954
 
956
955
  This bridge was written by [@broskees](https://github.com/broskees) (Joseph Roberts) on his fork and absorbed here with credit; see [Credits](#credits).
957
956
 
package/dist/index.d.ts CHANGED
@@ -1154,15 +1154,39 @@ declare class ClaudeCodeLanguageModel implements LanguageModelV3 {
1154
1154
  private thinkingCliOptions;
1155
1155
  private latestUserText;
1156
1156
  private synthesizeTitle;
1157
+ /**
1158
+ * Aggregates the one turn implementation into a `doGenerate` result.
1159
+ *
1160
+ * `doGenerate` used to carry a second copy of `doStreamForHost`'s line
1161
+ * parser: no inactivity watchdog, no `/claude-code-doctor`, no proxy or MCP
1162
+ * wiring, no auto-continue, no turn stats, and no test of its own. Three of
1163
+ * its own branches (a `/btw` aside, proxied tools, compaction) already bailed
1164
+ * out to this method. The copy is deleted and every `doGenerate` call is now
1165
+ * this aggregation, so a fix to the turn lands once.
1166
+ *
1167
+ * Tool parts arrive already in the host's vocabulary, because `streamTurn`
1168
+ * rewrites them once at the stream's edge (src/host-tools.ts). Nothing is
1169
+ * translated a second time here.
1170
+ */
1157
1171
  private doGenerateViaStream;
1172
+ /**
1173
+ * One turn implementation serves both host methods, so this is `doStream`
1174
+ * aggregated. The host's tool vocabulary is applied inside `streamTurn`,
1175
+ * which is why nothing is renamed here.
1176
+ */
1158
1177
  doGenerate(options: LanguageModelV3CallOptions): Promise<Awaited<ReturnType<LanguageModelV3["doGenerate"]>>>;
1159
- private doGenerateForHost;
1160
1178
  /**
1161
1179
  * Tool parts leave in opencode 1.x's vocabulary; on opencode 2.x they are
1162
1180
  * renamed at this one edge (src/host-tools.ts). On V1 the stream is
1163
1181
  * returned untouched.
1164
1182
  */
1165
1183
  doStream(options: LanguageModelV3CallOptions): Promise<Awaited<ReturnType<LanguageModelV3["doStream"]>>>;
1184
+ /**
1185
+ * The turn, for both host methods. `mode` is documented on `TurnMode`; it is
1186
+ * threaded down to `doStreamForHost` rather than read from the call options,
1187
+ * because which method opencode used is not in them.
1188
+ */
1189
+ private streamTurn;
1166
1190
  /**
1167
1191
  * Run the turn, moving to the next model in the fallback chain if the one
1168
1192
  * it started on is refused. The single wiring point for `src/model-fallback.ts`.