
import { BaseEvent, RunAgentInput } from "@ag-ui/client";

//#region src/agent/converters/tanstack.d.ts
/**
 * Message format expected by TanStack AI's `chat()`.
 *
 * Content is typed as `any[]` for the multimodal case so messages are directly
 * passable to any adapter without casts — different adapters constrain which
 * modalities they accept (e.g. OpenAI only allows text + image).
 * Use `TanStackContentPart` to inspect individual parts if needed.
 */
interface TanStackChatMessage {
  role: "user" | "assistant" | "tool";
  content: string | null | any[];
  name?: string;
  toolCalls?: Array<{
    id: string;
    type: "function";
    function: {
      name: string;
      arguments: string;
    };
  }>;
  toolCallId?: string;
}
/**
 * Result of converting RunAgentInput to TanStack AI format.
 */
interface TanStackInputResult {
  /** Chat messages (only user/assistant/tool roles; all others excluded) */
  messages: TanStackChatMessage[];
  /** System prompts extracted from system/developer messages, context, and state */
  systemPrompts: string[];
}
/**
 * Converts a RunAgentInput into the format expected by TanStack AI's `chat()`.
 *
 * - Keeps only user/assistant/tool messages (activity, reasoning, and other roles are also excluded)
 * - Extracts system/developer messages into `systemPrompts`
 * - Appends context entries and application state to `systemPrompts`
 * - Preserves tool calls on assistant messages and toolCallId on tool messages
 */
declare function convertInputToTanStackAI(input: RunAgentInput): TanStackInputResult;
/**
 * Converts a TanStack AI stream into AG-UI `BaseEvent` objects.
 *
 * This is a pure converter — it does NOT emit lifecycle events
 * (RUN_STARTED / RUN_FINISHED / RUN_ERROR). The caller (Agent class)
 * is responsible for those.
 */
declare function convertTanStackStream(stream: AsyncIterable<unknown>, abortSignal: AbortSignal): AsyncGenerator<BaseEvent>;
//#endregion
export { TanStackChatMessage, TanStackInputResult, convertInputToTanStackAI, convertTanStackStream };
//# sourceMappingURL=tanstack.d.cts.map