opencode-raven 2.1.8 → 2.2.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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.1
4
+
5
+ ### Fixed
6
+ - Plugin-created Raven sessions now emit a session update after creation so OpenCode adds root-level sessions to its navigable child-session list.
7
+
8
+ ## 2.2.0
9
+
10
+ ### Added
11
+ - Separate Raven Search and Raven MCP agents with independent models, reasoning effort, instructions, and timeouts.
12
+ - Public `raven_mcp` delegation tool and Raven-only `raven_mcp_bridge` for on-demand MCP operations.
13
+ - Delegated sessions now attach directly to the root session so nested agent calls remain visible in the main session's child switcher.
14
+
15
+ ### Changed
16
+ - Raven configuration now uses `raven_seek` and `raven_mcp` sections. Existing flat configuration migrates automatically without a version field.
17
+ - `raven_seek` is explicitly limited to narrowly scoped search and evidence retrieval; review, audit, implementation, and judgment remain with the calling agent.
18
+ - Per-agent commands replace the shared model, effort, and timeout commands.
19
+
20
+ ### Removed
21
+ - `/raven on`, `/raven off`, and the configuration-wide `enabled` field. Search routing is active while the plugin is installed.
22
+ - Shared `/raven model`, `/raven effort`, and `/raven timeout` commands.
23
+
3
24
  ## 2.1.8
4
25
 
5
26
  ### Added
package/README.md CHANGED
@@ -15,9 +15,10 @@
15
15
  </td>
16
16
  <td valign="top">
17
17
  <h2>Why Raven</h2>
18
- <p>Raven delegates search, web, documentation, GitHub, command-inspection, and MCP work to a focused subagent, then returns a compact answer to the main session.</p>
18
+ <p>Raven delegates search and on-demand MCP retrieval to separate focused agents, then returns compact evidence to the calling session.</p>
19
19
  <ul>
20
- <li>Routes OpenCode tools and globally configured MCPs through <code>raven_seek</code>.</li>
20
+ <li>Routes OpenCode search tools and globally configured MCPs through <code>raven_seek</code>.</li>
21
+ <li>Uses a separately configurable model for on-demand MCP retrieval through <code>raven_mcp</code>.</li>
21
22
  <li>Keeps optional on-demand MCP schemas out of the main model's tool list.</li>
22
23
  <li>Preconfigures Context7, Exa, and Grep.app endpoints.</li>
23
24
  <li>Tracks estimated main-session context avoided by delegation.</li>
@@ -54,19 +55,20 @@ In this run, Raven handled the search-heavy web research in a child session and
54
55
 
55
56
  1. Your agent attempts to use a routed search, fetch, shell-discovery, or MCP tool.
56
57
  2. Raven blocks the noisy direct call and gives the agent the exact `raven_seek` retry.
57
- 3. The agent creates a linked Raven child session or resumes one for a related follow-up.
58
- 4. Raven performs the tool-heavy work and returns only compact findings to the main session.
58
+ 3. The selected Raven agent creates a session attached directly to the root session or resumes one for a related follow-up.
59
+ 4. Raven performs retrieval work and returns compact evidence to the calling agent, which retains analysis and judgment.
59
60
 
60
61
  The main model receives Raven's final answer instead of its raw tool output. Each result includes a Raven session ID that the main agent can pass back for a context-aware follow-up. Child sessions remain available in OpenCode's session/subagent view for inspection.
61
62
 
62
- For direct control, mention `@Raven` in any chat. This sends the request straight to the Raven agent, but it is optional and not required for automatic routing.
63
+ For direct search control, mention `@Raven` in any chat. This sends the request to the search agent, but it is optional and not required for automatic routing.
63
64
 
64
- Under the hood, Raven registers two tools:
65
+ Under the hood, Raven registers two public delegation tools and one internal bridge:
65
66
 
66
67
  | Tool | Purpose |
67
68
  |------|---------|
68
- | `raven_seek` | Creates or resumes a linked Raven child session and returns its compact result. |
69
- | `raven_mcp` | Raven-only bridge to MCPs configured under `onDemandMcpServers`. |
69
+ | `raven_seek` | Creates or resumes a Raven Search session for narrowly scoped evidence retrieval. |
70
+ | `raven_mcp` | Creates or resumes a Raven MCP session for configured on-demand MCP capabilities. |
71
+ | `raven_mcp_bridge` | Internal bridge used only by the Raven MCP agent. |
70
72
 
