opencode-raven 2.2.1 → 2.3.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Added
6
+ - OpenCode 2 support through a native `setup()` adapter, sharing Raven configuration and MCP runtime with OpenCode 1.
7
+ - V2 agent/tool registration, shell routing, model discovery, guidance injection, child-session completion waiting, cancellation, continuation validation, and provider-error handling.
8
+ - A v2 terminal companion and typed RPC contract for immediate `/raven` command output and notifications without a model turn.
9
+ - Native-host smoke checks, including offline v2 routing and delegation, alongside v1/v2 regression tests.
10
+
11
+ ### Changed
12
+ - Raised the OpenCode 1 minimum to 1.18.29 for the shared `server()`/`setup()` object entrypoint. The v2 adapter targets OpenCode 2.0.26 and newer 2.x releases.
13
+ - OpenCode 2 installation uses `plugins`; OpenCode 1 continues to use `plugin`.
14
+ - V2 update instructions delegate cache management to OpenCode instead of deleting v1 cache paths.
15
+
16
+ ## 2.2.2
17
+
18
+ ### Added
19
+ - Fresh installs automatically select an available zero-cost, tool-capable model from OpenCode's connected provider catalog for Raven Search and Raven MCP.
20
+ - `/raven seek model auto` and `/raven mcp model auto` retry free-model detection.
21
+
22
+ ### Changed
23
+ - Removed the retired `opencode/deepseek-v4-flash-free` default. Raven now leaves routing inactive and shows first-time setup instructions when no suitable free model is available.
24
+ - Auto-selected models are rechecked on startup, while manually configured models are never replaced.
25
+
3
26
  ## 2.2.1
4
27
 
5
28
  ### Fixed
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  <div align="center">
2
2
  <h1>opencode-raven</h1>
3
3
  <p><strong>Keep noisy tool work out of your main OpenCode context.</strong></p>
4
+ <p><strong>Supports OpenCode V2 (2.0.26+) and OpenCode V1 (1.18.29+), in one package.</strong></p>
4
5
  <p>
5
6
  <a href="https://www.npmjs.com/package/opencode-raven"><img src="https://img.shields.io/npm/v/opencode-raven.svg" alt="npm version" /></a>
6
7
  <a href="https://www.npmjs.com/package/opencode-raven"><img src="https://img.shields.io/npm/dm/opencode-raven.svg" alt="npm downloads" /></a>
@@ -29,7 +30,21 @@
29
30
 
30
31
  ## Install
31
32
 
32
- Raven requires OpenCode 1.15.12 or newer. Add it to `opencode.jsonc`:
33
+ **Raven 2.3 supports OpenCode V2 (2.0.26+).** OpenCode V1 (1.18.29+) remains supported in the same package—no separate plugin is needed.
34
+
35
+ ### OpenCode V2
36
+
37
+ Use the v2 `plugins` key in `opencode.jsonc`:
38
+
39
+ ```jsonc
40
+ {
41
+ "plugins": ["opencode-raven"]
42
+ }
43
+ ```
44
+
45
+ ### OpenCode V1
46
+
47
+ Use the v1 `plugin` key in `opencode.jsonc`:
33
48
 
34
49
  ```jsonc
35
50
  {
@@ -37,10 +52,35 @@ Raven requires OpenCode 1.15.12 or newer. Add it to `opencode.jsonc`:
37
52
  }
38
53
  ```
39
54
 
40
- Restart OpenCode, then run `/raven` to verify the loaded version, model, routing, MCP health, and estimated savings.
55
+ Restart OpenCode, then run `/raven` to verify the loaded version, model, routing, MCP health, and estimated savings. A fresh install may ask for one additional restart after selecting its model.
41
56
 
42
57
  OpenCode resolves the package from npm and caches it automatically.
43
58
 
