opencode-raven 2.2.2 → 2.3.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/CHANGELOG.md +90 -68
- package/README.md +47 -2
- package/index.ts +13 -2659
- package/package.json +28 -5
- package/raven-core.ts +2706 -0
- package/rpc.ts +45 -0
- package/tui.ts +99 -0
- package/v2.ts +353 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,76 +1,98 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 2.
|
|
4
|
-
|
|
5
|
-
### Added
|
|
6
|
-
- Fresh installs automatically select an available zero-cost, tool-capable model from OpenCode's connected provider catalog for Raven Search and Raven MCP.
|
|
7
|
-
- `/raven seek model auto` and `/raven mcp model auto` retry free-model detection.
|
|
8
|
-
|
|
9
|
-
### Changed
|
|
10
|
-
- 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.
|
|
11
|
-
- Auto-selected models are rechecked on startup, while manually configured models are never replaced.
|
|
12
|
-
|
|
13
|
-
## 2.2.1
|
|
14
|
-
|
|
15
|
-
### Fixed
|
|
16
|
-
- Plugin-created Raven sessions now emit a session update after creation so OpenCode adds root-level sessions to its navigable child-session list.
|
|
17
|
-
|
|
18
|
-
## 2.2.0
|
|
19
|
-
|
|
20
|
-
### Added
|
|
21
|
-
- Separate Raven Search and Raven MCP agents with independent models, reasoning effort, instructions, and timeouts.
|
|
22
|
-
- Public `raven_mcp` delegation tool and Raven-only `raven_mcp_bridge` for on-demand MCP operations.
|
|
23
|
-
- Delegated sessions now attach directly to the root session so nested agent calls remain visible in the main session's child switcher.
|
|
24
|
-
|
|
25
|
-
### Changed
|
|
26
|
-
- Raven configuration now uses `raven_seek` and `raven_mcp` sections. Existing flat configuration migrates automatically without a version field.
|
|
27
|
-
- `raven_seek` is explicitly limited to narrowly scoped search and evidence retrieval; review, audit, implementation, and judgment remain with the calling agent.
|
|
28
|
-
- Per-agent commands replace the shared model, effort, and timeout commands.
|
|
29
|
-
|
|
30
|
-
### Removed
|
|
31
|
-
- `/raven on`, `/raven off`, and the configuration-wide `enabled` field. Search routing is active while the plugin is installed.
|
|
32
|
-
- Shared `/raven model`, `/raven effort`, and `/raven timeout` commands.
|
|
33
|
-
|
|
34
|
-
## 2.1.8
|
|
35
|
-
|
|
36
|
-
### Added
|
|
37
|
-
- `raven_seek` now returns a model-visible session ID and accepts it through the optional `sessionId` argument, allowing follow-up research to continue in the same Raven session.
|
|
38
|
-
- Resumed sessions are validated as Raven children of the current main session before they can be prompted again.
|
|
39
|
-
|
|
40
|
-
### Fixed
|
|
41
|
-
- Context estimates for resumed sessions count only the newly handled context instead of counting earlier Raven turns again.
|
|
42
|
-
|
|
43
|
-
## 2.1.7
|
|
3
|
+
## 2.3.1
|
|
44
4
|
|
|
45
5
|
### Fixed
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### Added
|
|
52
|
-
- Bun-based TypeScript verification and reproducible development dependencies.
|
|
6
|
+
- V2 manual MCP refreshes now use notifications only, and reopening the TUI shows refresh progress and results in top-right notifications.
|
|
7
|
+
- V2 now refreshes on-demand MCP health and tool discovery whenever the TUI attaches to the background service, sharing overlapping checks instead of relying on one-time server initialization.
|
|
8
|
+
- V2 MCP-agent requests now receive live capability guidance so refreshed tools are visible without reloading the agent or service.
|
|
9
|
+
- V2 `/raven` output now uses an opaque, terminal-height-bounded dialog with keyboard and mouse scrolling instead of an overflowing alert.
|
|
10
|
+
- V2 public Raven delegation no longer asks for confirmation on every call. Deny rules and permissions for other tools remain unchanged.
|
|
53
11
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
### Changed
|
|
12
|
+
## 2.3.0
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- OpenCode 2 support through a native `setup()` adapter, sharing Raven configuration and MCP runtime with OpenCode 1.
|
|
16
|
+
- V2 agent/tool registration, shell routing, model discovery, guidance injection, child-session completion waiting, cancellation, continuation validation, and provider-error handling.
|
|
17
|
+
- A v2 terminal companion and typed RPC contract for immediate `/raven` command output and notifications without a model turn.
|
|
18
|
+
- Native-host smoke checks, including offline v2 routing and delegation, alongside v1/v2 regression tests.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- 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.
|
|
22
|
+
- OpenCode 2 installation uses `plugins`; OpenCode 1 continues to use `plugin`.
|
|
23
|
+
- V2 update instructions delegate cache management to OpenCode instead of deleting v1 cache paths.
|
|
24
|
+
|
|
25
|
+
## 2.2.2
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
- Fresh installs automatically select an available zero-cost, tool-capable model from OpenCode's connected provider catalog for Raven Search and Raven MCP.
|
|
29
|
+
- `/raven seek model auto` and `/raven mcp model auto` retry free-model detection.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- 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.
|
|
33
|
+
- Auto-selected models are rechecked on startup, while manually configured models are never replaced.
|
|
34
|
+
|
|
35
|
+
## 2.2.1
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
- Plugin-created Raven sessions now emit a session update after creation so OpenCode adds root-level sessions to its navigable child-session list.
|
|
39
|
+
|
|
40
|
+
## 2.2.0
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- Separate Raven Search and Raven MCP agents with independent models, reasoning effort, instructions, and timeouts.
|
|
44
|
+
- Public `raven_mcp` delegation tool and Raven-only `raven_mcp_bridge` for on-demand MCP operations.
|
|
45
|
+
- Delegated sessions now attach directly to the root session so nested agent calls remain visible in the main session's child switcher.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
- Raven configuration now uses `raven_seek` and `raven_mcp` sections. Existing flat configuration migrates automatically without a version field.
|
|
49
|
+
- `raven_seek` is explicitly limited to narrowly scoped search and evidence retrieval; review, audit, implementation, and judgment remain with the calling agent.
|
|
50
|
+
- Per-agent commands replace the shared model, effort, and timeout commands.
|
|
51
|
+
|
|
52
|
+
### Removed
|
|
53
|
+
- `/raven on`, `/raven off`, and the configuration-wide `enabled` field. Search routing is active while the plugin is installed.
|
|
54
|
+
- Shared `/raven model`, `/raven effort`, and `/raven timeout` commands.
|
|
55
|
+
|
|
56
|
+
## 2.1.8
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
- `raven_seek` now returns a model-visible session ID and accepts it through the optional `sessionId` argument, allowing follow-up research to continue in the same Raven session.
|
|
60
|
+
- Resumed sessions are validated as Raven children of the current main session before they can be prompted again.
|
|
61
|
+
|
|
62
|
+
### Fixed
|
|
63
|
+
- Context estimates for resumed sessions count only the newly handled context instead of counting earlier Raven turns again.
|
|
64
|
+
|
|
65
|
+
## 2.1.7
|
|
66
|
+
|
|
67
|
+
### Fixed
|
|
68
|
+
- Stats and `/raven` setting updates now patch the latest on-disk configuration instead of rewriting stale in-memory state, preserving externally edited MCP servers and headers.
|
|
69
|
+
- Existing malformed or partially written configuration files are preserved for repair instead of being replaced with defaults.
|
|
70
|
+
|
|
71
|
+
## 2.1.6
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
- Bun-based TypeScript verification and reproducible development dependencies.
|
|
75
|
+
|
|
76
|
+
### Changed
|
|
77
|
+
- On-demand MCP requests now propagate cancellation and SDK-native timeouts, reuse one in-flight connection per session/server, and close idle or deleted-session connections.
|
|
78
|
+
- README structure and wording now focus on installation, usage, configuration, routing, security, and troubleshooting.
|
|
79
|
+
- Removed legacy root-config and embedded MCP-metadata migration support.
|
|
80
|
+
|
|
81
|
+
### Fixed
|
|
82
|
+
- Quoted `cmd`, PowerShell, and Unix shell search commands can no longer bypass Raven routing.
|
|
83
|
+
- Session event handling now follows the OpenCode SDK event shape.
|
|
84
|
+
- Raven receives configured on-demand MCP guidance while startup health checks are pending.
|
|
85
|
+
- Invalid timeout and stats values are normalized safely.
|
|
86
|
+
|
|
87
|
+
## 2.1.5
|
|
88
|
+
|
|
89
|
+
### Changed
|
|
90
|
+
- **On-demand MCP guidance** — autogenerated guidance now preserves existing MCP order and appends newly loaded MCPs at the end.
|
|
91
|
+
- **Guidance descriptions** — full-mode on-demand MCP guidance now keeps generated metadata intact while rendering only first-sentence descriptions to reduce main-model context.
|
|
92
|
+
|
|
93
|
+
## 2.1.4
|
|
94
|
+
|
|
95
|
+
### Changed
|
|
74
96
|
- **Subagent prompts** — Raven no longer injects routing guidance into subagent prompts; global instructions and tool enforcement handle routing.
|
|
75
97
|
|
|
76
98
|
## 2.1.3
|
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
|
|
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
|
{
|
|
@@ -41,6 +56,16 @@ Restart OpenCode, then run `/raven` to verify the loaded version, model, routing
|
|
|
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 scrollable dialog (arrow keys, Page Up/Down, or mouse wheel; Esc to close) 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
|
+
|
|
44
69
|
### First-Time Setup
|
|
45
70
|
|
|
46
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.
|
|
@@ -85,6 +110,8 @@ Under the hood, Raven registers two public delegation tools and one internal bri
|
|
|
85
110
|
| `raven_mcp` | Creates or resumes a Raven MCP session for configured on-demand MCP capabilities. |
|
|
86
111
|
| `raven_mcp_bridge` | Internal bridge used only by the Raven MCP agent. |
|
|
87
112
|
|
|
113
|
+
On OpenCode V2, Raven auto-approves permission checks for the public `raven_seek` and `raven_mcp` delegation tools instead of prompting on every call. Explicit deny rules still apply. This does not change permission checks for other tools or access restrictions on the internal MCP bridge.
|
|
114
|
+
|
|
88
115
|
For a related follow-up, the main agent can reuse the ID returned by the earlier call:
|
|
89
116
|
|
|
90
117
|
```text
|
|
@@ -98,6 +125,10 @@ OpenCode's built-in tools already exist; Raven routes selected calls instead of
|
|
|
98
125
|
|
|
99
126
|
On-demand MCPs are different: Raven discovers and calls them internally, so their full schemas are not registered globally. Enabled servers are probed after startup to discover tools and health, then per-session connections are opened when Raven uses them. "On-demand" describes schema exposure and normal use, not the absence of a startup health probe.
|
|
100
127
|
|
|
128
|
+
On OpenCode V2, reopening the TUI triggers a fresh background health and tool-discovery check even if the shared service is still running. Overlapping attachment checks share the same refresh. Use `/raven mcp refresh [server_name]` to retry manually without restarting the service.
|
|
129
|
+
|
|
130
|
+
Automatic and manual MCP refreshes use top-right notifications for progress and results, without opening a command dialog or a session tab.
|
|
131
|
+
|
|
101
132
|
## Configuration
|
|
102
133
|
|
|
103
134
|
Raven creates its global configuration here:
|
|
@@ -183,7 +214,7 @@ Generated MCP metadata and main-model guidance live beside `raven-config.json`.
|
|
|
183
214
|
|
|
184
215
|
## Routing
|
|
185
216
|
|
|
186
|
-
Default routed tools are `grep`, `glob`, `webfetch`, `fetch`, `websearch`, and search-like `bash` commands.
|
|
217
|
+
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.
|
|
187
218
|
|
|
188
219
|
Global MCPs are automatically routed when their OpenCode tool names use the normal `<server>_<tool>` prefix. Use a keyword for suffix-style names:
|
|
189
220
|
|
|
@@ -247,6 +278,20 @@ Review `Raven.md` and your MCP commands before using Raven in sensitive environm
|
|
|
247
278
|
- Stale plugin version: run `/raven update`, restart OpenCode, and follow the cache-clearing instructions it prints if needed.
|
|
248
279
|
- Remove Raven: delete `"opencode-raven"` from `plugin`, restart, then optionally remove `~/.config/opencode/opencode-raven/`.
|
|
249
280
|
|
|
281
|
+
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.
|
|
282
|
+
|
|
283
|
+
## Development Checks
|
|
284
|
+
|
|
285
|
+
```sh
|
|
286
|
+
bun install
|
|
287
|
+
bun test
|
|
288
|
+
bun run typecheck
|
|
289
|
+
bun scripts/smoke-compat.ts v1 /path/to/opencode-v1
|
|
290
|
+
bun scripts/smoke-compat.ts v2 /path/to/opencode-v2
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
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.
|
|
294
|
+
|
|
250
295
|
See [CHANGELOG.md](CHANGELOG.md) for release history.
|
|
251
296
|
|
|
252
297
|
## Disclaimer
|