@ag-ui/core 0.0.44 → 0.0.45-alpha.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.
package/dist/index.d.mts CHANGED
@@ -1000,6 +1000,16 @@ declare class AGUIError extends Error {
1000
1000
  declare class AGUIConnectNotImplementedError extends AGUIError {
1001
1001
  constructor();
1002
1002
  }
1003
+ interface RunHistory {
1004
+ runId: string;
1005
+ messages: Message[];
1006
+ }
1007
+ interface FetchRunHistoryResult {
1008
+ runs: RunHistory[];
1009
+ }
1010
+ interface FetchRunHistoryOptions {
1011
+ threadId: string;
1012
+ }
1003
1013
 
1004
1014
  declare enum EventType {
1005
1015
  TEXT_MESSAGE_START = "TEXT_MESSAGE_START",
@@ -5741,4 +5751,4 @@ type RunErrorEvent = z.infer<typeof RunErrorEventSchema>;
5741
5751
  type StepStartedEvent = z.infer<typeof StepStartedEventSchema>;
5742
5752
  type StepFinishedEvent = z.infer<typeof StepFinishedEventSchema>;
5743
5753
 
5744
- export { AGUIConnectNotImplementedError, AGUIError, type AGUIEvent, type AGUIEventByType, type AGUIEventOf, type ActivityDeltaEvent, type ActivityDeltaEventProps, ActivityDeltaEventSchema, type ActivityMessage, ActivityMessageSchema, type ActivitySnapshotEvent, type ActivitySnapshotEventProps, ActivitySnapshotEventSchema, type AssistantMessage, AssistantMessageSchema, type BaseEvent, type BaseEventFields, type BaseEventProps, BaseEventSchema, BaseMessageSchema, type BinaryInputContent, BinaryInputContentSchema, type Context, ContextSchema, type CustomEvent, type CustomEventProps, CustomEventSchema, type DeveloperMessage, DeveloperMessageSchema, type EventPayloadOf, EventSchemas, EventType, type FunctionCall, FunctionCallSchema, type InputContent, InputContentSchema, type Message, MessageSchema, type MessagesSnapshotEvent, type MessagesSnapshotEventProps, MessagesSnapshotEventSchema, type RawEvent, type RawEventProps, RawEventSchema, type Role, RoleSchema, type RunAgentInput, RunAgentInputSchema, type RunErrorEvent, type RunErrorEventProps, RunErrorEventSchema, type RunFinishedEvent, type RunFinishedEventProps, RunFinishedEventSchema, type RunStartedEvent, type RunStartedEventProps, RunStartedEventSchema, type State, type StateDeltaEvent, type StateDeltaEventProps, StateDeltaEventSchema, StateSchema, type StateSnapshotEvent, type StateSnapshotEventProps, StateSnapshotEventSchema, type StepFinishedEvent, type StepFinishedEventProps, StepFinishedEventSchema, type StepStartedEvent, type StepStartedEventProps, StepStartedEventSchema, type SystemMessage, SystemMessageSchema, type TextInputContent, TextInputContentSchema, type TextMessageChunkEvent, type TextMessageChunkEventProps, TextMessageChunkEventSchema, type TextMessageContentEvent, type TextMessageContentEventProps, TextMessageContentEventSchema, type TextMessageEndEvent, type TextMessageEndEventProps, TextMessageEndEventSchema, type TextMessageStartEvent, type TextMessageStartEventProps, TextMessageStartEventSchema, type ThinkingEndEvent, type ThinkingEndEventProps, ThinkingEndEventSchema, type ThinkingStartEvent, type ThinkingStartEventProps, ThinkingStartEventSchema, type ThinkingTextMessageContentEvent, type ThinkingTextMessageContentEventProps, ThinkingTextMessageContentEventSchema, type ThinkingTextMessageEndEvent, type ThinkingTextMessageEndEventProps, ThinkingTextMessageEndEventSchema, type ThinkingTextMessageStartEvent, type ThinkingTextMessageStartEventProps, ThinkingTextMessageStartEventSchema, type Tool, type ToolCall, type ToolCallArgsEvent, type ToolCallArgsEventProps, ToolCallArgsEventSchema, type ToolCallChunkEvent, type ToolCallChunkEventProps, ToolCallChunkEventSchema, type ToolCallEndEvent, type ToolCallEndEventProps, ToolCallEndEventSchema, type ToolCallResultEvent, type ToolCallResultEventProps, ToolCallResultEventSchema, ToolCallSchema, type ToolCallStartEvent, type ToolCallStartEventProps, ToolCallStartEventSchema, type ToolMessage, ToolMessageSchema, ToolSchema, type UserMessage, UserMessageSchema };
5754
+ export { AGUIConnectNotImplementedError, AGUIError, type AGUIEvent, type AGUIEventByType, type AGUIEventOf, type ActivityDeltaEvent, type ActivityDeltaEventProps, ActivityDeltaEventSchema, type ActivityMessage, ActivityMessageSchema, type ActivitySnapshotEvent, type ActivitySnapshotEventProps, ActivitySnapshotEventSchema, type AssistantMessage, AssistantMessageSchema, type BaseEvent, type BaseEventFields, type BaseEventProps, BaseEventSchema, BaseMessageSchema, type BinaryInputContent, BinaryInputContentSchema, type Context, ContextSchema, type CustomEvent, type CustomEventProps, CustomEventSchema, type DeveloperMessage, DeveloperMessageSchema, type EventPayloadOf, EventSchemas, EventType, type FetchRunHistoryOptions, type FetchRunHistoryResult, type FunctionCall, FunctionCallSchema, type InputContent, InputContentSchema, type Message, MessageSchema, type MessagesSnapshotEvent, type MessagesSnapshotEventProps, MessagesSnapshotEventSchema, type RawEvent, type RawEventProps, RawEventSchema, type Role, RoleSchema, type RunAgentInput, RunAgentInputSchema, type RunErrorEvent, type RunErrorEventProps, RunErrorEventSchema, type RunFinishedEvent, type RunFinishedEventProps, RunFinishedEventSchema, type RunHistory, type RunStartedEvent, type RunStartedEventProps, RunStartedEventSchema, type State, type StateDeltaEvent, type StateDeltaEventProps, StateDeltaEventSchema, StateSchema, type StateSnapshotEvent, type StateSnapshotEventProps, StateSnapshotEventSchema, type StepFinishedEvent, type StepFinishedEventProps, StepFinishedEventSchema, type StepStartedEvent, type StepStartedEventProps, StepStartedEventSchema, type SystemMessage, SystemMessageSchema, type TextInputContent, TextInputContentSchema, type TextMessageChunkEvent, type TextMessageChunkEventProps, TextMessageChunkEventSchema, type TextMessageContentEvent, type TextMessageContentEventProps, TextMessageContentEventSchema, type TextMessageEndEvent, type TextMessageEndEventProps, TextMessageEndEventSchema, type TextMessageStartEvent, type TextMessageStartEventProps, TextMessageStartEventSchema, type ThinkingEndEvent, type ThinkingEndEventProps, ThinkingEndEventSchema, type ThinkingStartEvent, type ThinkingStartEventProps, ThinkingStartEventSchema, type ThinkingTextMessageContentEvent, type ThinkingTextMessageContentEventProps, ThinkingTextMessageContentEventSchema, type ThinkingTextMessageEndEvent, type ThinkingTextMessageEndEventProps, ThinkingTextMessageEndEventSchema, type ThinkingTextMessageStartEvent, type ThinkingTextMessageStartEventProps, ThinkingTextMessageStartEventSchema, type Tool, type ToolCall, type ToolCallArgsEvent, type ToolCallArgsEventProps, ToolCallArgsEventSchema, type ToolCallChunkEvent, type ToolCallChunkEventProps, ToolCallChunkEventSchema, type ToolCallEndEvent, type ToolCallEndEventProps, ToolCallEndEventSchema, type ToolCallResultEvent, type ToolCallResultEventProps, ToolCallResultEventSchema, ToolCallSchema, type ToolCallStartEvent, type ToolCallStartEventProps, ToolCallStartEventSchema, type ToolMessage, ToolMessageSchema, ToolSchema, type UserMessage, UserMessageSchema };
package/dist/index.d.ts CHANGED
@@ -1000,6 +1000,16 @@ declare class AGUIError extends Error {
1000
1000
  declare class AGUIConnectNotImplementedError extends AGUIError {
1001
1001
  constructor();
1002
1002
  }
1003
+ interface RunHistory {
1004
+ runId: string;
1005
+ messages: Message[];
1006
+ }
1007
+ interface FetchRunHistoryResult {
1008
+ runs: RunHistory[];
1009
+ }
1010
+ interface FetchRunHistoryOptions {
1011
+ threadId: string;
1012
+ }
1003
1013
 
1004
1014
  declare enum EventType {
1005
1015
  TEXT_MESSAGE_START = "TEXT_MESSAGE_START",
@@ -5741,4 +5751,4 @@ type RunErrorEvent = z.infer<typeof RunErrorEventSchema>;
5741
5751
  type StepStartedEvent = z.infer<typeof StepStartedEventSchema>;
5742
5752
  type StepFinishedEvent = z.infer<typeof StepFinishedEventSchema>;
5743
5753
 
5744
- export { AGUIConnectNotImplementedError, AGUIError, type AGUIEvent, type AGUIEventByType, type AGUIEventOf, type ActivityDeltaEvent, type ActivityDeltaEventProps, ActivityDeltaEventSchema, type ActivityMessage, ActivityMessageSchema, type ActivitySnapshotEvent, type ActivitySnapshotEventProps, ActivitySnapshotEventSchema, type AssistantMessage, AssistantMessageSchema, type BaseEvent, type BaseEventFields, type BaseEventProps, BaseEventSchema, BaseMessageSchema, type BinaryInputContent, BinaryInputContentSchema, type Context, ContextSchema, type CustomEvent, type CustomEventProps, CustomEventSchema, type DeveloperMessage, DeveloperMessageSchema, type EventPayloadOf, EventSchemas, EventType, type FunctionCall, FunctionCallSchema, type InputContent, InputContentSchema, type Message, MessageSchema, type MessagesSnapshotEvent, type MessagesSnapshotEventProps, MessagesSnapshotEventSchema, type RawEvent, type RawEventProps, RawEventSchema, type Role, RoleSchema, type RunAgentInput, RunAgentInputSchema, type RunErrorEvent, type RunErrorEventProps, RunErrorEventSchema, type RunFinishedEvent, type RunFinishedEventProps, RunFinishedEventSchema, type RunStartedEvent, type RunStartedEventProps, RunStartedEventSchema, type State, type StateDeltaEvent, type StateDeltaEventProps, StateDeltaEventSchema, StateSchema, type StateSnapshotEvent, type StateSnapshotEventProps, StateSnapshotEventSchema, type StepFinishedEvent, type StepFinishedEventProps, StepFinishedEventSchema, type StepStartedEvent, type StepStartedEventProps, StepStartedEventSchema, type SystemMessage, SystemMessageSchema, type TextInputContent, TextInputContentSchema, type TextMessageChunkEvent, type TextMessageChunkEventProps, TextMessageChunkEventSchema, type TextMessageContentEvent, type TextMessageContentEventProps, TextMessageContentEventSchema, type TextMessageEndEvent, type TextMessageEndEventProps, TextMessageEndEventSchema, type TextMessageStartEvent, type TextMessageStartEventProps, TextMessageStartEventSchema, type ThinkingEndEvent, type ThinkingEndEventProps, ThinkingEndEventSchema, type ThinkingStartEvent, type ThinkingStartEventProps, ThinkingStartEventSchema, type ThinkingTextMessageContentEvent, type ThinkingTextMessageContentEventProps, ThinkingTextMessageContentEventSchema, type ThinkingTextMessageEndEvent, type ThinkingTextMessageEndEventProps, ThinkingTextMessageEndEventSchema, type ThinkingTextMessageStartEvent, type ThinkingTextMessageStartEventProps, ThinkingTextMessageStartEventSchema, type Tool, type ToolCall, type ToolCallArgsEvent, type ToolCallArgsEventProps, ToolCallArgsEventSchema, type ToolCallChunkEvent, type ToolCallChunkEventProps, ToolCallChunkEventSchema, type ToolCallEndEvent, type ToolCallEndEventProps, ToolCallEndEventSchema, type ToolCallResultEvent, type ToolCallResultEventProps, ToolCallResultEventSchema, ToolCallSchema, type ToolCallStartEvent, type ToolCallStartEventProps, ToolCallStartEventSchema, type ToolMessage, ToolMessageSchema, ToolSchema, type UserMessage, UserMessageSchema };
5754
+ export { AGUIConnectNotImplementedError, AGUIError, type AGUIEvent, type AGUIEventByType, type AGUIEventOf, type ActivityDeltaEvent, type ActivityDeltaEventProps, ActivityDeltaEventSchema, type ActivityMessage, ActivityMessageSchema, type ActivitySnapshotEvent, type ActivitySnapshotEventProps, ActivitySnapshotEventSchema, type AssistantMessage, AssistantMessageSchema, type BaseEvent, type BaseEventFields, type BaseEventProps, BaseEventSchema, BaseMessageSchema, type BinaryInputContent, BinaryInputContentSchema, type Context, ContextSchema, type CustomEvent, type CustomEventProps, CustomEventSchema, type DeveloperMessage, DeveloperMessageSchema, type EventPayloadOf, EventSchemas, EventType, type FetchRunHistoryOptions, type FetchRunHistoryResult, type FunctionCall, FunctionCallSchema, type InputContent, InputContentSchema, type Message, MessageSchema, type MessagesSnapshotEvent, type MessagesSnapshotEventProps, MessagesSnapshotEventSchema, type RawEvent, type RawEventProps, RawEventSchema, type Role, RoleSchema, type RunAgentInput, RunAgentInputSchema, type RunErrorEvent, type RunErrorEventProps, RunErrorEventSchema, type RunFinishedEvent, type RunFinishedEventProps, RunFinishedEventSchema, type RunHistory, type RunStartedEvent, type RunStartedEventProps, RunStartedEventSchema, type State, type StateDeltaEvent, type StateDeltaEventProps, StateDeltaEventSchema, StateSchema, type StateSnapshotEvent, type StateSnapshotEventProps, StateSnapshotEventSchema, type StepFinishedEvent, type StepFinishedEventProps, StepFinishedEventSchema, type StepStartedEvent, type StepStartedEventProps, StepStartedEventSchema, type SystemMessage, SystemMessageSchema, type TextInputContent, TextInputContentSchema, type TextMessageChunkEvent, type TextMessageChunkEventProps, TextMessageChunkEventSchema, type TextMessageContentEvent, type TextMessageContentEventProps, TextMessageContentEventSchema, type TextMessageEndEvent, type TextMessageEndEventProps, TextMessageEndEventSchema, type TextMessageStartEvent, type TextMessageStartEventProps, TextMessageStartEventSchema, type ThinkingEndEvent, type ThinkingEndEventProps, ThinkingEndEventSchema, type ThinkingStartEvent, type ThinkingStartEventProps, ThinkingStartEventSchema, type ThinkingTextMessageContentEvent, type ThinkingTextMessageContentEventProps, ThinkingTextMessageContentEventSchema, type ThinkingTextMessageEndEvent, type ThinkingTextMessageEndEventProps, ThinkingTextMessageEndEventSchema, type ThinkingTextMessageStartEvent, type ThinkingTextMessageStartEventProps, ThinkingTextMessageStartEventSchema, type Tool, type ToolCall, type ToolCallArgsEvent, type ToolCallArgsEventProps, ToolCallArgsEventSchema, type ToolCallChunkEvent, type ToolCallChunkEventProps, ToolCallChunkEventSchema, type ToolCallEndEvent, type ToolCallEndEventProps, ToolCallEndEventSchema, type ToolCallResultEvent, type ToolCallResultEventProps, ToolCallResultEventSchema, ToolCallSchema, type ToolCallStartEvent, type ToolCallStartEventProps, ToolCallStartEventSchema, type ToolMessage, ToolMessageSchema, ToolSchema, type UserMessage, UserMessageSchema };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/types.ts","../src/events.ts"],"sourcesContent":["// Export all base types and schemas\nexport * from \"./types\";\n\n// Export all event-related types and schemas\nexport * from \"./events\";\n","import { z } from \"zod\";\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});\n\nexport const BaseMessageSchema = z.object({\n id: z.string(),\n role: z.string(),\n content: z.string().optional(),\n name: z.string().optional(),\n});\n\nexport const TextInputContentSchema = z.object({\n type: z.literal(\"text\"),\n text: z.string(),\n});\n\nconst BinaryInputContentObjectSchema = 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\nconst ensureBinaryPayload = (\n value: { id?: string; url?: string; data?: string },\n ctx: z.RefinementCtx,\n) => {\n if (!value.id && !value.url && !value.data) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"BinaryInputContent requires at least one of id, url, or data.\",\n path: [\"id\"],\n });\n }\n};\n\nexport const BinaryInputContentSchema = BinaryInputContentObjectSchema.superRefine((value, ctx) => {\n ensureBinaryPayload(value, ctx);\n});\n\nconst InputContentBaseSchema = z.discriminatedUnion(\"type\", [\n TextInputContentSchema,\n BinaryInputContentObjectSchema,\n]);\n\nexport const InputContentSchema = InputContentBaseSchema.superRefine((value, ctx) => {\n if (value.type === \"binary\") {\n ensureBinaryPayload(value, ctx);\n }\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});\n\nexport const ActivityMessageSchema = z.object({\n id: z.string(),\n role: z.literal(\"activity\"),\n activityType: z.string(),\n content: z.record(z.any()),\n});\n\nexport const MessageSchema = z.discriminatedUnion(\"role\", [\n DeveloperMessageSchema,\n SystemMessageSchema,\n AssistantMessageSchema,\n UserMessageSchema,\n ToolMessageSchema,\n ActivityMessageSchema,\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]);\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 parameters: z.any(), // JSON Schema for the tool parameters\n});\n\nexport const RunAgentInputSchema = z.object({\n threadId: z.string(),\n runId: z.string(),\n parentRunId: z.string().optional(),\n state: z.any(),\n messages: z.array(MessageSchema),\n tools: z.array(ToolSchema),\n context: z.array(ContextSchema),\n forwardedProps: z.any(),\n});\n\nexport const StateSchema = z.any();\n\nexport type ToolCall = z.infer<typeof ToolCallSchema>;\nexport type FunctionCall = z.infer<typeof FunctionCallSchema>;\nexport type TextInputContent = z.infer<typeof TextInputContentSchema>;\nexport type BinaryInputContent = z.infer<typeof BinaryInputContentSchema>;\nexport type InputContent = z.infer<typeof InputContentSchema>;\nexport type DeveloperMessage = z.infer<typeof DeveloperMessageSchema>;\nexport type SystemMessage = z.infer<typeof SystemMessageSchema>;\nexport type AssistantMessage = z.infer<typeof AssistantMessageSchema>;\nexport type UserMessage = z.infer<typeof UserMessageSchema>;\nexport type ToolMessage = z.infer<typeof ToolMessageSchema>;\nexport type ActivityMessage = z.infer<typeof ActivityMessageSchema>;\nexport type Message = z.infer<typeof MessageSchema>;\nexport type Context = z.infer<typeof ContextSchema>;\nexport type Tool = z.infer<typeof ToolSchema>;\nexport type RunAgentInput = z.infer<typeof RunAgentInputSchema>;\nexport type State = z.infer<typeof StateSchema>;\nexport type Role = z.infer<typeof RoleSchema>;\n\nexport class AGUIError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\n\nexport class AGUIConnectNotImplementedError extends AGUIError {\n constructor() {\n super(\"Connect not implemented. This method is not supported by the current agent.\");\n }\n}\n","import { z } from \"zod\";\nimport { MessageSchema, StateSchema, RunAgentInputSchema } from \"./types\";\n\n// Text messages can have any role except \"tool\"\nconst TextMessageRoleSchema = z.union([\n z.literal(\"developer\"),\n z.literal(\"system\"),\n z.literal(\"assistant\"),\n z.literal(\"user\"),\n]);\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 THINKING_TEXT_MESSAGE_START = \"THINKING_TEXT_MESSAGE_START\",\n THINKING_TEXT_MESSAGE_CONTENT = \"THINKING_TEXT_MESSAGE_CONTENT\",\n THINKING_TEXT_MESSAGE_END = \"THINKING_TEXT_MESSAGE_END\",\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 THINKING_START = \"THINKING_START\",\n THINKING_END = \"THINKING_END\",\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}\n\nexport const BaseEventSchema = z\n .object({\n type: z.nativeEnum(EventType),\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});\n\nexport const TextMessageContentEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_CONTENT),\n messageId: z.string(),\n delta: z.string().refine((s) => s.length > 0, \"Delta must not be an empty 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});\n\nexport const ThinkingTextMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_START),\n});\n\nexport const ThinkingTextMessageContentEventSchema = TextMessageContentEventSchema.omit({\n messageId: true,\n type: true,\n}).extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_CONTENT),\n});\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 parentMessageId: z.string().optional(),\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 parentMessageId: z.string().optional(),\n delta: z.string().optional(),\n});\n\nexport const ThinkingStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_START),\n title: z.string().optional(),\n});\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,\n});\n\nexport const StateDeltaEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STATE_DELTA),\n delta: z.array(z.any()), // JSON Patch (RFC 6902)\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.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(),\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(),\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 RunFinishedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RUN_FINISHED),\n threadId: z.string(),\n runId: z.string(),\n result: z.any().optional(),\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 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]);\n\nexport type BaseEvent = z.infer<typeof BaseEventSchema>;\nexport type AGUIEvent = z.infer<typeof EventSchemas>;\nexport type BaseEventFields = z.infer<typeof BaseEventSchema>;\nexport type AGUIEventByType = {\n [EventType.TEXT_MESSAGE_START]: TextMessageStartEvent;\n [EventType.TEXT_MESSAGE_CONTENT]: TextMessageContentEvent;\n [EventType.TEXT_MESSAGE_END]: TextMessageEndEvent;\n [EventType.TEXT_MESSAGE_CHUNK]: TextMessageChunkEvent;\n [EventType.THINKING_TEXT_MESSAGE_START]: ThinkingTextMessageStartEvent;\n [EventType.THINKING_TEXT_MESSAGE_CONTENT]: ThinkingTextMessageContentEvent;\n [EventType.THINKING_TEXT_MESSAGE_END]: ThinkingTextMessageEndEvent;\n [EventType.TOOL_CALL_START]: ToolCallStartEvent;\n [EventType.TOOL_CALL_ARGS]: ToolCallArgsEvent;\n [EventType.TOOL_CALL_END]: ToolCallEndEvent;\n [EventType.TOOL_CALL_CHUNK]: ToolCallChunkEvent;\n [EventType.TOOL_CALL_RESULT]: ToolCallResultEvent;\n [EventType.THINKING_START]: ThinkingStartEvent;\n [EventType.THINKING_END]: ThinkingEndEvent;\n [EventType.STATE_SNAPSHOT]: StateSnapshotEvent;\n [EventType.STATE_DELTA]: StateDeltaEvent;\n [EventType.MESSAGES_SNAPSHOT]: MessagesSnapshotEvent;\n [EventType.ACTIVITY_SNAPSHOT]: ActivitySnapshotEvent;\n [EventType.ACTIVITY_DELTA]: ActivityDeltaEvent;\n [EventType.RAW]: RawEvent;\n [EventType.CUSTOM]: CustomEvent;\n [EventType.RUN_STARTED]: RunStartedEvent;\n [EventType.RUN_FINISHED]: RunFinishedEvent;\n [EventType.RUN_ERROR]: RunErrorEvent;\n [EventType.STEP_STARTED]: StepStartedEvent;\n [EventType.STEP_FINISHED]: StepFinishedEvent;\n};\nexport type AGUIEventOf<T extends EventType> = AGUIEventByType[T];\nexport type EventPayloadOf<T extends EventType> = Omit<AGUIEventOf<T>, keyof BaseEventFields>;\n\ntype EventProps<Schema extends z.ZodTypeAny> = Omit<z.input<Schema>, \"type\">;\n\nexport type BaseEventProps = EventProps<typeof BaseEventSchema>;\n\nexport type TextMessageStartEventProps = EventProps<typeof TextMessageStartEventSchema>;\nexport type TextMessageContentEventProps = EventProps<typeof TextMessageContentEventSchema>;\nexport type TextMessageEndEventProps = EventProps<typeof TextMessageEndEventSchema>;\nexport type TextMessageChunkEventProps = EventProps<typeof TextMessageChunkEventSchema>;\nexport type ThinkingTextMessageStartEventProps = EventProps<typeof ThinkingTextMessageStartEventSchema>;\nexport type ThinkingTextMessageContentEventProps = EventProps<\n typeof ThinkingTextMessageContentEventSchema\n>;\nexport type ThinkingTextMessageEndEventProps = EventProps<typeof ThinkingTextMessageEndEventSchema>;\nexport type ToolCallStartEventProps = EventProps<typeof ToolCallStartEventSchema>;\nexport type ToolCallArgsEventProps = EventProps<typeof ToolCallArgsEventSchema>;\nexport type ToolCallEndEventProps = EventProps<typeof ToolCallEndEventSchema>;\nexport type ToolCallChunkEventProps = EventProps<typeof ToolCallChunkEventSchema>;\nexport type ToolCallResultEventProps = EventProps<typeof ToolCallResultEventSchema>;\nexport type ThinkingStartEventProps = EventProps<typeof ThinkingStartEventSchema>;\nexport type ThinkingEndEventProps = EventProps<typeof ThinkingEndEventSchema>;\nexport type StateSnapshotEventProps = EventProps<typeof StateSnapshotEventSchema>;\nexport type StateDeltaEventProps = EventProps<typeof StateDeltaEventSchema>;\nexport type MessagesSnapshotEventProps = EventProps<typeof MessagesSnapshotEventSchema>;\nexport type ActivitySnapshotEventProps = EventProps<typeof ActivitySnapshotEventSchema>;\nexport type ActivityDeltaEventProps = EventProps<typeof ActivityDeltaEventSchema>;\nexport type RawEventProps = EventProps<typeof RawEventSchema>;\nexport type CustomEventProps = EventProps<typeof CustomEventSchema>;\nexport type RunStartedEventProps = EventProps<typeof RunStartedEventSchema>;\nexport type RunFinishedEventProps = EventProps<typeof RunFinishedEventSchema>;\nexport type RunErrorEventProps = EventProps<typeof RunErrorEventSchema>;\nexport type StepStartedEventProps = EventProps<typeof StepStartedEventSchema>;\nexport type StepFinishedEventProps = EventProps<typeof StepFinishedEventSchema>;\n\nexport type TextMessageStartEvent = z.infer<typeof TextMessageStartEventSchema>;\nexport type TextMessageContentEvent = z.infer<typeof TextMessageContentEventSchema>;\nexport type TextMessageEndEvent = z.infer<typeof TextMessageEndEventSchema>;\nexport type TextMessageChunkEvent = z.infer<typeof TextMessageChunkEventSchema>;\nexport type ThinkingTextMessageStartEvent = z.infer<typeof ThinkingTextMessageStartEventSchema>;\nexport type ThinkingTextMessageContentEvent = z.infer<typeof ThinkingTextMessageContentEventSchema>;\nexport type ThinkingTextMessageEndEvent = z.infer<typeof ThinkingTextMessageEndEventSchema>;\nexport type ToolCallStartEvent = z.infer<typeof ToolCallStartEventSchema>;\nexport type ToolCallArgsEvent = z.infer<typeof ToolCallArgsEventSchema>;\nexport type ToolCallEndEvent = z.infer<typeof ToolCallEndEventSchema>;\nexport type ToolCallChunkEvent = z.infer<typeof ToolCallChunkEventSchema>;\nexport type ToolCallResultEvent = z.infer<typeof ToolCallResultEventSchema>;\nexport type ThinkingStartEvent = z.infer<typeof ThinkingStartEventSchema>;\nexport type ThinkingEndEvent = z.infer<typeof ThinkingEndEventSchema>;\nexport type StateSnapshotEvent = z.infer<typeof StateSnapshotEventSchema>;\nexport type StateDeltaEvent = z.infer<typeof StateDeltaEventSchema>;\nexport type MessagesSnapshotEvent = z.infer<typeof MessagesSnapshotEventSchema>;\nexport type ActivitySnapshotEvent = z.infer<typeof ActivitySnapshotEventSchema>;\nexport type ActivityDeltaEvent = z.infer<typeof ActivityDeltaEventSchema>;\nexport type RawEvent = z.infer<typeof RawEventSchema>;\nexport type CustomEvent = z.infer<typeof CustomEventSchema>;\nexport type RunStartedEvent = z.infer<typeof RunStartedEventSchema>;\nexport type RunFinishedEvent = z.infer<typeof RunFinishedEventSchema>;\nexport type RunErrorEvent = z.infer<typeof RunErrorEventSchema>;\nexport type StepStartedEvent = z.infer<typeof StepStartedEventSchema>;\nexport type StepFinishedEvent = z.infer<typeof StepFinishedEventSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAEX,IAAM,qBAAqB,aAAE,OAAO;AAAA,EACzC,MAAM,aAAE,OAAO;AAAA,EACf,WAAW,aAAE,OAAO;AACtB,CAAC;AAEM,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,IAAI,aAAE,OAAO;AAAA,EACb,MAAM,aAAE,QAAQ,UAAU;AAAA,EAC1B,UAAU;AACZ,CAAC;AAEM,IAAM,oBAAoB,aAAE,OAAO;AAAA,E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;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":["import_zod","EventType"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/types.ts","../src/events.ts"],"sourcesContent":["// Export all base types and schemas\nexport * from \"./types\";\n\n// Export all event-related types and schemas\nexport * from \"./events\";\n","import { z } from \"zod\";\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});\n\nexport const BaseMessageSchema = z.object({\n id: z.string(),\n role: z.string(),\n content: z.string().optional(),\n name: z.string().optional(),\n});\n\nexport const TextInputContentSchema = z.object({\n type: z.literal(\"text\"),\n text: z.string(),\n});\n\nconst BinaryInputContentObjectSchema = 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\nconst ensureBinaryPayload = (\n value: { id?: string; url?: string; data?: string },\n ctx: z.RefinementCtx,\n) => {\n if (!value.id && !value.url && !value.data) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"BinaryInputContent requires at least one of id, url, or data.\",\n path: [\"id\"],\n });\n }\n};\n\nexport const BinaryInputContentSchema = BinaryInputContentObjectSchema.superRefine((value, ctx) => {\n ensureBinaryPayload(value, ctx);\n});\n\nconst InputContentBaseSchema = z.discriminatedUnion(\"type\", [\n TextInputContentSchema,\n BinaryInputContentObjectSchema,\n]);\n\nexport const InputContentSchema = InputContentBaseSchema.superRefine((value, ctx) => {\n if (value.type === \"binary\") {\n ensureBinaryPayload(value, ctx);\n }\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});\n\nexport const ActivityMessageSchema = z.object({\n id: z.string(),\n role: z.literal(\"activity\"),\n activityType: z.string(),\n content: z.record(z.any()),\n});\n\nexport const MessageSchema = z.discriminatedUnion(\"role\", [\n DeveloperMessageSchema,\n SystemMessageSchema,\n AssistantMessageSchema,\n UserMessageSchema,\n ToolMessageSchema,\n ActivityMessageSchema,\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]);\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 parameters: z.any(), // JSON Schema for the tool parameters\n});\n\nexport const RunAgentInputSchema = z.object({\n threadId: z.string(),\n runId: z.string(),\n parentRunId: z.string().optional(),\n state: z.any(),\n messages: z.array(MessageSchema),\n tools: z.array(ToolSchema),\n context: z.array(ContextSchema),\n forwardedProps: z.any(),\n});\n\nexport const StateSchema = z.any();\n\nexport type ToolCall = z.infer<typeof ToolCallSchema>;\nexport type FunctionCall = z.infer<typeof FunctionCallSchema>;\nexport type TextInputContent = z.infer<typeof TextInputContentSchema>;\nexport type BinaryInputContent = z.infer<typeof BinaryInputContentSchema>;\nexport type InputContent = z.infer<typeof InputContentSchema>;\nexport type DeveloperMessage = z.infer<typeof DeveloperMessageSchema>;\nexport type SystemMessage = z.infer<typeof SystemMessageSchema>;\nexport type AssistantMessage = z.infer<typeof AssistantMessageSchema>;\nexport type UserMessage = z.infer<typeof UserMessageSchema>;\nexport type ToolMessage = z.infer<typeof ToolMessageSchema>;\nexport type ActivityMessage = z.infer<typeof ActivityMessageSchema>;\nexport type Message = z.infer<typeof MessageSchema>;\nexport type Context = z.infer<typeof ContextSchema>;\nexport type Tool = z.infer<typeof ToolSchema>;\nexport type RunAgentInput = z.infer<typeof RunAgentInputSchema>;\nexport type State = z.infer<typeof StateSchema>;\nexport type Role = z.infer<typeof RoleSchema>;\n\nexport class AGUIError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\n\nexport class AGUIConnectNotImplementedError extends AGUIError {\n constructor() {\n super(\"Connect not implemented. This method is not supported by the current agent.\");\n }\n}\n\n// Run history types for fetching external state\nexport interface RunHistory {\n runId: string;\n messages: Message[];\n}\n\nexport interface FetchRunHistoryResult {\n runs: RunHistory[];\n}\n\nexport interface FetchRunHistoryOptions {\n threadId: string;\n}\n","import { z } from \"zod\";\nimport { MessageSchema, StateSchema, RunAgentInputSchema } from \"./types\";\n\n// Text messages can have any role except \"tool\"\nconst TextMessageRoleSchema = z.union([\n z.literal(\"developer\"),\n z.literal(\"system\"),\n z.literal(\"assistant\"),\n z.literal(\"user\"),\n]);\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 THINKING_TEXT_MESSAGE_START = \"THINKING_TEXT_MESSAGE_START\",\n THINKING_TEXT_MESSAGE_CONTENT = \"THINKING_TEXT_MESSAGE_CONTENT\",\n THINKING_TEXT_MESSAGE_END = \"THINKING_TEXT_MESSAGE_END\",\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 THINKING_START = \"THINKING_START\",\n THINKING_END = \"THINKING_END\",\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}\n\nexport const BaseEventSchema = z\n .object({\n type: z.nativeEnum(EventType),\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});\n\nexport const TextMessageContentEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_CONTENT),\n messageId: z.string(),\n delta: z.string().refine((s) => s.length > 0, \"Delta must not be an empty 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});\n\nexport const ThinkingTextMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_START),\n});\n\nexport const ThinkingTextMessageContentEventSchema = TextMessageContentEventSchema.omit({\n messageId: true,\n type: true,\n}).extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_CONTENT),\n});\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 parentMessageId: z.string().optional(),\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 parentMessageId: z.string().optional(),\n delta: z.string().optional(),\n});\n\nexport const ThinkingStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_START),\n title: z.string().optional(),\n});\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,\n});\n\nexport const StateDeltaEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STATE_DELTA),\n delta: z.array(z.any()), // JSON Patch (RFC 6902)\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.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(),\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(),\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 RunFinishedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RUN_FINISHED),\n threadId: z.string(),\n runId: z.string(),\n result: z.any().optional(),\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 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]);\n\nexport type BaseEvent = z.infer<typeof BaseEventSchema>;\nexport type AGUIEvent = z.infer<typeof EventSchemas>;\nexport type BaseEventFields = z.infer<typeof BaseEventSchema>;\nexport type AGUIEventByType = {\n [EventType.TEXT_MESSAGE_START]: TextMessageStartEvent;\n [EventType.TEXT_MESSAGE_CONTENT]: TextMessageContentEvent;\n [EventType.TEXT_MESSAGE_END]: TextMessageEndEvent;\n [EventType.TEXT_MESSAGE_CHUNK]: TextMessageChunkEvent;\n [EventType.THINKING_TEXT_MESSAGE_START]: ThinkingTextMessageStartEvent;\n [EventType.THINKING_TEXT_MESSAGE_CONTENT]: ThinkingTextMessageContentEvent;\n [EventType.THINKING_TEXT_MESSAGE_END]: ThinkingTextMessageEndEvent;\n [EventType.TOOL_CALL_START]: ToolCallStartEvent;\n [EventType.TOOL_CALL_ARGS]: ToolCallArgsEvent;\n [EventType.TOOL_CALL_END]: ToolCallEndEvent;\n [EventType.TOOL_CALL_CHUNK]: ToolCallChunkEvent;\n [EventType.TOOL_CALL_RESULT]: ToolCallResultEvent;\n [EventType.THINKING_START]: ThinkingStartEvent;\n [EventType.THINKING_END]: ThinkingEndEvent;\n [EventType.STATE_SNAPSHOT]: StateSnapshotEvent;\n [EventType.STATE_DELTA]: StateDeltaEvent;\n [EventType.MESSAGES_SNAPSHOT]: MessagesSnapshotEvent;\n [EventType.ACTIVITY_SNAPSHOT]: ActivitySnapshotEvent;\n [EventType.ACTIVITY_DELTA]: ActivityDeltaEvent;\n [EventType.RAW]: RawEvent;\n [EventType.CUSTOM]: CustomEvent;\n [EventType.RUN_STARTED]: RunStartedEvent;\n [EventType.RUN_FINISHED]: RunFinishedEvent;\n [EventType.RUN_ERROR]: RunErrorEvent;\n [EventType.STEP_STARTED]: StepStartedEvent;\n [EventType.STEP_FINISHED]: StepFinishedEvent;\n};\nexport type AGUIEventOf<T extends EventType> = AGUIEventByType[T];\nexport type EventPayloadOf<T extends EventType> = Omit<AGUIEventOf<T>, keyof BaseEventFields>;\n\ntype EventProps<Schema extends z.ZodTypeAny> = Omit<z.input<Schema>, \"type\">;\n\nexport type BaseEventProps = EventProps<typeof BaseEventSchema>;\n\nexport type TextMessageStartEventProps = EventProps<typeof TextMessageStartEventSchema>;\nexport type TextMessageContentEventProps = EventProps<typeof TextMessageContentEventSchema>;\nexport type TextMessageEndEventProps = EventProps<typeof TextMessageEndEventSchema>;\nexport type TextMessageChunkEventProps = EventProps<typeof TextMessageChunkEventSchema>;\nexport type ThinkingTextMessageStartEventProps = EventProps<typeof ThinkingTextMessageStartEventSchema>;\nexport type ThinkingTextMessageContentEventProps = EventProps<\n typeof ThinkingTextMessageContentEventSchema\n>;\nexport type ThinkingTextMessageEndEventProps = EventProps<typeof ThinkingTextMessageEndEventSchema>;\nexport type ToolCallStartEventProps = EventProps<typeof ToolCallStartEventSchema>;\nexport type ToolCallArgsEventProps = EventProps<typeof ToolCallArgsEventSchema>;\nexport type ToolCallEndEventProps = EventProps<typeof ToolCallEndEventSchema>;\nexport type ToolCallChunkEventProps = EventProps<typeof ToolCallChunkEventSchema>;\nexport type ToolCallResultEventProps = EventProps<typeof ToolCallResultEventSchema>;\nexport type ThinkingStartEventProps = EventProps<typeof ThinkingStartEventSchema>;\nexport type ThinkingEndEventProps = EventProps<typeof ThinkingEndEventSchema>;\nexport type StateSnapshotEventProps = EventProps<typeof StateSnapshotEventSchema>;\nexport type StateDeltaEventProps = EventProps<typeof StateDeltaEventSchema>;\nexport type MessagesSnapshotEventProps = EventProps<typeof MessagesSnapshotEventSchema>;\nexport type ActivitySnapshotEventProps = EventProps<typeof ActivitySnapshotEventSchema>;\nexport type ActivityDeltaEventProps = EventProps<typeof ActivityDeltaEventSchema>;\nexport type RawEventProps = EventProps<typeof RawEventSchema>;\nexport type CustomEventProps = EventProps<typeof CustomEventSchema>;\nexport type RunStartedEventProps = EventProps<typeof RunStartedEventSchema>;\nexport type RunFinishedEventProps = EventProps<typeof RunFinishedEventSchema>;\nexport type RunErrorEventProps = EventProps<typeof RunErrorEventSchema>;\nexport type StepStartedEventProps = EventProps<typeof StepStartedEventSchema>;\nexport type StepFinishedEventProps = EventProps<typeof StepFinishedEventSchema>;\n\nexport type TextMessageStartEvent = z.infer<typeof TextMessageStartEventSchema>;\nexport type TextMessageContentEvent = z.infer<typeof TextMessageContentEventSchema>;\nexport type TextMessageEndEvent = z.infer<typeof TextMessageEndEventSchema>;\nexport type TextMessageChunkEvent = z.infer<typeof TextMessageChunkEventSchema>;\nexport type ThinkingTextMessageStartEvent = z.infer<typeof ThinkingTextMessageStartEventSchema>;\nexport type ThinkingTextMessageContentEvent = z.infer<typeof ThinkingTextMessageContentEventSchema>;\nexport type ThinkingTextMessageEndEvent = z.infer<typeof ThinkingTextMessageEndEventSchema>;\nexport type ToolCallStartEvent = z.infer<typeof ToolCallStartEventSchema>;\nexport type ToolCallArgsEvent = z.infer<typeof ToolCallArgsEventSchema>;\nexport type ToolCallEndEvent = z.infer<typeof ToolCallEndEventSchema>;\nexport type ToolCallChunkEvent = z.infer<typeof ToolCallChunkEventSchema>;\nexport type ToolCallResultEvent = z.infer<typeof ToolCallResultEventSchema>;\nexport type ThinkingStartEvent = z.infer<typeof ThinkingStartEventSchema>;\nexport type ThinkingEndEvent = z.infer<typeof ThinkingEndEventSchema>;\nexport type StateSnapshotEvent = z.infer<typeof StateSnapshotEventSchema>;\nexport type StateDeltaEvent = z.infer<typeof StateDeltaEventSchema>;\nexport type MessagesSnapshotEvent = z.infer<typeof MessagesSnapshotEventSchema>;\nexport type ActivitySnapshotEvent = z.infer<typeof ActivitySnapshotEventSchema>;\nexport type ActivityDeltaEvent = z.infer<typeof ActivityDeltaEventSchema>;\nexport type RawEvent = z.infer<typeof RawEventSchema>;\nexport type CustomEvent = z.infer<typeof CustomEventSchema>;\nexport type RunStartedEvent = z.infer<typeof RunStartedEventSchema>;\nexport type RunFinishedEvent = z.infer<typeof RunFinishedEventSchema>;\nexport type RunErrorEvent = z.infer<typeof RunErrorEventSchema>;\nexport type StepStartedEvent = z.infer<typeof StepStartedEventSchema>;\nexport type StepFinishedEvent = z.infer<typeof StepFinishedEventSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAEX,IAAM,qBAAqB,aAAE,OAAO;AAAA,EACzC,MAAM,aAAE,OAAO;AAAA,EACf,WAAW,aAAE,OAAO;AACtB,CAAC;AAEM,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,IAAI,aAAE,OAAO;AAAA,EACb,MAAM,aAAE,QAAQ,UAAU;AAAA,EAC1B,UAAU;AACZ,CAAC;AAEM,IAAM,oBAAoB,aAAE,OAAO;AAAA,EACxC,IAAI,aAAE,OAAO;AAAA,EACb,MAAM,aAAE,OAAO;AAAA,EACf,SAAS,aAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAM,aAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;AAEM,IAAM,yBAAyB,aAAE,OAAO;AAAA,EAC7C,MAAM,aAAE,QAAQ,MAAM;AAAA,EACtB,MAAM,aAAE,OAAO;AACjB,CAAC;AAED,IAAM,iCAAiC,aAAE,OAAO;AAAA,EAC9C,MAAM,aAAE,Q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AU,cAAE,OAAO;AAAA,EACnB,OAAO,cAAE,OAAO;AAAA,EAChB,aAAa,cAAE,OAAO,EAAE,SAAS;AAAA,EACjC,OAAO,oBAAoB,SAAS;AACtC,CAAC;AAEM,IAAM,yBAAyB,gBAAgB,OAAO;AAAA,EAC3D,MAAM,cAAE,QAAQ,iCAAsB;AAAA,EACtC,UAAU,cAAE,OAAO;AAAA,EACnB,OAAO,cAAE,OAAO;AAAA,EAChB,QAAQ,cAAE,IAAI,EAAE,SAAS;AAC3B,CAAC;AAEM,IAAM,sBAAsB,gBAAgB,OAAO;AAAA,EACxD,MAAM,cAAE,QAAQ,2BAAmB;AAAA,EACnC,SAAS,cAAE,OAAO;AAAA,EAClB,MAAM,cAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;AAEM,IAAM,yBAAyB,gBAAgB,OAAO;AAAA,EAC3D,MAAM,cAAE,QAAQ,iCAAsB;AAAA,EACtC,UAAU,cAAE,OAAO;AACrB,CAAC;AAEM,IAAM,0BAA0B,gBAAgB,OAAO;AAAA,EAC5D,MAAM,cAAE,QAAQ,mCAAuB;AAAA,EACvC,UAAU,cAAE,OAAO;AACrB,CAAC;AAEM,IAAM,eAAe,cAAE,mBAAmB,QAAQ;AAAA,EACvD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":["import_zod","EventType"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts","../src/events.ts"],"sourcesContent":["import { z } from \"zod\";\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});\n\nexport const BaseMessageSchema = z.object({\n id: z.string(),\n role: z.string(),\n content: z.string().optional(),\n name: z.string().optional(),\n});\n\nexport const TextInputContentSchema = z.object({\n type: z.literal(\"text\"),\n text: z.string(),\n});\n\nconst BinaryInputContentObjectSchema = 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\nconst ensureBinaryPayload = (\n value: { id?: string; url?: string; data?: string },\n ctx: z.RefinementCtx,\n) => {\n if (!value.id && !value.url && !value.data) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"BinaryInputContent requires at least one of id, url, or data.\",\n path: [\"id\"],\n });\n }\n};\n\nexport const BinaryInputContentSchema = BinaryInputContentObjectSchema.superRefine((value, ctx) => {\n ensureBinaryPayload(value, ctx);\n});\n\nconst InputContentBaseSchema = z.discriminatedUnion(\"type\", [\n TextInputContentSchema,\n BinaryInputContentObjectSchema,\n]);\n\nexport const InputContentSchema = InputContentBaseSchema.superRefine((value, ctx) => {\n if (value.type === \"binary\") {\n ensureBinaryPayload(value, ctx);\n }\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});\n\nexport const ActivityMessageSchema = z.object({\n id: z.string(),\n role: z.literal(\"activity\"),\n activityType: z.string(),\n content: z.record(z.any()),\n});\n\nexport const MessageSchema = z.discriminatedUnion(\"role\", [\n DeveloperMessageSchema,\n SystemMessageSchema,\n AssistantMessageSchema,\n UserMessageSchema,\n ToolMessageSchema,\n ActivityMessageSchema,\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]);\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 parameters: z.any(), // JSON Schema for the tool parameters\n});\n\nexport const RunAgentInputSchema = z.object({\n threadId: z.string(),\n runId: z.string(),\n parentRunId: z.string().optional(),\n state: z.any(),\n messages: z.array(MessageSchema),\n tools: z.array(ToolSchema),\n context: z.array(ContextSchema),\n forwardedProps: z.any(),\n});\n\nexport const StateSchema = z.any();\n\nexport type ToolCall = z.infer<typeof ToolCallSchema>;\nexport type FunctionCall = z.infer<typeof FunctionCallSchema>;\nexport type TextInputContent = z.infer<typeof TextInputContentSchema>;\nexport type BinaryInputContent = z.infer<typeof BinaryInputContentSchema>;\nexport type InputContent = z.infer<typeof InputContentSchema>;\nexport type DeveloperMessage = z.infer<typeof DeveloperMessageSchema>;\nexport type SystemMessage = z.infer<typeof SystemMessageSchema>;\nexport type AssistantMessage = z.infer<typeof AssistantMessageSchema>;\nexport type UserMessage = z.infer<typeof UserMessageSchema>;\nexport type ToolMessage = z.infer<typeof ToolMessageSchema>;\nexport type ActivityMessage = z.infer<typeof ActivityMessageSchema>;\nexport type Message = z.infer<typeof MessageSchema>;\nexport type Context = z.infer<typeof ContextSchema>;\nexport type Tool = z.infer<typeof ToolSchema>;\nexport type RunAgentInput = z.infer<typeof RunAgentInputSchema>;\nexport type State = z.infer<typeof StateSchema>;\nexport type Role = z.infer<typeof RoleSchema>;\n\nexport class AGUIError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\n\nexport class AGUIConnectNotImplementedError extends AGUIError {\n constructor() {\n super(\"Connect not implemented. This method is not supported by the current agent.\");\n }\n}\n","import { z } from \"zod\";\nimport { MessageSchema, StateSchema, RunAgentInputSchema } from \"./types\";\n\n// Text messages can have any role except \"tool\"\nconst TextMessageRoleSchema = z.union([\n z.literal(\"developer\"),\n z.literal(\"system\"),\n z.literal(\"assistant\"),\n z.literal(\"user\"),\n]);\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 THINKING_TEXT_MESSAGE_START = \"THINKING_TEXT_MESSAGE_START\",\n THINKING_TEXT_MESSAGE_CONTENT = \"THINKING_TEXT_MESSAGE_CONTENT\",\n THINKING_TEXT_MESSAGE_END = \"THINKING_TEXT_MESSAGE_END\",\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 THINKING_START = \"THINKING_START\",\n THINKING_END = \"THINKING_END\",\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}\n\nexport const BaseEventSchema = z\n .object({\n type: z.nativeEnum(EventType),\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});\n\nexport const TextMessageContentEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_CONTENT),\n messageId: z.string(),\n delta: z.string().refine((s) => s.length > 0, \"Delta must not be an empty 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});\n\nexport const ThinkingTextMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_START),\n});\n\nexport const ThinkingTextMessageContentEventSchema = TextMessageContentEventSchema.omit({\n messageId: true,\n type: true,\n}).extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_CONTENT),\n});\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 parentMessageId: z.string().optional(),\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 parentMessageId: z.string().optional(),\n delta: z.string().optional(),\n});\n\nexport const ThinkingStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_START),\n title: z.string().optional(),\n});\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,\n});\n\nexport const StateDeltaEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STATE_DELTA),\n delta: z.array(z.any()), // JSON Patch (RFC 6902)\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.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(),\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(),\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 RunFinishedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RUN_FINISHED),\n threadId: z.string(),\n runId: z.string(),\n result: z.any().optional(),\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 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]);\n\nexport type BaseEvent = z.infer<typeof BaseEventSchema>;\nexport type AGUIEvent = z.infer<typeof EventSchemas>;\nexport type BaseEventFields = z.infer<typeof BaseEventSchema>;\nexport type AGUIEventByType = {\n [EventType.TEXT_MESSAGE_START]: TextMessageStartEvent;\n [EventType.TEXT_MESSAGE_CONTENT]: TextMessageContentEvent;\n [EventType.TEXT_MESSAGE_END]: TextMessageEndEvent;\n [EventType.TEXT_MESSAGE_CHUNK]: TextMessageChunkEvent;\n [EventType.THINKING_TEXT_MESSAGE_START]: ThinkingTextMessageStartEvent;\n [EventType.THINKING_TEXT_MESSAGE_CONTENT]: ThinkingTextMessageContentEvent;\n [EventType.THINKING_TEXT_MESSAGE_END]: ThinkingTextMessageEndEvent;\n [EventType.TOOL_CALL_START]: ToolCallStartEvent;\n [EventType.TOOL_CALL_ARGS]: ToolCallArgsEvent;\n [EventType.TOOL_CALL_END]: ToolCallEndEvent;\n [EventType.TOOL_CALL_CHUNK]: ToolCallChunkEvent;\n [EventType.TOOL_CALL_RESULT]: ToolCallResultEvent;\n [EventType.THINKING_START]: ThinkingStartEvent;\n [EventType.THINKING_END]: ThinkingEndEvent;\n [EventType.STATE_SNAPSHOT]: StateSnapshotEvent;\n [EventType.STATE_DELTA]: StateDeltaEvent;\n [EventType.MESSAGES_SNAPSHOT]: MessagesSnapshotEvent;\n [EventType.ACTIVITY_SNAPSHOT]: ActivitySnapshotEvent;\n [EventType.ACTIVITY_DELTA]: ActivityDeltaEvent;\n [EventType.RAW]: RawEvent;\n [EventType.CUSTOM]: CustomEvent;\n [EventType.RUN_STARTED]: RunStartedEvent;\n [EventType.RUN_FINISHED]: RunFinishedEvent;\n [EventType.RUN_ERROR]: RunErrorEvent;\n [EventType.STEP_STARTED]: StepStartedEvent;\n [EventType.STEP_FINISHED]: StepFinishedEvent;\n};\nexport type AGUIEventOf<T extends EventType> = AGUIEventByType[T];\nexport type EventPayloadOf<T extends EventType> = Omit<AGUIEventOf<T>, keyof BaseEventFields>;\n\ntype EventProps<Schema extends z.ZodTypeAny> = Omit<z.input<Schema>, \"type\">;\n\nexport type BaseEventProps = EventProps<typeof BaseEventSchema>;\n\nexport type TextMessageStartEventProps = EventProps<typeof TextMessageStartEventSchema>;\nexport type TextMessageContentEventProps = EventProps<typeof TextMessageContentEventSchema>;\nexport type TextMessageEndEventProps = EventProps<typeof TextMessageEndEventSchema>;\nexport type TextMessageChunkEventProps = EventProps<typeof TextMessageChunkEventSchema>;\nexport type ThinkingTextMessageStartEventProps = EventProps<typeof ThinkingTextMessageStartEventSchema>;\nexport type ThinkingTextMessageContentEventProps = EventProps<\n typeof ThinkingTextMessageContentEventSchema\n>;\nexport type ThinkingTextMessageEndEventProps = EventProps<typeof ThinkingTextMessageEndEventSchema>;\nexport type ToolCallStartEventProps = EventProps<typeof ToolCallStartEventSchema>;\nexport type ToolCallArgsEventProps = EventProps<typeof ToolCallArgsEventSchema>;\nexport type ToolCallEndEventProps = EventProps<typeof ToolCallEndEventSchema>;\nexport type ToolCallChunkEventProps = EventProps<typeof ToolCallChunkEventSchema>;\nexport type ToolCallResultEventProps = EventProps<typeof ToolCallResultEventSchema>;\nexport type ThinkingStartEventProps = EventProps<typeof ThinkingStartEventSchema>;\nexport type ThinkingEndEventProps = EventProps<typeof ThinkingEndEventSchema>;\nexport type StateSnapshotEventProps = EventProps<typeof StateSnapshotEventSchema>;\nexport type StateDeltaEventProps = EventProps<typeof StateDeltaEventSchema>;\nexport type MessagesSnapshotEventProps = EventProps<typeof MessagesSnapshotEventSchema>;\nexport type ActivitySnapshotEventProps = EventProps<typeof ActivitySnapshotEventSchema>;\nexport type ActivityDeltaEventProps = EventProps<typeof ActivityDeltaEventSchema>;\nexport type RawEventProps = EventProps<typeof RawEventSchema>;\nexport type CustomEventProps = EventProps<typeof CustomEventSchema>;\nexport type RunStartedEventProps = EventProps<typeof RunStartedEventSchema>;\nexport type RunFinishedEventProps = EventProps<typeof RunFinishedEventSchema>;\nexport type RunErrorEventProps = EventProps<typeof RunErrorEventSchema>;\nexport type StepStartedEventProps = EventProps<typeof StepStartedEventSchema>;\nexport type StepFinishedEventProps = EventProps<typeof StepFinishedEventSchema>;\n\nexport type TextMessageStartEvent = z.infer<typeof TextMessageStartEventSchema>;\nexport type TextMessageContentEvent = z.infer<typeof TextMessageContentEventSchema>;\nexport type TextMessageEndEvent = z.infer<typeof TextMessageEndEventSchema>;\nexport type TextMessageChunkEvent = z.infer<typeof TextMessageChunkEventSchema>;\nexport type ThinkingTextMessageStartEvent = z.infer<typeof ThinkingTextMessageStartEventSchema>;\nexport type ThinkingTextMessageContentEvent = z.infer<typeof ThinkingTextMessageContentEventSchema>;\nexport type ThinkingTextMessageEndEvent = z.infer<typeof ThinkingTextMessageEndEventSchema>;\nexport type ToolCallStartEvent = z.infer<typeof ToolCallStartEventSchema>;\nexport type ToolCallArgsEvent = z.infer<typeof ToolCallArgsEventSchema>;\nexport type ToolCallEndEvent = z.infer<typeof ToolCallEndEventSchema>;\nexport type ToolCallChunkEvent = z.infer<typeof ToolCallChunkEventSchema>;\nexport type ToolCallResultEvent = z.infer<typeof ToolCallResultEventSchema>;\nexport type ThinkingStartEvent = z.infer<typeof ThinkingStartEventSchema>;\nexport type ThinkingEndEvent = z.infer<typeof ThinkingEndEventSchema>;\nexport type StateSnapshotEvent = z.infer<typeof StateSnapshotEventSchema>;\nexport type StateDeltaEvent = z.infer<typeof StateDeltaEventSchema>;\nexport type MessagesSnapshotEvent = z.infer<typeof MessagesSnapshotEventSchema>;\nexport type ActivitySnapshotEvent = z.infer<typeof ActivitySnapshotEventSchema>;\nexport type ActivityDeltaEvent = z.infer<typeof ActivityDeltaEventSchema>;\nexport type RawEvent = z.infer<typeof RawEventSchema>;\nexport type CustomEvent = z.infer<typeof CustomEventSchema>;\nexport type RunStartedEvent = z.infer<typeof RunStartedEventSchema>;\nexport type RunFinishedEvent = z.infer<typeof RunFinishedEventSchema>;\nexport type RunErrorEvent = z.infer<typeof RunErrorEventSchema>;\nexport type StepStartedEvent = z.infer<typeof StepStartedEventSchema>;\nexport type StepFinishedEvent = z.infer<typeof StepFinishedEventSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,MAAM,EAAE,OAAO;AAAA,EACf,WAAW,EAAE,OAAO;AACtB,CAAC;AAEM,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,IAAI,EAAE,OAAO;AAAA,EACb,MAAM,EAAE,QAAQ,UAAU;AAAA,EAC1B,UA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;AAAA,EACvD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":["z","z","EventType"]}
1
+ {"version":3,"sources":["../src/types.ts","../src/events.ts"],"sourcesContent":["import { z } from \"zod\";\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});\n\nexport const BaseMessageSchema = z.object({\n id: z.string(),\n role: z.string(),\n content: z.string().optional(),\n name: z.string().optional(),\n});\n\nexport const TextInputContentSchema = z.object({\n type: z.literal(\"text\"),\n text: z.string(),\n});\n\nconst BinaryInputContentObjectSchema = 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\nconst ensureBinaryPayload = (\n value: { id?: string; url?: string; data?: string },\n ctx: z.RefinementCtx,\n) => {\n if (!value.id && !value.url && !value.data) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"BinaryInputContent requires at least one of id, url, or data.\",\n path: [\"id\"],\n });\n }\n};\n\nexport const BinaryInputContentSchema = BinaryInputContentObjectSchema.superRefine((value, ctx) => {\n ensureBinaryPayload(value, ctx);\n});\n\nconst InputContentBaseSchema = z.discriminatedUnion(\"type\", [\n TextInputContentSchema,\n BinaryInputContentObjectSchema,\n]);\n\nexport const InputContentSchema = InputContentBaseSchema.superRefine((value, ctx) => {\n if (value.type === \"binary\") {\n ensureBinaryPayload(value, ctx);\n }\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});\n\nexport const ActivityMessageSchema = z.object({\n id: z.string(),\n role: z.literal(\"activity\"),\n activityType: z.string(),\n content: z.record(z.any()),\n});\n\nexport const MessageSchema = z.discriminatedUnion(\"role\", [\n DeveloperMessageSchema,\n SystemMessageSchema,\n AssistantMessageSchema,\n UserMessageSchema,\n ToolMessageSchema,\n ActivityMessageSchema,\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]);\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 parameters: z.any(), // JSON Schema for the tool parameters\n});\n\nexport const RunAgentInputSchema = z.object({\n threadId: z.string(),\n runId: z.string(),\n parentRunId: z.string().optional(),\n state: z.any(),\n messages: z.array(MessageSchema),\n tools: z.array(ToolSchema),\n context: z.array(ContextSchema),\n forwardedProps: z.any(),\n});\n\nexport const StateSchema = z.any();\n\nexport type ToolCall = z.infer<typeof ToolCallSchema>;\nexport type FunctionCall = z.infer<typeof FunctionCallSchema>;\nexport type TextInputContent = z.infer<typeof TextInputContentSchema>;\nexport type BinaryInputContent = z.infer<typeof BinaryInputContentSchema>;\nexport type InputContent = z.infer<typeof InputContentSchema>;\nexport type DeveloperMessage = z.infer<typeof DeveloperMessageSchema>;\nexport type SystemMessage = z.infer<typeof SystemMessageSchema>;\nexport type AssistantMessage = z.infer<typeof AssistantMessageSchema>;\nexport type UserMessage = z.infer<typeof UserMessageSchema>;\nexport type ToolMessage = z.infer<typeof ToolMessageSchema>;\nexport type ActivityMessage = z.infer<typeof ActivityMessageSchema>;\nexport type Message = z.infer<typeof MessageSchema>;\nexport type Context = z.infer<typeof ContextSchema>;\nexport type Tool = z.infer<typeof ToolSchema>;\nexport type RunAgentInput = z.infer<typeof RunAgentInputSchema>;\nexport type State = z.infer<typeof StateSchema>;\nexport type Role = z.infer<typeof RoleSchema>;\n\nexport class AGUIError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\n\nexport class AGUIConnectNotImplementedError extends AGUIError {\n constructor() {\n super(\"Connect not implemented. This method is not supported by the current agent.\");\n }\n}\n\n// Run history types for fetching external state\nexport interface RunHistory {\n runId: string;\n messages: Message[];\n}\n\nexport interface FetchRunHistoryResult {\n runs: RunHistory[];\n}\n\nexport interface FetchRunHistoryOptions {\n threadId: string;\n}\n","import { z } from \"zod\";\nimport { MessageSchema, StateSchema, RunAgentInputSchema } from \"./types\";\n\n// Text messages can have any role except \"tool\"\nconst TextMessageRoleSchema = z.union([\n z.literal(\"developer\"),\n z.literal(\"system\"),\n z.literal(\"assistant\"),\n z.literal(\"user\"),\n]);\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 THINKING_TEXT_MESSAGE_START = \"THINKING_TEXT_MESSAGE_START\",\n THINKING_TEXT_MESSAGE_CONTENT = \"THINKING_TEXT_MESSAGE_CONTENT\",\n THINKING_TEXT_MESSAGE_END = \"THINKING_TEXT_MESSAGE_END\",\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 THINKING_START = \"THINKING_START\",\n THINKING_END = \"THINKING_END\",\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}\n\nexport const BaseEventSchema = z\n .object({\n type: z.nativeEnum(EventType),\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});\n\nexport const TextMessageContentEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_CONTENT),\n messageId: z.string(),\n delta: z.string().refine((s) => s.length > 0, \"Delta must not be an empty 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});\n\nexport const ThinkingTextMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_START),\n});\n\nexport const ThinkingTextMessageContentEventSchema = TextMessageContentEventSchema.omit({\n messageId: true,\n type: true,\n}).extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_CONTENT),\n});\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 parentMessageId: z.string().optional(),\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 parentMessageId: z.string().optional(),\n delta: z.string().optional(),\n});\n\nexport const ThinkingStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_START),\n title: z.string().optional(),\n});\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,\n});\n\nexport const StateDeltaEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STATE_DELTA),\n delta: z.array(z.any()), // JSON Patch (RFC 6902)\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.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(),\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(),\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 RunFinishedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RUN_FINISHED),\n threadId: z.string(),\n runId: z.string(),\n result: z.any().optional(),\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 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]);\n\nexport type BaseEvent = z.infer<typeof BaseEventSchema>;\nexport type AGUIEvent = z.infer<typeof EventSchemas>;\nexport type BaseEventFields = z.infer<typeof BaseEventSchema>;\nexport type AGUIEventByType = {\n [EventType.TEXT_MESSAGE_START]: TextMessageStartEvent;\n [EventType.TEXT_MESSAGE_CONTENT]: TextMessageContentEvent;\n [EventType.TEXT_MESSAGE_END]: TextMessageEndEvent;\n [EventType.TEXT_MESSAGE_CHUNK]: TextMessageChunkEvent;\n [EventType.THINKING_TEXT_MESSAGE_START]: ThinkingTextMessageStartEvent;\n [EventType.THINKING_TEXT_MESSAGE_CONTENT]: ThinkingTextMessageContentEvent;\n [EventType.THINKING_TEXT_MESSAGE_END]: ThinkingTextMessageEndEvent;\n [EventType.TOOL_CALL_START]: ToolCallStartEvent;\n [EventType.TOOL_CALL_ARGS]: ToolCallArgsEvent;\n [EventType.TOOL_CALL_END]: ToolCallEndEvent;\n [EventType.TOOL_CALL_CHUNK]: ToolCallChunkEvent;\n [EventType.TOOL_CALL_RESULT]: ToolCallResultEvent;\n [EventType.THINKING_START]: ThinkingStartEvent;\n [EventType.THINKING_END]: ThinkingEndEvent;\n [EventType.STATE_SNAPSHOT]: StateSnapshotEvent;\n [EventType.STATE_DELTA]: StateDeltaEvent;\n [EventType.MESSAGES_SNAPSHOT]: MessagesSnapshotEvent;\n [EventType.ACTIVITY_SNAPSHOT]: ActivitySnapshotEvent;\n [EventType.ACTIVITY_DELTA]: ActivityDeltaEvent;\n [EventType.RAW]: RawEvent;\n [EventType.CUSTOM]: CustomEvent;\n [EventType.RUN_STARTED]: RunStartedEvent;\n [EventType.RUN_FINISHED]: RunFinishedEvent;\n [EventType.RUN_ERROR]: RunErrorEvent;\n [EventType.STEP_STARTED]: StepStartedEvent;\n [EventType.STEP_FINISHED]: StepFinishedEvent;\n};\nexport type AGUIEventOf<T extends EventType> = AGUIEventByType[T];\nexport type EventPayloadOf<T extends EventType> = Omit<AGUIEventOf<T>, keyof BaseEventFields>;\n\ntype EventProps<Schema extends z.ZodTypeAny> = Omit<z.input<Schema>, \"type\">;\n\nexport type BaseEventProps = EventProps<typeof BaseEventSchema>;\n\nexport type TextMessageStartEventProps = EventProps<typeof TextMessageStartEventSchema>;\nexport type TextMessageContentEventProps = EventProps<typeof TextMessageContentEventSchema>;\nexport type TextMessageEndEventProps = EventProps<typeof TextMessageEndEventSchema>;\nexport type TextMessageChunkEventProps = EventProps<typeof TextMessageChunkEventSchema>;\nexport type ThinkingTextMessageStartEventProps = EventProps<typeof ThinkingTextMessageStartEventSchema>;\nexport type ThinkingTextMessageContentEventProps = EventProps<\n typeof ThinkingTextMessageContentEventSchema\n>;\nexport type ThinkingTextMessageEndEventProps = EventProps<typeof ThinkingTextMessageEndEventSchema>;\nexport type ToolCallStartEventProps = EventProps<typeof ToolCallStartEventSchema>;\nexport type ToolCallArgsEventProps = EventProps<typeof ToolCallArgsEventSchema>;\nexport type ToolCallEndEventProps = EventProps<typeof ToolCallEndEventSchema>;\nexport type ToolCallChunkEventProps = EventProps<typeof ToolCallChunkEventSchema>;\nexport type ToolCallResultEventProps = EventProps<typeof ToolCallResultEventSchema>;\nexport type ThinkingStartEventProps = EventProps<typeof ThinkingStartEventSchema>;\nexport type ThinkingEndEventProps = EventProps<typeof ThinkingEndEventSchema>;\nexport type StateSnapshotEventProps = EventProps<typeof StateSnapshotEventSchema>;\nexport type StateDeltaEventProps = EventProps<typeof StateDeltaEventSchema>;\nexport type MessagesSnapshotEventProps = EventProps<typeof MessagesSnapshotEventSchema>;\nexport type ActivitySnapshotEventProps = EventProps<typeof ActivitySnapshotEventSchema>;\nexport type ActivityDeltaEventProps = EventProps<typeof ActivityDeltaEventSchema>;\nexport type RawEventProps = EventProps<typeof RawEventSchema>;\nexport type CustomEventProps = EventProps<typeof CustomEventSchema>;\nexport type RunStartedEventProps = EventProps<typeof RunStartedEventSchema>;\nexport type RunFinishedEventProps = EventProps<typeof RunFinishedEventSchema>;\nexport type RunErrorEventProps = EventProps<typeof RunErrorEventSchema>;\nexport type StepStartedEventProps = EventProps<typeof StepStartedEventSchema>;\nexport type StepFinishedEventProps = EventProps<typeof StepFinishedEventSchema>;\n\nexport type TextMessageStartEvent = z.infer<typeof TextMessageStartEventSchema>;\nexport type TextMessageContentEvent = z.infer<typeof TextMessageContentEventSchema>;\nexport type TextMessageEndEvent = z.infer<typeof TextMessageEndEventSchema>;\nexport type TextMessageChunkEvent = z.infer<typeof TextMessageChunkEventSchema>;\nexport type ThinkingTextMessageStartEvent = z.infer<typeof ThinkingTextMessageStartEventSchema>;\nexport type ThinkingTextMessageContentEvent = z.infer<typeof ThinkingTextMessageContentEventSchema>;\nexport type ThinkingTextMessageEndEvent = z.infer<typeof ThinkingTextMessageEndEventSchema>;\nexport type ToolCallStartEvent = z.infer<typeof ToolCallStartEventSchema>;\nexport type ToolCallArgsEvent = z.infer<typeof ToolCallArgsEventSchema>;\nexport type ToolCallEndEvent = z.infer<typeof ToolCallEndEventSchema>;\nexport type ToolCallChunkEvent = z.infer<typeof ToolCallChunkEventSchema>;\nexport type ToolCallResultEvent = z.infer<typeof ToolCallResultEventSchema>;\nexport type ThinkingStartEvent = z.infer<typeof ThinkingStartEventSchema>;\nexport type ThinkingEndEvent = z.infer<typeof ThinkingEndEventSchema>;\nexport type StateSnapshotEvent = z.infer<typeof StateSnapshotEventSchema>;\nexport type StateDeltaEvent = z.infer<typeof StateDeltaEventSchema>;\nexport type MessagesSnapshotEvent = z.infer<typeof MessagesSnapshotEventSchema>;\nexport type ActivitySnapshotEvent = z.infer<typeof ActivitySnapshotEventSchema>;\nexport type ActivityDeltaEvent = z.infer<typeof ActivityDeltaEventSchema>;\nexport type RawEvent = z.infer<typeof RawEventSchema>;\nexport type CustomEvent = z.infer<typeof CustomEventSchema>;\nexport type RunStartedEvent = z.infer<typeof RunStartedEventSchema>;\nexport type RunFinishedEvent = z.infer<typeof RunFinishedEventSchema>;\nexport type RunErrorEvent = z.infer<typeof RunErrorEventSchema>;\nexport type StepStartedEvent = z.infer<typeof StepStartedEventSchema>;\nexport type StepFinishedEvent = z.infer<typeof StepFinishedEventSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,MAAM,EAAE,OAAO;AAAA,EACf,WAAW,EAAE,OAAO;AACtB,CAAC;AAEM,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,IAAI,EAAE,OAAO;AAAA,EACb,MAAM,EAAE,QAAQ,UAAU;AAAA,EAC1B,UAAU;AACZ,CAAC;AAEM,IAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,IAAI,EAAE,OAAO;AAAA,EACb,MAAM,EAAE,OAAO;AAAA,EACf,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAM,EAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;AAEM,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,MAAM,EAAE,QAAQ,MAAM;AAAA,EACtB,MAAM,EAAE,OAAO;AACjB,CAAC;AAED,IAAM,iCAAiC,EAAE,OAAO;AAAA,EAC9C,MAAM,EAAE,QAAQ,QAAQ;AAAA,EACxB,UAAU,EAAE,OAAO;AAAA,EACnB,IAAI,EAAE,OAAO,EAAE,SAAS;AAAA,EACxB,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA,EACzB,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,UAAU,EAAE,OAAO,EAAE,SAAS;AAChC,CAAC;AAED,IAAM,sBAAsB,CAC1B,OACA,QACG;A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3D,MAAMA,GAAE,QAAQ,iCAAsB;AAAA,EACtC,UAAUA,GAAE,OAAO;AAAA,EACnB,OAAOA,GAAE,OAAO;AAAA,EAChB,QAAQA,GAAE,IAAI,EAAE,SAAS;AAC3B,CAAC;AAEM,IAAM,sBAAsB,gBAAgB,OAAO;AAAA,EACxD,MAAMA,GAAE,QAAQ,2BAAmB;AAAA,EACnC,SAASA,GAAE,OAAO;AAAA,EAClB,MAAMA,GAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;AAEM,IAAM,yBAAyB,gBAAgB,OAAO;AAAA,EAC3D,MAAMA,GAAE,QAAQ,iCAAsB;AAAA,EACtC,UAAUA,GAAE,OAAO;AACrB,CAAC;AAEM,IAAM,0BAA0B,gBAAgB,OAAO;AAAA,EAC5D,MAAMA,GAAE,QAAQ,mCAAuB;AAAA,EACvC,UAAUA,GAAE,OAAO;AACrB,CAAC;AAEM,IAAM,eAAeA,GAAE,mBAAmB,QAAQ;AAAA,EACvD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":["z","z","EventType"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ag-ui/core",
3
3
  "author": "Markus Ecker <markus.ecker@gmail.com>",
4
- "version": "0.0.44",
4
+ "version": "0.0.45-alpha.0",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"