/** Latest-wins, idle-bound queue for safe Agent session changes. */ export interface IdleActivity { readonly status: 'idle' | 'running'; whenIdle(): Promise; } export declare class SessionSwitchQueue { private readonly execute; private readonly failed; private pending; private pumping; private running; constructor(execute: (value: T) => Promise, failed: (error: unknown) => void); /** Queue a request; a later request replaces any request still waiting. */ request(activity: IdleActivity, value: T): 'queued' | 'started'; /** Cancel only work that has not begun activation. */ cancel(): boolean; /** * Whether a queued change is being activated right now. Between the idle * wait and the handoff the old session is still installed, so a submission * made in that window would start a turn the handoff then discards; callers * use this to refuse one instead of losing it. */ get activating(): boolean; private pump; }