import type { AttachmentResult, FailureView, HitlAction, ResponseFeedback, RuntimeEvent, ThreadDetail, ThreadSummary } from "@agents24/client"; import { type ContextCompression, type ContextWindow } from "@agents24/client/protocol"; import { type ChatToolSessionRecap } from "./tool-session-recap"; export { toolSessionRecapFromWire } from "./tool-session-recap"; export type { ChatToolIconKey, ChatToolRecapAction, ChatToolSessionRecap } from "./tool-session-recap"; export type AgentChatMessageRole = "user" | "assistant"; export type AgentChatRunState = "idle" | "uploading" | "streaming" | "reconnecting" | "paused" | "waiting" | "interrupted" | "cancelling" | "completed" | "cancelled" | "failed"; export type ChatCitation = { title: string; url: string; description?: string; sourceRef?: string; [key: string]: unknown; }; export type ChatAttachment = { id?: string; url?: string; filename?: string; mediaType?: string; contentType?: string; status?: string; /** Authorized processed-text output; presentation only, never submission input. */ transcriptPresentation?: "attachment" | "dictation"; processedText?: string; processedTextOutputId?: string; processedTextIsLive?: boolean; [key: string]: unknown; }; export declare function chatAttachmentIds(attachments?: readonly ChatAttachment[]): string[]; export type ChatToolState = "input-streaming" | "input-available" | "output-available" | "output-error" | "cancelled"; export type ChatPartMetadata = { id: string; runId?: string | null; sequence?: number | null; timestamp?: string | null; raw?: Record; }; export type ChatToolChildRun = { runId?: string | null; agentId?: string | null; agentName?: string | null; status?: string | null; error?: string | null; }; export type ChatToolChild = { id: string; runId?: string | null; toolCallId?: string | null; toolName: string; title: string; status: string; detail?: string | null; sequence?: number | null; timestamp?: string | null; }; export type ChatToolPresentation = Record & { title?: string | null; activity?: string | null; detail?: string | null; category?: string | null; iconKey?: string | null; webAction?: "search" | "fetch"; searchTopic?: string | null; groupKey?: string | null; groupLabel?: string | null; generatedActivity?: { title: string; groupTitle: string; }; path?: string | null; threadId?: string | null; isExploration?: boolean; childRun?: ChatToolChildRun | null; childTools?: ChatToolChild[]; activeChildToolId?: string | null; }; export type ChatTextPart = ChatPartMetadata & { type: "text"; kind: "text"; text: string; toolSessionRecap?: ChatToolSessionRecap; }; export type ChatComputerResourceTarget = { type: "computer"; thread_id: string; computer_id: string; path: string; kind: "file" | "directory"; }; export type ChatToolPart = ChatPartMetadata & { type: `tool-${string}`; kind: "tool"; toolName: string; toolKey?: string | null; action?: string | null; displayName?: string | null; summary?: string | null; toolCallId?: string | null; sourceKind?: string | null; state: ChatToolState; input?: unknown; output?: unknown; resourceTargets?: readonly ChatComputerResourceTarget[]; errorText?: string | null; failure?: FailureView | null; presentation: ChatToolPresentation; }; export type ChatReasoningPart = ChatPartMetadata & { type: "reasoning"; kind: "reasoning"; label?: string | null; text?: string | null; status?: string | null; }; export type ChatModelTurnPart = ChatPartMetadata & { type: "model-turn"; kind: "model-turn"; modelTurnId: string; turnKind: "agent" | "model"; status: "running"; iteration?: number | null; }; export type ChatContextCompressionPart = ChatPartMetadata & { type: "context-compression"; kind: "context-compression"; status: "started" | "completed" | "failed"; compression: ContextCompression; }; export type ChatNodeActivityState = "running" | "completed" | "failed" | "cancelled" | "skipped"; export type ChatNodeSkipReason = "missing_required_input" | "upstream_input_unavailable" | "empty_optional_source"; export type ChatNodeActivityPart = ChatPartMetadata & { type: "node-activity"; kind: "node-activity"; activityId: string; /** Opaque trusted-host trace selector; absent from public projections. */ traceStepId?: string | null; label: string; nodeKind: string; status: ChatNodeActivityState; defaultChatVisible: boolean; reason?: ChatNodeSkipReason | null; failure?: FailureView | null; }; export type ChatUiBlocksPart = ChatPartMetadata & { type: "ui-blocks"; kind: "ui-blocks"; state: ChatToolState; toolCallId?: string | null; contractVersion?: string | null; bundle?: Record | null; errorText?: string | null; }; export type ChatHitlKind = "tool_review" | "mcp_auth" | "user_approval" | "app_data_permission" | "user_input"; export type ChatHitlStatus = "pending" | "resolved" | "expired" | "cancelled" | "invalidated"; export type ChatHitlQuestion = { id: string; header: string; question: string; options: Array<{ id: string; label: string; }>; multiSelect: boolean; }; export type ChatHitlAnswer = { questionId: string; selectedOptionIds: string[]; customText?: string; }; export type ChatHitlResolution = Record & { answers?: ChatHitlAnswer[]; outcome?: string; status?: string; }; export type ChatHitlPart = ChatPartMetadata & { type: "hitl"; kind: "hitl"; interruptId: string; hitlKind: ChatHitlKind; message: string; allowedActions: HitlAction[]; status: ChatHitlStatus; presentation: Record; questions: ChatHitlQuestion[]; resolution?: ChatHitlResolution | null; }; export type ChatErrorPart = ChatPartMetadata & { type: "error"; kind: "error"; errorText: string; failure?: FailureView | null; }; export type ChatDataPart = ChatPartMetadata & { type: "data"; kind: "data"; name: string; data: Record; }; export type ChatSourcePart = ChatPartMetadata & { type: "source"; kind: "source"; title: string; url?: string | null; description?: string | null; }; export type ChatCitationPart = ChatPartMetadata & { type: "citation"; kind: "citation"; sourceId?: string | null; label?: string | null; url?: string | null; }; export type ChatAttachmentPart = ChatPartMetadata & { type: "attachment"; kind: "attachment"; attachment: ChatAttachment; }; export type ChatPart = ChatTextPart | ChatToolPart | ChatReasoningPart | ChatModelTurnPart | ChatContextCompressionPart | ChatNodeActivityPart | ChatUiBlocksPart | ChatHitlPart | ChatErrorPart | ChatDataPart | ChatSourcePart | ChatCitationPart | ChatAttachmentPart; /** Transient run presentation; never execution authority or model history. */ export type ChatRunActivity = { status: "running" | "waiting" | "interrupted" | "cancelling"; capacityWait?: { reason: string; retryAt?: string; deadline?: string; }; waitingToolCallIds?: readonly string[]; }; export declare function waitingToolCallIdsFromWire(value: unknown): string[] | undefined; export type ChatMessage = { workflowOutputs?: import("@agents24/client").WorkflowOutputsPage; workflowOutputRevision?: number; liveWorkflowOutputIds?: readonly string[]; id: string; /** Durable timeline identity when a mounted optimistic turn keeps its display key. */ durableId?: string; clientSubmissionId?: string; segmentIndex?: number | null; role: AgentChatMessageRole; runId?: string | null; content: string; createdAt: Date | string; isFinal?: boolean; activity?: ChatRunActivity; responseCompletion?: import("@agents24/client/protocol").ResponseCompletion; parts: ChatPart[]; attachments?: ChatAttachment[]; citations?: ChatCitation[]; feedback?: ResponseFeedback | null; messageIndex?: number; reasoningSteps?: Array>; thinkingDurationMs?: number; tokenUsage?: { inputTokens?: number | null; outputTokens?: number | null; totalTokens?: number | null; usageSource?: string | null; }; isVoice?: boolean; }; export type StoredChatThread = ThreadSummary & { taskNotifications?: Array & { handle: string; }>; messages: ChatMessage[]; isHydrated?: boolean; hasOlderTurns?: boolean; nextBeforeTurnIndex?: number | null; contextWindow?: ContextWindow | null; contextCompression?: ContextCompression | null; }; export type ThreadActivity = { status: string | null; runId: string | null; isSpinning: boolean; isPaused: boolean; isFailed: boolean; isCompleted: boolean; isCancelled: boolean; }; export declare function getThreadActivity(thread: Pick): ThreadActivity; export declare function computerResourceTargets(value: unknown): ChatComputerResourceTarget[]; export declare function partsFromResponseBlocks(blocks: unknown, fallbackText?: string, fallbackPartId?: string): ChatPart[]; export declare function assistantProjectionFromEvent(event: RuntimeEvent): { content: string; parts: ChatPart[]; }; export declare function modelTurnPartFromEvent(event: RuntimeEvent): ChatModelTurnPart | null; export declare function contextCompressionPartFromEvent(event: RuntimeEvent, existingParts?: readonly ChatPart[]): ChatContextCompressionPart | null; export declare function threadDetailToMessages(detail: ThreadDetail): ChatMessage[]; export declare function threadTimelineToMessages(items: readonly import("@agents24/client").ThreadMessage[]): ChatMessage[]; export declare function latestThreadContext(detail: ThreadDetail): { contextWindow: ContextWindow | null; contextCompression: ContextCompression | null; }; export declare function attachmentResultToChatAttachment(result: AttachmentResult): ChatAttachment;