import { type Message, type Provider, type ThinkingLevel } from "@prestyj/ai";
import type { AgentTool } from "@prestyj/agent";
import type { ProcessManager } from "../core/process-manager.js";
import type { Skill } from "../core/skills.js";
import type { CheckpointStore } from "../core/checkpoint-store.js";
import { type GoalStatusEntry } from "./components/GoalStatusBar.js";
import { type PlanStep } from "../utils/plan-steps.js";
import type { MCPClientManager } from "../core/mcp/index.js";
import type { AuthStorage } from "../core/auth-storage.js";
import type { TerminalHistoryPrinter } from "./terminal-history.js";
import { type DoneStatus } from "./layout-decisions.js";
import type { GoalMode } from "../core/runtime-mode.js";
import type { GoalRun } from "../core/goal-store.js";
import { type SessionStats } from "./session-summary.js";
import type { CompletedItem, GoalProgressDraft } from "./app-items.js";
export type { CompletedItem, GoalProgressDraft, GoalProgressItem, ToolGroupItem, } from "./app-items.js";
export type { DoneStatus } from "./layout-decisions.js";
export { buildUserContentWithAttachments, routePromptCommandInput } from "./prompt-routing.js";
export { getNextThinkingLevel } from "./thinking-level.js";
export { getChatControlsLayoutDecision, getDoneFlushDecision, getScrollStabilizationDecision, getStaticHistoryKey, hasParagraphBreakLiveUserMessage, isTallLiveUserMessage, shouldHideHistoryForOverlayView, shouldHideStaticItemsForOverlayView, shouldStabilizeOverlayPaneRerender, shouldTopSpaceAfterPrintedAgentBoundary, shouldTopSpaceAssistantAfterToolBoundary, shouldTopSpaceStreamingAssistant, } from "./layout-decisions.js";
export { getNextGeneratedItemId, isActiveItem, partitionCompleted, pinStreamingTextBeforeToolBoundary, } from "./item-helpers.js";
export declare function completedItemsWithDurableGoalTerminalProgress(items: readonly CompletedItem[], runs: readonly GoalRun[]): CompletedItem[];
export declare function formatGoalTerminalProgress(run: GoalRun): GoalProgressDraft | null;
export declare function nextGoalModeAfterAgentDone({ currentMode, runningGoalIds, queuedSyntheticEvents, activeContinuationFlights, wasGoalSetupTurn, }: {
    currentMode: GoalMode;
    runningGoalIds: number;
    queuedSyntheticEvents: number;
    activeContinuationFlights?: number;
    wasGoalSetupTurn?: boolean;
}): GoalMode;
export interface AppProps {
    provider: Provider;
    model: string;
    tools: AgentTool[];
    webSearch?: boolean;
    messages: Message[];
    maxTokens: number;
    thinking?: ThinkingLevel;
    apiKey?: string;
    baseUrl?: string;
    accountId?: string;
    projectId?: string;
    cwd: string;
    version: string;
    showTokenUsage?: boolean;
    idealReviewEnabled?: boolean;
    autoApprovePlans?: boolean;
    onSlashCommand?: (input: string) => Promise<string | null>;
    loggedInProviders?: Provider[];
    credentialsByProvider?: Record<string, {
        accessToken: string;
        accountId?: string;
        projectId?: string;
        baseUrl?: string;
    }>;
    initialHistory?: CompletedItem[];
    sessionsDir?: string;
    sessionPath?: string;
    sessionId?: string;
    processManager?: ProcessManager;
    settingsFile?: string;
    mcpManager?: MCPClientManager;
    authStorage?: AuthStorage;
    planModeRef?: {
        current: boolean;
    };
    goalModeRef?: {
        current: GoalMode;
    };
    skills?: Skill[];
    /** Per-session file checkpoint store backing the /rewind command. */
    checkpointStore?: CheckpointStore;
    initialOverlay?: "pixel";
    rebuildToolsForCwd?: (cwd: string) => AgentTool[];
    /** Rebuild the `read` tool for a model (reuses the read tracker). Used on
     *  model switch so the tool's video capability tracks the active model. */
    rebuildReadTool?: (model: string) => AgentTool;
    connectInitialMcpTools?: () => Promise<AgentTool[]>;
    planCallbacks?: {
        onEnterPlan?: (reason?: string) => boolean | void | Promise<boolean | void>;
        onExitPlan?: (planPath: string) => Promise<string>;
    };
    terminalHistoryPrinter?: TerminalHistoryPrinter;
    /**
     * When true, the UI runs in the alternate-screen fullscreen viewport: the
     * transcript is rendered inside Ink as a bounded, app-scrolled region above a
     * pinned controls region, and nothing is written to native scrollback. This
     * is what keeps the footer a truly fixed bottom region. Defaults off (legacy
     * scrollback path) for non-TTY / CI / print modes.
     */
    fullscreen?: boolean;
    /**
     * Wired by `renderApp`. Tears down the current Ink instance and renders
     * a fresh one. Patching Ink's internal frame tracking in place is
     * unreliable (the live area drifts on subsequent streaming responses);
     * a full unmount/remount is the only consistent reset.
     *
     * Used by every path that previously did a bare ANSI screen clear:
     * `/clear`, plan accept/reject, overlay open/close, pixel fix.
     *
     * Runtime state (model, provider, thinking) survives via
     * `onRuntimeStateChange`; conversation/session state survives via
     * `sessionStore` (which App mirrors React state into).
     */
    resetUI?: (options?: {
        messages?: Message[];
        wipeSession?: boolean;
        history?: CompletedItem[];
        approvedPlanPath?: string;
        planSteps?: PlanStep[];
        sessionPath?: string;
        pendingAction?: {
            prompt: string;
            infoText?: string;
            planEvent?: {
                event: "approved" | "rejected" | "dismissed";
                detail?: string;
            };
        };
    }) => void;
    /**
     * Wired by `renderApp`. App calls this when the user changes
     * model/provider/thinking at runtime so those choices survive the
     * unmount/remount triggered by resetUI.
     */
    onRuntimeStateChange?: (updates: {
        model?: string;
        provider?: Provider;
        thinking?: ThinkingLevel;
    }) => void;
    /**
     * Wired by `renderApp`. App syncs its React state (messages, history,
     * plan steps, session metadata) to this object via useEffects so a
     * subsequent resetUI() can re-seed the conversation. Without this, every
     * overlay close would lose the chat.
     */
    sessionStore?: {
        messages: Message[];
        history: CompletedItem[];
        liveItems?: CompletedItem[];
        doneStatus?: DoneStatus | null;
        approvedPlanPath?: string;
        planSteps: PlanStep[];
        sessionPath?: string;
        sessionId?: string;
        sessionTitle?: string;
        sessionTitleGenerated: boolean;
        overlay?: "model" | "skills" | "plan" | "theme" | "pixel" | "goal" | null;
        planAutoExpand?: boolean;
        goalAutoExpand?: boolean;
        pendingAction?: {
            prompt: string;
            infoText?: string;
            planEvent?: {
                event: "approved" | "rejected" | "dismissed";
                detail?: string;
            };
        };
        pendingGoalRun?: GoalRun;
        isAgentRunning?: boolean;
        pendingResetUI?: boolean;
        runAllTasks?: boolean;
        runAllPixel?: boolean;
        planMode?: boolean;
        goalMode?: GoalMode;
        goalStatusEntries?: GoalStatusEntry[];
        sessionStats?: SessionStats;
        idealReviewEnabled?: boolean;
        autoApprovePlans?: boolean;
        taskRunning?: boolean;
    };
}
export declare function App(props: AppProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=App.d.ts.map