import type { EditorSocketDiagnostics } from "../client/socketDiagnostics";
import type { AgentDiagnosticsResponse, AgentDiagnosticsEvent } from "../services/agentService";
export interface AgentTerminalRecentEvent {
    timestamp: string;
    direction?: "incoming" | "outgoing" | null;
    type: string;
    seq?: number | null;
    detail?: string | null;
    rawMessage?: string | null;
    payloadBytes?: number | null;
}
export interface AgentTerminalRunDiagnosticsSnapshot {
    agentId: string;
    isSubmitting: boolean;
    isConnecting: boolean;
    isWaitingForResponse: boolean;
    isAgentThinking: boolean;
    isExecuting: boolean;
    lastStatusReason: string | null;
    lastStatusMessage: string | null;
    hasActiveStreaming: boolean;
    isSubscribed: boolean;
    lastSeq: number;
    lastEventType: string | null;
    lastEventAt: string | null;
    recentEvents: AgentTerminalRecentEvent[];
    currentRunReceivedSeqs: number[];
    currentRunMissingSeqs: number[];
    currentRunTotalEventCount: number;
    assistantMessageCount: number;
    assistantGroupCount: number;
    assistantGroupsWithRenderableToolCalls: number;
    messagesWithToolCalls: number;
    totalToolCallCount: number;
    incompleteToolCallCount: number;
    recentToolUiEvents: AgentTerminalRecentEvent[];
}
export interface AgentDiagnosticsSummary {
    code: "healthy" | "client-disconnected" | "subscription-lost" | "server-failed" | "waiting-for-capacity" | "client-lagging" | "stream-stalled" | "run-finished" | "waiting";
    title: string;
    detail: string;
}
export declare function isServerExecutionActive(diagnostics?: AgentDiagnosticsResponse | null): boolean;
export declare function interpretAgentRunDiagnostics(params: {
    socketDiagnostics: EditorSocketDiagnostics;
    localSnapshot: AgentTerminalRunDiagnosticsSnapshot;
    serverDiagnostics?: AgentDiagnosticsResponse | null;
    now?: Date;
    stalledAfterMs?: number;
}): AgentDiagnosticsSummary;
export declare function formatSeqRanges(seqs: number[]): string;
export declare function formatAgentDiagnosticsEvent(event: AgentDiagnosticsEvent | AgentTerminalRecentEvent): string;
