@ag-ui/core 0.1.1-canary.beta.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.mjs","names":[],"sources":["../src/schemas.ts","../src/event-factories.ts"],"sourcesContent":["// zod schemas for AG-UI types and events. This module is published at the\n// `@ag-ui/core/schemas` subpath. zod is an optional peer dependency — install\n// it explicitly if you import from this module. The schemas mirror the types\n// exported from the main `@ag-ui/core` entry.\n//\n// Cross-version note: this module imports `zod/v4`, NOT `zod`.\n//\n// zod 3.25.x shipped the whole zod 4 implementation at the `zod/v4` subpath, and\n// zod 4.x keeps `zod/v4` as an alias for its own classic entry. Both majors\n// therefore expose an identical `zod/v4` API, which is what lets a single set of\n// emitted .d.ts files type-check against either. Importing bare `zod` would bake\n// major-specific declaration shapes (`ZodEnum<[...]>`, five-parameter `ZodObject`,\n// `ZodEffects`) into the published types and break consumers on the other major.\n//\n// The supported peer range is `^3.25.18 || ^4.0.0`. zod 3.24.x has no `zod/v4`\n// subpath at all, and 3.25.0-3.25.17 ship `zod/v4` declarations that fail TS\n// variance checks under `skipLibCheck: false` (3.25.0 has no dist/ whatsoever),\n// so 3.25.18 is the lowest release we can honestly claim to support.\n//\n// Caveat: the zod/v4 *API surface* is stable across the range, but the *engine*\n// version is not — zod@3.25.x ships engine 4.0.0 while zod@4.4.x ships 4.4.x, and\n// their behavior differs in places. Most importantly, a bare `z.any()` object value\n// is accepted when missing on 4.0.0 but rejected as `nonoptional` on 4.4.x. Every\n// `z.any()` used as an object value below is therefore explicitly `.optional()` so\n// the protocol contract does not depend on which zod the consumer installed. See\n// __tests__/zod-version-conformance.test.ts.\n\nimport { z } from \"zod/v4\";\nimport { EventType } from \"./events\";\n\n// ---------------------------------------------------------------------------\n// EventType enum values as a z.enum tuple. z.nativeEnum() was removed in zod 4,\n// so the values are enumerated explicitly.\n// ---------------------------------------------------------------------------\n\nexport const EventTypeSchema = z.enum([\n \"TEXT_MESSAGE_START\",\n \"TEXT_MESSAGE_CONTENT\",\n \"TEXT_MESSAGE_END\",\n \"TEXT_MESSAGE_CHUNK\",\n \"TOOL_CALL_START\",\n \"TOOL_CALL_ARGS\",\n \"TOOL_CALL_END\",\n \"TOOL_CALL_CHUNK\",\n \"TOOL_CALL_RESULT\",\n \"THINKING_START\",\n \"THINKING_END\",\n \"THINKING_TEXT_MESSAGE_START\",\n \"THINKING_TEXT_MESSAGE_CONTENT\",\n \"THINKING_TEXT_MESSAGE_END\",\n \"STATE_SNAPSHOT\",\n \"STATE_DELTA\",\n \"MESSAGES_SNAPSHOT\",\n \"ACTIVITY_SNAPSHOT\",\n \"ACTIVITY_DELTA\",\n \"RAW\",\n \"CUSTOM\",\n \"RUN_STARTED\",\n \"RUN_FINISHED\",\n \"RUN_ERROR\",\n \"STEP_STARTED\",\n \"STEP_FINISHED\",\n \"REASONING_START\",\n \"REASONING_MESSAGE_START\",\n \"REASONING_MESSAGE_CONTENT\",\n \"REASONING_MESSAGE_END\",\n \"REASONING_MESSAGE_CHUNK\",\n \"REASONING_END\",\n \"REASONING_ENCRYPTED_VALUE\",\n] as const);\n\n// ---------------------------------------------------------------------------\n// Base types (from types.ts)\n// ---------------------------------------------------------------------------\n\nexport const FunctionCallSchema = z.object({\n name: z.string(),\n arguments: z.string(),\n});\n\nexport const ToolCallSchema = z.object({\n id: z.string(),\n type: z.literal(\"function\"),\n function: FunctionCallSchema,\n encryptedValue: z.string().optional(),\n});\n\nexport const TextInputContentSchema = z.object({\n type: z.literal(\"text\"),\n text: z.string(),\n});\n\nexport const InputContentDataSourceSchema = z.object({\n type: z.literal(\"data\"),\n value: z.string(),\n mimeType: z.string(),\n});\n\nexport const InputContentUrlSourceSchema = z.object({\n type: z.literal(\"url\"),\n value: z.string(),\n mimeType: z.string().optional(),\n});\n\nexport const InputContentSourceSchema = z.discriminatedUnion(\"type\", [\n InputContentDataSourceSchema,\n InputContentUrlSourceSchema,\n]);\n\nexport const ImageInputContentSchema = z.object({\n type: z.literal(\"image\"),\n source: InputContentSourceSchema,\n metadata: z.unknown().optional(),\n});\n\nexport const AudioInputContentSchema = z.object({\n type: z.literal(\"audio\"),\n source: InputContentSourceSchema,\n metadata: z.unknown().optional(),\n});\n\nexport const VideoInputContentSchema = z.object({\n type: z.literal(\"video\"),\n source: InputContentSourceSchema,\n metadata: z.unknown().optional(),\n});\n\nexport const DocumentInputContentSchema = z.object({\n type: z.literal(\"document\"),\n source: InputContentSourceSchema,\n metadata: z.unknown().optional(),\n});\n\nexport const ImageInputPartSchema = ImageInputContentSchema;\nexport const AudioInputPartSchema = AudioInputContentSchema;\nexport const VideoInputPartSchema = VideoInputContentSchema;\nexport const DocumentInputPartSchema = DocumentInputContentSchema;\n\nexport const BinaryInputContentSchema = z\n .object({\n type: z.literal(\"binary\"),\n mimeType: z.string(),\n id: z.string().optional(),\n url: z.string().optional(),\n data: z.string().optional(),\n filename: z.string().optional(),\n })\n .refine((value) => Boolean(value.id || value.url || value.data), {\n message: \"BinaryInputContent requires at least one of id, url, or data.\",\n });\n\nexport const InputContentSchema = z\n .discriminatedUnion(\"type\", [\n TextInputContentSchema,\n ImageInputContentSchema,\n AudioInputContentSchema,\n VideoInputContentSchema,\n DocumentInputContentSchema,\n z.object({\n type: z.literal(\"binary\"),\n mimeType: z.string(),\n id: z.string().optional(),\n url: z.string().optional(),\n data: z.string().optional(),\n filename: z.string().optional(),\n }),\n ])\n .refine(\n (value) => {\n if (value.type === \"binary\") {\n return Boolean(\n (value as { id?: string; url?: string; data?: string }).id ||\n (value as { id?: string; url?: string; data?: string }).url ||\n (value as { id?: string; url?: string; data?: string }).data,\n );\n }\n return true;\n },\n { message: \"BinaryInputContent requires at least one of id, url, or data.\" },\n );\n\nexport const InputContentPartSchema = InputContentSchema;\n\nconst BaseMessageSchema = z.object({\n id: z.string(),\n name: z.string().optional(),\n encryptedValue: z.string().optional(),\n});\n\nexport const DeveloperMessageSchema = BaseMessageSchema.extend({\n role: z.literal(\"developer\"),\n content: z.string(),\n});\n\nexport const SystemMessageSchema = BaseMessageSchema.extend({\n role: z.literal(\"system\"),\n content: z.string(),\n});\n\nexport const AssistantMessageSchema = BaseMessageSchema.extend({\n role: z.literal(\"assistant\"),\n content: z.string().optional(),\n toolCalls: z.array(ToolCallSchema).optional(),\n});\n\nexport const UserMessageSchema = BaseMessageSchema.extend({\n role: z.literal(\"user\"),\n content: z.union([z.string(), z.array(InputContentSchema)]),\n});\n\nexport const ToolMessageSchema = z.object({\n id: z.string(),\n content: z.string(),\n role: z.literal(\"tool\"),\n toolCallId: z.string(),\n error: z.string().optional(),\n encryptedValue: z.string().optional(),\n});\n\nexport const ActivityMessageSchema = z.object({\n id: z.string(),\n role: z.literal(\"activity\"),\n activityType: z.string(),\n content: z.record(z.string(), z.any()),\n});\n\nexport const ReasoningMessageSchema = z.object({\n id: z.string(),\n role: z.literal(\"reasoning\"),\n content: z.string(),\n encryptedValue: z.string().optional(),\n});\n\nexport const MessageSchema = z.discriminatedUnion(\"role\", [\n DeveloperMessageSchema,\n SystemMessageSchema,\n AssistantMessageSchema,\n UserMessageSchema,\n ToolMessageSchema,\n ActivityMessageSchema,\n ReasoningMessageSchema,\n]);\n\nexport const RoleSchema = z.union([\n z.literal(\"developer\"),\n z.literal(\"system\"),\n z.literal(\"assistant\"),\n z.literal(\"user\"),\n z.literal(\"tool\"),\n z.literal(\"activity\"),\n z.literal(\"reasoning\"),\n]);\n\nexport const ContextSchema = z.object({\n description: z.string(),\n value: z.string(),\n});\n\nexport const ToolSchema = z.object({\n name: z.string(),\n description: z.string(),\n // `.optional()` is load-bearing across the zod range — see the engine caveat above.\n parameters: z.any().optional(),\n metadata: z.record(z.string(), z.any()).optional(),\n});\n\nexport const InterruptSchema = z.object({\n id: z.string(),\n reason: z.string(),\n message: z.string().optional(),\n toolCallId: z.string().optional(),\n responseSchema: z.record(z.string(), z.any()).optional(),\n expiresAt: z.string().optional(),\n metadata: z.record(z.string(), z.any()).optional(),\n});\n\nexport const ResumeEntrySchema = z.object({\n interruptId: z.string(),\n status: z.enum([\"resolved\", \"cancelled\"]),\n payload: z.any().optional(),\n});\n\nexport const RunAgentInputSchema = z.object({\n threadId: z.string(),\n runId: z.string(),\n parentRunId: z.string().optional(),\n state: z.any().optional(),\n messages: z.array(MessageSchema),\n tools: z.array(ToolSchema),\n context: z.array(ContextSchema),\n forwardedProps: z.any().optional(),\n resume: z.array(ResumeEntrySchema).optional(),\n});\n\n// `State` is unconstrained, so this carries no validation. It stays `z.any()` (not\n// `.optional()`) because it is also used standalone; object-value uses below add\n// `.optional()` at the use site.\nexport const StateSchema = z.any();\n\n// ---------------------------------------------------------------------------\n// Event schemas (from events.ts)\n// ---------------------------------------------------------------------------\n\nconst TextMessageRoleSchema = z.union([\n z.literal(\"developer\"),\n z.literal(\"system\"),\n z.literal(\"assistant\"),\n z.literal(\"user\"),\n]);\n\nexport const BaseEventSchema = z\n .object({\n type: EventTypeSchema,\n timestamp: z.number().optional(),\n rawEvent: z.any().optional(),\n })\n .passthrough();\n\nexport const TextMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_START),\n messageId: z.string(),\n role: TextMessageRoleSchema.default(\"assistant\"),\n name: z.string().optional(),\n});\n\nexport const TextMessageContentEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_CONTENT),\n messageId: z.string(),\n delta: z.string(),\n});\n\nexport const TextMessageEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_END),\n messageId: z.string(),\n});\n\nexport const TextMessageChunkEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_CHUNK),\n messageId: z.string().optional(),\n role: TextMessageRoleSchema.optional(),\n delta: z.string().optional(),\n name: z.string().optional(),\n});\n\n/**\n * @deprecated Use ReasoningTextMessageStartEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingTextMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_START),\n});\n\n/**\n * @deprecated Use ReasoningMessageContentEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingTextMessageContentEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_CONTENT),\n delta: z.string(),\n});\n\n/**\n * @deprecated Use ReasoningMessageEndEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingTextMessageEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_END),\n});\n\nexport const ToolCallStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_START),\n toolCallId: z.string(),\n toolCallName: z.string(),\n // Accept `null` and treat it as omitted, so producers that serialize optional\n // fields as JSON `null` (e.g. the .NET Microsoft Agent Framework adapter, whose\n // System.Text.Json emits `\"parentMessageId\": null`) still validate instead of\n // aborting the run on the first tool call.\n parentMessageId: z\n .string()\n .nullable()\n .optional()\n .transform((v) => v ?? undefined),\n});\n\nexport const ToolCallArgsEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_ARGS),\n toolCallId: z.string(),\n delta: z.string(),\n});\n\nexport const ToolCallEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_END),\n toolCallId: z.string(),\n});\n\nexport const ToolCallResultEventSchema = BaseEventSchema.extend({\n messageId: z.string(),\n type: z.literal(EventType.TOOL_CALL_RESULT),\n toolCallId: z.string(),\n content: z.string(),\n role: z.literal(\"tool\").optional(),\n});\n\nexport const ToolCallChunkEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_CHUNK),\n toolCallId: z.string().optional(),\n toolCallName: z.string().optional(),\n // Accept `null` as omitted — same cross-language quirk as TOOL_CALL_START.\n parentMessageId: z\n .string()\n .nullable()\n .optional()\n .transform((v) => v ?? undefined),\n delta: z.string().optional(),\n});\n\n/**\n * @deprecated Use ReasoningStartEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_START),\n title: z.string().optional(),\n});\n\n/**\n * @deprecated Use ReasoningEndEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_END),\n});\n\nexport const StateSnapshotEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STATE_SNAPSHOT),\n snapshot: StateSchema.optional(),\n});\n\nexport const StateDeltaEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STATE_DELTA),\n delta: z.array(z.any()),\n});\n\nexport const MessagesSnapshotEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.MESSAGES_SNAPSHOT),\n messages: z.array(MessageSchema),\n});\n\nexport const ActivitySnapshotEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.ACTIVITY_SNAPSHOT),\n messageId: z.string(),\n activityType: z.string(),\n content: z.record(z.string(), z.any()),\n replace: z.boolean().optional().default(true),\n});\n\nexport const ActivityDeltaEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.ACTIVITY_DELTA),\n messageId: z.string(),\n activityType: z.string(),\n patch: z.array(z.any()),\n});\n\nexport const RawEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RAW),\n event: z.any().optional(),\n source: z.string().optional(),\n});\n\nexport const CustomEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.CUSTOM),\n name: z.string(),\n value: z.any().optional(),\n});\n\nexport const RunStartedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RUN_STARTED),\n threadId: z.string(),\n runId: z.string(),\n parentRunId: z.string().optional(),\n input: RunAgentInputSchema.optional(),\n});\n\nexport const RunFinishedSuccessOutcomeSchema = z\n .object({\n type: z.literal(\"success\"),\n })\n .strict();\n\nexport const RunFinishedInterruptOutcomeSchema = z\n .object({\n type: z.literal(\"interrupt\"),\n interrupts: z.array(InterruptSchema).min(1),\n })\n .strict();\n\nexport const RunFinishedOutcomeSchema = z.discriminatedUnion(\"type\", [\n RunFinishedSuccessOutcomeSchema,\n RunFinishedInterruptOutcomeSchema,\n]);\n\nexport const RunFinishedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RUN_FINISHED),\n threadId: z.string(),\n runId: z.string(),\n result: z.any().optional(),\n // Accept `null` and treat it as omitted, so producers that emit `\"outcome\": null`\n // for the legacy no-outcome case still validate.\n outcome: RunFinishedOutcomeSchema.nullable()\n .optional()\n .transform((v) => v ?? undefined),\n});\n\nexport const RunErrorEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RUN_ERROR),\n message: z.string(),\n code: z.string().optional(),\n});\n\nexport const StepStartedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STEP_STARTED),\n stepName: z.string(),\n});\n\nexport const StepFinishedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STEP_FINISHED),\n stepName: z.string(),\n});\n\nexport const ReasoningEncryptedValueSubtypeSchema = z.union([\n z.literal(\"tool-call\"),\n z.literal(\"message\"),\n]);\n\nexport const ReasoningStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_START),\n messageId: z.string(),\n});\n\nexport const ReasoningMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_MESSAGE_START),\n messageId: z.string(),\n role: z.literal(\"reasoning\"),\n});\n\nexport const ReasoningMessageContentEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_MESSAGE_CONTENT),\n messageId: z.string(),\n delta: z.string(),\n});\n\nexport const ReasoningMessageEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_MESSAGE_END),\n messageId: z.string(),\n});\n\nexport const ReasoningMessageChunkEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_MESSAGE_CHUNK),\n messageId: z.string().optional(),\n delta: z.string().optional(),\n});\n\nexport const ReasoningEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_END),\n messageId: z.string(),\n});\n\nexport const ReasoningEncryptedValueEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_ENCRYPTED_VALUE),\n subtype: ReasoningEncryptedValueSubtypeSchema,\n entityId: z.string(),\n encryptedValue: z.string(),\n});\n\n/**\n * Discriminated union of all AG-UI event schemas. Suitable for validating\n * untrusted event payloads from the wire.\n */\nexport const EventSchemas = z.discriminatedUnion(\"type\", [\n TextMessageStartEventSchema,\n TextMessageContentEventSchema,\n TextMessageEndEventSchema,\n TextMessageChunkEventSchema,\n ThinkingStartEventSchema,\n ThinkingEndEventSchema,\n ThinkingTextMessageStartEventSchema,\n ThinkingTextMessageContentEventSchema,\n ThinkingTextMessageEndEventSchema,\n ToolCallStartEventSchema,\n ToolCallArgsEventSchema,\n ToolCallEndEventSchema,\n ToolCallChunkEventSchema,\n ToolCallResultEventSchema,\n StateSnapshotEventSchema,\n StateDeltaEventSchema,\n MessagesSnapshotEventSchema,\n ActivitySnapshotEventSchema,\n ActivityDeltaEventSchema,\n RawEventSchema,\n CustomEventSchema,\n RunStartedEventSchema,\n RunFinishedEventSchema,\n RunErrorEventSchema,\n StepStartedEventSchema,\n StepFinishedEventSchema,\n ReasoningStartEventSchema,\n ReasoningMessageStartEventSchema,\n ReasoningMessageContentEventSchema,\n ReasoningMessageEndEventSchema,\n ReasoningMessageChunkEventSchema,\n ReasoningEndEventSchema,\n ReasoningEncryptedValueEventSchema,\n]);\n\n// ---------------------------------------------------------------------------\n// Capability schemas (from capabilities.ts)\n// ---------------------------------------------------------------------------\n\n/** Describes a sub-agent that can be invoked by a parent agent. */\nexport const SubAgentInfoSchema = z.object({\n /** Unique name or identifier of the sub-agent. */\n name: z.string(),\n /** What this sub-agent specializes in. Helps clients build agent selection UIs. */\n description: z.string().optional(),\n});\n\n/**\n * Basic metadata about the agent. Useful for discovery UIs, agent marketplaces,\n * and debugging.\n */\nexport const IdentityCapabilitiesSchema = z.object({\n name: z.string().optional(),\n type: z.string().optional(),\n description: z.string().optional(),\n version: z.string().optional(),\n provider: z.string().optional(),\n documentationUrl: z.string().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n});\n\n/**\n * Declares which transport mechanisms the agent supports.\n */\nexport const TransportCapabilitiesSchema = z.object({\n streaming: z.boolean().optional(),\n websocket: z.boolean().optional(),\n httpBinary: z.boolean().optional(),\n pushNotifications: z.boolean().optional(),\n resumable: z.boolean().optional(),\n});\n\n/**\n * Tool calling capabilities.\n */\nexport const ToolsCapabilitiesSchema = z.object({\n supported: z.boolean().optional(),\n items: z.array(ToolSchema).optional(),\n parallelCalls: z.boolean().optional(),\n clientProvided: z.boolean().optional(),\n});\n\n/**\n * Output format support.\n */\nexport const OutputCapabilitiesSchema = z.object({\n structuredOutput: z.boolean().optional(),\n supportedMimeTypes: z.array(z.string()).optional(),\n});\n\n/**\n * State and memory management capabilities.\n */\nexport const StateCapabilitiesSchema = z.object({\n snapshots: z.boolean().optional(),\n deltas: z.boolean().optional(),\n memory: z.boolean().optional(),\n persistentState: z.boolean().optional(),\n});\n\n/**\n * Multi-agent coordination capabilities.\n */\nexport const MultiAgentCapabilitiesSchema = z.object({\n supported: z.boolean().optional(),\n delegation: z.boolean().optional(),\n handoffs: z.boolean().optional(),\n subAgents: z.array(SubAgentInfoSchema).optional(),\n});\n\n/**\n * Reasoning and thinking capabilities.\n */\nexport const ReasoningCapabilitiesSchema = z.object({\n supported: z.boolean().optional(),\n streaming: z.boolean().optional(),\n encrypted: z.boolean().optional(),\n});\n\n/**\n * Modalities the agent can accept as input.\n */\nexport const MultimodalInputCapabilitiesSchema = z.object({\n image: z.boolean().optional(),\n audio: z.boolean().optional(),\n video: z.boolean().optional(),\n pdf: z.boolean().optional(),\n file: z.boolean().optional(),\n});\n\n/**\n * Modalities the agent can produce as output.\n */\nexport const MultimodalOutputCapabilitiesSchema = z.object({\n image: z.boolean().optional(),\n audio: z.boolean().optional(),\n});\n\n/**\n * Multimodal input and output support.\n */\nexport const MultimodalCapabilitiesSchema = z.object({\n input: MultimodalInputCapabilitiesSchema.optional(),\n output: MultimodalOutputCapabilitiesSchema.optional(),\n});\n\n/**\n * Execution control and limits.\n */\nexport const ExecutionCapabilitiesSchema = z.object({\n codeExecution: z.boolean().optional(),\n sandboxed: z.boolean().optional(),\n maxIterations: z.number().optional(),\n maxExecutionTime: z.number().optional(),\n});\n\n/**\n * Human-in-the-loop interaction support.\n */\nexport const HumanInTheLoopCapabilitiesSchema = z.object({\n supported: z.boolean().optional(),\n approvals: z.boolean().optional(),\n interventions: z.boolean().optional(),\n feedback: z.boolean().optional(),\n interrupts: z.boolean().optional(),\n approveWithEdits: z.boolean().optional(),\n});\n\n/**\n * A typed, categorized snapshot of an agent's current capabilities.\n * Returned by `getCapabilities()` on `AbstractAgent`.\n */\nexport const AgentCapabilitiesSchema = z.object({\n identity: IdentityCapabilitiesSchema.optional(),\n transport: TransportCapabilitiesSchema.optional(),\n tools: ToolsCapabilitiesSchema.optional(),\n output: OutputCapabilitiesSchema.optional(),\n state: StateCapabilitiesSchema.optional(),\n multiAgent: MultiAgentCapabilitiesSchema.optional(),\n reasoning: ReasoningCapabilitiesSchema.optional(),\n multimodal: MultimodalCapabilitiesSchema.optional(),\n execution: ExecutionCapabilitiesSchema.optional(),\n humanInTheLoop: HumanInTheLoopCapabilitiesSchema.optional(),\n custom: z.record(z.string(), z.unknown()).optional(),\n});\n","// Validating event factories. This module is part of the `@ag-ui/core/schemas`\n// subpath, NOT the main `@ag-ui/core` entry — it needs zod to run each event\n// through its schema, and the main entry is deliberately dependency-free.\n//\n// Every factory validates its input via `schema.parse(...)`, so invalid payloads\n// fail at construction time in the producer rather than surfacing later as a\n// stream error in the consumer. Parsing also applies the schemas' `.default(...)`\n// values (`role` -> \"assistant\", `replace` -> true) and `.transform(...)`\n// normalizations (`parentMessageId` / `outcome` `null` -> omitted).\n\nimport { z } from \"zod/v4\";\nimport { EventType } from \"./events\";\nimport type {\n ActivityDeltaEvent,\n ActivityDeltaEventProps,\n ActivitySnapshotEvent,\n ActivitySnapshotEventProps,\n CustomEvent,\n CustomEventProps,\n MessagesSnapshotEvent,\n MessagesSnapshotEventProps,\n RawEvent,\n RawEventProps,\n ReasoningEncryptedValueEvent,\n ReasoningEncryptedValueEventProps,\n ReasoningEndEvent,\n ReasoningEndEventProps,\n ReasoningMessageChunkEvent,\n ReasoningMessageChunkEventProps,\n ReasoningMessageContentEvent,\n ReasoningMessageContentEventProps,\n ReasoningMessageEndEvent,\n ReasoningMessageEndEventProps,\n ReasoningMessageStartEvent,\n ReasoningMessageStartEventProps,\n ReasoningStartEvent,\n ReasoningStartEventProps,\n RunErrorEvent,\n RunErrorEventProps,\n RunFinishedEvent,\n RunFinishedEventProps,\n RunStartedEvent,\n RunStartedEventProps,\n StateDeltaEvent,\n StateDeltaEventProps,\n StateSnapshotEvent,\n StateSnapshotEventProps,\n StepFinishedEvent,\n StepFinishedEventProps,\n StepStartedEvent,\n StepStartedEventProps,\n TextMessageChunkEvent,\n TextMessageChunkEventProps,\n TextMessageContentEvent,\n TextMessageContentEventProps,\n TextMessageEndEvent,\n TextMessageEndEventProps,\n TextMessageStartEvent,\n TextMessageStartEventProps,\n ThinkingEndEvent,\n ThinkingEndEventProps,\n ThinkingStartEvent,\n ThinkingStartEventProps,\n ThinkingTextMessageContentEvent,\n ThinkingTextMessageContentEventProps,\n ThinkingTextMessageEndEvent,\n ThinkingTextMessageEndEventProps,\n ThinkingTextMessageStartEvent,\n ThinkingTextMessageStartEventProps,\n ToolCallArgsEvent,\n ToolCallArgsEventProps,\n ToolCallChunkEvent,\n ToolCallChunkEventProps,\n ToolCallEndEvent,\n ToolCallEndEventProps,\n ToolCallResultEvent,\n ToolCallResultEventProps,\n ToolCallStartEvent,\n ToolCallStartEventProps,\n} from \"./events\";\nimport type { Interrupt } from \"./types\";\nimport {\n ActivityDeltaEventSchema,\n ActivitySnapshotEventSchema,\n CustomEventSchema,\n MessagesSnapshotEventSchema,\n RawEventSchema,\n ReasoningEncryptedValueEventSchema,\n ReasoningEndEventSchema,\n ReasoningMessageChunkEventSchema,\n ReasoningMessageContentEventSchema,\n ReasoningMessageEndEventSchema,\n ReasoningMessageStartEventSchema,\n ReasoningStartEventSchema,\n RunErrorEventSchema,\n RunFinishedEventSchema,\n RunStartedEventSchema,\n StateDeltaEventSchema,\n StateSnapshotEventSchema,\n StepFinishedEventSchema,\n StepStartedEventSchema,\n TextMessageChunkEventSchema,\n TextMessageContentEventSchema,\n TextMessageEndEventSchema,\n TextMessageStartEventSchema,\n ThinkingEndEventSchema,\n ThinkingStartEventSchema,\n ThinkingTextMessageContentEventSchema,\n ThinkingTextMessageEndEventSchema,\n ThinkingTextMessageStartEventSchema,\n ToolCallArgsEventSchema,\n ToolCallChunkEventSchema,\n ToolCallEndEventSchema,\n ToolCallResultEventSchema,\n ToolCallStartEventSchema,\n} from \"./schemas\";\n\n// `type` is assigned AFTER spreading props, so a caller cannot override the\n// discriminant. `BaseEvent`'s `[k: string]: unknown` index signature means\n// `Omit<Event, \"type\">` alone does not reject a `type` key — the `EventProps<E>`\n// helper in events.ts adds `type?: never` to catch it at compile time, and this\n// ordering makes it safe at runtime too.\nconst buildEvent = <Schema extends z.ZodTypeAny>(\n eventType: EventType,\n schema: Schema,\n props: Omit<z.input<Schema>, \"type\">,\n): z.infer<Schema> =>\n schema.parse({\n ...props,\n type: eventType,\n });\n\n/** Creates a TEXT_MESSAGE_START event. `role` defaults to `\"assistant\"` when omitted. */\nexport const createTextMessageStartEvent = (\n props: TextMessageStartEventProps,\n): TextMessageStartEvent =>\n buildEvent(EventType.TEXT_MESSAGE_START, TextMessageStartEventSchema, props);\n\n/** Creates a TEXT_MESSAGE_CONTENT event. */\nexport const createTextMessageContentEvent = (\n props: TextMessageContentEventProps,\n): TextMessageContentEvent =>\n buildEvent(EventType.TEXT_MESSAGE_CONTENT, TextMessageContentEventSchema, props);\n\n/** Creates a TEXT_MESSAGE_END event. */\nexport const createTextMessageEndEvent = (props: TextMessageEndEventProps): TextMessageEndEvent =>\n buildEvent(EventType.TEXT_MESSAGE_END, TextMessageEndEventSchema, props);\n\n/** Creates a TEXT_MESSAGE_CHUNK event. */\nexport const createTextMessageChunkEvent = (\n props: TextMessageChunkEventProps,\n): TextMessageChunkEvent =>\n buildEvent(EventType.TEXT_MESSAGE_CHUNK, TextMessageChunkEventSchema, props);\n\n/** @deprecated Use `createReasoningMessageStartEvent` instead. Will be removed in 1.0.0. */\nexport const createThinkingTextMessageStartEvent = (\n props: ThinkingTextMessageStartEventProps,\n): ThinkingTextMessageStartEvent =>\n buildEvent(EventType.THINKING_TEXT_MESSAGE_START, ThinkingTextMessageStartEventSchema, props);\n\n/** @deprecated Use `createReasoningMessageContentEvent` instead. Will be removed in 1.0.0. */\nexport const createThinkingTextMessageContentEvent = (\n props: ThinkingTextMessageContentEventProps,\n): ThinkingTextMessageContentEvent =>\n buildEvent(EventType.THINKING_TEXT_MESSAGE_CONTENT, ThinkingTextMessageContentEventSchema, props);\n\n/** @deprecated Use `createReasoningMessageEndEvent` instead. Will be removed in 1.0.0. */\nexport const createThinkingTextMessageEndEvent = (\n props: ThinkingTextMessageEndEventProps,\n): ThinkingTextMessageEndEvent =>\n buildEvent(EventType.THINKING_TEXT_MESSAGE_END, ThinkingTextMessageEndEventSchema, props);\n\n/** Creates a TOOL_CALL_START event. */\nexport const createToolCallStartEvent = (props: ToolCallStartEventProps): ToolCallStartEvent =>\n buildEvent(EventType.TOOL_CALL_START, ToolCallStartEventSchema, props);\n\n/** Creates a TOOL_CALL_ARGS event. */\nexport const createToolCallArgsEvent = (props: ToolCallArgsEventProps): ToolCallArgsEvent =>\n buildEvent(EventType.TOOL_CALL_ARGS, ToolCallArgsEventSchema, props);\n\n/** Creates a TOOL_CALL_END event. */\nexport const createToolCallEndEvent = (props: ToolCallEndEventProps): ToolCallEndEvent =>\n buildEvent(EventType.TOOL_CALL_END, ToolCallEndEventSchema, props);\n\n/** Creates a TOOL_CALL_CHUNK event. */\nexport const createToolCallChunkEvent = (props: ToolCallChunkEventProps): ToolCallChunkEvent =>\n buildEvent(EventType.TOOL_CALL_CHUNK, ToolCallChunkEventSchema, props);\n\n/** Creates a TOOL_CALL_RESULT event. */\nexport const createToolCallResultEvent = (props: ToolCallResultEventProps): ToolCallResultEvent =>\n buildEvent(EventType.TOOL_CALL_RESULT, ToolCallResultEventSchema, props);\n\n/** @deprecated Use `createReasoningStartEvent` instead. Will be removed in 1.0.0. */\nexport const createThinkingStartEvent = (props: ThinkingStartEventProps): ThinkingStartEvent =>\n buildEvent(EventType.THINKING_START, ThinkingStartEventSchema, props);\n\n/** @deprecated Use `createReasoningEndEvent` instead. Will be removed in 1.0.0. */\nexport const createThinkingEndEvent = (props: ThinkingEndEventProps): ThinkingEndEvent =>\n buildEvent(EventType.THINKING_END, ThinkingEndEventSchema, props);\n\n/** Creates a STATE_SNAPSHOT event. */\nexport const createStateSnapshotEvent = (props: StateSnapshotEventProps): StateSnapshotEvent =>\n buildEvent(EventType.STATE_SNAPSHOT, StateSnapshotEventSchema, props);\n\n/** Creates a STATE_DELTA event. */\nexport const createStateDeltaEvent = (props: StateDeltaEventProps): StateDeltaEvent =>\n buildEvent(EventType.STATE_DELTA, StateDeltaEventSchema, props);\n\n/** Creates a MESSAGES_SNAPSHOT event. */\nexport const createMessagesSnapshotEvent = (\n props: MessagesSnapshotEventProps,\n): MessagesSnapshotEvent =>\n buildEvent(EventType.MESSAGES_SNAPSHOT, MessagesSnapshotEventSchema, props);\n\n/** Creates an ACTIVITY_SNAPSHOT event. `replace` defaults to `true` when omitted. */\nexport const createActivitySnapshotEvent = (\n props: ActivitySnapshotEventProps,\n): ActivitySnapshotEvent =>\n buildEvent(EventType.ACTIVITY_SNAPSHOT, ActivitySnapshotEventSchema, props);\n\n/** Creates an ACTIVITY_DELTA event. */\nexport const createActivityDeltaEvent = (props: ActivityDeltaEventProps): ActivityDeltaEvent =>\n buildEvent(EventType.ACTIVITY_DELTA, ActivityDeltaEventSchema, props);\n\n/** Creates a RAW event. */\nexport const createRawEvent = (props: RawEventProps): RawEvent =>\n buildEvent(EventType.RAW, RawEventSchema, props);\n\n/** Creates a CUSTOM event. */\nexport const createCustomEvent = (props: CustomEventProps): CustomEvent =>\n buildEvent(EventType.CUSTOM, CustomEventSchema, props);\n\n/** Creates a RUN_STARTED event. */\nexport const createRunStartedEvent = (props: RunStartedEventProps): RunStartedEvent =>\n buildEvent(EventType.RUN_STARTED, RunStartedEventSchema, props);\n\n/**\n * Creates a RUN_FINISHED event.\n *\n * `outcome` is optional. Omit it for legacy/back-compat behavior, or set it\n * explicitly to `{ type: \"success\" }` or `{ type: \"interrupt\", interrupts }` —\n * see `createRunFinishedSuccessEvent` and `createRunFinishedInterruptEvent` for\n * convenience helpers. `outcome: null` is normalized to `outcome` being omitted.\n */\nexport const createRunFinishedEvent = (props: RunFinishedEventProps): RunFinishedEvent =>\n buildEvent(EventType.RUN_FINISHED, RunFinishedEventSchema, props);\n\n/** Creates a RUN_FINISHED event with `outcome: { type: \"success\" }`. */\nexport const createRunFinishedSuccessEvent = (\n props: Omit<RunFinishedEventProps, \"outcome\">,\n): RunFinishedEvent =>\n buildEvent(EventType.RUN_FINISHED, RunFinishedEventSchema, {\n ...props,\n outcome: { type: \"success\" },\n });\n\n/**\n * Creates a RUN_FINISHED event with `outcome: { type: \"interrupt\", interrupts }`.\n * Throws if `interrupts` is empty (the schema requires at least one entry).\n */\nexport const createRunFinishedInterruptEvent = (\n props: Omit<RunFinishedEventProps, \"outcome\"> & { interrupts: Interrupt[] },\n): RunFinishedEvent => {\n const { interrupts, ...rest } = props;\n return buildEvent(EventType.RUN_FINISHED, RunFinishedEventSchema, {\n ...rest,\n outcome: { type: \"interrupt\", interrupts },\n });\n};\n\n/** Creates a RUN_ERROR event. */\nexport const createRunErrorEvent = (props: RunErrorEventProps): RunErrorEvent =>\n buildEvent(EventType.RUN_ERROR, RunErrorEventSchema, props);\n\n/** Creates a STEP_STARTED event. */\nexport const createStepStartedEvent = (props: StepStartedEventProps): StepStartedEvent =>\n buildEvent(EventType.STEP_STARTED, StepStartedEventSchema, props);\n\n/** Creates a STEP_FINISHED event. */\nexport const createStepFinishedEvent = (props: StepFinishedEventProps): StepFinishedEvent =>\n buildEvent(EventType.STEP_FINISHED, StepFinishedEventSchema, props);\n\n/** Creates a REASONING_START event. */\nexport const createReasoningStartEvent = (props: ReasoningStartEventProps): ReasoningStartEvent =>\n buildEvent(EventType.REASONING_START, ReasoningStartEventSchema, props);\n\n/** Creates a REASONING_MESSAGE_START event. */\nexport const createReasoningMessageStartEvent = (\n props: ReasoningMessageStartEventProps,\n): ReasoningMessageStartEvent =>\n buildEvent(EventType.REASONING_MESSAGE_START, ReasoningMessageStartEventSchema, props);\n\n/** Creates a REASONING_MESSAGE_CONTENT event. */\nexport const createReasoningMessageContentEvent = (\n props: ReasoningMessageContentEventProps,\n): ReasoningMessageContentEvent =>\n buildEvent(EventType.REASONING_MESSAGE_CONTENT, ReasoningMessageContentEventSchema, props);\n\n/** Creates a REASONING_MESSAGE_END event. */\nexport const createReasoningMessageEndEvent = (\n props: ReasoningMessageEndEventProps,\n): ReasoningMessageEndEvent =>\n buildEvent(EventType.REASONING_MESSAGE_END, ReasoningMessageEndEventSchema, props);\n\n/** Creates a REASONING_MESSAGE_CHUNK event. */\nexport const createReasoningMessageChunkEvent = (\n props: ReasoningMessageChunkEventProps,\n): ReasoningMessageChunkEvent =>\n buildEvent(EventType.REASONING_MESSAGE_CHUNK, ReasoningMessageChunkEventSchema, props);\n\n/** Creates a REASONING_END event. */\nexport const createReasoningEndEvent = (props: ReasoningEndEventProps): ReasoningEndEvent =>\n buildEvent(EventType.REASONING_END, ReasoningEndEventSchema, props);\n\n/** Creates a REASONING_ENCRYPTED_VALUE event. */\nexport const createReasoningEncryptedValueEvent = (\n props: ReasoningEncryptedValueEventProps,\n): ReasoningEncryptedValueEvent =>\n buildEvent(EventType.REASONING_ENCRYPTED_VALUE, ReasoningEncryptedValueEventSchema, props);\n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A2B,oCAAoC,MAAM;;AAG5F,MAAa,kCACX,UAEA,WAAW,UAAU,uBAAuB,gCAAgC,MAAM;;AAGpF,MAAa,oCACX,UAEA,WAAW,UAAU,yBAAyB,kCAAkC,MAAM;;AAGxF,MAAa,2BAA2B,UACtC,WAAW,UAAU,eAAe,yBAAyB,MAAM;;AAGrE,MAAa,sCACX,UAEA,WAAW,UAAU,2BAA2B,oCAAoC,MAAM"}
1
+ {"version":3,"file":"schemas.mjs","names":[],"sources":["../src/generated/schemas.ts","../src/schemas.ts"],"sourcesContent":["// @generated by spec/generator — DO NOT EDIT.\n// Source: https://ag-ui.com/spec/1.0/schema.json\n// Regenerate: pnpm --filter @ag-ui/spec generate\n/* eslint-disable */\n\nimport { z } from \"zod/v4\";\nimport { EventType } from \"./types\";\n\n/**\n * The discriminator carried by every event.\n */\nexport const EventTypeSchema = z.enum(EventType);\n\n/**\n * Extra information attached to an event, a message, a tool call, a tool, an\n * interrupt or a resume entry. Open by key: any JSON value is allowed under a\n * key, including null, because a null there is meaningful data. The object\n * itself may be absent but is never null when present. The key ag-ui is\n * reserved for the protocol's own use; reservation is by convention, since\n * validating the shape of a key's value would contradict being open by key.\n */\nexport const MetadataSchema = z.custom<Record<string, any>>(\n (value) => typeof value === \"object\" && value !== null && !Array.isArray(value),\n);\n\n/**\n * An opaque handle for one subagent invocation, not a reusable name for a\n * subagent definition: two invocations of the same subagent carry two\n * different values. Named to mirror runId one level down, the way the\n * subagent's name mirrors agentId.\n */\nexport const SubagentRunIdSchema = z.string();\n\n/**\n * The roles a streamed text message may take. Excludes tool, which is carried\n * by TOOL_CALL_RESULT rather than streamed as text.\n */\nexport const TextMessageRoleSchema = z.enum([\"developer\", \"system\", \"assistant\", \"user\"]);\n\n/**\n * Opens a streamed text message. The content arrives as TEXT_MESSAGE_CONTENT\n * events and the message closes with TEXT_MESSAGE_END.\n */\nexport const TextMessageStartEventSchema = z.looseObject({\n type: z.literal(EventType.TEXT_MESSAGE_START),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string(),\n role: TextMessageRoleSchema.optional(),\n name: z.string().optional(),\n});\n\n/**\n * Appends a fragment to a streamed text message.\n */\nexport const TextMessageContentEventSchema = z.looseObject({\n type: z.literal(EventType.TEXT_MESSAGE_CONTENT),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string(),\n delta: z.string(),\n});\n\n/**\n * Closes a streamed text message.\n */\nexport const TextMessageEndEventSchema = z.looseObject({\n type: z.literal(EventType.TEXT_MESSAGE_END),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string(),\n});\n\n/**\n * A shorthand that stands in for a start, content and end sequence, for\n * producers that cannot know in advance where a message begins. Every field is\n * optional because a continuation chunk omits what has not changed; which\n * message a field-less chunk continues is a sequence question the prose\n * specification answers.\n */\nexport const TextMessageChunkEventSchema = z.looseObject({\n type: z.literal(EventType.TEXT_MESSAGE_CHUNK),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string().optional(),\n role: TextMessageRoleSchema.optional(),\n delta: z.string().optional(),\n name: z.string().optional(),\n});\n\n/**\n * Opens a tool call. The arguments arrive as TOOL_CALL_ARGS events and the\n * call closes with TOOL_CALL_END.\n */\nexport const ToolCallStartEventSchema = z.looseObject({\n type: z.literal(EventType.TOOL_CALL_START),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n toolCallId: z.string(),\n toolCallName: z.string(),\n parentMessageId: z.string().optional(),\n});\n\n/**\n * Appends a fragment of a tool call's arguments.\n */\nexport const ToolCallArgsEventSchema = z.looseObject({\n type: z.literal(EventType.TOOL_CALL_ARGS),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n toolCallId: z.string(),\n delta: z.string(),\n});\n\n/**\n * Closes a tool call, meaning its arguments are complete.\n */\nexport const ToolCallEndEventSchema = z.looseObject({\n type: z.literal(EventType.TOOL_CALL_END),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n toolCallId: z.string(),\n});\n\n/**\n * A shorthand that stands in for a tool call's start, args and end sequence.\n * Every field is optional for the same reason as TEXT_MESSAGE_CHUNK.\n */\nexport const ToolCallChunkEventSchema = z.looseObject({\n type: z.literal(EventType.TOOL_CALL_CHUNK),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n toolCallId: z.string().optional(),\n toolCallName: z.string().optional(),\n parentMessageId: z.string().optional(),\n delta: z.string().optional(),\n});\n\n/**\n * A text part.\n */\nexport const TextPartSchema = z.looseObject({\n type: z.literal(\"text\"),\n id: z.string().optional(),\n text: z.string(),\n metadata: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n});\n\n/**\n * Bytes carried inline.\n */\nexport const DataSourceSchema = z.looseObject({\n type: z.literal(\"data\"),\n value: z.string(),\n mimeType: z.string(),\n});\n\n/**\n * Bytes referenced by URL, fetched by whoever needs them.\n */\nexport const UrlSourceSchema = z.looseObject({\n type: z.literal(\"url\"),\n value: z.string(),\n mimeType: z.string().optional(),\n});\n\n/**\n * Bytes already at the provider, named by a handle the provider issued: an\n * OpenAI or Anthropic file id, a Gemini file URI, a storage URL only that\n * provider can read. No bytes travel and nothing is fetched. Only the provider\n * that minted the handle can resolve it; a peer that cannot drops the part as\n * it drops any part it cannot use.\n */\nexport const FileSourceSchema = z.looseObject({\n type: z.literal(\"file\"),\n value: z.string(),\n provider: z.string().optional(),\n mimeType: z.string().optional(),\n});\n\n/**\n * Where a media part's bytes come from: carried inline, referenced by URL, or\n * already at the provider under a handle it issued.\n */\nexport const PartSourceSchema = z.discriminatedUnion(\"type\", [\n DataSourceSchema,\n UrlSourceSchema,\n FileSourceSchema,\n]);\n\n/**\n * An image part.\n */\nexport const ImagePartSchema = z.looseObject({\n type: z.literal(\"image\"),\n id: z.string().optional(),\n source: PartSourceSchema,\n metadata: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n});\n\n/**\n * An audio part.\n */\nexport const AudioPartSchema = z.looseObject({\n type: z.literal(\"audio\"),\n id: z.string().optional(),\n source: PartSourceSchema,\n metadata: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n});\n\n/**\n * A video part.\n */\nexport const VideoPartSchema = z.looseObject({\n type: z.literal(\"video\"),\n id: z.string().optional(),\n source: PartSourceSchema,\n metadata: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n});\n\n/**\n * A document part.\n */\nexport const DocumentPartSchema = z.looseObject({\n type: z.literal(\"document\"),\n id: z.string().optional(),\n source: PartSourceSchema,\n metadata: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n});\n\n/**\n * One part of a message body: what a person sends in a user message, or what a\n * tool returns in a tool message. Discriminated by type. Named by what the\n * part is rather than by direction, because the same part travels into the\n * model inside a user message and back out of the stream inside a tool result.\n */\nexport const ContentPartSchema = z.discriminatedUnion(\"type\", [\n TextPartSchema,\n ImagePartSchema,\n AudioPartSchema,\n VideoPartSchema,\n DocumentPartSchema,\n]);\n\n/**\n * Carries what a tool returned. Mints a tool message rather than appending to\n * an existing one, which is why it has its own messageId.\n */\nexport const ToolCallResultEventSchema = z.looseObject({\n type: z.literal(EventType.TOOL_CALL_RESULT),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string(),\n toolCallId: z.string(),\n content: z.union([z.string(), z.array(ContentPartSchema)]),\n role: z.literal(\"tool\").optional(),\n});\n\n/**\n * Agent state. Any JSON value: the protocol carries state without interpreting\n * it, so an object, an array, a string and a number are all valid.\n */\nexport const StateSchema = z.any();\n\n/**\n * Replaces the agent state wholesale. Sent when a delta cannot express the\n * change, or to resynchronise a consumer.\n */\nexport const StateSnapshotEventSchema = z.looseObject({\n type: z.literal(EventType.STATE_SNAPSHOT),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n snapshot: StateSchema.refine((value) => value !== undefined),\n});\n\n/**\n * A JSON Pointer as defined by RFC 6901. Either the empty string, meaning the\n * whole document, or a sequence of slash-prefixed reference tokens in which a\n * tilde is escaped as ~0 and a slash as ~1. A value with no leading slash, or\n * a tilde followed by anything other than 0 or 1, is not a JSON Pointer.\n */\nexport const JsonPointerSchema = z.string().regex(new RegExp(\"^(/([^/~]|~[01])*)*$\"));\n\n/**\n * Inserts value at path. RFC 6902 section 4.1.\n */\nexport const AddOperationSchema = z\n .looseObject({\n op: z.literal(\"add\"),\n path: JsonPointerSchema,\n value: z.any().refine((value) => value !== undefined),\n })\n .meta({ specOpen: true });\n\n/**\n * Removes the value at path. RFC 6902 section 4.2.\n */\nexport const RemoveOperationSchema = z\n .looseObject({\n op: z.literal(\"remove\"),\n path: JsonPointerSchema,\n })\n .meta({ specOpen: true });\n\n/**\n * Replaces the value at path. RFC 6902 section 4.3.\n */\nexport const ReplaceOperationSchema = z\n .looseObject({\n op: z.literal(\"replace\"),\n path: JsonPointerSchema,\n value: z.any().refine((value) => value !== undefined),\n })\n .meta({ specOpen: true });\n\n/**\n * Moves the value at from to path. RFC 6902 section 4.4.\n */\nexport const MoveOperationSchema = z\n .looseObject({\n op: z.literal(\"move\"),\n from: JsonPointerSchema,\n path: JsonPointerSchema,\n })\n .meta({ specOpen: true });\n\n/**\n * Copies the value at from to path. RFC 6902 section 4.5.\n */\nexport const CopyOperationSchema = z\n .looseObject({\n op: z.literal(\"copy\"),\n from: JsonPointerSchema,\n path: JsonPointerSchema,\n })\n .meta({ specOpen: true });\n\n/**\n * Asserts that the value at path equals value. RFC 6902 section 4.6.\n */\nexport const TestOperationSchema = z\n .looseObject({\n op: z.literal(\"test\"),\n path: JsonPointerSchema,\n value: z.any().refine((value) => value !== undefined),\n })\n .meta({ specOpen: true });\n\n/**\n * A single RFC 6902 operation. Exactly one of the operation shapes must match,\n * discriminated by op. Unlike the protocol's own objects, the operations are\n * open: RFC 6902 section 4 requires members an operation does not define to be\n * ignored rather than rejected, so a remove carrying a leftover value is a\n * valid patch. Two of the RFC's rules are relations between values rather than\n * shapes, so no static schema can express them and neither is checked here: a\n * move whose from is a proper prefix of its path (section 4.4), and any\n * operation whose pointer does not resolve in the target document. Both are\n * the applier's to reject.\n */\nexport const JsonPatchOperationSchema = z.discriminatedUnion(\"op\", [\n AddOperationSchema,\n RemoveOperationSchema,\n ReplaceOperationSchema,\n MoveOperationSchema,\n CopyOperationSchema,\n TestOperationSchema,\n]);\n\n/**\n * A JSON Patch document as defined by RFC 6902, referenced by\n * STATE_DELTA.delta and ACTIVITY_DELTA.patch: an ordered sequence of\n * operations applied to a target document. An empty array is a valid no-op\n * patch. Whether the operations actually apply to the document they target is\n * a runtime question RFC 6902 leaves to the applier; structural validity here\n * says nothing about it.\n */\nexport const JsonPatchSchema = z.array(JsonPatchOperationSchema);\n\n/**\n * Changes the agent state incrementally.\n */\nexport const StateDeltaEventSchema = z.looseObject({\n type: z.literal(EventType.STATE_DELTA),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n delta: JsonPatchSchema,\n});\n\n/**\n * Instructions from the application developer.\n */\nexport const DeveloperMessageSchema = z.looseObject({\n subagentRunId: SubagentRunIdSchema.optional(),\n id: z.string(),\n role: z.literal(\"developer\"),\n name: z.string().optional(),\n encryptedValue: z.string().optional(),\n metadata: MetadataSchema.optional(),\n content: z.string(),\n});\n\n/**\n * Instructions from the system.\n */\nexport const SystemMessageSchema = z.looseObject({\n subagentRunId: SubagentRunIdSchema.optional(),\n id: z.string(),\n role: z.literal(\"system\"),\n name: z.string().optional(),\n encryptedValue: z.string().optional(),\n metadata: MetadataSchema.optional(),\n content: z.string(),\n});\n\n/**\n * The name and arguments of a tool call.\n */\nexport const FunctionCallSchema = z.looseObject({\n name: z.string(),\n arguments: z.string(),\n});\n\n/**\n * A call an assistant message made. Carries no subagent attribution of its own\n * and inherits its containing message's, since several calls can share one\n * parent.\n */\nexport const ToolCallSchema = z.looseObject({\n id: z.string(),\n type: z.literal(\"function\"),\n function: FunctionCallSchema,\n encryptedValue: z.string().optional(),\n metadata: MetadataSchema.optional(),\n});\n\n/**\n * A message from the agent. Content is optional because a turn may consist\n * only of tool calls.\n */\nexport const AssistantMessageSchema = z.looseObject({\n subagentRunId: SubagentRunIdSchema.optional(),\n id: z.string(),\n role: z.literal(\"assistant\"),\n name: z.string().optional(),\n encryptedValue: z.string().optional(),\n metadata: MetadataSchema.optional(),\n content: z.string().optional(),\n toolCalls: z.array(ToolCallSchema).optional(),\n});\n\n/**\n * A message from the person using the application.\n */\nexport const UserMessageSchema = z.looseObject({\n subagentRunId: SubagentRunIdSchema.optional(),\n id: z.string(),\n role: z.literal(\"user\"),\n name: z.string().optional(),\n encryptedValue: z.string().optional(),\n metadata: MetadataSchema.optional(),\n content: z.union([z.string(), z.array(ContentPartSchema)]),\n});\n\n/**\n * What a tool returned, as a message in the conversation. Stands alone rather\n * than composing BaseMessage, because it carries no name.\n */\nexport const ToolMessageSchema = z.looseObject({\n subagentRunId: SubagentRunIdSchema.optional(),\n id: z.string(),\n role: z.literal(\"tool\"),\n content: z.union([z.string(), z.array(ContentPartSchema)]),\n toolCallId: z.string(),\n error: z.string().optional(),\n encryptedValue: z.string().optional(),\n metadata: MetadataSchema.optional(),\n});\n\n/**\n * Structured progress that is not conversation content, materialised as a\n * message so it keeps its place in the sequence. Stands alone rather than\n * composing BaseMessage, because its content is an object rather than a\n * string.\n */\nexport const ActivityMessageSchema = z.looseObject({\n subagentRunId: SubagentRunIdSchema.optional(),\n id: z.string(),\n role: z.literal(\"activity\"),\n activityType: z.string(),\n content: z.custom<Record<string, any>>(\n (value) => typeof value === \"object\" && value !== null && !Array.isArray(value),\n ),\n metadata: MetadataSchema.optional(),\n});\n\n/**\n * A span of the agent's reasoning, materialised as a message. Stands alone\n * rather than composing BaseMessage, because it carries no name.\n */\nexport const ReasoningMessageSchema = z.looseObject({\n subagentRunId: SubagentRunIdSchema.optional(),\n id: z.string(),\n role: z.literal(\"reasoning\"),\n content: z.string(),\n encryptedValue: z.string().optional(),\n metadata: MetadataSchema.optional(),\n});\n\n/**\n * Any message in a conversation. Discriminated by role.\n */\nexport const MessageSchema = z.discriminatedUnion(\"role\", [\n DeveloperMessageSchema,\n SystemMessageSchema,\n AssistantMessageSchema,\n UserMessageSchema,\n ToolMessageSchema,\n ActivityMessageSchema,\n ReasoningMessageSchema,\n]);\n\n/**\n * The complete set of messages the producer owns, in order. Conversation-wide\n * rather than a plain overwrite: a consumer may keep messages of its own that\n * no producer tracks, so exactly how a snapshot reconciles with those is\n * behavioural and belongs in the prose. Being conversation-wide it cannot\n * belong to a single subagent, so it carries no attribution; it does establish\n * which subagent owns each message it contains, through the messages\n * themselves.\n */\nexport const MessagesSnapshotEventSchema = z.looseObject({\n type: z.literal(EventType.MESSAGES_SNAPSHOT),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n messages: z.array(MessageSchema),\n});\n\n/**\n * Reports structured progress that is not conversation content, such as a step\n * a UI renders as its own widget.\n */\nexport const ActivitySnapshotEventSchema = z.looseObject({\n type: z.literal(EventType.ACTIVITY_SNAPSHOT),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string(),\n activityType: z.string(),\n content: z.custom<Record<string, any>>(\n (value) => typeof value === \"object\" && value !== null && !Array.isArray(value),\n ),\n replace: z.boolean().optional(),\n});\n\n/**\n * Changes an activity message's content incrementally.\n */\nexport const ActivityDeltaEventSchema = z.looseObject({\n type: z.literal(EventType.ACTIVITY_DELTA),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string(),\n activityType: z.string(),\n patch: JsonPatchSchema,\n});\n\n/**\n * Passes a provider-native event through untranslated, for consumers that need\n * detail the protocol does not model.\n */\nexport const RawEventSchema = z.looseObject({\n type: z.literal(EventType.RAW),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n event: z.any().refine((value) => value !== undefined),\n source: z.string().optional(),\n});\n\n/**\n * The protocol's extension point for an application's own events. Anything a\n * consumer does with one is outside the protocol.\n */\nexport const CustomEventSchema = z.looseObject({\n type: z.literal(EventType.CUSTOM),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n name: z.string(),\n value: z.any().refine((value) => value !== undefined),\n});\n\n/**\n * A tool the agent may call.\n */\nexport const ToolSchema = z.looseObject({\n name: z.string(),\n description: z.string(),\n parameters: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n});\n\n/**\n * A named piece of ambient information given to the agent for the run,\n * distinct from the conversation.\n */\nexport const ContextSchema = z.looseObject({\n description: z.string(),\n value: z.string(),\n});\n\n/**\n * An answer to one interrupt, sent on the run that continues from it.\n */\nexport const ResumeEntrySchema = z.looseObject({\n interruptId: z.string(),\n status: z.enum([\"resolved\", \"cancelled\"]),\n payload: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n});\n\n/**\n * A request to run an agent. Also echoed back as RUN_STARTED.input. Only\n * threadId, runId and messages are required: those are the three the SDKs\n * already agree on, and for tools and context an absent key and an empty array\n * mean the same thing, so requiring them would catch nothing a producer could\n * get wrong.\n */\nexport const RunAgentInputSchema = z.looseObject({\n threadId: z.string(),\n runId: z.string(),\n protocolVersion: z.string().optional(),\n parentRunId: z.string().optional(),\n state: StateSchema.refine((value) => value !== null)\n .nullable()\n .transform((value) => value ?? undefined)\n .optional(),\n messages: z.array(MessageSchema),\n tools: z.array(ToolSchema).default(() => []),\n context: z.array(ContextSchema).default(() => []),\n forwardedProps: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n resume: z.array(ResumeEntrySchema).optional(),\n});\n\n/**\n * Opens a run. Run-scoped, so it carries no subagent attribution.\n */\nexport const RunStartedEventSchema = z.looseObject({\n type: z.literal(EventType.RUN_STARTED),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n threadId: z.string(),\n runId: z.string(),\n protocolVersion: z.string().optional(),\n parentRunId: z.string().optional(),\n input: RunAgentInputSchema.optional(),\n});\n\n/**\n * The run completed. Equivalent to an absent outcome. Closed like every other\n * object, which is also what keeps it from carrying the suspended sibling's\n * interrupts — a success with an interrupt still pending would be a\n * contradiction, not an extension. A completed run may still have left\n * frontend tool calls for the application to answer; pendingToolCallIds names\n * them.\n */\nexport const RunFinishedSuccessOutcomeSchema = z.looseObject({\n type: z.literal(\"success\"),\n pendingToolCallIds: z.array(z.string()).optional(),\n});\n\n/**\n * Something a run needs from outside before it can continue, such as an\n * approval or a missing value.\n */\nexport const InterruptSchema = z.looseObject({\n subagentRunId: SubagentRunIdSchema.optional(),\n id: z.string(),\n reason: z.string(),\n message: z.string().optional(),\n toolCallId: z.string().optional(),\n responseSchema: z\n .custom<\n Record<string, any>\n >((value) => typeof value === \"object\" && value !== null && !Array.isArray(value))\n .optional(),\n expiresAt: z.string().optional(),\n metadata: MetadataSchema.optional(),\n});\n\n/**\n * The run is paused, waiting for something outside it. Resuming means starting\n * a new run whose resume entries answer these interrupts.\n */\nexport const RunFinishedInterruptOutcomeSchema = z.looseObject({\n type: z.literal(\"interrupt\"),\n interrupts: z.array(InterruptSchema).min(1),\n});\n\n/**\n * The run was stopped before it completed, by whoever was running it, and did\n * not fail. Neither success nor interrupt: nothing was produced as a result,\n * and nothing is waited for, so the next run on the thread is an ordinary new\n * run rather than a resume. Closed like its siblings: a cancelled run has no\n * interrupts to carry. Named in the schema before 1.0 because an outcome a\n * consumer does not recognise is stripped and read as success — a cancellation\n * added later would reach every 1.0 consumer as a completed run.\n */\nexport const RunFinishedCancelledOutcomeSchema = z.looseObject({\n type: z.literal(\"cancelled\"),\n});\n\n/**\n * Why a run ended.\n */\nexport const RunFinishedOutcomeSchema = z.discriminatedUnion(\"type\", [\n RunFinishedSuccessOutcomeSchema,\n RunFinishedInterruptOutcomeSchema,\n RunFinishedCancelledOutcomeSchema,\n]);\n\n/**\n * Token counts for one provider and model, in the protocol's own accounting:\n * every count is either a total or a named part of one, so entries from\n * different providers add up without double-counting. inputTokens and\n * outputTokens are the totals; reasoningTokens, cachedInputTokens and\n * cacheWriteInputTokens are parts of them, never additions to them;\n * totalTokens is the two totals summed. Every field is a label or a number —\n * nothing content-bearing or identifying, no prompts, completions, messages,\n * or thread, run and user identifiers.\n */\nexport const TokenUsageSchema = z.looseObject({\n provider: z.string().optional(),\n model: z.string().optional(),\n inputTokens: z.int().min(0).max(9007199254740991).optional(),\n outputTokens: z.int().min(0).max(9007199254740991).optional(),\n totalTokens: z.int().min(0).max(9007199254740991).optional(),\n reasoningTokens: z.int().min(0).max(9007199254740991).optional(),\n cachedInputTokens: z.int().min(0).max(9007199254740991).optional(),\n cacheWriteInputTokens: z.int().min(0).max(9007199254740991).optional(),\n});\n\n/**\n * Closes a run that did not fail. Run-scoped, so it carries no subagent\n * attribution.\n */\nexport const RunFinishedEventSchema = z.looseObject({\n type: z.literal(EventType.RUN_FINISHED),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n threadId: z.string(),\n runId: z.string(),\n result: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n outcome: RunFinishedOutcomeSchema.optional(),\n usage: z.array(TokenUsageSchema).optional(),\n});\n\n/**\n * Ends a run that failed. Run-scoped, so it carries no subagent attribution; a\n * subagent that fails without ending the run reports SUBAGENT_ERROR instead.\n */\nexport const RunErrorEventSchema = z.looseObject({\n type: z.literal(EventType.RUN_ERROR),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n message: z.string(),\n code: z.string().optional(),\n usage: z.array(TokenUsageSchema).optional(),\n});\n\n/**\n * Opens a named step within a run, for producers whose frameworks have a step\n * concept worth surfacing.\n */\nexport const StepStartedEventSchema = z.looseObject({\n type: z.literal(EventType.STEP_STARTED),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n stepName: z.string(),\n});\n\n/**\n * Closes a named step.\n */\nexport const StepFinishedEventSchema = z.looseObject({\n type: z.literal(EventType.STEP_FINISHED),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n stepName: z.string(),\n});\n\n/**\n * Opens a span of reasoning. A span may contain several reasoning messages.\n */\nexport const ReasoningStartEventSchema = z.looseObject({\n type: z.literal(EventType.REASONING_START),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string(),\n});\n\n/**\n * Opens a streamed reasoning message.\n */\nexport const ReasoningMessageStartEventSchema = z.looseObject({\n type: z.literal(EventType.REASONING_MESSAGE_START),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string(),\n role: z.literal(\"reasoning\"),\n});\n\n/**\n * Appends a fragment to a streamed reasoning message.\n */\nexport const ReasoningMessageContentEventSchema = z.looseObject({\n type: z.literal(EventType.REASONING_MESSAGE_CONTENT),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string(),\n delta: z.string(),\n});\n\n/**\n * Closes a streamed reasoning message.\n */\nexport const ReasoningMessageEndEventSchema = z.looseObject({\n type: z.literal(EventType.REASONING_MESSAGE_END),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string(),\n});\n\n/**\n * A shorthand that stands in for a reasoning message's start, content and end\n * sequence.\n */\nexport const ReasoningMessageChunkEventSchema = z.looseObject({\n type: z.literal(EventType.REASONING_MESSAGE_CHUNK),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string().optional(),\n delta: z.string().optional(),\n});\n\n/**\n * Closes a span of reasoning.\n */\nexport const ReasoningEndEventSchema = z.looseObject({\n type: z.literal(EventType.REASONING_END),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n messageId: z.string(),\n});\n\n/**\n * Whether a REASONING_ENCRYPTED_VALUE belongs to a message or to a tool call.\n */\nexport const ReasoningEncryptedValueSubtypeSchema = z.enum([\"tool-call\", \"message\"]);\n\n/**\n * Carries a provider's opaque, encrypted reasoning artefact, which a consumer\n * stores and returns on a later turn without being able to read it.\n */\nexport const ReasoningEncryptedValueEventSchema = z.looseObject({\n type: z.literal(EventType.REASONING_ENCRYPTED_VALUE),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema.optional(),\n subtype: ReasoningEncryptedValueSubtypeSchema,\n entityId: z.string(),\n encryptedValue: z.string(),\n});\n\n/**\n * Announces that a subagent invocation has begun. Everything the subagent\n * produces afterwards is attributed by carrying its subagentRunId, so a\n * consumer can group the work without replaying the stream. Composed from\n * BaseEvent alone rather than Attributable, because here subagentRunId\n * identifies the subagent rather than attributing the event to one;\n * attribution to an enclosing subagent is parentSubagentRunId.\n */\nexport const SubagentStartedEventSchema = z.looseObject({\n type: z.literal(EventType.SUBAGENT_STARTED),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema,\n name: z.string(),\n description: z.string().optional(),\n parentSubagentRunId: SubagentRunIdSchema.optional(),\n parentToolCallId: z.string().optional(),\n parentMessageId: z.string().optional(),\n});\n\n/**\n * The subagent completed its work. Equivalent to an absent outcome.\n */\nexport const SubagentFinishedSuccessOutcomeSchema = z.looseObject({\n type: z.literal(\"success\"),\n});\n\n/**\n * The subagent is paused awaiting outside input. Terminal for this stream, not\n * for the subagent: a later run may continue the same invocation once the\n * interrupts are answered.\n */\nexport const SubagentFinishedSuspendedOutcomeSchema = z.looseObject({\n type: z.literal(\"suspended\"),\n interruptIds: z.array(z.string()).optional(),\n});\n\n/**\n * Why a subagent's segment of a run ended. Mirrors RunFinishedOutcome one\n * level down.\n */\nexport const SubagentFinishedOutcomeSchema = z.discriminatedUnion(\"type\", [\n SubagentFinishedSuccessOutcomeSchema,\n SubagentFinishedSuspendedOutcomeSchema,\n]);\n\n/**\n * Ends a subagent invocation's segment of this run, either because the work\n * completed or because it is suspended awaiting outside input.\n */\nexport const SubagentFinishedEventSchema = z.looseObject({\n type: z.literal(EventType.SUBAGENT_FINISHED),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema,\n result: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n outcome: SubagentFinishedOutcomeSchema.optional(),\n});\n\n/**\n * Reports that a subagent invocation failed. The run may continue: a parent\n * agent is free to handle a failed subagent, which is why this is not\n * RUN_ERROR.\n */\nexport const SubagentErrorEventSchema = z.looseObject({\n type: z.literal(EventType.SUBAGENT_ERROR),\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n subagentRunId: SubagentRunIdSchema,\n message: z.string(),\n code: z.string().optional(),\n});\n\n/**\n * Any AG-UI event. Every member is normative: there is no optional tier and no\n * event a consumer may decline to implement. Discriminated by the type\n * property.\n */\nexport const EventSchema = z.discriminatedUnion(\"type\", [\n TextMessageStartEventSchema,\n TextMessageContentEventSchema,\n TextMessageEndEventSchema,\n TextMessageChunkEventSchema,\n ToolCallStartEventSchema,\n ToolCallArgsEventSchema,\n ToolCallEndEventSchema,\n ToolCallChunkEventSchema,\n ToolCallResultEventSchema,\n StateSnapshotEventSchema,\n StateDeltaEventSchema,\n MessagesSnapshotEventSchema,\n ActivitySnapshotEventSchema,\n ActivityDeltaEventSchema,\n RawEventSchema,\n CustomEventSchema,\n RunStartedEventSchema,\n RunFinishedEventSchema,\n RunErrorEventSchema,\n StepStartedEventSchema,\n StepFinishedEventSchema,\n ReasoningStartEventSchema,\n ReasoningMessageStartEventSchema,\n ReasoningMessageContentEventSchema,\n ReasoningMessageEndEventSchema,\n ReasoningMessageChunkEventSchema,\n ReasoningEndEventSchema,\n ReasoningEncryptedValueEventSchema,\n SubagentStartedEventSchema,\n SubagentFinishedEventSchema,\n SubagentErrorEventSchema,\n]);\n\n/**\n * Every role a materialised message may have.\n */\nexport const RoleSchema = z.enum([\n \"developer\",\n \"system\",\n \"assistant\",\n \"user\",\n \"tool\",\n \"activity\",\n \"reasoning\",\n]);\n\n/**\n * Describes a subagent that can be invoked by a parent agent.\n */\nexport const SubagentInfoSchema = z.looseObject({\n name: z.string(),\n description: z.string().optional(),\n});\n\n/**\n * Basic metadata about the agent. Useful for discovery UIs, agent\n * marketplaces, and debugging. Set these when you want clients to display\n * agent information or when multiple agents are available and users need to\n * pick one.\n */\nexport const IdentityCapabilitiesSchema = z.looseObject({\n name: z.string().optional(),\n type: z.string().optional(),\n description: z.string().optional(),\n version: z.string().optional(),\n provider: z.string().optional(),\n documentationUrl: z.string().optional(),\n metadata: MetadataSchema.optional(),\n});\n\n/**\n * Declares which transport mechanisms the agent supports. Clients use this to\n * pick the best connection strategy. Only set flags to true for transports\n * your agent actually handles — omit or set false for unsupported ones.\n */\nexport const TransportCapabilitiesSchema = z.looseObject({\n streaming: z.boolean().optional(),\n websocket: z.boolean().optional(),\n httpBinary: z.boolean().optional(),\n pushNotifications: z.boolean().optional(),\n resumable: z.boolean().optional(),\n});\n\n/**\n * Tool calling capabilities. Distinguishes between tools the agent itself\n * provides (listed in items) and tools the client passes at runtime via\n * RunAgentInput.tools. Enable this when your agent can call functions, search\n * the web, execute code, etc.\n */\nexport const ToolsCapabilitiesSchema = z.looseObject({\n supported: z.boolean().optional(),\n items: z.array(ToolSchema).optional(),\n parallelCalls: z.boolean().optional(),\n clientProvided: z.boolean().optional(),\n});\n\n/**\n * Output format support. Enable structuredOutput when your agent can return\n * responses conforming to a JSON schema, which is useful for programmatic\n * consumption.\n */\nexport const OutputCapabilitiesSchema = z.looseObject({\n structuredOutput: z.boolean().optional(),\n supportedMimeTypes: z.array(z.string()).optional(),\n});\n\n/**\n * State and memory management capabilities. These tell the client how the\n * agent handles shared state and whether conversation context persists across\n * runs.\n */\nexport const StateCapabilitiesSchema = z.looseObject({\n snapshots: z.boolean().optional(),\n deltas: z.boolean().optional(),\n memory: z.boolean().optional(),\n persistentState: z.boolean().optional(),\n});\n\n/**\n * Multi-agent coordination capabilities. Enable these when your agent can\n * orchestrate or hand off work to other agents.\n */\nexport const MultiAgentCapabilitiesSchema = z.looseObject({\n supported: z.boolean().optional(),\n delegation: z.boolean().optional(),\n handoffs: z.boolean().optional(),\n subagents: z.array(SubagentInfoSchema).optional(),\n});\n\n/**\n * Reasoning and thinking capabilities. Enable these when your agent exposes\n * its internal thought process (e.g., chain-of-thought, extended thinking).\n */\nexport const ReasoningCapabilitiesSchema = z.looseObject({\n supported: z.boolean().optional(),\n streaming: z.boolean().optional(),\n encrypted: z.boolean().optional(),\n});\n\n/**\n * Modalities the agent can accept as input. Clients use this to show or hide\n * file upload buttons, audio recorders, image pickers, etc.\n */\nexport const MultimodalInputCapabilitiesSchema = z.looseObject({\n image: z.boolean().optional(),\n audio: z.boolean().optional(),\n video: z.boolean().optional(),\n pdf: z.boolean().optional(),\n file: z.boolean().optional(),\n});\n\n/**\n * Modalities the agent can produce as output. Clients use this to anticipate\n * rich content in the agent's response.\n */\nexport const MultimodalOutputCapabilitiesSchema = z.looseObject({\n image: z.boolean().optional(),\n audio: z.boolean().optional(),\n});\n\n/**\n * Multimodal input and output support. Organized into input and output\n * sub-objects so clients can independently query what the agent accepts versus\n * what it produces.\n */\nexport const MultimodalCapabilitiesSchema = z.looseObject({\n input: MultimodalInputCapabilitiesSchema.optional(),\n output: MultimodalOutputCapabilitiesSchema.optional(),\n});\n\n/**\n * Execution control and limits. Declare these so clients can set expectations\n * about how long or how many steps an agent run might take.\n */\nexport const ExecutionCapabilitiesSchema = z.looseObject({\n codeExecution: z.boolean().optional(),\n sandboxed: z.boolean().optional(),\n maxIterations: z.int().min(0).max(9007199254740991).optional(),\n maxExecutionTime: z.int().min(0).max(9007199254740991).optional(),\n});\n\n/**\n * Human-in-the-loop interaction support. Enable these when your agent can\n * pause execution to request human input, approval, or feedback before\n * continuing.\n */\nexport const HumanInTheLoopCapabilitiesSchema = z.looseObject({\n supported: z.boolean().optional(),\n approvals: z.boolean().optional(),\n interventions: z.boolean().optional(),\n feedback: z.boolean().optional(),\n interrupts: z.boolean().optional(),\n approveWithEdits: z.boolean().optional(),\n});\n\n/**\n * A typed, categorized snapshot of an agent's current capabilities. All fields\n * are optional — agents only declare what they support. An omitted field means\n * the capability is not declared (unknown), not that it is unsupported. The\n * custom field is an escape hatch for integration-specific capabilities that\n * do not fit into the standard categories.\n */\nexport const AgentCapabilitiesSchema = z.looseObject({\n identity: IdentityCapabilitiesSchema.optional(),\n transport: TransportCapabilitiesSchema.optional(),\n tools: ToolsCapabilitiesSchema.optional(),\n output: OutputCapabilitiesSchema.optional(),\n state: StateCapabilitiesSchema.optional(),\n multiAgent: MultiAgentCapabilitiesSchema.optional(),\n reasoning: ReasoningCapabilitiesSchema.optional(),\n multimodal: MultimodalCapabilitiesSchema.optional(),\n execution: ExecutionCapabilitiesSchema.optional(),\n humanInTheLoop: HumanInTheLoopCapabilitiesSchema.optional(),\n custom: z\n .custom<\n Record<string, any>\n >((value) => typeof value === \"object\" && value !== null && !Array.isArray(value))\n .optional(),\n});\n\n/**\n * Composed into everything that can belong to a subagent's work: the events\n * that describe content or progress, the message types, and each interrupt.\n * Run-scoped events omit it — RUN_STARTED, RUN_FINISHED and RUN_ERROR describe\n * the run itself and MESSAGES_SNAPSHOT is conversation-wide, so none of them\n * can belong to one subagent. A tool call omits it too and inherits its\n * containing message's attribution.\n */\nexport const AttributableSchema = z.looseObject({\n subagentRunId: SubagentRunIdSchema.optional(),\n});\n\n/**\n * The fields every event carries, whatever its type. Composed into each event\n * definition rather than repeated, so a change here reaches every event at\n * once.\n */\nexport const BaseEventSchema = z.looseObject({\n type: EventTypeSchema,\n timestamp: z.int().min(-9007199254740991).max(9007199254740991).optional(),\n rawEvent: z\n .any()\n .refine((value) => value !== null)\n .optional(),\n metadata: MetadataSchema.optional(),\n});\n\n/**\n * The fields shared by the developer, system, assistant and user messages.\n * Deliberately excludes content, because a user message's content may be an\n * array while the others are strings, and composition here intersects rather\n * than overrides: a base that constrained content to a string would make an\n * array content invalid. The tool, activity and reasoning messages do not\n * compose this, because they carry no name.\n */\nexport const BaseMessageSchema = z.looseObject({\n subagentRunId: SubagentRunIdSchema.optional(),\n id: z.string(),\n role: z.string(),\n name: z.string().optional(),\n encryptedValue: z.string().optional(),\n metadata: MetadataSchema.optional(),\n});\n","// The `@ag-ui/core/schemas` subpath: the zod validators, and nothing else.\n// Type-only consumers import the main entry; runtime validation imports this.\n// Regenerate the generated source with `pnpm --filter @ag-ui/spec generate`.\n//\n// This is the ONLY entry of this package that touches zod, which is what lets\n// zod be an optional peer dependency: an application that never validates\n// never has to install it.\nimport { MetadataSchema } from \"./generated/schemas\";\n\nexport * from \"./generated/schemas\";\nexport { PROTOCOL_VERSION } from \"./generated/version\";\n\n/** The discriminated union of every event validator, under its historic name. */\nexport { EventSchema as EventSchemas } from \"./generated/schemas\";\n\n/**\n * The names the content part validators carried before 1.0 renamed the parts\n * (InputContent -> ContentPart, TextInputContent -> TextPart, and so on): the\n * same parts now sit on tool messages as well as user messages, so they are\n * named by what they are rather than by direction. The wire is unchanged —\n * every `type` value is the same — and so is every validator behind these\n * names; only the spelling moved. Kept for one release, see DEPRECATIONS.md.\n *\n * @deprecated Use the ...Part names.\n */\nexport {\n ContentPartSchema as InputContentSchema,\n TextPartSchema as TextInputContentSchema,\n ImagePartSchema as ImageInputContentSchema,\n AudioPartSchema as AudioInputContentSchema,\n VideoPartSchema as VideoInputContentSchema,\n DocumentPartSchema as DocumentInputContentSchema,\n PartSourceSchema as InputContentSourceSchema,\n DataSourceSchema as InputContentDataSourceSchema,\n UrlSourceSchema as InputContentUrlSourceSchema,\n} from \"./generated/schemas\";\n\n/**\n * Historic aliases for the media part validators: this package has always\n * also exported them as ...InputPart.\n */\nexport {\n ImagePartSchema as ImageInputPartSchema,\n AudioPartSchema as AudioInputPartSchema,\n VideoPartSchema as VideoInputPartSchema,\n DocumentPartSchema as DocumentInputPartSchema,\n} from \"./generated/schemas\";\n\n/**\n * How metadata is declared on events and messages.\n *\n * The object itself is absent or an object, never `null` — and parsing enforces\n * that invariant rather than coercing a `null` to absent. The schema pinning it\n * now lives in the generated source (MetadataSchema in\n * src/generated/schemas.ts); this comment survives as the recorded reasoning.\n *\n * Historically tolerated whole optional nulls are translated to absence in\n * the client's compatibility boundary before validation. That includes the\n * legacy `parentMessageId` and `outcome` cases and optional JSON fields such as\n * `rawEvent`, `result`, and media content-part `metadata`; see the repo-root\n * DEPRECATIONS.md for the exact list. Event and message metadata already\n * rejected a whole `null`, so their restriction remains. Compatibility for\n * media content-part metadata does not broaden this shared metadata schema.\n *\n * A `null` *value under a key* is meaningful data and is preserved. Only a\n * `null` in place of the whole object is a contract violation.\n */\nexport const OptionalMetadataSchema = MetadataSchema.optional();\n"],"mappings":";;;;;;;AAWA,MAAa,kBAAkB,EAAE,KAAK,UAAU;;;;;;;;;AAUhD,MAAa,iBAAiB,EAAE,QAC7B,UAAU,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,MAAM,CAChF;;;;;;;AAQD,MAAa,sBAAsB,EAAE,QAAQ;;;;;AAM7C,MAAa,wBAAwB,EAAE,KAAK;CAAC;CAAa;CAAU;CAAa;CAAO,CAAC;;;;;AAMzF,MAAa,8BAA8B,EAAE,YAAY;CACvD,MAAM,EAAE,QAAQ,UAAU,mBAAmB;CAC7C,WAAW,EAAE,KAAK,CAAC,IAAI,kBAAkB,CAAC,IAAI,iBAAiB,CAAC,UAAU;CAC1E,UAAU,EACP,KAAK,CACL,QAAQ,UAAU,UAAU,KAAK,CACjC,UAAU;CACb,UAAU,eAAe,UAAU;CACnC,eAAe,oBAAoB,UAAU;CAC7C,WAAW,EAAE,QAAQ;CACrB,MAAM,sBAAsB,UAAU;CACtC,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC5B,CAAC;;;;AAKF,MAAa,gCAAgC,EAAE,YAAY;CACzD,MAAM,EAAE,QAAQ,UAAU,qBAAqB;CAC/C,WAAW,EAAE,KAAK,CAAC,IAAI,kBAAkB,CAAC,IAAI,iBAAiB,CAAC,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I,EAAE,QAAQ;CACd,MAAM,EAAE,QAAQ;CAChB,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,gBAAgB,EAAE,QAAQ,CAAC,UAAU;CACrC,UAAU,eAAe,UAAU;CACpC,CAAC;;;;;;;;;;;;;;;;;;;;;;;AC1yCF,MAAa,yBAAyB,eAAe,UAAU"}
@@ -1,5 +1,8 @@
1
1
 
