@adonis-agora/agent 0.55.0 → 0.57.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.
Files changed (119) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/providers/agent_provider.d.ts.map +1 -1
  3. package/dist/providers/agent_provider.js +84 -10
  4. package/dist/providers/agent_provider.js.map +1 -1
  5. package/dist/src/ag-ui/adapter.d.ts.map +1 -1
  6. package/dist/src/ag-ui/adapter.js +1 -2
  7. package/dist/src/ag-ui/adapter.js.map +1 -1
  8. package/dist/src/ag-ui/encoder.d.ts +7 -92
  9. package/dist/src/ag-ui/encoder.d.ts.map +1 -1
  10. package/dist/src/ag-ui/encoder.js +14 -498
  11. package/dist/src/ag-ui/encoder.js.map +1 -1
  12. package/dist/src/ag-ui/frames.d.ts +17 -0
  13. package/dist/src/ag-ui/frames.d.ts.map +1 -0
  14. package/dist/src/ag-ui/frames.js +69 -0
  15. package/dist/src/ag-ui/frames.js.map +1 -0
  16. package/dist/src/ag-ui/index.d.ts +9 -6
  17. package/dist/src/ag-ui/index.d.ts.map +1 -1
  18. package/dist/src/ag-ui/index.js +9 -6
  19. package/dist/src/ag-ui/index.js.map +1 -1
  20. package/dist/src/ag-ui/stream.d.ts +7 -23
  21. package/dist/src/ag-ui/stream.d.ts.map +1 -1
  22. package/dist/src/ag-ui/stream.js +9 -64
  23. package/dist/src/ag-ui/stream.js.map +1 -1
  24. package/dist/src/agent-service.d.ts +22 -0
  25. package/dist/src/agent-service.d.ts.map +1 -1
  26. package/dist/src/agent-service.js +57 -5
  27. package/dist/src/agent-service.js.map +1 -1
  28. package/dist/src/ai-tool-ref.d.ts +26 -4
  29. package/dist/src/ai-tool-ref.d.ts.map +1 -1
  30. package/dist/src/ai-tool-ref.js +6 -1
  31. package/dist/src/ai-tool-ref.js.map +1 -1
  32. package/dist/src/confirmed-tool.d.ts +2 -2
  33. package/dist/src/confirmed-tool.d.ts.map +1 -1
  34. package/dist/src/confirmed-tool.js.map +1 -1
  35. package/dist/src/guardrails/agent.d.ts.map +1 -1
  36. package/dist/src/guardrails/agent.js +11 -0
  37. package/dist/src/guardrails/agent.js.map +1 -1
  38. package/dist/src/index.d.ts +4 -3
  39. package/dist/src/index.d.ts.map +1 -1
  40. package/dist/src/index.js +4 -3
  41. package/dist/src/index.js.map +1 -1
  42. package/dist/src/mcp-client/options.d.ts +12 -0
  43. package/dist/src/mcp-client/options.d.ts.map +1 -1
  44. package/dist/src/mcp-client/tool-source.d.ts.map +1 -1
  45. package/dist/src/mcp-client/tool-source.js +2 -0
  46. package/dist/src/mcp-client/tool-source.js.map +1 -1
  47. package/dist/src/media/index.d.ts +1 -1
  48. package/dist/src/media/index.d.ts.map +1 -1
  49. package/dist/src/media/index.js +1 -1
  50. package/dist/src/media/index.js.map +1 -1
  51. package/dist/src/media/media-attachment-staging.d.ts +107 -6
  52. package/dist/src/media/media-attachment-staging.d.ts.map +1 -1
  53. package/dist/src/media/media-attachment-staging.js +173 -21
  54. package/dist/src/media/media-attachment-staging.js.map +1 -1
  55. package/dist/src/react/ag-ui.d.ts +41 -0
  56. package/dist/src/react/ag-ui.d.ts.map +1 -0
  57. package/dist/src/react/ag-ui.js +63 -0
  58. package/dist/src/react/ag-ui.js.map +1 -0
  59. package/dist/src/react/client.d.ts +12 -0
  60. package/dist/src/react/client.d.ts.map +1 -0
  61. package/dist/src/react/client.js +21 -0
  62. package/dist/src/react/client.js.map +1 -0
  63. package/dist/src/react/index.d.ts +3 -8
  64. package/dist/src/react/index.d.ts.map +1 -1
  65. package/dist/src/react/index.js +4 -20
  66. package/dist/src/react/index.js.map +1 -1
  67. package/dist/src/react/media.d.ts +18 -0
  68. package/dist/src/react/media.d.ts.map +1 -0
  69. package/dist/src/react/media.js +18 -0
  70. package/dist/src/react/media.js.map +1 -0
  71. package/dist/src/spi/agent-store.d.ts +22 -0
  72. package/dist/src/spi/agent-store.d.ts.map +1 -1
  73. package/dist/src/spi/agent-store.js.map +1 -1
  74. package/dist/src/spi/attachment-staging.d.ts +5 -0
  75. package/dist/src/spi/attachment-staging.d.ts.map +1 -1
  76. package/dist/src/spi/tool.d.ts +24 -0
  77. package/dist/src/spi/tool.d.ts.map +1 -1
  78. package/dist/src/stores/factory.d.ts +8 -2
  79. package/dist/src/stores/factory.d.ts.map +1 -1
  80. package/dist/src/stores/factory.js +8 -2
  81. package/dist/src/stores/factory.js.map +1 -1
  82. package/dist/src/stores/lucid-schema.d.ts.map +1 -1
  83. package/dist/src/stores/lucid-schema.js +2 -0
  84. package/dist/src/stores/lucid-schema.js.map +1 -1
  85. package/dist/src/stores/lucid.d.ts +12 -0
  86. package/dist/src/stores/lucid.d.ts.map +1 -1
  87. package/dist/src/stores/lucid.js +47 -0
  88. package/dist/src/stores/lucid.js.map +1 -1
  89. package/dist/src/testing/in-memory-store.d.ts +7 -0
  90. package/dist/src/testing/in-memory-store.d.ts.map +1 -1
  91. package/dist/src/testing/in-memory-store.js +33 -0
  92. package/dist/src/testing/in-memory-store.js.map +1 -1
  93. package/dist/src/tool-discovery.d.ts.map +1 -1
  94. package/dist/src/tool-discovery.js +27 -9
  95. package/dist/src/tool-discovery.js.map +1 -1
  96. package/dist/src/tool-filters.d.ts +33 -0
  97. package/dist/src/tool-filters.d.ts.map +1 -0
  98. package/dist/src/tool-filters.js +45 -0
  99. package/dist/src/tool-filters.js.map +1 -0
  100. package/dist/src/tool-registry.d.ts +33 -5
  101. package/dist/src/tool-registry.d.ts.map +1 -1
  102. package/dist/src/tool-registry.js +55 -11
  103. package/dist/src/tool-registry.js.map +1 -1
  104. package/dist/src/types.d.ts +16 -0
  105. package/dist/src/types.d.ts.map +1 -1
  106. package/package.json +15 -5
  107. package/skills/agent-tools/SKILL.md +19 -1
  108. package/dist/src/ag-ui/input.d.ts +0 -72
  109. package/dist/src/ag-ui/input.d.ts.map +0 -1
  110. package/dist/src/ag-ui/input.js +0 -216
  111. package/dist/src/ag-ui/input.js.map +0 -1
  112. package/dist/src/ag-ui/interrupt-id.d.ts +0 -27
  113. package/dist/src/ag-ui/interrupt-id.d.ts.map +0 -1
  114. package/dist/src/ag-ui/interrupt-id.js +0 -42
  115. package/dist/src/ag-ui/interrupt-id.js.map +0 -1
  116. package/dist/src/ag-ui/types.d.ts +0 -202
  117. package/dist/src/ag-ui/types.d.ts.map +0 -1
  118. package/dist/src/ag-ui/types.js +0 -33
  119. package/dist/src/ag-ui/types.js.map +0 -1
