import type { FunctionRecord, ParsedDocstring, VectorRow, SearchResult, RankedResult, SearchFilter, CallGraph, CallGraphEntry, TypeRelationGraph, TypeNode, ImportMap, RawFunctionInfo, RawCallInfo, RawImportInfo, RawTypeRelationship } from "./index.js"; export interface IFunctionIndexReader { getById(id: string): FunctionRecord | null; getByModule(module: string): FunctionRecord[]; getByFile(filePath: string): FunctionRecord[]; getByTags(tags: string[], matchMode: "all" | "any"): FunctionRecord[]; findByName(name: string, module?: string): FunctionRecord[]; findByExactName(name: string): FunctionRecord[]; findByClassAware(query: string): FunctionRecord[]; getAllModules(): string[]; getAllNames(): string[]; getAllFilePaths(): string[]; getFileRecordIds(filePath: string): string[]; getFileHashes(): Map; getStats(): { files: number; functions: number; classes: number; }; getDocstringCoverage(): number; getLanguageStats(): Record; getAll(): FunctionRecord[]; } export interface IFunctionIndexWriter { buildFull(projectRoot: string): Promise; updateFiles(files: string[]): Promise; refreshStale(projectRoot: string): Promise; loadFromDisk(): Promise; saveToDisk(): Promise; clear(): void; } export interface ISourceExtractor { getFunctionSource(id: string, contextLines?: number): Promise<{ source: string; lineStart: number; lineEnd: number; contextBefore?: string; contextAfter?: string; }>; } export interface IEmbeddingProvider { embedDocuments(texts: string[]): Promise; embedQuery(text: string): Promise; isAvailable(): Promise; readonly dimensions: number; } export interface IVectorDatabase { initialize(connectionString: string, tableName?: string): Promise; upsert(records: VectorRow[]): Promise; deleteByFile(filePath: string): Promise; deleteByIds(ids: string[]): Promise; vectorSearch(query: Float32Array, topK: number, filter?: SearchFilter): Promise; searchByExactName(name: string, scope?: string): Promise; isEmpty(): Promise; countRows(): Promise; close?(): Promise; } export interface IFullTextSearch { ftsSearch(queryText: string, topK: number, filter?: SearchFilter): Promise; readonly isAvailable: boolean; } export interface IResultMerger { merge(rankedLists: RankedResult[][], topK: number): SearchResult[]; } export interface ISearchPipeline { search(query: { vector?: Float32Array; text: string; }, options: { topK: number; scope?: string; tagsFilter?: string[]; sideEffectsFilter?: string[]; }): Promise; } export interface ICallGraphReader { getEntry(id: string): CallGraphEntry | undefined; getTransitive(startId: string, direction: "downstream" | "upstream", maxDepth: number, bridgeNode?: (id: string) => string[]): { nodes: Array<{ id: string; depth: number; }>; cycles: string[][]; }; getStats(): { nodes: number; edges: number; cycles: number; }; } export interface ICallGraphWriter { build(index: IFunctionIndexReader, projectRoot: string): Promise; buildForFiles(files: string[], index: IFunctionIndexReader, projectRoot: string): Promise; removeByFile(filePath: string, index: IFunctionIndexReader): void; saveToDisk(cacheDir: string, index: IFunctionIndexReader): Promise; loadFromDisk(cacheDir: string, index: IFunctionIndexReader): Promise; clear(): void; } export interface ITypeGraphReader { getTypeNode(typeName: string): TypeNode | undefined; getImplementors(typeName: string): string[]; getExtenders(typeName: string): string[]; getUsages(typeName: string): string[]; getTypeChain(typeName: string): string[]; getMemberType(typeName: string, memberName: string): string | undefined; getAllTypes(): string[]; getStats(): { types: number; relationships: number; }; } export interface ITypeGraphWriter { build(index: IFunctionIndexReader, parsers: ILanguageParser[], projectRoot: string): Promise; buildForFiles(files: string[], index: IFunctionIndexReader, parsers: ILanguageParser[], projectRoot: string): Promise; removeByFile(filePath: string): void; saveToDisk(cacheDir: string, index: IFunctionIndexReader): Promise; loadFromDisk(cacheDir: string, index: IFunctionIndexReader): Promise; clear(): void; } export interface ILanguageParser { readonly extensions: string[]; canParse(filePath: string): boolean; parseFunctions(source: string, filePath: string): RawFunctionInfo[]; parseCalls(source: string, lineStart: number, lineEnd: number): RawCallInfo[]; parseImports(source: string, filePath: string): RawImportInfo[]; parseTypeRelationships(source: string, filePath: string): RawTypeRelationship[]; parseLocalVariables?(source: string, lineStart: number, lineEnd: number): Array<{ name: string; type: string; }>; resolveImportPath(modulePath: string, fromFile: string, projectRoot: string, pathExists: (workspaceRelativePath: string) => boolean): string | null; isExternalImport(modulePath: string): boolean; } export interface IImportResolver { resolveImports(source: string, filePath: string, projectRoot: string): ImportMap; } export interface IDocstringParser { parse(raw: string, kind: "function" | "method" | "class"): ParsedDocstring; } export interface IRecordStore { loadAll(): Promise<{ records: FunctionRecord[]; hashes: Map; mtimes: Map; }>; saveFile(filePath: string, records: FunctionRecord[], hash: string, mtimeMs: number): Promise; deleteFile(filePath: string): Promise; getFileHash(filePath: string): Promise; deleteOrphans?(activeFiles: Set): Promise; } export interface IStalenessChecker { getChangedFiles(projectRoot: string, knownHashes: Map, knownMtimes: Map): Promise<{ changed: string[]; mtimes: Map; }>; computeHash(filePath: string): Promise; } export interface IFileWatcher { start(): void; stop(): void; readonly isRunning: boolean; notifyChanges(filePaths: string[]): void; } export interface ReindexResult { mode: string; changedFunctions: number; embedded: number; elapsedMs: number; } export interface IReindexOrchestrator { /** Full rebuild: re-parse all files, re-embed, rebuild graphs */ reindexFull(ws: WorkspaceServices, wsPath: string): Promise; /** Incremental: check for stale files, update only changed */ reindexIncremental(ws: WorkspaceServices, wsPath: string): Promise; /** Specific files only */ reindexFiles(ws: WorkspaceServices, wsPath: string, files: string[]): Promise; /** Handle file watcher changes (optimized incremental path) */ handleFileChanges(ws: WorkspaceServices, wsPath: string, changedFiles: string[]): Promise; } export interface TestDetectionMetadata { allTestDecorators: string[]; testImportPrefixesByExtension: Map; } export interface NoiseFilterMetadata { noiseTargets: Set; builtinMethods: Set; noisePatterns: RegExp[]; } export interface LanguageConventions { readonly selfKeywords: ReadonlySet; readonly constructorNames: ReadonlySet; readonly returnTypePatterns: readonly RegExp[]; readonly sourceRoots: readonly string[]; readonly workspaceManifests: readonly string[]; readonly workspaceManifestExtensions: readonly string[]; readonly indexFileNames: readonly string[]; } export interface WorkspaceServices { readonly index: IFunctionIndexReader; readonly indexWriter: IFunctionIndexWriter; readonly source: ISourceExtractor; readonly search: ISearchPipeline; readonly callGraph: ICallGraphReader; readonly callGraphWriter: ICallGraphWriter; readonly typeGraph: ITypeGraphReader; readonly typeGraphWriter: ITypeGraphWriter; readonly vectorDb: IVectorDatabase; readonly projectRoot: string; } export interface AppContext { resolveWorkspace(wsPath?: string): WorkspaceServices; readonly workspacePaths: string[]; readonly isMultiWorkspace: boolean; readonly config: Readonly; readonly embedding: IEmbeddingProvider; embeddingAvailable: boolean; readonly parsers: ILanguageParser[]; readonly conventions: LanguageConventions; readonly noiseFilter: NoiseFilterMetadata; readonly watcher: IFileWatcher; readonly reindex: IReindexOrchestrator; normalizeModuleQuery(query: string): string[]; ready: boolean; shutdown(): Promise; } export interface Config { projectRoot: string; workspaces?: string[]; embedding: { model: string; ollamaUrl: string; dimensions: number; batchSize: number; instruction?: string; }; parser: { languages: Record; ignore: string[]; sourceRoot?: string; }; moduleSummary: { compactThreshold: number; filesOnlyThreshold: number; overviewThreshold: number; maxTokenBudget: number; }; search: { highConfidenceThreshold: number; rrfK: number; expandCamelCase: boolean; exactNameBoost: boolean; density: { enabled: boolean; floor: number; ceiling: number; accessorPenalty: number; constructorPenalty: number; testFilePenalty: number; weights: { bodySize: number; docstring: number; docstringRichness: number; paramCount: number; centrality: number; visibility: number; kind: number; }; }; }; indexing: { parallelWorkers: number; maxFileSizeKb: number; maxChunkTokens: number; }; watcher: { debounceMs: number; minIntervalMs: number; }; } //# sourceMappingURL=interfaces.d.ts.map