/** UI-facing snapshot of session state (messages + stop reason) plus its guards. */
import { type UserMessageUiMetadata } from './user-message-ui-metadata.js';
export declare const RuntimeMessageRole: {
    readonly Assistant: "assistant";
    readonly Tool: "tool";
    readonly User: "user";
};
export type RuntimeMessageRole = (typeof RuntimeMessageRole)[keyof typeof RuntimeMessageRole];
export interface RuntimeToolCall {
    args: Record<string, unknown>;
    id: string;
    name: string;
}
export interface RuntimeMessage {
    details?: unknown;
    id: string;
    isError?: boolean;
    role: RuntimeMessageRole;
    text: string;
    thinking?: string;
    toolCallId?: string;
    toolCalls?: readonly RuntimeToolCall[];
    toolName?: string;
    uiMetadata?: UserMessageUiMetadata;
}
export declare const AgentStopReason: {
    readonly Cancelled: "cancelled";
    readonly Completed: "completed";
    readonly Failed: "failed";
    readonly Running: "running";
};
export type AgentStopReason = (typeof AgentStopReason)[keyof typeof AgentStopReason];
/**
 * Categorical reason for a `Failed` stop. Mirrors backend's user-visible
 * error codes (`chat_context_too_long`, `chat_llm_unavailable`,
 * `chat_internal_error`) so the UI can render the right error card.
 */
export declare const AgentProtocolErrorKind: {
    readonly ContextTooLong: "context_too_long";
    readonly LlmUnavailable: "llm_unavailable";
    readonly Internal: "internal";
};
export type AgentProtocolErrorKind = (typeof AgentProtocolErrorKind)[keyof typeof AgentProtocolErrorKind];
export declare const RuntimeInFlightKind: {
    readonly Llm: "llm";
    readonly Tool: "tool";
    readonly HostTool: "host_tool";
    readonly Subagent: "subagent";
    readonly Compaction: "compaction";
};
export type RuntimeInFlightKind = (typeof RuntimeInFlightKind)[keyof typeof RuntimeInFlightKind];
export interface RuntimeInFlightOp {
    opId: string;
    kind: RuntimeInFlightKind;
    /** Human label, e.g. "Running code...". May be omitted for plain LLM calls. */
    label?: string;
    /** Tool name when kind is 'tool' or 'host_tool'. */
    toolName?: string;
    /** Tool-call id; UI keys per-message spinners on this. */
    toolCallId?: string;
    startedAt: number;
    /** Latest observed elapsed at the most recent tick. */
    elapsedMs: number;
}
export interface AgentSnapshot {
    sessionId: string;
    isStreaming: boolean;
    stopReason: AgentStopReason;
    /** Populated only when `stopReason === 'failed'`. */
    errorKind?: AgentProtocolErrorKind;
    messages: readonly RuntimeMessage[];
    /** Heartbeat-tracked operations currently outstanding. Empty when idle. */
    inFlight: readonly RuntimeInFlightOp[];
    /** Active run id; matches the `RunStatsEntry.run_id` emitted at agent_end. Undefined between runs. */
    runId?: string;
}
export declare function isRuntimeMessage(value: unknown): value is RuntimeMessage;
export declare function isRuntimeInFlightOp(value: unknown): value is RuntimeInFlightOp;
export declare function isAgentSnapshot(value: unknown): value is AgentSnapshot;
//# sourceMappingURL=agent-snapshot.d.ts.map