import React from "react";
import { type Message, type Provider, type ThinkingLevel } from "@kenkaiiii/gg-ai";
import type { AgentTool } from "@kenkaiiii/gg-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 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 SessionStats } from "./session-summary.js";
import type { CompletedItem } from "./app-items.js";
export type { CompletedItem, 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 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;
    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;
    };
    skills?: Skill[];
    /** Per-session file checkpoint store backing the /rewind command. */
    checkpointStore?: CheckpointStore;
    initialOverlay?: "pixel";
    rebuildToolsForCwd?: (cwd: string) => Promise<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) => void | Promise<void>;
        onExitPlan?: (planPath: string) => Promise<string>;
    };
    terminalHistoryPrinter?: TerminalHistoryPrinter;
    /**
     * Wired by `renderApp`. Queues raw bytes through the patched Ink
     * `insertBeforeFrame` so finalized transcript rows are folded atomically
     * into the next frame write (erase old frame + scrollback bytes + new frame
     * in one synchronized write). This is what keeps the footer pinned when
     * flushed rows leave the live frame. Falls back to a raw stdout write when
     * the patched API is unavailable.
     */
    enqueueHistoryWrite?: (data: string) => void;
    /**
     * Wired by `renderApp`. Enables/disables the patched Ink bottom-anchor pad
     * creation. On while the agent runs (footer must not jump as the tool panel
     * and status rows churn); off at idle so symmetric UI shrink (slash menu
     * close, input collapse) lets the footer return up without leaving pads.
     */
    setFrameAnchorActive?: (active: boolean) => void;
    /**
     * 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" | null;
        planAutoExpand?: boolean;
        pendingAction?: {
            prompt: string;
            infoText?: string;
            planEvent?: {
                event: "approved" | "rejected" | "dismissed";
                detail?: string;
            };
        };
        isAgentRunning?: boolean;
        pendingResetUI?: boolean;
        runAllTasks?: boolean;
        runAllPixel?: boolean;
        planMode?: boolean;
        sessionStats?: SessionStats;
        idealReviewEnabled?: boolean;
    };
}
export declare function App(props: AppProps): React.JSX.Element;
//# sourceMappingURL=App.d.ts.map