@@ -1,216 +0,0 @@
1
- import { decodeInterruptId } from './interrupt-id.js';
2
- function isRecord(value) {
3
- return typeof value === 'object' && value !== null && !Array.isArray(value);
4
- }
5
- /**
6
- * Read a request body as a `RunAgentInput`, or say why it is not one.
7
- *
8
- * Only what this producer acts on is checked, and a KNOWN member with a value the schema rejects is
9
- * malformed (the run never starts). A member it does not recognise is not an error — the protocol's
10
- * asymmetry: a newer consumer's input must not bounce off an older producer.
11
- */
12
- export function parseRunInput(body) {
13
- if (!isRecord(body))
14
- return 'the body must be a RunAgentInput object';
15
- if (typeof body.threadId !== 'string' || body.threadId.length === 0) {
16
- return 'threadId must be a non-empty string';
17
- }
18
- if (body.threadId.length > 255)
19
- return 'threadId must be at most 255 characters';
20
- if (typeof body.runId !== 'string' || body.runId.length === 0) {
21
- return 'runId must be a non-empty string';
22
- }
23
- if (!Array.isArray(body.messages))
24
- return 'messages must be an array';
25
- for (const message of body.messages) {
26
- if (!isRecord(message) || typeof message.role !== 'string') {
27
- return 'each message must be an object with a role';
28
- }
29
- }
30
- if (body.resume !== undefined) {
31
- if (!Array.isArray(body.resume))
32
- return 'resume must be an array';
33
- for (const entry of body.resume) {
34
- if (!isRecord(entry) ||
35
- typeof entry.interruptId !== 'string' ||
36
- (entry.status !== 'resolved' && entry.status !== 'cancelled')) {
37
- return "each resume entry needs an interruptId and a status of 'resolved' or 'cancelled'";
38
- }
39
- }
40
- }
41
- if (body.context !== undefined && !Array.isArray(body.context)) {
42
- return 'context must be an array';
43
- }
44
- return body;
45
- }
46
- const EXTENSIONS = {
47
- 'image/png': 'png',
48
- 'image/jpeg': 'jpg',
49
- 'image/gif': 'gif',
50
- 'image/webp': 'webp',
51
- 'application/pdf': 'pdf',
52
- 'text/plain': 'txt',
53
- };
54
- function filenameOf(part, index, contentType) {
55
- const metadata = part.metadata;
56
- if (isRecord(metadata)) {
57
- for (const key of ['filename', 'name', 'title']) {
58
- const value = metadata[key];
59
- if (typeof value === 'string' && value.trim().length > 0)
60
- return value.trim().slice(0, 200);
61
- }
62
- }
63
- const extension = EXTENSIONS[contentType];
64
- return `${part.type}-${index + 1}${extension !== undefined ? `.${extension}` : ''}`;
65
- }
66
- /**
67
- * The turn a run answers: the LAST user message of the input. The library keeps each thread's
68
- * history itself, so the earlier messages the consumer restates are not read back in — what the
69
- * agent resumes from is what it stored.
70
- *
71
- * Multimodal parts: text parts are the message's text; a media part carried inline (`data`) becomes
72
- * an attachment. A part by `url` or by provider `file` handle is dropped and said so — this producer
73
- * hands the model only bytes it staged itself, never an address a caller supplied.
74
- */
75
- export function readUserTurn(messages) {
76
- let last;
77
- for (let index = messages.length - 1; index >= 0; index -= 1) {
78
- if (messages[index]?.role === 'user') {
79
- last = messages[index];
80
- break;
81
- }
82
- }
83
- if (last === undefined)
84
- return null;
85
- if (typeof last.content === 'string')
86
- return { text: last.content, media: [], dropped: [] };
87
- if (!Array.isArray(last.content))
88
- return { text: '', media: [], dropped: [] };
89
- const texts = [];
90
- const media = [];
91
- const dropped = [];
92
- last.content.forEach((part, index) => {
93
- if (!isRecord(part))
94
- return;
95
- if (part.type === 'text') {
96
- if (typeof part.text === 'string')
97
- texts.push(part.text);
98
- return;
99
- }
100
- if (part.type !== 'image' &&
101
- part.type !== 'audio' &&
102
- part.type !== 'video' &&
103
- part.type !== 'document') {
104
- return;
105
- }
106
- const source = part.source;
107
- if (!isRecord(source) || source.type !== 'data') {
108
- const how = isRecord(source) && typeof source.type === 'string' ? source.type : 'unknown';
109
- dropped.push(`The ${part.type} part ${index + 1} was not used: only inline data is accepted, not a ${how} source.`);
110
- return;
111
- }
112
- if (typeof source.value !== 'string' || typeof source.mimeType !== 'string') {
113
- dropped.push(`The ${part.type} part ${index + 1} was not used: its inline data is malformed.`);
114
- return;
115
- }
116
- const data = Buffer.from(source.value, 'base64');
117
- if (data.length === 0) {
118
- dropped.push(`The ${part.type} part ${index + 1} was not used: it carries no bytes.`);
119
- return;
120
- }
121
- const contentType = source.mimeType.toLowerCase();
122
- media.push({
123
- kind: part.type,
124
- contentType,
125
- data,
126
- filename: filenameOf(part, index, contentType),
127
- });
128
- });
129
- return { text: texts.join('\n'), media, dropped };
130
- }
131
- /** `context` entries as the library's page context carries them, or `undefined` for none. */
132
- export function readContext(context) {
133
- if (context === undefined)
134
- return undefined;
135
- const entries = context.filter((entry) => isRecord(entry) && typeof entry.description === 'string' && typeof entry.value === 'string');
136
- return entries.length > 0 ? entries : undefined;
137
- }
138
- export function readForwardedProps(forwarded) {
139
- if (!isRecord(forwarded))
140
- return {};
141
- const pick = (key) => {
142
- const value = forwarded[key];
143
- return typeof value === 'string' && value.length > 0 ? value : undefined;
144
- };
145
- const agent = pick('agent');
146
- const model = pick('model');
147
- const persona = pick('persona');
148
- return {
149
- ...(agent !== undefined ? { agent } : {}),
150
- ...(model !== undefined ? { model } : {}),
151
- ...(persona !== undefined ? { persona } : {}),
152
- ...(isRecord(forwarded.pageContext) ? { pageContext: forwarded.pageContext } : {}),
153
- };
154
- }
155
- /**
156
- * Sort a resume list into what it answers. Every recognised entry must continue the SAME library
157
- * run from the SAME point — they are the interrupts of one `RUN_FINISHED` — and a list that does not
158
- * is malformed (a string says why).
159
- */
160
- export function planResume(resume) {
161
- const decisions = [];
162
- const unrecognised = [];
163
- for (const entry of resume) {
164
- const address = decodeInterruptId(entry.interruptId);
165
- if (address === null) {
166
- unrecognised.push(entry.interruptId);
167
- continue;
168
- }
169
- decisions.push({ address, entry });
170
- }
171
- const first = decisions[0];
172
- if (first === undefined)
173
- return { decisions, unrecognised };
174
- for (const { address } of decisions) {
175
- if (address.stream !== first.address.stream || address.position !== first.address.position) {
176
- return 'the resume entries answer interrupts of different runs';
177
- }
178
- }
179
- const seen = new Set();
180
- for (const { address } of decisions) {
181
- if (seen.has(address.toolCallId))
182
- return 'an interrupt is answered twice';
183
- seen.add(address.toolCallId);
184
- }
185
- return { decisions, unrecognised };
186
- }
187
- /** `{ approved, reason?, remember? }` out of an approval's resume payload. A bare boolean is accepted. */
188
- export function readApprovalPayload(payload) {
189
- if (typeof payload === 'boolean')
190
- return { approved: payload };
191
- if (!isRecord(payload) || typeof payload.approved !== 'boolean')
192
- return null;
193
- return {
194
- approved: payload.approved,
195
- ...(typeof payload.reason === 'string' ? { reason: payload.reason } : {}),
196
- ...(typeof payload.remember === 'boolean' ? { remember: payload.remember } : {}),
197
- };
198
- }
199
- /** `questionId → string[]` out of an elicitation's resume payload (`{ answers }` or the map itself). */
200
- export function readAnswersPayload(payload) {
201
- const source = isRecord(payload) && isRecord(payload.answers) ? payload.answers : payload;
202
- if (!isRecord(source))
203
- return null;
204
- const answers = {};
205
- for (const [key, value] of Object.entries(source)) {
206
- if (typeof value === 'string')
207
- answers[key] = [value];
208
- else if (Array.isArray(value) && value.every((item) => typeof item === 'string')) {
209
- answers[key] = value;
210
- }
211
- else
212
- return null;
213
- }
214
- return answers;
215
- }
216
- //# sourceMappingURL=input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/ag-ui/input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAyB,MAAM,mBAAmB,CAAC;AAS7E,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,IAAa;IACzC,IAAI,CAAC,QAAQ,CAAC,IAAI,C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C,GAAG,CAAC,KAAK,CAAC,CAAC;aACjD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,EAAE,CAAC;YACjF,OAAO,CAAC,GAAG,CAAC,GAAG,KAAiB,CAAC;QACnC,CAAC;;YAAM,OAAO,IAAI,CAAC;IACrB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * An interrupt's id carries everything a resuming request needs, so the producer keeps NOTHING
3
- * between the run that stopped to ask and the run that answers — the statelessness AG-UI lets a
4
- * producer have, and what lets any replica serve the resume.
5
- *
6
- * It names the library run the human is answering (`parked` — a delegated sub-agent parks its OWN
7
- * run), the run whose stream carries the work (`stream`), the tool call, and how many of that
8
- * stream's frames the interrupted AG-UI run already delivered (`position`), which is where the
9
- * resuming run picks the stream up.
10
- *
11
- * It is an address, not a credential: the resume route checks the caller owns the run exactly as
12
- * the native approve/answer routes do.
13
- */
14
- export interface InterruptAddress {
15
- kind: 'approval' | 'elicitation';
16
- /** The run to settle the call on. */
17
- parked: string;
18
- /** The run whose buffered stream the resume re-attaches to. */
19
- stream: string;
20
- toolCallId: string;
21
- /** Frames of `stream` already delivered when the run was reported interrupted. */
22
- position: number;
23
- }
24
- export declare function encodeInterruptId(address: InterruptAddress): string;
25
- /** The address an id names, or `null` for an id this producer did not mint. */
26
- export declare function decodeInterruptId(id: unknown): InterruptAddress | null;
27
- //# sourceMappingURL=interrupt-id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interrupt-id.d.ts","sourceRoot":"","sources":["../../../src/ag-ui/interrupt-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,GAAG,aAAa,CAAC;IACjC,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CASnE;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,OAAO,GAAG,gBAAgB,GAAG,IAAI,CA6BtE"}
@@ -1,42 +0,0 @@
1
- const PREFIX = 'agora_';
2
- export function encodeInterruptId(address) {
3
- const compact = [
4
- address.kind === 'approval' ? 'a' : 'e',
5
- address.parked,
6
- address.stream,
7
- address.toolCallId,
8
- address.position,
9
- ];
10
- return PREFIX + Buffer.from(JSON.stringify(compact), 'utf8').toString('base64url');
11
- }
12
- /** The address an id names, or `null` for an id this producer did not mint. */
13
- export function decodeInterruptId(id) {
14
- if (typeof id !== 'string' || !id.startsWith(PREFIX))
15
- return null;
16
- try {
17
- const parsed = JSON.parse(Buffer.from(id.slice(PREFIX.length), 'base64url').toString('utf8'));
18
- if (!Array.isArray(parsed) || parsed.length !== 5)
19
- return null;
20
- const [kind, parked, stream, toolCallId, position] = parsed;
21
- if ((kind !== 'a' && kind !== 'e') ||
22
- typeof parked !== 'string' ||
23
- typeof stream !== 'string' ||
24
- typeof toolCallId !== 'string' ||
25
- typeof position !== 'number' ||
26
- !Number.isSafeInteger(position) ||
27
- position < 0) {
28
- return null;
29
- }
30
- return {
31
- kind: kind === 'a' ? 'approval' : 'elicitation',
32
- parked,
33
- stream,
34
- toolCallId,
35
- position,
36
- };
37
- }
38
- catch {
39
- return null;
40
- }
41
- }
42
- //# sourceMappingURL=interrupt-id.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interrupt-id.js","sourceRoot":"","sources":["../../../src/ag-ui/interrupt-id.ts"],"names":[],"mappings":"AAwBA,MAAM,MAAM,GAAG,QAAQ,CAAC;AAExB,MAAM,UAAU,iBAAi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,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO;YACL,IAAI,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa;YAC/C,MAAM;YACN,MAAM;YACN,UAAU;YACV,QAAQ;SACT,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -1,202 +0,0 @@
1
- /**
2
- * The slice of AG-UI 1.0 (https://docs.ag-ui.com/spec/1.0) this producer writes and reads. Typed by
3
- * hand rather than imported: the agent package takes no dependency on an AG-UI SDK, and the wire
4
- * shape is pinned by the protocol's own JSON Schema, which the tests validate every emitted event
5
- * against (`test/fixtures/ag-ui/schema-1.0.json`).
6
- *
7
- * Optional members are OMITTED when there is nothing to say, never `null` — the protocol's
8
- * "absent means absent" rule.
9
- */
10
- /** The protocol version this producer declares on `RUN_STARTED`. */
11
- export declare const AG_UI_PROTOCOL_VERSION = "1.0";
12
- export type AgUiMetadata = Record<string, unknown>;
13
- /** One provider-and-model's token usage, in the protocol's single accounting. */
14
- export interface AgUiTokenUsage {
15
- provider?: string;
16
- model?: string;
17
- /** Every prompt token, cached or not. */
18
- inputTokens?: number;
19
- /** Every generated token, reasoning included. */
20
- outputTokens?: number;
21
- totalTokens?: number;
22
- /** Part of `outputTokens`. */
23
- reasoningTokens?: number;
24
- /** Cache reads — part of `inputTokens`. */
25
- cachedInputTokens?: number;
26
- /** Cache writes — part of `inputTokens`, disjoint from the reads. */
27
- cacheWriteInputTokens?: number;
28
- }
29
- /** What an interrupted run is waiting for; a resume entry answers it by `id`. */
30
- export interface AgUiInterrupt {
31
- id: string;
32
- /** Open string. This producer writes `tool_approval` and `input_required`. */
33
- reason: string;
34
- message?: string;
35
- toolCallId?: string;
36
- responseSchema?: Record<string, unknown>;
37
- expiresAt?: string;
38
- metadata?: AgUiMetadata;
39
- }
40
- export type AgUiRunOutcome = {
41
- type: 'success';
42
- pendingToolCallIds?: string[];
43
- } | {
44
- type: 'interrupt';
45
- interrupts: AgUiInterrupt[];
46
- } | {
47
- type: 'cancelled';
48
- };
49
- interface Base {
50
- metadata?: AgUiMetadata;
51
- }
52
- export type AgUiEvent = (Base & {
53
- type: 'RUN_STARTED';
54
- threadId: string;
55
- runId: string;
56
- protocolVersion?: string;
57
- }) | (Base & {
58
- type: 'RUN_FINISHED';
59
- threadId: string;
60
- runId: string;
61
- outcome?: AgUiRunOutcome;
62
- usage?: AgUiTokenUsage[];
63
- }) | (Base & {
64
- type: 'RUN_ERROR';
65
- message: string;
66
- code?: string;
67
- usage?: AgUiTokenUsage[];
68
- }) | (Base & {
69
- type: 'STEP_STARTED';
70
- stepName: string;
71
- }) | (Base & {
72
- type: 'STEP_FINISHED';
73
- stepName: string;
74
- }) | (Base & {
75
- type: 'TEXT_MESSAGE_START';
76
- messageId: string;
77
- role: 'assistant';
78
- }) | (Base & {
79
- type: 'TEXT_MESSAGE_CONTENT';
80
- messageId: string;
81
- delta: string;
82
- }) | (Base & {
83
- type: 'TEXT_MESSAGE_END';
84
- messageId: string;
85
- }) | (Base & {
86
- type: 'REASONING_START';
87
- messageId: string;
88
- }) | (Base & {
89
- type: 'REASONING_MESSAGE_START';
90
- messageId: string;
91
- role: 'reasoning';
92
- }) | (Base & {
93
- type: 'REASONING_MESSAGE_CONTENT';
94
- messageId: string;
95
- delta: string;
96
- }) | (Base & {
97
- type: 'REASONING_MESSAGE_END';
98
- messageId: string;
99
- }) | (Base & {
100
- type: 'REASONING_END';
101
- messageId: string;
102
- }) | (Base & {
103
- type: 'TOOL_CALL_START';
104
- toolCallId: string;
105
- toolCallName: string;
106
- parentMessageId?: string;
107
- }) | (Base & {
108
- type: 'TOOL_CALL_ARGS';
109
- toolCallId: string;
110
- delta: string;
111
- }) | (Base & {
112
- type: 'TOOL_CALL_END';
113
- toolCallId: string;
114
- }) | (Base & {
115
- type: 'TOOL_CALL_RESULT';
116
- messageId: string;
117
- toolCallId: string;
118
- content: string;
119
- role: 'tool';
120
- }) | (Base & {
121
- type: 'CUSTOM';
122
- name: string;
123
- value: unknown;
124
- });
125
- /** Where a media part's bytes are. Closed set: an unknown `type` is malformed input. */
126
- export type AgUiPartSource = {
127
- type: 'data';
128
- value: string;
129
- mimeType: string;
130
- } | {
131
- type: 'url';
132
- value: string;
133
- mimeType?: string;
134
- } | {
135
- type: 'file';
136
- value: string;
137
- provider?: string;
138
- mimeType?: string;
139
- };
140
- export type AgUiContentPart = {
141
- type: 'text';
142
- text: string;
143
- id?: string;
144
- metadata?: unknown;
145
- } | {
146
- type: 'image' | 'audio' | 'video' | 'document';
147
- source: AgUiPartSource;
148
- id?: string;
149
- metadata?: unknown;
150
- };
151
- export interface AgUiMessage {
152
- id: string;
153
- role: string;
154
- content?: string | AgUiContentPart[];
155
- [key: string]: unknown;
156
- }
157
- export interface AgUiResumeEntry {
158
- interruptId: string;
159
- status: 'resolved' | 'cancelled';
160
- payload?: unknown;
161
- metadata?: AgUiMetadata;
162
- }
163
- export interface AgUiContext {
164
- description: string;
165
- value: string;
166
- }
167
- /** `RunAgentInput`: the one message that travels from the application to the agent. */
168
- export interface AgUiRunInput {
169
- threadId: string;
170
- runId: string;
171
- protocolVersion?: string;
172
- parentRunId?: string;
173
- state?: unknown;
174
- messages: AgUiMessage[];
175
- tools?: unknown[];
176
- context?: AgUiContext[];
177
- forwardedProps?: unknown;
178
- resume?: AgUiResumeEntry[];
179
- }
180
- /**
181
- * The names of the `CUSTOM` events this producer writes for what AG-UI does not model. Prefixed, as
182
- * the protocol asks of invented names; a consumer that does not know one ignores it.
183
- */
184
- export declare const AG_UI_CUSTOM: {
185
- /** `{ runId, threadId }` — the library's own ids for the run behind this stream (cancel, re-attach). */
186
- readonly run: 'agora.run';
187
- /** A generative-UI component (`AgentUiComponent`); a repeat `id` replaces. */
188
- readonly ui: 'agora.ui';
189
- readonly title: 'agora.title';
190
- readonly queue: 'agora.queue';
191
- /** The approval request as the native protocol carries it, for a consumer that renders it live. */
192
- readonly approvalRequested: 'agora.approval-requested';
193
- readonly approvalSettled: 'agora.approval-settled';
194
- /** The whole question set of an elicitation (`ElicitationRequest`). */
195
- readonly elicitation: 'agora.elicitation';
196
- /** `{ usage, costUsd, reasoningMs }` of one model step. */
197
- readonly stepUsage: 'agora.step-usage';
198
- /** `{ message }` — input material this producer could not use and dropped. */
199
- readonly warning: 'agora.warning';
200
- };
201
- export {};
202
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ag-ui/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnD,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2CAA2C;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qEAAqE;IACrE,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,M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M,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,GAAG,WAAW,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,uFAAuF;AACvF,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY;IACvB,wGAAwG;aACxG,GAAG,EAAE,WAAW;IAChB,8EAA8E;aAC9E,EAAE,EAAE,UAAU;aACd,KAAK,EAAE,aAAa;aACpB,KAAK,EAAE,aAAa;IACpB,mGAAmG;aACnG,iBAAiB,EAAE,0BAA0B;aAC7C,eAAe,EAAE,wBAAwB;IACzC,uEAAuE;aACvE,WAAW,EAAE,mBAAmB;IAChC,2DAA2D;aAC3D,SAAS,EAAE,kBAAkB;IAC7B,8EAA8E;aAC9E,OAAO,EAAE,eAAe;CAChB,CAAC"}
@@ -1,33 +0,0 @@
1
- /**
2
- * The slice of AG-UI 1.0 (https://docs.ag-ui.com/spec/1.0) this producer writes and reads. Typed by
3
- * hand rather than imported: the agent package takes no dependency on an AG-UI SDK, and the wire
4
- * shape is pinned by the protocol's own JSON Schema, which the tests validate every emitted event
5
- * against (`test/fixtures/ag-ui/schema-1.0.json`).
6
- *
7
- * Optional members are OMITTED when there is nothing to say, never `null` — the protocol's
8
- * "absent means absent" rule.
9
- */
10
- /** The protocol version this producer declares on `RUN_STARTED`. */
11
- export const AG_UI_PROTOCOL_VERSION = '1.0';
12
- /**
13
- * The names of the `CUSTOM` events this producer writes for what AG-UI does not model. Prefixed, as
14
- * the protocol asks of invented names; a consumer that does not know one ignores it.
15
- */
16
- export const AG_UI_CUSTOM = {
17
- /** `{ runId, threadId }` — the library's own ids for the run behind this stream (cancel, re-attach). */
18
- run: 'agora.run',
19
- /** A generative-UI component (`AgentUiComponent`); a repeat `id` replaces. */
20
- ui: 'agora.ui',
21
- title: 'agora.title',
22
- queue: 'agora.queue',
23
- /** The approval request as the native protocol carries it, for a consumer that renders it live. */
24
- approvalRequested: 'agora.approval-requested',
25
- approvalSettled: 'agora.approval-settled',
26
- /** The whole question set of an elicitation (`ElicitationRequest`). */
27
- elicitation: 'agora.elicitation',
28
- /** `{ usage, costUsd, reasoningMs }` of one model step. */
29
- stepUsage: 'agora.step-usage',
30
- /** `{ message }` — input material this producer could not use and dropped. */
31
- warning: 'agora.warning',
32
- };
33
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ag-ui/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,oEAAoE;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC;AA+H5C;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,wGAAwG;IACxG,GAAG,EAAE,WAAW;IAChB,8EAA8E;IAC9E,EAAE,EAAE,UAAU;IACd,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,aAAa;IACpB,mGAAmG;IACnG,iBAAiB,EAAE,0BAA0B;IAC7C,eAAe,EAAE,wBAAwB;IACzC,uEAAuE;IACvE,WAAW,EAAE,mBAAmB;IAChC,2DAA2D;IAC3D,SAAS,EAAE,kBAAkB;IAC7B,8EAA8E;IAC9E,OAAO,EAAE,eAAe;CAChB,CAAC"}