@khalilgharbaoui/opencode-claude-code-plugin 0.37.0 → 0.37.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khalilgharbaoui/opencode-claude-code-plugin",
3
- "version": "0.37.0",
3
+ "version": "0.37.1",
4
4
  "description": "Claude Code CLI provider plugin for opencode",
5
5
  "homepage": "https://opencode-claude-code-plugin.dev/",
6
6
  "funding": {
@@ -26,7 +26,7 @@
26
26
  "build": "tsup",
27
27
  "dev": "tsup --watch",
28
28
  "typecheck": "tsc --noEmit",
29
- "test": "OPENCODE_CLAUDE_CODE_LOG_FILE=0 tsx --test test-bridge.ts test-broker.ts test-proxy-mcp.ts test-proxy-task.ts test-auto-continue.ts test-has-new-user-content.ts test-get-claude-user-message.ts test-logger.ts test-cli-args.ts test-permission-presets.ts test-session-manager.ts test-compaction-model.ts test-tool-mapping.ts test-cwd-resolution.ts test-todo-ledger.ts test-session-affinity.ts test-config-models.ts test-ask-user-question.ts test-claude-session-wrapper.ts test-spawn-env.ts test-respawn.ts test-startup-diagnostics.ts test-subagent-hint.ts test-exit-plan-mode-question.ts test-compress-tool.ts test-agent-models.ts test-side-question.ts test-btw-command.ts test-effort-sessions.ts test-tool-block-index.ts test-context-usage.ts test-skill-bridge.ts test-turn-stats.ts test-cli-events.ts test-cli-events-stream.ts test-result-fallback.ts test-doctor.ts test-configure-skill.ts test-unattended-replay.ts test-process-lifecycle.ts test-account-failover.ts test-host-tools.ts test-v2-entrypoint.ts test-v2-client.ts test-tmp-dir.ts test-cleanup-stale.ts test-account-wrapper.ts test-runtime-status-sessions.ts test-index-hooks.ts test-silent-turn.ts test-mcp-tool-result-name.ts test-model-fallback.ts test-do-generate.ts test-interactive-usage.ts test-background-subagents.ts test-interactive-result.ts test-cli-probe-cache.ts test-mcp-late-connect.ts test-prologue-abort.ts test-diagnostic-bundle.ts test-ids.ts test-session-fork.ts test-deferred-cli-tool-result.ts test-stale-build.ts",
29
+ "test": "OPENCODE_CLAUDE_CODE_LOG_FILE=0 tsx --test test-bridge.ts test-broker.ts test-proxy-mcp.ts test-proxy-task.ts test-auto-continue.ts test-has-new-user-content.ts test-get-claude-user-message.ts test-logger.ts test-cli-args.ts test-permission-presets.ts test-session-manager.ts test-compaction-model.ts test-tool-mapping.ts test-cwd-resolution.ts test-todo-ledger.ts test-session-affinity.ts test-config-models.ts test-ask-user-question.ts test-claude-session-wrapper.ts test-spawn-env.ts test-respawn.ts test-startup-diagnostics.ts test-subagent-hint.ts test-exit-plan-mode-question.ts test-compress-tool.ts test-agent-models.ts test-side-question.ts test-btw-command.ts test-effort-sessions.ts test-tool-block-index.ts test-context-usage.ts test-skill-bridge.ts test-turn-stats.ts test-cli-events.ts test-cli-events-stream.ts test-result-fallback.ts test-doctor.ts test-configure-skill.ts test-unattended-replay.ts test-process-lifecycle.ts test-account-failover.ts test-host-tools.ts test-v2-entrypoint.ts test-v2-client.ts test-tmp-dir.ts test-cleanup-stale.ts test-account-wrapper.ts test-runtime-status-sessions.ts test-index-hooks.ts test-silent-turn.ts test-mcp-tool-result-name.ts test-model-fallback.ts test-do-generate.ts test-interactive-usage.ts test-background-subagents.ts test-interactive-result.ts test-cli-probe-cache.ts test-mcp-late-connect.ts test-prologue-abort.ts test-diagnostic-bundle.ts test-ids.ts test-session-fork.ts test-deferred-cli-tool-result.ts test-stale-build.ts test-tui-log-sink.ts",
30
30
  "generate:log-messages": "tsx scripts/generate-log-messages.ts"
31
31
  },
