@jini-ai/agentic 0.4.3 → 0.4.4

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 (81) hide show
  1. package/dist/core/handle.d.ts +13 -0
  2. package/dist/core/handle.js +19 -0
  3. package/dist/core/index.d.ts +2 -1
  4. package/dist/core/index.js +2 -1
  5. package/dist/core/site-guide/index.d.ts +4 -0
  6. package/dist/core/site-guide/index.js +4 -0
  7. package/dist/core/site-guide/site-guide.d.ts +18 -0
  8. package/dist/core/site-guide/site-guide.js +144 -0
  9. package/dist/core/site-guide/topic-schema.d.ts +16 -0
  10. package/dist/core/site-guide/topic-schema.js +68 -0
  11. package/dist/core/site-guide/types.d.ts +83 -0
  12. package/dist/core/site-guide/types.js +2 -0
  13. package/dist/skills/install/archive.js +1 -0
  14. package/dist/skills/install/index.d.ts +1 -0
  15. package/dist/skills/install/index.js +1 -0
  16. package/dist/skills/install/install-service.d.ts +20 -1
  17. package/dist/skills/install/install-service.js +23 -11
  18. package/dist/skills/install/layout.d.ts +8 -0
  19. package/dist/skills/install/layout.js +26 -1
  20. package/dist/skills/install/live-registration.js +1 -0
  21. package/dist/skills/install/validation.d.ts +5 -1
  22. package/dist/skills/install/validation.js +2 -2
  23. package/dist/skills/install/yauzl-archive-reader.d.ts +29 -0
  24. package/dist/skills/install/yauzl-archive-reader.js +31 -0
  25. package/package.json +4 -4
  26. package/dist/a2ui/agent-to-renderer.d.ts +0 -613
  27. package/dist/a2ui/agent-to-renderer.js +0 -191
  28. package/dist/a2ui/catalog.d.ts +0 -73
  29. package/dist/a2ui/catalog.js +0 -304
  30. package/dist/a2ui/common-types.d.ts +0 -401
  31. package/dist/a2ui/common-types.js +0 -130
  32. package/dist/a2ui/index.d.ts +0 -16
  33. package/dist/a2ui/index.js +0 -16
  34. package/dist/a2ui/interpreter.d.ts +0 -71
  35. package/dist/a2ui/interpreter.js +0 -337
  36. package/dist/a2ui/json-pointer.d.ts +0 -48
  37. package/dist/a2ui/json-pointer.js +0 -174
  38. package/dist/a2ui/renderer-to-agent.d.ts +0 -342
  39. package/dist/a2ui/renderer-to-agent.js +0 -111
  40. package/dist/a2ui/resolve.d.ts +0 -28
  41. package/dist/a2ui/resolve.js +0 -144
  42. package/dist/a2ui/tree.d.ts +0 -66
  43. package/dist/a2ui/tree.js +0 -74
  44. package/dist/ag-ui.d.ts +0 -82
  45. package/dist/ag-ui.js +0 -85
  46. package/dist/agui/encoder.d.ts +0 -50
  47. package/dist/agui/encoder.js +0 -97
  48. package/dist/agui/events.d.ts +0 -59
  49. package/dist/agui/events.js +0 -15
  50. package/dist/capability.d.ts +0 -81
  51. package/dist/capability.js +0 -79
  52. package/dist/dom/dom-page-driver.d.ts +0 -36
  53. package/dist/dom/dom-page-driver.js +0 -601
  54. package/dist/dom/index.d.ts +0 -17
  55. package/dist/dom/index.js +0 -17
  56. package/dist/dom/model-context.d.ts +0 -69
  57. package/dist/dom/model-context.js +0 -44
  58. package/dist/element-handles.d.ts +0 -120
  59. package/dist/element-handles.js +0 -39
  60. package/dist/gen-ui/encoder.d.ts +0 -50
  61. package/dist/gen-ui/encoder.js +0 -97
  62. package/dist/gen-ui/events.d.ts +0 -59
  63. package/dist/gen-ui/events.js +0 -15
  64. package/dist/gen-ui/index.d.ts +0 -18
  65. package/dist/gen-ui/index.js +0 -17
  66. package/dist/guards.d.ts +0 -96
  67. package/dist/guards.js +0 -186
  68. package/dist/handle.d.ts +0 -41
  69. package/dist/handle.js +0 -41
  70. package/dist/mcp-ui-apps.d.ts +0 -223
  71. package/dist/mcp-ui-apps.js +0 -252
  72. package/dist/mcp-ui.d.ts +0 -133
  73. package/dist/mcp-ui.js +0 -134
  74. package/dist/page-capabilities.d.ts +0 -14
  75. package/dist/page-capabilities.js +0 -129
  76. package/dist/page-driver.d.ts +0 -120
  77. package/dist/page-driver.js +0 -2
  78. package/dist/page-executor.d.ts +0 -94
  79. package/dist/page-executor.js +0 -320
  80. package/dist/webmcp.d.ts +0 -202
  81. package/dist/webmcp.js +0 -173
