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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/capabilities.ts"],"mappings":";;;;UAMiB,YAAA;EAAA;EAEf,IAAA;;EAEA,WAAA;AAAA;AAQF;;;;;AAAA,UAAiB,oBAAA;EAMf;EAJA,IAAA;EAQA;EANA,IAAA;EAUA;EARA,WAAA;EAQiB;EANjB,OAAA;EAce;EAZf,QAAA;;EAEA,gBAAA;EAYA;EAVA,QAAA,GAAW,MAAA;AAAA;;;;;AA0Bb;UAlBiB,qBAAA;;EAEf,SAAA;EAmBA;EAjBA,SAAA;EAoBQ;EAlBR,UAAA;EAsBA;EApBA,iBAAA;EAoBc;EAlBd,SAAA;AAAA;;;;AAqCF;;UA7BiB,iBAAA;EA6BiB;;EA1BhC,SAAA;EAiCA;;EA9BA,KAAA,GAAQ,IAAA;EAiCO;EA/Bf,aAAA;EAsCqC;EApCrC,cAAA;AAAA;;;;;UAOe,kBAAA;EAqCS;EAnCxB,gBAAA;EA0Ce;;EAvCf,kBAAA;AAAA;;;;;UAOe,iBAAA;EA8CA;EA5Cf,SAAA;;EAEA,MAAA;EA4CA;;EAzCA,MAAA;EA+CA;;EA5CA,eAAA;AAAA;AAqDF;;;;AAAA,UA9CiB,sBAAA;EA0DA;EAxDf,SAAA;;EAEA,UAAA;EAwDA;EAtDA,QAAA;EAwDA;EAtDA,SAAA,GAAY,YAAA;AAAA;;AA6Dd;;;UAtDiB,qBAAA;EAwDf;EAtDA,SAAA;EA4DA;EA1DA,SAAA;EA4DgB;;EAzDhB,SAAA;AAAA;;;;;UAOe,2BAAA;EAmEf;EAjEA,KAAA;EAwEA;EAtEA,KAAA;EAsEgB;EApEhB,KAAA;EAkFgC;EAhFhC,GAAA;EAkFW;EAhFX,IAAA;AAAA;;;;;UAOe,4BAAA;EAyFH;EAvFZ,KAAA;EA2FS;EAzFT,KAAA;AAAA;;;;;;UAQe,sBAAA;EAmEf;EAjEA,KAAA,GAAQ,2BAAA;EAmER;EAjEA,MAAA,GAAS,4BAAA;AAAA;;;;;UAOM,qBAAA;EAkEf;EAhEA,aAAA;EAkEA;;EA/DA,SAAA;EAiES;;EA9DT,aAAA;;EAEA,gBAAA;AAAA;;;;;UAOe,0BAAA;;EAEf,SAAA;;;EAGA,SAAA;;EAEA,aAAA;;;EAGA,QAAA;;;;EAIA,UAAA;;;EAGA,gBAAA;AAAA;;;;;;;;;;;;UAce,iBAAA;;EAEf,QAAA,GAAW,oBAAA;;EAEX,SAAA,GAAY,qBAAA;;EAEZ,KAAA,GAAQ,iBAAA;;EAER,MAAA,GAAS,kBAAA;;EAET,KAAA,GAAQ,iBAAA;;EAER,UAAA,GAAa,sBAAA;;EAEb,SAAA,GAAY,qBAAA;;EAEZ,UAAA,GAAa,sBAAA;;EAEb,SAAA,GAAY,qBAAA;;EAEZ,cAAA,GAAiB,0BAAA;;EAEjB,MAAA,GAAS,MAAA;AAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/generated/serialization.ts","../src/compat.ts","../src/metadata.ts","../src/token-usage.ts","../src/content.ts"],"mappings":";;;;;;AAsbA;;iBAAgB,iBAAA,GAAA,CAAqB,KAAA,EAAO,CAAA,EAAG,IAAA,8BAAkC,CAAA;;;;AAAjF;;;;;;KC9ZY,SAAA,GAAY,KAAA;;;;;;;;KASZ,SAAA,GAAY,WAAA;EAAA,CAAuB,GAAA;AAAA;;KAGnC,eAAA,GAAkB,SAAA;AAH9B;AAAA,KAMY,eAAA,WACJ,SAAA,GAAY,OAAA,CAAQ,KAAA;EAAS,IAAA,EAAM,CAAA;AAAA;AAAA,KAG/B,WAAA,WAAsB,SAAA,IAAa,eAAA,CAAgB,CAAA;AAAA,KAMnD,cAAA,WAAyB,SAAA,IAAa,CAAA,SAAU,SAAA,GACxD,IAAA,CACE,WAAA,CAA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;;;;;iBA+Ba,mBAAA,CAAoB,OAAA,EAAS,UAAA,KAAe,UAAA;;;;;AHmQ5D;;;;;;;;;;;;iBItagB,aAAA,CAAc,OAAA,WAAkB,WAAA;;AHQhD;;;;iBGMgB,eAAA,CAAgB,OAAA,WAAkB,WAAA"}
package/dist/index.d.ts CHANGED
@@ -1,233 +1,251 @@
1
- import { $ as TextMessageChunkEventProps, $t as State, A as ReasoningMessageEndEventProps, At as AssistantMessage, B as RunFinishedOutcome, Bt as ImageInputPart, C as ReasoningEndEvent, Ct as ToolCallResultEvent, D as ReasoningMessageContentEvent, Dt as AGUIConnectNotImplementedError, E as ReasoningMessageChunkEventProps, Et as ToolCallStartEventProps, F as RunErrorEvent, Ft as DeveloperMessage, G as StateDeltaEventProps, Gt as InputContentUrlSource, H as RunStartedEvent, Ht as InputContentDataSource, I as RunErrorEventProps, It as DocumentInputContent, J as StepFinishedEvent, Jt as ReasoningMessage, K as StateSnapshotEvent, Kt as Interrupt, L as RunFinishedEvent, Lt as DocumentInputPart, M as ReasoningMessageStartEventProps, Mt as AudioInputPart, N as ReasoningStartEvent, Nt as BinaryInputContent, O as ReasoningMessageContentEventProps, Ot as AGUIError, P as ReasoningStartEventProps, Pt as Context, Q as TextMessageChunkEvent, Qt as RunAgentInput, R as RunFinishedEventProps, Rt as FunctionCall, S as ReasoningEncryptedValueSubtype, St as ToolCallEndEventProps, T as ReasoningMessageChunkEvent, Tt as ToolCallStartEvent, U as RunStartedEventProps, Ut as InputContentPart, V as RunFinishedSuccessOutcome, Vt as InputContent, W as StateDeltaEvent, Wt as InputContentSource, X as StepStartedEvent, Xt as ResumeStatus, Y as StepFinishedEventProps, Yt as ResumeEntry, Z as StepStartedEventProps, Zt as Role, _ as MessagesSnapshotEventProps, _t as ToolCallArgsEvent, a as ActivityDeltaEventProps, an as UserMessage, at as TextMessageStartEvent, b as ReasoningEncryptedValueEvent, bt as ToolCallChunkEventProps, c as BaseEvent, ct as ThinkingEndEventProps, d as CustomEvent, dt as ThinkingTextMessageContentEvent, en as SystemMessage, et as TextMessageContentEvent, f as CustomEventProps, ft as ThinkingTextMessageContentEventProps, g as MessagesSnapshotEvent, gt as ThinkingTextMessageStartEventProps, h as EventType, ht as ThinkingTextMessageStartEvent, i as ActivityDeltaEvent, in as ToolMessage, it as TextMessageRole, j as ReasoningMessageStartEvent, jt as AudioInputContent, k as ReasoningMessageEndEvent, kt as ActivityMessage, l as BaseEventFields, lt as ThinkingStartEvent, m as EventProps, mt as ThinkingTextMessageEndEventProps, n as AGUIEventByType, nn as Tool, nt as TextMessageEndEvent, o as ActivitySnapshotEvent, on as VideoInputContent, ot as TextMessageStartEventProps, p as EventPayloadOf, pt as ThinkingTextMessageEndEvent, q as StateSnapshotEventProps, qt as Message, r as AGUIEventOf, rn as ToolCall, rt as TextMessageEndEventProps, s as ActivitySnapshotEventProps, sn as VideoInputPart, st as ThinkingEndEvent, t as AGUIEvent, tn as TextInputContent, tt as TextMessageContentEventProps, u as BaseEventProps, ut as ThinkingStartEventProps, v as RawEvent, vt as ToolCallArgsEventProps, w as ReasoningEndEventProps, wt as ToolCallResultEventProps, x as ReasoningEncryptedValueEventProps, xt as ToolCallEndEvent, y as RawEventProps, yt as ToolCallChunkEvent, z as RunFinishedInterruptOutcome, zt as ImageInputContent } from "./events-JPFRVbr9.js";
1
+ import { $ as ReplaceOperation, A as JsonPointer, At as TextMessageStartEvent, B as PartSource, Bt as ToolMessage, C as FunctionCall, Ct as SubagentStartedEvent, D as Interrupt, Dt as TextMessageContentEvent, E as ImagePart, Et as TextMessageChunkEvent, F as MultiAgentCapabilities, Ft as ToolCallArgsEvent, G as ReasoningEndEvent, Gt as VideoPart, H as ReasoningCapabilities, Ht as TransportCapabilities, I as MultimodalCapabilities, It as ToolCallChunkEvent, J as ReasoningMessageContentEvent, K as ReasoningMessage, L as MultimodalInputCapabilities, Lt as ToolCallEndEvent, M as MessagesSnapshotEvent, Mt as TokenUsage, N as Metadata, Nt as Tool, O as JsonPatch, Ot as TextMessageEndEvent, P as MoveOperation, Pt as ToolCall, Q as RemoveOperation, R as MultimodalOutputCapabilities, Rt as ToolCallResultEvent, S as FileSource, St as SubagentRunId, T as IdentityCapabilities, Tt as TestOperation, U as ReasoningEncryptedValueEvent, Ut as UrlSource, V as RawEvent, Vt as ToolsCapabilities, W as ReasoningEncryptedValueSubtype, Wt as UserMessage, X as ReasoningMessageStartEvent, Y as ReasoningMessageEndEvent, Z as ReasoningStartEvent, _ as DeveloperMessage, _t as SubagentFinishedEvent, a as AddOperation, at as RunFinishedEvent, b as EventType, bt as SubagentFinishedSuspendedOutcome, c as Attributable, ct as RunFinishedSuccessOutcome, d as BaseMessage, dt as StateCapabilities, et as ResumeEntry, f as ContentPart, ft as StateDeltaEvent, g as DataSource, gt as SubagentErrorEvent, h as CustomEvent, ht as StepStartedEvent, i as ActivitySnapshotEvent, it as RunFinishedCancelledOutcome, j as Message, jt as TextPart, k as JsonPatchOperation, kt as TextMessageRole, l as AudioPart, lt as RunStartedEvent, m as CopyOperation, mt as StepFinishedEvent, n as ActivityDeltaEvent, nt as RunAgentInput, o as AgentCapabilities, ot as RunFinishedInterruptOutcome, p as Context, pt as StateSnapshotEvent, q as ReasoningMessageChunkEvent, r as ActivityMessage, rt as RunErrorEvent, s as AssistantMessage, st as RunFinishedOutcome, t as PROTOCOL_VERSION, tt as Role, u as BaseEvent$1, ut as State, v as DocumentPart, vt as SubagentFinishedOutcome, w as HumanInTheLoopCapabilities, wt as SystemMessage, x as ExecutionCapabilities, xt as SubagentInfo, y as Event, yt as SubagentFinishedSuccessOutcome, z as OutputCapabilities, zt as ToolCallStartEvent } from "./version-DEKfpZNa.js";
2
2
 
