vibe-splain 2.5.0 → 2.7.0

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.
@@ -11,6 +11,7 @@ import { handleGetStrategicOverview, getStrategicOverviewTool } from './tools/ge
11
11
  import { handleInspectPillar, inspectPillarTool } from './tools/inspect_pillar.js';
12
12
  import { handleGetWildDiscoveries, getWildDiscoveriesTool } from './tools/get_wild_discoveries.js';
13
13
  import { handleMarkStale, markStaleTool } from './tools/mark_stale.js';
14
+ import { handleGetCallChain, getCallChainTool } from './tools/get_call_chain.js';
14
15
  // ⚠️ CRITICAL: Never use console.log() anywhere in this codebase.
15
16
  // stdout is owned by the MCP SDK for protocol messages.
16
17
  // Use console.error() for all diagnostic output.
@@ -19,6 +20,7 @@ const ALL_TOOLS = [
19
20
  getProjectMapTool,
20
21
  setProjectBriefTool,
21
22
  getFileContextTool,
23
+ getCallChainTool,
22
24
  writeDecisionCardTool,
23
25
  getStrategicOverviewTool,
24
26
  inspectPillarTool,
@@ -30,6 +32,7 @@ const TOOL_HANDLERS = {
30
32
  get_project_map: handleGetProjectMap,
31
33
  set_project_brief: handleSetProjectBrief,
32
34
  get_file_context: handleGetFileContext,
35
+ get_call_chain: handleGetCallChain,
33
36
  write_decision_card: handleWriteDecisionCard,
34
37
  get_strategic_overview: handleGetStrategicOverview,
35
38
  inspect_pillar: handleInspectPillar,
@@ -0,0 +1,42 @@
1
+ export declare const getCallChainTool: {
2
+ name: string;
3
+ description: string;
4
+ inputSchema: {
5
+ type: "object";
6
+ properties: {
7
+ projectRoot: {
8
+ type: string;
9
+ };
10
+ entrypointPath: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ maxDepth: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ targetActionKind: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ targetModel: {
23
+ type: string;
24
+ description: string;
25
+ };
26
+ targetOperation: {
27
+ type: string;
28
+ description: string;
29
+ };
30
+ targetFunctionName: {
31
+ type: string;
32
+ description: string;
33
+ };
34
+ includeTests: {
35
+ type: string;
36
+ description: string;
37
+ };
38
+ };
39
+ required: string[];
40
+ };
41
+ };
42
+ export declare function handleGetCallChain(args: Record<string, unknown>): Promise<unknown>;
@@ -0,0 +1,50 @@
1
+ import { traverseCallChain } from '@vibe-splain/brain';
2
+ export const getCallChainTool = {
3
+ name: 'get_call_chain',
4
+ description: `Trace how behavior is reached from an entrypoint by following function call edges through the codebase. Returns a step-by-step chain with exact function names, file paths, line numbers, action kinds, and evidence text. Every edge has a confidence level; unresolved edges are listed explicitly.
5
+
6
+ Use structured filters when you know the target:
7
+ targetModel + targetOperation: "where does Booking get created?"
8
+ targetActionKind: "where is auth enforced?"
9
+ targetFunctionName: "how is function X reached?"
10
+ No filter returns the full call tree up to maxDepth.
11
+
12
+ Run scan_project first — this tool reads from the generated action_bindings.json.`,
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ projectRoot: { type: 'string' },
17
+ entrypointPath: { type: 'string', description: 'Relative path to the entrypoint file' },
18
+ maxDepth: { type: 'number', description: 'Max traversal depth. Default 6, max 12.' },
19
+ targetActionKind: { type: 'string', description: 'Stop at this semantic action kind.' },
20
+ targetModel: { type: 'string', description: 'Stop at functions touching this model.' },
21
+ targetOperation: { type: 'string', description: 'Narrow targetModel to this operation.' },
22
+ targetFunctionName: { type: 'string', description: 'Stop at a specific function name.' },
23
+ includeTests: { type: 'boolean', description: 'Include test files in traversal. Default false.' },
24
+ },
25
+ required: ['projectRoot', 'entrypointPath'],
26
+ },
27
+ };
28
+ export async function handleGetCallChain(args) {
29
+ const projectRoot = args.projectRoot;
30
+ const entrypointPath = args.entrypointPath;
31
+ if (!projectRoot || !entrypointPath)
32
+ throw new Error('projectRoot and entrypointPath are required');
33
+ const getCallChainArgs = {
34
+ entrypointPath,
35
+ maxDepth: typeof args.maxDepth === 'number' ? args.maxDepth : undefined,
36
+ targetActionKind: typeof args.targetActionKind === 'string' ? args.targetActionKind : undefined,
37
+ targetModel: typeof args.targetModel === 'string' ? args.targetModel : undefined,
38
+ targetOperation: typeof args.targetOperation === 'string' ? args.targetOperation : undefined,
39
+ targetFunctionName: typeof args.targetFunctionName === 'string' ? args.targetFunctionName : undefined,
40
+ includeTests: typeof args.includeTests === 'boolean' ? args.includeTests : undefined,
41
+ };
42
+ try {
43
+ const result = await traverseCallChain(projectRoot, getCallChainArgs);
44
+ return result;
45
+ }
46
+ catch (error) {
47
+ throw new Error(`get_call_chain failed: ${error instanceof Error ? error.message : String(error)}`);
48
+ }
49
+ }
50
+ //# sourceMappingURL=get_call_chain.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-splain",
3
- "version": "2.5.0",
3
+ "version": "2.7.0",
4
4
  "description": "Architectural dossier engine for vibe-coded TypeScript/JavaScript projects. Runs as an MCP server inside your coding agent.",
5
5
  "type": "module",
6
6
  "license": "MIT",