@mcp-native/a2ui 0.1.0 → 0.3.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 (83) hide show
  1. package/README.md +100 -13
  2. package/dist/binding.d.ts +33 -0
  3. package/dist/binding.d.ts.map +1 -0
  4. package/dist/binding.js +83 -0
  5. package/dist/binding.js.map +1 -0
  6. package/dist/errors.d.ts +7 -0
  7. package/dist/errors.d.ts.map +1 -0
  8. package/dist/errors.js +13 -0
  9. package/dist/errors.js.map +1 -0
  10. package/dist/index.d.ts +9 -12
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +7 -13
  13. package/dist/index.js.map +1 -1
  14. package/dist/mime.d.ts +6 -0
  15. package/dist/mime.d.ts.map +1 -0
  16. package/dist/mime.js +2 -0
  17. package/dist/mime.js.map +1 -0
  18. package/dist/schema-revision.d.ts +3 -0
  19. package/dist/schema-revision.d.ts.map +1 -0
  20. package/dist/schema-revision.js +3 -0
  21. package/dist/schema-revision.js.map +1 -0
  22. package/dist/v1/action.d.ts +7 -0
  23. package/dist/v1/action.d.ts.map +1 -0
  24. package/dist/v1/action.js +86 -0
  25. package/dist/v1/action.js.map +1 -0
  26. package/dist/v1/capabilities.d.ts +13 -0
  27. package/dist/v1/capabilities.d.ts.map +1 -0
  28. package/dist/v1/capabilities.js +134 -0
  29. package/dist/v1/capabilities.js.map +1 -0
  30. package/dist/v1/format-string.d.ts +21 -0
  31. package/dist/v1/format-string.d.ts.map +1 -0
  32. package/dist/v1/format-string.js +487 -0
  33. package/dist/v1/format-string.js.map +1 -0
  34. package/dist/v1/index.d.ts +13 -0
  35. package/dist/v1/index.d.ts.map +1 -0
  36. package/dist/v1/index.js +9 -0
  37. package/dist/v1/index.js.map +1 -0
  38. package/dist/v1/parse.d.ts +12 -0
  39. package/dist/v1/parse.d.ts.map +1 -0
  40. package/dist/v1/parse.js +96 -0
  41. package/dist/v1/parse.js.map +1 -0
  42. package/dist/v1/resolve.d.ts +19 -0
  43. package/dist/v1/resolve.d.ts.map +1 -0
  44. package/dist/v1/resolve.js +112 -0
  45. package/dist/v1/resolve.js.map +1 -0
  46. package/dist/v1/schemas.d.ts +16 -0
  47. package/dist/v1/schemas.d.ts.map +1 -0
  48. package/dist/v1/schemas.js +133 -0
  49. package/dist/v1/schemas.js.map +1 -0
  50. package/dist/v1/store.d.ts +21 -0
  51. package/dist/v1/store.d.ts.map +1 -0
  52. package/dist/v1/store.js +305 -0
  53. package/dist/v1/store.js.map +1 -0
  54. package/dist/v1/types.d.ts +109 -0
  55. package/dist/v1/types.d.ts.map +1 -0
  56. package/dist/v1/types.js +10 -0
  57. package/dist/v1/types.js.map +1 -0
  58. package/dist/v1/validate.d.ts +26 -0
  59. package/dist/v1/validate.d.ts.map +1 -0
  60. package/dist/v1/validate.js +449 -0
  61. package/dist/v1/validate.js.map +1 -0
  62. package/dist/v1/vendor/agent_capabilities.json +26 -0
  63. package/dist/v1/vendor/agent_to_renderer.json +216 -0
  64. package/dist/v1/vendor/catalog.json +1346 -0
  65. package/dist/v1/vendor/common_types.json +395 -0
  66. package/dist/v1/vendor/renderer_capabilities.json +29 -0
  67. package/dist/v1/vendor/renderer_to_agent.json +161 -0
  68. package/package.json +5 -2
  69. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/CHECKSUMS.sha256 +13 -0
  70. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/PROVENANCE.md +12 -0
  71. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/catalogs/basic/catalog.json +1346 -0
  72. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/json/agent_capabilities.json +26 -0
  73. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/json/agent_to_renderer.json +216 -0
  74. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/json/agent_to_renderer_list.json +10 -0
  75. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/json/agent_to_renderer_list_wrapper.json +14 -0
  76. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/json/catalog_definition.json +267 -0
  77. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/json/common_types.json +395 -0
  78. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/json/renderer_capabilities.json +29 -0
  79. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/json/renderer_data_model.json +22 -0
  80. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/json/renderer_to_agent.json +161 -0
  81. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/json/renderer_to_agent_list.json +10 -0
  82. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/json/renderer_to_agent_list_wrapper.json +14 -0
  83. package/schemas/7541f953050cd58b80f0bf5d85fe2d63192af305/json/sample.json +22 -0
