import type { Context } from '@wrongstack/core/agent'; import type { IndexResult } from './schema.js'; import { IndexStore } from './writer.js'; /** * Parallel parse batch size — see {@link indexParallelBatchSize}. * Re-resolved at the start of each index run so env profile changes apply. */ export declare function resolveParallelBatch(): number; /** * Pool startup is amortized across the complete index run, not one outer * batch. Balanced batches are capped at 40 files, so comparing the per-batch * parse count with the 500-file threshold made the worker path unreachable. * * Threshold is env-configurable (audit T-04): `WRONGSTACK_INDEX_WORKER_THRESHOLD` * overrides the default, `0` disables the worker path entirely. */ export declare function shouldUseParserWorkerPool(candidateFileCount: number, parseBatchCount: number): boolean; interface IndexerOptions { projectRoot: string; files?: string[] | undefined; force?: boolean | undefined; langs?: string[] | undefined; ignore?: string[] | undefined; /** Override the index directory (default: the global per-project dir). */ indexDir?: string | undefined; /** * Signal that cancels indexing cooperatively. Polled at yield points * (file walk, per-file loop) so a hung filesystem won't lock up the * process. When the tool executor's timeout fires, this signal aborts * and `runIndexer` throws, releasing the mutex and resetting flags. */ signal?: AbortSignal | undefined; /** * Per-file progress callback. Injected by the caller instead of imported * from the host's module state so the indexer can run inside a worker * thread (worker posts progress messages; inline host updates its state). */ onProgress?: ((current: number, total: number) => void) | undefined; } /** Run a full or incremental index and return statistics. */ export declare function runIndexer(_ctx: Context, opts: IndexerOptions): Promise; export declare function runIndexerWithStore(store: IndexStore, opts: IndexerOptions): Promise; export {}; //# sourceMappingURL=indexer.d.ts.map