opencode-codebase-index 0.5.1 → 0.6.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/README.md +226 -107
- package/commands/call-graph.md +24 -0
- package/commands/definition.md +24 -0
- package/dist/cli.cjs +2624 -269
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +2626 -277
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1324 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1325 -81
- package/dist/index.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.linux-arm64-gnu.node +0 -0
- package/native/codebase-index-native.linux-x64-gnu.node +0 -0
- package/native/codebase-index-native.win32-x64-msvc.node +0 -0
- package/package.json +9 -3
- package/skill/SKILL.md +13 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-codebase-index",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Semantic codebase indexing and search for OpenCode - find code by meaning, not just keywords",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -39,8 +39,15 @@
|
|
|
39
39
|
"build:native": "cd native && cargo build --release && napi build --release --platform",
|
|
40
40
|
"build:native:all": "cd native && napi build --release --platform --target x86_64-apple-darwin --target aarch64-apple-darwin --target x86_64-unknown-linux-gnu --target aarch64-unknown-linux-gnu --target x86_64-pc-windows-msvc",
|
|
41
41
|
"dev": "tsup --watch",
|
|
42
|
+
"eval": "npx tsx src/cli.ts eval run",
|
|
43
|
+
"eval:smoke": "npx tsx src/cli.ts eval run --config .github/eval-config.json --reindex --dataset benchmarks/golden/small.json",
|
|
44
|
+
"eval:ci": "npx tsx src/cli.ts eval run --reindex --ci --budget benchmarks/budgets/default.json --against benchmarks/baselines/eval-baseline-summary.json",
|
|
45
|
+
"eval:ci:ollama": "npx tsx src/cli.ts eval run --config .github/eval-ollama-config.json --reindex --ci --budget benchmarks/budgets/default.json --against benchmarks/baselines/eval-baseline-summary.json",
|
|
46
|
+
"eval:compare": "npx tsx src/cli.ts eval compare",
|
|
42
47
|
"test": "vitest",
|
|
48
|
+
"pretest:run": "npm run build:native",
|
|
43
49
|
"test:run": "vitest run",
|
|
50
|
+
"pretest:coverage": "npm run build:native",
|
|
44
51
|
"test:coverage": "vitest run --coverage",
|
|
45
52
|
"lint": "eslint src/",
|
|
46
53
|
"typecheck": "tsc --noEmit",
|
|
@@ -99,5 +106,4 @@
|
|
|
99
106
|
"optional": true
|
|
100
107
|
}
|
|
101
108
|
}
|
|
102
|
-
|
|
103
|
-
}
|
|
109
|
+
}
|
package/skill/SKILL.md
CHANGED
|
@@ -12,6 +12,7 @@ description: Semantic code search by meaning. Use codebase_peek to find WHERE co
|
|
|
12
12
|
| Just need file locations | `codebase_peek` | Metadata only, saves ~90% tokens |
|
|
13
13
|
| Need to see actual code | `codebase_search` | Returns full code content |
|
|
14
14
|
| Find duplicates/patterns | `find_similar` | Given code snippet → similar code |
|
|
15
|
+
| Understand code flow | `call_graph` | Find callers/callees of any function |
|
|
15
16
|
| Don't know function/class names | `codebase_peek` or `codebase_search` | Natural language → code |
|
|
16
17
|
| Know exact identifier names | `grep` | Faster, more precise |
|
|
17
18
|
| Need ALL occurrences | `grep` | Semantic returns top N only |
|
|
@@ -45,8 +46,19 @@ Find code similar to a given snippet. Use for duplicate detection, pattern disco
|
|
|
45
46
|
find_similar(code="function validate(input) { return input.length > 0; }", excludeFile="src/current.ts")
|
|
46
47
|
```
|
|
47
48
|
|
|
49
|
+
### `call_graph`
|
|
50
|
+
Query callers or callees of a function/method. Built automatically during indexing for TypeScript, JavaScript, Python, Go, and Rust.
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
call_graph(name="validateToken", direction="callers")
|
|
54
|
+
call_graph(name="validateToken", direction="callees", symbolId="src/auth.ts::validateToken")
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
- `direction="callers"`: Who calls this function?
|
|
58
|
+
- `direction="callees"`: What does this function call? (requires `symbolId` from a prior callers query)
|
|
59
|
+
|
|
48
60
|
### `index_codebase`
|
|
49
|
-
|
|
61
|
+
Manually trigger indexing. Required before first search. Incremental (~50ms when unchanged).
|
|
50
62
|
|
|
51
63
|
### `index_status`
|
|
52
64
|
Check if indexed and ready.
|