@tai-io/codesearch 2026.313.1614

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.
Files changed (78) hide show
  1. package/dist/build-info.d.ts +3 -0
  2. package/dist/build-info.js +4 -0
  3. package/dist/config.d.ts +62 -0
  4. package/dist/config.js +52 -0
  5. package/dist/core/cleanup.d.ts +8 -0
  6. package/dist/core/cleanup.js +41 -0
  7. package/dist/core/doc-indexer.d.ts +13 -0
  8. package/dist/core/doc-indexer.js +76 -0
  9. package/dist/core/doc-searcher.d.ts +13 -0
  10. package/dist/core/doc-searcher.js +65 -0
  11. package/dist/core/file-category.d.ts +7 -0
  12. package/dist/core/file-category.js +75 -0
  13. package/dist/core/indexer.d.ts +18 -0
  14. package/dist/core/indexer.js +177 -0
  15. package/dist/core/preview.d.ts +13 -0
  16. package/dist/core/preview.js +58 -0
  17. package/dist/core/repo-map.d.ts +33 -0
  18. package/dist/core/repo-map.js +144 -0
  19. package/dist/core/searcher.d.ts +12 -0
  20. package/dist/core/searcher.js +97 -0
  21. package/dist/core/sync.d.ts +15 -0
  22. package/dist/core/sync.js +212 -0
  23. package/dist/core/targeted-indexer.d.ts +19 -0
  24. package/dist/core/targeted-indexer.js +127 -0
  25. package/dist/embedding/factory.d.ts +4 -0
  26. package/dist/embedding/factory.js +24 -0
  27. package/dist/embedding/openai.d.ts +33 -0
  28. package/dist/embedding/openai.js +234 -0
  29. package/dist/embedding/truncate.d.ts +6 -0
  30. package/dist/embedding/truncate.js +14 -0
  31. package/dist/embedding/types.d.ts +18 -0
  32. package/dist/embedding/types.js +2 -0
  33. package/dist/errors.d.ts +17 -0
  34. package/dist/errors.js +21 -0
  35. package/dist/format.d.ts +18 -0
  36. package/dist/format.js +151 -0
  37. package/dist/hooks/cli-router.d.ts +7 -0
  38. package/dist/hooks/cli-router.js +47 -0
  39. package/dist/hooks/hook-output.d.ts +56 -0
  40. package/dist/hooks/hook-output.js +21 -0
  41. package/dist/hooks/post-tool-use.d.ts +13 -0
  42. package/dist/hooks/post-tool-use.js +123 -0
  43. package/dist/hooks/stop-hook.d.ts +11 -0
  44. package/dist/hooks/stop-hook.js +137 -0
  45. package/dist/hooks/targeted-runner.d.ts +11 -0
  46. package/dist/hooks/targeted-runner.js +58 -0
  47. package/dist/index.d.ts +3 -0
  48. package/dist/index.js +138 -0
  49. package/dist/paths.d.ts +11 -0
  50. package/dist/paths.js +54 -0
  51. package/dist/setup-message.d.ts +4 -0
  52. package/dist/setup-message.js +48 -0
  53. package/dist/splitter/ast.d.ts +13 -0
  54. package/dist/splitter/ast.js +231 -0
  55. package/dist/splitter/line.d.ts +10 -0
  56. package/dist/splitter/line.js +103 -0
  57. package/dist/splitter/symbol-extract.d.ts +16 -0
  58. package/dist/splitter/symbol-extract.js +61 -0
  59. package/dist/splitter/types.d.ts +16 -0
  60. package/dist/splitter/types.js +2 -0
  61. package/dist/state/doc-metadata.d.ts +18 -0
  62. package/dist/state/doc-metadata.js +59 -0
  63. package/dist/state/registry.d.ts +7 -0
  64. package/dist/state/registry.js +46 -0
  65. package/dist/state/snapshot.d.ts +26 -0
  66. package/dist/state/snapshot.js +100 -0
  67. package/dist/tool-schemas.d.ts +215 -0
  68. package/dist/tool-schemas.js +269 -0
  69. package/dist/tools.d.ts +58 -0
  70. package/dist/tools.js +245 -0
  71. package/dist/vectordb/rrf.d.ts +32 -0
  72. package/dist/vectordb/rrf.js +88 -0
  73. package/dist/vectordb/sqlite.d.ts +34 -0
  74. package/dist/vectordb/sqlite.js +624 -0
  75. package/dist/vectordb/types.d.ts +63 -0
  76. package/dist/vectordb/types.js +2 -0
  77. package/messages.yaml +69 -0
  78. package/package.json +79 -0