71
73
  For a related follow-up, the main agent can reuse the ID returned by the earlier call:
72
74
 
@@ -75,7 +77,7 @@ raven_seek(query="Research the available options")
75
77
  raven_seek(query="Compare the first two in more detail", sessionId="ses_...")
76
78
  ```
77
79
 
78
- Raven accepts a resumed session only when it is a Raven child of the current main session. Unrelated work should omit `sessionId` and start a fresh child.
80
+ Raven accepts a resumed session only when it belongs to the same root session tree and matching Raven agent. Do not pass session IDs between `raven_seek` and `raven_mcp`. Delegated sessions attach directly to the root so they remain visible in the main session's child switcher even when delegation starts inside another child.
79
81
 
80
82
  OpenCode's built-in tools already exist; Raven routes selected calls instead of replacing those tools. Global MCPs also remain globally registered, so their schemas still enter the main session even when Raven routes their calls.
81
83
 
@@ -89,21 +91,26 @@ Raven creates its global configuration here:
89
91
  ~/.config/opencode/opencode-raven/raven-config.json
90
92
  ```
91
93
 
92
- Manual edits require an OpenCode restart. `/raven on`, `/raven off`, routing changes, and timeout changes apply immediately unless the command says otherwise.
94
+ Manual edits require an OpenCode restart. Route and timeout commands apply immediately unless the command says otherwise.
93
95
 
94
96
  | Field | Fresh-install default | Description |
95
97
  |-------|-----------------------|-------------|
96
- | `enabled` | `true` | Enables hard routing. It does not disable Raven's update check or MCP health probes. |
97
- | `model` | From `Raven.md` | Raven model override. Availability and pricing depend on the provider. |
98
- | `reasoning_effort` | `low` | Raven model reasoning option. |
99
- | `ravenInstructions` | `""` | Extra Raven-only instructions. |
100
- | `routeTools` | Search/fetch tools plus `bash` | Exact tools routed through Raven. `bash` only intercepts search-like commands. |
101
- | `routeToolKeywords` | `[]` | Case-insensitive tool-name substrings, useful for nonstandard MCP tool names. |
102
- | `onDemandMcpDescriptionDetail` | `"full"` | `full` includes tool names and short summaries; `minimized` includes capability summaries only. |
103
- | `onDemandMcpServers` | Context7, Exa, Grep.app | Remote HTTP/SSE or local stdio MCP definitions. |
104
- | `excludeAgents` | `[]` | Agents allowed to bypass routing. |
105
- | `excludeTools` | `[]` | Exact tools never routed by Raven. |
106
- | `timeout` | `600` | Raven delegation and fallback MCP timeout in seconds; minimum 10. |
98
+ | `raven_seek.model` | From `Raven.md` | Search-agent model override. |
99
+ | `raven_seek.reasoning_effort` | `low` | Search-agent reasoning option. |
100
+ | `raven_seek.instructions` | `""` | Extra search-agent instructions. |
101
+ | `raven_seek.routeTools` | Search/fetch tools plus `bash` | Exact tools routed through Raven Search. |
102
+ | `raven_seek.routeToolKeywords` | `[]` | Case-insensitive routed tool-name substrings. |
103
+ | `raven_seek.excludeAgents` | `[]` | Agents allowed to bypass search routing. |
104
+ | `raven_seek.excludeTools` | `[]` | Exact tools never routed through Raven Search. |
105
+ | `raven_seek.timeout` | `600` | Search delegation timeout in seconds. |
106
+ | `raven_mcp.model` | From `RavenMcp.md` | MCP-agent model override. |
107
+ | `raven_mcp.reasoning_effort` | `low` | MCP-agent reasoning option. |
108
+ | `raven_mcp.instructions` | `""` | Extra MCP-agent instructions. |
109
+ | `raven_mcp.timeout` | `600` | MCP delegation and fallback connection timeout in seconds. |
110
+ | `raven_mcp.descriptionDetail` | `"full"` | Full or minimized generated MCP guidance. |
111
+ | `raven_mcp.onDemandMcpServers` | Context7, Exa, Grep.app | Remote HTTP/SSE or local stdio MCP definitions. |
112
+
113
+ Existing flat configuration is migrated automatically on startup without a version field. Shared model, reasoning effort, instructions, and timeout values seed both sections; routing and MCP fields move to their corresponding sections.
107
114
 