@@ -0,0 +1,29 @@
1
+ import type { ArchiveReaderPort } from "./ports.js";
2
+ interface ZipEntry {
3
+ fileName: string;
4
+ uncompressedSize: number;
5
+ externalFileAttributes: number;
6
+ }
7
+ interface ZipFile {
8
+ eachEntry(): AsyncIterable<ZipEntry>;
9
+ openReadStreamPromise(entry: ZipEntry): Promise<AsyncIterable<Uint8Array> & {
10
+ destroy(): void;
11
+ }>;
12
+ close(): void;
13
+ }
14
+ export interface SkillZipSdkPort {
15
+ fromBufferPromise(bytes: Buffer, options: {
16
+ lazyEntries: boolean;
17
+ strictFileNames: boolean;
18
+ validateEntrySizes: boolean;
19
+ }): Promise<ZipFile>;
20
+ }
21
+ /** Bind the installed ZIP library, preserving strict filenames and regular-file-only semantics.
22
+ * Unlike executable plugin archives, skill scripts are inert data and every non-regular mode is
23
+ * refused regardless of the ZIP producer's platform marker.
24
+ */
25
+ export declare function createYauzlSkillArchiveReader({ yauzl }: {
26
+ yauzl: SkillZipSdkPort;
27
+ }, _optional?: {}): ArchiveReaderPort;
28
+ export {};
29
+ //# sourceMappingURL=yauzl-archive-reader.d.ts.map
@@ -0,0 +1,31 @@
1
+ /** Bind the installed ZIP library, preserving strict filenames and regular-file-only semantics.
2
+ * Unlike executable plugin archives, skill scripts are inert data and every non-regular mode is
3
+ * refused regardless of the ZIP producer's platform marker.
4
+ */
5
+ export function createYauzlSkillArchiveReader({ yauzl }, _optional = {}) {
6
+ return { async open({ bytes }) {
7
+ const zip = await yauzl.fromBufferPromise(Buffer.from(bytes), { lazyEntries: true, strictFileNames: true, validateEntrySizes: true });
8
+ return {
9
+ entries: (async function* () {
10
+ for await (const entry of zip.eachEntry()) {
11
+ const type = (entry.externalFileAttributes >>> 16) & 0xf000;
12
+ const kind = type && type !== 0x8000 && type !== 0x4000 ? "other" : entry.fileName.endsWith("/") ? "directory" : "file";
13
+ yield { path: entry.fileName, size: entry.uncompressedSize, kind,
14
+ async *read() {
15
+ const stream = await zip.openReadStreamPromise(entry);
16
+ try {
17
+ for await (const chunk of stream)
18
+ yield chunk;
19
+ }
20
+ finally {
21
+ stream.destroy();
22
+ }
23
+ },
24
+ };
25
+ }
26
+ })(),
27
+ close: () => zip.close(),
28
+ };
29
+ } };
30
+ }
31
+ //# sourceMappingURL=yauzl-archive-reader.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/agentic",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Framework-free agent-control layer: page-capability vocabulary and manifests, the data-agent-* markup convention, AG-UI projection, generative-UI streams, and A2UI.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -77,12 +77,12 @@
77
77
  "jsdom": "^25.0.1",
78
78
  "zod": "^3.25.76",
79
79
  "@jini-ai/core": "^0.4.0",
80
- "@jini-ai/protocol": "^0.4.2"
80
+ "@jini-ai/protocol": "^0.4.4"
81
81
  },
82
82
  "peerDependencies": {
83
- "@jini-ai/protocol": "^0.4.1",
83
+ "@jini-ai/protocol": "^0.4.4",
84
84
  "zod": "^3.25.76",
85
- "@jini-ai/core": "^0.4.0"
85
+ "@jini-ai/core": "^0.4.3"
86
86
  },
87
87
  "peerDependenciesMeta": {
88
88
  "@jini-ai/protocol": {
@@ -1,613 +0,0 @@
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