(
args: { query: string; limit?: number },
context: ToolContext
)
| 20 | required: ['query'] |
| 21 | }, |
| 22 | async execute( |
| 23 | args: { query: string; limit?: number }, |
| 24 | context: ToolContext |
| 25 | ): Promise<ToolResult> { |
| 26 | try { |
| 27 | const dbPath = resolve(context.workingDirectory, '.coding-agent/index.db'); |
| 28 | const indexer = new CodebaseIndexer(dbPath, context.workingDirectory); |
| 29 | |
| 30 | const results = await indexer.search(args.query, { |
| 31 | limit: args.limit || 20 |
| 32 | }); |
| 33 | |
| 34 | indexer.close(); |
| 35 | |
| 36 | return { |
| 37 | success: true, |
| 38 | data: { |
| 39 | results, |
| 40 | count: results.length |
| 41 | } |
| 42 | }; |
| 43 | } catch (error) { |
| 44 | return { |
| 45 | success: false, |
| 46 | error: error instanceof Error ? error.message : String(error) |
| 47 | }; |
| 48 | } |
| 49 | } |
| 50 | }; |
| 51 | |
| 52 | export const getDependenciesTool: Tool = { |
nothing calls this directly
no test coverage detected