export type AiEvent = { type: 'text_delta'; text: string; } | { type: 'tool_call'; id: string; name: string; args: Record; } | { type: 'done'; finishReason: string; usage?: { promptTokens: number; completionTokens: number; totalTokens: number; }; } | { type: 'error'; message: string; code?: string; }; export type ContentPart = { type: 'text'; text: string; } | { type: 'image'; source: string; } | { type: 'tool_result'; tool_use_id: string; content: string; }; export interface AiMessage { role: 'system' | 'user' | 'assistant' | 'tool'; content: string | ContentPart[]; name?: string; tool_call_id?: string; tool_calls?: Array<{ id: string; type: 'function'; function: { name: string; arguments: string; }; }>; } export interface AiTool { name: string; description: string; parameters: Record; } export type AiToolChoice = 'auto' | 'none' | 'required' | { name: string; }; export interface AiChatOptions { messages: AiMessage[]; tools?: AiTool[]; toolChoice?: AiToolChoice; model?: string; temperature?: number; maxTokens?: number; /** HTTP headers merged onto the POST — NOT included in the JSON body. */ headers?: Record; } export declare const ai: { /** * Stream typed AiEvent from a Tina4 backend endpoint that runs Ai.chat and * re-emits the event stream over SSE. Works against tina4-python / * tina4-php / tina4-ruby / tina4-nodejs services that expose an Ai.chat * route wired to Api.stream_sse (ADR-0060). */ stream(url: string, options: AiChatOptions): AsyncGenerator; }; //# sourceMappingURL=ai.d.ts.map