import type React from "react";
import type { Agent, AgentChatMessage, AgentDetails, AgentMetadata, QueuedPrompt } from "../../services/agentService";
import type { AiProfile } from "../../services/aiService";
import type { AgentStatus } from "../../services/agentStatus";
import type { EditOperation } from "../../../types";
import type { AgentDialogRequest } from "../dialogs/agentDialogTypes";
export interface AgentTerminalProps {
    agentStub: Agent;
    initialMetadata?: AgentMetadata;
    profiles: AiProfile[];
    onReloadProfiles?: () => void | Promise<void>;
    /** Legacy single flag. If `isVisible`/`isFocused` are omitted, both fall back to this. */
    isActive?: boolean;
    /** Mounted and rendered. Drives WebSocket subscription, polling, and reload-on-active. Defaults to `isActive ?? true`. */
    isVisible?: boolean;
    /** Receives keyboard focus and owns dialogs. Defaults to `isActive ?? true`. */
    isFocused?: boolean;
    compact?: boolean;
    displayMode?: "full" | "summary";
    showSummaryInput?: boolean;
    hideContext?: boolean;
    hideBottomControls?: boolean;
    /** Force the bottom status bar (model/context/cost) to render even when bottom controls are hidden. Defaults to `!hideBottomControls`. */
    showStatusBar?: boolean;
    /** Force the agent configuration row (mode selector, Agent settings popover) to render even when bottom controls are hidden. Defaults to `!hideBottomControls`. */
    showAgentConfigControls?: boolean;
    hideGreeting?: boolean;
    defaultCollapseJson?: boolean;
    simpleMode?: boolean;
    className?: string;
    initialPrompt?: string;
    onAgentUpdate?: (updates: Partial<Agent>) => void;
    onMessage?: (message: AgentChatMessage) => void;
    onInteractionSubmitted?: () => void | Promise<void>;
    onQuestionnaireOpenChange?: (isOpen: boolean) => void;
    questionnaireFooterActions?: React.ReactNode;
    hideSummaryMessages?: boolean;
    summaryPlaceholderActions?: React.ReactNode;
    summaryPlaceholderMessage?: string;
    hideSummaryWaitingPlaceholder?: boolean;
}
export type AgentSessionLoadStatus = "idle" | "loading" | "ready" | "error";
export interface AgentSessionRunState {
    currentRunId: string | null;
    lastSeq: number;
    lastSettledRunId: string | null;
    status: AgentStatus | "submitting" | "connecting" | null;
    lastStatusReason: string | null;
    isConnecting: boolean;
    isSubmitting: boolean;
    isWaitingForResponse: boolean;
    isAgentThinking: boolean;
    stopGuardActive: boolean;
}
export interface AgentSessionReconciliationState {
    snapshotEpoch: number;
    latestAcceptedSnapshotEpoch: number;
    seenMessageIds: string[];
}
export interface AgentSessionActiveInlineDialog {
    request: AgentDialogRequest;
    onComplete: (result: unknown | null) => void;
    onCancel: () => void;
}
export interface AgentSessionCostLimitState {
    totalCost: number;
    costLimit: number;
    initialCostLimit: number;
}
export interface AgentSessionContextWindowState {
    contextWindowTokens: number;
    estimatedInputTokens: number;
    contextUsedPercent: number;
    model?: string;
}
export interface AgentSessionLiveTotalsState {
    input: number;
    output: number;
    cached: number;
    cacheWrite?: number;
    inputAudio?: number;
    outputAudio?: number;
    outputImage?: number;
    reasoning?: number;
    inputCost: number;
    outputCost: number;
    cachedCost: number;
    cacheWriteCost?: number;
    inputAudioCost?: number;
    outputAudioCost?: number;
    outputImageCost?: number;
    imageCost: number;
    markupCost?: number;
    reportedTotalCost?: number;
    totalCost: number;
    currency?: string;
}
export interface AgentSessionState {
    loadStatus: AgentSessionLoadStatus;
    error: string | null;
    agent: AgentDetails | undefined;
    transcript: AgentChatMessage[];
    operationHistory: EditOperation[];
    queuedPrompts: QueuedPrompt[];
    metadata: AgentMetadata | null;
    costLimitExceeded: AgentSessionCostLimitState | null;
    contextWindowStatus: AgentSessionContextWindowState | null;
    liveTotals: AgentSessionLiveTotalsState | null;
    browserClaimMutationPending: boolean;
    activeInlineDialog: AgentSessionActiveInlineDialog | null;
    run: AgentSessionRunState;
    reconciliation: AgentSessionReconciliationState;
}
export interface AgentSessionSubmitPromptInput {
    text: string;
    source: "composer" | "quick-action" | "initial-prompt";
    resolveComposerPlaceholders?: boolean;
}
export interface AgentSessionCommands {
    reload: (options?: {
        silent?: boolean;
    }) => Promise<void>;
    submitPrompt: (input: AgentSessionSubmitPromptInput) => Promise<void>;
    sendQuickMessage: (text: string) => Promise<void>;
    stopRun: () => Promise<void>;
    resolveToolApproval: (input: {
        messageId: string;
        toolCallId: string;
        approved: boolean;
        note?: string;
    }) => Promise<void>;
    cancelInlineDialog: () => void;
    refreshContext: () => Promise<void>;
    claimBrowser: (takeOver: boolean) => Promise<void>;
    releaseBrowser: () => Promise<void>;
}
