/** * Parser worker entry point for P5's multi-threaded parser pool. * * Each worker in the pool runs this script. It receives batches of files, * reads them from disk, parses them via the existing `parseFileContent` * dispatch (which routes to tree-sitter, the TS compiler, etc.), and returns * the parsed `FileSymbols[]` back to the main thread. * * Workers never touch SQLite — the main thread owns all DB writes via * `commitBatch`. This keeps the WAL writer single-threaded and avoids * cross-thread `node:sqlite` issues. * * The worker terminates cleanly when it receives a `{ type: 'shutdown' }` * message. If the parent port closes unexpectedly, the worker exits. */ import type { FileSymbols } from './schema.js'; export interface ParserWorkerResponse { type: 'result'; id: number; /** Identity of the responding worker (`threadId`) — lets the pool free * exactly the worker that answered, and detect which chunk is orphaned * when a worker dies mid-batch. */ workerId: number; results: FileSymbols[]; errors: ReadonlyArray<{ file: string; error: string; }>; } //# sourceMappingURL=parser-worker-script.d.ts.map