/** * MCP tool handlers for codebase analysis: * analyze_codebase, get_architecture_overview, get_refactor_report, * get_duplicate_report, get_signatures, get_mapping, check_spec_drift, * get_function_skeleton, get_god_functions, get_route_inventory, * get_middleware_inventory, get_schema_inventory, get_ui_components. */ import type { SerializedCallGraph } from '../../analyzer/call-graph.js'; import type { DriftResult } from '../../../types/index.js'; /** * Run a full static analysis pass on `directory` and return a compact summary. */ export declare function handleAnalyzeCodebase(directory: string, force: boolean): Promise>; /** * High-level architecture map: clusters, cross-cluster deps, entry points, hubs. */ export declare function handleGetArchitectureOverview(directory: string): Promise; /** * Return a prioritized refactor report from cached analysis. */ export declare function handleGetRefactorReport(directory: string): Promise; /** * Read the cached duplicate detection result. */ export declare function handleGetDuplicateReport(directory: string): Promise; /** * Return compact function and class signatures for files in the project. */ export declare function handleGetSignatures(directory: string, filePattern?: string): Promise; /** * Return the requirement→function mapping from mapping.json. */ export declare function handleGetMapping(directory: string, domain?: string, orphansOnly?: boolean): Promise; /** * Run spec-drift detection in static mode (no LLM). */ export declare function handleCheckSpecDrift(directory: string, base?: string, files?: string[], domains?: string[], failOn?: 'error' | 'warning' | 'info', maxFiles?: number): Promise; /** * Return a noise-stripped skeleton of a source file. */ export declare function handleGetFunctionSkeleton(directory: string, filePath: string): Promise; /** * Extract the exact source text of a named function using the cached call graph. * * Uses the startIndex/endIndex byte offsets recorded in llm-context.json to * slice the source file — no extra tree-sitter parsing needed at query time. * Falls back to a line-number scan when the call graph is unavailable. */ export declare function handleGetFunctionBody(directory: string, filePath: string, functionName: string): Promise; /** * List and optionally filter Architecture Decision Records from openspec/decisions/. */ export declare function handleGetDecisions(directory: string, query?: string): Promise; /** * Return the pre-computed route inventory from the last analysis run. * Falls back to re-computing from source files if the artifact is missing. */ export declare function handleGetRouteInventory(directory: string): Promise>; /** * Return the pre-computed middleware inventory from the last analysis run. * Falls back to re-computing from source files if the artifact is missing. */ export declare function handleGetMiddlewareInventory(directory: string): Promise>; /** * Return the pre-computed database schema inventory from the last analysis run. * Falls back to re-computing from source files if the artifact is missing. */ export declare function handleGetSchemaInventory(directory: string): Promise>; /** * Return the pre-computed UI component inventory from the last analysis run. * Falls back to re-computing from source files if the artifact is missing. */ export declare function handleGetUIComponents(directory: string): Promise>; /** * Return the pre-computed environment variable inventory from the last analysis run. * Falls back to re-computing from source files if the artifact is missing. */ export declare function handleGetEnvVars(directory: string): Promise>; /** * Return direct external dependencies from package manifests * (package.json, pyproject.toml, requirements.txt, Cargo.toml, go.mod). * Falls back to live extraction if cached artifact is absent. */ export declare function handleGetExternalPackages(directory: string): Promise>; /** * Parity audit: report spec coverage gaps without any LLM call. * Returns uncovered functions, hub gaps, orphan requirements, and stale domains. */ export declare function handleAuditSpecCoverage(directory: string, maxUncovered?: number, hubThreshold?: number): Promise; /** * Generate spec-driven test files from OpenSpec scenarios. */ export declare function handleGenerateTests(args: { directory: string; domains?: string[]; framework?: string; useLlm?: boolean; dryRun?: boolean; }): Promise>; /** * Report spec test coverage for a project. */ export declare function handleGetTestCoverage(args: { directory: string; domains?: string[]; discover?: boolean; minCoverage?: number; }): Promise>; /** * Return the bare minimum an agent needs to safely modify a function: * its signature + body, direct callers (signatures), direct callees (signatures), * and which test files cover it. Typically 200-600 tokens vs orient's 2000+. */ export declare function handleGetMinimalContext(directory: string, functionName: string, filePath?: string, rankBy?: 'distance' | 'pagerank', tokenBudget?: number): Promise; /** * Return all functions in the same community as the given function. * Communities are computed via label propagation on the call graph at analyze time. * Useful for understanding the "cluster" of related functions without traversing the graph. */ export declare function handleGetCluster(directory: string, functionName: string): Promise; /** * Function-granularity view of one community: members (by fan-in), spanning files, * internal call edges, and density. Shared by `get_cluster` (which resolves a * function name to its community) and `get_map`'s drill-in (which has the * `communityId` directly), so both render a region identically. */ export declare function buildClusterView(cg: SerializedCallGraph, absDir: string, communityId: string): unknown; /** * Detect recently changed functions and rank them by blast radius (fanIn of callers via BFS). * Runs git diff to find changed files/lines, maps to function nodes, scores by impact. */ export declare function handleDetectChanges(directory: string, base?: string): Promise; //# sourceMappingURL=analysis.d.ts.map