import { c as ChatMessage, v as ToolCallPart, a as ChatEvent, g as ChatSession, F as FilePart, p as MessagePart, q as ReasoningPart, t as SourcePart, u as TextPart, b as ChatId } from '../types-ajANVzf7.js';
export { C as ChatEventType, f as ChatIdLike, k as ChatMessageMetadata, l as ChatMessageStatus, e as ChatMiddleware, m as ChatMiddlewareContext, n as ChatRole, j as ChatSessionConfig, A as ChatSessionMetadata, o as IChatProvider, M as MessageStatus, O as ObservableSession, P as PartStatus, h as RuntimeSendOptions, R as RuntimeStatus, S as SendMessageOptions, r as SessionInfo, s as SessionStatus, T as ToolCallStatus, w as createChatId, x as createTextMessage, y as isObservableSession, z as toChatId } from '../types-ajANVzf7.js';
import { A as AgentEvent, d as Message, e as ToolResult } from '../agent-CW9XbmG_.js';
import '../errors-C-so0M4t.js';
import '../types-BxggH0Yh.js';
import '../errors-CmVvczxZ.js';
import 'zod';

/**
 * @witqq/agent-sdk — Chat utility functions
 */

/**
 * Join all TextPart texts in a message
 */
declare function getMessageText(message: ChatMessage): string;
/**
 * Filter all ToolCallParts from a message
 */
declare function getMessageToolCalls(message: ChatMessage): ToolCallPart[];
/**
 * Join all ReasoningPart texts in a message
 */
declare function getMessageReasoning(message: ChatMessage): string;

/**
 * @witqq/agent-sdk — Chat type guards
 */

/** Check if a value is a ChatMessage */
declare function isChatMessage(value: unknown): value is ChatMessage;
/** Check if a value is a ChatSession */
declare function isChatSession(value: unknown): value is ChatSession;
/** Check if a value is a MessagePart */
declare function isMessagePart(value: unknown): value is MessagePart;
/** Check if a value is a TextPart */
declare function isTextPart(value: unknown): value is TextPart;
/** Check if a value is a ToolCallPart */
declare function isToolCallPart(value: unknown): value is ToolCallPart;
/** Check if a value is a ReasoningPart */
declare function isReasoningPart(value: unknown): value is ReasoningPart;
/** Check if a value is a SourcePart */
declare function isSourcePart(value: unknown): value is SourcePart;
/** Check if a value is a FilePart */
declare function isFilePart(value: unknown): value is FilePart;
/** Check if a value is a ChatEvent */
declare function isChatEvent(value: unknown): value is ChatEvent;

/**
 * @witqq/agent-sdk — AgentEvent ↔ ChatEvent bridge
 */

/**
 * Map a single AgentEvent to a ChatEvent (or null if no mapping)
 */
declare function agentEventToChatEvent(event: AgentEvent, messageId: ChatId): ChatEvent | null;
/**
 * Convert AgentEvent async iterable to ChatEvent async iterable
 */
declare function adaptAgentEvents(events: AsyncIterable<AgentEvent>, messageId: ChatId): AsyncIterable<ChatEvent>;
/**
 * Map a ChatEvent back to an AgentEvent for accumulator consumption.
 * Returns null for events that don't map to accumulator-relevant AgentEvents.
 */
declare function chatEventToAgentEvent(event: ChatEvent): AgentEvent | null;

/**
 * @witqq/agent-sdk — ChatMessage ↔ agent-sdk Message conversion
 */

/**
 * Convert a ChatMessage to agent-sdk Message format
 */
declare function toAgentMessage(message: ChatMessage): Message;
/**
 * Convert an agent-sdk Message to ChatMessage
 */
declare function fromAgentMessage(message: Message, id?: ChatId): ChatMessage;
/**
 * Extract ToolResults from ToolCallParts that have results
 */
declare function extractToolResults(message: ChatMessage): ToolResult[];

export { ChatEvent, ChatId, ChatMessage, ChatSession, FilePart, MessagePart, ReasoningPart, SourcePart, TextPart, ToolCallPart, adaptAgentEvents, agentEventToChatEvent, chatEventToAgentEvent, extractToolResults, fromAgentMessage, getMessageReasoning, getMessageText, getMessageToolCalls, isChatEvent, isChatMessage, isChatSession, isFilePart, isMessagePart, isReasoningPart, isSourcePart, isTextPart, isToolCallPart, toAgentMessage };
