import type { ExtractionMode } from '../contracts/generation-policy.js'; import type { IndexingStrictThresholds, IndexingSummary } from '../contracts/indexing.js'; import { type SpiCacheStats } from '../pipeline/spi/cache.js'; import { type DiscoveryExclusion, type DiscoverySafetyMetadata } from '../shared/discovery-safety.js'; export type ProgressStep = { step: 'detect'; message: string; } | { step: 'extract'; message: string; current?: number; total?: number; } | { step: 'build'; message: string; } | { step: 'cluster'; message: string; } | { step: 'analyze'; message: string; } | { step: 'export'; message: string; }; export interface GenerateGraphOptions { update?: boolean; clusterOnly?: boolean; /** Generated code graphs are directed by default. Set false only for visualization-only legacy output. */ directed?: boolean; followSymlinks?: boolean; /** Restrict discovery to files that Git does not ignore. Falls back outside Git repositories. */ respectGitignore?: boolean; noHtml?: boolean; htmlMode?: 'auto' | 'inline' | 'overview'; wiki?: boolean; obsidian?: boolean; obsidianDir?: string | null; svg?: boolean; graphml?: boolean; neo4j?: boolean; includeDocs?: boolean; docs?: boolean; /** Select capability-aware auto extraction, legacy-only extraction, or * strict SPI code extraction without unsupported-language fallback. * Eligible non-code evidence remains included. CLI and programmatic * generation default to `auto`; explicit `useSpi` retains its legacy * compatibility mapping. */ extractionMode?: ExtractionMode; /** @deprecated Use `extractionMode`. Retained for programmatic callers. */ useSpi?: boolean; indexingStrict?: IndexingStrictThresholds; onProgress?: (progress: ProgressStep) => void; } export interface GenerateGraphResult { mode: 'generate' | 'update' | 'cluster-only'; /** User-facing requested extraction mode used for this graph. */ extractionMode?: ExtractionMode; rootPath: string; outputDir: string; graphPath: string; reportPath: string; htmlPath: string | null; wikiPath: string | null; obsidianPath: string | null; svgPath: string | null; graphmlPath: string | null; cypherPath: string | null; docsPath: string | null; totalFiles: number; codeFiles: number; nonCodeFiles: number; extractableFiles: number; extractedFiles: number; totalWords: number; nodeCount: number; edgeCount: number; communityCount: number; semanticAnomalyCount?: number; changedFiles: number; deletedFiles: number; cache: GenerateGraphCacheSummary | null; warning: string | null; notes: string[]; discoverySafety?: DiscoverySafetyMetadata; discoveryExclusions?: DiscoveryExclusion[]; indexingManifestPath?: string; indexingShareSafeManifestPath?: string; indexing?: IndexingSummary; } export interface GenerateGraphCacheSummary { strategy: 'spi'; hit: boolean; reason: SpiCacheStats['reason']; fileCount: number; } export type GenerateUnsupportedCorpusCode = 'NO_SUPPORTED_FILES' | 'NO_GRAPH_NODES'; export declare class GenerateUnsupportedCorpusError extends Error { readonly code: GenerateUnsupportedCorpusCode; readonly discoverySafety: DiscoverySafetyMetadata | undefined; constructor(code: GenerateUnsupportedCorpusCode, message: string, discoverySafety?: DiscoverySafetyMetadata); } export declare class IndexingCompletenessError extends Error { readonly manifestPath: string; readonly summary: IndexingSummary; readonly violations: string[]; constructor(manifestPath: string, summary: IndexingSummary, violations: string[]); } export declare function loadGraphExtractorVersion(graphPath: string): number | null; export declare function generateGraph(rootPath?: string, options?: GenerateGraphOptions): GenerateGraphResult;