claude-eidetic 0.1.0 → 0.1.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 +333 -0
- package/dist/config.d.ts +25 -0
- package/dist/config.js +29 -14
- package/dist/core/cleanup.d.ts +8 -0
- package/dist/core/cleanup.js +41 -0
- package/dist/core/doc-indexer.d.ts +13 -0
- package/dist/core/doc-indexer.js +76 -0
- package/dist/core/doc-searcher.d.ts +13 -0
- package/dist/core/doc-searcher.js +65 -0
- package/dist/core/file-category.d.ts +7 -0
- package/dist/core/file-category.js +75 -0
- package/dist/core/indexer.js +12 -4
- package/dist/core/preview.d.ts +1 -2
- package/dist/core/preview.js +2 -5
- package/dist/core/repo-map.d.ts +33 -0
- package/dist/core/repo-map.js +144 -0
- package/dist/core/searcher.d.ts +1 -13
- package/dist/core/searcher.js +20 -24
- package/dist/core/snapshot-io.js +2 -2
- package/dist/core/sync.d.ts +5 -25
- package/dist/core/sync.js +90 -65
- package/dist/core/targeted-indexer.d.ts +19 -0
- package/dist/core/targeted-indexer.js +127 -0
- package/dist/embedding/factory.d.ts +0 -13
- package/dist/embedding/factory.js +0 -17
- package/dist/embedding/openai.d.ts +2 -14
- package/dist/embedding/openai.js +7 -20
- package/dist/errors.d.ts +2 -0
- package/dist/errors.js +2 -0
- package/dist/format.d.ts +12 -0
- package/dist/format.js +160 -31
- package/dist/hooks/post-tool-use.d.ts +13 -0
- package/dist/hooks/post-tool-use.js +113 -0
- package/dist/hooks/stop-hook.d.ts +11 -0
- package/dist/hooks/stop-hook.js +121 -0
- package/dist/hooks/targeted-runner.d.ts +11 -0
- package/dist/hooks/targeted-runner.js +66 -0
- package/dist/index.js +102 -24
- package/dist/infra/qdrant-bootstrap.js +14 -12
- package/dist/memory/history.d.ts +19 -0
- package/dist/memory/history.js +40 -0
- package/dist/memory/llm.d.ts +2 -0
- package/dist/memory/llm.js +56 -0
- package/dist/memory/prompts.d.ts +5 -0
- package/dist/memory/prompts.js +36 -0
- package/dist/memory/reconciler.d.ts +12 -0
- package/dist/memory/reconciler.js +36 -0
- package/dist/memory/store.d.ts +20 -0
- package/dist/memory/store.js +206 -0
- package/dist/memory/types.d.ts +28 -0
- package/dist/memory/types.js +2 -0
- package/dist/paths.d.ts +3 -4
- package/dist/paths.js +14 -4
- package/dist/precompact/hook.d.ts +9 -0
- package/dist/precompact/hook.js +170 -0
- package/dist/precompact/index-runner.d.ts +9 -0
- package/dist/precompact/index-runner.js +52 -0
- package/dist/precompact/note-writer.d.ts +15 -0
- package/dist/precompact/note-writer.js +109 -0
- package/dist/precompact/session-indexer.d.ts +13 -0
- package/dist/precompact/session-indexer.js +31 -0
- package/dist/precompact/tier0-inject.d.ts +16 -0
- package/dist/precompact/tier0-inject.js +88 -0
- package/dist/precompact/tier0-writer.d.ts +16 -0
- package/dist/precompact/tier0-writer.js +74 -0
- package/dist/precompact/transcript-parser.d.ts +10 -0
- package/dist/precompact/transcript-parser.js +148 -0
- package/dist/precompact/types.d.ts +93 -0
- package/dist/precompact/types.js +5 -0
- package/dist/precompact/utils.d.ts +29 -0
- package/dist/precompact/utils.js +95 -0
- package/dist/setup-message.d.ts +3 -0
- package/dist/setup-message.js +42 -0
- package/dist/splitter/ast.js +84 -22
- package/dist/splitter/line.d.ts +0 -4
- package/dist/splitter/line.js +1 -7
- package/dist/splitter/symbol-extract.d.ts +16 -0
- package/dist/splitter/symbol-extract.js +61 -0
- package/dist/splitter/types.d.ts +5 -0
- package/dist/splitter/types.js +1 -1
- package/dist/state/doc-metadata.d.ts +18 -0
- package/dist/state/doc-metadata.js +59 -0
- package/dist/state/registry.d.ts +1 -3
- package/dist/state/snapshot.d.ts +0 -1
- package/dist/state/snapshot.js +3 -19
- package/dist/tool-schemas.d.ts +251 -1
- package/dist/tool-schemas.js +307 -0
- package/dist/tools.d.ts +69 -0
- package/dist/tools.js +286 -17
- package/dist/vectordb/milvus.d.ts +7 -5
- package/dist/vectordb/milvus.js +116 -19
- package/dist/vectordb/qdrant.d.ts +8 -10
- package/dist/vectordb/qdrant.js +105 -33
- package/dist/vectordb/types.d.ts +20 -0
- package/messages.yaml +50 -0
- package/package.json +31 -6
package/dist/tool-schemas.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare const TOOL_DEFINITIONS: readonly [{
|
|
|
43
43
|
};
|
|
44
44
|
}, {
|
|
45
45
|
readonly name: "search_code";
|
|
46
|
-
readonly description: "Search the indexed codebase using natural language queries.\n\nProvide either `path` (absolute) or `project` (name). Use `list_indexed` to see registered projects.\n\nWhen to Use:\n- Code search: Find specific functions, classes, or implementations\n- Context-aware assistance: Gather relevant code context before making changes\n- Issue identification: Locate problematic code sections or bugs\n- Code review: Understand existing implementations and patterns\n- Refactoring: Find all related code pieces that need to be updated\n- Feature development: Understand existing architecture and similar implementations\n- Duplicate detection: Identify redundant or duplicated code patterns\n\nIf the codebase is not indexed, this tool will return a clear error message indicating that indexing is required first.";
|
|
46
|
+
readonly description: "Search the indexed codebase using natural language queries.\nPrefer over Grep for conceptual/semantic queries — returns ~20 tokens/result vs ~100+ for Grep.\nTry before launching an Explore agent — faster and cheaper for understanding code.\n\nProvide either `path` (absolute) or `project` (name). Use `list_indexed` to see registered projects.\n\nWhen to Use:\n- Code search: Find specific functions, classes, or implementations\n- Context-aware assistance: Gather relevant code context before making changes\n- Issue identification: Locate problematic code sections or bugs\n- Code review: Understand existing implementations and patterns\n- Refactoring: Find all related code pieces that need to be updated\n- Feature development: Understand existing architecture and similar implementations\n- Duplicate detection: Identify redundant or duplicated code patterns\n\nIf the codebase is not indexed, this tool will return a clear error message indicating that indexing is required first.";
|
|
47
47
|
readonly inputSchema: {
|
|
48
48
|
readonly type: "object";
|
|
49
49
|
readonly properties: {
|
|
@@ -123,6 +123,256 @@ export declare const TOOL_DEFINITIONS: readonly [{
|
|
|
123
123
|
readonly properties: {};
|
|
124
124
|
readonly required: readonly [];
|
|
125
125
|
};
|
|
126
|
+
}, {
|
|
127
|
+
readonly name: "cleanup_vectors";
|
|
128
|
+
readonly description: "Remove orphaned vectors for files that no longer exist on disk. Lightweight alternative to re-indexing — no embedding cost.\n\nProvide either `path` (absolute) or `project` (name). Use `list_indexed` to see registered projects.\n\nUse `dryRun=true` first to preview which files would be cleaned without making any changes.";
|
|
129
|
+
readonly inputSchema: {
|
|
130
|
+
readonly type: "object";
|
|
131
|
+
readonly properties: {
|
|
132
|
+
readonly path: {
|
|
133
|
+
readonly type: "string";
|
|
134
|
+
readonly description: "Absolute path to the codebase directory.";
|
|
135
|
+
};
|
|
136
|
+
readonly project: {
|
|
137
|
+
readonly type: "string";
|
|
138
|
+
readonly description: "Project name (resolves via registry). Use list_indexed to see registered projects.";
|
|
139
|
+
};
|
|
140
|
+
readonly dryRun: {
|
|
141
|
+
readonly type: "boolean";
|
|
142
|
+
readonly description: "List files that would be cleaned without actually deleting any vectors.";
|
|
143
|
+
readonly default: false;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
readonly required: readonly [];
|
|
147
|
+
};
|
|
148
|
+
}, {
|
|
149
|
+
readonly name: "index_document";
|
|
150
|
+
readonly description: "Cache external documentation (from query-docs, WebFetch, etc.) for cheap semantic search later.\n\nAfter fetching documentation from an external source, call this tool to store it. Subsequent queries about the same library will use search_documents (~20 tokens/result) instead of re-fetching (~5K+ tokens).\n\nThe content is split into chunks, embedded, and stored in a vector collection grouped by library. A TTL tracks staleness — stale docs still return results but are flagged.";
|
|
151
|
+
readonly inputSchema: {
|
|
152
|
+
readonly type: "object";
|
|
153
|
+
readonly properties: {
|
|
154
|
+
readonly content: {
|
|
155
|
+
readonly type: "string";
|
|
156
|
+
readonly description: "The full text content of the documentation to cache.";
|
|
157
|
+
};
|
|
158
|
+
readonly source: {
|
|
159
|
+
readonly type: "string";
|
|
160
|
+
readonly description: "Source URL or identifier (e.g., \"https://docs.langfuse.com/guides/evaluators\" or \"context7:langfuse/hooks\").";
|
|
161
|
+
};
|
|
162
|
+
readonly library: {
|
|
163
|
+
readonly type: "string";
|
|
164
|
+
readonly description: "Library name (e.g., \"react\", \"langfuse\"). Used for collection grouping.";
|
|
165
|
+
};
|
|
166
|
+
readonly topic: {
|
|
167
|
+
readonly type: "string";
|
|
168
|
+
readonly description: "Topic within the library (e.g., \"hooks\", \"evaluators\").";
|
|
169
|
+
};
|
|
170
|
+
readonly ttlDays: {
|
|
171
|
+
readonly type: "number";
|
|
172
|
+
readonly description: "Days before the cached content is considered stale.";
|
|
173
|
+
readonly default: 7;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
readonly required: readonly ["content", "source", "library", "topic"];
|
|
177
|
+
};
|
|
178
|
+
}, {
|
|
179
|
+
readonly name: "search_documents";
|
|
180
|
+
readonly description: "Search cached documentation using natural language queries.\n\nReturns results from previously cached documentation (via index_document). Much cheaper than re-fetching docs (~20 tokens/result vs ~5K+ tokens/fetch).\n\nIf a specific library is provided, searches only that library's collection. Otherwise searches across all cached documentation. Results include staleness indicators.";
|
|
181
|
+
readonly inputSchema: {
|
|
182
|
+
readonly type: "object";
|
|
183
|
+
readonly properties: {
|
|
184
|
+
readonly query: {
|
|
185
|
+
readonly type: "string";
|
|
186
|
+
readonly description: "Natural language query to search cached documentation.";
|
|
187
|
+
};
|
|
188
|
+
readonly library: {
|
|
189
|
+
readonly type: "string";
|
|
190
|
+
readonly description: "Optional: limit search to a specific library (e.g., \"langfuse\"). Omit to search all cached docs.";
|
|
191
|
+
};
|
|
192
|
+
readonly limit: {
|
|
193
|
+
readonly type: "number";
|
|
194
|
+
readonly description: "Maximum number of results to return.";
|
|
195
|
+
readonly default: 5;
|
|
196
|
+
readonly maximum: 20;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
readonly required: readonly ["query"];
|
|
200
|
+
};
|
|
201
|
+
}, {
|
|
202
|
+
readonly name: "read_file";
|
|
203
|
+
readonly description: "Read a file and return raw content without line-number overhead (~15-20% fewer tokens than built-in Read for code, more for short-line files).\n\nUse offset and limit to page through large files. Add lineNumbers=true only when you need line references for editing.";
|
|
204
|
+
readonly inputSchema: {
|
|
205
|
+
readonly type: "object";
|
|
206
|
+
readonly properties: {
|
|
207
|
+
readonly path: {
|
|
208
|
+
readonly type: "string";
|
|
209
|
+
readonly description: "Absolute file path to read.";
|
|
210
|
+
};
|
|
211
|
+
readonly offset: {
|
|
212
|
+
readonly type: "number";
|
|
213
|
+
readonly description: "1-based line number to start reading from.";
|
|
214
|
+
readonly default: 1;
|
|
215
|
+
};
|
|
216
|
+
readonly limit: {
|
|
217
|
+
readonly type: "number";
|
|
218
|
+
readonly description: "Maximum number of lines to return.";
|
|
219
|
+
readonly default: 5000;
|
|
220
|
+
readonly maximum: 10000;
|
|
221
|
+
};
|
|
222
|
+
readonly lineNumbers: {
|
|
223
|
+
readonly type: "boolean";
|
|
224
|
+
readonly description: "Prefix each line with its line number. Only enable when you need line references for editing.";
|
|
225
|
+
readonly default: false;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
readonly required: readonly ["path"];
|
|
229
|
+
};
|
|
230
|
+
}, {
|
|
231
|
+
readonly name: "add_memory";
|
|
232
|
+
readonly description: "Extract and store developer knowledge from text. Uses LLM to identify facts about coding style, tools, architecture, conventions, debugging insights, and workflow preferences. Automatically deduplicates against existing memories.";
|
|
233
|
+
readonly inputSchema: {
|
|
234
|
+
readonly type: "object";
|
|
235
|
+
readonly properties: {
|
|
236
|
+
readonly content: {
|
|
237
|
+
readonly type: "string";
|
|
238
|
+
readonly description: "Text containing developer knowledge to extract and store (conversation snippets, notes, preferences).";
|
|
239
|
+
};
|
|
240
|
+
readonly source: {
|
|
241
|
+
readonly type: "string";
|
|
242
|
+
readonly description: "Optional source identifier (e.g., \"conversation\", \"claude-code\", \"user-note\").";
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
readonly required: readonly ["content"];
|
|
246
|
+
};
|
|
247
|
+
}, {
|
|
248
|
+
readonly name: "search_memory";
|
|
249
|
+
readonly description: "Search stored developer memories using natural language. Returns semantically similar memories ranked by relevance.";
|
|
250
|
+
readonly inputSchema: {
|
|
251
|
+
readonly type: "object";
|
|
252
|
+
readonly properties: {
|
|
253
|
+
readonly query: {
|
|
254
|
+
readonly type: "string";
|
|
255
|
+
readonly description: "Natural language query to search memories.";
|
|
256
|
+
};
|
|
257
|
+
readonly limit: {
|
|
258
|
+
readonly type: "number";
|
|
259
|
+
readonly description: "Maximum number of results.";
|
|
260
|
+
readonly default: 10;
|
|
261
|
+
readonly maximum: 50;
|
|
262
|
+
};
|
|
263
|
+
readonly category: {
|
|
264
|
+
readonly type: "string";
|
|
265
|
+
readonly description: "Filter by category: coding_style, tools, architecture, conventions, debugging, workflow, preferences.";
|
|
266
|
+
readonly enum: readonly ["coding_style", "tools", "architecture", "conventions", "debugging", "workflow", "preferences"];
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
readonly required: readonly ["query"];
|
|
270
|
+
};
|
|
271
|
+
}, {
|
|
272
|
+
readonly name: "list_memories";
|
|
273
|
+
readonly description: "List all stored developer memories, optionally filtered by category.";
|
|
274
|
+
readonly inputSchema: {
|
|
275
|
+
readonly type: "object";
|
|
276
|
+
readonly properties: {
|
|
277
|
+
readonly category: {
|
|
278
|
+
readonly type: "string";
|
|
279
|
+
readonly description: "Filter by category: coding_style, tools, architecture, conventions, debugging, workflow, preferences.";
|
|
280
|
+
readonly enum: readonly ["coding_style", "tools", "architecture", "conventions", "debugging", "workflow", "preferences"];
|
|
281
|
+
};
|
|
282
|
+
readonly limit: {
|
|
283
|
+
readonly type: "number";
|
|
284
|
+
readonly description: "Maximum number of memories to return.";
|
|
285
|
+
readonly default: 50;
|
|
286
|
+
readonly maximum: 100;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
readonly required: readonly [];
|
|
290
|
+
};
|
|
291
|
+
}, {
|
|
292
|
+
readonly name: "delete_memory";
|
|
293
|
+
readonly description: "Delete a specific memory by its ID.";
|
|
294
|
+
readonly inputSchema: {
|
|
295
|
+
readonly type: "object";
|
|
296
|
+
readonly properties: {
|
|
297
|
+
readonly id: {
|
|
298
|
+
readonly type: "string";
|
|
299
|
+
readonly description: "The UUID of the memory to delete.";
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
readonly required: readonly ["id"];
|
|
303
|
+
};
|
|
304
|
+
}, {
|
|
305
|
+
readonly name: "memory_history";
|
|
306
|
+
readonly description: "View the change history for a specific memory (additions, updates, deletions).";
|
|
307
|
+
readonly inputSchema: {
|
|
308
|
+
readonly type: "object";
|
|
309
|
+
readonly properties: {
|
|
310
|
+
readonly id: {
|
|
311
|
+
readonly type: "string";
|
|
312
|
+
readonly description: "The UUID of the memory to view history for.";
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
readonly required: readonly ["id"];
|
|
316
|
+
};
|
|
317
|
+
}, {
|
|
318
|
+
readonly name: "browse_structure";
|
|
319
|
+
readonly description: "Show a condensed structural map of the indexed codebase — classes, functions, methods with signatures, grouped by file.\nPrefer over Glob + Read cascades for understanding architecture — one call vs many.\n\nProvide either `path` (absolute) or `project` (name). Use `list_indexed` to see registered projects.";
|
|
320
|
+
readonly inputSchema: {
|
|
321
|
+
readonly type: "object";
|
|
322
|
+
readonly properties: {
|
|
323
|
+
readonly path: {
|
|
324
|
+
readonly type: "string";
|
|
325
|
+
readonly description: "Absolute path to the codebase directory.";
|
|
326
|
+
};
|
|
327
|
+
readonly project: {
|
|
328
|
+
readonly type: "string";
|
|
329
|
+
readonly description: "Project name (resolves via registry). Use list_indexed to see registered projects.";
|
|
330
|
+
};
|
|
331
|
+
readonly pathFilter: {
|
|
332
|
+
readonly type: "string";
|
|
333
|
+
readonly description: "Glob pattern to filter by file path (e.g., \"src/core/**\", \"**/*.ts\").";
|
|
334
|
+
};
|
|
335
|
+
readonly kind: {
|
|
336
|
+
readonly type: "string";
|
|
337
|
+
readonly description: "Filter by symbol kind: function, class, interface, method, type, enum, etc.";
|
|
338
|
+
};
|
|
339
|
+
readonly maxTokens: {
|
|
340
|
+
readonly type: "number";
|
|
341
|
+
readonly description: "Approximate token budget for the output (1 token ≈ 4 chars). Default: 4000.";
|
|
342
|
+
readonly default: 4000;
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
readonly required: readonly [];
|
|
346
|
+
};
|
|
347
|
+
}, {
|
|
348
|
+
readonly name: "list_symbols";
|
|
349
|
+
readonly description: "List symbols (functions, classes, methods, etc.) from the indexed codebase as a compact table. Supports filtering by name, kind, or path.\n\nProvide either `path` (absolute) or `project` (name). Use `list_indexed` to see registered projects.";
|
|
350
|
+
readonly inputSchema: {
|
|
351
|
+
readonly type: "object";
|
|
352
|
+
readonly properties: {
|
|
353
|
+
readonly path: {
|
|
354
|
+
readonly type: "string";
|
|
355
|
+
readonly description: "Absolute path to the codebase directory.";
|
|
356
|
+
};
|
|
357
|
+
readonly project: {
|
|
358
|
+
readonly type: "string";
|
|
359
|
+
readonly description: "Project name (resolves via registry). Use list_indexed to see registered projects.";
|
|
360
|
+
};
|
|
361
|
+
readonly pathFilter: {
|
|
362
|
+
readonly type: "string";
|
|
363
|
+
readonly description: "Glob pattern to filter by file path (e.g., \"src/core/**\").";
|
|
364
|
+
};
|
|
365
|
+
readonly kind: {
|
|
366
|
+
readonly type: "string";
|
|
367
|
+
readonly description: "Filter by symbol kind: function, class, interface, method, type, enum, etc.";
|
|
368
|
+
};
|
|
369
|
+
readonly nameFilter: {
|
|
370
|
+
readonly type: "string";
|
|
371
|
+
readonly description: "Substring filter on symbol name (case-insensitive).";
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
readonly required: readonly [];
|
|
375
|
+
};
|
|
126
376
|
}, {
|
|
127
377
|
readonly name: "__IMPORTANT";
|
|
128
378
|
readonly description: "Workflow guidance for efficient code search. ALWAYS index before searching. Use project names after first index. Use extensionFilter to narrow results.";
|
package/dist/tool-schemas.js
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
const READ_FILE_DESCRIPTION = `\
|
|
2
|
+
Read a file and return raw content without line-number overhead (~15-20% fewer tokens than built-in Read for code, more for short-line files).
|
|
3
|
+
|
|
4
|
+
Use offset and limit to page through large files. \
|
|
5
|
+
Add lineNumbers=true only when you need line references for editing.`;
|
|
6
|
+
const INDEX_DOCUMENT_DESCRIPTION = `\
|
|
7
|
+
Cache external documentation (from query-docs, WebFetch, etc.) for cheap semantic search later.
|
|
8
|
+
|
|
9
|
+
After fetching documentation from an external source, call this tool to store it. \
|
|
10
|
+
Subsequent queries about the same library will use search_documents (~20 tokens/result) \
|
|
11
|
+
instead of re-fetching (~5K+ tokens).
|
|
12
|
+
|
|
13
|
+
The content is split into chunks, embedded, and stored in a vector collection grouped by library. \
|
|
14
|
+
A TTL tracks staleness — stale docs still return results but are flagged.`;
|
|
15
|
+
const SEARCH_DOCUMENTS_DESCRIPTION = `\
|
|
16
|
+
Search cached documentation using natural language queries.
|
|
17
|
+
|
|
18
|
+
Returns results from previously cached documentation (via index_document). \
|
|
19
|
+
Much cheaper than re-fetching docs (~20 tokens/result vs ~5K+ tokens/fetch).
|
|
20
|
+
|
|
21
|
+
If a specific library is provided, searches only that library's collection. \
|
|
22
|
+
Otherwise searches across all cached documentation. Results include staleness indicators.`;
|
|
23
|
+
const CLEANUP_DESCRIPTION = `\
|
|
24
|
+
Remove orphaned vectors for files that no longer exist on disk. Lightweight alternative to re-indexing — no embedding cost.
|
|
25
|
+
|
|
26
|
+
Provide either \`path\` (absolute) or \`project\` (name). Use \`list_indexed\` to see registered projects.
|
|
27
|
+
|
|
28
|
+
Use \`dryRun=true\` first to preview which files would be cleaned without making any changes.`;
|
|
1
29
|
const INDEX_DESCRIPTION = `\
|
|
2
30
|
Index a codebase directory to enable semantic search using a configurable code splitter.
|
|
3
31
|
|
|
@@ -10,6 +38,8 @@ Usage Guidance:
|
|
|
10
38
|
you MUST prompt the user to confirm whether to proceed with a force index.`;
|
|
11
39
|
const SEARCH_DESCRIPTION = `\
|
|
12
40
|
Search the indexed codebase using natural language queries.
|
|
41
|
+
Prefer over Grep for conceptual/semantic queries — returns ~20 tokens/result vs ~100+ for Grep.
|
|
42
|
+
Try before launching an Explore agent — faster and cheaper for understanding code.
|
|
13
43
|
|
|
14
44
|
Provide either \`path\` (absolute) or \`project\` (name). Use \`list_indexed\` to see registered projects.
|
|
15
45
|
|
|
@@ -149,6 +179,283 @@ export const TOOL_DEFINITIONS = [
|
|
|
149
179
|
required: [],
|
|
150
180
|
},
|
|
151
181
|
},
|
|
182
|
+
{
|
|
183
|
+
name: 'cleanup_vectors',
|
|
184
|
+
description: CLEANUP_DESCRIPTION,
|
|
185
|
+
inputSchema: {
|
|
186
|
+
type: 'object',
|
|
187
|
+
properties: {
|
|
188
|
+
path: {
|
|
189
|
+
type: 'string',
|
|
190
|
+
description: 'Absolute path to the codebase directory.',
|
|
191
|
+
},
|
|
192
|
+
project: {
|
|
193
|
+
type: 'string',
|
|
194
|
+
description: 'Project name (resolves via registry). Use list_indexed to see registered projects.',
|
|
195
|
+
},
|
|
196
|
+
dryRun: {
|
|
197
|
+
type: 'boolean',
|
|
198
|
+
description: 'List files that would be cleaned without actually deleting any vectors.',
|
|
199
|
+
default: false,
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
required: [],
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: 'index_document',
|
|
207
|
+
description: INDEX_DOCUMENT_DESCRIPTION,
|
|
208
|
+
inputSchema: {
|
|
209
|
+
type: 'object',
|
|
210
|
+
properties: {
|
|
211
|
+
content: {
|
|
212
|
+
type: 'string',
|
|
213
|
+
description: 'The full text content of the documentation to cache.',
|
|
214
|
+
},
|
|
215
|
+
source: {
|
|
216
|
+
type: 'string',
|
|
217
|
+
description: 'Source URL or identifier (e.g., "https://docs.langfuse.com/guides/evaluators" or "context7:langfuse/hooks").',
|
|
218
|
+
},
|
|
219
|
+
library: {
|
|
220
|
+
type: 'string',
|
|
221
|
+
description: 'Library name (e.g., "react", "langfuse"). Used for collection grouping.',
|
|
222
|
+
},
|
|
223
|
+
topic: {
|
|
224
|
+
type: 'string',
|
|
225
|
+
description: 'Topic within the library (e.g., "hooks", "evaluators").',
|
|
226
|
+
},
|
|
227
|
+
ttlDays: {
|
|
228
|
+
type: 'number',
|
|
229
|
+
description: 'Days before the cached content is considered stale.',
|
|
230
|
+
default: 7,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
required: ['content', 'source', 'library', 'topic'],
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: 'search_documents',
|
|
238
|
+
description: SEARCH_DOCUMENTS_DESCRIPTION,
|
|
239
|
+
inputSchema: {
|
|
240
|
+
type: 'object',
|
|
241
|
+
properties: {
|
|
242
|
+
query: {
|
|
243
|
+
type: 'string',
|
|
244
|
+
description: 'Natural language query to search cached documentation.',
|
|
245
|
+
},
|
|
246
|
+
library: {
|
|
247
|
+
type: 'string',
|
|
248
|
+
description: 'Optional: limit search to a specific library (e.g., "langfuse"). Omit to search all cached docs.',
|
|
249
|
+
},
|
|
250
|
+
limit: {
|
|
251
|
+
type: 'number',
|
|
252
|
+
description: 'Maximum number of results to return.',
|
|
253
|
+
default: 5,
|
|
254
|
+
maximum: 20,
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
required: ['query'],
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: 'read_file',
|
|
262
|
+
description: READ_FILE_DESCRIPTION,
|
|
263
|
+
inputSchema: {
|
|
264
|
+
type: 'object',
|
|
265
|
+
properties: {
|
|
266
|
+
path: {
|
|
267
|
+
type: 'string',
|
|
268
|
+
description: 'Absolute file path to read.',
|
|
269
|
+
},
|
|
270
|
+
offset: {
|
|
271
|
+
type: 'number',
|
|
272
|
+
description: '1-based line number to start reading from.',
|
|
273
|
+
default: 1,
|
|
274
|
+
},
|
|
275
|
+
limit: {
|
|
276
|
+
type: 'number',
|
|
277
|
+
description: 'Maximum number of lines to return.',
|
|
278
|
+
default: 5000,
|
|
279
|
+
maximum: 10000,
|
|
280
|
+
},
|
|
281
|
+
lineNumbers: {
|
|
282
|
+
type: 'boolean',
|
|
283
|
+
description: 'Prefix each line with its line number. Only enable when you need line references for editing.',
|
|
284
|
+
default: false,
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
required: ['path'],
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: 'add_memory',
|
|
292
|
+
description: 'Extract and store developer knowledge from text. Uses LLM to identify facts about coding style, tools, architecture, conventions, debugging insights, and workflow preferences. Automatically deduplicates against existing memories.',
|
|
293
|
+
inputSchema: {
|
|
294
|
+
type: 'object',
|
|
295
|
+
properties: {
|
|
296
|
+
content: {
|
|
297
|
+
type: 'string',
|
|
298
|
+
description: 'Text containing developer knowledge to extract and store (conversation snippets, notes, preferences).',
|
|
299
|
+
},
|
|
300
|
+
source: {
|
|
301
|
+
type: 'string',
|
|
302
|
+
description: 'Optional source identifier (e.g., "conversation", "claude-code", "user-note").',
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
required: ['content'],
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: 'search_memory',
|
|
310
|
+
description: 'Search stored developer memories using natural language. Returns semantically similar memories ranked by relevance.',
|
|
311
|
+
inputSchema: {
|
|
312
|
+
type: 'object',
|
|
313
|
+
properties: {
|
|
314
|
+
query: {
|
|
315
|
+
type: 'string',
|
|
316
|
+
description: 'Natural language query to search memories.',
|
|
317
|
+
},
|
|
318
|
+
limit: {
|
|
319
|
+
type: 'number',
|
|
320
|
+
description: 'Maximum number of results.',
|
|
321
|
+
default: 10,
|
|
322
|
+
maximum: 50,
|
|
323
|
+
},
|
|
324
|
+
category: {
|
|
325
|
+
type: 'string',
|
|
326
|
+
description: 'Filter by category: coding_style, tools, architecture, conventions, debugging, workflow, preferences.',
|
|
327
|
+
enum: [
|
|
328
|
+
'coding_style',
|
|
329
|
+
'tools',
|
|
330
|
+
'architecture',
|
|
331
|
+
'conventions',
|
|
332
|
+
'debugging',
|
|
333
|
+
'workflow',
|
|
334
|
+
'preferences',
|
|
335
|
+
],
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
required: ['query'],
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: 'list_memories',
|
|
343
|
+
description: 'List all stored developer memories, optionally filtered by category.',
|
|
344
|
+
inputSchema: {
|
|
345
|
+
type: 'object',
|
|
346
|
+
properties: {
|
|
347
|
+
category: {
|
|
348
|
+
type: 'string',
|
|
349
|
+
description: 'Filter by category: coding_style, tools, architecture, conventions, debugging, workflow, preferences.',
|
|
350
|
+
enum: [
|
|
351
|
+
'coding_style',
|
|
352
|
+
'tools',
|
|
353
|
+
'architecture',
|
|
354
|
+
'conventions',
|
|
355
|
+
'debugging',
|
|
356
|
+
'workflow',
|
|
357
|
+
'preferences',
|
|
358
|
+
],
|
|
359
|
+
},
|
|
360
|
+
limit: {
|
|
361
|
+
type: 'number',
|
|
362
|
+
description: 'Maximum number of memories to return.',
|
|
363
|
+
default: 50,
|
|
364
|
+
maximum: 100,
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
required: [],
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
name: 'delete_memory',
|
|
372
|
+
description: 'Delete a specific memory by its ID.',
|
|
373
|
+
inputSchema: {
|
|
374
|
+
type: 'object',
|
|
375
|
+
properties: {
|
|
376
|
+
id: {
|
|
377
|
+
type: 'string',
|
|
378
|
+
description: 'The UUID of the memory to delete.',
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
required: ['id'],
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
name: 'memory_history',
|
|
386
|
+
description: 'View the change history for a specific memory (additions, updates, deletions).',
|
|
387
|
+
inputSchema: {
|
|
388
|
+
type: 'object',
|
|
389
|
+
properties: {
|
|
390
|
+
id: {
|
|
391
|
+
type: 'string',
|
|
392
|
+
description: 'The UUID of the memory to view history for.',
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
required: ['id'],
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: 'browse_structure',
|
|
400
|
+
description: 'Show a condensed structural map of the indexed codebase — classes, functions, methods with signatures, grouped by file.\nPrefer over Glob + Read cascades for understanding architecture — one call vs many.\n\nProvide either `path` (absolute) or `project` (name). Use `list_indexed` to see registered projects.',
|
|
401
|
+
inputSchema: {
|
|
402
|
+
type: 'object',
|
|
403
|
+
properties: {
|
|
404
|
+
path: {
|
|
405
|
+
type: 'string',
|
|
406
|
+
description: 'Absolute path to the codebase directory.',
|
|
407
|
+
},
|
|
408
|
+
project: {
|
|
409
|
+
type: 'string',
|
|
410
|
+
description: 'Project name (resolves via registry). Use list_indexed to see registered projects.',
|
|
411
|
+
},
|
|
412
|
+
pathFilter: {
|
|
413
|
+
type: 'string',
|
|
414
|
+
description: 'Glob pattern to filter by file path (e.g., "src/core/**", "**/*.ts").',
|
|
415
|
+
},
|
|
416
|
+
kind: {
|
|
417
|
+
type: 'string',
|
|
418
|
+
description: 'Filter by symbol kind: function, class, interface, method, type, enum, etc.',
|
|
419
|
+
},
|
|
420
|
+
maxTokens: {
|
|
421
|
+
type: 'number',
|
|
422
|
+
description: 'Approximate token budget for the output (1 token ≈ 4 chars). Default: 4000.',
|
|
423
|
+
default: 4000,
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
required: [],
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
name: 'list_symbols',
|
|
431
|
+
description: 'List symbols (functions, classes, methods, etc.) from the indexed codebase as a compact table. Supports filtering by name, kind, or path.\n\nProvide either `path` (absolute) or `project` (name). Use `list_indexed` to see registered projects.',
|
|
432
|
+
inputSchema: {
|
|
433
|
+
type: 'object',
|
|
434
|
+
properties: {
|
|
435
|
+
path: {
|
|
436
|
+
type: 'string',
|
|
437
|
+
description: 'Absolute path to the codebase directory.',
|
|
438
|
+
},
|
|
439
|
+
project: {
|
|
440
|
+
type: 'string',
|
|
441
|
+
description: 'Project name (resolves via registry). Use list_indexed to see registered projects.',
|
|
442
|
+
},
|
|
443
|
+
pathFilter: {
|
|
444
|
+
type: 'string',
|
|
445
|
+
description: 'Glob pattern to filter by file path (e.g., "src/core/**").',
|
|
446
|
+
},
|
|
447
|
+
kind: {
|
|
448
|
+
type: 'string',
|
|
449
|
+
description: 'Filter by symbol kind: function, class, interface, method, type, enum, etc.',
|
|
450
|
+
},
|
|
451
|
+
nameFilter: {
|
|
452
|
+
type: 'string',
|
|
453
|
+
description: 'Substring filter on symbol name (case-insensitive).',
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
required: [],
|
|
457
|
+
},
|
|
458
|
+
},
|
|
152
459
|
{
|
|
153
460
|
name: '__IMPORTANT',
|
|
154
461
|
description: 'Workflow guidance for efficient code search. ALWAYS index before searching. Use project names after first index. Use extensionFilter to narrow results.',
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { StateManager } from './state/snapshot.js';
|
|
2
2
|
import type { Embedding } from './embedding/types.js';
|
|
3
3
|
import type { VectorDB } from './vectordb/types.js';
|
|
4
|
+
import type { MemoryStore } from './memory/store.js';
|
|
4
5
|
export declare class ToolHandlers {
|
|
5
6
|
private embedding;
|
|
6
7
|
private vectordb;
|
|
7
8
|
private state;
|
|
9
|
+
private memoryStore;
|
|
8
10
|
constructor(embedding: Embedding, vectordb: VectorDB, state: StateManager);
|
|
11
|
+
setMemoryStore(store: MemoryStore): void;
|
|
9
12
|
handleIndexCodebase(args: Record<string, unknown>): Promise<{
|
|
10
13
|
content: {
|
|
11
14
|
type: string;
|
|
@@ -36,5 +39,71 @@ export declare class ToolHandlers {
|
|
|
36
39
|
text: string;
|
|
37
40
|
}[];
|
|
38
41
|
}>;
|
|
42
|
+
handleCleanupVectors(args: Record<string, unknown>): Promise<{
|
|
43
|
+
content: {
|
|
44
|
+
type: string;
|
|
45
|
+
text: string;
|
|
46
|
+
}[];
|
|
47
|
+
}>;
|
|
48
|
+
handleIndexDocument(args: Record<string, unknown>): Promise<{
|
|
49
|
+
content: {
|
|
50
|
+
type: string;
|
|
51
|
+
text: string;
|
|
52
|
+
}[];
|
|
53
|
+
}>;
|
|
54
|
+
handleSearchDocuments(args: Record<string, unknown>): Promise<{
|
|
55
|
+
content: {
|
|
56
|
+
type: string;
|
|
57
|
+
text: string;
|
|
58
|
+
}[];
|
|
59
|
+
}>;
|
|
60
|
+
handleAddMemory(args: Record<string, unknown>): Promise<{
|
|
61
|
+
content: {
|
|
62
|
+
type: string;
|
|
63
|
+
text: string;
|
|
64
|
+
}[];
|
|
65
|
+
}>;
|
|
66
|
+
handleSearchMemory(args: Record<string, unknown>): Promise<{
|
|
67
|
+
content: {
|
|
68
|
+
type: string;
|
|
69
|
+
text: string;
|
|
70
|
+
}[];
|
|
71
|
+
}>;
|
|
72
|
+
handleListMemories(args: Record<string, unknown>): Promise<{
|
|
73
|
+
content: {
|
|
74
|
+
type: string;
|
|
75
|
+
text: string;
|
|
76
|
+
}[];
|
|
77
|
+
}>;
|
|
78
|
+
handleDeleteMemory(args: Record<string, unknown>): Promise<{
|
|
79
|
+
content: {
|
|
80
|
+
type: string;
|
|
81
|
+
text: string;
|
|
82
|
+
}[];
|
|
83
|
+
}>;
|
|
84
|
+
handleMemoryHistory(args: Record<string, unknown>): Promise<{
|
|
85
|
+
content: {
|
|
86
|
+
type: string;
|
|
87
|
+
text: string;
|
|
88
|
+
}[];
|
|
89
|
+
}>;
|
|
90
|
+
handleBrowseStructure(args: Record<string, unknown>): Promise<{
|
|
91
|
+
content: {
|
|
92
|
+
type: string;
|
|
93
|
+
text: string;
|
|
94
|
+
}[];
|
|
95
|
+
}>;
|
|
96
|
+
handleListSymbols(args: Record<string, unknown>): Promise<{
|
|
97
|
+
content: {
|
|
98
|
+
type: string;
|
|
99
|
+
text: string;
|
|
100
|
+
}[];
|
|
101
|
+
}>;
|
|
39
102
|
}
|
|
103
|
+
export declare function handleReadFile(args: Record<string, unknown>): Promise<{
|
|
104
|
+
content: {
|
|
105
|
+
type: string;
|
|
106
|
+
text: string;
|
|
107
|
+
}[];
|
|
108
|
+
}>;
|
|
40
109
|
//# sourceMappingURL=tools.d.ts.map
|