@jini-ai/agentic 0.4.2 → 0.4.3

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 (72) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/a2ui/agent-to-renderer.d.ts +613 -0
  3. package/dist/a2ui/agent-to-renderer.js +191 -0
  4. package/dist/a2ui/catalog.d.ts +73 -0
  5. package/dist/a2ui/catalog.js +304 -0
  6. package/dist/a2ui/common-types.d.ts +401 -0
  7. package/dist/a2ui/common-types.js +130 -0
  8. package/dist/a2ui/index.d.ts +16 -0
  9. package/dist/a2ui/index.js +16 -0
  10. package/dist/a2ui/interpreter.d.ts +71 -0
  11. package/dist/a2ui/interpreter.js +337 -0
  12. package/dist/a2ui/json-pointer.d.ts +48 -0
  13. package/dist/a2ui/json-pointer.js +174 -0
  14. package/dist/a2ui/renderer-to-agent.d.ts +342 -0
  15. package/dist/a2ui/renderer-to-agent.js +111 -0
  16. package/dist/a2ui/resolve.d.ts +28 -0
  17. package/dist/a2ui/resolve.js +144 -0
  18. package/dist/a2ui/tree.d.ts +66 -0
  19. package/dist/a2ui/tree.js +74 -0
  20. package/dist/ag-ui.d.ts +82 -0
  21. package/dist/ag-ui.js +85 -0
  22. package/dist/agui/encoder.d.ts +50 -0
  23. package/dist/agui/encoder.js +97 -0
  24. package/dist/agui/events.d.ts +59 -0
  25. package/dist/agui/events.js +15 -0
  26. package/dist/capability.d.ts +81 -0
  27. package/dist/capability.js +79 -0
  28. package/dist/core/a2ui/index.d.ts +3 -7
  29. package/dist/core/a2ui/index.js +3 -7
  30. package/dist/core/a2ui/interpreter.d.ts +1 -1
  31. package/dist/core/a2ui/interpreter.js +0 -1
  32. package/dist/core/a2ui/surface-properties.d.ts +1 -1
  33. package/dist/core/a2ui/surface-properties.js +1 -1
  34. package/dist/core/dom/index.d.ts +3 -8
  35. package/dist/core/dom/index.js +3 -8
  36. package/dist/core/gen-ui/index.d.ts +2 -4
  37. package/dist/core/gen-ui/index.js +2 -4
  38. package/dist/core/index.d.ts +4 -30
  39. package/dist/core/index.js +4 -30
  40. package/dist/dom/dom-page-driver.d.ts +36 -0
  41. package/dist/dom/dom-page-driver.js +601 -0
  42. package/dist/dom/index.d.ts +17 -0
  43. package/dist/dom/index.js +17 -0
  44. package/dist/dom/model-context.d.ts +69 -0
  45. package/dist/dom/model-context.js +44 -0
  46. package/dist/element-handles.d.ts +120 -0
  47. package/dist/element-handles.js +39 -0
  48. package/dist/gen-ui/encoder.d.ts +50 -0
  49. package/dist/gen-ui/encoder.js +97 -0
  50. package/dist/gen-ui/events.d.ts +59 -0
  51. package/dist/gen-ui/events.js +15 -0
  52. package/dist/gen-ui/index.d.ts +18 -0
  53. package/dist/gen-ui/index.js +17 -0
  54. package/dist/guards.d.ts +96 -0
  55. package/dist/guards.js +186 -0
  56. package/dist/handle.d.ts +41 -0
  57. package/dist/handle.js +41 -0
  58. package/dist/index.d.ts +3 -35
  59. package/dist/index.js +3 -35
  60. package/dist/mcp-ui-apps.d.ts +223 -0
  61. package/dist/mcp-ui-apps.js +252 -0
  62. package/dist/mcp-ui.d.ts +133 -0
  63. package/dist/mcp-ui.js +134 -0
  64. package/dist/page-capabilities.d.ts +14 -0
  65. package/dist/page-capabilities.js +129 -0
  66. package/dist/page-driver.d.ts +120 -0
  67. package/dist/page-driver.js +2 -0
  68. package/dist/page-executor.d.ts +94 -0
  69. package/dist/page-executor.js +320 -0
  70. package/dist/webmcp.d.ts +202 -0
  71. package/dist/webmcp.js +173 -0
  72. package/package.json +20 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @jini-ai/agentic
2
2
 