3
- //#region src/capabilities.d.ts
4
- /** Describes a sub-agent that can be invoked by a parent agent. */
5
- interface SubAgentInfo {
6
- /** Unique name or identifier of the sub-agent. */
7
- name: string;
8
- /** What this sub-agent specializes in. Helps clients build agent selection UIs. */
9
- description?: string;
10
- }
3
+ //#region src/generated/serialization.d.ts
11
4
  /**
12
- * Basic metadata about the agent. Useful for discovery UIs, agent marketplaces,
13
- * and debugging. Set these when you want clients to display agent information
14
- * or when multiple agents are available and users need to pick one.
5
+ * Omits whole optional null fields before transmission. Does not validate,
6
+ * mutate the input, or traverse arbitrary application JSON or unknown fields.
7
+ * Required null payloads and null values inside opaque data remain intact.
15
8
  */
16
- interface IdentityCapabilities {
17
- /** Human-readable name shown in UIs and agent selectors. */
18
- name?: string;
19
- /** The framework or platform powering this agent (e.g., "langgraph", "mastra", "crewai"). */
20
- type?: string;
21
- /** What this agent does — helps users and routing logic decide when to use it. */
22
- description?: string;
23
- /** Semantic version of the agent (e.g., "1.2.0"). Useful for compatibility checks. */
24
- version?: string;
25
- /** Organization or team that maintains this agent. */
26
- provider?: string;
27
- /** URL to the agent's documentation or homepage. */
28
- documentationUrl?: string;
29
- /** Arbitrary key-value pairs for integration-specific identity info. */
30
- metadata?: Record<string, unknown>;
31
- }
9
+ declare function omitOptionalNulls<T>(value: T, root: "Event" | "RunAgentInput"): T;
10
+ //#endregion
11
+ //#region src/compat.d.ts
32
12
  /**
33
- * Declares which transport mechanisms the agent supports. Clients use this
34
- * to pick the best connection strategy. Only set flags to `true` for transports
35
- * your agent actually handles omit or set `false` for unsupported ones.
13
+ * Compatibility layer: the names this package has always exported, pointed at
14
+ * the generated protocol source. Everything protocol-shaped lives in
15
+ * src/generated (regenerate with `pnpm --filter @ag-ui/spec generate`); this
16
+ * file only aliases, derives, and carries the package's own error types.
36
17
  */
