/** Zoe Core — Message conversion helpers */ import type { Message, ToolCall } from "./types.js"; import { ZoeError } from "./errors.js"; import type { ProviderMessage, ProviderResponse, ProviderToolCall } from "../providers/types.js"; /** * Generate a unique identifier using crypto.randomUUID(). */ export declare function generateId(): string; /** * Get the current Unix timestamp in milliseconds. */ export declare function now(): number; /** * Rough token estimate: ~4 characters per token. */ export declare function estimateTokens(text: string): number; /** * Create a ZoeError from a plain Error or unknown value. * Uses the proper class hierarchy based on the error code. */ export declare function toZoeError(err: unknown, code: string): ZoeError; /** * Convert an SDK Message to ProviderMessage format. */ export declare function messageToProviderMessage(msg: Message): ProviderMessage; /** * Convert a ProviderToolCall to SDK ToolCall format. */ export declare function providerToolCallToToolCall(tc: ProviderToolCall): ToolCall; /** * Convert a ProviderResponse into an array of SDK Message objects. * * A single provider response may contain both text content and tool calls. * This function normalises it into one or more Message objects: * - An assistant message with text content (and optional toolCalls) * - If only tool calls with no text, an assistant message with empty content * * @param response - The raw ProviderResponse from the LLM provider. * @returns Array of Message objects representing the response. */ export declare function providerResponseToMessages(response: ProviderResponse): Message[];