import { z } from 'zod'; import type { AgentRunEvent } from '../types.js'; /** * Provider-neutral multimodal content part schema used by AI outputs and * OpenAPI descriptions. * * @example * ```ts * const image = agentContentPartSchema.parse({ * kind: 'image_url', * url: 'https://example.com/image.png', * }) * ``` */ export declare const agentContentPartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"image">; mimeType: z.ZodString; dataBase64: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"image_url">; url: z.ZodString; mimeType: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"audio">; mimeType: z.ZodString; dataBase64: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"file">; mimeType: z.ZodString; dataBase64: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"file_url">; url: z.ZodString; mimeType: z.ZodOptional; filename: z.ZodOptional; }, z.core.$strip>], "kind">; /** * OpenAI Responses-style streaming event data for PURISTA agent streams. * * The event envelope uses normal SSE `event`/`data` framing. The JSON payload * keeps the provider-familiar `type` and `sequence_number` fields so clients * can consume it like modern OpenAI/Anthropic semantic streaming events. */ export declare const agentProviderEventDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.created">; response: z.ZodObject<{ id: z.ZodString; object: z.ZodLiteral<"response">; status: z.ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; in_progress: "in_progress"; incomplete: "incomplete"; queued: "queued"; }>; created_at: z.ZodNumber; output: z.ZodOptional; error: z.ZodOptional>; }, z.core.$strip>>>; metadata: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.in_progress">; response: z.ZodObject<{ id: z.ZodString; object: z.ZodLiteral<"response">; status: z.ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; in_progress: "in_progress"; incomplete: "incomplete"; queued: "queued"; }>; created_at: z.ZodNumber; output: z.ZodOptional; error: z.ZodOptional>; }, z.core.$strip>>>; metadata: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.output_text.delta">; output_index: z.ZodNumber; content_index: z.ZodNumber; delta: z.ZodString; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.output_json.delta">; output_index: z.ZodNumber; content_index: z.ZodNumber; delta: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.output_json.done">; output_index: z.ZodNumber; content_index: z.ZodNumber; object: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.tool_call.started">; item_id: z.ZodString; tool_name: z.ZodString; input: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.tool_call.completed">; item_id: z.ZodString; tool_name: z.ZodString; output: z.ZodOptional; error: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.model_embedding.completed">; count: z.ZodNumber; dimensions: z.ZodOptional; usage: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.model_rerank.completed">; count: z.ZodNumber; top_n: z.ZodOptional; usage: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.completed">; response: z.ZodObject<{ id: z.ZodString; object: z.ZodLiteral<"response">; status: z.ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; in_progress: "in_progress"; incomplete: "incomplete"; queued: "queued"; }>; created_at: z.ZodNumber; output: z.ZodOptional; error: z.ZodOptional>; }, z.core.$strip>>>; metadata: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"error">; error: z.ZodObject<{ code: z.ZodString; category: z.ZodString; retriable: z.ZodBoolean; message: z.ZodString; meta: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>], "type">; /** * SSE chunk schema emitted by AI stream endpoints. * * @example * ```json * { * "event": "response.output_text.delta", * "data": { * "type": "response.output_text.delta", * "sequence_number": 2, * "response_id": "run_123", * "run_id": "run_123", * "stream_id": "model_abc", * "delta": "hello" * } * } * ``` */ export declare const agentSseEventSchema: z.ZodObject<{ event: z.ZodString; data: z.ZodDiscriminatedUnion<[z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.created">; response: z.ZodObject<{ id: z.ZodString; object: z.ZodLiteral<"response">; status: z.ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; in_progress: "in_progress"; incomplete: "incomplete"; queued: "queued"; }>; created_at: z.ZodNumber; output: z.ZodOptional; error: z.ZodOptional>; }, z.core.$strip>>>; metadata: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.in_progress">; response: z.ZodObject<{ id: z.ZodString; object: z.ZodLiteral<"response">; status: z.ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; in_progress: "in_progress"; incomplete: "incomplete"; queued: "queued"; }>; created_at: z.ZodNumber; output: z.ZodOptional; error: z.ZodOptional>; }, z.core.$strip>>>; metadata: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.output_text.delta">; output_index: z.ZodNumber; content_index: z.ZodNumber; delta: z.ZodString; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.output_json.delta">; output_index: z.ZodNumber; content_index: z.ZodNumber; delta: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.output_json.done">; output_index: z.ZodNumber; content_index: z.ZodNumber; object: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.tool_call.started">; item_id: z.ZodString; tool_name: z.ZodString; input: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.tool_call.completed">; item_id: z.ZodString; tool_name: z.ZodString; output: z.ZodOptional; error: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.model_embedding.completed">; count: z.ZodNumber; dimensions: z.ZodOptional; usage: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.model_rerank.completed">; count: z.ZodNumber; top_n: z.ZodOptional; usage: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"response.completed">; response: z.ZodObject<{ id: z.ZodString; object: z.ZodLiteral<"response">; status: z.ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; in_progress: "in_progress"; incomplete: "incomplete"; queued: "queued"; }>; created_at: z.ZodNumber; output: z.ZodOptional; error: z.ZodOptional>; }, z.core.$strip>>>; metadata: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ sequence_number: z.ZodNumber; response_id: z.ZodString; run_id: z.ZodString; agent_id: z.ZodOptional; workflow_id: z.ZodOptional; model_alias: z.ZodOptional; stream_id: z.ZodOptional; type: z.ZodLiteral<"error">; error: z.ZodObject<{ code: z.ZodString; category: z.ZodString; retriable: z.ZodBoolean; message: z.ZodString; meta: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>], "type">; }, z.core.$strip>; export type AgentProviderEventData = z.infer; export type AgentSseEvent = z.infer; /** * Map one PURISTA agent run event to its provider-style SSE chunk. * * Returns `undefined` for run events that have no provider projection (for * example a future harness event type that this core version does not yet * model). Callers skip `undefined` chunks instead of failing the stream; the * raw run event still flows through the agent run-event bus. */ export declare function createProviderSseEvent(input: AgentRunEvent, sequenceNumber: number): AgentSseEvent | undefined; //# sourceMappingURL=sseEvents.d.ts.map