@@ -0,0 +1,216 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://a2ui.org/specification/v1_0/agent_to_renderer.json",
4
+ "title": "A2UI Message Schema",
5
+ "description": "Describes a JSON payload for an A2UI (Agent to UI) message, which is used to dynamically construct and update user interfaces.",
6
+ "type": "object",
7
+ "oneOf": [
8
+ { "$ref": "#/$defs/CreateSurfaceMessage" },
9
+ { "$ref": "#/$defs/UpdateComponentsMessage" },
10
+ { "$ref": "#/$defs/UpdateDataModelMessage" },
11
+ { "$ref": "#/$defs/DeleteSurfaceMessage" },
12
+ { "$ref": "#/$defs/CallRendererFunctionMessage" },
13
+ { "$ref": "#/$defs/AgentFunctionResponseMessage" }
14
+ ],
15
+ "$defs": {
16
+ "CreateSurfaceMessage": {
17
+ "type": "object",
18
+ "properties": {
19
+ "version": {
20
+ "const": "v1.0"
21
+ },
22
+ "createSurface": {
23
+ "type": "object",
24
+ "description": "Signals the renderer to create a new surface and begin rendering it. Creating a surface implicitly instantiates the canonical 'Surface' container component ('common_types.json#/$defs/Surface') with 'child': 'root'. It is an error to try to create a surface with an existing ID without first deleting it; surfaceId MUST be globally unique for the renderer's lifetime. When this message is sent, the renderer expects 'updateComponents' and/or 'updateDataModel' messages for the same surfaceId to define the component tree.",
25
+ "properties": {
26
+ "surfaceId": {
27
+ "type": "string",
28
+ "description": "The unique identifier for the UI surface to be rendered. It must be globally unique for the renderer's lifetime."
29
+ },
30
+ "catalogId": {
31
+ "description": "A string that uniquely identifies the default catalog for this surface. It is recommended to prefix this with an internet domain that you own, to avoid conflicts e.g. 'mycompany.com:somecatalog'. Components and function calls that do not explicitly specify a catalogId will use this surface-level default catalogId.",
32
+ "type": "string"
33
+ },
34
+ "sendDataModel": {
35
+ "type": "boolean",
36
+ "description": "If true, the renderer will send the full data model of this surface in the metadata of every A2A message sent to the agent that created the surface. Defaults to false."
37
+ },
38
+ "components": {
39
+ "$ref": "#/$defs/ComponentsList"
40
+ },
41
+ "dataModel": {
42
+ "type": "object",
43
+ "description": "The initial root data model object for the surface.",
44
+ "additionalProperties": true
45
+ },
46
+ "metadata": {
47
+ "type": "object",
48
+ "description": "Optional surface-level metadata.",
49
+ "properties": {
50
+ "extensions": {
51
+ "$ref": "common_types.json#/$defs/Extensions"
52
+ }
53
+ },
54
+ "additionalProperties": false
55
+ }
56
+ },
57
+ "required": ["surfaceId"],
58
+ "additionalProperties": false
59
+ }
60
+ },
61
+ "required": ["createSurface", "version"],
62
+ "additionalProperties": false
63
+ },
64
+ "Component": {
65
+ "description": "A UI component for the surface, combining baseline envelope properties with the catalog component definition.",
66
+ "allOf": [
67
+ {
68
+ "$ref": "common_types.json#/$defs/ComponentCommon"
69
+ },
70
+ {
71
+ "$ref": "catalog.json#/$defs/anyComponent"
72
+ },
73
+ {
74
+ "type": "object",
75
+ "properties": {
76
+ "component": {
77
+ "not": {
78
+ "const": "Surface"
79
+ }
80
+ }
81
+ }
82
+ }
83
+ ],
84
+ "unevaluatedProperties": false
85
+ },
86
+ "ComponentsList": {
87
+ "type": "array",
88
+ "description": "A list containing UI components for the surface.",
89
+ "minItems": 1,
90
+ "items": {
91
+ "$ref": "#/$defs/Component"
92
+ }
93
+ },
94
+ "UpdateComponentsMessage": {
95
+ "type": "object",
96
+ "properties": {
97
+ "version": {
98
+ "const": "v1.0"
99
+ },
100
+ "updateComponents": {
101
+ "type": "object",
102
+ "description": "Updates a surface with a new set of components. This message can be sent multiple times to update the component tree of an existing surface. One of the components in one of the components lists MUST have an 'id' of 'root' to serve as the root of the component tree. The createSurface message MUST have been previously sent for this surfaceId.",
103
+ "properties": {
104
+ "surfaceId": {
105
+ "type": "string",
106
+ "description": "The unique identifier for the UI surface to be updated. It must be globally unique for the renderer's lifetime."
107
+ },
108
+ "components": {
109
+ "$ref": "#/$defs/ComponentsList"
110
+ }
111
+ },
112
+ "required": ["surfaceId", "components"],
113
+ "additionalProperties": false
114
+ }
115
+ },
116
+ "required": ["updateComponents", "version"],
117
+ "additionalProperties": false
118
+ },
119
+ "UpdateDataModelMessage": {
120
+ "type": "object",
121
+ "properties": {
122
+ "version": {
123
+ "const": "v1.0"
124
+ },
125
+ "updateDataModel": {
126
+ "type": "object",
127
+ "description": "Updates the data model for an existing surface. This message can be sent multiple times to update the data model. The createSurface message MUST have been previously sent for this surfaceId.",
128
+ "properties": {
129
+ "surfaceId": {
130
+ "type": "string",
131
+ "description": "The unique identifier for the UI surface this data model update applies to. It must be globally unique for the renderer's lifetime."
132
+ },
133
+ "path": {
134
+ "type": "string",
135
+ "description": "An optional path to a location within the data model (e.g., '/user/name'). If omitted, or set to '/', refers to the entire data model."
136
+ },
137
+ "value": {
138
+ "description": "The data to be updated in the data model. To delete the key/value at 'path', set 'value' explicitly to null."
139
+ }
140
+ },
141
+ "required": ["surfaceId", "value"],
142
+ "additionalProperties": false
143
+ }
144
+ },
145
+ "required": ["updateDataModel", "version"],
146
+ "additionalProperties": false
147
+ },
148
+ "DeleteSurfaceMessage": {
149
+ "type": "object",
150
+ "properties": {
151
+ "version": {
152
+ "const": "v1.0"
153
+ },
154
+ "deleteSurface": {
155
+ "type": "object",
156
+ "description": "Signals the renderer to delete the surface identified by 'surfaceId'. The createSurface message MUST have been previously sent for this surfaceId.",
157
+ "properties": {
158
+ "surfaceId": {
159
+ "type": "string",
160
+ "description": "The unique identifier for the UI surface to be deleted. It must be globally unique for the renderer's lifetime."
161
+ }
162
+ },
163
+ "required": ["surfaceId"],
164
+ "additionalProperties": false
165
+ }
166
+ },
167
+ "required": ["deleteSurface", "version"],
168
+ "additionalProperties": false
169
+ },
170
+ "CallRendererFunctionMessage": {
171
+ "type": "object",
172
+ "properties": {
173
+ "version": {
174
+ "const": "v1.0"
175
+ },
176
+ "callRendererFunction": {
177
+ "type": "object",
178
+ "description": "Signals the renderer to execute a function locally on behalf of the agent.",
179
+ "properties": {
180
+ "functionCallId": {
181
+ "$ref": "common_types.json#/$defs/CallId",
182
+ "description": "Unique ID for this instance of the function call. The renderer MUST copy this ID into the return response."
183
+ },
184
+ "callFunction": {
185
+ "allOf": [
186
+ {
187
+ "$ref": "common_types.json#/$defs/FunctionCall"
188
+ },
189
+ {
190
+ "required": ["catalogId"]
191
+ }
192
+ ]
193
+ }
194
+ },
195
+ "required": ["functionCallId", "callFunction"],
196
+ "additionalProperties": false
197
+ }
198
+ },
199
+ "required": ["callRendererFunction", "version"],
200
+ "additionalProperties": false
201
+ },
202
+ "AgentFunctionResponseMessage": {
203
+ "type": "object",
204
+ "properties": {
205
+ "version": {
206
+ "const": "v1.0"
207
+ },
208
+ "agentFunctionResponse": {
209
+ "$ref": "common_types.json#/$defs/FunctionResponse"
210
+ }
211
+ },
212
+ "required": ["agentFunctionResponse", "version"],
213
+ "additionalProperties": false
214
+ }
215
+ }
216
+ }