2
- //#region src/events.ts
2
+ //#region src/generated/types.ts
3
+ /**
4
+ * The discriminator carried by every event.
5
+ */
3
6
  let EventType = /* @__PURE__ */ function(EventType) {
4
7
  EventType["TEXT_MESSAGE_START"] = "TEXT_MESSAGE_START";
5
8
  EventType["TEXT_MESSAGE_CONTENT"] = "TEXT_MESSAGE_CONTENT";
@@ -10,16 +13,6 @@ let EventType = /* @__PURE__ */ function(EventType) {
10
13
  EventType["TOOL_CALL_END"] = "TOOL_CALL_END";
11
14
  EventType["TOOL_CALL_CHUNK"] = "TOOL_CALL_CHUNK";
12
15
  EventType["TOOL_CALL_RESULT"] = "TOOL_CALL_RESULT";
13
- /** @deprecated Use REASONING_START instead. Will be removed in 1.0.0. */
14
- EventType["THINKING_START"] = "THINKING_START";
15
- /** @deprecated Use REASONING_END instead. Will be removed in 1.0.0. */
16
- EventType["THINKING_END"] = "THINKING_END";
17
- /** @deprecated Use REASONING_MESSAGE_START instead. Will be removed in 1.0.0. */
18
- EventType["THINKING_TEXT_MESSAGE_START"] = "THINKING_TEXT_MESSAGE_START";
19
- /** @deprecated Use REASONING_MESSAGE_CONTENT instead. Will be removed in 1.0.0. */
20
- EventType["THINKING_TEXT_MESSAGE_CONTENT"] = "THINKING_TEXT_MESSAGE_CONTENT";
21
- /** @deprecated Use REASONING_MESSAGE_END instead. Will be removed in 1.0.0. */
22
- EventType["THINKING_TEXT_MESSAGE_END"] = "THINKING_TEXT_MESSAGE_END";
23
16
  EventType["STATE_SNAPSHOT"] = "STATE_SNAPSHOT";
24
17
  EventType["STATE_DELTA"] = "STATE_DELTA";
25
18
  EventType["MESSAGES_SNAPSHOT"] = "MESSAGES_SNAPSHOT";
@@ -39,9 +32,21 @@ let EventType = /* @__PURE__ */ function(EventType) {
39
32
  EventType["REASONING_MESSAGE_CHUNK"] = "REASONING_MESSAGE_CHUNK";
40
33
  EventType["REASONING_END"] = "REASONING_END";
41
34
  EventType["REASONING_ENCRYPTED_VALUE"] = "REASONING_ENCRYPTED_VALUE";
35
+ EventType["SUBAGENT_STARTED"] = "SUBAGENT_STARTED";
36
+ EventType["SUBAGENT_FINISHED"] = "SUBAGENT_FINISHED";
37
+ EventType["SUBAGENT_ERROR"] = "SUBAGENT_ERROR";
42
38
  return EventType;
43
39
  }({});
44
40
 
41
+ //#endregion
42
+ //#region src/generated/version.ts
43
+ /**
44
+ * The protocol version this code was generated from: the version segment of
45
+ * the schema's $id (https://ag-ui.com/spec/1.0/schema.json). Never typed by a
46
+ * human.
47
+ */
48
+ const PROTOCOL_VERSION = "1.0";
49
+
45
50
  //#endregion
46
51
  Object.defineProperty(exports, 'EventType', {
47
52
  enumerable: true,
@@ -49,4 +54,10 @@ Object.defineProperty(exports, 'EventType', {
49
54
  return EventType;
50
55
  }
51
56
  });
52
- //# sourceMappingURL=events-CMtdFXWl.js.map
57
+ Object.defineProperty(exports, 'PROTOCOL_VERSION', {
58
+ enumerable: true,
59
+ get: function () {
60
+ return PROTOCOL_VERSION;
61
+ }
62
+ });
63
+ //# sourceMappingURL=version-BIes0ykB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-BIes0ykB.js","names":[],"sources":["../src/generated/types.ts","../src/generated/version.ts"],"sourcesContent":["// @generated by spec/generator — DO NOT EDIT.\n// Source: https://ag-ui.com/spec/1.0/schema.json\n// Regenerate: pnpm --filter @ag-ui/spec generate\n/* eslint-disable */\n\n/**\n * The discriminator carried by every event.\n */\nexport enum EventType {\n TEXT_MESSAGE_START = \"TEXT_MESSAGE_START\",\n TEXT_MESSAGE_CONTENT = \"TEXT_MESSAGE_CONTENT\",\n TEXT_MESSAGE_END = \"TEXT_MESSAGE_END\",\n TEXT_MESSAGE_CHUNK = \"TEXT_MESSAGE_CHUNK\",\n TOOL_CALL_START = \"TOOL_CALL_START\",\n TOOL_CALL_ARGS = \"TOOL_CALL_ARGS\",\n TOOL_CALL_END = \"TOOL_CALL_END\",\n TOOL_CALL_CHUNK = \"TOOL_CALL_CHUNK\",\n TOOL_CALL_RESULT = \"TOOL_CALL_RESULT\",\n STATE_SNAPSHOT = \"STATE_SNAPSHOT\",\n STATE_DELTA = \"STATE_DELTA\",\n MESSAGES_SNAPSHOT = \"MESSAGES_SNAPSHOT\",\n ACTIVITY_SNAPSHOT = \"ACTIVITY_SNAPSHOT\",\n ACTIVITY_DELTA = \"ACTIVITY_DELTA\",\n RAW = \"RAW\",\n CUSTOM = \"CUSTOM\",\n RUN_STARTED = \"RUN_STARTED\",\n RUN_FINISHED = \"RUN_FINISHED\",\n RUN_ERROR = \"RUN_ERROR\",\n STEP_STARTED = \"STEP_STARTED\",\n STEP_FINISHED = \"STEP_FINISHED\",\n REASONING_START = \"REASONING_START\",\n REASONING_MESSAGE_START = \"REASONING_MESSAGE_START\",\n REASONING_MESSAGE_CONTENT = \"REASONING_MESSAGE_CONTENT\",\n REASONING_MESSAGE_END = \"REASONING_MESSAGE_END\",\n REASONING_MESSAGE_CHUNK = \"REASONING_MESSAGE_CHUNK\",\n REASONING_END = \"REASONING_END\",\n REASONING_ENCRYPTED_VALUE = \"REASONING_ENCRYPTED_VALUE\",\n SUBAGENT_STARTED = \"SUBAGENT_STARTED\",\n SUBAGENT_FINISHED = \"SUBAGENT_FINISHED\",\n SUBAGENT_ERROR = \"SUBAGENT_ERROR\",\n}\n\n/**\n * Extra information attached to an event, a message, a tool call, a tool, an\n * interrupt or a resume entry. Open by key: any JSON value is allowed under a\n * key, including null, because a null there is meaningful data. The object\n * itself may be absent but is never null when present. The key ag-ui is\n * reserved for the protocol's own use; reservation is by convention, since\n * validating the shape of a key's value would contradict being open by key.\n */\nexport type Metadata = Record<string, any>;\n\n/**\n * An opaque handle for one subagent invocation, not a reusable name for a\n * subagent definition: two invocations of the same subagent carry two\n * different values. Named to mirror runId one level down, the way the\n * subagent's name mirrors agentId.\n */\nexport type SubagentRunId = string;\n\n/**\n * The roles a streamed text message may take. Excludes tool, which is carried\n * by TOOL_CALL_RESULT rather than streamed as text.\n */\nexport type TextMessageRole = \"developer\" | \"system\" | \"assistant\" | \"user\";\n\n/**\n * Opens a streamed text message. The content arrives as TEXT_MESSAGE_CONTENT\n * events and the message closes with TEXT_MESSAGE_END.\n */\nexport type TextMessageStartEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.TEXT_MESSAGE_START;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * Identifies the message this stream builds, and ties the later content and\n * end events to it.\n */\n messageId: string;\n /**\n * Who the message is from. An absent role means assistant; that meaning is\n * normative and stated in the prose, because a validator treats a default as\n * documentation rather than as behaviour.\n * @default \"assistant\"\n */\n role?: TextMessageRole;\n /**\n * An optional display name for the author, for providers that distinguish\n * several participants in one role.\n */\n name?: string;\n};\n\n/**\n * Appends a fragment to a streamed text message.\n */\nexport type TextMessageContentEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.TEXT_MESSAGE_CONTENT;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The message this fragment belongs to.\n */\n messageId: string;\n /**\n * The fragment to append. May be the empty string: providers emit empty\n * deltas as keep-alives and while a tool call is being decided, and\n * rejecting them would kill runs that are working correctly.\n */\n delta: string;\n};\n\n/**\n * Closes a streamed text message.\n */\nexport type TextMessageEndEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.TEXT_MESSAGE_END;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The message being closed.\n */\n messageId: string;\n};\n\n/**\n * A shorthand that stands in for a start, content and end sequence, for\n * producers that cannot know in advance where a message begins. Every field is\n * optional because a continuation chunk omits what has not changed; which\n * message a field-less chunk continues is a sequence question the prose\n * specification answers.\n */\nexport type TextMessageChunkEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.TEXT_MESSAGE_CHUNK;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The message this chunk belongs to. Absent continues the message already\n * open.\n */\n messageId?: string;\n /**\n * Who the message is from, on the chunk that opens it.\n */\n role?: TextMessageRole;\n /**\n * The fragment to append. May be the empty string.\n */\n delta?: string;\n /**\n * An optional display name for the author.\n */\n name?: string;\n};\n\n/**\n * Opens a tool call. The arguments arrive as TOOL_CALL_ARGS events and the\n * call closes with TOOL_CALL_END.\n */\nexport type ToolCallStartEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.TOOL_CALL_START;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * Identifies the call, and ties the later args, end and result events to it.\n */\n toolCallId: string;\n /**\n * Which tool is being called.\n */\n toolCallName: string;\n /**\n * The assistant message that holds this call. Absent means the producer did\n * not attribute it to one.\n */\n parentMessageId?: string;\n};\n\n/**\n * Appends a fragment of a tool call's arguments.\n */\nexport type ToolCallArgsEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.TOOL_CALL_ARGS;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The call these arguments belong to.\n */\n toolCallId: string;\n /**\n * A fragment of the arguments, which concatenate into the call's argument\n * text — conventionally a JSON document, though the protocol does not\n * validate it (see FunctionCall.arguments). Deliberately a string rather\n * than parsed JSON: a fragment is not itself a document. May be the empty\n * string.\n */\n delta: string;\n};\n\n/**\n * Closes a tool call, meaning its arguments are complete.\n */\nexport type ToolCallEndEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.TOOL_CALL_END;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The call being closed.\n */\n toolCallId: string;\n};\n\n/**\n * A shorthand that stands in for a tool call's start, args and end sequence.\n * Every field is optional for the same reason as TEXT_MESSAGE_CHUNK.\n */\nexport type ToolCallChunkEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.TOOL_CALL_CHUNK;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The call this chunk belongs to. Absent continues the call already open.\n */\n toolCallId?: string;\n /**\n * Which tool is being called, on the chunk that opens it.\n */\n toolCallName?: string;\n /**\n * The assistant message that holds this call.\n */\n parentMessageId?: string;\n /**\n * A fragment of the arguments. May be the empty string.\n */\n delta?: string;\n};\n\n/**\n * A text part.\n */\nexport type TextPart = {\n /**\n * Discriminator.\n */\n type: \"text\";\n /**\n * Identifies this part within its message. Optional, and nothing reads it\n * yet: reserved so that a streamed part can be matched to its entry in\n * history once assistant messages carry parts too.\n */\n id?: string;\n /**\n * The text.\n */\n text: string;\n /**\n * Extra information about this part. Unconstrained, as on the media parts.\n * This is where a text search hit carries its source and title, rather than\n * the protocol modelling a search-result part of its own.\n */\n metadata?: any;\n};\n\n/**\n * Bytes carried inline.\n */\nexport type DataSource = {\n /**\n * Discriminator.\n */\n type: \"data\";\n /**\n * The bytes, base64-encoded. contentEncoding is an annotation rather than a\n * constraint in 2020-12, so a malformed string still validates here;\n * rejecting one is the decoder's job.\n * @contentEncoding base64\n */\n value: string;\n /**\n * What the bytes are. Required here, unlike on a URL source, because nothing\n * else can tell a consumer how to read them.\n */\n mimeType: string;\n};\n\n/**\n * Bytes referenced by URL, fetched by whoever needs them.\n */\nexport type UrlSource = {\n /**\n * Discriminator.\n */\n type: \"url\";\n /**\n * The URL. Deliberately not constrained to a URI format, so a scheme a\n * producer already uses is not rejected here.\n */\n value: string;\n /**\n * What the resource is, when the producer knows. Optional, because the\n * response can say.\n */\n mimeType?: string;\n};\n\n/**\n * Bytes already at the provider, named by a handle the provider issued: an\n * OpenAI or Anthropic file id, a Gemini file URI, a storage URL only that\n * provider can read. No bytes travel and nothing is fetched. Only the provider\n * that minted the handle can resolve it; a peer that cannot drops the part as\n * it drops any part it cannot use.\n */\nexport type FileSource = {\n /**\n * Discriminator.\n */\n type: \"file\";\n /**\n * The handle, exactly as the provider issued it. Opaque: a consumer MUST NOT\n * fetch it, parse it or read a scheme out of it.\n */\n value: string;\n /**\n * Who issued the handle, when the producer knows. Optional: an agent already\n * knows which provider it talks to. When present, SHOULD be the lowercase\n * vendor id (openai, anthropic, google) that TokenUsage.provider uses, so a\n * peer can tell before sending whether a handle is one it can use.\n */\n provider?: string;\n /**\n * What the file is, when the producer knows. Optional, because the provider\n * that holds the bytes knows.\n */\n mimeType?: string;\n};\n\n/**\n * Where a media part's bytes come from: carried inline, referenced by URL, or\n * already at the provider under a handle it issued.\n */\nexport type PartSource = DataSource | UrlSource | FileSource;\n\n/**\n * An image part.\n */\nexport type ImagePart = {\n /**\n * Discriminator.\n */\n type: \"image\";\n /**\n * Identifies this part within its message. Optional, and nothing reads it\n * yet: reserved as on the text part.\n */\n id?: string;\n /**\n * Where the image comes from.\n */\n source: PartSource;\n /**\n * Extra information about this part. Unconstrained rather than an object:\n * inherited from the SDKs, which declare it unknown rather than a record;\n * listed under known divergences in the README rather than resolved here.\n */\n metadata?: any;\n};\n\n/**\n * An audio part.\n */\nexport type AudioPart = {\n /**\n * Discriminator.\n */\n type: \"audio\";\n /**\n * Identifies this part within its message. Optional, and nothing reads it\n * yet: reserved as on the text part.\n */\n id?: string;\n /**\n * Where the audio comes from.\n */\n source: PartSource;\n /**\n * Extra information about this part. Unconstrained, as on the other media\n * parts.\n */\n metadata?: any;\n};\n\n/**\n * A video part.\n */\nexport type VideoPart = {\n /**\n * Discriminator.\n */\n type: \"video\";\n /**\n * Identifies this part within its message. Optional, and nothing reads it\n * yet: reserved as on the text part.\n */\n id?: string;\n /**\n * Where the video comes from.\n */\n source: PartSource;\n /**\n * Extra information about this part. Unconstrained, as on the other media\n * parts.\n */\n metadata?: any;\n};\n\n/**\n * A document part.\n */\nexport type DocumentPart = {\n /**\n * Discriminator.\n */\n type: \"document\";\n /**\n * Identifies this part within its message. Optional, and nothing reads it\n * yet: reserved as on the text part.\n */\n id?: string;\n /**\n * Where the document comes from.\n */\n source: PartSource;\n /**\n * Extra information about this part. Unconstrained, as on the other media\n * parts.\n */\n metadata?: any;\n};\n\n/**\n * One part of a message body: what a person sends in a user message, or what a\n * tool returns in a tool message. Discriminated by type. Named by what the\n * part is rather than by direction, because the same part travels into the\n * model inside a user message and back out of the stream inside a tool result.\n */\nexport type ContentPart = TextPart | ImagePart | AudioPart | VideoPart | DocumentPart;\n\n/**\n * Carries what a tool returned. Mints a tool message rather than appending to\n * an existing one, which is why it has its own messageId.\n */\nexport type ToolCallResultEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.TOOL_CALL_RESULT;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The tool message this result becomes.\n */\n messageId: string;\n /**\n * The call being answered.\n */\n toolCallId: string;\n /**\n * What the tool returned: either plain text, or an ordered list of parts,\n * exactly as on the tool message this event mints. A tool returning\n * structured data serialises it into text; media travel as parts of their\n * own.\n */\n content: string | ContentPart[];\n /**\n * Present only for symmetry with the message it mints; the value is fixed,\n * so a producer may leave it out.\n */\n role?: \"tool\";\n};\n\n/**\n * Agent state. Any JSON value: the protocol carries state without interpreting\n * it, so an object, an array, a string and a number are all valid.\n */\nexport type State = any;\n\n/**\n * Replaces the agent state wholesale. Sent when a delta cannot express the\n * change, or to resynchronise a consumer.\n */\nexport type StateSnapshotEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.STATE_SNAPSHOT;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The complete new state.\n */\n snapshot: State;\n};\n\n/**\n * A JSON Pointer as defined by RFC 6901. Either the empty string, meaning the\n * whole document, or a sequence of slash-prefixed reference tokens in which a\n * tilde is escaped as ~0 and a slash as ~1. A value with no leading slash, or\n * a tilde followed by anything other than 0 or 1, is not a JSON Pointer.\n */\nexport type JsonPointer = string;\n\n/**\n * Inserts value at path. RFC 6902 section 4.1.\n */\nexport type AddOperation = {\n /**\n * Discriminator for the add operation.\n */\n op: \"add\";\n /**\n * Where to insert the value.\n */\n path: JsonPointer;\n /**\n * The value to insert. Any JSON value, including null, which is a legitimate\n * thing to add.\n */\n value: any;\n};\n\n/**\n * Removes the value at path. RFC 6902 section 4.2.\n */\nexport type RemoveOperation = {\n /**\n * Discriminator for the remove operation.\n */\n op: \"remove\";\n /**\n * What to remove.\n */\n path: JsonPointer;\n};\n\n/**\n * Replaces the value at path. RFC 6902 section 4.3.\n */\nexport type ReplaceOperation = {\n /**\n * Discriminator for the replace operation.\n */\n op: \"replace\";\n /**\n * What to replace.\n */\n path: JsonPointer;\n /**\n * The replacement. Any JSON value, including null.\n */\n value: any;\n};\n\n/**\n * Moves the value at from to path. RFC 6902 section 4.4.\n */\nexport type MoveOperation = {\n /**\n * Discriminator for the move operation.\n */\n op: \"move\";\n /**\n * Where the value is moved from.\n */\n from: JsonPointer;\n /**\n * Where the value is moved to.\n */\n path: JsonPointer;\n};\n\n/**\n * Copies the value at from to path. RFC 6902 section 4.5.\n */\nexport type CopyOperation = {\n /**\n * Discriminator for the copy operation.\n */\n op: \"copy\";\n /**\n * Where the value is copied from.\n */\n from: JsonPointer;\n /**\n * Where the value is copied to.\n */\n path: JsonPointer;\n};\n\n/**\n * Asserts that the value at path equals value. RFC 6902 section 4.6.\n */\nexport type TestOperation = {\n /**\n * Discriminator for the test operation.\n */\n op: \"test\";\n /**\n * What to compare.\n */\n path: JsonPointer;\n /**\n * The value the target must equal. Any JSON value, including null.\n */\n value: any;\n};\n\n/**\n * A single RFC 6902 operation. Exactly one of the operation shapes must match,\n * discriminated by op. Unlike the protocol's own objects, the operations are\n * open: RFC 6902 section 4 requires members an operation does not define to be\n * ignored rather than rejected, so a remove carrying a leftover value is a\n * valid patch. Two of the RFC's rules are relations between values rather than\n * shapes, so no static schema can express them and neither is checked here: a\n * move whose from is a proper prefix of its path (section 4.4), and any\n * operation whose pointer does not resolve in the target document. Both are\n * the applier's to reject.\n */\nexport type JsonPatchOperation =\n | AddOperation\n | RemoveOperation\n | ReplaceOperation\n | MoveOperation\n | CopyOperation\n | TestOperation;\n\n/**\n * A JSON Patch document as defined by RFC 6902, referenced by\n * STATE_DELTA.delta and ACTIVITY_DELTA.patch: an ordered sequence of\n * operations applied to a target document. An empty array is a valid no-op\n * patch. Whether the operations actually apply to the document they target is\n * a runtime question RFC 6902 leaves to the applier; structural validity here\n * says nothing about it.\n */\nexport type JsonPatch = JsonPatchOperation[];\n\n/**\n * Changes the agent state incrementally.\n */\nexport type StateDeltaEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.STATE_DELTA;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The change, as an RFC 6902 patch against the current state. Structural\n * validity here does not mean the patch applies: a well-formed operation may\n * point at a path that does not exist, which RFC 6902 leaves to the applier.\n */\n delta: JsonPatch;\n};\n\n/**\n * Instructions from the application developer.\n */\nexport type DeveloperMessage = {\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * Identifies the message within the conversation.\n */\n id: string;\n /**\n * Who the message is from. Each message definition narrows this to a single\n * value.\n */\n role: \"developer\";\n /**\n * An optional display name for the author.\n */\n name?: string;\n /**\n * A provider's opaque artefact belonging to this message, stored by a\n * consumer and returned on a later turn.\n */\n encryptedValue?: string;\n /**\n * Extra information attached to this message.\n */\n metadata?: Metadata;\n /**\n * The instructions. Required: a developer message with nothing in it says\n * nothing.\n */\n content: string;\n};\n\n/**\n * Instructions from the system.\n */\nexport type SystemMessage = {\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * Identifies the message within the conversation.\n */\n id: string;\n /**\n * Who the message is from. Each message definition narrows this to a single\n * value.\n */\n role: \"system\";\n /**\n * An optional display name for the author.\n */\n name?: string;\n /**\n * A provider's opaque artefact belonging to this message, stored by a\n * consumer and returned on a later turn.\n */\n encryptedValue?: string;\n /**\n * Extra information attached to this message.\n */\n metadata?: Metadata;\n /**\n * The instructions. Required.\n */\n content: string;\n};\n\n/**\n * The name and arguments of a tool call.\n */\nexport type FunctionCall = {\n /**\n * Which tool is being called.\n */\n name: string;\n /**\n * The arguments as a JSON string, not as parsed JSON. Kept as written\n * because a model can emit arguments that are not valid JSON, and losing\n * them at the protocol boundary would hide the fault from the consumer that\n * has to handle it.\n */\n arguments: string;\n};\n\n/**\n * A call an assistant message made. Carries no subagent attribution of its own\n * and inherits its containing message's, since several calls can share one\n * parent.\n */\nexport type ToolCall = {\n /**\n * Identifies the call. The answering tool message carries this as its\n * toolCallId.\n */\n id: string;\n /**\n * The only kind of call the protocol models.\n */\n type: \"function\";\n /**\n * What is being called, and with what.\n */\n function: FunctionCall;\n /**\n * A provider's opaque artefact belonging to this call.\n */\n encryptedValue?: string;\n /**\n * Extra information attached to this call. Carried here rather than folded\n * into the containing message, because several calls can share one parent\n * and merging them would make the result depend on their order.\n */\n metadata?: Metadata;\n};\n\n/**\n * A message from the agent. Content is optional because a turn may consist\n * only of tool calls.\n */\nexport type AssistantMessage = {\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * Identifies the message within the conversation.\n */\n id: string;\n /**\n * Who the message is from. Each message definition narrows this to a single\n * value.\n */\n role: \"assistant\";\n /**\n * An optional display name for the author.\n */\n name?: string;\n /**\n * A provider's opaque artefact belonging to this message, stored by a\n * consumer and returned on a later turn.\n */\n encryptedValue?: string;\n /**\n * Extra information attached to this message.\n */\n metadata?: Metadata;\n /**\n * What the agent said, if it said anything.\n */\n content?: string;\n /**\n * The tool calls this turn made.\n */\n toolCalls?: ToolCall[];\n};\n\n/**\n * A message from the person using the application.\n */\nexport type UserMessage = {\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * Identifies the message within the conversation.\n */\n id: string;\n /**\n * Who the message is from. Each message definition narrows this to a single\n * value.\n */\n role: \"user\";\n /**\n * An optional display name for the author.\n */\n name?: string;\n /**\n * A provider's opaque artefact belonging to this message, stored by a\n * consumer and returned on a later turn.\n */\n encryptedValue?: string;\n /**\n * Extra information attached to this message.\n */\n metadata?: Metadata;\n /**\n * What the person sent: either plain text, or an ordered list of parts for a\n * multimodal message.\n */\n content: string | ContentPart[];\n};\n\n/**\n * What a tool returned, as a message in the conversation. Stands alone rather\n * than composing BaseMessage, because it carries no name.\n */\nexport type ToolMessage = {\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * Identifies the message.\n */\n id: string;\n /**\n * Fixed. Declared here rather than inherited, because this message does not\n * compose BaseMessage.\n */\n role: \"tool\";\n /**\n * What the tool returned: either plain text, or an ordered list of parts. A\n * tool returning structured data serialises it into text; media travel as\n * parts of their own.\n */\n content: string | ContentPart[];\n /**\n * The call this answers.\n */\n toolCallId: string;\n /**\n * Why the tool failed, when it did. Present alongside content rather than\n * instead of it, so a partial result survives a failure.\n */\n error?: string;\n /**\n * A provider's opaque artefact belonging to this message.\n */\n encryptedValue?: string;\n /**\n * Extra information attached to this message.\n */\n metadata?: Metadata;\n};\n\n/**\n * Structured progress that is not conversation content, materialised as a\n * message so it keeps its place in the sequence. Stands alone rather than\n * composing BaseMessage, because its content is an object rather than a\n * string.\n */\nexport type ActivityMessage = {\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * Identifies the message.\n */\n id: string;\n /**\n * Fixed. Declared here rather than inherited, because this message does not\n * compose BaseMessage.\n */\n role: \"activity\";\n /**\n * What kind of activity this is. An open string: the set is the producer's.\n */\n activityType: string;\n /**\n * The activity's payload, open by key.\n */\n content: Record<string, any>;\n /**\n * Extra information attached to this message.\n */\n metadata?: Metadata;\n};\n\n/**\n * A span of the agent's reasoning, materialised as a message. Stands alone\n * rather than composing BaseMessage, because it carries no name.\n */\nexport type ReasoningMessage = {\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * Identifies the message.\n */\n id: string;\n /**\n * Fixed. Declared here rather than inherited, because this message does not\n * compose BaseMessage.\n */\n role: \"reasoning\";\n /**\n * The reasoning text.\n */\n content: string;\n /**\n * A provider's opaque reasoning artefact belonging to this message.\n */\n encryptedValue?: string;\n /**\n * Extra information attached to this message.\n */\n metadata?: Metadata;\n};\n\n/**\n * Any message in a conversation. Discriminated by role.\n */\nexport type Message =\n | DeveloperMessage\n | SystemMessage\n | AssistantMessage\n | UserMessage\n | ToolMessage\n | ActivityMessage\n | ReasoningMessage;\n\n/**\n * The complete set of messages the producer owns, in order. Conversation-wide\n * rather than a plain overwrite: a consumer may keep messages of its own that\n * no producer tracks, so exactly how a snapshot reconciles with those is\n * behavioural and belongs in the prose. Being conversation-wide it cannot\n * belong to a single subagent, so it carries no attribution; it does establish\n * which subagent owns each message it contains, through the messages\n * themselves.\n */\nexport type MessagesSnapshotEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.MESSAGES_SNAPSHOT;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The messages the producer is declaring, in order.\n */\n messages: Message[];\n};\n\n/**\n * Reports structured progress that is not conversation content, such as a step\n * a UI renders as its own widget.\n */\nexport type ActivitySnapshotEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.ACTIVITY_SNAPSHOT;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The activity message this describes.\n */\n messageId: string;\n /**\n * What kind of activity this is. An open string: the set is the producer's,\n * not the protocol's.\n */\n activityType: string;\n /**\n * The activity's payload, open by key.\n */\n content: Record<string, any>;\n /**\n * Whether this snapshot overwrites the activity's existing content. Absent\n * means it does, and that meaning is normative; only an explicit false asks\n * a consumer to leave what is already there. It does not ask for a merge —\n * ACTIVITY_DELTA is how content is changed incrementally. What a consumer\n * does with a non-overwriting snapshot is behavioural and belongs in the\n * prose.\n * @default true\n */\n replace?: boolean;\n};\n\n/**\n * Changes an activity message's content incrementally.\n */\nexport type ActivityDeltaEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.ACTIVITY_DELTA;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The activity message being changed.\n */\n messageId: string;\n /**\n * What kind of activity this is.\n */\n activityType: string;\n /**\n * The change, as an RFC 6902 patch against the activity's content.\n */\n patch: JsonPatch;\n};\n\n/**\n * Passes a provider-native event through untranslated, for consumers that need\n * detail the protocol does not model.\n */\nexport type RawEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.RAW;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The provider's own event. Any JSON value, and required: an event whose\n * only purpose is to carry this would say nothing without it.\n */\n event: any;\n /**\n * Which provider or framework the event came from.\n */\n source?: string;\n};\n\n/**\n * The protocol's extension point for an application's own events. Anything a\n * consumer does with one is outside the protocol.\n */\nexport type CustomEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.CUSTOM;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * What this custom event is. Required: without it a consumer cannot route\n * the value.\n */\n name: string;\n /**\n * The payload. Any JSON value, and required.\n */\n value: any;\n};\n\n/**\n * A tool the agent may call.\n */\nexport type Tool = {\n /**\n * The tool's name, as the agent will call it.\n */\n name: string;\n /**\n * What the tool does, for the agent to decide when to use it.\n */\n description: string;\n /**\n * A JSON Schema describing the tool's arguments. Carried opaquely: the\n * protocol does not constrain or validate it. Optional, because all three\n * SDKs already treat it that way and a tool that takes no arguments has\n * nothing to declare; an absent schema and an empty one mean the same thing\n * to an agent.\n */\n parameters?: any;\n /**\n * Extra information about the tool, for consumers that attach their own\n * rendering or routing information to it.\n */\n metadata?: Metadata;\n};\n\n/**\n * A named piece of ambient information given to the agent for the run,\n * distinct from the conversation.\n */\nexport type Context = {\n /**\n * What this context is, for the agent to interpret.\n */\n description: string;\n /**\n * The context itself.\n */\n value: string;\n};\n\n/**\n * An answer to one interrupt, sent on the run that continues from it.\n */\nexport type ResumeEntry = {\n /**\n * The interrupt being answered.\n */\n interruptId: string;\n /**\n * Whether the interrupt was answered or abandoned.\n */\n status: \"resolved\" | \"cancelled\";\n /**\n * The answer the agent asked for and will act on. Any JSON value.\n */\n payload?: any;\n /**\n * Envelope information about the response, such as signatures or routing\n * keys, as opposed to payload, which is the answer itself.\n */\n metadata?: Metadata;\n};\n\n/**\n * A request to run an agent. Also echoed back as RUN_STARTED.input. Only\n * threadId, runId and messages are required: those are the three the SDKs\n * already agree on, and for tools and context an absent key and an empty array\n * mean the same thing, so requiring them would catch nothing a producer could\n * get wrong. Requiredness above describes the wire; this TypeScript type\n * additionally requires every field the SDK materialises.\n */\nexport type RunAgentInput = {\n /**\n * The conversation this run belongs to.\n */\n threadId: string;\n /**\n * Identifies this run.\n */\n runId: string;\n /**\n * The protocol version this consumer speaks, such as \"1.0\". Absent means the\n * input was produced before the protocol carried a version — the versioning\n * rules in the prose govern what each side does with that. Sent in-band\n * rather than by the transport, so a recorded exchange stays\n * self-describing.\n */\n protocolVersion?: string;\n /**\n * The run that spawned this one.\n */\n parentRunId?: string;\n /**\n * The state the run starts from.\n */\n state?: State;\n /**\n * The conversation so far, in order.\n */\n messages: Message[];\n /**\n * The tools the agent may call. Absent means none. Optional on the wire; the\n * TypeScript SDK materialises an absent one as an empty list, so this type\n * requires it.\n */\n tools: Tool[];\n /**\n * Ambient information for the run. Absent means none. Optional on the wire;\n * the TypeScript SDK materialises an absent one as an empty list, so this\n * type requires it.\n */\n context: Context[];\n /**\n * Application-specific values passed through to the agent untouched. Any\n * JSON value.\n */\n forwardedProps?: any;\n /**\n * Answers to the interrupts that ended a previous run, when this run\n * continues from one.\n */\n resume?: ResumeEntry[];\n};\n\n/**\n * Opens a run. Run-scoped, so it carries no subagent attribution.\n */\nexport type RunStartedEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.RUN_STARTED;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The conversation this run belongs to.\n */\n threadId: string;\n /**\n * Identifies this run.\n */\n runId: string;\n /**\n * The protocol version this producer speaks, such as \"1.0\" — the producer's\n * own version, not an echo of the input's, which is what makes the pair a\n * negotiation: each side declares itself and the consumer sees a downgrade\n * the moment it happens. Absent means a producer from before the protocol\n * carried a version.\n */\n protocolVersion?: string;\n /**\n * The run that spawned this one, when an agent invokes another agent as a\n * separate run rather than as a subagent within one.\n */\n parentRunId?: string;\n /**\n * The request this run was started from, echoed back so a consumer that did\n * not make the request can still see what the agent was asked.\n */\n input?: RunAgentInput;\n};\n\n/**\n * The run completed. Equivalent to an absent outcome. Closed like every other\n * object, which is also what keeps it from carrying the suspended sibling's\n * interrupts — a success with an interrupt still pending would be a\n * contradiction, not an extension. A completed run may still have left\n * frontend tool calls for the application to answer; pendingToolCallIds names\n * them.\n */\nexport type RunFinishedSuccessOutcome = {\n /**\n * Discriminator.\n */\n type: \"success\";\n /**\n * The tool calls this run started and left unanswered — no TOOL_CALL_RESULT\n * in the run — for the application to answer in the next input's messages,\n * in the order they were made. Absent or empty means the producer named\n * none, and a consumer derives the list from the stream; otherwise it is the\n * list, and it agrees with the stream. On the success outcome rather than\n * the event because a run that stopped on a frontend tool call is a\n * completed run: whether the application continues the thread is its own\n * decision, so the producer reports what it knows and no more. Each item: A\n * tool call id, as carried by TOOL_CALL_START.\n */\n pendingToolCallIds?: string[];\n};\n\n/**\n * Something a run needs from outside before it can continue, such as an\n * approval or a missing value.\n */\nexport type Interrupt = {\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * Identifies the interrupt. A resume entry answers it by this id.\n */\n id: string;\n /**\n * Why the run stopped. An open string rather than an enumeration: the\n * protocol does not attempt to classify every reason an agent might need\n * input.\n */\n reason: string;\n /**\n * A human-readable prompt for whoever answers.\n */\n message?: string;\n /**\n * The tool call this interrupt concerns, when it is a tool approval.\n */\n toolCallId?: string;\n /**\n * A JSON Schema describing the answer this interrupt expects, so a consumer\n * can build a form for it. Carried opaquely: the protocol does not constrain\n * or validate it. Restricted to an object because TypeScript and Python both\n * declare it that way; .NET holds it as any JSON, and the ticket that\n * commissioned this schema lists it among the arbitrary-JSON fields.\n * Following the two that constrain it keeps the schema from accepting\n * documents the reference client rejects, at the cost of rejecting the\n * boolean schemas JSON Schema also permits — a bare true for \"any answer\".\n * Recorded as a known divergence rather than settled.\n */\n responseSchema?: Record<string, any>;\n /**\n * When the interrupt stops being answerable. Deliberately unconstrained\n * rather than a date-time format, because producers already disagree about\n * the representation and tightening it here would reject streams that work\n * today. The documented convention is ISO 8601, and a consumer comparing\n * this value will parse it as a date, so a value that is not one leaves the\n * interrupt looking permanently unexpired.\n */\n expiresAt?: string;\n /**\n * Extra information attached to this interrupt.\n */\n metadata?: Metadata;\n};\n\n/**\n * The run is paused, waiting for something outside it. Resuming means starting\n * a new run whose resume entries answer these interrupts.\n */\nexport type RunFinishedInterruptOutcome = {\n /**\n * Discriminator.\n */\n type: \"interrupt\";\n /**\n * What the run is waiting for. At least one: an interrupt outcome with\n * nothing to answer would leave a consumer with nothing to do.\n */\n interrupts: Interrupt[];\n};\n\n/**\n * The run was stopped before it completed, by whoever was running it, and did\n * not fail. Neither success nor interrupt: nothing was produced as a result,\n * and nothing is waited for, so the next run on the thread is an ordinary new\n * run rather than a resume. Closed like its siblings: a cancelled run has no\n * interrupts to carry. Named in the schema before 1.0 because an outcome a\n * consumer does not recognise is stripped and read as success — a cancellation\n * added later would reach every 1.0 consumer as a completed run.\n */\nexport type RunFinishedCancelledOutcome = {\n /**\n * Discriminator.\n */\n type: \"cancelled\";\n};\n\n/**\n * Why a run ended.\n */\nexport type RunFinishedOutcome =\n | RunFinishedSuccessOutcome\n | RunFinishedInterruptOutcome\n | RunFinishedCancelledOutcome;\n\n/**\n * Token counts for one provider and model, in the protocol's own accounting:\n * every count is either a total or a named part of one, so entries from\n * different providers add up without double-counting. inputTokens and\n * outputTokens are the totals; reasoningTokens, cachedInputTokens and\n * cacheWriteInputTokens are parts of them, never additions to them;\n * totalTokens is the two totals summed. Every field is a label or a number —\n * nothing content-bearing or identifying, no prompts, completions, messages,\n * or thread, run and user identifiers.\n */\nexport type TokenUsage = {\n /**\n * Which provider served the request.\n */\n provider?: string;\n /**\n * Which model served the request.\n */\n model?: string;\n /**\n * Every prompt token the call was charged for: tokens read from a provider\n * cache, tokens written to one, and audio or other non-text input all count\n * here. cachedInputTokens and cacheWriteInputTokens break this number down\n * and are never added to it — a provider that reports its cache counts\n * beside a smaller input count has them added in by the producer before the\n * entry leaves. Bounded like timestamp and for the same reason: a count\n * above the JSON safe-integer range does not survive a round trip, so a\n * consumer would silently read a different number than the producer wrote.\n */\n inputTokens?: number;\n /**\n * Every generated token, reasoning included where the provider distinguishes\n * it. reasoningTokens breaks this number down and is never added to it — a\n * provider that reports reasoning tokens beside a smaller completion count\n * has them added in by the producer.\n */\n outputTokens?: number;\n /**\n * inputTokens plus outputTokens, under the accounting above. A producer MAY\n * compute it rather than copy a provider's total, and copies a provider's\n * total only when that total counts the same way, so a consumer can read\n * this field as the sum of the other two.\n */\n totalTokens?: number;\n /**\n * Output tokens spent on reasoning, where the provider distinguishes them.\n * Part of outputTokens, not in addition to it.\n */\n reasoningTokens?: number;\n /**\n * Input tokens read from a provider cache. Part of inputTokens, not in\n * addition to it, and disjoint from cacheWriteInputTokens.\n */\n cachedInputTokens?: number;\n /**\n * Input tokens written to a provider cache on this call, where the provider\n * distinguishes them. Part of inputTokens, not in addition to it, and\n * disjoint from cachedInputTokens. Its own field because providers price a\n * cache write differently from a cache read, so a consumer computing cost\n * cannot do without it.\n */\n cacheWriteInputTokens?: number;\n};\n\n/**\n * Closes a run that did not fail. Run-scoped, so it carries no subagent\n * attribution.\n */\nexport type RunFinishedEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.RUN_FINISHED;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The conversation this run belongs to.\n */\n threadId: string;\n /**\n * The run being closed.\n */\n runId: string;\n /**\n * The run's return value, if it has one. Any JSON value.\n */\n result?: any;\n /**\n * Why the run ended. Absent means success, so every producer written before\n * outcomes existed is already conformant.\n */\n outcome?: RunFinishedOutcome;\n /**\n * Token usage for the run, one entry per provider and model, so a run that\n * invoked several models keeps them separate. A consumer that only wants\n * totals sums across the entries. The run is the accounting boundary: usage\n * covers every model call made within the run, calls made by its subagents\n * included; an agent invoked as a separate run under parentRunId reports its\n * own usage on its own terminal event; and a run that resumes an interrupted\n * one reports only the calls it made itself, not the interrupted run's.\n */\n usage?: TokenUsage[];\n};\n\n/**\n * Ends a run that failed. Run-scoped, so it carries no subagent attribution; a\n * subagent that fails without ending the run reports SUBAGENT_ERROR instead.\n */\nexport type RunErrorEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.RUN_ERROR;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * What went wrong, for a person to read.\n */\n message: string;\n /**\n * A machine-readable error code. An open string: the protocol defines no\n * vocabulary.\n */\n code?: string;\n /**\n * Token usage accrued before the failure, for a run that completed one or\n * more model calls before dying. Scoped as on RUN_FINISHED: the run's own\n * calls, subagents included.\n */\n usage?: TokenUsage[];\n};\n\n/**\n * Opens a named step within a run, for producers whose frameworks have a step\n * concept worth surfacing.\n */\nexport type StepStartedEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.STEP_STARTED;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The step's name. Identifies it: the matching STEP_FINISHED carries the\n * same name.\n */\n stepName: string;\n};\n\n/**\n * Closes a named step.\n */\nexport type StepFinishedEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.STEP_FINISHED;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The step being closed.\n */\n stepName: string;\n};\n\n/**\n * Opens a span of reasoning. A span may contain several reasoning messages.\n */\nexport type ReasoningStartEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.REASONING_START;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The span being opened.\n */\n messageId: string;\n};\n\n/**\n * Opens a streamed reasoning message.\n */\nexport type ReasoningMessageStartEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.REASONING_MESSAGE_START;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The reasoning message this stream builds.\n */\n messageId: string;\n /**\n * Fixed, and required rather than defaulted. The requirement is inherited\n * from the SDKs rather than chosen.\n */\n role: \"reasoning\";\n};\n\n/**\n * Appends a fragment to a streamed reasoning message.\n */\nexport type ReasoningMessageContentEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.REASONING_MESSAGE_CONTENT;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The reasoning message this fragment belongs to.\n */\n messageId: string;\n /**\n * The fragment to append. May be the empty string.\n */\n delta: string;\n};\n\n/**\n * Closes a streamed reasoning message.\n */\nexport type ReasoningMessageEndEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.REASONING_MESSAGE_END;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The reasoning message being closed.\n */\n messageId: string;\n};\n\n/**\n * A shorthand that stands in for a reasoning message's start, content and end\n * sequence.\n */\nexport type ReasoningMessageChunkEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.REASONING_MESSAGE_CHUNK;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The reasoning message this chunk belongs to. Absent continues the one\n * already open.\n */\n messageId?: string;\n /**\n * The fragment to append. May be the empty string.\n */\n delta?: string;\n};\n\n/**\n * Closes a span of reasoning.\n */\nexport type ReasoningEndEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.REASONING_END;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * The span being closed.\n */\n messageId: string;\n};\n\n/**\n * Whether a REASONING_ENCRYPTED_VALUE belongs to a message or to a tool call.\n */\nexport type ReasoningEncryptedValueSubtype = \"tool-call\" | \"message\";\n\n/**\n * Carries a provider's opaque, encrypted reasoning artefact, which a consumer\n * stores and returns on a later turn without being able to read it.\n */\nexport type ReasoningEncryptedValueEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.REASONING_ENCRYPTED_VALUE;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * What kind of thing entityId names, which decides where the value is\n * stored.\n */\n subtype: ReasoningEncryptedValueSubtype;\n /**\n * What the value belongs to: a message id or a tool call id, according to\n * subtype.\n */\n entityId: string;\n /**\n * The provider's opaque artefact.\n */\n encryptedValue: string;\n};\n\n/**\n * Announces that a subagent invocation has begun. Everything the subagent\n * produces afterwards is attributed by carrying its subagentRunId, so a\n * consumer can group the work without replaying the stream. Composed from\n * BaseEvent alone rather than Attributable, because here subagentRunId\n * identifies the subagent rather than attributing the event to one;\n * attribution to an enclosing subagent is parentSubagentRunId.\n */\nexport type SubagentStartedEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.SUBAGENT_STARTED;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The invocation being announced.\n */\n subagentRunId: SubagentRunId;\n /**\n * The subagent's name, which is reusable across invocations, unlike\n * subagentRunId.\n */\n name: string;\n /**\n * What this subagent is for, for a consumer to display.\n */\n description?: string;\n /**\n * The subagent invocation that spawned this one, for nested delegation.\n * Absent means the parent agent spawned it directly.\n */\n parentSubagentRunId?: SubagentRunId;\n /**\n * The tool call that spawned this subagent, for the pattern where agents are\n * exposed to a model as tools. Lets a consumer tie the subagent to the call\n * without reading rawEvent.\n */\n parentToolCallId?: string;\n /**\n * The message that held the spawning tool call.\n */\n parentMessageId?: string;\n};\n\n/**\n * The subagent completed its work. Equivalent to an absent outcome.\n */\nexport type SubagentFinishedSuccessOutcome = {\n /**\n * Discriminator.\n */\n type: \"success\";\n};\n\n/**\n * The subagent is paused awaiting outside input. Terminal for this stream, not\n * for the subagent: a later run may continue the same invocation once the\n * interrupts are answered.\n */\nexport type SubagentFinishedSuspendedOutcome = {\n /**\n * Discriminator.\n */\n type: \"suspended\";\n /**\n * The run-level interrupts this subagent raised itself. May be empty or\n * absent: a subagent suspended because a descendant interrupted owns no\n * interrupt of its own. Each item: An Interrupt.id.\n */\n interruptIds?: string[];\n};\n\n/**\n * Why a subagent's segment of a run ended. Mirrors RunFinishedOutcome one\n * level down.\n */\nexport type SubagentFinishedOutcome =\n | SubagentFinishedSuccessOutcome\n | SubagentFinishedSuspendedOutcome;\n\n/**\n * Ends a subagent invocation's segment of this run, either because the work\n * completed or because it is suspended awaiting outside input.\n */\nexport type SubagentFinishedEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.SUBAGENT_FINISHED;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The invocation being closed.\n */\n subagentRunId: SubagentRunId;\n /**\n * The subagent's return value, if it has one. Any JSON value, mirroring\n * RUN_FINISHED.result.\n */\n result?: any;\n /**\n * Why the segment ended. Absent means success. A suspended subagent is\n * neither a success nor a failure, which is why saying so needs its own\n * value rather than being inferred from a later interrupt.\n */\n outcome?: SubagentFinishedOutcome;\n};\n\n/**\n * Reports that a subagent invocation failed. The run may continue: a parent\n * agent is free to handle a failed subagent, which is why this is not\n * RUN_ERROR.\n */\nexport type SubagentErrorEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType.SUBAGENT_ERROR;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n /**\n * The invocation that failed.\n */\n subagentRunId: SubagentRunId;\n /**\n * What went wrong, for a person to read.\n */\n message: string;\n /**\n * A machine-readable error code. An open string.\n */\n code?: string;\n};\n\n/**\n * Any AG-UI event. Every member is normative: there is no optional tier and no\n * event a consumer may decline to implement. Discriminated by the type\n * property.\n */\nexport type Event =\n | TextMessageStartEvent\n | TextMessageContentEvent\n | TextMessageEndEvent\n | TextMessageChunkEvent\n | ToolCallStartEvent\n | ToolCallArgsEvent\n | ToolCallEndEvent\n | ToolCallChunkEvent\n | ToolCallResultEvent\n | StateSnapshotEvent\n | StateDeltaEvent\n | MessagesSnapshotEvent\n | ActivitySnapshotEvent\n | ActivityDeltaEvent\n | RawEvent\n | CustomEvent\n | RunStartedEvent\n | RunFinishedEvent\n | RunErrorEvent\n | StepStartedEvent\n | StepFinishedEvent\n | ReasoningStartEvent\n | ReasoningMessageStartEvent\n | ReasoningMessageContentEvent\n | ReasoningMessageEndEvent\n | ReasoningMessageChunkEvent\n | ReasoningEndEvent\n | ReasoningEncryptedValueEvent\n | SubagentStartedEvent\n | SubagentFinishedEvent\n | SubagentErrorEvent;\n\n/**\n * Every role a materialised message may have.\n */\nexport type Role =\n | \"developer\"\n | \"system\"\n | \"assistant\"\n | \"user\"\n | \"tool\"\n | \"activity\"\n | \"reasoning\";\n\n/**\n * Describes a subagent that can be invoked by a parent agent.\n */\nexport type SubagentInfo = {\n /**\n * Unique name or identifier of the subagent.\n */\n name: string;\n /**\n * What this subagent specializes in. Helps clients build agent selection\n * UIs.\n */\n description?: string;\n};\n\n/**\n * Basic metadata about the agent. Useful for discovery UIs, agent\n * marketplaces, and debugging. Set these when you want clients to display\n * agent information or when multiple agents are available and users need to\n * pick one.\n */\nexport type IdentityCapabilities = {\n /**\n * Human-readable name shown in UIs and agent selectors.\n */\n name?: string;\n /**\n * The framework or platform powering this agent (e.g., \"langgraph\",\n * \"mastra\", \"crewai\").\n */\n type?: string;\n /**\n * What this agent does — helps users and routing logic decide when to use\n * it.\n */\n description?: string;\n /**\n * Semantic version of the agent (e.g., \"1.2.0\"). Useful for compatibility\n * checks.\n */\n version?: string;\n /**\n * Organization or team that maintains this agent.\n */\n provider?: string;\n /**\n * URL to the agent's documentation or homepage.\n */\n documentationUrl?: string;\n /**\n * Arbitrary key-value pairs for integration-specific identity info.\n */\n metadata?: Metadata;\n};\n\n/**\n * Declares which transport mechanisms the agent supports. Clients use this to\n * pick the best connection strategy. Only set flags to true for transports\n * your agent actually handles — omit or set false for unsupported ones.\n */\nexport type TransportCapabilities = {\n /**\n * Set true if the agent streams responses via SSE. Most agents enable this.\n */\n streaming?: boolean;\n /**\n * Set true if the agent accepts persistent WebSocket connections.\n */\n websocket?: boolean;\n /**\n * Set true if the agent supports the AG-UI binary protocol (protobuf over\n * HTTP).\n */\n httpBinary?: boolean;\n /**\n * Set true if the agent can send async updates via webhooks after a run\n * finishes.\n */\n pushNotifications?: boolean;\n /**\n * Set true if the agent supports resuming interrupted streams via sequence\n * numbers.\n */\n resumable?: boolean;\n};\n\n/**\n * Tool calling capabilities. Distinguishes between tools the agent itself\n * provides (listed in items) and tools the client passes at runtime via\n * RunAgentInput.tools. Enable this when your agent can call functions, search\n * the web, execute code, etc.\n */\nexport type ToolsCapabilities = {\n /**\n * Set true if the agent can make tool calls at all. Set false to explicitly\n * signal tool calling is disabled even if items are present.\n */\n supported?: boolean;\n /**\n * The tools this agent provides on its own (full JSON Schema definitions).\n * These are distinct from client-provided tools passed in\n * RunAgentInput.tools.\n */\n items?: Tool[];\n /**\n * Set true if the agent can invoke multiple tools concurrently within a\n * single step.\n */\n parallelCalls?: boolean;\n /**\n * Set true if the agent accepts and uses tools provided by the client at\n * runtime.\n */\n clientProvided?: boolean;\n};\n\n/**\n * Output format support. Enable structuredOutput when your agent can return\n * responses conforming to a JSON schema, which is useful for programmatic\n * consumption.\n */\nexport type OutputCapabilities = {\n /**\n * Set true if the agent can produce structured JSON output matching a\n * provided schema.\n */\n structuredOutput?: boolean;\n /**\n * MIME types the agent can produce (e.g., [\"text/plain\",\n * \"application/json\"]). Omit if the agent only produces plain text.\n */\n supportedMimeTypes?: string[];\n};\n\n/**\n * State and memory management capabilities. These tell the client how the\n * agent handles shared state and whether conversation context persists across\n * runs.\n */\nexport type StateCapabilities = {\n /**\n * Set true if the agent emits STATE_SNAPSHOT events (full state\n * replacement).\n */\n snapshots?: boolean;\n /**\n * Set true if the agent emits STATE_DELTA events (JSON Patch incremental\n * updates).\n */\n deltas?: boolean;\n /**\n * Set true if the agent has long-term memory beyond the current thread\n * (e.g., vector store, knowledge base, or cross-session recall).\n */\n memory?: boolean;\n /**\n * Set true if state is preserved across multiple runs within the same\n * thread. When false, state resets on each run.\n */\n persistentState?: boolean;\n};\n\n/**\n * Multi-agent coordination capabilities. Enable these when your agent can\n * orchestrate or hand off work to other agents.\n */\nexport type MultiAgentCapabilities = {\n /**\n * Set true if the agent participates in any form of multi-agent\n * coordination.\n */\n supported?: boolean;\n /**\n * Set true if the agent can delegate subtasks to other agents while\n * retaining control.\n */\n delegation?: boolean;\n /**\n * Set true if the agent can transfer the conversation entirely to another\n * agent.\n */\n handoffs?: boolean;\n /**\n * List of subagents this agent can invoke. Helps clients build agent\n * selection UIs.\n */\n subagents?: SubagentInfo[];\n};\n\n/**\n * Reasoning and thinking capabilities. Enable these when your agent exposes\n * its internal thought process (e.g., chain-of-thought, extended thinking).\n */\nexport type ReasoningCapabilities = {\n /**\n * Set true if the agent produces reasoning/thinking tokens visible to the\n * client.\n */\n supported?: boolean;\n /**\n * Set true if reasoning tokens are streamed incrementally (vs. returned all\n * at once).\n */\n streaming?: boolean;\n /**\n * Set true if reasoning content is encrypted (zero-data-retention mode).\n * Clients should expect opaque encryptedValue fields instead of readable\n * content.\n */\n encrypted?: boolean;\n};\n\n/**\n * Modalities the agent can accept as input. Clients use this to show or hide\n * file upload buttons, audio recorders, image pickers, etc.\n */\nexport type MultimodalInputCapabilities = {\n /**\n * Set true if the agent can process image inputs (e.g., screenshots,\n * photos).\n */\n image?: boolean;\n /**\n * Set true if the agent can process audio inputs (speech, recordings).\n */\n audio?: boolean;\n /**\n * Set true if the agent can process video inputs.\n */\n video?: boolean;\n /**\n * Set true if the agent can process PDF documents.\n */\n pdf?: boolean;\n /**\n * Set true if the agent can process arbitrary file uploads: files of a kind\n * the image, audio, video and document parts do not cover. Says nothing\n * about how a file arrives; a part's source (inline, URL or provider handle)\n * is a separate question.\n */\n file?: boolean;\n};\n\n/**\n * Modalities the agent can produce as output. Clients use this to anticipate\n * rich content in the agent's response.\n */\nexport type MultimodalOutputCapabilities = {\n /**\n * Set true if the agent can generate images as part of its response.\n */\n image?: boolean;\n /**\n * Set true if the agent can produce audio output (text-to-speech, audio\n * files).\n */\n audio?: boolean;\n};\n\n/**\n * Multimodal input and output support. Organized into input and output\n * sub-objects so clients can independently query what the agent accepts versus\n * what it produces.\n */\nexport type MultimodalCapabilities = {\n /**\n * Modalities the agent can accept as input (images, audio, video, PDFs,\n * files).\n */\n input?: MultimodalInputCapabilities;\n /**\n * Modalities the agent can produce as output (images, audio).\n */\n output?: MultimodalOutputCapabilities;\n};\n\n/**\n * Execution control and limits. Declare these so clients can set expectations\n * about how long or how many steps an agent run might take.\n */\nexport type ExecutionCapabilities = {\n /**\n * Set true if the agent can execute code (e.g., Python, JavaScript) during a\n * run.\n */\n codeExecution?: boolean;\n /**\n * Set true if code execution happens in a sandboxed or isolated environment.\n * Only meaningful when codeExecution is true.\n */\n sandboxed?: boolean;\n /**\n * Maximum number of tool-call/reasoning iterations the agent will perform\n * per run. Helps clients display progress or set timeout expectations.\n */\n maxIterations?: number;\n /**\n * Maximum wall-clock time (in milliseconds) the agent will run before timing\n * out.\n */\n maxExecutionTime?: number;\n};\n\n/**\n * Human-in-the-loop interaction support. Enable these when your agent can\n * pause execution to request human input, approval, or feedback before\n * continuing.\n */\nexport type HumanInTheLoopCapabilities = {\n /**\n * Set true if the agent supports any form of human-in-the-loop interaction.\n */\n supported?: boolean;\n /**\n * Set true if the agent can pause and request explicit approval before\n * performing sensitive actions (e.g., sending emails, deleting data).\n */\n approvals?: boolean;\n /**\n * Set true if the agent allows humans to intervene and modify its plan\n * mid-execution.\n */\n interventions?: boolean;\n /**\n * Set true if the agent can incorporate user feedback (thumbs up/down,\n * corrections) to improve its behavior within the current session.\n */\n feedback?: boolean;\n /**\n * Set true if the agent participates in the AG-UI interrupt protocol: it\n * ends a run with RUN_FINISHED carrying an interrupt outcome, and accepts\n * the answers back in RunAgentInput.resume.\n */\n interrupts?: boolean;\n /**\n * Set true if tool-call interrupts accept editedArgs in the resume payload.\n * Only meaningful when interrupts is true.\n */\n approveWithEdits?: boolean;\n};\n\n/**\n * A typed, categorized snapshot of an agent's current capabilities. All fields\n * are optional — agents only declare what they support. An omitted field means\n * the capability is not declared (unknown), not that it is unsupported. The\n * custom field is an escape hatch for integration-specific capabilities that\n * do not fit into the standard categories.\n */\nexport type AgentCapabilities = {\n /**\n * Agent identity and metadata.\n */\n identity?: IdentityCapabilities;\n /**\n * Supported transport mechanisms (SSE, WebSocket, binary, etc.).\n */\n transport?: TransportCapabilities;\n /**\n * Tools the agent provides and tool calling configuration.\n */\n tools?: ToolsCapabilities;\n /**\n * Output format support (structured output, MIME types).\n */\n output?: OutputCapabilities;\n /**\n * State and memory management (snapshots, deltas, persistence).\n */\n state?: StateCapabilities;\n /**\n * Multi-agent coordination (delegation, handoffs, subagents).\n */\n multiAgent?: MultiAgentCapabilities;\n /**\n * Reasoning and thinking support (chain-of-thought, encrypted thinking).\n */\n reasoning?: ReasoningCapabilities;\n /**\n * Multimodal input/output support (images, audio, video, files).\n */\n multimodal?: MultimodalCapabilities;\n /**\n * Execution control and limits (code execution, timeouts, iteration caps).\n */\n execution?: ExecutionCapabilities;\n /**\n * Human-in-the-loop support (approvals, interventions, feedback).\n */\n humanInTheLoop?: HumanInTheLoopCapabilities;\n /**\n * Integration-specific capabilities not covered by the standard categories.\n * Open by key: any JSON value is allowed under a key, because the categories\n * above cannot anticipate what an integration declares.\n */\n custom?: Record<string, any>;\n};\n\n/**\n * Composed into everything that can belong to a subagent's work: the events\n * that describe content or progress, the message types, and each interrupt.\n * Run-scoped events omit it — RUN_STARTED, RUN_FINISHED and RUN_ERROR describe\n * the run itself and MESSAGES_SNAPSHOT is conversation-wide, so none of them\n * can belong to one subagent. A tool call omits it too and inherits its\n * containing message's attribution.\n */\nexport type Attributable = {\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n};\n\n/**\n * The fields every event carries, whatever its type. Composed into each event\n * definition rather than repeated, so a change here reaches every event at\n * once.\n */\nexport type BaseEvent = {\n /**\n * Which event this is. Each event definition narrows this to a single value.\n */\n type: EventType;\n /**\n * When the event was created. Bounded to the range JSON numbers survive a\n * round trip in, so the value a consumer reads is the value the producer\n * wrote. Deliberately not a float. The unit is not constrained here, because\n * it never has been stated normatively; every SDK that sets it in practice\n * uses milliseconds since the Unix epoch, and a producer choosing another\n * unit will be misread by consumers even though it validates. Nothing in the\n * protocol computes with this value.\n */\n timestamp?: number;\n /**\n * The provider-native event this one was translated from, carried verbatim\n * for debugging and for consumers that need detail the protocol does not\n * model. Any JSON value.\n */\n rawEvent?: any;\n /**\n * Extra information attached to this event.\n */\n metadata?: Metadata;\n};\n\n/**\n * The fields shared by the developer, system, assistant and user messages.\n * Deliberately excludes content, because a user message's content may be an\n * array while the others are strings, and composition here intersects rather\n * than overrides: a base that constrained content to a string would make an\n * array content invalid. The tool, activity and reasoning messages do not\n * compose this, because they carry no name.\n */\nexport type BaseMessage = {\n /**\n * The subagent invocation this belongs to. Absent means the parent agent\n * produced it directly.\n */\n subagentRunId?: SubagentRunId;\n /**\n * Identifies the message within the conversation.\n */\n id: string;\n /**\n * Who the message is from. Each message definition narrows this to a single\n * value.\n */\n role: string;\n /**\n * An optional display name for the author.\n */\n name?: string;\n /**\n * A provider's opaque artefact belonging to this message, stored by a\n * consumer and returned on a later turn.\n */\n encryptedValue?: string;\n /**\n * Extra information attached to this message.\n */\n metadata?: Metadata;\n};\n","// @generated by spec/generator — DO NOT EDIT.\n// Source: https://ag-ui.com/spec/1.0/schema.json\n// Regenerate: pnpm --filter @ag-ui/spec generate\n/* eslint-disable */\n\n/**\n * The protocol version this code was generated from: the version segment of\n * the schema's $id (https://ag-ui.com/spec/1.0/schema.json). Never typed by a\n * human.\n */\nexport const PROTOCOL_VERSION = \"1.0\";\n"],"mappings":";;;;;AAQA,IAAY,gDAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC7BF,MAAa,mBAAmB"}