@ag-ui/core 0.0.57 → 0.0.58
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 +388 -19
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +388 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +137 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +134 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -1
package/dist/index.mjs
CHANGED
|
@@ -449,7 +449,7 @@ const ToolCallStartEventSchema = BaseEventSchema.extend({
|
|
|
449
449
|
type: z.literal(EventType.TOOL_CALL_START),
|
|
450
450
|
toolCallId: z.string(),
|
|
451
451
|
toolCallName: z.string(),
|
|
452
|
-
parentMessageId: z.string().optional()
|
|
452
|
+
parentMessageId: z.string().nullable().optional().transform((v) => v ?? void 0)
|
|
453
453
|
});
|
|
454
454
|
const ToolCallArgsEventSchema = BaseEventSchema.extend({
|
|
455
455
|
type: z.literal(EventType.TOOL_CALL_ARGS),
|
|
@@ -471,7 +471,7 @@ const ToolCallChunkEventSchema = BaseEventSchema.extend({
|
|
|
471
471
|
type: z.literal(EventType.TOOL_CALL_CHUNK),
|
|
472
472
|
toolCallId: z.string().optional(),
|
|
473
473
|
toolCallName: z.string().optional(),
|
|
474
|
-
parentMessageId: z.string().optional(),
|
|
474
|
+
parentMessageId: z.string().nullable().optional().transform((v) => v ?? void 0),
|
|
475
475
|
delta: z.string().optional()
|
|
476
476
|
});
|
|
477
477
|
/**
|
|
@@ -533,17 +533,28 @@ const RunFinishedInterruptOutcomeSchema = z.object({
|
|
|
533
533
|
interrupts: z.array(InterruptSchema).min(1)
|
|
534
534
|
}).strict();
|
|
535
535
|
const RunFinishedOutcomeSchema = z.discriminatedUnion("type", [RunFinishedSuccessOutcomeSchema, RunFinishedInterruptOutcomeSchema]);
|
|
536
|
+
const TokenUsageSchema = z.object({
|
|
537
|
+
provider: z.string().optional(),
|
|
538
|
+
model: z.string().optional(),
|
|
539
|
+
inputTokens: z.number().int().nonnegative().optional(),
|
|
540
|
+
outputTokens: z.number().int().nonnegative().optional(),
|
|
541
|
+
totalTokens: z.number().int().nonnegative().optional(),
|
|
542
|
+
reasoningTokens: z.number().int().nonnegative().optional(),
|
|
543
|
+
cachedInputTokens: z.number().int().nonnegative().optional()
|
|
544
|
+
});
|
|
536
545
|
const RunFinishedEventSchema = BaseEventSchema.extend({
|
|
537
546
|
type: z.literal(EventType.RUN_FINISHED),
|
|
538
547
|
threadId: z.string(),
|
|
539
548
|
runId: z.string(),
|
|
540
549
|
result: z.any().optional(),
|
|
541
|
-
outcome: RunFinishedOutcomeSchema.nullable().optional().transform((v) => v ?? void 0)
|
|
550
|
+
outcome: RunFinishedOutcomeSchema.nullable().optional().transform((v) => v ?? void 0),
|
|
551
|
+
usage: z.array(TokenUsageSchema).optional()
|
|
542
552
|
});
|
|
543
553
|
const RunErrorEventSchema = BaseEventSchema.extend({
|
|
544
554
|
type: z.literal(EventType.RUN_ERROR),
|
|
545
555
|
message: z.string(),
|
|
546
|
-
code: z.string().optional()
|
|
556
|
+
code: z.string().optional(),
|
|
557
|
+
usage: z.array(TokenUsageSchema).optional()
|
|
547
558
|
});
|
|
548
559
|
const StepStartedEventSchema = BaseEventSchema.extend({
|
|
549
560
|
type: z.literal(EventType.STEP_STARTED),
|
|
@@ -624,5 +635,123 @@ const EventSchemas = z.discriminatedUnion("type", [
|
|
|
624
635
|
]);
|
|
625
636
|
|
|
626
637
|
//#endregion
|
|
627
|
-
|
|
638
|
+
//#region src/token-usage.ts
|
|
639
|
+
/**
|
|
640
|
+
* Accept a value only if it is a real, finite number.
|
|
641
|
+
*
|
|
642
|
+
* Shared by both vendor mappers so they guard identically. Providers do hand
|
|
643
|
+
* over strings, `null`s and `NaN`s in their usage metadata, and a bad value must
|
|
644
|
+
* not reach the wire: consumers validate every incoming event and throw on
|
|
645
|
+
* failure, so one malformed count would fail an otherwise-successful run at its
|
|
646
|
+
* final event — costing the user the answer, not just the token count.
|
|
647
|
+
*/
|
|
648
|
+
const num = (v) => typeof v === "number" && Number.isFinite(v) ? v : void 0;
|
|
649
|
+
/**
|
|
650
|
+
* Read a property from a value of unknown shape, yielding `undefined` for
|
|
651
|
+
* anything that is not an object. Lets the mappers take `unknown` rather than
|
|
652
|
+
* `any` — vendor payloads are untrusted, so every access should be narrowed
|
|
653
|
+
* rather than assumed.
|
|
654
|
+
*/
|
|
655
|
+
const prop = (v, key) => typeof v === "object" && v !== null ? v[key] : void 0;
|
|
656
|
+
const COUNT_KEYS = [
|
|
657
|
+
"inputTokens",
|
|
658
|
+
"outputTokens",
|
|
659
|
+
"totalTokens",
|
|
660
|
+
"reasoningTokens",
|
|
661
|
+
"cachedInputTokens"
|
|
662
|
+
];
|
|
663
|
+
/**
|
|
664
|
+
* Build a {@link TokenUsage} from already-guarded counts, or `undefined` when no
|
|
665
|
+
* count survived. Returning `undefined` rather than a labels-only entry keeps
|
|
666
|
+
* "the provider reported no usage" distinct from "the provider reported usage",
|
|
667
|
+
* so callers omit the field instead of emitting an entry that claims nothing.
|
|
668
|
+
*/
|
|
669
|
+
function buildEntry(counts, { provider, model }) {
|
|
670
|
+
if (!COUNT_KEYS.some((key) => counts[key] !== void 0)) return void 0;
|
|
671
|
+
const entry = {};
|
|
672
|
+
if (provider != null) entry.provider = provider;
|
|
673
|
+
if (model != null) entry.model = model;
|
|
674
|
+
for (const key of COUNT_KEYS) {
|
|
675
|
+
const value = counts[key];
|
|
676
|
+
if (value !== void 0) entry[key] = value;
|
|
677
|
+
}
|
|
678
|
+
return entry;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Map a LangChain-family `usage_metadata` object into an AG-UI {@link TokenUsage}.
|
|
682
|
+
*
|
|
683
|
+
* LangChain and LangGraph both attach usage as `{ input_tokens, output_tokens,
|
|
684
|
+
* total_tokens, input_token_details: { cache_read }, output_token_details:
|
|
685
|
+
* { reasoning } }`. This maps only those numeric counts plus optional
|
|
686
|
+
* provider/model labels — never prompt/completion content. Returns `undefined`
|
|
687
|
+
* when no usable count is present, so callers can omit usage rather than
|
|
688
|
+
* report zeros.
|
|
689
|
+
*/
|
|
690
|
+
function tokenUsageFromLangChainMetadata(usageMetadata, { provider, model }) {
|
|
691
|
+
if (!usageMetadata) return void 0;
|
|
692
|
+
const inputDetails = prop(usageMetadata, "input_token_details");
|
|
693
|
+
const outputDetails = prop(usageMetadata, "output_token_details");
|
|
694
|
+
return buildEntry({
|
|
695
|
+
inputTokens: num(prop(usageMetadata, "input_tokens")),
|
|
696
|
+
outputTokens: num(prop(usageMetadata, "output_tokens")),
|
|
697
|
+
totalTokens: num(prop(usageMetadata, "total_tokens")),
|
|
698
|
+
reasoningTokens: num(prop(outputDetails, "reasoning")),
|
|
699
|
+
cachedInputTokens: num(prop(inputDetails, "cache_read"))
|
|
700
|
+
}, {
|
|
701
|
+
provider,
|
|
702
|
+
model
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Map an AI-SDK (v5) `LanguageModelUsage` object into an AG-UI {@link TokenUsage}.
|
|
707
|
+
*
|
|
708
|
+
* AI-SDK's keys already match: `inputTokens`, `outputTokens`, `totalTokens`,
|
|
709
|
+
* `reasoningTokens`, `cachedInputTokens`. AI-SDK reports `NaN`/`undefined` for
|
|
710
|
+
* counts a provider didn't return, so only finite numbers are copied. Returns
|
|
711
|
+
* `undefined` when no finite count is present (so callers omit empty usage).
|
|
712
|
+
*/
|
|
713
|
+
function tokenUsageFromAiSdkUsage(usage, { provider, model }) {
|
|
714
|
+
if (!usage) return void 0;
|
|
715
|
+
return buildEntry({
|
|
716
|
+
inputTokens: num(prop(usage, "inputTokens")),
|
|
717
|
+
outputTokens: num(prop(usage, "outputTokens")),
|
|
718
|
+
totalTokens: num(prop(usage, "totalTokens")),
|
|
719
|
+
reasoningTokens: num(prop(usage, "reasoningTokens")),
|
|
720
|
+
cachedInputTokens: num(prop(usage, "cachedInputTokens"))
|
|
721
|
+
}, {
|
|
722
|
+
provider,
|
|
723
|
+
model
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Sum per-call {@link TokenUsage} entries into one entry per `(provider, model)`
|
|
728
|
+
* pair. Order follows first appearance. A count field stays `undefined` when no
|
|
729
|
+
* member of the group reported it, so "not reported" stays distinct from zero.
|
|
730
|
+
*
|
|
731
|
+
* Protocol-agnostic: works on any producer's `TokenUsage[]`, so integrations
|
|
732
|
+
* share it rather than reimplementing aggregation.
|
|
733
|
+
*/
|
|
734
|
+
function aggregateTokenUsage(entries) {
|
|
735
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
736
|
+
for (const entry of entries) {
|
|
737
|
+
const key = `${entry.provider ?? ""} ${entry.model ?? ""}`;
|
|
738
|
+
let target = grouped.get(key);
|
|
739
|
+
if (!target) {
|
|
740
|
+
target = {
|
|
741
|
+
provider: entry.provider,
|
|
742
|
+
model: entry.model
|
|
743
|
+
};
|
|
744
|
+
grouped.set(key, target);
|
|
745
|
+
}
|
|
746
|
+
for (const field of COUNT_KEYS) {
|
|
747
|
+
const value = entry[field];
|
|
748
|
+
if (value == null) continue;
|
|
749
|
+
target[field] = (target[field] ?? 0) + value;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
return [...grouped.values()];
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
//#endregion
|
|
756
|
+
export { AGUIConnectNotImplementedError, AGUIError, ActivityDeltaEventSchema, ActivityMessageSchema, ActivitySnapshotEventSchema, AgentCapabilitiesSchema, AssistantMessageSchema, AudioInputContentSchema, AudioInputPartSchema, BaseEventSchema, BaseMessageSchema, BinaryInputContentSchema, ContextSchema, CustomEventSchema, DeveloperMessageSchema, DocumentInputContentSchema, DocumentInputPartSchema, EventSchemas, EventType, ExecutionCapabilitiesSchema, FunctionCallSchema, HumanInTheLoopCapabilitiesSchema, IdentityCapabilitiesSchema, ImageInputContentSchema, ImageInputPartSchema, InputContentDataSourceSchema, InputContentSchema, InputContentSourceSchema, InputContentUrlSourceSchema, InterruptSchema, MessageSchema, MessagesSnapshotEventSchema, MultiAgentCapabilitiesSchema, MultimodalCapabilitiesSchema, MultimodalInputCapabilitiesSchema, MultimodalOutputCapabilitiesSchema, OutputCapabilitiesSchema, RawEventSchema, ReasoningCapabilitiesSchema, ReasoningEncryptedValueEventSchema, ReasoningEncryptedValueSubtypeSchema, ReasoningEndEventSchema, ReasoningMessageChunkEventSchema, ReasoningMessageContentEventSchema, ReasoningMessageEndEventSchema, ReasoningMessageSchema, ReasoningMessageStartEventSchema, ReasoningStartEventSchema, ResumeEntrySchema, RoleSchema, RunAgentInputSchema, RunErrorEventSchema, RunFinishedEventSchema, RunFinishedInterruptOutcomeSchema, RunFinishedOutcomeSchema, RunFinishedSuccessOutcomeSchema, RunStartedEventSchema, StateCapabilitiesSchema, StateDeltaEventSchema, StateSchema, StateSnapshotEventSchema, StepFinishedEventSchema, StepStartedEventSchema, SubAgentInfoSchema, SystemMessageSchema, TextInputContentSchema, TextMessageChunkEventSchema, TextMessageContentEventSchema, TextMessageEndEventSchema, TextMessageStartEventSchema, ThinkingEndEventSchema, ThinkingStartEventSchema, ThinkingTextMessageContentEventSchema, ThinkingTextMessageEndEventSchema, ThinkingTextMessageStartEventSchema, TokenUsageSchema, ToolCallArgsEventSchema, ToolCallChunkEventSchema, ToolCallEndEventSchema, ToolCallResultEventSchema, ToolCallSchema, ToolCallStartEventSchema, ToolMessageSchema, ToolSchema, ToolsCapabilitiesSchema, TransportCapabilitiesSchema, UserMessageSchema, VideoInputContentSchema, VideoInputPartSchema, aggregateTokenUsage, tokenUsageFromAiSdkUsage, tokenUsageFromLangChainMetadata };
|
|
628
757
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/types.ts","../src/capabilities.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 encryptedValue: z.string().optional(),\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 encryptedValue: z.string().optional(),\n});\n\nexport const TextInputContentSchema = z.object({\n type: z.literal(\"text\"),\n text: z.string(),\n});\n\nexport const InputContentDataSourceSchema = z.object({\n type: z.literal(\"data\"),\n value: z.string(),\n mimeType: z.string(),\n});\n\nexport const InputContentUrlSourceSchema = z.object({\n type: z.literal(\"url\"),\n value: z.string(),\n mimeType: z.string().optional(),\n});\n\nexport const InputContentSourceSchema = z.discriminatedUnion(\"type\", [\n InputContentDataSourceSchema,\n InputContentUrlSourceSchema,\n]);\n\nexport const ImageInputContentSchema = z.object({\n type: z.literal(\"image\"),\n source: InputContentSourceSchema,\n metadata: z.unknown().optional(),\n});\n\nexport const AudioInputContentSchema = z.object({\n type: z.literal(\"audio\"),\n source: InputContentSourceSchema,\n metadata: z.unknown().optional(),\n});\n\nexport const VideoInputContentSchema = z.object({\n type: z.literal(\"video\"),\n source: InputContentSourceSchema,\n metadata: z.unknown().optional(),\n});\n\nexport const DocumentInputContentSchema = z.object({\n type: z.literal(\"document\"),\n source: InputContentSourceSchema,\n metadata: z.unknown().optional(),\n});\n\nexport const ImageInputPartSchema = ImageInputContentSchema;\nexport const AudioInputPartSchema = AudioInputContentSchema;\nexport const VideoInputPartSchema = VideoInputContentSchema;\nexport const DocumentInputPartSchema = DocumentInputContentSchema;\n\nconst LegacyBinaryInputContentObjectSchema = 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 = LegacyBinaryInputContentObjectSchema.superRefine(\n (value, ctx) => {\n ensureBinaryPayload(value, ctx);\n },\n);\n\nconst InputContentBaseSchema = z.discriminatedUnion(\"type\", [\n TextInputContentSchema,\n ImageInputContentSchema,\n AudioInputContentSchema,\n VideoInputContentSchema,\n DocumentInputContentSchema,\n LegacyBinaryInputContentObjectSchema,\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 encryptedValue: z.string().optional(),\n});\n\nexport const ActivityMessageSchema = z.object({\n id: z.string(),\n role: z.literal(\"activity\"),\n activityType: z.string(),\n content: z.record(z.any()),\n});\n\nexport const ReasoningMessageSchema = z.object({\n id: z.string(),\n role: z.literal(\"reasoning\"),\n content: z.string(),\n encryptedValue: z.string().optional(),\n});\n\nexport const MessageSchema = z.discriminatedUnion(\"role\", [\n DeveloperMessageSchema,\n SystemMessageSchema,\n AssistantMessageSchema,\n UserMessageSchema,\n ToolMessageSchema,\n ActivityMessageSchema,\n ReasoningMessageSchema,\n]);\n\nexport const RoleSchema = z.union([\n z.literal(\"developer\"),\n z.literal(\"system\"),\n z.literal(\"assistant\"),\n z.literal(\"user\"),\n z.literal(\"tool\"),\n z.literal(\"activity\"),\n z.literal(\"reasoning\"),\n]);\n\nexport const ContextSchema = z.object({\n description: z.string(),\n value: z.string(),\n});\n\nexport const ToolSchema = z.object({\n name: z.string(),\n description: z.string(),\n parameters: z.any(), // JSON Schema for the tool parameters\n metadata: z.record(z.any()).optional(), // Arbitrary tool metadata (e.g. a2ui schema)\n});\n\nexport const InterruptSchema = z.object({\n id: z.string(),\n reason: z.string(),\n message: z.string().optional(),\n toolCallId: z.string().optional(),\n responseSchema: z.record(z.any()).optional(),\n expiresAt: z.string().optional(),\n metadata: z.record(z.any()).optional(),\n});\n\nexport const ResumeEntrySchema = z.object({\n interruptId: z.string(),\n status: z.enum([\"resolved\", \"cancelled\"]),\n payload: z.any().optional(),\n});\n\nexport const RunAgentInputSchema = z.object({\n threadId: z.string(),\n runId: z.string(),\n parentRunId: z.string().optional(),\n state: z.any(),\n messages: z.array(MessageSchema),\n tools: z.array(ToolSchema),\n context: z.array(ContextSchema),\n forwardedProps: z.any(),\n resume: z.array(ResumeEntrySchema).optional(),\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 InputContentDataSource = z.infer<typeof InputContentDataSourceSchema>;\nexport type InputContentUrlSource = z.infer<typeof InputContentUrlSourceSchema>;\nexport type InputContentSource = z.infer<typeof InputContentSourceSchema>;\nexport type ImageInputContent = z.infer<typeof ImageInputContentSchema>;\nexport type AudioInputContent = z.infer<typeof AudioInputContentSchema>;\nexport type VideoInputContent = z.infer<typeof VideoInputContentSchema>;\nexport type DocumentInputContent = z.infer<typeof DocumentInputContentSchema>;\nexport type ImageInputPart = ImageInputContent;\nexport type AudioInputPart = AudioInputContent;\nexport type VideoInputPart = VideoInputContent;\nexport type DocumentInputPart = DocumentInputContent;\nexport type BinaryInputContent = z.infer<typeof BinaryInputContentSchema>;\nexport type InputContent = z.infer<typeof InputContentSchema>;\nexport type InputContentPart = 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 ReasoningMessage = z.infer<typeof ReasoningMessageSchema>;\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>;\nexport type Interrupt = z.infer<typeof InterruptSchema>;\nexport type ResumeEntry = z.infer<typeof ResumeEntrySchema>;\nexport type ResumeStatus = z.infer<typeof ResumeEntrySchema>[\"status\"];\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 { ToolSchema } from \"./types\";\n\n/** Describes a sub-agent that can be invoked by a parent agent. */\nexport const SubAgentInfoSchema = z.object({\n /** Unique name or identifier of the sub-agent. */\n name: z.string(),\n /** What this sub-agent specializes in. Helps clients build agent selection UIs. */\n description: z.string().optional(),\n});\n\n/**\n * Basic metadata about the agent. Useful for discovery UIs, agent marketplaces,\n * and debugging. Set these when you want clients to display agent information\n * or when multiple agents are available and users need to pick one.\n */\nexport const IdentityCapabilitiesSchema = z.object({\n /** Human-readable name shown in UIs and agent selectors. */\n name: z.string().optional(),\n /** The framework or platform powering this agent (e.g., \"langgraph\", \"mastra\", \"crewai\"). */\n type: z.string().optional(),\n /** What this agent does — helps users and routing logic decide when to use it. */\n description: z.string().optional(),\n /** Semantic version of the agent (e.g., \"1.2.0\"). Useful for compatibility checks. */\n version: z.string().optional(),\n /** Organization or team that maintains this agent. */\n provider: z.string().optional(),\n /** URL to the agent's documentation or homepage. */\n documentationUrl: z.string().optional(),\n /** Arbitrary key-value pairs for integration-specific identity info. */\n metadata: z.record(z.unknown()).optional(),\n});\n\n/**\n * Declares which transport mechanisms the agent supports. Clients use this\n * to pick the best connection strategy. Only set flags to `true` for transports\n * your agent actually handles — omit or set `false` for unsupported ones.\n */\nexport const TransportCapabilitiesSchema = z.object({\n /** Set `true` if the agent streams responses via SSE. Most agents enable this. */\n streaming: z.boolean().optional(),\n /** Set `true` if the agent accepts persistent WebSocket connections. */\n websocket: z.boolean().optional(),\n /** Set `true` if the agent supports the AG-UI binary protocol (protobuf over HTTP). */\n httpBinary: z.boolean().optional(),\n /** Set `true` if the agent can send async updates via webhooks after a run finishes. */\n pushNotifications: z.boolean().optional(),\n /** Set `true` if the agent supports resuming interrupted streams via sequence numbers. */\n resumable: z.boolean().optional(),\n});\n\n/**\n * Tool calling capabilities. Distinguishes between tools the agent itself provides\n * (listed in `items`) and tools the client passes at runtime via `RunAgentInput.tools`.\n * Enable this when your agent can call functions, search the web, execute code, etc.\n */\nexport const ToolsCapabilitiesSchema = z.object({\n /** Set `true` if the agent can make tool calls at all. Set `false` to explicitly\n * signal tool calling is disabled even if items are present. */\n supported: z.boolean().optional(),\n /** The tools this agent provides on its own (full JSON Schema definitions).\n * These are distinct from client-provided tools passed in `RunAgentInput.tools`. */\n items: z.array(ToolSchema).optional(),\n /** Set `true` if the agent can invoke multiple tools concurrently within a single step. */\n parallelCalls: z.boolean().optional(),\n /** Set `true` if the agent accepts and uses tools provided by the client at runtime. */\n clientProvided: z.boolean().optional(),\n});\n\n/**\n * Output format support. Enable `structuredOutput` when your agent can return\n * responses conforming to a JSON schema, which is useful for programmatic consumption.\n */\nexport const OutputCapabilitiesSchema = z.object({\n /** Set `true` if the agent can produce structured JSON output matching a provided schema. */\n structuredOutput: z.boolean().optional(),\n /** MIME types the agent can produce (e.g., `[\"text/plain\", \"application/json\"]`).\n * Omit if the agent only produces plain text. */\n supportedMimeTypes: z.array(z.string()).optional(),\n});\n\n/**\n * State and memory management capabilities. These tell the client how the agent\n * handles shared state and whether conversation context persists across runs.\n */\nexport const StateCapabilitiesSchema = z.object({\n /** Set `true` if the agent emits `STATE_SNAPSHOT` events (full state replacement). */\n snapshots: z.boolean().optional(),\n /** Set `true` if the agent emits `STATE_DELTA` events (JSON Patch incremental updates). */\n deltas: z.boolean().optional(),\n /** Set `true` if the agent has long-term memory beyond the current thread\n * (e.g., vector store, knowledge base, or cross-session recall). */\n memory: z.boolean().optional(),\n /** Set `true` if state is preserved across multiple runs within the same thread.\n * When `false`, state resets on each run. */\n persistentState: z.boolean().optional(),\n});\n\n/**\n * Multi-agent coordination capabilities. Enable these when your agent can\n * orchestrate or hand off work to other agents.\n */\nexport const MultiAgentCapabilitiesSchema = z.object({\n /** Set `true` if the agent participates in any form of multi-agent coordination. */\n supported: z.boolean().optional(),\n /** Set `true` if the agent can delegate subtasks to other agents while retaining control. */\n delegation: z.boolean().optional(),\n /** Set `true` if the agent can transfer the conversation entirely to another agent. */\n handoffs: z.boolean().optional(),\n /** List of sub-agents this agent can invoke. Helps clients build agent selection UIs. */\n subAgents: z.array(SubAgentInfoSchema).optional(),\n});\n\n/**\n * Reasoning and thinking capabilities. Enable these when your agent exposes its\n * internal thought process (e.g., chain-of-thought, extended thinking).\n */\nexport const ReasoningCapabilitiesSchema = z.object({\n /** Set `true` if the agent produces reasoning/thinking tokens visible to the client. */\n supported: z.boolean().optional(),\n /** Set `true` if reasoning tokens are streamed incrementally (vs. returned all at once). */\n streaming: z.boolean().optional(),\n /** Set `true` if reasoning content is encrypted (zero-data-retention mode).\n * Clients should expect opaque `encryptedValue` fields instead of readable content. */\n encrypted: z.boolean().optional(),\n});\n\n/**\n * Modalities the agent can accept as input. Clients use this to show/hide\n * file upload buttons, audio recorders, image pickers, etc.\n */\nexport const MultimodalInputCapabilitiesSchema = z.object({\n /** Set `true` if the agent can process image inputs (e.g., screenshots, photos). */\n image: z.boolean().optional(),\n /** Set `true` if the agent can process audio inputs (speech, recordings). */\n audio: z.boolean().optional(),\n /** Set `true` if the agent can process video inputs. */\n video: z.boolean().optional(),\n /** Set `true` if the agent can process PDF documents. */\n pdf: z.boolean().optional(),\n /** Set `true` if the agent can process arbitrary file uploads. */\n file: z.boolean().optional(),\n});\n\n/**\n * Modalities the agent can produce as output. Clients use this to anticipate\n * rich content in the agent's response.\n */\nexport const MultimodalOutputCapabilitiesSchema = z.object({\n /** Set `true` if the agent can generate images as part of its response. */\n image: z.boolean().optional(),\n /** Set `true` if the agent can produce audio output (text-to-speech, audio files). */\n audio: z.boolean().optional(),\n});\n\n/**\n * Multimodal input and output support. Organized into `input` and `output`\n * sub-objects so clients can independently query what the agent accepts\n * versus what it produces.\n */\nexport const MultimodalCapabilitiesSchema = z.object({\n /** Modalities the agent can accept as input (images, audio, video, PDFs, files). */\n input: MultimodalInputCapabilitiesSchema.optional(),\n /** Modalities the agent can produce as output (images, audio). */\n output: MultimodalOutputCapabilitiesSchema.optional(),\n});\n\n/**\n * Execution control and limits. Declare these so clients can set expectations\n * about how long or how many steps an agent run might take.\n */\nexport const ExecutionCapabilitiesSchema = z.object({\n /** Set `true` if the agent can execute code (e.g., Python, JavaScript) during a run. */\n codeExecution: z.boolean().optional(),\n /** Set `true` if code execution happens in a sandboxed/isolated environment.\n * Only meaningful when `codeExecution` is `true`. */\n sandboxed: z.boolean().optional(),\n /** Maximum number of tool-call/reasoning iterations the agent will perform per run.\n * Helps clients display progress or set timeout expectations. */\n maxIterations: z.number().optional(),\n /** Maximum wall-clock time (in milliseconds) the agent will run before timing out. */\n maxExecutionTime: z.number().optional(),\n});\n\n/**\n * Human-in-the-loop interaction support. Enable these when your agent can pause\n * execution to request human input, approval, or feedback before continuing.\n */\nexport const HumanInTheLoopCapabilitiesSchema = z.object({\n /** Set `true` if the agent supports any form of human-in-the-loop interaction. */\n supported: z.boolean().optional(),\n /** Set `true` if the agent can pause and request explicit approval before\n * performing sensitive actions (e.g., sending emails, deleting data). */\n approvals: z.boolean().optional(),\n /** Set `true` if the agent allows humans to intervene and modify its plan mid-execution. */\n interventions: z.boolean().optional(),\n /** Set `true` if the agent can incorporate user feedback (thumbs up/down, corrections)\n * to improve its behavior within the current session. */\n feedback: z.boolean().optional(),\n /** Set `true` if the agent participates in the AG-UI interrupt protocol\n * (emits RUN_FINISHED with outcome={ type: \"interrupt\", interrupts: [...] },\n * accepts resume[]). */\n interrupts: z.boolean().optional(),\n /** Set `true` if tool-call interrupts accept editedArgs in the resume payload.\n * Only meaningful when interrupts is true. */\n approveWithEdits: z.boolean().optional(),\n});\n\n/**\n * A typed, categorized snapshot of an agent's current capabilities.\n * Returned by `getCapabilities()` on `AbstractAgent`.\n *\n * All fields are optional — agents only declare what they support.\n * Omitted fields mean the capability is not declared (unknown), not that\n * it's unsupported.\n *\n * The `custom` field is an escape hatch for integration-specific capabilities\n * that don't fit into the standard categories.\n */\nexport const AgentCapabilitiesSchema = z.object({\n /** Agent identity and metadata. */\n identity: IdentityCapabilitiesSchema.optional(),\n /** Supported transport mechanisms (SSE, WebSocket, binary, etc.). */\n transport: TransportCapabilitiesSchema.optional(),\n /** Tools the agent provides and tool calling configuration. */\n tools: ToolsCapabilitiesSchema.optional(),\n /** Output format support (structured output, MIME types). */\n output: OutputCapabilitiesSchema.optional(),\n /** State and memory management (snapshots, deltas, persistence). */\n state: StateCapabilitiesSchema.optional(),\n /** Multi-agent coordination (delegation, handoffs, sub-agents). */\n multiAgent: MultiAgentCapabilitiesSchema.optional(),\n /** Reasoning and thinking support (chain-of-thought, encrypted thinking). */\n reasoning: ReasoningCapabilitiesSchema.optional(),\n /** Multimodal input/output support (images, audio, video, files). */\n multimodal: MultimodalCapabilitiesSchema.optional(),\n /** Execution control and limits (code execution, timeouts, iteration caps). */\n execution: ExecutionCapabilitiesSchema.optional(),\n /** Human-in-the-loop support (approvals, interventions, feedback). */\n humanInTheLoop: HumanInTheLoopCapabilitiesSchema.optional(),\n /** Integration-specific capabilities not covered by the standard categories. */\n custom: z.record(z.unknown()).optional(),\n});\n\n/** Describes a sub-agent that can be invoked by a parent agent. */\nexport type SubAgentInfo = z.infer<typeof SubAgentInfoSchema>;\n/** Agent identity and metadata for discovery UIs, marketplaces, and debugging. */\nexport type IdentityCapabilities = z.infer<typeof IdentityCapabilitiesSchema>;\n/** Supported transport mechanisms (SSE, WebSocket, binary protocol, push notifications). */\nexport type TransportCapabilities = z.infer<typeof TransportCapabilitiesSchema>;\n/** Tool calling support and agent-provided tool definitions. */\nexport type ToolsCapabilities = z.infer<typeof ToolsCapabilitiesSchema>;\n/** Output format support (structured output, MIME types). */\nexport type OutputCapabilities = z.infer<typeof OutputCapabilitiesSchema>;\n/** State and memory management (snapshots, deltas, persistence, long-term memory). */\nexport type StateCapabilities = z.infer<typeof StateCapabilitiesSchema>;\n/** Multi-agent coordination (delegation, handoffs, sub-agent orchestration). */\nexport type MultiAgentCapabilities = z.infer<typeof MultiAgentCapabilitiesSchema>;\n/** Reasoning and thinking visibility (streaming, encrypted chain-of-thought). */\nexport type ReasoningCapabilities = z.infer<typeof ReasoningCapabilitiesSchema>;\n/** Modalities the agent can accept as input (images, audio, video, PDFs, files). */\nexport type MultimodalInputCapabilities = z.infer<typeof MultimodalInputCapabilitiesSchema>;\n/** Modalities the agent can produce as output (images, audio). */\nexport type MultimodalOutputCapabilities = z.infer<typeof MultimodalOutputCapabilitiesSchema>;\n/** Multimodal input/output support (images, audio, video, PDFs, file uploads). */\nexport type MultimodalCapabilities = z.infer<typeof MultimodalCapabilitiesSchema>;\n/** Execution control and limits (code execution, sandboxing, iteration caps, timeouts). */\nexport type ExecutionCapabilities = z.infer<typeof ExecutionCapabilitiesSchema>;\n/** Human-in-the-loop interaction support (approvals, interventions, feedback). */\nexport type HumanInTheLoopCapabilities = z.infer<typeof HumanInTheLoopCapabilitiesSchema>;\n/** A typed, categorized snapshot of an agent's current capabilities. Returned by `getCapabilities()`. */\nexport type AgentCapabilities = z.infer<typeof AgentCapabilitiesSchema>;\n","import { z } from \"zod\";\nimport { MessageSchema, StateSchema, RunAgentInputSchema, InterruptSchema } 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 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 /**\n * @deprecated Use REASONING_START instead. Will be removed in 1.0.0.\n */\n THINKING_START = \"THINKING_START\",\n /**\n * @deprecated Use REASONING_END instead. Will be removed in 1.0.0.\n */\n THINKING_END = \"THINKING_END\",\n /**\n * @deprecated Use REASONING_MESSAGE_START instead. Will be removed in 1.0.0.\n */\n THINKING_TEXT_MESSAGE_START = \"THINKING_TEXT_MESSAGE_START\",\n /**\n * @deprecated Use REASONING_MESSAGE_CONTENT instead. Will be removed in 1.0.0.\n */\n THINKING_TEXT_MESSAGE_CONTENT = \"THINKING_TEXT_MESSAGE_CONTENT\",\n /**\n * @deprecated Use REASONING_MESSAGE_END instead. Will be removed in 1.0.0.\n */\n THINKING_TEXT_MESSAGE_END = \"THINKING_TEXT_MESSAGE_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 REASONING_START = \"REASONING_START\",\n REASONING_MESSAGE_START = \"REASONING_MESSAGE_START\",\n REASONING_MESSAGE_CONTENT = \"REASONING_MESSAGE_CONTENT\",\n REASONING_MESSAGE_END = \"REASONING_MESSAGE_END\",\n REASONING_MESSAGE_CHUNK = \"REASONING_MESSAGE_CHUNK\",\n REASONING_END = \"REASONING_END\",\n REASONING_ENCRYPTED_VALUE = \"REASONING_ENCRYPTED_VALUE\",\n}\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 name: z.string().optional(),\n});\n\nexport const TextMessageContentEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_CONTENT),\n messageId: z.string(),\n delta: z.string(),\n});\n\nexport const TextMessageEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_END),\n messageId: z.string(),\n});\n\nexport const TextMessageChunkEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_CHUNK),\n messageId: z.string().optional(),\n role: TextMessageRoleSchema.optional(),\n delta: z.string().optional(),\n name: z.string().optional(),\n});\n\n/**\n * @deprecated Use ReasoningMessageStartEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingTextMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_START),\n});\n\n/**\n * @deprecated Use ReasoningMessageContentEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingTextMessageContentEventSchema = TextMessageContentEventSchema.omit({\n messageId: true,\n type: true,\n}).extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_CONTENT),\n});\n\n/**\n * @deprecated Use ReasoningMessageEndEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingTextMessageEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_END),\n});\n\nexport const ToolCallStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_START),\n toolCallId: z.string(),\n toolCallName: z.string(),\n 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\n/**\n * @deprecated Use ReasoningStartEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_START),\n title: z.string().optional(),\n});\n\n/**\n * @deprecated Use ReasoningEndEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_END),\n});\n\nexport const StateSnapshotEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STATE_SNAPSHOT),\n snapshot: StateSchema,\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 RunFinishedSuccessOutcomeSchema = z\n .object({\n type: z.literal(\"success\"),\n })\n .strict();\n\nexport const RunFinishedInterruptOutcomeSchema = z\n .object({\n type: z.literal(\"interrupt\"),\n interrupts: z.array(InterruptSchema).min(1),\n })\n .strict();\n\nexport const RunFinishedOutcomeSchema = z.discriminatedUnion(\"type\", [\n RunFinishedSuccessOutcomeSchema,\n RunFinishedInterruptOutcomeSchema,\n]);\n\nexport const RunFinishedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RUN_FINISHED),\n threadId: z.string(),\n runId: z.string(),\n result: z.any().optional(),\n // Accept `null` and treat it as omitted, so producers like the Pydantic-based\n // Python SDK that serialize via `model_dump()` (without `exclude_none=True`)\n // and emit `\"outcome\": null` for the legacy no-outcome case still validate.\n outcome: RunFinishedOutcomeSchema.nullable().optional().transform((v) => v ?? undefined),\n});\n\nexport const RunErrorEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RUN_ERROR),\n message: z.string(),\n code: z.string().optional(),\n});\n\nexport const StepStartedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STEP_STARTED),\n stepName: z.string(),\n});\n\nexport const StepFinishedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STEP_FINISHED),\n stepName: z.string(),\n});\n\n// Schema for the encrypted signature subtype\nexport const ReasoningEncryptedValueSubtypeSchema = z.union([\n z.literal(\"tool-call\"),\n z.literal(\"message\"),\n]);\n\nexport const ReasoningStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_START),\n messageId: z.string(),\n});\n\nexport const ReasoningMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_MESSAGE_START),\n messageId: z.string(),\n role: z.literal(\"reasoning\"),\n});\n\nexport const ReasoningMessageContentEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_MESSAGE_CONTENT),\n messageId: z.string(),\n delta: z.string(),\n});\n\nexport const ReasoningMessageEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_MESSAGE_END),\n messageId: z.string(),\n});\n\nexport const ReasoningMessageChunkEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_MESSAGE_CHUNK),\n messageId: z.string().optional(),\n delta: z.string().optional(),\n});\n\nexport const ReasoningEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_END),\n messageId: z.string(),\n});\n\nexport const ReasoningEncryptedValueEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_ENCRYPTED_VALUE),\n subtype: ReasoningEncryptedValueSubtypeSchema,\n entityId: z.string(),\n encryptedValue: z.string(),\n});\n\nexport const EventSchemas = z.discriminatedUnion(\"type\", [\n TextMessageStartEventSchema,\n TextMessageContentEventSchema,\n TextMessageEndEventSchema,\n TextMessageChunkEventSchema,\n ThinkingStartEventSchema,\n ThinkingEndEventSchema,\n ThinkingTextMessageStartEventSchema,\n ThinkingTextMessageContentEventSchema,\n ThinkingTextMessageEndEventSchema,\n ToolCallStartEventSchema,\n ToolCallArgsEventSchema,\n ToolCallEndEventSchema,\n ToolCallChunkEventSchema,\n ToolCallResultEventSchema,\n StateSnapshotEventSchema,\n StateDeltaEventSchema,\n MessagesSnapshotEventSchema,\n ActivitySnapshotEventSchema,\n ActivityDeltaEventSchema,\n RawEventSchema,\n CustomEventSchema,\n RunStartedEventSchema,\n RunFinishedEventSchema,\n RunErrorEventSchema,\n StepStartedEventSchema,\n StepFinishedEventSchema,\n ReasoningStartEventSchema,\n ReasoningMessageStartEventSchema,\n ReasoningMessageContentEventSchema,\n ReasoningMessageEndEventSchema,\n ReasoningMessageChunkEventSchema,\n ReasoningEndEventSchema,\n ReasoningEncryptedValueEventSchema,\n]);\n\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 [EventType.REASONING_START]: ReasoningStartEvent;\n [EventType.REASONING_MESSAGE_START]: ReasoningMessageStartEvent;\n [EventType.REASONING_MESSAGE_CONTENT]: ReasoningMessageContentEvent;\n [EventType.REASONING_MESSAGE_END]: ReasoningMessageEndEvent;\n [EventType.REASONING_MESSAGE_CHUNK]: ReasoningMessageChunkEvent;\n [EventType.REASONING_END]: ReasoningEndEvent;\n [EventType.REASONING_ENCRYPTED_VALUE]: ReasoningEncryptedValueEvent;\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<\n typeof ThinkingTextMessageStartEventSchema\n>;\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>;\nexport type ReasoningStartEventProps = EventProps<typeof ReasoningStartEventSchema>;\nexport type ReasoningMessageStartEventProps = EventProps<typeof ReasoningMessageStartEventSchema>;\nexport type ReasoningMessageContentEventProps = EventProps<\n typeof ReasoningMessageContentEventSchema\n>;\nexport type ReasoningMessageEndEventProps = EventProps<typeof ReasoningMessageEndEventSchema>;\nexport type ReasoningMessageChunkEventProps = EventProps<typeof ReasoningMessageChunkEventSchema>;\nexport type ReasoningEndEventProps = EventProps<typeof ReasoningEndEventSchema>;\nexport type ReasoningEncryptedValueEventProps = EventProps<\n typeof ReasoningEncryptedValueEventSchema\n>;\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 RunFinishedOutcome = z.infer<typeof RunFinishedOutcomeSchema>;\nexport type RunFinishedSuccessOutcome = z.infer<typeof RunFinishedSuccessOutcomeSchema>;\nexport type RunFinishedInterruptOutcome = z.infer<typeof RunFinishedInterruptOutcomeSchema>;\nexport type RunErrorEvent = z.infer<typeof RunErrorEventSchema>;\nexport type StepStartedEvent = z.infer<typeof StepStartedEventSchema>;\nexport type StepFinishedEvent = z.infer<typeof StepFinishedEventSchema>;\nexport type ReasoningStartEvent = z.infer<typeof ReasoningStartEventSchema>;\nexport type ReasoningMessageStartEvent = z.infer<typeof ReasoningMessageStartEventSchema>;\nexport type ReasoningMessageContentEvent = z.infer<typeof ReasoningMessageContentEventSchema>;\nexport type ReasoningMessageEndEvent = z.infer<typeof ReasoningMessageEndEventSchema>;\nexport type ReasoningMessageChunkEvent = z.infer<typeof ReasoningMessageChunkEventSchema>;\nexport type ReasoningEndEvent = z.infer<typeof ReasoningEndEventSchema>;\nexport type ReasoningEncryptedValueEvent = z.infer<typeof ReasoningEncryptedValueEventSchema>;\nexport type ReasoningEncryptedValueSubtype = z.infer<typeof ReasoningEncryptedValueSubtypeSchema>;\n"],"mappings":";;;AAEA,MAAa,qBAAqB,EAAE,OAAO;CACzC,MAAM,EAAE,QAAQ;CAChB,WAAW,EAAE,QAAQ;CACtB,CAAC;AAEF,MAAa,iBAAiB,EAAE,OAAO;CACrC,IAAI,EAAE,QAAQ;CACd,MAAM,EAAE,QAAQ,WAAW;CAC3B,UAAU;CACV,gBAAgB,EAAE,QAAQ,CAAC,UAAU;CACtC,CAAC;AAEF,MAAa,oBAAoB,EAAE,OAAO;CACxC,IAAI,EAAE,Q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MAAa,4BAA4B,gBAAgB,OAAO;CAC9D,MAAM,EAAE,QAAQ,UAAU,gBAAgB;CAC1C,WAAW,EAAE,QAAQ;CACtB,CAAC;AAEF,MAAa,mCAAmC,gBAAgB,OAAO;CACrE,MAAM,EAAE,QAAQ,UAAU,wBAAwB;CAClD,WAAW,EAAE,QAAQ;CACrB,MAAM,EAAE,QAAQ,YAAY;CAC7B,CAAC;AAEF,MAAa,qCAAqC,gBAAgB,OAAO;CACvE,MAAM,EAAE,QAAQ,UAAU,0BAA0B;CACpD,WAAW,EAAE,QAAQ;CACrB,OAAO,EAAE,QAAQ;CAClB,CAAC;AAEF,MAAa,iCAAiC,gBAAgB,OAAO;CACnE,MAAM,EAAE,QAAQ,UAAU,sBAAsB;CAChD,WAAW,EAAE,QAAQ;CACtB,CAAC;AAEF,MAAa,mCAAmC,gBAAgB,OAAO;CACrE,MAAM,EAAE,QAAQ,UAAU,wBAAwB;CAClD,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC7B,CAAC;AAEF,MAAa,0BAA0B,gBAAgB,OAAO;CAC5D,MAAM,EAAE,QAAQ,UAAU,cAAc;CACxC,WAAW,EAAE,QAAQ;CACtB,CAAC;AAEF,MAAa,qCAAqC,gBAAgB,OAAO;CACvE,MAAM,EAAE,QAAQ,UAAU,0BAA0B;CACpD,SAAS;CACT,UAAU,EAAE,QAAQ;CACpB,gBAAgB,EAAE,QAAQ;CAC3B,CAAC;AAEF,MAAa,eAAe,EAAE,mBAAmB,QAAQ;CACvD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/types.ts","../src/capabilities.ts","../src/events.ts","../src/token-usage.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 encryptedValue: z.string().optional(),\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 encryptedValue: z.string().optional(),\n});\n\nexport const TextInputContentSchema = z.object({\n type: z.literal(\"text\"),\n text: z.string(),\n});\n\nexport const InputContentDataSourceSchema = z.object({\n type: z.literal(\"data\"),\n value: z.string(),\n mimeType: z.string(),\n});\n\nexport const InputContentUrlSourceSchema = z.object({\n type: z.literal(\"url\"),\n value: z.string(),\n mimeType: z.string().optional(),\n});\n\nexport const InputContentSourceSchema = z.discriminatedUnion(\"type\", [\n InputContentDataSourceSchema,\n InputContentUrlSourceSchema,\n]);\n\nexport const ImageInputContentSchema = z.object({\n type: z.literal(\"image\"),\n source: InputContentSourceSchema,\n metadata: z.unknown().optional(),\n});\n\nexport const AudioInputContentSchema = z.object({\n type: z.literal(\"audio\"),\n source: InputContentSourceSchema,\n metadata: z.unknown().optional(),\n});\n\nexport const VideoInputContentSchema = z.object({\n type: z.literal(\"video\"),\n source: InputContentSourceSchema,\n metadata: z.unknown().optional(),\n});\n\nexport const DocumentInputContentSchema = z.object({\n type: z.literal(\"document\"),\n source: InputContentSourceSchema,\n metadata: z.unknown().optional(),\n});\n\nexport const ImageInputPartSchema = ImageInputContentSchema;\nexport const AudioInputPartSchema = AudioInputContentSchema;\nexport const VideoInputPartSchema = VideoInputContentSchema;\nexport const DocumentInputPartSchema = DocumentInputContentSchema;\n\nconst LegacyBinaryInputContentObjectSchema = 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 = LegacyBinaryInputContentObjectSchema.superRefine(\n (value, ctx) => {\n ensureBinaryPayload(value, ctx);\n },\n);\n\nconst InputContentBaseSchema = z.discriminatedUnion(\"type\", [\n TextInputContentSchema,\n ImageInputContentSchema,\n AudioInputContentSchema,\n VideoInputContentSchema,\n DocumentInputContentSchema,\n LegacyBinaryInputContentObjectSchema,\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 encryptedValue: z.string().optional(),\n});\n\nexport const ActivityMessageSchema = z.object({\n id: z.string(),\n role: z.literal(\"activity\"),\n activityType: z.string(),\n content: z.record(z.any()),\n});\n\nexport const ReasoningMessageSchema = z.object({\n id: z.string(),\n role: z.literal(\"reasoning\"),\n content: z.string(),\n encryptedValue: z.string().optional(),\n});\n\nexport const MessageSchema = z.discriminatedUnion(\"role\", [\n DeveloperMessageSchema,\n SystemMessageSchema,\n AssistantMessageSchema,\n UserMessageSchema,\n ToolMessageSchema,\n ActivityMessageSchema,\n ReasoningMessageSchema,\n]);\n\nexport const RoleSchema = z.union([\n z.literal(\"developer\"),\n z.literal(\"system\"),\n z.literal(\"assistant\"),\n z.literal(\"user\"),\n z.literal(\"tool\"),\n z.literal(\"activity\"),\n z.literal(\"reasoning\"),\n]);\n\nexport const ContextSchema = z.object({\n description: z.string(),\n value: z.string(),\n});\n\nexport const ToolSchema = z.object({\n name: z.string(),\n description: z.string(),\n parameters: z.any(), // JSON Schema for the tool parameters\n metadata: z.record(z.any()).optional(), // Arbitrary tool metadata (e.g. a2ui schema)\n});\n\nexport const InterruptSchema = z.object({\n id: z.string(),\n reason: z.string(),\n message: z.string().optional(),\n toolCallId: z.string().optional(),\n responseSchema: z.record(z.any()).optional(),\n expiresAt: z.string().optional(),\n metadata: z.record(z.any()).optional(),\n});\n\nexport const ResumeEntrySchema = z.object({\n interruptId: z.string(),\n status: z.enum([\"resolved\", \"cancelled\"]),\n payload: z.any().optional(),\n});\n\nexport const RunAgentInputSchema = z.object({\n threadId: z.string(),\n runId: z.string(),\n parentRunId: z.string().optional(),\n state: z.any(),\n messages: z.array(MessageSchema),\n tools: z.array(ToolSchema),\n context: z.array(ContextSchema),\n forwardedProps: z.any(),\n resume: z.array(ResumeEntrySchema).optional(),\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 InputContentDataSource = z.infer<typeof InputContentDataSourceSchema>;\nexport type InputContentUrlSource = z.infer<typeof InputContentUrlSourceSchema>;\nexport type InputContentSource = z.infer<typeof InputContentSourceSchema>;\nexport type ImageInputContent = z.infer<typeof ImageInputContentSchema>;\nexport type AudioInputContent = z.infer<typeof AudioInputContentSchema>;\nexport type VideoInputContent = z.infer<typeof VideoInputContentSchema>;\nexport type DocumentInputContent = z.infer<typeof DocumentInputContentSchema>;\nexport type ImageInputPart = ImageInputContent;\nexport type AudioInputPart = AudioInputContent;\nexport type VideoInputPart = VideoInputContent;\nexport type DocumentInputPart = DocumentInputContent;\nexport type BinaryInputContent = z.infer<typeof BinaryInputContentSchema>;\nexport type InputContent = z.infer<typeof InputContentSchema>;\nexport type InputContentPart = 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 ReasoningMessage = z.infer<typeof ReasoningMessageSchema>;\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>;\nexport type Interrupt = z.infer<typeof InterruptSchema>;\nexport type ResumeEntry = z.infer<typeof ResumeEntrySchema>;\nexport type ResumeStatus = z.infer<typeof ResumeEntrySchema>[\"status\"];\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 { ToolSchema } from \"./types\";\n\n/** Describes a sub-agent that can be invoked by a parent agent. */\nexport const SubAgentInfoSchema = z.object({\n /** Unique name or identifier of the sub-agent. */\n name: z.string(),\n /** What this sub-agent specializes in. Helps clients build agent selection UIs. */\n description: z.string().optional(),\n});\n\n/**\n * Basic metadata about the agent. Useful for discovery UIs, agent marketplaces,\n * and debugging. Set these when you want clients to display agent information\n * or when multiple agents are available and users need to pick one.\n */\nexport const IdentityCapabilitiesSchema = z.object({\n /** Human-readable name shown in UIs and agent selectors. */\n name: z.string().optional(),\n /** The framework or platform powering this agent (e.g., \"langgraph\", \"mastra\", \"crewai\"). */\n type: z.string().optional(),\n /** What this agent does — helps users and routing logic decide when to use it. */\n description: z.string().optional(),\n /** Semantic version of the agent (e.g., \"1.2.0\"). Useful for compatibility checks. */\n version: z.string().optional(),\n /** Organization or team that maintains this agent. */\n provider: z.string().optional(),\n /** URL to the agent's documentation or homepage. */\n documentationUrl: z.string().optional(),\n /** Arbitrary key-value pairs for integration-specific identity info. */\n metadata: z.record(z.unknown()).optional(),\n});\n\n/**\n * Declares which transport mechanisms the agent supports. Clients use this\n * to pick the best connection strategy. Only set flags to `true` for transports\n * your agent actually handles — omit or set `false` for unsupported ones.\n */\nexport const TransportCapabilitiesSchema = z.object({\n /** Set `true` if the agent streams responses via SSE. Most agents enable this. */\n streaming: z.boolean().optional(),\n /** Set `true` if the agent accepts persistent WebSocket connections. */\n websocket: z.boolean().optional(),\n /** Set `true` if the agent supports the AG-UI binary protocol (protobuf over HTTP). */\n httpBinary: z.boolean().optional(),\n /** Set `true` if the agent can send async updates via webhooks after a run finishes. */\n pushNotifications: z.boolean().optional(),\n /** Set `true` if the agent supports resuming interrupted streams via sequence numbers. */\n resumable: z.boolean().optional(),\n});\n\n/**\n * Tool calling capabilities. Distinguishes between tools the agent itself provides\n * (listed in `items`) and tools the client passes at runtime via `RunAgentInput.tools`.\n * Enable this when your agent can call functions, search the web, execute code, etc.\n */\nexport const ToolsCapabilitiesSchema = z.object({\n /** Set `true` if the agent can make tool calls at all. Set `false` to explicitly\n * signal tool calling is disabled even if items are present. */\n supported: z.boolean().optional(),\n /** The tools this agent provides on its own (full JSON Schema definitions).\n * These are distinct from client-provided tools passed in `RunAgentInput.tools`. */\n items: z.array(ToolSchema).optional(),\n /** Set `true` if the agent can invoke multiple tools concurrently within a single step. */\n parallelCalls: z.boolean().optional(),\n /** Set `true` if the agent accepts and uses tools provided by the client at runtime. */\n clientProvided: z.boolean().optional(),\n});\n\n/**\n * Output format support. Enable `structuredOutput` when your agent can return\n * responses conforming to a JSON schema, which is useful for programmatic consumption.\n */\nexport const OutputCapabilitiesSchema = z.object({\n /** Set `true` if the agent can produce structured JSON output matching a provided schema. */\n structuredOutput: z.boolean().optional(),\n /** MIME types the agent can produce (e.g., `[\"text/plain\", \"application/json\"]`).\n * Omit if the agent only produces plain text. */\n supportedMimeTypes: z.array(z.string()).optional(),\n});\n\n/**\n * State and memory management capabilities. These tell the client how the agent\n * handles shared state and whether conversation context persists across runs.\n */\nexport const StateCapabilitiesSchema = z.object({\n /** Set `true` if the agent emits `STATE_SNAPSHOT` events (full state replacement). */\n snapshots: z.boolean().optional(),\n /** Set `true` if the agent emits `STATE_DELTA` events (JSON Patch incremental updates). */\n deltas: z.boolean().optional(),\n /** Set `true` if the agent has long-term memory beyond the current thread\n * (e.g., vector store, knowledge base, or cross-session recall). */\n memory: z.boolean().optional(),\n /** Set `true` if state is preserved across multiple runs within the same thread.\n * When `false`, state resets on each run. */\n persistentState: z.boolean().optional(),\n});\n\n/**\n * Multi-agent coordination capabilities. Enable these when your agent can\n * orchestrate or hand off work to other agents.\n */\nexport const MultiAgentCapabilitiesSchema = z.object({\n /** Set `true` if the agent participates in any form of multi-agent coordination. */\n supported: z.boolean().optional(),\n /** Set `true` if the agent can delegate subtasks to other agents while retaining control. */\n delegation: z.boolean().optional(),\n /** Set `true` if the agent can transfer the conversation entirely to another agent. */\n handoffs: z.boolean().optional(),\n /** List of sub-agents this agent can invoke. Helps clients build agent selection UIs. */\n subAgents: z.array(SubAgentInfoSchema).optional(),\n});\n\n/**\n * Reasoning and thinking capabilities. Enable these when your agent exposes its\n * internal thought process (e.g., chain-of-thought, extended thinking).\n */\nexport const ReasoningCapabilitiesSchema = z.object({\n /** Set `true` if the agent produces reasoning/thinking tokens visible to the client. */\n supported: z.boolean().optional(),\n /** Set `true` if reasoning tokens are streamed incrementally (vs. returned all at once). */\n streaming: z.boolean().optional(),\n /** Set `true` if reasoning content is encrypted (zero-data-retention mode).\n * Clients should expect opaque `encryptedValue` fields instead of readable content. */\n encrypted: z.boolean().optional(),\n});\n\n/**\n * Modalities the agent can accept as input. Clients use this to show/hide\n * file upload buttons, audio recorders, image pickers, etc.\n */\nexport const MultimodalInputCapabilitiesSchema = z.object({\n /** Set `true` if the agent can process image inputs (e.g., screenshots, photos). */\n image: z.boolean().optional(),\n /** Set `true` if the agent can process audio inputs (speech, recordings). */\n audio: z.boolean().optional(),\n /** Set `true` if the agent can process video inputs. */\n video: z.boolean().optional(),\n /** Set `true` if the agent can process PDF documents. */\n pdf: z.boolean().optional(),\n /** Set `true` if the agent can process arbitrary file uploads. */\n file: z.boolean().optional(),\n});\n\n/**\n * Modalities the agent can produce as output. Clients use this to anticipate\n * rich content in the agent's response.\n */\nexport const MultimodalOutputCapabilitiesSchema = z.object({\n /** Set `true` if the agent can generate images as part of its response. */\n image: z.boolean().optional(),\n /** Set `true` if the agent can produce audio output (text-to-speech, audio files). */\n audio: z.boolean().optional(),\n});\n\n/**\n * Multimodal input and output support. Organized into `input` and `output`\n * sub-objects so clients can independently query what the agent accepts\n * versus what it produces.\n */\nexport const MultimodalCapabilitiesSchema = z.object({\n /** Modalities the agent can accept as input (images, audio, video, PDFs, files). */\n input: MultimodalInputCapabilitiesSchema.optional(),\n /** Modalities the agent can produce as output (images, audio). */\n output: MultimodalOutputCapabilitiesSchema.optional(),\n});\n\n/**\n * Execution control and limits. Declare these so clients can set expectations\n * about how long or how many steps an agent run might take.\n */\nexport const ExecutionCapabilitiesSchema = z.object({\n /** Set `true` if the agent can execute code (e.g., Python, JavaScript) during a run. */\n codeExecution: z.boolean().optional(),\n /** Set `true` if code execution happens in a sandboxed/isolated environment.\n * Only meaningful when `codeExecution` is `true`. */\n sandboxed: z.boolean().optional(),\n /** Maximum number of tool-call/reasoning iterations the agent will perform per run.\n * Helps clients display progress or set timeout expectations. */\n maxIterations: z.number().optional(),\n /** Maximum wall-clock time (in milliseconds) the agent will run before timing out. */\n maxExecutionTime: z.number().optional(),\n});\n\n/**\n * Human-in-the-loop interaction support. Enable these when your agent can pause\n * execution to request human input, approval, or feedback before continuing.\n */\nexport const HumanInTheLoopCapabilitiesSchema = z.object({\n /** Set `true` if the agent supports any form of human-in-the-loop interaction. */\n supported: z.boolean().optional(),\n /** Set `true` if the agent can pause and request explicit approval before\n * performing sensitive actions (e.g., sending emails, deleting data). */\n approvals: z.boolean().optional(),\n /** Set `true` if the agent allows humans to intervene and modify its plan mid-execution. */\n interventions: z.boolean().optional(),\n /** Set `true` if the agent can incorporate user feedback (thumbs up/down, corrections)\n * to improve its behavior within the current session. */\n feedback: z.boolean().optional(),\n /** Set `true` if the agent participates in the AG-UI interrupt protocol\n * (emits RUN_FINISHED with outcome={ type: \"interrupt\", interrupts: [...] },\n * accepts resume[]). */\n interrupts: z.boolean().optional(),\n /** Set `true` if tool-call interrupts accept editedArgs in the resume payload.\n * Only meaningful when interrupts is true. */\n approveWithEdits: z.boolean().optional(),\n});\n\n/**\n * A typed, categorized snapshot of an agent's current capabilities.\n * Returned by `getCapabilities()` on `AbstractAgent`.\n *\n * All fields are optional — agents only declare what they support.\n * Omitted fields mean the capability is not declared (unknown), not that\n * it's unsupported.\n *\n * The `custom` field is an escape hatch for integration-specific capabilities\n * that don't fit into the standard categories.\n */\nexport const AgentCapabilitiesSchema = z.object({\n /** Agent identity and metadata. */\n identity: IdentityCapabilitiesSchema.optional(),\n /** Supported transport mechanisms (SSE, WebSocket, binary, etc.). */\n transport: TransportCapabilitiesSchema.optional(),\n /** Tools the agent provides and tool calling configuration. */\n tools: ToolsCapabilitiesSchema.optional(),\n /** Output format support (structured output, MIME types). */\n output: OutputCapabilitiesSchema.optional(),\n /** State and memory management (snapshots, deltas, persistence). */\n state: StateCapabilitiesSchema.optional(),\n /** Multi-agent coordination (delegation, handoffs, sub-agents). */\n multiAgent: MultiAgentCapabilitiesSchema.optional(),\n /** Reasoning and thinking support (chain-of-thought, encrypted thinking). */\n reasoning: ReasoningCapabilitiesSchema.optional(),\n /** Multimodal input/output support (images, audio, video, files). */\n multimodal: MultimodalCapabilitiesSchema.optional(),\n /** Execution control and limits (code execution, timeouts, iteration caps). */\n execution: ExecutionCapabilitiesSchema.optional(),\n /** Human-in-the-loop support (approvals, interventions, feedback). */\n humanInTheLoop: HumanInTheLoopCapabilitiesSchema.optional(),\n /** Integration-specific capabilities not covered by the standard categories. */\n custom: z.record(z.unknown()).optional(),\n});\n\n/** Describes a sub-agent that can be invoked by a parent agent. */\nexport type SubAgentInfo = z.infer<typeof SubAgentInfoSchema>;\n/** Agent identity and metadata for discovery UIs, marketplaces, and debugging. */\nexport type IdentityCapabilities = z.infer<typeof IdentityCapabilitiesSchema>;\n/** Supported transport mechanisms (SSE, WebSocket, binary protocol, push notifications). */\nexport type TransportCapabilities = z.infer<typeof TransportCapabilitiesSchema>;\n/** Tool calling support and agent-provided tool definitions. */\nexport type ToolsCapabilities = z.infer<typeof ToolsCapabilitiesSchema>;\n/** Output format support (structured output, MIME types). */\nexport type OutputCapabilities = z.infer<typeof OutputCapabilitiesSchema>;\n/** State and memory management (snapshots, deltas, persistence, long-term memory). */\nexport type StateCapabilities = z.infer<typeof StateCapabilitiesSchema>;\n/** Multi-agent coordination (delegation, handoffs, sub-agent orchestration). */\nexport type MultiAgentCapabilities = z.infer<typeof MultiAgentCapabilitiesSchema>;\n/** Reasoning and thinking visibility (streaming, encrypted chain-of-thought). */\nexport type ReasoningCapabilities = z.infer<typeof ReasoningCapabilitiesSchema>;\n/** Modalities the agent can accept as input (images, audio, video, PDFs, files). */\nexport type MultimodalInputCapabilities = z.infer<typeof MultimodalInputCapabilitiesSchema>;\n/** Modalities the agent can produce as output (images, audio). */\nexport type MultimodalOutputCapabilities = z.infer<typeof MultimodalOutputCapabilitiesSchema>;\n/** Multimodal input/output support (images, audio, video, PDFs, file uploads). */\nexport type MultimodalCapabilities = z.infer<typeof MultimodalCapabilitiesSchema>;\n/** Execution control and limits (code execution, sandboxing, iteration caps, timeouts). */\nexport type ExecutionCapabilities = z.infer<typeof ExecutionCapabilitiesSchema>;\n/** Human-in-the-loop interaction support (approvals, interventions, feedback). */\nexport type HumanInTheLoopCapabilities = z.infer<typeof HumanInTheLoopCapabilitiesSchema>;\n/** A typed, categorized snapshot of an agent's current capabilities. Returned by `getCapabilities()`. */\nexport type AgentCapabilities = z.infer<typeof AgentCapabilitiesSchema>;\n","import { z } from \"zod\";\nimport { MessageSchema, StateSchema, RunAgentInputSchema, InterruptSchema } 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 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 /**\n * @deprecated Use REASONING_START instead. Will be removed in 1.0.0.\n */\n THINKING_START = \"THINKING_START\",\n /**\n * @deprecated Use REASONING_END instead. Will be removed in 1.0.0.\n */\n THINKING_END = \"THINKING_END\",\n /**\n * @deprecated Use REASONING_MESSAGE_START instead. Will be removed in 1.0.0.\n */\n THINKING_TEXT_MESSAGE_START = \"THINKING_TEXT_MESSAGE_START\",\n /**\n * @deprecated Use REASONING_MESSAGE_CONTENT instead. Will be removed in 1.0.0.\n */\n THINKING_TEXT_MESSAGE_CONTENT = \"THINKING_TEXT_MESSAGE_CONTENT\",\n /**\n * @deprecated Use REASONING_MESSAGE_END instead. Will be removed in 1.0.0.\n */\n THINKING_TEXT_MESSAGE_END = \"THINKING_TEXT_MESSAGE_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 REASONING_START = \"REASONING_START\",\n REASONING_MESSAGE_START = \"REASONING_MESSAGE_START\",\n REASONING_MESSAGE_CONTENT = \"REASONING_MESSAGE_CONTENT\",\n REASONING_MESSAGE_END = \"REASONING_MESSAGE_END\",\n REASONING_MESSAGE_CHUNK = \"REASONING_MESSAGE_CHUNK\",\n REASONING_END = \"REASONING_END\",\n REASONING_ENCRYPTED_VALUE = \"REASONING_ENCRYPTED_VALUE\",\n}\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 name: z.string().optional(),\n});\n\nexport const TextMessageContentEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_CONTENT),\n messageId: z.string(),\n delta: z.string(),\n});\n\nexport const TextMessageEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_END),\n messageId: z.string(),\n});\n\nexport const TextMessageChunkEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_CHUNK),\n messageId: z.string().optional(),\n role: TextMessageRoleSchema.optional(),\n delta: z.string().optional(),\n name: z.string().optional(),\n});\n\n/**\n * @deprecated Use ReasoningMessageStartEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingTextMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_START),\n});\n\n/**\n * @deprecated Use ReasoningMessageContentEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingTextMessageContentEventSchema = TextMessageContentEventSchema.omit({\n messageId: true,\n type: true,\n}).extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_CONTENT),\n});\n\n/**\n * @deprecated Use ReasoningMessageEndEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingTextMessageEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_END),\n});\n\nexport const ToolCallStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_START),\n toolCallId: z.string(),\n toolCallName: z.string(),\n // Accept `null` and treat it as omitted, so producers that serialize optional\n // fields as JSON `null` (e.g. the .NET Microsoft Agent Framework adapter,\n // whose System.Text.Json emits `\"parentMessageId\": null`) still validate\n // instead of aborting the run on the first tool call.\n parentMessageId: z\n .string()\n .nullable()\n .optional()\n .transform((v) => v ?? undefined),\n});\n\nexport const ToolCallArgsEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_ARGS),\n toolCallId: z.string(),\n delta: z.string(),\n});\n\nexport const ToolCallEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_END),\n toolCallId: z.string(),\n});\n\nexport const ToolCallResultEventSchema = BaseEventSchema.extend({\n messageId: z.string(),\n type: z.literal(EventType.TOOL_CALL_RESULT),\n toolCallId: z.string(),\n content: z.string(),\n role: z.literal(\"tool\").optional(),\n});\n\nexport const ToolCallChunkEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_CHUNK),\n toolCallId: z.string().optional(),\n toolCallName: z.string().optional(),\n // Accept `null` as omitted — same cross-language quirk as TOOL_CALL_START.\n parentMessageId: z\n .string()\n .nullable()\n .optional()\n .transform((v) => v ?? undefined),\n delta: z.string().optional(),\n});\n\n/**\n * @deprecated Use ReasoningStartEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_START),\n title: z.string().optional(),\n});\n\n/**\n * @deprecated Use ReasoningEndEventSchema instead. Will be removed in 1.0.0.\n */\nexport const ThinkingEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_END),\n});\n\nexport const StateSnapshotEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STATE_SNAPSHOT),\n snapshot: StateSchema,\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 RunFinishedSuccessOutcomeSchema = z\n .object({\n type: z.literal(\"success\"),\n })\n .strict();\n\nexport const RunFinishedInterruptOutcomeSchema = z\n .object({\n type: z.literal(\"interrupt\"),\n interrupts: z.array(InterruptSchema).min(1),\n })\n .strict();\n\nexport const RunFinishedOutcomeSchema = z.discriminatedUnion(\"type\", [\n RunFinishedSuccessOutcomeSchema,\n RunFinishedInterruptOutcomeSchema,\n]);\n\n// Reusable, numeric-only token usage summary. Deliberately carries no\n// content-bearing or identifying fields (no prompts, completions, messages,\n// thread/run/user IDs) — only provider/model labels and numeric token counts.\n// Unknown keys are stripped on parse, so content cannot ride along.\nexport const TokenUsageSchema = z.object({\n provider: z.string().optional(),\n model: z.string().optional(),\n // Counts are non-negative integers in every representation: proto `int64`,\n // C# `long?`, Python `int`. Constraining them here keeps TypeScript from\n // admitting values the other bindings cannot encode — `proto.encode` parses\n // against this schema and then writes via an int64 writer that throws on a\n // non-integer, so an unconstrained `z.number()` turns a bad producer value\n // into a mid-stream crash on the protobuf transport instead of a validation\n // error at the source.\n inputTokens: z.number().int().nonnegative().optional(),\n outputTokens: z.number().int().nonnegative().optional(),\n totalTokens: z.number().int().nonnegative().optional(),\n reasoningTokens: z.number().int().nonnegative().optional(),\n cachedInputTokens: z.number().int().nonnegative().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 // Accept `null` and treat it as omitted, so producers like the Pydantic-based\n // Python SDK that serialize via `model_dump()` (without `exclude_none=True`)\n // and emit `\"outcome\": null` for the legacy no-outcome case still validate.\n outcome: RunFinishedOutcomeSchema.nullable()\n .optional()\n .transform((v) => v ?? undefined),\n // Optional per-(provider, model) token usage for the completed run. An array\n // so runs that invoke multiple models keep them separate for downstream\n // display; consumers that only need totals can sum across entries. Must be\n // declared here (not relied upon via passthrough) so it survives the\n // `EventSchemas` discriminated-union parse.\n usage: z.array(TokenUsageSchema).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 // Optional partial usage for a run that failed after one or more model calls\n // completed. Same numeric-only shape as RUN_FINISHED.\n usage: z.array(TokenUsageSchema).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\n// Schema for the encrypted signature subtype\nexport const ReasoningEncryptedValueSubtypeSchema = z.union([\n z.literal(\"tool-call\"),\n z.literal(\"message\"),\n]);\n\nexport const ReasoningStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_START),\n messageId: z.string(),\n});\n\nexport const ReasoningMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_MESSAGE_START),\n messageId: z.string(),\n role: z.literal(\"reasoning\"),\n});\n\nexport const ReasoningMessageContentEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_MESSAGE_CONTENT),\n messageId: z.string(),\n delta: z.string(),\n});\n\nexport const ReasoningMessageEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_MESSAGE_END),\n messageId: z.string(),\n});\n\nexport const ReasoningMessageChunkEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_MESSAGE_CHUNK),\n messageId: z.string().optional(),\n delta: z.string().optional(),\n});\n\nexport const ReasoningEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_END),\n messageId: z.string(),\n});\n\nexport const ReasoningEncryptedValueEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.REASONING_ENCRYPTED_VALUE),\n subtype: ReasoningEncryptedValueSubtypeSchema,\n entityId: z.string(),\n encryptedValue: z.string(),\n});\n\nexport const EventSchemas = z.discriminatedUnion(\"type\", [\n TextMessageStartEventSchema,\n TextMessageContentEventSchema,\n TextMessageEndEventSchema,\n TextMessageChunkEventSchema,\n ThinkingStartEventSchema,\n ThinkingEndEventSchema,\n ThinkingTextMessageStartEventSchema,\n ThinkingTextMessageContentEventSchema,\n ThinkingTextMessageEndEventSchema,\n ToolCallStartEventSchema,\n ToolCallArgsEventSchema,\n ToolCallEndEventSchema,\n ToolCallChunkEventSchema,\n ToolCallResultEventSchema,\n StateSnapshotEventSchema,\n StateDeltaEventSchema,\n MessagesSnapshotEventSchema,\n ActivitySnapshotEventSchema,\n ActivityDeltaEventSchema,\n RawEventSchema,\n CustomEventSchema,\n RunStartedEventSchema,\n RunFinishedEventSchema,\n RunErrorEventSchema,\n StepStartedEventSchema,\n StepFinishedEventSchema,\n ReasoningStartEventSchema,\n ReasoningMessageStartEventSchema,\n ReasoningMessageContentEventSchema,\n ReasoningMessageEndEventSchema,\n ReasoningMessageChunkEventSchema,\n ReasoningEndEventSchema,\n ReasoningEncryptedValueEventSchema,\n]);\n\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 [EventType.REASONING_START]: ReasoningStartEvent;\n [EventType.REASONING_MESSAGE_START]: ReasoningMessageStartEvent;\n [EventType.REASONING_MESSAGE_CONTENT]: ReasoningMessageContentEvent;\n [EventType.REASONING_MESSAGE_END]: ReasoningMessageEndEvent;\n [EventType.REASONING_MESSAGE_CHUNK]: ReasoningMessageChunkEvent;\n [EventType.REASONING_END]: ReasoningEndEvent;\n [EventType.REASONING_ENCRYPTED_VALUE]: ReasoningEncryptedValueEvent;\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<\n typeof ThinkingTextMessageStartEventSchema\n>;\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>;\nexport type ReasoningStartEventProps = EventProps<typeof ReasoningStartEventSchema>;\nexport type ReasoningMessageStartEventProps = EventProps<typeof ReasoningMessageStartEventSchema>;\nexport type ReasoningMessageContentEventProps = EventProps<\n typeof ReasoningMessageContentEventSchema\n>;\nexport type ReasoningMessageEndEventProps = EventProps<typeof ReasoningMessageEndEventSchema>;\nexport type ReasoningMessageChunkEventProps = EventProps<typeof ReasoningMessageChunkEventSchema>;\nexport type ReasoningEndEventProps = EventProps<typeof ReasoningEndEventSchema>;\nexport type ReasoningEncryptedValueEventProps = EventProps<\n typeof ReasoningEncryptedValueEventSchema\n>;\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 TokenUsage = z.infer<typeof TokenUsageSchema>;\nexport type RunFinishedOutcome = z.infer<typeof RunFinishedOutcomeSchema>;\nexport type RunFinishedSuccessOutcome = z.infer<typeof RunFinishedSuccessOutcomeSchema>;\nexport type RunFinishedInterruptOutcome = z.infer<typeof RunFinishedInterruptOutcomeSchema>;\nexport type RunErrorEvent = z.infer<typeof RunErrorEventSchema>;\nexport type StepStartedEvent = z.infer<typeof StepStartedEventSchema>;\nexport type StepFinishedEvent = z.infer<typeof StepFinishedEventSchema>;\nexport type ReasoningStartEvent = z.infer<typeof ReasoningStartEventSchema>;\nexport type ReasoningMessageStartEvent = z.infer<typeof ReasoningMessageStartEventSchema>;\nexport type ReasoningMessageContentEvent = z.infer<typeof ReasoningMessageContentEventSchema>;\nexport type ReasoningMessageEndEvent = z.infer<typeof ReasoningMessageEndEventSchema>;\nexport type ReasoningMessageChunkEvent = z.infer<typeof ReasoningMessageChunkEventSchema>;\nexport type ReasoningEndEvent = z.infer<typeof ReasoningEndEventSchema>;\nexport type ReasoningEncryptedValueEvent = z.infer<typeof ReasoningEncryptedValueEventSchema>;\nexport type ReasoningEncryptedValueSubtype = z.infer<typeof ReasoningEncryptedValueSubtypeSchema>;\n","import { TokenUsage } from \"./events\";\n\n/**\n * Accept a value only if it is a real, finite number.\n *\n * Shared by both vendor mappers so they guard identically. Providers do hand\n * over strings, `null`s and `NaN`s in their usage metadata, and a bad value must\n * not reach the wire: consumers validate every incoming event and throw on\n * failure, so one malformed count would fail an otherwise-successful run at its\n * final event — costing the user the answer, not just the token count.\n */\nconst num = (v: unknown): number | undefined =>\n typeof v === \"number\" && Number.isFinite(v) ? v : undefined;\n\n/**\n * Read a property from a value of unknown shape, yielding `undefined` for\n * anything that is not an object. Lets the mappers take `unknown` rather than\n * `any` — vendor payloads are untrusted, so every access should be narrowed\n * rather than assumed.\n */\nconst prop = (v: unknown, key: string): unknown =>\n typeof v === \"object\" && v !== null ? (v as Record<string, unknown>)[key] : undefined;\n\nconst COUNT_KEYS = [\n \"inputTokens\",\n \"outputTokens\",\n \"totalTokens\",\n \"reasoningTokens\",\n \"cachedInputTokens\",\n] as const;\n\n/**\n * Build a {@link TokenUsage} from already-guarded counts, or `undefined` when no\n * count survived. Returning `undefined` rather than a labels-only entry keeps\n * \"the provider reported no usage\" distinct from \"the provider reported usage\",\n * so callers omit the field instead of emitting an entry that claims nothing.\n */\nfunction buildEntry(\n counts: Partial<Record<(typeof COUNT_KEYS)[number], number | undefined>>,\n { provider, model }: { provider?: string; model?: string },\n): TokenUsage | undefined {\n if (!COUNT_KEYS.some((key) => counts[key] !== undefined)) return undefined;\n\n const entry: TokenUsage = {};\n if (provider != null) entry.provider = provider;\n if (model != null) entry.model = model;\n for (const key of COUNT_KEYS) {\n const value = counts[key];\n if (value !== undefined) entry[key] = value;\n }\n return entry;\n}\n\n/**\n * Map a LangChain-family `usage_metadata` object into an AG-UI {@link TokenUsage}.\n *\n * LangChain and LangGraph both attach usage as `{ input_tokens, output_tokens,\n * total_tokens, input_token_details: { cache_read }, output_token_details:\n * { reasoning } }`. This maps only those numeric counts plus optional\n * provider/model labels — never prompt/completion content. Returns `undefined`\n * when no usable count is present, so callers can omit usage rather than\n * report zeros.\n */\nexport function tokenUsageFromLangChainMetadata(\n usageMetadata: unknown,\n { provider, model }: { provider?: string; model?: string },\n): TokenUsage | undefined {\n if (!usageMetadata) return undefined;\n\n const inputDetails = prop(usageMetadata, \"input_token_details\");\n const outputDetails = prop(usageMetadata, \"output_token_details\");\n\n return buildEntry(\n {\n inputTokens: num(prop(usageMetadata, \"input_tokens\")),\n outputTokens: num(prop(usageMetadata, \"output_tokens\")),\n totalTokens: num(prop(usageMetadata, \"total_tokens\")),\n reasoningTokens: num(prop(outputDetails, \"reasoning\")),\n cachedInputTokens: num(prop(inputDetails, \"cache_read\")),\n },\n { provider, model },\n );\n}\n\n/**\n * Map an AI-SDK (v5) `LanguageModelUsage` object into an AG-UI {@link TokenUsage}.\n *\n * AI-SDK's keys already match: `inputTokens`, `outputTokens`, `totalTokens`,\n * `reasoningTokens`, `cachedInputTokens`. AI-SDK reports `NaN`/`undefined` for\n * counts a provider didn't return, so only finite numbers are copied. Returns\n * `undefined` when no finite count is present (so callers omit empty usage).\n */\nexport function tokenUsageFromAiSdkUsage(\n usage: unknown,\n { provider, model }: { provider?: string; model?: string },\n): TokenUsage | undefined {\n if (!usage) return undefined;\n\n return buildEntry(\n {\n inputTokens: num(prop(usage, \"inputTokens\")),\n outputTokens: num(prop(usage, \"outputTokens\")),\n totalTokens: num(prop(usage, \"totalTokens\")),\n reasoningTokens: num(prop(usage, \"reasoningTokens\")),\n cachedInputTokens: num(prop(usage, \"cachedInputTokens\")),\n },\n { provider, model },\n );\n}\n\n/**\n * Sum per-call {@link TokenUsage} entries into one entry per `(provider, model)`\n * pair. Order follows first appearance. A count field stays `undefined` when no\n * member of the group reported it, so \"not reported\" stays distinct from zero.\n *\n * Protocol-agnostic: works on any producer's `TokenUsage[]`, so integrations\n * share it rather than reimplementing aggregation.\n */\nexport function aggregateTokenUsage(entries: TokenUsage[]): TokenUsage[] {\n const grouped = new Map<string, TokenUsage>();\n\n for (const entry of entries) {\n const key = `${entry.provider ?? \"\"} ${entry.model ?? \"\"}`;\n let target = grouped.get(key);\n if (!target) {\n target = { provider: entry.provider, model: entry.model };\n grouped.set(key, target);\n }\n for (const field of COUNT_KEYS) {\n const value = entry[field];\n if (value == null) continue;\n target[field] = (target[field] ?? 0) + value;\n }\n }\n\n return [...grouped.values()];\n}\n"],"mappings":";;;AAEA,MAAa,qBAAqB,EAAE,OAAO;CACzC,MAAM,EAAE,QAAQ;CAChB,WAAW,EAAE,QAAQ;CACtB,CAAC;AAEF,MAAa,iBAAiB,EAAE,OAAO;CACrC,IAAI,EAAE,QAAQ;CACd,MAAM,EAAE,QAAQ,WAAW;CAC3B,UAAU;CACV,gBAAgB,EAAE,QAAQ,CAAC,UAAU;CACtC,CAAC;AAEF,M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|
"author": "Markus Ecker <markus.ecker@gmail.com>",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.58",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"repository": {
|
|
6
7
|
"type": "git",
|
|
7
8
|
"url": "https://github.com/ag-ui-protocol/ag-ui.git"
|
|
@@ -18,6 +19,7 @@
|
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
21
|
"@vitest/coverage-istanbul": "^4.0.18",
|
|
22
|
+
"eslint": "^9.37.0",
|
|
21
23
|
"publint": "^0.3.12",
|
|
22
24
|
"@arethetypeswrong/cli": "^0.17.4",
|
|
23
25
|
"vitest": "^4.0.18",
|