@@ -0,0 +1,46 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { getRegistryPath } from '../paths.js';
4
+ function readRegistry() {
5
+ const registryPath = getRegistryPath();
6
+ try {
7
+ const data = fs.readFileSync(registryPath, 'utf-8');
8
+ return JSON.parse(data);
9
+ }
10
+ catch {
11
+ return {};
12
+ }
13
+ }
14
+ function writeRegistry(registry) {
15
+ const registryPath = getRegistryPath();
16
+ const dir = path.dirname(registryPath);
17
+ fs.mkdirSync(dir, { recursive: true });
18
+ fs.writeFileSync(registryPath, JSON.stringify(registry, null, 2) + '\n', 'utf-8');
19
+ }
20
+ export function registerProject(absolutePath) {
21
+ const name = path.basename(absolutePath).toLowerCase();
22
+ const registry = readRegistry();
23
+ registry[name] = absolutePath;
24
+ writeRegistry(registry);
25
+ }
26
+ export function resolveProject(project) {
27
+ const registry = readRegistry();
28
+ return registry[project.toLowerCase()];
29
+ }
30
+ export function listProjects() {
31
+ return readRegistry();
32
+ }
33
+ export function findProjectByPath(dir) {
34
+ const registry = readRegistry();
35
+ const normalized = dir.replace(/\\/g, '/').toLowerCase();
36
+ let best;
37
+ for (const projPath of Object.values(registry)) {
38
+ const normProj = projPath.replace(/\\/g, '/').toLowerCase();
39
+ if (normalized === normProj || normalized.startsWith(normProj + '/')) {
40
+ if (!best || projPath.length > best.length)
41
+ best = projPath;
42
+ }
43
+ }
44
+ return best;
45
+ }
46
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1,26 @@
1
+ import type { VectorDB } from '../vectordb/types.js';
2
+ export type CodebaseStatus = 'idle' | 'indexing' | 'indexed' | 'error';
3
+ export interface CodebaseState {
4
+ path: string;
5
+ collectionName: string;
6
+ status: CodebaseStatus;
7
+ lastIndexed?: string;
8
+ totalFiles?: number;
9
+ totalChunks?: number;
10
+ error?: string;
11
+ progress?: number;
12
+ progressMessage?: string;
13
+ }
14
+ export declare class StateManager {
15
+ private states;
16
+ getState(normalizedPath: string): CodebaseState | undefined;
17
+ getAllStates(): CodebaseState[];
18
+ setIndexing(normalizedPath: string, collectionName: string): void;
19
+ updateProgress(normalizedPath: string, progress: number, message: string): void;
20
+ setIndexed(normalizedPath: string, totalFiles: number, totalChunks: number): void;
21
+ setError(normalizedPath: string, error: string): void;
22
+ remove(normalizedPath: string): void;
23
+ hydrate(registry: Record<string, string>, vectordb: VectorDB): Promise<number>;
24
+ }
25
+ export declare function cleanupOrphanedSnapshots(vectordb: VectorDB): Promise<number>;
26
+ //# sourceMappingURL=snapshot.d.ts.map
@@ -0,0 +1,100 @@
1
+ import { pathToCollectionName } from '../paths.js';
2
+ import { listSnapshotCollections, deleteSnapshotByCollection } from '../vectordb/sqlite.js';
3
+ export class StateManager {
4
+ states = new Map();
5
+ getState(normalizedPath) {
6
+ return this.states.get(normalizedPath);
7
+ }
8
+ getAllStates() {
9
+ return [...this.states.values()];
10
+ }
11
+ setIndexing(normalizedPath, collectionName) {
12
+ this.states.set(normalizedPath, {
13
+ path: normalizedPath,
14
+ collectionName,
15
+ status: 'indexing',
16
+ progress: 0,
17
+ progressMessage: 'Starting...',
18
+ });
19
+ }
20
+ updateProgress(normalizedPath, progress, message) {
21
+ const state = this.states.get(normalizedPath);
22
+ if (state) {
23
+ state.progress = progress;
24
+ state.progressMessage = message;
25
+ }
26
+ }
27
+ setIndexed(normalizedPath, totalFiles, totalChunks) {
28
+ const state = this.states.get(normalizedPath);
29
+ if (state) {
30
+ state.status = 'indexed';
31
+ state.lastIndexed = new Date().toISOString();
32
+ state.totalFiles = totalFiles;
33
+ state.totalChunks = totalChunks;
34
+ state.progress = 100;
35
+ state.progressMessage = 'Done';
36
+ }
37
+ }
38
+ setError(normalizedPath, error) {
39
+ const state = this.states.get(normalizedPath);
40
+ if (state) {
41
+ state.status = 'error';
42
+ state.error = error;
43
+ }
44
+ }
45
+ remove(normalizedPath) {
46
+ this.states.delete(normalizedPath);
47
+ }
48
+ async hydrate(registry, vectordb) {
49
+ let count = 0;
50
+ for (const [, projectPath] of Object.entries(registry)) {
51
+ try {
52
+ const collectionName = pathToCollectionName(projectPath);
53
+ const exists = await vectordb.hasCollection(collectionName);
54
+ if (exists && !this.states.has(projectPath)) {
55
+ this.states.set(projectPath, {
56
+ path: projectPath,
57
+ collectionName,
58
+ status: 'indexed',
59
+ });
60
+ count++;
61
+ }
62
+ }
63
+ catch (err) {
64
+ console.warn(`Hydration failed for ${projectPath}:`, err);
65
+ }
66
+ }
67
+ return count;
68
+ }
69
+ }
70
+ export async function cleanupOrphanedSnapshots(vectordb) {
71
+ let cleaned = 0;
72
+ try {
73
+ const collections = listSnapshotCollections();
74
+ if (collections.length === 0)
75
+ return 0;
76
+ const probeResult = await vectordb.hasCollection('__eidetic_connectivity_probe__');
77
+ if (probeResult) {
78
+ console.warn('Orphan cleanup skipped: connectivity probe returned unexpected result.');
79
+ return 0;
80
+ }
81
+ for (const collectionName of collections) {
82
+ try {
83
+ const exists = await vectordb.hasCollection(collectionName);
84
+ if (!exists) {
85
+ deleteSnapshotByCollection(collectionName);
86
+ console.log(`Cleaned orphaned snapshot: ${collectionName}`);
87
+ cleaned++;
88
+ }
89
+ }
90
+ catch (err) {
91
+ console.warn(`Skipping orphan check for ${collectionName}:`, err);
92
+ }
93
+ }
94
+ }
95
+ catch (err) {
96
+ console.warn('Orphan cleanup skipped:', err);
97
+ }
98
+ return cleaned;
99
+ }
100
+ //# sourceMappingURL=snapshot.js.map
@@ -0,0 +1,215 @@
1
+ export declare const TOOL_DEFINITIONS: readonly [{
2
+ readonly name: "index";
3
+ readonly description: "Index a codebase directory to enable semantic search using a configurable code splitter.\n\nProvide either `path` (absolute) or `project` (name). Use `list` to see registered projects.\n\nUsage Guidance:\n- Use dryRun=true first to preview what files would be indexed and catch configuration issues before committing to a full index.\n- This tool is typically used when search fails due to an unindexed codebase.\n- If indexing is attempted on an already indexed path, and a conflict is detected, you MUST prompt the user to confirm whether to proceed with a force index.";
4
+ readonly inputSchema: {
5
+ readonly type: "object";
6
+ readonly properties: {
7
+ readonly path: {
8
+ readonly type: "string";
9
+ readonly description: "Absolute path to the codebase directory to index.";
10
+ };
11
+ readonly project: {
12
+ readonly type: "string";
13
+ readonly description: "Project name (resolves via registry). Use list to see registered projects.";
14
+ };
15
+ readonly force: {
16
+ readonly type: "boolean";
17
+ readonly description: "Force re-indexing even if already indexed";
18
+ readonly default: false;
19
+ };
20
+ readonly dryRun: {
21
+ readonly type: "boolean";
22
+ readonly description: "Preview what would be indexed without actually indexing. Returns file counts by extension, top directories, estimated cost, and warnings.";
23
+ readonly default: false;
24
+ };
25
+ readonly customExtensions: {
26
+ readonly type: "array";
27
+ readonly items: {
28
+ readonly type: "string";
29
+ };
30
+ readonly description: "Additional file extensions to include beyond defaults (e.g., [\".dart\", \".arb\"]). Extensions should include the dot prefix.";
31
+ readonly default: readonly [];
32
+ };
33
+ readonly customIgnorePatterns: {
34
+ readonly type: "array";
35
+ readonly items: {
36
+ readonly type: "string";
37
+ };
38
+ readonly description: "Additional glob patterns to exclude (e.g., [\"**/Pods/**\", \"**/DerivedData/**\"]).";
39
+ readonly default: readonly [];
40
+ };
41
+ };
42
+ readonly required: readonly [];
43
+ };
44
+ }, {
45
+ readonly name: "search";
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` 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
+ readonly inputSchema: {
48
+ readonly type: "object";
49
+ readonly properties: {
50
+ readonly path: {
51
+ readonly type: "string";
52
+ readonly description: "Absolute path to the codebase directory to search in.";
53
+ };
54
+ readonly project: {
55
+ readonly type: "string";
56
+ readonly description: "Project name (resolves via registry). Use list to see registered projects.";
57
+ };
58
+ readonly query: {
59
+ readonly type: "string";
60
+ readonly description: "Natural language query to search for in the codebase";
61
+ };
62
+ readonly limit: {
63
+ readonly type: "number";
64
+ readonly description: "Maximum number of results to return";
65
+ readonly default: 10;
66
+ readonly maximum: 50;
67
+ };
68
+ readonly extensionFilter: {
69
+ readonly type: "array";
70
+ readonly items: {
71
+ readonly type: "string";
72
+ };
73
+ readonly description: "Optional: List of file extensions to filter results (e.g., [\".ts\", \".py\"]).";
74
+ readonly default: readonly [];
75
+ };
76
+ readonly compact: {
77
+ readonly type: "boolean";
78
+ readonly description: "Return compact table (file, lines, score, ~tokens) instead of full code snippets. Use Read tool to fetch interesting results. Default: true.";
79
+ readonly default: true;
80
+ };
81
+ };
82
+ readonly required: readonly ["query"];
83
+ };
84
+ }, {
85
+ readonly name: "clear";
86
+ readonly description: "Clear the search index. Provide either `path` (absolute) or `project` (name). Use `list` to see registered projects.";
87
+ readonly inputSchema: {
88
+ readonly type: "object";
89
+ readonly properties: {
90
+ readonly path: {
91
+ readonly type: "string";
92
+ readonly description: "Absolute path to the codebase directory to clear.";
93
+ };
94
+ readonly project: {
95
+ readonly type: "string";
96
+ readonly description: "Project name (resolves via registry). Use list to see registered projects.";
97
+ };
98
+ };
99
+ readonly required: readonly [];
100
+ };
101
+ }, {
102
+ readonly name: "list";
103
+ readonly description: "List all currently indexed codebases with their status. Returns paths, file/chunk counts, and indexing status for all known codebases in this session.";
104
+ readonly inputSchema: {
105
+ readonly type: "object";
106
+ readonly properties: {};
107
+ readonly required: readonly [];
108
+ };
109
+ }, {
110
+ readonly name: "cleanup";
111
+ 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` to see registered projects.\n\nUse `dryRun=true` first to preview which files would be cleaned without making any changes.";
112
+ readonly inputSchema: {
113
+ readonly type: "object";
114
+ readonly properties: {
115
+ readonly path: {
116
+ readonly type: "string";
117
+ readonly description: "Absolute path to the codebase directory.";
118
+ };
119
+ readonly project: {
120
+ readonly type: "string";
121
+ readonly description: "Project name (resolves via registry). Use list to see registered projects.";
122
+ };
123
+ readonly dryRun: {
124
+ readonly type: "boolean";
125
+ readonly description: "List files that would be cleaned without actually deleting any vectors.";
126
+ readonly default: false;
127
+ };
128
+ };
129
+ readonly required: readonly [];
130
+ };
131
+ }, {
132
+ readonly name: "ingest";
133
+ 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 lookup (~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.";
134
+ readonly inputSchema: {
135
+ readonly type: "object";
136
+ readonly properties: {
137
+ readonly content: {
138
+ readonly type: "string";
139
+ readonly description: "The full text content of the documentation to cache.";
140
+ };
141
+ readonly source: {
142
+ readonly type: "string";
143
+ readonly description: "Source URL or identifier (e.g., \"https://docs.langfuse.com/guides/evaluators\" or \"context7:langfuse/hooks\").";
144
+ };
145
+ readonly library: {
146
+ readonly type: "string";
147
+ readonly description: "Library name (e.g., \"react\", \"langfuse\"). Used for collection grouping.";
148
+ };
149
+ readonly topic: {
150
+ readonly type: "string";
151
+ readonly description: "Topic within the library (e.g., \"hooks\", \"evaluators\").";
152
+ };
153
+ readonly ttlDays: {
154
+ readonly type: "number";
155
+ readonly description: "Days before the cached content is considered stale.";
156
+ readonly default: 7;
157
+ };
158
+ };
159
+ readonly required: readonly ["content", "source", "library", "topic"];
160
+ };
161
+ }, {
162
+ readonly name: "lookup";
163
+ readonly description: "Search cached documentation using natural language queries.\n\nReturns results from previously cached documentation (via ingest). 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.";
164
+ readonly inputSchema: {
165
+ readonly type: "object";
166
+ readonly properties: {
167
+ readonly query: {
168
+ readonly type: "string";
169
+ readonly description: "Natural language query to search cached documentation.";
170
+ };
171
+ readonly library: {
172
+ readonly type: "string";
173
+ readonly description: "Optional: limit search to a specific library (e.g., \"langfuse\"). Omit to search all cached docs.";
174
+ };
175
+ readonly limit: {
176
+ readonly type: "number";
177
+ readonly description: "Maximum number of results to return.";
178
+ readonly default: 5;
179
+ readonly maximum: 20;
180
+ };
181
+ };
182
+ readonly required: readonly ["query"];
183
+ };
184
+ }, {
185
+ readonly name: "browse";
186
+ 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` to see registered projects.";
187
+ readonly inputSchema: {
188
+ readonly type: "object";
189
+ readonly properties: {
190
+ readonly path: {
191
+ readonly type: "string";
192
+ readonly description: "Absolute path to the codebase directory.";
193
+ };
194
+ readonly project: {
195
+ readonly type: "string";
196
+ readonly description: "Project name (resolves via registry). Use list to see registered projects.";
197
+ };
198
+ readonly pathFilter: {
199
+ readonly type: "string";
200
+ readonly description: "Glob pattern to filter by file path (e.g., \"src/core/**\", \"**/*.ts\").";
201
+ };
202
+ readonly kind: {
203
+ readonly type: "string";
204
+ readonly description: "Filter by symbol kind: function, class, interface, method, type, enum, etc.";
205
+ };
206
+ readonly maxTokens: {
207
+ readonly type: "number";
208
+ readonly description: "Approximate token budget for the output (1 token ≈ 4 chars). Default: 4000.";
209
+ readonly default: 4000;
210
+ };
211
+ };
212
+ readonly required: readonly [];
213
+ };
214
+ }];
215
+ //# sourceMappingURL=tool-schemas.d.ts.map
@@ -0,0 +1,269 @@
1
+ const INDEX_DOCUMENT_DESCRIPTION = `\
2
+ Cache external documentation (from query-docs, WebFetch, etc.) for cheap semantic search later.
3
+
4
+ After fetching documentation from an external source, call this tool to store it. \
5
+ Subsequent queries about the same library will use lookup (~20 tokens/result) \
6
+ instead of re-fetching (~5K+ tokens).
7
+
8
+ The content is split into chunks, embedded, and stored in a vector collection grouped by library. \
9
+ A TTL tracks staleness — stale docs still return results but are flagged.`;
10
+ const SEARCH_DOCUMENTS_DESCRIPTION = `\
11
+ Search cached documentation using natural language queries.
12
+
13
+ Returns results from previously cached documentation (via ingest). \
14
+ Much cheaper than re-fetching docs (~20 tokens/result vs ~5K+ tokens/fetch).
15
+
16
+ If a specific library is provided, searches only that library's collection. \
17
+ Otherwise searches across all cached documentation. Results include staleness indicators.`;
18
+ const CLEANUP_DESCRIPTION = `\
19
+ Remove orphaned vectors for files that no longer exist on disk. Lightweight alternative to re-indexing — no embedding cost.
20
+
21
+ Provide either \`path\` (absolute) or \`project\` (name). Use \`list\` to see registered projects.
22
+
23
+ Use \`dryRun=true\` first to preview which files would be cleaned without making any changes.`;
24
+ const INDEX_DESCRIPTION = `\
25
+ Index a codebase directory to enable semantic search using a configurable code splitter.
26
+
27
+ Provide either \`path\` (absolute) or \`project\` (name). Use \`list\` to see registered projects.
28
+
29
+ Usage Guidance:
30
+ - Use dryRun=true first to preview what files would be indexed and catch configuration issues before committing to a full index.
31
+ - This tool is typically used when search fails due to an unindexed codebase.
32
+ - If indexing is attempted on an already indexed path, and a conflict is detected, \
33
+ you MUST prompt the user to confirm whether to proceed with a force index.`;
34
+ const SEARCH_DESCRIPTION = `\
35
+ Search the indexed codebase using natural language queries.
36
+ Prefer over Grep for conceptual/semantic queries — returns ~20 tokens/result vs ~100+ for Grep.
37
+ Try before launching an Explore agent — faster and cheaper for understanding code.
38
+
39
+ Provide either \`path\` (absolute) or \`project\` (name). Use \`list\` to see registered projects.
40
+
41
+ When to Use:
42
+ - Code search: Find specific functions, classes, or implementations
43
+ - Context-aware assistance: Gather relevant code context before making changes
44
+ - Issue identification: Locate problematic code sections or bugs
45
+ - Code review: Understand existing implementations and patterns
46
+ - Refactoring: Find all related code pieces that need to be updated
47
+ - Feature development: Understand existing architecture and similar implementations
48
+ - Duplicate detection: Identify redundant or duplicated code patterns
49
+
50
+ If the codebase is not indexed, this tool will return a clear error message \
51
+ indicating that indexing is required first.`;
52
+ export const TOOL_DEFINITIONS = [
53
+ {
54
+ name: 'index',
55
+ description: INDEX_DESCRIPTION,
56
+ inputSchema: {
57
+ type: 'object',
58
+ properties: {
59
+ path: {
60
+ type: 'string',
61
+ description: 'Absolute path to the codebase directory to index.',
62
+ },
63
+ project: {
64
+ type: 'string',
65
+ description: 'Project name (resolves via registry). Use list to see registered projects.',
66
+ },
67
+ force: {
68
+ type: 'boolean',
69
+ description: 'Force re-indexing even if already indexed',
70
+ default: false,
71
+ },
72
+ dryRun: {
73
+ type: 'boolean',
74
+ description: 'Preview what would be indexed without actually indexing. Returns file counts by extension, top directories, estimated cost, and warnings.',
75
+ default: false,
76
+ },
77
+ customExtensions: {
78
+ type: 'array',
79
+ items: { type: 'string' },
80
+ description: 'Additional file extensions to include beyond defaults (e.g., [".dart", ".arb"]). Extensions should include the dot prefix.',
81
+ default: [],
82
+ },
83
+ customIgnorePatterns: {
84
+ type: 'array',
85
+ items: { type: 'string' },
86
+ description: 'Additional glob patterns to exclude (e.g., ["**/Pods/**", "**/DerivedData/**"]).',
87
+ default: [],
88
+ },
89
+ },
90
+ required: [],
91
+ },
92
+ },
93
+ {
94
+ name: 'search',
95
+ description: SEARCH_DESCRIPTION,
96
+ inputSchema: {
97
+ type: 'object',
98
+ properties: {
99
+ path: {
100
+ type: 'string',
101
+ description: 'Absolute path to the codebase directory to search in.',
102
+ },
103
+ project: {
104
+ type: 'string',
105
+ description: 'Project name (resolves via registry). Use list to see registered projects.',
106
+ },
107
+ query: {
108
+ type: 'string',
109
+ description: 'Natural language query to search for in the codebase',
110
+ },
111
+ limit: {
112
+ type: 'number',
113
+ description: 'Maximum number of results to return',
114
+ default: 10,
115
+ maximum: 50,
116
+ },
117
+ extensionFilter: {
118
+ type: 'array',
119
+ items: { type: 'string' },
120
+ description: 'Optional: List of file extensions to filter results (e.g., [".ts", ".py"]).',
121
+ default: [],
122
+ },
123
+ compact: {
124
+ type: 'boolean',
125
+ description: 'Return compact table (file, lines, score, ~tokens) instead of full code snippets. Use Read tool to fetch interesting results. Default: true.',
126
+ default: true,
127
+ },
128
+ },
129
+ required: ['query'],
130
+ },
131
+ },
132
+ {
133
+ name: 'clear',
134
+ description: 'Clear the search index. Provide either `path` (absolute) or `project` (name). Use `list` to see registered projects.',
135
+ inputSchema: {
136
+ type: 'object',
137
+ properties: {
138
+ path: {
139
+ type: 'string',
140
+ description: 'Absolute path to the codebase directory to clear.',
141
+ },
142
+ project: {
143
+ type: 'string',
144
+ description: 'Project name (resolves via registry). Use list to see registered projects.',
145
+ },
146
+ },
147
+ required: [],
148
+ },
149
+ },
150
+ {
151
+ name: 'list',
152
+ description: 'List all currently indexed codebases with their status. Returns paths, file/chunk counts, and indexing status for all known codebases in this session.',
153
+ inputSchema: {
154
+ type: 'object',
155
+ properties: {},
156
+ required: [],
157
+ },
158
+ },
159
+ {
160
+ name: 'cleanup',
161
+ description: CLEANUP_DESCRIPTION,
162
+ inputSchema: {
163
+ type: 'object',
164
+ properties: {
165
+ path: {
166
+ type: 'string',
167
+ description: 'Absolute path to the codebase directory.',
168
+ },
169
+ project: {
170
+ type: 'string',
171
+ description: 'Project name (resolves via registry). Use list to see registered projects.',
172
+ },
173
+ dryRun: {
174
+ type: 'boolean',
175
+ description: 'List files that would be cleaned without actually deleting any vectors.',
176
+ default: false,
177
+ },
178
+ },
179
+ required: [],
180
+ },
181
+ },
182
+ {
183
+ name: 'ingest',
184
+ description: INDEX_DOCUMENT_DESCRIPTION,
185
+ inputSchema: {
186
+ type: 'object',
187
+ properties: {
188
+ content: {
189
+ type: 'string',
190
+ description: 'The full text content of the documentation to cache.',
191
+ },
192
+ source: {
193
+ type: 'string',
194
+ description: 'Source URL or identifier (e.g., "https://docs.langfuse.com/guides/evaluators" or "context7:langfuse/hooks").',
195
+ },
196
+ library: {
197
+ type: 'string',
198
+ description: 'Library name (e.g., "react", "langfuse"). Used for collection grouping.',
199
+ },
200
+ topic: {
201
+ type: 'string',
202
+ description: 'Topic within the library (e.g., "hooks", "evaluators").',
203
+ },
204
+ ttlDays: {
205
+ type: 'number',
206
+ description: 'Days before the cached content is considered stale.',
207
+ default: 7,
208
+ },
209
+ },
210
+ required: ['content', 'source', 'library', 'topic'],
211
+ },
212
+ },
213
+ {
214
+ name: 'lookup',
215
+ description: SEARCH_DOCUMENTS_DESCRIPTION,
216
+ inputSchema: {
217
+ type: 'object',
218
+ properties: {
219
+ query: {
220
+ type: 'string',
221
+ description: 'Natural language query to search cached documentation.',
222
+ },
223
+ library: {
224
+ type: 'string',
225
+ description: 'Optional: limit search to a specific library (e.g., "langfuse"). Omit to search all cached docs.',
226
+ },
227
+ limit: {
228
+ type: 'number',
229
+ description: 'Maximum number of results to return.',
230
+ default: 5,
231
+ maximum: 20,
232
+ },
233
+ },
234
+ required: ['query'],
235
+ },
236
+ },
237
+ {
238
+ name: 'browse',
239
+ 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` to see registered projects.',
240
+ inputSchema: {
241
+ type: 'object',
242
+ properties: {
243
+ path: {
244
+ type: 'string',
245
+ description: 'Absolute path to the codebase directory.',
246
+ },
247
+ project: {
248
+ type: 'string',
249
+ description: 'Project name (resolves via registry). Use list to see registered projects.',
250
+ },
251
+ pathFilter: {
252
+ type: 'string',
253
+ description: 'Glob pattern to filter by file path (e.g., "src/core/**", "**/*.ts").',
254
+ },
255
+ kind: {
256
+ type: 'string',
257
+ description: 'Filter by symbol kind: function, class, interface, method, type, enum, etc.',
258
+ },
259
+ maxTokens: {
260
+ type: 'number',
261
+ description: 'Approximate token budget for the output (1 token ≈ 4 chars). Default: 4000.',
262
+ default: 4000,
263
+ },
264
+ },
265
+ required: [],
266
+ },
267
+ },
268
+ ];
269
+ //# sourceMappingURL=tool-schemas.js.map