/** * Run the first-start metadata index in a worker thread and wait for it. * * See startupIndexWorker.ts for why. The parent side is thin: it spawns the * worker, routes its console output where the caller says (stderr in stdio * mode — stdout is the MCP protocol channel there), and settles once with the * worker's result. It still WAITS: the caller holds dbReady until the index is * populated, so tools that need symbols keep getting the "still loading" * answer instead of silently empty results — the difference is that the event * loop is free meanwhile, so the tools that need no symbols answer at once. */ import type { StartupIndexWorkerData } from './startupIndexWorker.js'; import type { IndexProgress } from './symbolIndex.js'; export interface StartupIndexOptions extends StartupIndexWorkerData { /** Injected in tests; the real one resolves next to the compiled worker. */ workerUrl?: URL; /** Where the worker's stdout/stderr go. Defaults to the parent's stderr. */ output?: NodeJS.WritableStream; /** * Heap cap for the worker. A worker's default old-generation limit is derived * from the parent's, which is sized for serving, not for indexing. */ maxOldGenerationSizeMb?: number; /** Called as the build moves between models and phases. */ onProgress?: (p: IndexProgress) => void; } export interface StartupIndexResult { elapsedMs: number; symbolCount: number; } /** In-memory databases cannot be shared with a worker — the caller indexes inline. */ export declare function canIndexOffThread(dbPath: string, labelsDbPath: string): boolean; export declare function indexMetadataOffThread(opts: StartupIndexOptions): Promise; //# sourceMappingURL=startupIndexing.d.ts.map