import { type ThreadLifecycleService } from "./thread-lifecycle.service.js"; export declare const WORKER_GRACE_MS: number; /** True while a worker is inside its TTL grace window (winding down, but its MCP * socket is still open so it can deliver a final result). Read by the poll loop * (to tell the worker to wrap up) and by send_message_to_thread (to honestly * reject new orchestrator work rather than silently queue it to a dying worker). */ export declare function isWorkerInGrace(threadId: number): boolean; /** Drop a worker's grace-map entry without running teardown. Used by the terminal * self-exit path in handleProcessExit, which returns without calling * decommissionWorker (the DB row is already Archived/Expired) and would otherwise * leak the in-memory deadline forever. Best-effort and safe if no entry exists. */ export declare function clearWorkerGrace(threadId: number): void; export declare function decommissionWorker(thread: { threadId: number; pid?: number; memorySourceThreadId?: number; name: string; startedAt?: number; }, deps: { db: ReturnType; telegram: { deleteForumTopic(chatId: string, threadId: number): Promise; }; chatId: string; threadLifecycle: ThreadLifecycleService; }): Promise; export declare const DEFAULT_WORKER_TTL_MS: number; export declare function cleanupExpiredWorkers(db: ReturnType, telegram: { deleteForumTopic(chatId: string, threadId: number): Promise; sendMessage?(chatId: string, text: string, parseMode?: string, threadId?: number): Promise; }, chatId: string, threadLifecycle: ThreadLifecycleService, ttlMs?: number): Promise<{ cleaned: number; errors: string[]; }>; //# sourceMappingURL=worker-cleanup.service.d.ts.map