import { type Goal } from "../../goals/state"; import type { AgentSession, AgentSessionEvent } from "../../session/agent-session"; import type { SessionContext, SessionManager } from "../../session/session-manager"; import type { SubmittedUserInput } from "../types"; import type { ModeGate } from "./mode-gate"; interface GoalModeControllerContext { readonly session: AgentSession; readonly sessionManager: SessionManager; readonly modeGate: ModeGate; get planModeActive(): boolean; get inputCallback(): ((input: SubmittedUserInput) => void) | undefined; get hasPendingSubmission(): boolean; get hasPendingImages(): boolean; get editorText(): string; startPendingSubmission(input: { text: string; customType?: string; display?: boolean; }): SubmittedUserInput; showStatus(message: string): void; showWarning(message: string): void; showError(message: string): void; showHookConfirm(title: string, message: string): Promise; showHookSelector(title: string, options: string[]): Promise; showHookEditor(title: string, options?: { promptStyle?: boolean; }): Promise; updateGoalModeStatus(status: { enabled: boolean; paused: boolean; } | undefined): void; } /** Owns goal-mode state, continuation scheduling, commands, and session restoration. */ export declare class GoalModeController { #private; private readonly ctx; constructor(ctx: GoalModeControllerContext); get enabled(): boolean; get paused(): boolean; setEnabledForCompatibility(enabled: boolean): void; setPausedForCompatibility(paused: boolean): void; beforeGetUserInput(): Promise; scheduleContinuation(): void; cancelContinuation(): void; onPendingSubmissionFinished(customType?: string): void; onUserSubmission(): void; handleSessionEvent(event: AgentSessionEvent): Promise; /** * Restore durable goal state. Recovery hydration deliberately performs only * in-memory restoration: it neither consumes a pending request nor repairs * invalid persisted state by writing a fallback mode entry. */ restoreFromSession(sessionContext: SessionContext, options?: { recoveryHydration?: boolean; }): Promise; handleCommand(rest?: string): Promise; enter(options: { objective?: string; provenance?: Goal["provenance"]; resume?: boolean; silent?: boolean; }): Promise; exit(options?: { silent?: boolean; paused?: boolean; reason?: "completed" | "paused" | "dropped"; }): Promise; } export {};