59
+ ### Upgrading From OpenCode 1 To 2
60
+
61
+ Keep using `opencode-raven`; change its OpenCode config entry from `plugin` to `plugins`. Raven's existing `~/.config/opencode/opencode-raven/raven-config.json` is shared by both versions, including models, on-demand MCPs, routing settings, and stats. Quit and restart OpenCode after upgrading.
62
+
63
+ OpenCode 1 uses Raven's `server()` entrypoint; OpenCode 2 uses `setup()` and automatically loads the terminal companion. The terminal companion displays `/raven` command results in a dialog and delivers startup/update warnings as toasts, without sending a prompt to the model. The v2 server also exposes the typed `opencode-raven/rpc` command contract for other clients.
64
+
65
+ The v1 minimum is 1.18.29 because earlier versions cannot load the shared object entrypoint. See OpenCode's [plugin migration guide](https://opencode.ai/v2/docs/build/plugins/migrate-v1) for the upstream lifecycle and config changes.
66
+
67
+ For local development, v1 can load `file:///path/to/opencode-raven/index.ts`; v2 requires the package directory, `file:///path/to/opencode-raven`.
68
+
69
+ ### First-Time Setup
70
+
71
+ On first start, Raven checks OpenCode's connected provider catalog and automatically selects an available zero-cost, tool-capable model from the `opencode` provider for both Raven agents. Free-model availability is controlled by the provider and can change.
72
+
73
+ If a free model is found, Raven writes it to the config and asks you to restart OpenCode once to load it. After restarting, `/raven` shows it with `(auto)`. Raven rechecks auto-selected models after startup and replaces one only when it is no longer available. A model you set manually is never replaced.
74
+
75
+ If no suitable free model is available, Raven shows a setup warning and leaves search routing inactive rather than silently using a paid model. Open OpenCode's model picker to choose an available model, then run:
76
+
77
+ ```txt
78
+ /raven seek model <provider/model>
79
+ /raven mcp model <provider/model>
80
+ ```
81
+
82
+ Restart OpenCode afterward. You can retry free-model detection at any time with `/raven seek model auto` and `/raven mcp model auto`.
83
+
44
84
  ## Example
45
85
 
46
86
  <p align="center">
@@ -95,7 +135,8 @@ Manual edits require an OpenCode restart. Route and timeout commands apply immed
95
135
 
96
136
  | Field | Fresh-install default | Description |
97
137
  |-------|-----------------------|-------------|
98
- | `raven_seek.model` | From `Raven.md` | Search-agent model override. |
138
+ | `raven_seek.model` | Auto-detected free OpenCode model, otherwise unset | Search-agent model. Manual values are preserved. |
139
+ | `raven_seek.autoSelectedModel` | Managed by Raven | Tracks whether the Search model can be safely refreshed automatically. |
99
140
  | `raven_seek.reasoning_effort` | `low` | Search-agent reasoning option. |
100
141
  | `raven_seek.instructions` | `""` | Extra search-agent instructions. |
101
142
  | `raven_seek.routeTools` | Search/fetch tools plus `bash` | Exact tools routed through Raven Search. |
@@ -103,7 +144,8 @@ Manual edits require an OpenCode restart. Route and timeout commands apply immed
103
144
  | `raven_seek.excludeAgents` | `[]` | Agents allowed to bypass search routing. |
104
145
  | `raven_seek.excludeTools` | `[]` | Exact tools never routed through Raven Search. |
105
146
  | `raven_seek.timeout` | `600` | Search delegation timeout in seconds. |
106
- | `raven_mcp.model` | From `RavenMcp.md` | MCP-agent model override. |
147
+ | `raven_mcp.model` | Auto-detected free OpenCode model, otherwise unset | MCP-agent model. Manual values are preserved. |
148
+ | `raven_mcp.autoSelectedModel` | Managed by Raven | Tracks whether the MCP model can be safely refreshed automatically. |
107
149
  | `raven_mcp.reasoning_effort` | `low` | MCP-agent reasoning option. |
108
150
  | `raven_mcp.instructions` | `""` | Extra MCP-agent instructions. |
109
151
  | `raven_mcp.timeout` | `600` | MCP delegation and fallback connection timeout in seconds. |
@@ -166,7 +208,7 @@ Generated MCP metadata and main-model guidance live beside `raven-config.json`.
166
208
 
167
209
  ## Routing
168
210
 
169
- Default routed tools are `grep`, `glob`, `webfetch`, `fetch`, `websearch`, and search-like `bash` commands.
211
+ Default routed tools are `grep`, `glob`, `webfetch`, `fetch`, `websearch`, and search-like `bash` commands. On OpenCode 2, Raven also recognizes the native `shell` tool; `bash` and `shell` are routing aliases, so existing routing settings continue to work. Exact `excludeTools` entries use the host's actual tool name.
170
212
 
