import { Worker } from 'node:worker_threads'; import { Tool } from '../../tool.js'; import { BaseSearchTransform } from './base-search.transform.js'; import { SearchTransformOptions } from './types.js'; /** A match that is still running after this is treated as catastrophic and abandoned. */ export declare const REGEX_MATCH_TIMEOUT_MS = 300; /** After this quiet period a disabled transform may use the worker again. */ export declare const REGEX_TIMEOUT_COOLDOWN_MS = 60000; type RegexWorkerFactory = (filename: string, options: { workerData: { pattern: string; fields: string[]; }; resourceLimits: { maxOldGenerationSizeMb: number; }; }) => Worker; /** Test hook: replace worker construction. Pass undefined to restore the real Worker. */ export declare function setRegexWorkerFactoryForTests(factory?: RegexWorkerFactory): void; /** Test hook: highest concurrent regex workers since the last reset. */ export declare function regexWorkerPeak(): number; /** Test hook. */ export declare function resetRegexWorkerStats(): void; export declare class RegexSearchTransform extends BaseSearchTransform { readonly name = "RegexSearchTransform"; private toolsList; private toolMetadata; private consecutiveRegexTimeouts; private regexDisabledUntil; constructor(options?: SearchTransformOptions); protected queryIsPattern(): boolean; protected updateIndex(tools: Tool[], _hash: string): void; protected search(query: string, limit: number): Promise; private regexMatchingDisabled; /** * The query reaches us straight from the MCP client. Compiling it on the server * thread hands the caller an event-loop stall via catastrophic backtracking. * Literal substring matching is the default. Opt-in regex runs in a worker and * falls back to a literal match when the pattern is invalid or does not finish. */ private matchFields; } export {}; //# sourceMappingURL=regex-search.transform.d.ts.map