@polyxd/a2ui 0.1.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.
- package/LICENSE +202 -0
- package/NOTICE +177 -0
- package/README.md +101 -0
- package/catalog/catalog.json +2806 -0
- package/dist/a2ui.d.ts +22 -0
- package/dist/a2ui.js +28 -0
- package/dist/a2ui.js.map +1 -0
- package/dist/catalog.d.ts +33 -0
- package/dist/catalog.js +184 -0
- package/dist/catalog.js.map +1 -0
- package/dist/export.d.ts +79 -0
- package/dist/export.js +120 -0
- package/dist/export.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/mapping.d.ts +18 -0
- package/dist/mapping.js +133 -0
- package/dist/mapping.js.map +1 -0
- package/dist/validate.d.ts +18 -0
- package/dist/validate.js +83 -0
- package/dist/validate.js.map +1 -0
- package/package.json +36 -0
- package/vendor/a2ui/v1_0-04e6f07/LICENSE +227 -0
- package/vendor/a2ui/v1_0-04e6f07/README.md +29 -0
- package/vendor/a2ui/v1_0-04e6f07/catalogs/basic/catalog.json +1220 -0
- package/vendor/a2ui/v1_0-04e6f07/json/agent_to_renderer.json +216 -0
- package/vendor/a2ui/v1_0-04e6f07/json/catalog_definition.json +229 -0
- package/vendor/a2ui/v1_0-04e6f07/json/common_types.json +386 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://a2ui.org/specification/v1_0/common_types.json",
|
|
4
|
+
"title": "A2UI Common Types",
|
|
5
|
+
"description": "Common type definitions used across A2UI schemas.",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"ComponentId": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The unique identifier for a component, used for both definitions and references within the same surface."
|
|
10
|
+
},
|
|
11
|
+
"CallId": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "The unique identifier for a function call."
|
|
14
|
+
},
|
|
15
|
+
"AccessibilityAttributes": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"description": "Attributes to enhance accessibility when using assistive technologies like screen readers or model understanding.",
|
|
18
|
+
"properties": {
|
|
19
|
+
"label": {
|
|
20
|
+
"$ref": "#/$defs/DynamicString",
|
|
21
|
+
"description": "A short string, typically 1 to 3 words, used by assistive technologies to convey the purpose or intent of an element. For example, an input field might have an accessible label of 'User ID' or a button might be labeled 'Submit'."
|
|
22
|
+
},
|
|
23
|
+
"description": {
|
|
24
|
+
"$ref": "#/$defs/DynamicString",
|
|
25
|
+
"description": "Additional information provided by assistive technologies about an element such as instructions, format requirements, or result of an action. For example, a mute button might have a label of 'Mute' and a description of 'Silences notifications about this conversation'."
|
|
26
|
+
},
|
|
27
|
+
"live": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"enum": ["off", "polite", "assertive"],
|
|
30
|
+
"default": "off",
|
|
31
|
+
"description": "Controls screen reader announcements for dynamic updates (WAI-ARIA aria-live). 'polite' waits for user pause; 'assertive' interrupts immediately for alerts."
|
|
32
|
+
},
|
|
33
|
+
"hidden": {
|
|
34
|
+
"$ref": "#/$defs/DynamicBoolean",
|
|
35
|
+
"description": "Hides the element and its children from assistive technologies when true. Default is false."
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"additionalProperties": false
|
|
39
|
+
},
|
|
40
|
+
"Extensions": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"description": "Optional extension metadata. Keys MUST be Unicode identifiers (UAX #31). Keys starting with 'a2ui_' are reserved for official extensions.",
|
|
43
|
+
"patternProperties": {
|
|
44
|
+
"^[\\p{XID_Start}_][\\p{XID_Continue}]*$": {}
|
|
45
|
+
},
|
|
46
|
+
"additionalProperties": false
|
|
47
|
+
},
|
|
48
|
+
"ComponentCommon": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"properties": {
|
|
51
|
+
"id": {
|
|
52
|
+
"$ref": "#/$defs/ComponentId"
|
|
53
|
+
},
|
|
54
|
+
"catalogId": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "The catalog ID for this component, overriding any surface-level default catalogId."
|
|
57
|
+
},
|
|
58
|
+
"accessibility": {
|
|
59
|
+
"$ref": "#/$defs/AccessibilityAttributes"
|
|
60
|
+
},
|
|
61
|
+
"metadata": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"description": "Optional component-level metadata for vendor extensions.",
|
|
64
|
+
"properties": {
|
|
65
|
+
"extensions": {
|
|
66
|
+
"$ref": "#/$defs/Extensions"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"additionalProperties": false
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"required": ["id"]
|
|
73
|
+
},
|
|
74
|
+
"Child": {
|
|
75
|
+
"$ref": "#/$defs/ComponentId",
|
|
76
|
+
"description": "A reference to a single child component ID."
|
|
77
|
+
},
|
|
78
|
+
"ChildList": {
|
|
79
|
+
"oneOf": [
|
|
80
|
+
{
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": {
|
|
83
|
+
"$ref": "#/$defs/ComponentId"
|
|
84
|
+
},
|
|
85
|
+
"description": "A static list of child component IDs."
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"type": "object",
|
|
89
|
+
"description": "A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.",
|
|
90
|
+
"properties": {
|
|
91
|
+
"componentId": {
|
|
92
|
+
"$ref": "#/$defs/ComponentId"
|
|
93
|
+
},
|
|
94
|
+
"path": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "The path to the list of component property objects in the data model."
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"required": ["componentId", "path"],
|
|
100
|
+
"additionalProperties": false
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"DataBinding": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"properties": {
|
|
107
|
+
"path": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"description": "A JSON Pointer path to a value in the data model."
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"required": ["path"],
|
|
113
|
+
"additionalProperties": false
|
|
114
|
+
},
|
|
115
|
+
"DynamicValue": {
|
|
116
|
+
"description": "A value that can be a literal, a path, or a function call returning any type.",
|
|
117
|
+
"oneOf": [
|
|
118
|
+
{
|
|
119
|
+
"type": "string"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"type": "number"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"type": "boolean"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"type": "array"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"type": "object",
|
|
132
|
+
"not": {
|
|
133
|
+
"anyOf": [
|
|
134
|
+
{
|
|
135
|
+
"required": ["path"]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"required": ["call"]
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"$ref": "#/$defs/DataBinding"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"$ref": "#/$defs/FunctionCall"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
"DynamicString": {
|
|
152
|
+
"description": "Represents a string",
|
|
153
|
+
"oneOf": [
|
|
154
|
+
{
|
|
155
|
+
"type": "string"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"$ref": "#/$defs/DataBinding"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"$ref": "#/$defs/FunctionCall"
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
"DynamicNumber": {
|
|
166
|
+
"description": "Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number.",
|
|
167
|
+
"oneOf": [
|
|
168
|
+
{
|
|
169
|
+
"type": "number"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"$ref": "#/$defs/DataBinding"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"$ref": "#/$defs/FunctionCall"
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
"DynamicBoolean": {
|
|
180
|
+
"description": "A boolean value that can be a literal, a path, or a function call returning a boolean.",
|
|
181
|
+
"oneOf": [
|
|
182
|
+
{
|
|
183
|
+
"type": "boolean"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"$ref": "#/$defs/DataBinding"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"$ref": "#/$defs/FunctionCall"
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
"DynamicStringList": {
|
|
194
|
+
"description": "Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array.",
|
|
195
|
+
"oneOf": [
|
|
196
|
+
{
|
|
197
|
+
"type": "array",
|
|
198
|
+
"items": {
|
|
199
|
+
"type": "string"
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"$ref": "#/$defs/DataBinding"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"$ref": "#/$defs/FunctionCall"
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
"FunctionCommon": {
|
|
211
|
+
"type": "object",
|
|
212
|
+
"description": "Baseline envelope properties common to all function calls. Function-specific argument schemas ('args') are defined individually by each function in the active catalog.",
|
|
213
|
+
"properties": {
|
|
214
|
+
"call": {
|
|
215
|
+
"type": "string",
|
|
216
|
+
"description": "The name of the function to call."
|
|
217
|
+
},
|
|
218
|
+
"catalogId": {
|
|
219
|
+
"type": "string",
|
|
220
|
+
"description": "The catalog ID for this function, overriding any surface-level default catalogId."
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"required": ["call"]
|
|
224
|
+
},
|
|
225
|
+
"IndexSystemFunction": {
|
|
226
|
+
"type": "object",
|
|
227
|
+
"description": "Returns the 0-based index of the current item when rendering a dynamic list from a template. This function MUST ONLY be available when evaluating template items within a list context.",
|
|
228
|
+
"returnType": "number",
|
|
229
|
+
"properties": {
|
|
230
|
+
"call": {
|
|
231
|
+
"const": "@index"
|
|
232
|
+
},
|
|
233
|
+
"args": {
|
|
234
|
+
"type": "object",
|
|
235
|
+
"properties": {
|
|
236
|
+
"offset": {
|
|
237
|
+
"$ref": "#/$defs/DynamicNumber",
|
|
238
|
+
"description": "Optional. An offset to add to the 0-based index (e.g., 1 for 1-based indexing). Defaults to 0.",
|
|
239
|
+
"default": 0
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"unevaluatedProperties": false
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"required": ["call"],
|
|
246
|
+
"unevaluatedProperties": false
|
|
247
|
+
},
|
|
248
|
+
"FunctionCall": {
|
|
249
|
+
"type": "object",
|
|
250
|
+
"description": "Invokes a named function, combining common function properties with the catalog function definition.",
|
|
251
|
+
"allOf": [
|
|
252
|
+
{
|
|
253
|
+
"$ref": "#/$defs/FunctionCommon"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"oneOf": [
|
|
257
|
+
{
|
|
258
|
+
"$ref": "catalog.json#/$defs/anyFunction"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"$ref": "#/$defs/IndexSystemFunction"
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
"unevaluatedProperties": false
|
|
267
|
+
},
|
|
268
|
+
"CheckRule": {
|
|
269
|
+
"type": "object",
|
|
270
|
+
"description": "A single validation check rule applied to an input component. The condition function or path evaluates to a ValidationResult object.",
|
|
271
|
+
"properties": {
|
|
272
|
+
"condition": {
|
|
273
|
+
"oneOf": [{"$ref": "#/$defs/DataBinding"}, {"$ref": "#/$defs/FunctionCall"}],
|
|
274
|
+
"description": "Path or function call evaluating to a ValidationResult object."
|
|
275
|
+
},
|
|
276
|
+
"message": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"description": "Optional fallback error message."
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"required": ["condition"],
|
|
282
|
+
"additionalProperties": false
|
|
283
|
+
},
|
|
284
|
+
"Checkable": {
|
|
285
|
+
"description": "Properties for components that support renderer-side checks.",
|
|
286
|
+
"type": "object",
|
|
287
|
+
"properties": {
|
|
288
|
+
"checks": {
|
|
289
|
+
"type": "array",
|
|
290
|
+
"description": "A list of checks to perform. These are function calls that must return a boolean indicating validity.",
|
|
291
|
+
"items": {
|
|
292
|
+
"$ref": "#/$defs/CheckRule"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"Action": {
|
|
298
|
+
"description": "Defines an interaction handler that can either trigger an agent-side event or execute a local renderer-side function.",
|
|
299
|
+
"oneOf": [
|
|
300
|
+
{
|
|
301
|
+
"type": "object",
|
|
302
|
+
"description": "Triggers an agent-side event.",
|
|
303
|
+
"properties": {
|
|
304
|
+
"event": {
|
|
305
|
+
"type": "object",
|
|
306
|
+
"description": "The event to dispatch to the agent.",
|
|
307
|
+
"properties": {
|
|
308
|
+
"name": {
|
|
309
|
+
"type": "string",
|
|
310
|
+
"description": "The name of the action to be dispatched to the agent."
|
|
311
|
+
},
|
|
312
|
+
"userMessage": {
|
|
313
|
+
"$ref": "#/$defs/DynamicString",
|
|
314
|
+
"description": "An optional human-readable message describing the action performed by the user, to present in conversation history or user feedback."
|
|
315
|
+
},
|
|
316
|
+
"context": {
|
|
317
|
+
"type": "object",
|
|
318
|
+
"description": "A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.",
|
|
319
|
+
"additionalProperties": {
|
|
320
|
+
"$ref": "#/$defs/DynamicValue"
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"required": ["name"],
|
|
325
|
+
"additionalProperties": false
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"required": ["event"],
|
|
329
|
+
"additionalProperties": false
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"type": "object",
|
|
333
|
+
"description": "Executes a renderer or agent-side function.",
|
|
334
|
+
"properties": {
|
|
335
|
+
"functionCall": {
|
|
336
|
+
"$ref": "#/$defs/FunctionCall"
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
"required": ["functionCall"],
|
|
340
|
+
"additionalProperties": false
|
|
341
|
+
}
|
|
342
|
+
]
|
|
343
|
+
},
|
|
344
|
+
"Surface": {
|
|
345
|
+
"title": "Surface Container Component",
|
|
346
|
+
"description": "The reserved canonical container component representing an A2UI surface. The Surface component is immutable and always has 'child': 'root'.",
|
|
347
|
+
"type": "object",
|
|
348
|
+
"allowedParents": [],
|
|
349
|
+
"properties": {
|
|
350
|
+
"component": {
|
|
351
|
+
"const": "Surface"
|
|
352
|
+
},
|
|
353
|
+
"child": {
|
|
354
|
+
"const": "root"
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
"additionalProperties": false
|
|
358
|
+
},
|
|
359
|
+
"FunctionResponse": {
|
|
360
|
+
"type": "object",
|
|
361
|
+
"description": "The return response matching a callAgentFunction or callRendererFunction invocation.",
|
|
362
|
+
"properties": {
|
|
363
|
+
"functionCallId": {
|
|
364
|
+
"$ref": "#/$defs/CallId",
|
|
365
|
+
"description": "The unique ID matching the initiating function call."
|
|
366
|
+
},
|
|
367
|
+
"value": {
|
|
368
|
+
"description": "The return value of the function."
|
|
369
|
+
},
|
|
370
|
+
"error": {
|
|
371
|
+
"type": "object",
|
|
372
|
+
"description": "An error object indicating failure of the function execution.",
|
|
373
|
+
"properties": {
|
|
374
|
+
"code": {"type": "string"},
|
|
375
|
+
"message": {"type": "string"}
|
|
376
|
+
},
|
|
377
|
+
"required": ["code", "message"],
|
|
378
|
+
"additionalProperties": false
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
"required": ["functionCallId"],
|
|
382
|
+
"oneOf": [{"required": ["value"]}, {"required": ["error"]}],
|
|
383
|
+
"additionalProperties": false
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|