37
- interface TransportCapabilities {
38
- /** Set `true` if the agent streams responses via SSE. Most agents enable this. */
39
- streaming?: boolean;
40
- /** Set `true` if the agent accepts persistent WebSocket connections. */
41
- websocket?: boolean;
42
- /** Set `true` if the agent supports the AG-UI binary protocol (protobuf over HTTP). */
43
- httpBinary?: boolean;
44
- /** Set `true` if the agent can send async updates via webhooks after a run finishes. */
45
- pushNotifications?: boolean;
46
- /** Set `true` if the agent supports resuming interrupted streams via sequence numbers. */
47
- resumable?: boolean;
48
- }
18
+ /** Every protocol event, under its historic name (the generated name is Event). */
19
+ type AGUIEvent = Event;
49
20
  /**
50
- * Tool calling capabilities. Distinguishes between tools the agent itself provides
51
- * (listed in `items`) and tools the client passes at runtime via `RunAgentInput.tools`.
52
- * Enable this when your agent can call functions, search the web, execute code, etc.
21
+ * The historic BaseEvent shape: the protocol's base fields plus an open index
22
+ * signature. The hand-written type inherited the index signature from zod's
23
+ * passthrough inference, and client code reads event-specific fields straight
24
+ * off a BaseEvent, so the compat surface keeps it. The exact protocol shape
25
+ * is the generated BaseEvent; the closed union of real events is `Event`.
53
26
  */
54
- interface ToolsCapabilities {
55
- /** Set `true` if the agent can make tool calls at all. Set `false` to explicitly
56
- * signal tool calling is disabled even if items are present. */
57
- supported?: boolean;
58
- /** The tools this agent provides on its own (full JSON Schema definitions).
59
- * These are distinct from client-provided tools passed in `RunAgentInput.tools`. */
60
- items?: Tool[];
61
- /** Set `true` if the agent can invoke multiple tools concurrently within a single step. */
62
- parallelCalls?: boolean;
63
- /** Set `true` if the agent accepts and uses tools provided by the client at runtime. */
64
- clientProvided?: boolean;
65
- }
27
+ type BaseEvent = BaseEvent$1 & {
28
+ [key: string]: unknown;
29
+ };
30
+ /** The fields every event carries, under their historic name. */
31
+ type BaseEventFields = BaseEvent;
32
+ /** Event type discriminator -> concrete event, derived from the union. */
33
+ type AGUIEventByType = { [K in EventType]: Extract<Event, {
34
+ type: K;
35
+ }> };
36
+ type AGUIEventOf<T extends EventType> = AGUIEventByType[T];
37
+ type EventPayloadOf<T extends EventType> = T extends EventType ? Omit<AGUIEventOf<T>, keyof BaseEvent$1> : never;
66
38
  /**
67
- * Output format support. Enable `structuredOutput` when your agent can return
68
- * responses conforming to a JSON schema, which is useful for programmatic consumption.
39
+ * What a factory takes: the event's fields, minus the discriminator the
40
+ * factory sets. Derived from the generated event types rather than from
41
+ * z.input of the loose validators — a looseObject's input type carries a
42
+ * string index signature, and Omit over that erases every named field, which
43
+ * would let `{}` or a wrong-typed field compile. The trailing open signature
44
+ * keeps the historic tolerance for extra keys.
69
45
  */
