import { type ChatSourceDocumentUiPart, type ChatSourceUrlUiPart, type ChatToolResultPart, type ProviderModelMessage } from "../../chat/types.js"; type RuntimeAttachmentFields = { url: string; mediaType: string; filename?: string; uploadId?: string; uploadPath?: string; }; type RuntimeAttachmentPart = ({ type: "image"; } & RuntimeAttachmentFields) | ({ type: "file"; } & RuntimeAttachmentFields); type RuntimeAttachmentLikePart = RuntimeAttachmentPart & { upload_id?: string; upload_path?: string; }; type AgentRuntimeMessageLikePart = { type: "text"; text: string; } | { type: "reasoning"; text?: string; signature?: string; redactedData?: string; } | { type: string; toolCallId: string; toolName: string; args: Record; } | { type: string; toolCallId: string; toolName: string; input: Record; } | { type: "tool_call"; id?: string; name?: string; tool_call_id?: string; tool_name?: string; toolCallId?: string; toolName?: string; input?: Record; args?: Record; } | { type: "tool-result"; toolCallId: string; toolName: string; result?: unknown; } | { type: "tool-result"; toolCallId: string; toolName: string; output: unknown; } | { type: "tool_result"; tool_call_id?: string; tool_name?: string; toolCallId?: string; toolName?: string; result?: unknown; output?: unknown; } | RuntimeAttachmentLikePart | ChatSourceUrlUiPart | ChatSourceDocumentUiPart; /** Public API contract for agent runtime message part. */ export type AgentRuntimeMessagePart = { type: "text"; text: string; } | { type: "reasoning"; text?: string; signature?: string; redactedData?: string; } | { type: string; toolCallId: string; toolName: string; args: Record; } | { type: "tool-result"; toolCallId: string; toolName: string; result: unknown; } | RuntimeAttachmentPart | ChatSourceUrlUiPart | ChatSourceDocumentUiPart; /** Message shape for agent runtime. */ export interface AgentRuntimeMessage { id: string; role: ProviderModelMessage["role"]; parts: AgentRuntimeMessagePart[]; timestamp: number; } type ProviderReasoningPart = { type: "reasoning"; text?: string; signature?: string; redactedData?: string; }; /** Error shape for agent runtime message conversion. */ export declare class AgentRuntimeMessageConversionError extends Error { constructor(message: string); } /** Return a runtime text part when the value carries text. */ export declare function getAgentRuntimeTextPart(part: unknown): { type: "text"; text: string; } | null; /** Return a runtime reasoning part when the value carries reasoning replay state. */ export declare function getAgentRuntimeReasoningPart(part: unknown): ProviderReasoningPart | null; /** Return a runtime tool-call part when the value carries a tool call. */ export declare function getAgentRuntimeToolCallPart(part: unknown): { toolCallId: string; toolName: string; input: Record; } | null; /** Return a runtime tool-result part when the value carries a tool result. */ export declare function getAgentRuntimeToolResultPart(part: unknown, toolNameFallback?: string): { toolCallId: string; toolName: string; output: unknown; } | null; /** Create a chat tool-result part. */ export declare function createToolResultPart(part: { toolCallId: string; toolName: string; output: unknown; }): ChatToolResultPart; /** Convert provider messages to agent runtime messages. */ export declare function convertProviderMessagesToAgentRuntimeMessages(messages: readonly ProviderModelMessage[]): AgentRuntimeMessage[]; /** Convert agent runtime messages to provider messages. */ export declare function convertAgentRuntimeMessagesToProviderMessages(messages: ReadonlyArray & { parts: ReadonlyArray; }>): ProviderModelMessage[]; export {}; //# sourceMappingURL=message-adapter.d.ts.map