3
+ ## 0.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Tovu clean-up release (2026-10-08): code Tovu moved into Jini, plus the Jini clean-up (see the commit log since 0.4.2).
8
+
3
9
  ## 0.4.2 — 2026-10-06
4
10
 
5
11
  - `@jini-ai/agentic/a2ui`: `A2UI_DISPLAY_ONLY_PROPERTY` (`"displayOnly"` on `createSurface.surfaceProperties`) plus `displayOnlySurfaceIdOf` and `a2uiSurfaceIdOf` readers.
@@ -0,0 +1,613 @@
1
+ /**
2
+ * @module agent-to-renderer
3
+ *
4
+ * A2UI v1.0 agent→renderer envelope — mirrors `specification/v1_0/json/agent_to_renderer.json`
5
+ * (fetched from https://github.com/a2ui-project/a2ui, `main` branch, this session). Every
6
+ * required/optional field and every `additionalProperties: false` closure below was copied
7
+ * directly from that JSON Schema, not guessed. See `common-types.ts`'s module doc for the overall
8
+ * scope note (wire shape only; catalog membership is a separate runtime concern).
9
+ *
10
+ * The six message kinds, each keyed by version + exactly one message-type key
11
+ * (`createSurface` | `updateComponents` | `updateDataModel` | `deleteSurface` | `callFunction` +
12
+ * `functionCallId` | `actionResponse` + `actionId`):
13
+ * `CreateSurfaceMessage`, `UpdateComponentsMessage`, `UpdateDataModelMessage`,
14
+ * `DeleteSurfaceMessage`, `CallFunctionMessage`, `ActionResponseMessage`.
15
+ *
16
+ * `parseAgentToRendererMessage` is a hand-written dispatcher, not a plain `z.union(...)`: zod's
17
+ * union error for a 6-branch, all-`.strict()` union is an unreadable dump of all 6 branches'
18
+ * failures at once. Real renderers need to tell an agent *specifically* "you sent no version",
19
+ * "you sent two message-type keys", or "`updateComponents` is missing `surfaceId`" — so this
20
+ * dispatcher inspects the envelope's own shape first (which key is present) and only then
21
+ * validates against the one matching schema, matching what `renderer_to_agent.json`'s own error
22
+ * schema anticipates (`VALIDATION_FAILED` with a JSON-Pointer `path` into the offending field).
23
+ */
24
+ import { z } from 'zod';
25
+ /**
26
+ * A component's wire shape is only closed by its *catalog's* own per-type schema (e.g. `Text`
27
+ * requires `text`, forbids unknown extra keys via that type's own `unevaluatedProperties: false`)
28
+ * — a shape this module cannot know statically, since a renderer may be configured with any
29
+ * catalog. This schema validates only what every component, in every catalog, always carries:
30
+ * an `id` and a `component` type-name string. `catalog.ts`/`interpreter.ts` layer the closed,
31
+ * per-type check on top at runtime (component-type whitelisting against the active catalog).
32
+ */
33
+ export declare const WireComponentSchema: z.ZodObject<{
34
+ id: z.ZodString;
35
+ component: z.ZodString;
36
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
37
+ id: z.ZodString;
38
+ component: z.ZodString;
39
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
40
+ id: z.ZodString;
41
+ component: z.ZodString;
42
+ }, z.ZodTypeAny, "passthrough">>;
43
+ export type WireComponent = z.infer<typeof WireComponentSchema> & Record<string, unknown>;
44
+ /** `agent_to_renderer.json#/$defs/ComponentsList` — "A list containing UI components for the surface." `minItems: 1`. */
45
+ export declare const ComponentsListSchema: z.ZodArray<z.ZodObject<{
46
+ id: z.ZodString;
47
+ component: z.ZodString;
48
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
49
+ id: z.ZodString;
50
+ component: z.ZodString;
51
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
52
+ id: z.ZodString;
53
+ component: z.ZodString;
54
+ }, z.ZodTypeAny, "passthrough">>, "many">;
55
+ export type ComponentsList = z.infer<typeof ComponentsListSchema>;
56
+ export declare const CreateSurfaceMessageSchema: z.ZodObject<{
57
+ version: z.ZodLiteral<"v1.0">;
58
+ createSurface: z.ZodObject<{
59
+ surfaceId: z.ZodString;
60
+ catalogId: z.ZodString;
61
+ surfaceProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
62
+ sendDataModel: z.ZodOptional<z.ZodBoolean>;
63
+ components: z.ZodOptional<z.ZodArray<z.ZodObject<{
64
+ id: z.ZodString;
65
+ component: z.ZodString;
66
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
67
+ id: z.ZodString;
68
+ component: z.ZodString;
69
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
70
+ id: z.ZodString;
71
+ component: z.ZodString;
72
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
73
+ dataModel: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
74
+ }, "strict", z.ZodTypeAny, {
75
+ surfaceId: string;
76
+ catalogId: string;
77
+ surfaceProperties?: Record<string, unknown> | undefined;
78
+ sendDataModel?: boolean | undefined;
79
+ components?: z.objectOutputType<{
80
+ id: z.ZodString;
81
+ component: z.ZodString;
82
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
83
+ dataModel?: Record<string, unknown> | undefined;
84
+ }, {
85
+ surfaceId: string;
86
+ catalogId: string;
87
+ surfaceProperties?: Record<string, unknown> | undefined;
88
+ sendDataModel?: boolean | undefined;
89
+ components?: z.objectInputType<{
90
+ id: z.ZodString;
91
+ component: z.ZodString;
92
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
93
+ dataModel?: Record<string, unknown> | undefined;
94
+ }>;
95
+ }, "strict", z.ZodTypeAny, {
96
+ version: "v1.0";
97
+ createSurface: {
98
+ surfaceId: string;
99
+ catalogId: string;
100
+ surfaceProperties?: Record<string, unknown> | undefined;
101
+ sendDataModel?: boolean | undefined;
102
+ components?: z.objectOutputType<{
103
+ id: z.ZodString;
104
+ component: z.ZodString;
105
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
106
+ dataModel?: Record<string, unknown> | undefined;
107
+ };
108
+ }, {
109
+ version: "v1.0";
110
+ createSurface: {
111
+ surfaceId: string;
112
+ catalogId: string;
113
+ surfaceProperties?: Record<string, unknown> | undefined;
114
+ sendDataModel?: boolean | undefined;
115
+ components?: z.objectInputType<{
116
+ id: z.ZodString;
117
+ component: z.ZodString;
118
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
119
+ dataModel?: Record<string, unknown> | undefined;
120
+ };
121
+ }>;
122
+ export type CreateSurfaceMessage = z.infer<typeof CreateSurfaceMessageSchema>;
123
+ export declare const UpdateComponentsMessageSchema: z.ZodObject<{
124
+ version: z.ZodLiteral<"v1.0">;
125
+ updateComponents: z.ZodObject<{
126
+ surfaceId: z.ZodString;
127
+ components: z.ZodArray<z.ZodObject<{
128
+ id: z.ZodString;
129
+ component: z.ZodString;
130
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
131
+ id: z.ZodString;
132
+ component: z.ZodString;
133
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
134
+ id: z.ZodString;
135
+ component: z.ZodString;
136
+ }, z.ZodTypeAny, "passthrough">>, "many">;
137
+ }, "strict", z.ZodTypeAny, {
138
+ surfaceId: string;
139
+ components: z.objectOutputType<{
140
+ id: z.ZodString;
141
+ component: z.ZodString;
142
+ }, z.ZodTypeAny, "passthrough">[];
143
+ }, {
144
+ surfaceId: string;
145
+ components: z.objectInputType<{
146
+ id: z.ZodString;
147
+ component: z.ZodString;
148
+ }, z.ZodTypeAny, "passthrough">[];
149
+ }>;
150
+ }, "strict", z.ZodTypeAny, {
151
+ version: "v1.0";
152
+ updateComponents: {
153
+ surfaceId: string;
154
+ components: z.objectOutputType<{
155
+ id: z.ZodString;
156
+ component: z.ZodString;
157
+ }, z.ZodTypeAny, "passthrough">[];
158
+ };
159
+ }, {
160
+ version: "v1.0";
161
+ updateComponents: {
162
+ surfaceId: string;
163
+ components: z.objectInputType<{
164
+ id: z.ZodString;
165
+ component: z.ZodString;
166
+ }, z.ZodTypeAny, "passthrough">[];
167
+ };
168
+ }>;
169
+ export type UpdateComponentsMessage = z.infer<typeof UpdateComponentsMessageSchema>;
170
+ /**
171
+ * `value` is required by the real schema (`"required": ["surfaceId", "value"]`, re-fetched and
172
+ * checked 2026-07-29) — but declaring it `z.unknown()` did not make it so. In Zod 3 a key whose
173
+ * schema accepts `undefined` is satisfied by the key being absent entirely, and `undefined`
174
+ * inhabits `unknown`; `z.unknown().isOptional()` is literally `true`. So `{updateDataModel:
175
+ * {surfaceId: "s1"}}` parsed clean, and `interpreter.ts` then wrote that missing value at the
176
+ * default `'/'` pointer — replacing the surface's whole data model with `undefined`, silently,
177
+ * with no error message and no way for the agent to learn it had happened.
178
+ *
179
+ * Presence is therefore asserted on the object rather than on the field: there is no Zod 3 schema
180
+ * for "any value, but it has to be there," because optionality is decided by the field's *type*.
181
+ * `'value' in body` rather than a `!== undefined` check, so every legal JSON value — `null`
182
+ * (the spec's own delete verb), `false`, `0`, `""` — is still accepted as content.
183
+ *
184
+ * The same limitation leaves `value` typed `value?: unknown` on the inferred type. That is
185
+ * unavoidable in Zod 3 for an `unknown`-typed key (`undefined extends unknown`), and is why this
186
+ * is enforced at runtime rather than trusted to the type.
187
+ */
188
+ export declare const UpdateDataModelMessageSchema: z.ZodObject<{
189
+ version: z.ZodLiteral<"v1.0">;
190
+ updateDataModel: z.ZodEffects<z.ZodObject<{
191
+ surfaceId: z.ZodString;
192
+ path: z.ZodOptional<z.ZodString>;
193
+ value: z.ZodUnknown;
194
+ }, "strict", z.ZodTypeAny, {
195
+ surfaceId: string;
196
+ value?: unknown;
197
+ path?: string | undefined;
198
+ }, {
199
+ surfaceId: string;
200
+ value?: unknown;
201
+ path?: string | undefined;
202
+ }>, {
203
+ surfaceId: string;
204
+ value?: unknown;
205
+ path?: string | undefined;
206
+ }, {
207
+ surfaceId: string;
208
+ value?: unknown;
209
+ path?: string | undefined;
210
+ }>;
211
+ }, "strict", z.ZodTypeAny, {
212
+ version: "v1.0";
213
+ updateDataModel: {
214
+ surfaceId: string;
215
+ value?: unknown;
216
+ path?: string | undefined;
217
+ };
218
+ }, {
219
+ version: "v1.0";
220
+ updateDataModel: {
221
+ surfaceId: string;
222
+ value?: unknown;
223
+ path?: string | undefined;
224
+ };
225
+ }>;
226
+ export type UpdateDataModelMessage = z.infer<typeof UpdateDataModelMessageSchema>;
227
+ export declare const DeleteSurfaceMessageSchema: z.ZodObject<{
228
+ version: z.ZodLiteral<"v1.0">;
229
+ deleteSurface: z.ZodObject<{
230
+ surfaceId: z.ZodString;
231
+ }, "strict", z.ZodTypeAny, {
232
+ surfaceId: string;
233
+ }, {
234
+ surfaceId: string;
235
+ }>;
236
+ }, "strict", z.ZodTypeAny, {
237
+ version: "v1.0";
238
+ deleteSurface: {
239
+ surfaceId: string;
240
+ };
241
+ }, {
242
+ version: "v1.0";
243
+ deleteSurface: {
244
+ surfaceId: string;
245
+ };
246
+ }>;
247
+ export type DeleteSurfaceMessage = z.infer<typeof DeleteSurfaceMessageSchema>;
248
+ export declare const CallFunctionMessageSchema: z.ZodObject<{
249
+ version: z.ZodLiteral<"v1.0">;
250
+ functionCallId: z.ZodString;
251
+ wantResponse: z.ZodOptional<z.ZodBoolean>;
252
+ callFunction: z.ZodType<import("./common-types.js").FunctionCall, z.ZodTypeDef, import("./common-types.js").FunctionCall>;
253
+ }, "strict", z.ZodTypeAny, {
254
+ version: "v1.0";
255
+ functionCallId: string;
256
+ callFunction: import("./common-types.js").FunctionCall;
257
+ wantResponse?: boolean | undefined;
258
+ }, {
259
+ version: "v1.0";
260
+ functionCallId: string;
261
+ callFunction: import("./common-types.js").FunctionCall;
262
+ wantResponse?: boolean | undefined;
263
+ }>;
264
+ export type CallFunctionMessage = z.infer<typeof CallFunctionMessageSchema>;
265
+ export declare const ActionResponseMessageSchema: z.ZodObject<{
266
+ version: z.ZodLiteral<"v1.0">;
267
+ actionId: z.ZodString;
268
+ actionResponse: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
269
+ value: z.ZodUnknown;
270
+ }, "strict", z.ZodTypeAny, {
271
+ value?: unknown;
272
+ }, {
273
+ value?: unknown;
274
+ }>, z.ZodObject<{
275
+ error: z.ZodObject<{
276
+ code: z.ZodString;
277
+ message: z.ZodString;
278
+ }, "strict", z.ZodTypeAny, {
279
+ code: string;
280
+ message: string;
281
+ }, {
282
+ code: string;
283
+ message: string;
284
+ }>;
285
+ }, "strict", z.ZodTypeAny, {
286
+ error: {
287
+ code: string;
288
+ message: string;
289
+ };
290
+ }, {
291
+ error: {
292
+ code: string;
293
+ message: string;
294
+ };
295
+ }>]>, {
296
+ value?: unknown;
297
+ } | {
298
+ error: {
299
+ code: string;
300
+ message: string;
301
+ };
302
+ }, {
303
+ value?: unknown;
304
+ } | {
305
+ error: {
306
+ code: string;
307
+ message: string;
308
+ };
309
+ }>;
310
+ }, "strict", z.ZodTypeAny, {
311
+ version: "v1.0";
312
+ actionId: string;
313
+ actionResponse: {
314
+ value?: unknown;
315
+ } | {
316
+ error: {
317
+ code: string;
318
+ message: string;
319
+ };
320
+ };
321
+ }, {
322
+ version: "v1.0";
323
+ actionId: string;
324
+ actionResponse: {
325
+ value?: unknown;
326
+ } | {
327
+ error: {
328
+ code: string;
329
+ message: string;
330
+ };
331
+ };
332
+ }>;
333
+ export type ActionResponseMessage = z.infer<typeof ActionResponseMessageSchema>;
334
+ export type AgentToRendererMessage = CreateSurfaceMessage | UpdateComponentsMessage | UpdateDataModelMessage | DeleteSurfaceMessage | CallFunctionMessage | ActionResponseMessage;
335
+ declare const MESSAGE_KEY_SCHEMAS: {
336
+ readonly createSurface: z.ZodObject<{
337
+ version: z.ZodLiteral<"v1.0">;
338
+ createSurface: z.ZodObject<{
339
+ surfaceId: z.ZodString;
340
+ catalogId: z.ZodString;
341
+ surfaceProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
342
+ sendDataModel: z.ZodOptional<z.ZodBoolean>;
343
+ components: z.ZodOptional<z.ZodArray<z.ZodObject<{
344
+ id: z.ZodString;
345
+ component: z.ZodString;
346
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
347
+ id: z.ZodString;
348
+ component: z.ZodString;
349
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
350
+ id: z.ZodString;
351
+ component: z.ZodString;
352
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
353
+ dataModel: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
354
+ }, "strict", z.ZodTypeAny, {
355
+ surfaceId: string;
356
+ catalogId: string;
357
+ surfaceProperties?: Record<string, unknown> | undefined;
358
+ sendDataModel?: boolean | undefined;
359
+ components?: z.objectOutputType<{
360
+ id: z.ZodString;
361
+ component: z.ZodString;
362
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
363
+ dataModel?: Record<string, unknown> | undefined;
364
+ }, {
365
+ surfaceId: string;
366
+ catalogId: string;
367
+ surfaceProperties?: Record<string, unknown> | undefined;
368
+ sendDataModel?: boolean | undefined;
369
+ components?: z.objectInputType<{
370
+ id: z.ZodString;
371
+ component: z.ZodString;
372
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
373
+ dataModel?: Record<string, unknown> | undefined;
374
+ }>;
375
+ }, "strict", z.ZodTypeAny, {
376
+ version: "v1.0";
377
+ createSurface: {
378
+ surfaceId: string;
379
+ catalogId: string;
380
+ surfaceProperties?: Record<string, unknown> | undefined;
381
+ sendDataModel?: boolean | undefined;
382
+ components?: z.objectOutputType<{
383
+ id: z.ZodString;
384
+ component: z.ZodString;
385
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
386
+ dataModel?: Record<string, unknown> | undefined;
387
+ };
388
+ }, {
389
+ version: "v1.0";
390
+ createSurface: {
391
+ surfaceId: string;
392
+ catalogId: string;
393
+ surfaceProperties?: Record<string, unknown> | undefined;
394
+ sendDataModel?: boolean | undefined;
395
+ components?: z.objectInputType<{
396
+ id: z.ZodString;
397
+ component: z.ZodString;
398
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
399
+ dataModel?: Record<string, unknown> | undefined;
400
+ };
401
+ }>;
402
+ readonly updateComponents: z.ZodObject<{
403
+ version: z.ZodLiteral<"v1.0">;
404
+ updateComponents: z.ZodObject<{
405
+ surfaceId: z.ZodString;
406
+ components: z.ZodArray<z.ZodObject<{
407
+ id: z.ZodString;
408
+ component: z.ZodString;
409
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
410
+ id: z.ZodString;
411
+ component: z.ZodString;
412
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
413
+ id: z.ZodString;
414
+ component: z.ZodString;
415
+ }, z.ZodTypeAny, "passthrough">>, "many">;
416
+ }, "strict", z.ZodTypeAny, {
417
+ surfaceId: string;
418
+ components: z.objectOutputType<{
419
+ id: z.ZodString;
420
+ component: z.ZodString;
421
+ }, z.ZodTypeAny, "passthrough">[];
422
+ }, {
423
+ surfaceId: string;
424
+ components: z.objectInputType<{
425
+ id: z.ZodString;
426
+ component: z.ZodString;
427
+ }, z.ZodTypeAny, "passthrough">[];
428
+ }>;
429
+ }, "strict", z.ZodTypeAny, {
430
+ version: "v1.0";
431
+ updateComponents: {
432
+ surfaceId: string;
433
+ components: z.objectOutputType<{
434
+ id: z.ZodString;
435
+ component: z.ZodString;
436
+ }, z.ZodTypeAny, "passthrough">[];
437
+ };
438
+ }, {
439
+ version: "v1.0";
440
+ updateComponents: {
441
+ surfaceId: string;
442
+ components: z.objectInputType<{
443
+ id: z.ZodString;
444
+ component: z.ZodString;
445
+ }, z.ZodTypeAny, "passthrough">[];
446
+ };
447
+ }>;
448
+ readonly updateDataModel: z.ZodObject<{
449
+ version: z.ZodLiteral<"v1.0">;
450
+ updateDataModel: z.ZodEffects<z.ZodObject<{
451
+ surfaceId: z.ZodString;
452
+ path: z.ZodOptional<z.ZodString>;
453
+ value: z.ZodUnknown;
454
+ }, "strict", z.ZodTypeAny, {
455
+ surfaceId: string;
456
+ value?: unknown;
457
+ path?: string | undefined;
458
+ }, {
459
+ surfaceId: string;
460
+ value?: unknown;
461
+ path?: string | undefined;
462
+ }>, {
463
+ surfaceId: string;
464
+ value?: unknown;
465
+ path?: string | undefined;
466
+ }, {
467
+ surfaceId: string;
468
+ value?: unknown;
469
+ path?: string | undefined;
470
+ }>;
471
+ }, "strict", z.ZodTypeAny, {
472
+ version: "v1.0";
473
+ updateDataModel: {
474
+ surfaceId: string;
475
+ value?: unknown;
476
+ path?: string | undefined;
477
+ };
478
+ }, {
479
+ version: "v1.0";
480
+ updateDataModel: {
481
+ surfaceId: string;
482
+ value?: unknown;
483
+ path?: string | undefined;
484
+ };
485
+ }>;
486
+ readonly deleteSurface: z.ZodObject<{
487
+ version: z.ZodLiteral<"v1.0">;
488
+ deleteSurface: z.ZodObject<{
489
+ surfaceId: z.ZodString;
490
+ }, "strict", z.ZodTypeAny, {
491
+ surfaceId: string;
492
+ }, {
493
+ surfaceId: string;
494
+ }>;
495
+ }, "strict", z.ZodTypeAny, {
496
+ version: "v1.0";
497
+ deleteSurface: {
498
+ surfaceId: string;
499
+ };
500
+ }, {
501
+ version: "v1.0";
502
+ deleteSurface: {
503
+ surfaceId: string;
504
+ };
505
+ }>;
506
+ readonly callFunction: z.ZodObject<{
507
+ version: z.ZodLiteral<"v1.0">;
508
+ functionCallId: z.ZodString;
509
+ wantResponse: z.ZodOptional<z.ZodBoolean>;
510
+ callFunction: z.ZodType<import("./common-types.js").FunctionCall, z.ZodTypeDef, import("./common-types.js").FunctionCall>;
511
+ }, "strict", z.ZodTypeAny, {
512
+ version: "v1.0";
513
+ functionCallId: string;
514
+ callFunction: import("./common-types.js").FunctionCall;
515
+ wantResponse?: boolean | undefined;
516
+ }, {
517
+ version: "v1.0";
518
+ functionCallId: string;
519
+ callFunction: import("./common-types.js").FunctionCall;
520
+ wantResponse?: boolean | undefined;
521
+ }>;
522
+ readonly actionResponse: z.ZodObject<{
523
+ version: z.ZodLiteral<"v1.0">;
524
+ actionId: z.ZodString;
525
+ actionResponse: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
526
+ value: z.ZodUnknown;
527
+ }, "strict", z.ZodTypeAny, {
528
+ value?: unknown;
529
+ }, {
530
+ value?: unknown;
531
+ }>, z.ZodObject<{
532
+ error: z.ZodObject<{
533
+ code: z.ZodString;
534
+ message: z.ZodString;
535
+ }, "strict", z.ZodTypeAny, {
536
+ code: string;
537
+ message: string;
538
+ }, {
539
+ code: string;
540
+ message: string;
541
+ }>;
542
+ }, "strict", z.ZodTypeAny, {
543
+ error: {
544
+ code: string;
545
+ message: string;
546
+ };
547
+ }, {
548
+ error: {
549
+ code: string;
550
+ message: string;
551
+ };
552
+ }>]>, {
553
+ value?: unknown;
554
+ } | {
555
+ error: {
556
+ code: string;
557
+ message: string;
558
+ };
559
+ }, {
560
+ value?: unknown;
561
+ } | {
562
+ error: {
563
+ code: string;
564
+ message: string;
565
+ };
566
+ }>;
567
+ }, "strict", z.ZodTypeAny, {
568
+ version: "v1.0";
569
+ actionId: string;
570
+ actionResponse: {
571
+ value?: unknown;
572
+ } | {
573
+ error: {
574
+ code: string;
575
+ message: string;
576
+ };
577
+ };
578
+ }, {
579
+ version: "v1.0";
580
+ actionId: string;
581
+ actionResponse: {
582
+ value?: unknown;
583
+ } | {
584
+ error: {
585
+ code: string;
586
+ message: string;
587
+ };
588
+ };
589
+ }>;
590
+ };
591
+ type MessageKey = keyof typeof MESSAGE_KEY_SCHEMAS;
592
+ /** Exported so `interpreter.ts` can look up "which of the *known* message-type keys is present" the same way this module's own dispatcher does, instead of guessing from raw object-key order (which could pick up an unrelated extra top-level key first). */
593
+ export declare const AGENT_TO_RENDERER_MESSAGE_KEYS: MessageKey[];
594
+ export interface ParseFailure {
595
+ readonly ok: false;
596
+ readonly code: 'MISSING_VERSION' | 'UNSUPPORTED_VERSION' | 'NO_MESSAGE_KEY' | 'AMBIGUOUS_MESSAGE' | 'VALIDATION_FAILED';
597
+ readonly message: string;
598
+ readonly path?: string;
599
+ }
600
+ export interface ParseSuccess {
601
+ readonly ok: true;
602
+ readonly message: AgentToRendererMessage;
603
+ }
604
+ /**
605
+ * Validates a raw (untrusted, possibly-malformed) value as one A2UI agent→renderer envelope.
606
+ * Never throws — every failure mode (missing `version`, an unrecognized/absent message-type key,
607
+ * two message-type keys at once, or a structurally invalid message body) returns a tagged
608
+ * `ParseFailure` instead, mirroring how a real renderer must degrade on the wire: reject the one
609
+ * bad message with a specific reason, not crash the whole connection.
610
+ */
611
+ export declare function parseAgentToRendererMessage(raw: unknown): ParseSuccess | ParseFailure;
612
+ export {};
613
+ //# sourceMappingURL=agent-to-renderer.d.ts.map