declare const CODEGRAPH_EXTRACTOR_VERSION = "codegraph-v1"; declare const CODEGRAPH_EXTRACTOR_PACKAGE_VERSION: string; type CodegraphConfidence = "confirmed" | "likely" | "review"; type CodegraphFileState = "tracked" | "untracked" | "deleted" | "renamed" | "ignored-generated"; type CodegraphImportKind = "static" | "export" | "dynamic"; type CodegraphNodeKind = "file" | "package" | "asset" | "generated" | "unresolved"; interface CodegraphFileRecord { path: string; content: string; size?: number; executable?: boolean; state?: CodegraphFileState; } interface GitStatusEntry { path: string; originalPath?: string; state: CodegraphFileState; } interface CodegraphIgnoreRules { skipSegments: string[]; skipFileNames: string[]; generatedPatterns: string[]; } interface CodegraphGitStateProvider { getHead(): Promise; getBaseRef(args: { requestedBase?: string; }): Promise; listStatus(args: { baseRef?: string | null; }): Promise; readIncludedFiles(args: { sourceRoots: string[]; explicitFiles: string[]; ignoreRules: CodegraphIgnoreRules; }): Promise; } interface CodegraphImportEdge { source: string; target: string; targetKind: CodegraphNodeKind; specifier: string; importKind: CodegraphImportKind; } interface CodegraphApiRef { file: string; module: string; functionName: string; } interface CodegraphTableAccess { file: string; name: string; access: "read" | "write" | "unknown"; } interface CodegraphGraph { files: string[]; importEdges: CodegraphImportEdge[]; apiRefs: CodegraphApiRef[]; tableAccesses: CodegraphTableAccess[]; warnings: string[]; } interface CodegraphFeatureMap { version: number; features: CodegraphFeatureDefinition[]; } interface CodegraphFeatureDefinition { id: string; label: string; paths: string[]; workflows?: string[]; verification?: string[]; } interface CodegraphFeatureMatch { id: string; label: string; confidence: CodegraphConfidence; workflows: string[]; verification: string[]; } interface CodegraphImpactOptions { command: string[]; contextPackageVersion: string; depth: number; explicitFiles: string[]; featureMap: CodegraphFeatureMap | null; gitBaseRef?: string; gitProvider: CodegraphGitStateProvider; ignoreRules: CodegraphIgnoreRules; includeChanged: boolean; repoRootHashSource: string; sourceRoots: string[]; } interface CodegraphImpactPacket { schemaVersion: 1; generatedAt: string; provenance: { repoRootHash: string; gitHead: string | null; gitBaseRef: string | null; gitStatusHash: string; inputFilesHash: string; extractorVersion: string; extractorPackageVersion: string; command: string[]; sourceRoots: string[]; ignoredGenerated: string[]; featureMapVersion: number | null; }; freshness: { state: "fresh" | "stale" | "partial"; staleReasons: string[]; partialReasons: string[]; }; seeds: Array<{ file: string; reason: "changed" | "explicit"; }>; features: Array<{ id: string; label: string; confidence: CodegraphConfidence; }>; downstreamFiles: Array<{ file: string; depth: number; confidence: CodegraphConfidence; }>; routes: Array<{ file: string; routeId?: string; method?: string; }>; convex: { functions: Array<{ module: string; name: string; confidence: CodegraphConfidence; }>; tables: Array<{ name: string; access: "read" | "write" | "unknown"; }>; }; tests: Array<{ file: string; reason: string; confidence: CodegraphConfidence; }>; verification: string[]; warnings: string[]; } interface CodegraphSessionResult { packet: CodegraphImpactPacket; generation: number; rebuilt: boolean; } declare function extractCodegraph(args: { files: CodegraphFileRecord[]; ignoreRules: CodegraphIgnoreRules; }): CodegraphGraph; declare function isGeneratedPath(file: string, ignoreRules: CodegraphIgnoreRules): boolean; declare function parseFeatureMap(raw: string): CodegraphFeatureMap; declare function matchFeaturesForFiles(featureMap: CodegraphFeatureMap | null, files: string[]): CodegraphFeatureMatch[]; declare function staleFeatureMapEntries(featureMap: CodegraphFeatureMap | null, files: string[]): string[]; declare function matchesPattern(pattern: string, file: string): boolean; declare class FileSystemGitStateProvider implements CodegraphGitStateProvider { private readonly repoRoot; private readonly workingRoot; constructor(repoRoot: string, workingRoot: string); getHead(): Promise; getBaseRef(args: { requestedBase?: string; }): Promise; listStatus(args: { baseRef?: string | null; }): Promise; readIncludedFiles(args: { sourceRoots: string[]; explicitFiles: string[]; ignoreRules: CodegraphIgnoreRules; }): Promise; private listDiffStatus; private collectFiles; private readFileRecord; private toAbsolute; private toRelative; private relativeStatusEntry; } declare function parsePorcelainStatus(raw: string): GitStatusEntry[]; declare function parseNameStatus(raw: string): GitStatusEntry[]; declare function buildCodegraphImpactPacket(options: CodegraphImpactOptions): Promise; declare class GraphSession { private generation; private lastInputFilesHash; query(options: CodegraphImpactOptions): Promise; } declare function sha256(value: string): string; declare function normalizePath(value: string): string; declare function normalizeText(value: string): string; declare function computeGitStatusHash(args: { head: string | null; status: GitStatusEntry[]; }): string; declare function computeInputFilesHash(args: { command: string[]; contextPackageVersion: string; depth: number; extractorVersion: string; featureMapJson: string | null; files: CodegraphFileRecord[]; gitBaseRef: string | null; ignoreRules: CodegraphIgnoreRules; nodeMajorVersion: string; sourceRoots: string[]; }): string; declare function sortUnique(values: string[]): string[]; export { CODEGRAPH_EXTRACTOR_PACKAGE_VERSION, CODEGRAPH_EXTRACTOR_VERSION, type CodegraphApiRef, type CodegraphConfidence, type CodegraphFeatureDefinition, type CodegraphFeatureMap, type CodegraphFeatureMatch, type CodegraphFileRecord, type CodegraphFileState, type CodegraphGitStateProvider, type CodegraphGraph, type CodegraphIgnoreRules, type CodegraphImpactOptions, type CodegraphImpactPacket, type CodegraphImportEdge, type CodegraphImportKind, type CodegraphNodeKind, type CodegraphSessionResult, type CodegraphTableAccess, FileSystemGitStateProvider, type GitStatusEntry, GraphSession, buildCodegraphImpactPacket, computeGitStatusHash, computeInputFilesHash, extractCodegraph, isGeneratedPath, matchFeaturesForFiles, matchesPattern, normalizePath, normalizeText, parseFeatureMap, parseNameStatus, parsePorcelainStatus, sha256, sortUnique, staleFeatureMapEntries };