opencode-raven 2.1.3 → 2.1.4

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.
Files changed (3) hide show
  1. package/README.md +2 -2
  2. package/index.ts +2 -19
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -285,10 +285,10 @@ MCPs configured directly in OpenCode `opencode.jsonc` still load globally and ma
285
285
  | `chat.message` | Tracks agent to session mapping for allowlist and Raven exclusion. |
286
286
  | `event` | Shows startup update and MCP failure notifications after the TUI event stream is ready. |
287
287
  | `command.execute.before` | Handles `/raven help`, routing commands, MCP commands, update checks, model settings, timeout, and stats. |
288
- | `tool.execute.before` | Hard-blocks configured tools/MCPs for non-Raven, non-excluded agents. Error output gives the next `raven_seek(query="...")` call. Injects dynamic `<raven_guidance>` with configured routes into subagent prompts. |
288
+ | `tool.execute.before` | Hard-blocks configured tools/MCPs for non-Raven, non-excluded agents. Error output gives the next `raven_seek(query="...")` call or recovery instructions if Raven's provider is unavailable. Tracks direct Raven subagent calls for stats. |
289
289
  | `tool.execute.after` | Tracks direct `@Raven` calls for context-saved stats. |
290
290
 
291
- Every non-Raven, non-excluded subagent gets `<raven_guidance>` injected into its prompt at spawn time. The injected guidance includes `routeTools`, auto-detected global MCP prefixes, `routeToolKeywords`, and on-demand MCP capabilities.
291
+ Raven routing guidance is loaded through OpenCode instructions at startup. Subagent prompts are not modified; if a non-Raven agent calls a routed tool, Raven blocks it and returns the exact `raven_seek(query="...")` call to use.
292
292
 
293
293
  ## Agent Capabilities
294
294
 
package/index.ts CHANGED
@@ -531,13 +531,6 @@ export default ((input: PluginInput) => {
531
531
  return config.excludeAgents.some((a) => a.toLowerCase() === lower)
532
532
  }
533
533
 
534
- function ravenGuidance(): string {
535
- const tools = config.routeTools?.length ? config.routeTools.join(", ") : "none"
536
- const mcps = globalMcpServers.length ? globalMcpServers.map((server) => `${server}_*`).join(", ") : "none"
537
- const keywords = config.routeToolKeywords?.length ? config.routeToolKeywords.join(", ") : "none"
538
- return `Some tools/MCPs are routed through Raven to save context. Routed tools: ${tools}. Auto-routed global MCP prefixes: ${mcps}. Routed tool-name keywords: ${keywords}. ${onDemandMcpGuidance("delegate")} If one is blocked, your next tool call should be raven_seek(query="<same request>"). Include the original tool/MCP name and relevant arguments.`
539
- }
540
-
541
534
  function isRouteConfigured(toolName: string): boolean {
542
535
  const tool = toolName.toLowerCase()
543
536
  if (NEVER_ROUTE_TOOLS.has(tool)) return false
@@ -1682,18 +1675,8 @@ Then restart opencode for the model change to take effect. If the task can be co
1682
1675
  if (isExcluded(sessionAgents.get(input.sessionID))) return
1683
1676
  if (config.excludeTools?.some((name) => name.toLowerCase() === input.tool.toLowerCase())) return
1684
1677
 
1685
- // ── Subagent prompt injection: inject Raven guidance into every subagent ──
1686
- if ((input.tool === "task" || input.tool === "subtask") && output.args) {
1687
- const subagentType = input.tool === "task" ? (output.args.subagent_type ?? "") : ""
1688
- if (subagentType === "raven") {
1689
- ravenTaskCalls.add(input.callID)
1690
- }
1691
- if (subagentType !== "raven" && !isExcluded(subagentType)) {
1692
- const field = ["prompt", "description", "request", "objective", "query"].find(
1693
- (f) => f in output.args
1694
- ) ?? "prompt"
1695
- output.args[field] = `${output.args[field] ?? ""}\n\n<raven_guidance>\n${ravenGuidance()}\n</raven_guidance>`
1696
- }
1678
+ if (input.tool === "task" && output.args?.subagent_type === "raven") {
1679
+ ravenTaskCalls.add(input.callID)
1697
1680
  }
1698
1681
 
1699
1682
  // ── Block routed tools/MCPs for non-Raven agents ──
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-raven",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "Ready-to-use search tools and optional on-demand MCPs for OpenCode, routed through Raven to save your main model's context and cost.",
5
5
  "main": "./index.ts",
6
6
  "exports": {