/** * Drive mode keep-warm (specs/2026-10-09-drive-mode-v3.md ยง5): while the * owner is in a Drive mode session, the agents he names and the team leads * he talks to stay running, so the next thing he says to them is answered in * seconds instead of after a cold start. * * Crewly Cloud tells this machine which of its agents to keep warm (relay * push `op:'warm'`, the list read back from `machine/state` with this * machine's token) and repeats it every few minutes while the phone is * connected. Each list holds until its `until` time (or the session's end), * so a phone that drops never pins agents for long. * * Consulted by every path that stops an idle agent or frees a running slot * (idle stop, memory-pressure stop, slot freeing, reconciler wake eviction) * and by the start gate, which lets a warm agent's start go ahead of * ordinary starts. * * @module services/drive/drive-keep-warm */ /** Which agents Drive mode keeps running right now. */ export declare class DriveKeepWarm { private readonly now; private readonly sessions; /** * @param now - Clock (ms) */ constructor(now?: () => number); /** * Replace a session's warm list. * * @param driveSessionId - Drive mode session * @param agents - Agent sessions to keep warm * @param untilMs - Until when (ms) * @returns The agents that were not warm before (to pre-start) */ set(driveSessionId: string, agents: readonly string[], untilMs: number): string[]; /** * The session ended: its agents are no longer kept warm. * * @param driveSessionId - Drive mode session */ end(driveSessionId: string): void; /** * Whether an agent is kept warm by any live session. * * @param agentSession - Agent session name * @returns True while a session's list holds it */ isWarm(agentSession: string): boolean; /** * Every agent kept warm now (expired lists are dropped). * * @returns Agent sessions */ warmAgents(): string[]; } /** @returns The process-wide keep-warm registry */ export declare function getDriveKeepWarm(): DriveKeepWarm; /** * Replace the registry (tests). * * @param registry - Registry */ export declare function setDriveKeepWarm(registry: DriveKeepWarm): void; /** * Whether Drive mode keeps an agent running right now. Never throws. * * @param agentSession - Agent session name * @returns True while the owner's Drive mode session keeps it warm */ export declare function isDriveWarm(agentSession: string): boolean; //# sourceMappingURL=drive-keep-warm.d.ts.map