32
32
  "dependencies": {
@@ -151,7 +151,7 @@ Defaults below describe normal headless opencode use when the key is absent.
151
151
  | `interactiveBypass` | boolean | `false` | Deprecated no-op. The TUI asks for a manual safety confirmation on `bypassPermissions`, so the plugin never passes it. |
152
152
  | `interactiveAllowTools` | string[] | `["Bash", "Edit", "Write", "Read", "WebFetch"]` | With `interactive`: replaces the built-in pre-allow list. MCP wildcards from discovered bridge names plus `mcp__opencode_proxy__*` are added even with `[]`. Not a capability denylist; review permissions before enabling. |
153
153
  | `interactiveSystemPrompt` | boolean | `true` | With `interactive`: append the plugin's own prompt. opencode's forwarded system prompt is deliberately not sent on this transport (it can trip Claude's third-party usage gate). `false` is for diagnostics only. |
154
- | `logging` | object | see below | File and TUI logging policy. |
154
+ | `logging` | object | see below | File logging plus how much reaches the operator. |
155
155
  | `name` | string | unset | Low-level `createClaudeCode()` provider identity fallback after `providerID`, not the opencode display-name setting. Display name lives at `provider.<id>.name`; account expansion supplies its own label. Leave this option unset. |
156
156
  | `providerID` | string | derived | Config hook writes the actual provider id (`claude-code` or `claude-code-work`). Do not override manually. |
157
157
  | `hostApi` | `"v1"` \| `"v2"` | derived | Which opencode major created the model, which decides the tool names its stream uses (`bash` on 1.x, `shell` on 2.x). Set only by the opencode 2 entrypoint. Do not set it: forcing `"v2"` under opencode 1.x makes every proxied tool call fail as an unavailable tool. |
@@ -164,9 +164,25 @@ Defaults below describe normal headless opencode use when the key is absent.
164
164
  |---|---|---|---|
165
165
  | `file` | boolean | `false` | Persist entries that pass `level`. Logs can contain prompts/tool data/CLI arguments; enable temporarily with consent, not as a credential dump. |
166
166
  | `dir` | path | `~/.local/share/opencode-claude-code/` | Where `plugin.log` goes. |
167
- | `mode` | `"silent"` / `"debug"` | `"silent"` | After level filtering: silent routes lower levels only to the file if enabled; WARN/ERROR go to stderr/TUI too. Debug echoes all emitted levels to stderr, but does not lower the threshold. |
167
+ | `mode` | `"silent"` / `"debug"` | `"silent"` | After level filtering: silent routes lower levels only to the file if enabled; WARN/ERROR are surfaced to the operator too. Debug surfaces all emitted levels, but does not lower the threshold. |
168
168
  | `level` | `debug` / `info` / `notice` / `warn` / `error` | `"info"` | Minimum level emitted anywhere. |
169
169
 
170
+ Where a surfaced line goes depends on whether a full-screen TUI owns the terminal, and
171
+ the plugin detects that itself (`isTuiHost`, true when the plugin is running off the main
172
+ thread, which is how opencode 1.x's TUI runs a plugin). Outside a TUI (`opencode run`,
173
+ `opencode serve`, tests, and opencode 2, which runs plugins in a separate `serve --stdio`
174
+ process) it is stderr, prefixed `[opencode-claude-code] WARN:`, unchanged. Inside the TUI
175
+ **nothing is written to stderr at any level**, because stderr there is the terminal the
176
+ TUI is drawing on and a raw line sits on top of the interface until a redraw. Instead the
177
+ line goes to opencode's own log (`client.app.log`, service `opencode-claude-code`, so it
178
+ lands in `~/.local/share/opencode/log/`), and WARN/ERROR also raise a toast titled
179
+ `claude-code`. The toast carries the message only, never the JSON data; the same message
180
+ text toasts at most once per process, and a burst raises at most three toasts plus one
181
+ line naming how many were held back. Nothing is held back from either log. So when a user
182
+ reports "the plugin printed garbage over my opencode UI", the answer is to upgrade, not to
183
+ turn logging off; and when they ask where a WARN went in the TUI, point them at opencode's
184
+ own log or the toast rather than at stderr.
185
+
170
186
  ## Environment variables
171
187
 
172
188
  Set variables in the environment that launches opencode, then fully restart it.
@@ -836,7 +852,8 @@ user's own Claude Code hooks (`hook_response` with `outcome: "error"` or a non-z
836
852
  `exit_code`), not opencode's. A failing `SessionStart` hook is otherwise invisible: the
837
853
  CLI drops its contribution and the turn succeeds, so the context it was meant to add is
838
854
  missing from every turn on that process. Read it whenever a hook's effect is absent. The
839
- first failure is also a WARN in the terminal. Only the hook's `stderr` is shown, capped
855
+ first failure is also a plugin WARN, which in the TUI means a toast plus a line in
856
+ opencode's own log rather than terminal text. Only the hook's `stderr` is shown, capped
840
857
  at 200 characters, because its stdout is spliced into the model's context. The plugin
841
858
  never passes `--include-hook-events`, so only `SessionStart` (and `Setup`) hooks are
842
859
  reported at all; `cancelled` is not a failure, since an abort produces it.