opencode-codebase-index 0.16.0 → 0.17.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +5 -3
- package/dist/cli.cjs +2867 -1792
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +2874 -1793
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +915 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +922 -11
- package/dist/index.js.map +1 -1
- package/dist/pi-extension.cjs +920 -69
- package/dist/pi-extension.cjs.map +1 -1
- package/dist/pi-extension.js +927 -70
- package/dist/pi-extension.js.map +1 -1
- package/native/codebase-index-native.darwin-arm64.node +0 -0
- package/native/codebase-index-native.darwin-x64.node +0 -0
- package/native/codebase-index-native.win32-x64-msvc.node +0 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -229,7 +229,7 @@ Use the same semantic search from any MCP-compatible client. Index once, search
|
|
|
229
229
|
npx -y --package opencode-codebase-index opencode-codebase-index-mcp
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
-
The MCP server exposes all 13 tools (`codebase_context`, `codebase_search`, `codebase_peek`, `find_similar`, `implementation_lookup`, `call_graph`, `call_graph_path`, `pr_impact`, `index_codebase`, `index_status`, `index_health_check`, `index_metrics`, `index_logs`) and 5 prompts (`search`, `find`, `definition`, `index`, `status`).
|
|
232
|
+
The MCP server exposes all 13 tools (`codebase_context`, `codebase_search`, `codebase_peek`, `find_similar`, `implementation_lookup`, `call_graph`, `call_graph_path`, `pr_impact`, `index_codebase`, `index_status`, `index_health_check`, `index_metrics`, `index_logs`) and 5 prompts (`search`, `find`, `definition`, `index`, `status`). Native OpenCode and Pi integrations expose the same `codebase_context` entry point.
|
|
233
233
|
|
|
234
234
|
The tools carry self-routing descriptions so clients can choose the lightweight path without relying on separate documentation:
|
|
235
235
|
|
|
@@ -241,6 +241,8 @@ The tools carry self-routing descriptions so clients can choose the lightweight
|
|
|
241
241
|
6. `grep` for exact identifiers or exhaustive matches
|
|
242
242
|
7. `call_graph` / `call_graph_path` for direct graph queries
|
|
243
243
|
|
|
244
|
+
`codebase_context` accepts a `tokenBudget` from 128 to 4000 tokens, defaulting to 1200. The hard cap is counted with the `cl100k_base` tokenizer, including multilingual and emoji text. It returns deterministic location evidence rather than source bodies, removes overlapping same-file results, diversifies evidence across files, and distinguishes duplicates, result-limit exclusions, and token-budget omissions. Increase the budget only when broader location coverage is useful. Use `implementation_lookup`, `codebase_search`, or a targeted file read for the exact source after selecting a location.
|
|
245
|
+
|
|
244
246
|
The server also publishes this workflow through the standard MCP initialization `instructions` field. Client behavior remains client-controlled: an MCP server can describe and recommend its tools, but cannot force an agent host to read server instructions or invoke a tool before filesystem search. Clients that ignore MCP instructions still receive the routing guidance in each tool description.
|
|
245
247
|
|
|
246
248
|
The MCP dependencies (`@modelcontextprotocol/sdk`, `zod`) ship with the package so published `npx --package opencode-codebase-index` launches work in clean MCP clients.
|
|
@@ -270,8 +272,8 @@ src/api/checkout.ts:89 (Route handler for /pay)
|
|
|
270
272
|
|
|
271
273
|
| Scenario | Tool | Why |
|
|
272
274
|
|----------|------|-----|
|
|
273
|
-
| Don't know the function name | `codebase_context`
|
|
274
|
-
| Exploring unfamiliar codebase | `codebase_context`
|
|
275
|
+
| Don't know the function name | `codebase_context` | Routes conceptual questions to a bounded, low-token evidence pack |
|
|
276
|
+
| Exploring unfamiliar codebase | `codebase_context` | Available natively in OpenCode and Pi, and through MCP for other clients |
|
|
275
277
|
| Just need to find locations | `codebase_peek` (or `codebase_context`) | Returns metadata only, saves ~90% tokens |
|
|
276
278
|
| Need the authoritative definition site | `implementation_lookup` | Prioritizes real implementation definitions over docs/tests |
|
|
277
279
|
| Understand code flow | `call_graph` | Find callers/callees of any function |
|