171
213
  Global MCPs are automatically routed when their OpenCode tool names use the normal `<server>_<tool>` prefix. Use a keyword for suffix-style names:
172
214
 
@@ -195,10 +237,10 @@ When `bash` is routed, Raven intercepts primary discovery commands such as `rg`,
195
237
  | `/raven mcp` | Show on-demand MCP health and generated metadata. |
196
238
  | `/raven mcp refresh [server]` | Recheck MCP health and regenerate metadata. |
197
239
  | `/raven mcp detail full|minimized` | Set generated guidance detail; restart afterward. |
198
- | `/raven seek model <provider/model>` | Change the search model; restart afterward. |
240
+ | `/raven seek model <provider/model>\|auto` | Change or auto-detect the search model; restart afterward. |
199
241
  | `/raven seek effort <value>` | Change search reasoning effort; restart afterward. |
200
242
  | `/raven seek timeout <seconds>` | Change the search delegation timeout. |
201
- | `/raven mcp model <provider/model>` | Change the MCP model; restart afterward. |
243
+ | `/raven mcp model <provider/model>\|auto` | Change or auto-detect the MCP model; restart afterward. |
202
244
  | `/raven mcp effort <value>` | Change MCP reasoning effort; restart afterward. |
203
245
  | `/raven mcp timeout <seconds>` | Change the MCP delegation timeout. |
204
246
  | `/raven stats` | Show estimated context avoided. |
@@ -223,12 +265,27 @@ Review `Raven.md` and your MCP commands before using Raven in sensitive environm
223
265
 
224
266
  ## Troubleshooting
225
267
 
268
+ - First-time model warning: select a model in OpenCode's model picker, run `/raven seek model <provider/model>` and `/raven mcp model <provider/model>`, then restart. Use `auto` as the model value to retry free-model detection.
226
269
  - Search provider or quota failure: run `/raven seek model <provider/model>`, then restart OpenCode.
227
270
  - MCP-agent provider or quota failure: run `/raven mcp model <provider/model>`, then restart OpenCode.
228
271
  - MCP failure: run `/raven mcp`, then `/raven mcp refresh <server>` after correcting its URL, command, environment, or credentials.
229
272
  - Stale plugin version: run `/raven update`, restart OpenCode, and follow the cache-clearing instructions it prints if needed.
230
273
  - Remove Raven: delete `"opencode-raven"` from `plugin`, restart, then optionally remove `~/.config/opencode/opencode-raven/`.
231
274
 
275
+ On OpenCode 2, remove it from `plugins` instead. `/raven update` uses v1 cache-clearing behavior only on OpenCode 1; on v2 it checks the version and provides restart/pinned-version instructions while leaving cache management to OpenCode.
276
+
277
+ ## Development Checks
278
+
279
+ ```sh
280
+ bun install
281
+ bun test
282
+ bun run typecheck
283
+ bun scripts/smoke-compat.ts v1 /path/to/opencode-v1
284
+ bun scripts/smoke-compat.ts v2 /path/to/opencode-v2
285
+ ```
286
+
287
+ The native smoke checks use isolated configuration and data directories. The v2 check uses a deterministic local model endpoint to exercise routed main-agent search, direct Raven child search, delegation completion, and command/RPC output without calling a paid model provider.
288
+
232
289
  See [CHANGELOG.md](CHANGELOG.md) for release history.
233
290
 
234
291
  ## Disclaimer
package/Raven.md CHANGED
@@ -1,9 +1,8 @@
1
1
  ---
2
- description: Context firewall for OpenCode that routes noisy search, docs, web, GitHub, and MCP calls through a free focused agent before they hit your main model.
2
+ description: Context firewall for OpenCode that routes noisy search, docs, web, GitHub, and MCP calls through a focused agent before they hit your main model.
3
3
  mode: subagent
4
4
  hidden: false
5
- model: opencode/deepseek-v4-flash-free
6
- reasoning_effort: low
5
+ reasoning_effort: low
7
6
  permission:
8
7
  read: allow
9
8
  glob: allow
package/RavenMcp.md CHANGED
@@ -2,7 +2,6 @@
2
2
  description: Focused on-demand MCP agent that retrieves compact information through Raven's internal MCP bridge.
3
3
  mode: subagent
4
4
  hidden: true
5
- model: opencode/deepseek-v4-flash-free
6
5
  reasoning_effort: low
7
6
  permission:
8
7
  "*": deny