/** * Batch parsers for the external toolchain languages (Go, Python) — P3.8. * * The single-file parsers spawn one `go run` / `python` child process per * file. For a 400-file Go project that is 400 process spawns, each paying * toolchain startup; the spawn gate serializes them, so parse time scales * linearly with spawn cost. This module runs the SAME extraction core (see * `toolchain-scripts.ts`) over a batch: one child process per chunk of files, * sources in over stdin as a JSON array, one JSON envelope out per file. * * Fallback contract: a file the batch could not parse (per-file error in the * envelope, or the chunk itself failing) is simply ABSENT from the returned * map — the caller re-parses those files through the single-file parser, * which owns the per-language fallback semantics (Go: regex extractor; * Python: generic regex only when the runtime is missing). */ import type { FileSymbols, SymbolLang } from './schema.js'; export interface BatchFile { file: string; content: string; lang: SymbolLang; } /** Split a file list into chunks bounded by both file count and total bytes. * Generic so callers' extra per-file fields (e.g. source index) survive. */ export declare function chunkBatchFiles(files: readonly T[]): T[][]; /** * Test-only: the cached batch-script paths, so a test can observe WHERE the * scripts were written without needing a toolchain. */ export declare function __batchScriptPathsForTest(): { go: string | null; py: string | null; }; /** * Parse a chunk of Go files with ONE `go run` invocation. * Returns per-file results; files absent from the map failed and the caller * falls back to the single-file parser. */ export declare function runGoBatch(files: readonly BatchFile[], goBinary?: string): Promise>; /** * Parse a chunk of Python files with ONE interpreter invocation. * Same contract as {@link runGoBatch}; `pythonBinary` is the cached resolver * from py-parser.ts so both paths agree on which interpreter runs. */ export declare function runPyBatch(files: readonly BatchFile[], pythonBinary: string): Promise>; //# sourceMappingURL=parser-batch.d.ts.map