feat(server): add boocontext deep analysis tools and synthesis pipeline
- get_symbol_details: type signature, definition location, usage count - get_call_graph: callers, callees, transitive references - get_blast_radius added to SYNTHESIS_TOOLS
This commit is contained in:
31
apps/server/src/services/tools/codecontext/get_call_graph.ts
Normal file
31
apps/server/src/services/tools/codecontext/get_call_graph.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { z } from 'zod';
|
||||
import { makeCodecontextTool } from './factory.js';
|
||||
|
||||
export const GetCallGraphInput = z.object({
|
||||
symbol: z.string().describe('Symbol name to analyze'),
|
||||
depth: z.number().int().min(1).max(5).optional().describe('Max traversal depth (default 2)'),
|
||||
});
|
||||
export type GetCallGraphInputT = z.infer<typeof GetCallGraphInput>;
|
||||
|
||||
const DESCRIPTION =
|
||||
'Returns a call graph for a function or method: callers, callees, and transitive references. ' +
|
||||
'Use to understand how a symbol is invoked and what it depends on.';
|
||||
|
||||
const { toolDef: getCallGraph, execute: executeGetCallGraph } =
|
||||
makeCodecontextTool<GetCallGraphInputT>({
|
||||
name: 'get_call_graph',
|
||||
schema: GetCallGraphInput,
|
||||
description: DESCRIPTION,
|
||||
jsonParameters: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
symbol: { type: 'string', description: 'Symbol name to analyze' },
|
||||
depth: { type: 'number', description: 'Max traversal depth (default 2)' },
|
||||
},
|
||||
required: ['symbol'],
|
||||
additionalProperties: false,
|
||||
},
|
||||
mapArgs: (input) => ({ symbol: input.symbol, depth: input.depth ?? 2 }),
|
||||
});
|
||||
|
||||
export { getCallGraph, executeGetCallGraph };
|
||||
Reference in New Issue
Block a user