108
115
  ## On-Demand MCPs
109
116
 
@@ -117,17 +124,19 @@ Fresh installs include:
117
124
 
118
125
  Provider access policies can change. `/raven mcp` shows the result of Raven's current startup probe.
119
126
 
120
- Merge changes into the existing `onDemandMcpServers` object; replacing it removes omitted defaults. Header and environment values support `{env:VARIABLE}` placeholders.
127
+ Merge changes into the existing `raven_mcp.onDemandMcpServers` object; replacing it removes omitted defaults. Header and environment values support `{env:VARIABLE}` placeholders.
121
128
 
122
129
  Custom remote MCP or keyed endpoint:
123
130
 
124
131
  ```jsonc
125
132
  {
126
- "onDemandMcpServers": {
127
- "myDocs": {
128
- "type": "remote",
129
- "url": "https://example.com/mcp",
130
- "headers": { "Authorization": "Bearer {env:MY_DOCS_TOKEN}" }
133
+ "raven_mcp": {
134
+ "onDemandMcpServers": {
135
+ "myDocs": {
136
+ "type": "remote",
137
+ "url": "https://example.com/mcp",
138
+ "headers": { "Authorization": "Bearer {env:MY_DOCS_TOKEN}" }
139
+ }
131
140
  }
132
141
  }
133
142
  }
@@ -137,13 +146,15 @@ Custom local stdio MCP:
137
146
 
138
147
  ```jsonc
