import type { ScanTask, ScanResult, DerivedTask, DerivedResult } from './scan-worker.js'; export declare class ScanPool { private readonly size; private slots; private queue; private nextId; private started; private disabled; /** Version of the rule pack each worker has installed, by slot index. */ private packSent; constructor(size?: number); /** True when tasks will actually run on a worker. */ get enabled(): boolean; private start; private pump; /** * Keep the process alive exactly while the pool owes someone an answer. * * A worker with a task in flight must be ref'd or Node may exit before the * reply lands; an idle one must be unref'd or the pool alone keeps a one-shot * CLI command running forever. */ private refIfBusy; /** * Run one task on a worker. * * Returns null when the pool cannot take it — the caller must then do the * work inline. Null is a normal outcome, not an error: it is what makes the * pool optional. */ run(task: Omit): Promise; /** * Derive a session's compute rows on a worker. * * Same pool, same lifecycle, same null-means-inline contract as `run` — two * pools would mean two sets of workers competing for the same cores. */ runDerived(task: Omit): Promise; private dispatch; /** * Has this pool already sent the current rule pack? Lets the caller omit the * ~74-rule pack from every task and send it only when the version changes. * * Conservative on purpose: the answer is per POOL, not per worker, so the * pack is re-sent to every worker whenever the version moves. A worker that * receives a pack it already has reinstalls it once — cheap, and far safer * than a worker scanning with rules it never got. */ needsPack(version: string): boolean; markPackSent(version: string): void; close(): Promise; } export declare function scanPool(): ScanPool; /** Tests and `logout`: drop the workers. */ export declare function closeScanPool(): Promise; //# sourceMappingURL=scan-pool.d.ts.map