/** * In-process registry tracking which sessions currently have an active * CLI agent subprocess (ChannelBridge turn). * * Replaces the conceptual role of the former engine's active-runs map * that was stubbed to false/0 during engine removal (b27cecc795, #76/#77). */ /** * Runtime attestation (ADR 0005 H9). Declares the implementation status * of each runtime export in this module. See CONTRIBUTING.md § Module * attestations for the category definitions and the convention for * updating these when sync or rebrand changes the surface. */ export declare const MODULE_ATTESTATIONS: { readonly isSessionRunActive: "live"; readonly getActiveSessionRunCount: "live"; readonly registerSessionRun: "live"; readonly unregisterSessionRun: "live"; readonly getSessionRunHandle: "live"; readonly killSessionRun: "live"; readonly waitForSessionRunEnd: "live"; readonly resetSessionRunRegistryForTest: "live"; }; export type SessionRunHandle = { startedAt: number; pid?: number; sessionKey: string; agentId: string; abortController?: AbortController; }; /** Check whether a session currently has an active CLI agent turn. */ export declare function isSessionRunActive(sessionKey: string): boolean; /** Return the number of currently active session runs. */ export declare function getActiveSessionRunCount(): number; /** Register an active session run. */ export declare function registerSessionRun(sessionKey: string, handle: SessionRunHandle): void; /** Unregister a session run (on turn completion or crash). */ export declare function unregisterSessionRun(sessionKey: string): void; /** Retrieve the handle for an active session run, if any. */ export declare function getSessionRunHandle(sessionKey: string): SessionRunHandle | undefined; /** * Kill an active session run by aborting its controller or sending SIGTERM to its PID. * Returns `true` if a kill signal was dispatched. */ export declare function killSessionRun(sessionKey: string): boolean; /** * Wait (poll) for a session run to end. * Resolves `true` if the run ended, `false` on timeout. */ export declare function waitForSessionRunEnd(sessionKey: string, timeoutMs: number): Promise; /** Reset registry — only for tests. */ export declare function resetSessionRunRegistryForTest(): void;