139
148
  {
140
- "onDemandMcpServers": {
141
- "myLocal": {
142
- "type": "local",
143
- "command": ["bunx", "some-mcp-server"],
144
- "environment": { "API_KEY": "{env:MY_LOCAL_KEY}" },
145
- "cwd": "C:\\path\\to\\workspace",
146
- "timeout": 60000
149
+ "raven_mcp": {
150
+ "onDemandMcpServers": {
151
+ "myLocal": {
152
+ "type": "local",
153
+ "command": ["bunx", "some-mcp-server"],
154
+ "environment": { "API_KEY": "{env:MY_LOCAL_KEY}" },
155
+ "cwd": "C:\\path\\to\\workspace",
156
+ "timeout": 60000
157
+ }
147
158
  }
148
159
  }
149
160
  }
@@ -170,7 +181,7 @@ Route or unroute exact tools:
170
181
  /raven route tool remove bash
171
182
  ```
172
183
 
173
- `excludeTools` leaves selected tools direct even if their MCP prefix is routed. `excludeAgents` bypasses routing for selected agents.
184
+ `raven_seek.excludeTools` leaves selected tools direct even if their MCP prefix is routed. `raven_seek.excludeAgents` bypasses routing for selected agents.
174
185
 
175
186
  When `bash` is routed, Raven intercepts primary discovery commands such as `rg`, recursive `grep`, `find -name`, `dir /s`, and `Get-ChildItem -Recurse`, including common quoted shell wrappers. Bounded output filters such as `command | grep ...` remain direct.
176
187
 
@@ -180,22 +191,25 @@ When `bash` is routed, Raven intercepts primary discovery commands such as `rg`,
180
191
  |---------|--------|
181
192
  | `/raven` | Show status, routing, MCP health, version, model, timeout, and stats. |
182
193
  | `/raven help` | Show command help. |
183
- | `/raven on` / `/raven off` | Enable or disable hard routing. |
184
194
  | `/raven route` | Show and edit routed tools and keywords. |
185
195
  | `/raven mcp` | Show on-demand MCP health and generated metadata. |
186
196
  | `/raven mcp refresh [server]` | Recheck MCP health and regenerate metadata. |
187
197
  | `/raven mcp detail full|minimized` | Set generated guidance detail; restart afterward. |
188
- | `/raven model <provider/model>` | Change Raven's model; restart afterward. |
189
- | `/raven effort <value>` | Change Raven's reasoning effort; restart afterward. |
190
- | `/raven timeout <seconds>` | Change the delegation timeout. |
198
+ | `/raven seek model <provider/model>` | Change the search model; restart afterward. |
199
+ | `/raven seek effort <value>` | Change search reasoning effort; restart afterward. |
200
+ | `/raven seek timeout <seconds>` | Change the search delegation timeout. |
201
+ | `/raven mcp model <provider/model>` | Change the MCP model; restart afterward. |
202
+ | `/raven mcp effort <value>` | Change MCP reasoning effort; restart afterward. |
203
+ | `/raven mcp timeout <seconds>` | Change the MCP delegation timeout. |
191
204
  | `/raven stats` | Show estimated context avoided. |
192
205
  | `/raven update` | Check npm, clear Raven's OpenCode package cache when needed, and show restart instructions. |
193
206
 
194
207
  ## Security And Privacy
195
208
 
196
- Raven is optimized for autonomous inspection:
209
+ Raven is optimized for autonomous retrieval:
197
210
 
198
- - It has read, search, unrestricted shell, external-directory, and configured MCP access without normal permission prompts.
211
+ - Raven Search has read, search, unrestricted shell, external-directory, and globally configured MCP access without normal permission prompts.
212
+ - Raven MCP has only the internal on-demand MCP bridge and cannot use shell, local search, or edit tools.
199
213
  - Its `edit` tool is denied, but shell access is not a read-only sandbox and can modify the system.
200
214
  - Queries are sent to Raven's configured model provider.
201
215
  - Remote MCP requests are sent to their services; local MCP entries launch local commands and inherit environment values.
@@ -209,7 +223,8 @@ Review `Raven.md` and your MCP commands before using Raven in sensitive environm
209
223
 
210
224
  ## Troubleshooting
211
225
 
212
- - Provider or quota failure: run `/raven model <provider/model>`, then restart OpenCode.
226
+ - Search provider or quota failure: run `/raven seek model <provider/model>`, then restart OpenCode.
227
+ - MCP-agent provider or quota failure: run `/raven mcp model <provider/model>`, then restart OpenCode.
213
228
  - MCP failure: run `/raven mcp`, then `/raven mcp refresh <server>` after correcting its URL, command, environment, or credentials.
214
229
  - Stale plugin version: run `/raven update`, restart OpenCode, and follow the cache-clearing instructions it prints if needed.
215
230
  - Remove Raven: delete `"opencode-raven"` from `plugin`, restart, then optionally remove `~/.config/opencode/opencode-raven/`.
package/Raven.md CHANGED
@@ -11,17 +11,20 @@ permission:
11
11
  list: allow
12
12
  edit: deny
13
13
  bash: allow
14
- task: deny
15
- raven_seek: deny
16
- raven_mcp: allow
14
+ task: deny
15
+ raven_seek: deny
16
+ raven_mcp: deny
17
+ raven_mcp_bridge: deny
17
18
  external_directory: allow
18
19
  ---
19
20
 
20
21
  You are Raven.
21
22
 
22
- You search, fetch, inspect, and use routed MCPs only.
23
- You return compact findings only.
24
- Never call `raven_seek`; you are Raven. Use your direct tools, globally available MCPs, and `raven_mcp` for on-demand MCPs instead.
23
+ You locate and retrieve evidence with search, fetch, read, command-inspection, and globally routed MCP tools only.
24
+ You return compact evidence only.
25
+ Never call `raven_seek` or `raven_mcp`; you are Raven Search. Use your direct tools and globally available routed MCPs.
26
+
27
+ Do not perform code review, auditing, correctness judgments, implementation, debugging decisions, planning, or general task execution. During those tasks, retrieve only narrowly scoped evidence; the calling agent owns analysis and judgment. If asked to review or audit, return concrete requested locations and facts without a verdict.
25
28
 
26
29
  When a query implies multiple independent searches, run tools in parallel (single turn) for speed.
27
30
 
@@ -33,39 +36,18 @@ Use tools/MCPs like this:
33
36
 
34
37
  **Command-output/system inspection:** when the caller asks about installed commands, `--help` output, man pages, package metadata, loaded modules, local environment state, or whether a local tool supports a format/flag, use bash as needed and return compact findings. This includes running or inspecting bounded command output that a primary agent would otherwise filter with grep/rg/head.
35
38
 
36
- **MCP usage guidance:**
37
-
38
- Use direct MCP tools when they are globally available in your tool list.
39
- Use `raven_mcp` for on-demand MCPs described in your prompt. If you do not know the exact tool name, call `raven_mcp` with `operation: "list_tools"` first, then call the selected tool with `operation: "call_tool"`. For `call_tool` and `get_prompt`, pass arguments as a JSON object string in `argumentsJson`.
40
-
41
- *Context7:*
42
- Use when implementing, configuring, or debugging code that depends on a library, framework, SDK, package, or API.
43
- Prefer Context7 over memory when docs may be version-specific or recently changed.
44
-
45
- *Exa AI:*
46
- Use for live web search, current information, company/product research, reading webpages, comparing tools, and broad external research.
47
- Use Exa when the answer may depend on recent updates, pricing, docs pages, releases, or online sources.
48
-
49
- *Grep.app:*
50
- Use for searching public GitHub code examples, real-world usage patterns, config examples, and how other projects structure similar code.
51
- Use Grep.app when docs are unclear or when implementation examples would help.
52
-
53
- *Other routed MCPs:*
54
- When the caller asks for a configured MCP, use that MCP directly and return a compact summary of only what the primary agent needs.
39
+ **Globally routed MCPs:** when a globally available MCP is present in your tool list, use it directly and return compact evidence. On-demand MCPs belong to the separate Raven MCP agent and are not available here.
55
40
 
56
41
  Output format:
57
42
 
58
- Answer:
59
- * Short direct finding.
43
+ Result:
44
+ * Short direct evidence.
60
45
 
61
46
  Sources / locations:
62
47
  * File paths, URLs, docs, examples, MCP records, or local objects checked.
63
48
 
64
- Relevant details:
65
- * Small notes only. No long code dumps.
66
-
67
- Recommended next step:
68
- * What the caller should do next.
69
-
70
- Uncertainty:
71
- * Anything unclear or not found.
49
+ Relevant evidence:
50
+ * Small notes only. No long code dumps.
51
+
52
+ Search gaps:
53
+ * Anything unclear or not found.
package/RavenMcp.md ADDED
@@ -0,0 +1,42 @@
1
+ ---
2
+ description: Focused on-demand MCP agent that retrieves compact information through Raven's internal MCP bridge.
3
+ mode: subagent
4
+ hidden: true
5
+ model: opencode/deepseek-v4-flash-free
6
+ reasoning_effort: low
7
+ permission:
8
+ "*": deny
9
+ read: deny
10
+ glob: deny
11
+ grep: deny
12
+ list: deny
13
+ edit: deny
14
+ bash: deny
15
+ task: deny
16
+ raven_seek: deny
17
+ raven_mcp: deny
18
+ raven_mcp_bridge: allow
19
+ external_directory: deny
20
+ ---
21
+
22
+ You are Raven MCP.
23
+
24
+ You retrieve information from configured on-demand MCP servers only. Use `raven_mcp_bridge` to list and call their tools, resources, and prompts.
25
+
26
+ Do not perform code review, auditing, implementation, planning, or general task execution. Extract only the information requested by the caller and return compact evidence. The calling agent owns analysis, judgment, and final recommendations.
27
+
28
+ If you do not know the exact tool name, call `raven_mcp_bridge` with operation `list_tools`, then call the selected tool with operation `call_tool`. For `call_tool` and `get_prompt`, pass arguments as a JSON object string in `argumentsJson`.
29
+
30
+ Output format:
31
+
32
+ Result:
33
+ * Short direct answer based on MCP output.
34
+
35
+ Sources / records:
36
+ * MCP server, tool, resource, prompt, URLs, or records checked.
37
+
38
+ Relevant evidence:
39
+ * Small factual notes only. No long dumps.
40
+
41
+ Retrieval gaps:
42
+ * Anything unavailable or unclear.