70
- interface OutputCapabilities {
71
- /** Set `true` if the agent can produce structured JSON output matching a provided schema. */
72
- structuredOutput?: boolean;
73
- /** MIME types the agent can produce (e.g., `["text/plain", "application/json"]`).
74
- * Omit if the agent only produces plain text. */
75
- supportedMimeTypes?: string[];
76
- }
46
+ type EventProps<E extends {
47
+ type: EventType;
48
+ }> = Omit<E, "type"> & {
49
+ [key: string]: unknown;
50
+ };
51
+ type BaseEventProps = EventProps<BaseEvent$1>;
52
+ type TextMessageStartEventProps = EventProps<TextMessageStartEvent>;
53
+ type TextMessageContentEventProps = EventProps<TextMessageContentEvent>;
54
+ type TextMessageEndEventProps = EventProps<TextMessageEndEvent>;
55
+ type TextMessageChunkEventProps = EventProps<TextMessageChunkEvent>;
56
+ type ToolCallStartEventProps = EventProps<ToolCallStartEvent>;
57
+ type ToolCallArgsEventProps = EventProps<ToolCallArgsEvent>;
58
+ type ToolCallEndEventProps = EventProps<ToolCallEndEvent>;
59
+ type ToolCallChunkEventProps = EventProps<ToolCallChunkEvent>;
60
+ type ToolCallResultEventProps = EventProps<ToolCallResultEvent>;
61
+ type StateSnapshotEventProps = EventProps<StateSnapshotEvent>;
62
+ type StateDeltaEventProps = EventProps<StateDeltaEvent>;
63
+ type MessagesSnapshotEventProps = EventProps<MessagesSnapshotEvent>;
64
+ type ActivitySnapshotEventProps = EventProps<ActivitySnapshotEvent>;
65
+ type ActivityDeltaEventProps = EventProps<ActivityDeltaEvent>;
66
+ type RawEventProps = EventProps<RawEvent>;
67
+ type CustomEventProps = EventProps<CustomEvent>;
68
+ type RunStartedEventProps = EventProps<RunStartedEvent>;
69
+ type RunFinishedEventProps = EventProps<RunFinishedEvent>;
70
+ type RunErrorEventProps = EventProps<RunErrorEvent>;
71
+ type StepStartedEventProps = EventProps<StepStartedEvent>;
72
+ type StepFinishedEventProps = EventProps<StepFinishedEvent>;
73
+ type ReasoningStartEventProps = EventProps<ReasoningStartEvent>;
74
+ type ReasoningMessageStartEventProps = EventProps<ReasoningMessageStartEvent>;
75
+ type ReasoningMessageContentEventProps = EventProps<ReasoningMessageContentEvent>;
76
+ type ReasoningMessageEndEventProps = EventProps<ReasoningMessageEndEvent>;
77
+ type ReasoningMessageChunkEventProps = EventProps<ReasoningMessageChunkEvent>;
78
+ type ReasoningEndEventProps = EventProps<ReasoningEndEvent>;
79
+ type ReasoningEncryptedValueEventProps = EventProps<ReasoningEncryptedValueEvent>;
80
+ type SubagentStartedEventProps = EventProps<SubagentStartedEvent>;
81
+ type SubagentFinishedEventProps = EventProps<SubagentFinishedEvent>;
82
+ type SubagentErrorEventProps = EventProps<SubagentErrorEvent>;
77
83
  /**
78
- * State and memory management capabilities. These tell the client how the agent
79
- * handles shared state and whether conversation context persists across runs.
84
+ * The names the content parts carried before 1.0 renamed them (InputContent
85
+ * -> ContentPart, TextInputContent -> TextPart, and so on): the same parts now
86
+ * sit on tool messages as well as user messages, so they are named by what
87
+ * they are rather than by direction. The wire is unchanged — every `type`
88
+ * value is the same — and so is every type behind these names; only the
89
+ * spelling moved. Kept for one release, see DEPRECATIONS.md. The matching
90
+ * validator aliases live in src/schemas.ts, which is where every runtime
91
+ * validator this package ships lives.
92
+ *
93
+ * @deprecated Use the ...Part names.
80
94
  */
