/** * Call Graph Analyzer * * Performs static analysis of function calls across source files using tree-sitter. * Supports TypeScript/JavaScript, Python, Go, Rust, Ruby, Java, Swift — no LLM, pure AST. * * Produces: * - FunctionNode[] — all identified functions/methods * - CallEdge[] — resolved function→function call relationships * - Hub functions — high-fanIn nodes (called by many others) * - Entry points — functions with no internal callers * - Layer violations — cross-layer calls in the wrong direction */ import type { ImportMap } from './import-resolver-bridge.js'; import { type FileStyleRaw } from './style-fingerprint.js'; import { type FileParseHealth } from './parse-health.js'; import type { FunctionNode, CallEdge, CallGraphResult, SerializedCallGraph } from './call-graph-types.js'; export type { EdgeConfidence, EdgeKind, CallType, FunctionNode, ExternalKind, CallEdge, LayerViolation, ClassNode, InheritanceEdge, CallGraphResult, SerializedCallGraph, AmbiguousCallSite, AmbiguousStrategy, } from './call-graph-types.js'; export { CALL_DISTANCE_COSTS, callDistance, layerOf, classifyLayerEdge, AMBIGUOUS_CANDIDATE_CAP } from './call-graph-types.js'; export { computeCyclomaticComplexity } from './call-graph-complexity.js'; /** Reset loader caches — test-only hook for the graceful-degradation test. */ export declare function __resetGrammarCacheForTests(): void; /** * Languages for which `CallGraphBuilder.build()` extracts function/method nodes and * call edges. The authoritative source for the `callGraph` capability flag in the * declarative language-support registry (change: add-declarative-language-support-registry). * * MUST stay in sync with the per-language dispatch in `build()`: the native extractors * (Python/TS/JS/Go/Rust/Ruby/Java/C++/Swift/Elixir/Dart) plus the data-driven * `QUERY_LANG_SPECS` languages. A behavioral test asserts a fixture in each member * yields ≥1 node, so this set cannot silently over-claim. */ export declare const CALLGRAPH_LANGUAGES: ReadonlySet; /** Per-channel handler fan-out cap. Over-cap channels are DROPPED, never guessed. */ export declare const EVENT_CHANNEL_FANOUT_CAP = 8; /** Resolve a referenced simple name to a single internal function node, or undefined * when unknown or ambiguous (never guesses). Prefers a match in `preferFile`. */ type HandlerResolver = (name: string, preferFile: string) => FunctionNode | undefined; export declare function synthesizeDynamicDispatchEdges(files: Array<{ path: string; content: string; language: string; }>, allNodes: Map, resolveHandler: HandlerResolver): Promise; export declare class CallGraphBuilder { /** * Build a call graph from a list of source files. * * @param files Source files with path, content, and language * @param layers Optional layer map { layerName: [path prefix, ...] } * @param importMap Optional per-file import map (from ImportResolverBridge) * @param resolutionNodes Optional pre-existing nodes used only to seed the * call-resolution trie (not added to the returned nodes/edges). An * incremental subset rebuild passes the full set of known nodes so calls * into files outside the re-parsed subset resolve to their real node * instead of degrading to a synthetic `external::` leaf. */ build(files: Array<{ path: string; content: string; language: string; }>, layers?: Record, importMap?: ImportMap, resolutionNodes?: FunctionNode[]): Promise; private detectLayerViolations; } /** * Tally ONE file's style fingerprint in isolation (change: add-codebase-style-fingerprint). * Reuses the same per-language extractor (and its single parse) the full build uses, returning * only the style counters. Used by the watcher to refresh a changed file's fingerprint without a * whole-graph rebuild. Fail-soft: an unsupported language or parse failure returns `undefined`. */ export declare function extractFileStyle(file: { path: string; content: string; language: string; }): Promise; /** * Record ONE file's parse health in isolation (change: add-parse-health-boundary-disclosure). Runs * the same per-language dispatch the full build uses (so it covers every callGraph language, not * just the style ones) over a single file — Pass 2 resolution over one file is trivial — and returns * only its parse-health record, or `undefined` for a clean file. Used by the watcher to keep * `parse-health.json` live for a changed file without a whole-graph rebuild. Fail-soft: a parse * failure is itself a parse-health signal, surfaced as `parseFailed`. */ export declare function extractFileParseHealth(file: { path: string; content: string; language: string; }): Promise; export declare function serializeCallGraph(result: CallGraphResult): SerializedCallGraph; //# sourceMappingURL=call-graph.d.ts.map