/** Mirrors the `session.status` delta: a session is held while its last status event said * running:true AND backgroundRunning:true; any other status event clears it. * * Also carries the hold's CHANNEL and its abort handle, because the Stop path needs both. Stop * (`sessions.cancel` → cancelChannelRuns) is channel-keyed and used to look only at * `runningExecutions` — but a bg-held session has already left that registry (the execution is * torn down BEFORE the hold is installed), so Stop found nothing and silently did nothing while * the UI still showed the button. The channel index gives the channel-keyed cancel path a way to * find the hold, and the abort handle lets it seal the hold immediately. */ export declare class BgHeldSessions { private held; private aborts; /** Feed every `session.status` event through this (wired to the bus in entry/app.ts). */ onSessionStatus(e: { sessionId: string; channel?: string; running: boolean; backgroundRunning?: boolean; }): void; /** True while the session's foreground turn is over but a background task still holds it. */ has(sessionId: string): boolean; /** Sessions currently bg-held on a channel — the reverse lookup the channel-keyed Stop path * needs (`cancelChannelRuns`). Empty for an unheld/unknown channel. */ sessionsOnChannel(channel: string): string[]; /** Register the hold's abort (seal) handle — called by the hold itself via agent-runner. */ setAbort(sessionId: string, abort: () => void): void; /** Fire the registered abort once (Stop during a bg hold). Returns false when the session has * no live hold. Single-fire: the handle is dropped before invoking, and the seal's own * `running:false` publish clears the rest of the entry through `onSessionStatus`. */ abort(sessionId: string): boolean; /** Empty the registry (tests). */ clear(): void; } /** Singleton instance (one server process = one registry). */ export declare const bgHeldSessions: BgHeldSessions;