import type { EternalAutonomyEngine, ParallelEternalEngine } from '@wrongstack/core/execution'; import type { SddRunControl } from '@wrongstack/sdd'; import type { Action, State } from '../app-reducer.js'; interface MutableRef { current: T; } interface StreamSegment { kind: 'assistant' | 'thinking'; text: string; } export interface SessionInterruptController { abortLeader: () => boolean; /** * True while a leader run, autonomy loop, or SDD run is in flight. Read by * `/clear` to confirm before wiping a session that still has active work. */ isRunning?: (() => boolean) | undefined; /** TUI-owned `/clear` confirmation panel bridge. */ confirmClear?: ((info: { leaderActive: boolean; subagentCount: number; }) => Promise) | undefined; /** TUI-owned generic slash-command confirmation panel bridge. */ confirmSlash?: ((question: string, defaultYes: boolean) => Promise) | undefined; resetSession?: (() => void) | undefined; waitForIdle?: (() => Promise) | undefined; } interface UseSessionInterruptControllerOptions { interruptController: SessionInterruptController | undefined; dispatch: (action: Action) => void; stateRef: MutableRef; activeCtrlRef: MutableRef; activeRunSettledRef: MutableRef>; sessionGenerationRef: MutableRef; streamingTextRef: MutableRef; streamSegmentsRef: MutableRef; pendingDeltaRef: MutableRef; assistantCommittedThisRunRef: MutableRef; flushTimerRef: MutableRef | null>; eternalLoopRunningRef: MutableRef; parallelLoopRunningRef: MutableRef; /** Attachment preview cache — cleared on /clear so stale previews from * the previous conversation don't survive into the next one. */ tokenPreviewsRef: MutableRef<{ clear(): void; }>; clearPendingConfirms: () => void; getEternalEngine: (() => EternalAutonomyEngine | null) | undefined; getParallelEngine: (() => ParallelEternalEngine | null) | undefined; getSddRun: (() => SddRunControl | null) | undefined; switchAutonomy: ((mode: 'off' | 'suggest' | 'auto' | 'eternal' | 'eternal-parallel') => string | null) | undefined; } /** Connect `/interrupt` and `/clear` to the live TUI run lifecycle. */ export declare function useSessionInterruptController({ interruptController, dispatch, stateRef, activeCtrlRef, activeRunSettledRef, sessionGenerationRef, streamingTextRef, streamSegmentsRef, pendingDeltaRef, assistantCommittedThisRunRef, flushTimerRef, eternalLoopRunningRef, parallelLoopRunningRef, tokenPreviewsRef, clearPendingConfirms, getEternalEngine, getParallelEngine, getSddRun, switchAutonomy, }: UseSessionInterruptControllerOptions): void; export {}; //# sourceMappingURL=use-session-interrupt-controller.d.ts.map