81
- interface StateCapabilities {
82
- /** Set `true` if the agent emits `STATE_SNAPSHOT` events (full state replacement). */
83
- snapshots?: boolean;
84
- /** Set `true` if the agent emits `STATE_DELTA` events (JSON Patch incremental updates). */
85
- deltas?: boolean;
86
- /** Set `true` if the agent has long-term memory beyond the current thread
87
- * (e.g., vector store, knowledge base, or cross-session recall). */
88
- memory?: boolean;
89
- /** Set `true` if state is preserved across multiple runs within the same thread.
90
- * When `false`, state resets on each run. */
91
- persistentState?: boolean;
95
+ type InputContent = ContentPart;
96
+ /** @deprecated Use TextPart. */
97
+ type TextInputContent = TextPart;
98
+ /** @deprecated Use ImagePart. */
99
+ type ImageInputContent = ImagePart;
100
+ /** @deprecated Use AudioPart. */
101
+ type AudioInputContent = AudioPart;
102
+ /** @deprecated Use VideoPart. */
103
+ type VideoInputContent = VideoPart;
104
+ /** @deprecated Use DocumentPart. */
105
+ type DocumentInputContent = DocumentPart;
106
+ /** @deprecated Use PartSource. */
107
+ type InputContentSource = PartSource;
108
+ /** @deprecated Use DataSource. */
109
+ type InputContentDataSource = DataSource;
110
+ /** @deprecated Use UrlSource. */
111
+ type InputContentUrlSource = UrlSource;
112
+ /** Historic alias: a content part of a user message. */
113
+ type InputContentPart = ContentPart;
114
+ /** Whether an interrupt was answered or abandoned. */
115
+ type ResumeStatus = ResumeEntry["status"];
116
+ declare class AGUIError extends Error {
117
+ constructor(message: string);
118
+ }
119
+ declare class AGUIConnectNotImplementedError extends AGUIError {
120
+ constructor();
92
121
  }
122
+ //#endregion
123
+ //#region src/metadata.d.ts
93
124
  /**
94
- * Multi-agent coordination capabilities. Enable these when your agent can
95
- * orchestrate or hand off work to other agents.
125
+ * The key reserved for AG-UI's own use inside a metadata object. Every other
126
+ * key is user space.
127
+ *
128
+ * Reservation is by convention: nothing rejects a write to this key at runtime,
129
+ * because metadata is open by key and validating its shape would contradict
130
+ * that.
96
131
  */
97
- interface MultiAgentCapabilities {
98
- /** Set `true` if the agent participates in any form of multi-agent coordination. */
99
- supported?: boolean;
100
- /** Set `true` if the agent can delegate subtasks to other agents while retaining control. */
101
- delegation?: boolean;
102
- /** Set `true` if the agent can transfer the conversation entirely to another agent. */
103
- handoffs?: boolean;
104
- /** List of sub-agents this agent can invoke. Helps clients build agent selection UIs. */
105
- subAgents?: SubAgentInfo[];
106
- }
132
+ declare const AGUI_METADATA_KEY = "ag-ui";
107
133
  /**
108
- * Reasoning and thinking capabilities. Enable these when your agent exposes its
109
- * internal thought process (e.g., chain-of-thought, extended thinking).
134
+ * Extra information attached to an event or a message.
135
+ *
136
+ * Open by key — any JSON value is allowed under a key, including `null`.
137
+ *
138
+ * Deliberately `z.any()` rather than a recursive JSON-value schema, which review
139
+ * has suggested more than once. Two reasons. Every dynamic payload in the
140
+ * protocol uses the permissive form — `state`, `rawEvent`, `CustomEvent.value`,
141
+ * `ActivityMessage.content`, and the pre-existing `Tool.metadata` and
142
+ * `Interrupt.metadata` — so tightening this one field would make it the sole
143
+ * outlier while fixing nothing elsewhere. And a recursive validation would walk
144
+ * every value on every event, on the streaming hot path, to catch a mistake
145
+ * (a function, a bigint) that already fails loudly at encode time.
146
+ *
147
+ * The schema itself now lives in the generated source (MetadataSchema in
148
+ * src/generated/schemas.ts); this comment survives as the recorded reasoning.
110
149
  */
111
- interface ReasoningCapabilities {
112
- /** Set `true` if the agent produces reasoning/thinking tokens visible to the client. */
113
- supported?: boolean;
114
- /** Set `true` if reasoning tokens are streamed incrementally (vs. returned all at once). */
115
- streaming?: boolean;
116
- /** Set `true` if reasoning content is encrypted (zero-data-retention mode).
117
- * Clients should expect opaque `encryptedValue` fields instead of readable content. */
118
- encrypted?: boolean;
119
- }
120
150
  /**
121
- * Modalities the agent can accept as input. Clients use this to show/hide
122
- * file upload buttons, audio recorders, image pickers, etc.
151
+ * How metadata is declared on events and messages: the object is absent or an
152
+ * object, never `null`. The validator pinning that invariant is
153
+ * `OptionalMetadataSchema`, which lives in src/schemas.ts along with every
154
+ * other runtime validator this package ships.
123
155
  */
124
- interface MultimodalInputCapabilities {
125
- /** Set `true` if the agent can process image inputs (e.g., screenshots, photos). */
126
- image?: boolean;
127
- /** Set `true` if the agent can process audio inputs (speech, recordings). */
128
- audio?: boolean;
129
- /** Set `true` if the agent can process video inputs. */
130
- video?: boolean;
131
- /** Set `true` if the agent can process PDF documents. */
132
- pdf?: boolean;
133
- /** Set `true` if the agent can process arbitrary file uploads. */
134
- file?: boolean;
135
- }
136
156
  /**
137
- * Modalities the agent can produce as output. Clients use this to anticipate
138
- * rich content in the agent's response.
157
+ * Folds `incoming` metadata into `existing`, key by key, with the last write
158
+ * winning.
159
+ *
160
+ * A message is assembled from a sequence of events, and the interesting values
161
+ * — token usage and finish reason among them — are only known at the end. So
162
+ * metadata accumulates as the sequence arrives rather than being fixed at the
163
+ * start.
164
+ *
165
+ * A key's value is replaced outright. This never recurses, so an array or
166
+ * object under any key — including {@link AGUI_METADATA_KEY} — is replaced
167
+ * wholesale rather than blended with what was there before.
168
+ *
169
+ * Returns a new object rather than mutating either argument. An absent
170
+ * `incoming` returns `existing` untouched; an empty `incoming` changes nothing.
139
171
  */
140
- interface MultimodalOutputCapabilities {
141
- /** Set `true` if the agent can generate images as part of its response. */
142
- image?: boolean;
143
- /** Set `true` if the agent can produce audio output (text-to-speech, audio files). */
144
- audio?: boolean;
145
- }
172
+ declare function mergeMetadata(existing: Metadata | undefined, incoming: Metadata | undefined): Metadata | undefined;
173
+ //#endregion
174
+ //#region src/token-usage.d.ts
146
175
  /**
147
- * Multimodal input and output support. Organized into `input` and `output`
148
- * sub-objects so clients can independently query what the agent accepts
149
- * versus what it produces.
176
+ * Map a LangChain-family `usage_metadata` object into an AG-UI {@link TokenUsage}.
177
+ *
178
+ * LangChain and LangGraph both attach usage as `{ input_tokens, output_tokens,
179
+ * total_tokens, input_token_details: { cache_read, cache_creation },
180
+ * output_token_details: { reasoning } }`. LangChain's accounting is the
181
+ * protocol's — `input_tokens` already includes the cache details and
182
+ * `output_tokens` the reasoning detail — so every count passes through as is.
183
+ * This maps only those numeric counts plus optional provider/model labels —
184
+ * never prompt/completion content. A count the provider
185
+ * did not return is simply absent from `usage_metadata` and reads as
186
+ * `undefined` here; that is not a defect and draws no warning. Returns
187
+ * `undefined` when no usable count is present, so callers can omit usage rather
188
+ * than report zeros.
150
189
  */
151
- interface MultimodalCapabilities {
152
- /** Modalities the agent can accept as input (images, audio, video, PDFs, files). */
153
- input?: MultimodalInputCapabilities;
154
- /** Modalities the agent can produce as output (images, audio). */
155
- output?: MultimodalOutputCapabilities;
156
- }
190
+ declare function tokenUsageFromLangChainMetadata(usageMetadata: unknown, {
191
+ provider,
192
+ model
193
+ }: {
194
+ provider?: string;
195
+ model?: string;
196
+ }): TokenUsage | undefined;
157
197
  /**
158
- * Execution control and limits. Declare these so clients can set expectations
159
- * about how long or how many steps an agent run might take.
198
+ * Map an AI-SDK `LanguageModelUsage` object into an AG-UI {@link TokenUsage}.
199
+ *
200
+ * AI-SDK's v5 keys already match — `inputTokens`, `outputTokens`,
201
+ * `totalTokens`, `reasoningTokens`, `cachedInputTokens` — with the totals
202
+ * inclusive the way the protocol counts them. v6 adds `inputTokenDetails:
203
+ * { cacheReadTokens, cacheWriteTokens }` and `outputTokenDetails:
204
+ * { reasoningTokens }`; the cache-write count exists only there, and the two
205
+ * counts present in both forms are read from the top level first. AI-SDK
206
+ * reports `NaN`/`undefined` for counts a provider didn't return, so only finite
207
+ * numbers are copied. Returns `undefined` when no finite count is present (so
208
+ * callers omit empty usage).
160
209
  */
161
- interface ExecutionCapabilities {
162
- /** Set `true` if the agent can execute code (e.g., Python, JavaScript) during a run. */
163
- codeExecution?: boolean;
164
- /** Set `true` if code execution happens in a sandboxed/isolated environment.
165
- * Only meaningful when `codeExecution` is `true`. */
166
- sandboxed?: boolean;
167
- /** Maximum number of tool-call/reasoning iterations the agent will perform per run.
168
- * Helps clients display progress or set timeout expectations. */
169
- maxIterations?: number;
170
- /** Maximum wall-clock time (in milliseconds) the agent will run before timing out. */
171
- maxExecutionTime?: number;
172
- }
210
+ declare function tokenUsageFromAiSdkUsage(usage: unknown, {
211
+ provider,
212
+ model
213
+ }: {
214
+ provider?: string;
215
+ model?: string;
216
+ }): TokenUsage | undefined;
173
217
  /**
174
- * Human-in-the-loop interaction support. Enable these when your agent can pause
175
- * execution to request human input, approval, or feedback before continuing.
218
+ * Sum per-call {@link TokenUsage} entries into one entry per `(provider, model)`
219
+ * pair. Order follows first appearance. A count field stays `undefined` when no
220
+ * member of the group reported it, so "not reported" stays distinct from zero.
221
+ *
222
+ * Protocol-agnostic: works on any producer's `TokenUsage[]`, so integrations
223
+ * share it rather than reimplementing aggregation.
176
224
  */
177
- interface HumanInTheLoopCapabilities {
178
- /** Set `true` if the agent supports any form of human-in-the-loop interaction. */
179
- supported?: boolean;
180
- /** Set `true` if the agent can pause and request explicit approval before
181
- * performing sensitive actions (e.g., sending emails, deleting data). */
182
- approvals?: boolean;
183
- /** Set `true` if the agent allows humans to intervene and modify its plan mid-execution. */
184
- interventions?: boolean;
185
- /** Set `true` if the agent can incorporate user feedback (thumbs up/down, corrections)
186
- * to improve its behavior within the current session. */
187
- feedback?: boolean;
188
- /** Set `true` if the agent participates in the AG-UI interrupt protocol
189
- * (emits RUN_FINISHED with outcome={ type: "interrupt", interrupts: [...] },
190
- * accepts resume[]). */
191
- interrupts?: boolean;
192
- /** Set `true` if tool-call interrupts accept editedArgs in the resume payload.
193
- * Only meaningful when interrupts is true. */
194
- approveWithEdits?: boolean;
195
- }
225
+ declare function aggregateTokenUsage(entries: TokenUsage[]): TokenUsage[];
226
+ //#endregion
227
+ //#region src/content.d.ts
196
228
  /**
197
- * A typed, categorized snapshot of an agent's current capabilities.
198
- * Returned by `getCapabilities()` on `AbstractAgent`.
229
+ * The text of string-or-parts content, for a consumer that can only hold a
230
+ * string: the text parts concatenated in order, every other part dropped.
199
231
  *
200
- * All fields are optional agents only declare what they support.
201
- * Omitted fields mean the capability is not declared (unknown), not that
202
- * it's unsupported.
232
+ * This is the downgrade the specification permits for a peer that predates
233
+ * content parts (/spec/1.0/basic/versioning): it removes and reshapes, and
234
+ * it invents nothing — no placeholder stands in for a dropped image, because a
235
+ * downgrade MUST NOT supply a value the producer never sent. Content that is
236
+ * entirely media flattens to the empty string, which the same rule allows.
203
237
  *
204
- * The `custom` field is an escape hatch for integration-specific capabilities
205
- * that don't fit into the standard categories.
238
+ * Losing content is never meant to be silent. This helper only reshapes; a
239
+ * caller that knows it is talking to an older peer warns as well, the way the
240
+ * era shims in `@ag-ui/client` do.
206
241
  */
207
- interface AgentCapabilities {
208
- /** Agent identity and metadata. */
209
- identity?: IdentityCapabilities;
210
- /** Supported transport mechanisms (SSE, WebSocket, binary, etc.). */
211
- transport?: TransportCapabilities;
212
- /** Tools the agent provides and tool calling configuration. */
213
- tools?: ToolsCapabilities;
214
- /** Output format support (structured output, MIME types). */
215
- output?: OutputCapabilities;
216
- /** State and memory management (snapshots, deltas, persistence). */
217
- state?: StateCapabilities;
218
- /** Multi-agent coordination (delegation, handoffs, sub-agents). */
219
- multiAgent?: MultiAgentCapabilities;
220
- /** Reasoning and thinking support (chain-of-thought, encrypted thinking). */
221
- reasoning?: ReasoningCapabilities;
222
- /** Multimodal input/output support (images, audio, video, files). */
223
- multimodal?: MultimodalCapabilities;
224
- /** Execution control and limits (code execution, timeouts, iteration caps). */
225
- execution?: ExecutionCapabilities;
226
- /** Human-in-the-loop support (approvals, interventions, feedback). */
227
- humanInTheLoop?: HumanInTheLoopCapabilities;
228
- /** Integration-specific capabilities not covered by the standard categories. */
229
- custom?: Record<string, unknown>;
230
- }
242
+ declare function contentToText(content: string | ContentPart[] | undefined): string;
243
+ /**
244
+ * Whether string-or-parts content carries anything but text — the question a
245
+ * caller asks before flattening, so it can warn about what the flattening
246
+ * would drop.
247
+ */
248
+ declare function contentHasMedia(content: string | ContentPart[] | undefined): boolean;
231
249
  //#endregion
232
- export { AGUIConnectNotImplementedError, AGUIError, AGUIEvent, AGUIEventByType, AGUIEventOf, ActivityDeltaEvent, ActivityDeltaEventProps, ActivityMessage, ActivitySnapshotEvent, ActivitySnapshotEventProps, AgentCapabilities, AssistantMessage, AudioInputContent, AudioInputPart, BaseEvent, BaseEventFields, BaseEventProps, BinaryInputContent, Context, CustomEvent, CustomEventProps, DeveloperMessage, DocumentInputContent, DocumentInputPart, EventPayloadOf, EventProps, EventType, ExecutionCapabilities, FunctionCall, HumanInTheLoopCapabilities, IdentityCapabilities, ImageInputContent, ImageInputPart, InputContent, InputContentDataSource, InputContentPart, InputContentSource, InputContentUrlSource, Interrupt, Message, MessagesSnapshotEvent, MessagesSnapshotEventProps, MultiAgentCapabilities, MultimodalCapabilities, MultimodalInputCapabilities, MultimodalOutputCapabilities, OutputCapabilities, RawEvent, RawEventProps, ReasoningCapabilities, ReasoningEncryptedValueEvent, ReasoningEncryptedValueEventProps, ReasoningEncryptedValueSubtype, ReasoningEndEvent, ReasoningEndEventProps, ReasoningMessage, ReasoningMessageChunkEvent, ReasoningMessageChunkEventProps, ReasoningMessageContentEvent, ReasoningMessageContentEventProps, ReasoningMessageEndEvent, ReasoningMessageEndEventProps, ReasoningMessageStartEvent, ReasoningMessageStartEventProps, ReasoningStartEvent, ReasoningStartEventProps, ResumeEntry, ResumeStatus, Role, RunAgentInput, RunErrorEvent, RunErrorEventProps, RunFinishedEvent, RunFinishedEventProps, RunFinishedInterruptOutcome, RunFinishedOutcome, RunFinishedSuccessOutcome, RunStartedEvent, RunStartedEventProps, State, StateCapabilities, StateDeltaEvent, StateDeltaEventProps, StateSnapshotEvent, StateSnapshotEventProps, StepFinishedEvent, StepFinishedEventProps, StepStartedEvent, StepStartedEventProps, SubAgentInfo, SystemMessage, TextInputContent, TextMessageChunkEvent, TextMessageChunkEventProps, TextMessageContentEvent, TextMessageContentEventProps, TextMessageEndEvent, TextMessageEndEventProps, TextMessageRole, TextMessageStartEvent, TextMessageStartEventProps, ThinkingEndEvent, ThinkingEndEventProps, ThinkingStartEvent, ThinkingStartEventProps, ThinkingTextMessageContentEvent, ThinkingTextMessageContentEventProps, ThinkingTextMessageEndEvent, ThinkingTextMessageEndEventProps, ThinkingTextMessageStartEvent, ThinkingTextMessageStartEventProps, Tool, ToolCall, ToolCallArgsEvent, ToolCallArgsEventProps, ToolCallChunkEvent, ToolCallChunkEventProps, ToolCallEndEvent, ToolCallEndEventProps, ToolCallResultEvent, ToolCallResultEventProps, ToolCallStartEvent, ToolCallStartEventProps, ToolMessage, ToolsCapabilities, TransportCapabilities, UserMessage, VideoInputContent, VideoInputPart };
250
+ export { AGUIConnectNotImplementedError, AGUIError, AGUIEvent, AGUIEventByType, AGUIEventOf, AGUI_METADATA_KEY, ActivityDeltaEvent, ActivityDeltaEventProps, ActivityMessage, ActivitySnapshotEvent, ActivitySnapshotEventProps, AddOperation, AgentCapabilities, AssistantMessage, Attributable, AudioInputContent, type AudioPart as AudioInputPart, AudioPart, type BaseEvent, BaseEventFields, BaseEventProps, BaseMessage, ContentPart, Context, CopyOperation, CustomEvent, CustomEventProps, DataSource, DeveloperMessage, DocumentInputContent, type DocumentPart as DocumentInputPart, DocumentPart, Event, EventPayloadOf, EventType, ExecutionCapabilities, FileSource, FunctionCall, HumanInTheLoopCapabilities, IdentityCapabilities, ImageInputContent, type ImagePart as ImageInputPart, ImagePart, InputContent, InputContentDataSource, InputContentPart, InputContentSource, InputContentUrlSource, Interrupt, JsonPatch, JsonPatchOperation, JsonPointer, Message, MessagesSnapshotEvent, MessagesSnapshotEventProps, Metadata, MoveOperation, MultiAgentCapabilities, MultimodalCapabilities, MultimodalInputCapabilities, MultimodalOutputCapabilities, OutputCapabilities, PROTOCOL_VERSION, PartSource, RawEvent, RawEventProps, ReasoningCapabilities, ReasoningEncryptedValueEvent, ReasoningEncryptedValueEventProps, ReasoningEncryptedValueSubtype, ReasoningEndEvent, ReasoningEndEventProps, ReasoningMessage, ReasoningMessageChunkEvent, ReasoningMessageChunkEventProps, ReasoningMessageContentEvent, ReasoningMessageContentEventProps, ReasoningMessageEndEvent, ReasoningMessageEndEventProps, ReasoningMessageStartEvent, ReasoningMessageStartEventProps, ReasoningStartEvent, ReasoningStartEventProps, RemoveOperation, ReplaceOperation, ResumeEntry, ResumeStatus, Role, RunAgentInput, RunErrorEvent, RunErrorEventProps, RunFinishedCancelledOutcome, RunFinishedEvent, RunFinishedEventProps, RunFinishedInterruptOutcome, RunFinishedOutcome, RunFinishedSuccessOutcome, RunStartedEvent, RunStartedEventProps, State, StateCapabilities, StateDeltaEvent, StateDeltaEventProps, StateSnapshotEvent, StateSnapshotEventProps, StepFinishedEvent, StepFinishedEventProps, StepStartedEvent, StepStartedEventProps, SubagentErrorEvent, SubagentErrorEventProps, SubagentFinishedEvent, SubagentFinishedEventProps, SubagentFinishedOutcome, SubagentFinishedSuccessOutcome, SubagentFinishedSuspendedOutcome, SubagentInfo, SubagentRunId, SubagentStartedEvent, SubagentStartedEventProps, SystemMessage, TestOperation, TextInputContent, TextMessageChunkEvent, TextMessageChunkEventProps, TextMessageContentEvent, TextMessageContentEventProps, TextMessageEndEvent, TextMessageEndEventProps, TextMessageRole, TextMessageStartEvent, TextMessageStartEventProps, TextPart, TokenUsage, Tool, ToolCall, ToolCallArgsEvent, ToolCallArgsEventProps, ToolCallChunkEvent, ToolCallChunkEventProps, ToolCallEndEvent, ToolCallEndEventProps, ToolCallResultEvent, ToolCallResultEventProps, ToolCallStartEvent, ToolCallStartEventProps, ToolMessage, ToolsCapabilities, TransportCapabilities, UrlSource, UserMessage, VideoInputContent, type VideoPart as VideoInputPart, VideoPart, aggregateTokenUsage, contentHasMedia, contentToText, mergeMetadata, omitOptionalNulls, tokenUsageFromAiSdkUsage, tokenUsageFromLangChainMetadata };
233
251
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/capabilities.ts"],"mappings":";;;;UAMiB,YAAA;EAAA;EAEf,IAAA;;EAEA,WAAA;AAAA;AAQF;;;;;AAAA,UAAiB,oBAAA;EAMf;EAJA,IAAA;EAQA;EANA,IAAA;EAUA;EARA,WAAA;EAQiB;EANjB,OAAA;EAce;EAZf,QAAA;;EAEA,gBAAA;EAYA;EAVA,QAAA,GAAW,MAAA;AAAA;;;;;AA0Bb;UAlBiB,qBAAA;;EAEf,SAAA;EAmBA;EAjBA,SAAA;EAoBQ;EAlBR,UAAA;EAsBA;EApBA,iBAAA;EAoBc;EAlBd,SAAA;AAAA;;;;AAqCF;;UA7BiB,iBAAA;EA6BiB;;EA1BhC,SAAA;EAiCA;;EA9BA,KAAA,GAAQ,IAAA;EAiCO;EA/Bf,aAAA;EAsCqC;EApCrC,cAAA;AAAA;;;;;UAOe,kBAAA;EAqCS;EAnCxB,gBAAA;E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