/** * Planned relaunches — sessions Crewly is stopping and starting again on * purpose (the runtime fallback moving an agent to another runtime, or back). * * A planned relaunch is not a crash or a hang. While a session is marked here * the orchestrator restart service, the orchestrator / agent heartbeat * monitors and hung-session detection leave it alone: no "Orchestrator * Restarted … unresponsive" alarm, no restart attempt counted, no ghost * downgrade. The service that relaunches sends its own single owner message. * * Module-level and dependency-free so every monitor can import it without * import cycles. * * @module services/agent/planned-relaunch.registry */ /** One planned relaunch. */ export interface PlannedRelaunch { /** Who asked for it (e.g. `runtime_fallback`) */ reason: string; /** Epoch ms the window ends */ until: number; } /** * Mark a session as being relaunched on purpose (or extend its window). * * @param sessionName - Session * @param reason - Who relaunches it * @param windowMs - How long it counts as planned * @param now - Current time (ms) * * @example * ```ts * markPlannedRelaunch('crewly-orc', 'runtime_fallback'); * ``` */ export declare function markPlannedRelaunch(sessionName: string, reason: string, windowMs?: number, now?: number): void; /** * The planned relaunch of a session, while its window lasts. * * @param sessionName - Session * @param now - Current time (ms) * @returns The record, or null */ export declare function getPlannedRelaunch(sessionName: string, now?: number): PlannedRelaunch | null; /** * Whether a session is being relaunched on purpose right now. * * @param sessionName - Session * @param now - Current time (ms) * @returns True inside the window */ export declare function isPlannedRelaunch(sessionName: string, now?: number): boolean; /** * End a session's planned-relaunch window. * * @param sessionName - Session */ export declare function clearPlannedRelaunch(sessionName: string): void; /** Forget every planned relaunch (tests). */ export declare function resetPlannedRelaunches(): void; //# sourceMappingURL=planned-relaunch.registry.d.ts.map