opencode-codebase-index 0.16.0 → 0.17.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.
@@ -10,7 +10,7 @@
10
10
  "name": "codebase-index",
11
11
  "description": "Semantic code search and codebase graph tools for Claude Code",
12
12
  "source": "./",
13
- "version": "0.16.0"
13
+ "version": "0.17.1"
14
14
  }
15
15
  ]
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-index",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "description": "Semantic code search and codebase graph tools for Claude Code",
5
5
  "displayName": "Codebase Index",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-index",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "description": "Semantic code search and codebase graph tools for Codex",
5
5
  "author": {
6
6
  "name": "Kenneth",
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` (MCP) | Routes conceptual questions to low-token discovery first |
274
- | Exploring unfamiliar codebase | `codebase_context` (MCP) | Discovers related code and then guides to definitions or graph queries |
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 |