import { type Message, type Provider, type ThinkingLevel } from "@kenkaiiii/gg-ai"; import type { AgentTool } from "@kenkaiiii/gg-agent"; import { type SubAgentManager } from "../core/subagent-manager.js"; import type { ProcessManager } from "../core/process-manager.js"; import { type TurnMetricPayload } from "../core/session-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 ReviewCoverageTracker } from "../core/ideal-review.js"; import type { LspManager } from "../core/lsp/manager.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; /** Kill switch for the pre-stop verification gate (default on). */ verificationGateEnabled?: boolean; onSlashCommand?: (input: string) => Promise; loggedInProviders?: Provider[]; credentialsByProvider?: Record; initialHistory?: CompletedItem[]; sessionsDir?: string; sessionPath?: string; sessionId?: string; processManager?: ProcessManager; subAgentManager?: SubAgentManager; lspManager?: LspManager; reviewCoverageTracker?: ReviewCoverageTracker; settingsFile?: string; mcpManager?: MCPClientManager; authStorage?: AuthStorage; planModeRef?: { current: boolean; }; skills?: Skill[]; /** Per-session file checkpoint store backing the /rewind command. */ checkpointStore?: CheckpointStore; /** 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; planCallbacks?: { onEnterPlan?: (reason?: string) => void | Promise; onExitPlan?: (planPath: string) => Promise; }; 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. * * 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[]; turnMetrics?: TurnMetricPayload[]; liveItems?: CompletedItem[]; doneStatus?: DoneStatus | null; approvedPlanPath?: string; planSteps: PlanStep[]; sessionPath?: string; sessionId?: string; overlay?: "model" | "skills" | "plan" | "theme" | null; planAutoExpand?: boolean; pendingAction?: { prompt: string; infoText?: string; planEvent?: { event: "approved" | "rejected" | "dismissed"; detail?: string; }; }; isAgentRunning?: boolean; pendingResetUI?: boolean; runAllTasks?: boolean; planMode?: boolean; sessionStats?: SessionStats; idealReviewEnabled?: boolean; verificationGateEnabled?: boolean; }; } export declare function App(props: AppProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=App.d.ts.map