@neuralsea/workspace-indexer 0.1.0 → 0.3.2
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 +51 -4
- package/dist/chunk-GGL3XTMV.js +4487 -0
- package/dist/cli.cjs +4551 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.js +62 -59
- package/dist/index.cjs +4924 -0
- package/dist/index.d.cts +1326 -0
- package/dist/index.d.ts +842 -21
- package/dist/index.js +408 -3
- package/package.json +12 -6
- package/dist/chunk-QPQCSCBN.js +0 -2374
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @neuralsea/workspace-indexer
|
|
2
2
|
|
|
3
3
|
A **local-first**, **multi-repo** workspace indexer for AI agents (e.g. your custom agent “Damocles”).
|
|
4
4
|
|
|
@@ -31,17 +31,21 @@ This package is designed so Damocles can use the same index in different problem
|
|
|
31
31
|
npm i @neuralsea/workspace-indexer
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
Node 18+
|
|
34
|
+
Node 18+ required.
|
|
35
35
|
|
|
36
36
|
---
|
|
37
37
|
|
|
38
38
|
## Quick start (library)
|
|
39
39
|
|
|
40
40
|
```ts
|
|
41
|
-
import { WorkspaceIndexer, OllamaEmbeddingsProvider } from "@neuralsea/workspace-indexer";
|
|
41
|
+
import { WorkspaceIndexer, OllamaEmbeddingsProvider, IndexerProgressObservable } from "@neuralsea/workspace-indexer";
|
|
42
42
|
|
|
43
43
|
const embedder = new OllamaEmbeddingsProvider({ model: "nomic-embed-text" });
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
const progress = new IndexerProgressObservable();
|
|
46
|
+
progress.subscribe(e => console.log(e.type, e));
|
|
47
|
+
|
|
48
|
+
const ix = new WorkspaceIndexer("/path/to/workspace", embedder, { progress });
|
|
45
49
|
|
|
46
50
|
await ix.indexAll();
|
|
47
51
|
|
|
@@ -63,6 +67,26 @@ await ix.closeAsync();
|
|
|
63
67
|
|
|
64
68
|
---
|
|
65
69
|
|
|
70
|
+
## VS Code: high-fidelity symbol graphs (optional)
|
|
71
|
+
|
|
72
|
+
In a VS Code extension, you can pass a `symbolGraphProvider` that uses VS Code (LSP-backed) providers to extract symbols.
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { WorkspaceIndexer, createVSCodeSymbolGraphProvider } from "@neuralsea/workspace-indexer";
|
|
76
|
+
|
|
77
|
+
const symbolGraphProvider = await createVSCodeSymbolGraphProvider({
|
|
78
|
+
languages: ["typescript", "javascript", "python", "go"]
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const ix = new WorkspaceIndexer(workspaceRoot, embedder, {
|
|
82
|
+
symbolGraphProvider: symbolGraphProvider ?? undefined
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
To enable the optional Neo4j graph store, install `neo4j-driver` in your extension/app and set `workspace.graph` in config.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
66
90
|
## CLI
|
|
67
91
|
|
|
68
92
|
### Index a workspace
|
|
@@ -139,6 +163,29 @@ Example: `petri-index.config.json`
|
|
|
139
163
|
|
|
140
164
|
```json
|
|
141
165
|
{
|
|
166
|
+
"workspace": {
|
|
167
|
+
"discovery": {
|
|
168
|
+
"exclude": ["**/vendor/**", "**/node_modules/**"],
|
|
169
|
+
"maxDepth": 8,
|
|
170
|
+
"includeSubmodules": true
|
|
171
|
+
},
|
|
172
|
+
"graph": {
|
|
173
|
+
"provider": "neo4j",
|
|
174
|
+
"neo4j": {
|
|
175
|
+
"uri": "neo4j://localhost:7687",
|
|
176
|
+
"user": "neo4j",
|
|
177
|
+
"password": "password",
|
|
178
|
+
"database": "neo4j",
|
|
179
|
+
"labelPrefix": "Petri"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"repoOverrides": [
|
|
183
|
+
{
|
|
184
|
+
"match": "apps/**",
|
|
185
|
+
"config": { "storage": { "ftsMode": "tokens" } }
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
},
|
|
142
189
|
"storage": {
|
|
143
190
|
"storeText": true,
|
|
144
191
|
"ftsMode": "full"
|