@adia-ai/a2ui 0.8.37 → 0.8.39
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/CHANGELOG.md +46 -22
- package/README.md +14 -0
- package/a2ui.schema.d.ts +1 -1
- package/catalog/catalog-a2ui_0_9.d.ts +4 -0
- package/catalog/catalog-a2ui_0_9.json +29838 -0
- package/catalog/catalog-a2ui_0_9_rules.txt +1223 -0
- package/catalog/common_types.d.ts +5 -0
- package/catalog/common_types.json +222 -0
- package/catalog/functions.d.ts +5 -0
- package/catalog/functions.json +253 -0
- package/catalog/tier-index.d.ts +4 -0
- package/catalog/tier-index.json +7790 -0
- package/catalog/tiers/README.md +94 -0
- package/catalog/tiers/curation/l1-widgets.curation.json +153 -0
- package/catalog/tiers/l1-widgets.json +6789 -0
- package/package.json +23 -2
- package/registry.js +1 -0
- package/validate/CHANGELOG.md +23 -23
- package/validate/README.md +14 -9
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/common_types.json",
|
|
4
|
+
"title": "AdiaUI A2UI Common Types",
|
|
5
|
+
"description": "Shared structural primitives used by every AdiaUI catalog component. Modeled after Google A2UI v0.9 (github.com/google/A2UI/blob/main/specification/v0_9/json/common_types.json) so catalogs produced here remain shape-compatible with the public spec. An authoring-time dependency — at publish time, scripts/build-components.mjs inlines these entries into the assembled catalog's $defs.",
|
|
6
|
+
|
|
7
|
+
"$defs": {
|
|
8
|
+
"ComponentId": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Reference to another component's id within the same surface. Validators follow this ref to verify the target exists."
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
"ChildList": {
|
|
14
|
+
"oneOf": [
|
|
15
|
+
{
|
|
16
|
+
"type": "array",
|
|
17
|
+
"items": { "$ref": "#/$defs/ComponentId" },
|
|
18
|
+
"description": "A static list of child component ids."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": "object",
|
|
22
|
+
"description": "A template-driven list: binds a data model list and stamps a component template per item.",
|
|
23
|
+
"properties": {
|
|
24
|
+
"path": { "type": "string" },
|
|
25
|
+
"componentId": { "$ref": "#/$defs/ComponentId" }
|
|
26
|
+
},
|
|
27
|
+
"required": ["path", "componentId"],
|
|
28
|
+
"additionalProperties": false
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
"DynamicString": {
|
|
34
|
+
"oneOf": [
|
|
35
|
+
{ "type": "string" },
|
|
36
|
+
{
|
|
37
|
+
"type": "object",
|
|
38
|
+
"properties": { "path": { "type": "string" } },
|
|
39
|
+
"required": ["path"],
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"description": "Binds to a JSON Pointer in the surface's data model."
|
|
42
|
+
},
|
|
43
|
+
{ "$ref": "#/$defs/FunctionCall" }
|
|
44
|
+
],
|
|
45
|
+
"description": "A string that may be a literal, a path-bound reference, or the result of a FunctionCall."
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
"DynamicNumber": {
|
|
49
|
+
"oneOf": [
|
|
50
|
+
{ "type": "number" },
|
|
51
|
+
{
|
|
52
|
+
"type": "object",
|
|
53
|
+
"properties": { "path": { "type": "string" } },
|
|
54
|
+
"required": ["path"],
|
|
55
|
+
"additionalProperties": false
|
|
56
|
+
},
|
|
57
|
+
{ "$ref": "#/$defs/FunctionCall" }
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
"DynamicBoolean": {
|
|
62
|
+
"oneOf": [
|
|
63
|
+
{ "type": "boolean" },
|
|
64
|
+
{
|
|
65
|
+
"type": "object",
|
|
66
|
+
"properties": { "path": { "type": "string" } },
|
|
67
|
+
"required": ["path"],
|
|
68
|
+
"additionalProperties": false
|
|
69
|
+
},
|
|
70
|
+
{ "$ref": "#/$defs/FunctionCall" }
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
"DynamicStringList": {
|
|
75
|
+
"oneOf": [
|
|
76
|
+
{ "type": "array", "items": { "type": "string" } },
|
|
77
|
+
{
|
|
78
|
+
"type": "object",
|
|
79
|
+
"properties": { "path": { "type": "string" } },
|
|
80
|
+
"required": ["path"],
|
|
81
|
+
"additionalProperties": false
|
|
82
|
+
},
|
|
83
|
+
{ "$ref": "#/$defs/FunctionCall" }
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
"DynamicObjectList": {
|
|
88
|
+
"oneOf": [
|
|
89
|
+
{ "type": "array", "items": { "type": "object" } },
|
|
90
|
+
{
|
|
91
|
+
"type": "object",
|
|
92
|
+
"properties": { "path": { "type": "string" } },
|
|
93
|
+
"required": ["path"],
|
|
94
|
+
"additionalProperties": false
|
|
95
|
+
},
|
|
96
|
+
{ "$ref": "#/$defs/FunctionCall" }
|
|
97
|
+
],
|
|
98
|
+
"description": "An array of plain objects (e.g. chart/table row records) that may be a literal, a path-bound reference, or the result of a FunctionCall. TKT-0010: split from DynamicStringList, which only ever accepted array-of-string — the wrong shape for JS-set collection props whose items are records."
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
"FunctionCall": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"properties": {
|
|
104
|
+
"call": { "type": "string", "description": "Name of a function registered in the catalog's `functions` dictionary." },
|
|
105
|
+
"args": { "type": "object", "description": "Named arguments; shape validated by the function's own schema entry." }
|
|
106
|
+
},
|
|
107
|
+
"required": ["call"],
|
|
108
|
+
"additionalProperties": false,
|
|
109
|
+
"description": "A reference to a client-side function. No code crosses the wire — only names and typed arguments."
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
"AccessibilityAttributes": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"properties": {
|
|
115
|
+
"label": { "$ref": "#/$defs/DynamicString", "description": "Short label (1–3 words) used by assistive tech." },
|
|
116
|
+
"description": { "$ref": "#/$defs/DynamicString", "description": "Additional instructions/context for assistive tech." }
|
|
117
|
+
},
|
|
118
|
+
"additionalProperties": false
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
"ComponentCommon": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"properties": {
|
|
124
|
+
"id": { "$ref": "#/$defs/ComponentId" },
|
|
125
|
+
"accessibility": { "$ref": "#/$defs/AccessibilityAttributes" }
|
|
126
|
+
},
|
|
127
|
+
"required": ["id"]
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
"CatalogComponentCommon": {
|
|
131
|
+
"type": "object",
|
|
132
|
+
"description": "Shared properties accepted by every AdiaUI catalog component. Split into three concerns: runtime hooks (visible, style, slot), universal child region (children), and global HTML attributes the renderer honors on every custom element (nomargin, truncate, grow, color, weight, size, align, justify, text). Per-component schemas can restrict these further via their own enum declarations; allOf composition means the stricter rule wins.",
|
|
133
|
+
"properties": {
|
|
134
|
+
"visible": { "$ref": "#/$defs/DynamicBoolean", "description": "When false, the component is not rendered." },
|
|
135
|
+
"style": { "type": "string", "description": "Inline CSS string applied to the host element (use sparingly; prefer variants)." },
|
|
136
|
+
"slot": { "type": "string", "description": "Named slot to project into when child of a slotted container." },
|
|
137
|
+
|
|
138
|
+
"children": { "$ref": "#/$defs/ChildList", "description": "Ordered list of child component ids (or a template binding)." },
|
|
139
|
+
|
|
140
|
+
"nomargin": { "$ref": "#/$defs/DynamicBoolean", "description": "Remove default block margins (typography + prose elements)." },
|
|
141
|
+
"truncate": { "$ref": "#/$defs/DynamicBoolean", "description": "Single-line ellipsis when the container constrains width." },
|
|
142
|
+
"grow": { "$ref": "#/$defs/DynamicBoolean", "description": "flex: 1 — fills remaining space in a flex parent (row-ui/col-ui)." },
|
|
143
|
+
|
|
144
|
+
"color": { "$ref": "#/$defs/DynamicString", "description": "Foreground color role. Common values: text, text-strong, subtle, muted, accent, success, warning, danger, info." },
|
|
145
|
+
"weight": { "$ref": "#/$defs/DynamicString", "description": "Font weight role. Common values: thin, light, normal, medium, semibold, bold." },
|
|
146
|
+
"size": { "$ref": "#/$defs/DynamicString", "description": "Sizing role. Values: sm, md, lg (scale picks the table, size picks the row — denser/larger registers come from an ancestor [scale] tier). Per-component schemas may narrow." },
|
|
147
|
+
"align": { "$ref": "#/$defs/DynamicString", "description": "Alignment role. Values depend on container (flex cross-axis for row-ui/col-ui, text for typography)." },
|
|
148
|
+
"justify": { "$ref": "#/$defs/DynamicString", "description": "Main-axis justification for flex/grid containers." },
|
|
149
|
+
"text": { "$ref": "#/$defs/DynamicString", "description": "Short text payload rendered via CSS attr(text) on ::after (Button, Badge, Tag, etc.)." },
|
|
150
|
+
"prose": { "$ref": "#/$defs/DynamicBoolean", "description": "Content-optimized spacing/typography for long-form prose containers." },
|
|
151
|
+
"icon": { "$ref": "#/$defs/DynamicString", "description": "Leading Phosphor icon name. Components that support leading icons render it; others ignore." },
|
|
152
|
+
"title": { "$ref": "#/$defs/DynamicString", "description": "Short heading/identifier. Used by EmptyState/Dialog/Modal etc. for heading slot shortcut." },
|
|
153
|
+
"label": { "$ref": "#/$defs/DynamicString", "description": "Accessible label or leading heading — aria-label or first-line text depending on component." },
|
|
154
|
+
"hidden": { "$ref": "#/$defs/DynamicBoolean", "description": "HTML [hidden] — element not displayed but remains in the DOM." },
|
|
155
|
+
"textAlign": { "$ref": "#/$defs/DynamicString", "description": "Text alignment — start, center, end, justify." },
|
|
156
|
+
"ariaLabel": { "$ref": "#/$defs/DynamicString", "description": "Accessibility label (maps to aria-label at runtime)." },
|
|
157
|
+
"ariaHidden":{ "$ref": "#/$defs/DynamicBoolean", "description": "Accessibility hidden state (maps to aria-hidden at runtime)." },
|
|
158
|
+
"span": { "$ref": "#/$defs/DynamicString", "description": "Grid-child column span, read by grid-ui's CSS attribute selector ([span=\"N\"] { grid-column: span N }). Layout-bearing like slot — accepted on every component, not a per-component prop (TKT-0002/TKT-0010)." }
|
|
159
|
+
},
|
|
160
|
+
"patternProperties": {
|
|
161
|
+
"^data-": { "description": "Arbitrary data-* attribute — a JS/CSS hook the transpiler passes through verbatim (TKT-0010); not modeled per-component." }
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
"Action": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"description": "An event handler binding. The `event` identifies which AdiaEvent to match; `handler` names a registered handler function; `config` supplies handler arguments.",
|
|
168
|
+
"properties": {
|
|
169
|
+
"event": { "$ref": "#/$defs/Event" },
|
|
170
|
+
"handler": { "type": "string", "description": "Handler name registered in the wiring registry." },
|
|
171
|
+
"config": { "type": "object", "description": "Handler-specific configuration (URL, path, payload, etc.)." },
|
|
172
|
+
"onSuccess": { "type": "array", "items": { "$ref": "#/$defs/Action" } },
|
|
173
|
+
"onError": { "type": "array", "items": { "$ref": "#/$defs/Action" } }
|
|
174
|
+
},
|
|
175
|
+
"required": ["event", "handler"],
|
|
176
|
+
"additionalProperties": false
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
"Event": {
|
|
180
|
+
"type": "object",
|
|
181
|
+
"description": "A typed event selector. Matches events fired by components (submit, input, click, mount, etc.) optionally scoped to a component id.",
|
|
182
|
+
"properties": {
|
|
183
|
+
"event": { "type": "string", "description": "Event type name (e.g. 'submit', 'input', 'press')." },
|
|
184
|
+
"target": { "$ref": "#/$defs/ComponentId", "description": "Optional — scopes the match to a specific component. Omit for surface-level events." },
|
|
185
|
+
"debounce": { "type": "number", "description": "Debounce window in ms." },
|
|
186
|
+
"throttle": { "type": "number", "description": "Throttle window in ms." },
|
|
187
|
+
"condition": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"description": "Guard — the action only fires when the condition holds.",
|
|
190
|
+
"properties": {
|
|
191
|
+
"path": { "type": "string" },
|
|
192
|
+
"equals": {},
|
|
193
|
+
"notEquals": {},
|
|
194
|
+
"exists": { "type": "boolean" }
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"required": ["event"],
|
|
199
|
+
"additionalProperties": false
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
"Checkable": {
|
|
203
|
+
"type": "object",
|
|
204
|
+
"description": "Mixed into components that support validation checks (Input, TextArea, Button, etc.). Failed checks block dependent actions (e.g. a Button with unmet checks is auto-disabled).",
|
|
205
|
+
"properties": {
|
|
206
|
+
"checks": {
|
|
207
|
+
"type": "array",
|
|
208
|
+
"items": {
|
|
209
|
+
"type": "object",
|
|
210
|
+
"properties": {
|
|
211
|
+
"call": { "type": "string" },
|
|
212
|
+
"args": { "type": "object" },
|
|
213
|
+
"errorMessage": { "$ref": "#/$defs/DynamicString" }
|
|
214
|
+
},
|
|
215
|
+
"required": ["call"],
|
|
216
|
+
"additionalProperties": false
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/functions.json",
|
|
4
|
+
"title": "AdiaUI A2UI Functions",
|
|
5
|
+
"description": "Client-side function vocabulary. Each function is a named routine with typed `args` and a declared `returnType`. Agents reference functions by name in `FunctionCall` objects (inside `checks` or anywhere a DynamicString/Number/Boolean is accepted). No code crosses the wire — only names and typed arguments. At publish time, scripts/build-components.mjs inlines these entries into the assembled catalog's `functions` key.",
|
|
6
|
+
|
|
7
|
+
"functions": {
|
|
8
|
+
"required": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"description": "Returns true when `value` is non-empty (non-null string, number, boolean, or array). Used in `checks` to gate Button enablement and surface inline errors.",
|
|
11
|
+
"properties": {
|
|
12
|
+
"call": { "const": "required" },
|
|
13
|
+
"args": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"properties": {
|
|
16
|
+
"value": { "$ref": "common_types.json#/$defs/DynamicString" }
|
|
17
|
+
},
|
|
18
|
+
"required": ["value"],
|
|
19
|
+
"additionalProperties": false
|
|
20
|
+
},
|
|
21
|
+
"returnType": { "const": "boolean" }
|
|
22
|
+
},
|
|
23
|
+
"required": ["call", "args"],
|
|
24
|
+
"unevaluatedProperties": false
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
"minLength": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"description": "Returns true when `value`'s length is at least `min`. Strings count characters; arrays count entries.",
|
|
30
|
+
"properties": {
|
|
31
|
+
"call": { "const": "minLength" },
|
|
32
|
+
"args": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"properties": {
|
|
35
|
+
"value": { "$ref": "common_types.json#/$defs/DynamicString" },
|
|
36
|
+
"min": { "$ref": "common_types.json#/$defs/DynamicNumber" }
|
|
37
|
+
},
|
|
38
|
+
"required": ["value", "min"],
|
|
39
|
+
"additionalProperties": false
|
|
40
|
+
},
|
|
41
|
+
"returnType": { "const": "boolean" }
|
|
42
|
+
},
|
|
43
|
+
"required": ["call", "args"],
|
|
44
|
+
"unevaluatedProperties": false
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
"maxLength": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"description": "Returns true when `value`'s length is at most `max`.",
|
|
50
|
+
"properties": {
|
|
51
|
+
"call": { "const": "maxLength" },
|
|
52
|
+
"args": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"properties": {
|
|
55
|
+
"value": { "$ref": "common_types.json#/$defs/DynamicString" },
|
|
56
|
+
"max": { "$ref": "common_types.json#/$defs/DynamicNumber" }
|
|
57
|
+
},
|
|
58
|
+
"required": ["value", "max"],
|
|
59
|
+
"additionalProperties": false
|
|
60
|
+
},
|
|
61
|
+
"returnType": { "const": "boolean" }
|
|
62
|
+
},
|
|
63
|
+
"required": ["call", "args"],
|
|
64
|
+
"unevaluatedProperties": false
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
"matchesPattern": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"description": "Returns true when `value` matches the regex `pattern` (tested as ^(?:pattern)$ — anchored full match).",
|
|
70
|
+
"properties": {
|
|
71
|
+
"call": { "const": "matchesPattern" },
|
|
72
|
+
"args": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"properties": {
|
|
75
|
+
"value": { "$ref": "common_types.json#/$defs/DynamicString" },
|
|
76
|
+
"pattern": { "type": "string" }
|
|
77
|
+
},
|
|
78
|
+
"required": ["value", "pattern"],
|
|
79
|
+
"additionalProperties": false
|
|
80
|
+
},
|
|
81
|
+
"returnType": { "const": "boolean" }
|
|
82
|
+
},
|
|
83
|
+
"required": ["call", "args"],
|
|
84
|
+
"unevaluatedProperties": false
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
"isEmail": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"description": "Convenience check — returns true when `value` parses as a well-formed email address.",
|
|
90
|
+
"properties": {
|
|
91
|
+
"call": { "const": "isEmail" },
|
|
92
|
+
"args": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"properties": {
|
|
95
|
+
"value": { "$ref": "common_types.json#/$defs/DynamicString" }
|
|
96
|
+
},
|
|
97
|
+
"required": ["value"],
|
|
98
|
+
"additionalProperties": false
|
|
99
|
+
},
|
|
100
|
+
"returnType": { "const": "boolean" }
|
|
101
|
+
},
|
|
102
|
+
"required": ["call", "args"],
|
|
103
|
+
"unevaluatedProperties": false
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
"equals": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"description": "Returns true when `value` deep-equals `target`. Used for confirm-password checks (compare field to its sibling).",
|
|
109
|
+
"properties": {
|
|
110
|
+
"call": { "const": "equals" },
|
|
111
|
+
"args": {
|
|
112
|
+
"type": "object",
|
|
113
|
+
"properties": {
|
|
114
|
+
"value": { "$ref": "common_types.json#/$defs/DynamicString" },
|
|
115
|
+
"target": { "$ref": "common_types.json#/$defs/DynamicString" }
|
|
116
|
+
},
|
|
117
|
+
"required": ["value", "target"],
|
|
118
|
+
"additionalProperties": false
|
|
119
|
+
},
|
|
120
|
+
"returnType": { "const": "boolean" }
|
|
121
|
+
},
|
|
122
|
+
"required": ["call", "args"],
|
|
123
|
+
"unevaluatedProperties": false
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
"formatString": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"description": "Template-interpolate a string using `${/abs/path}` for absolute JSON Pointers, `${rel/path}` for relative paths inside a template child scope, and `${fn(arg: value)}` for nested calls. The `${...}` grammar is ONLY legal inside this function's `value` arg; every other string property in A2UI is static or path-bound via DynamicString.",
|
|
129
|
+
"properties": {
|
|
130
|
+
"call": { "const": "formatString" },
|
|
131
|
+
"args": {
|
|
132
|
+
"type": "object",
|
|
133
|
+
"properties": {
|
|
134
|
+
"value": { "type": "string", "description": "Template. Supports ${path}, ${fn(...)}, \\${ escapes." }
|
|
135
|
+
},
|
|
136
|
+
"required": ["value"],
|
|
137
|
+
"additionalProperties": false
|
|
138
|
+
},
|
|
139
|
+
"returnType": { "const": "string" }
|
|
140
|
+
},
|
|
141
|
+
"required": ["call", "args"],
|
|
142
|
+
"unevaluatedProperties": false
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
"formatNumber": {
|
|
146
|
+
"type": "object",
|
|
147
|
+
"description": "Localize a number. `style` = decimal (default) | percent | unit. `unit` paired with style=unit. `maximumFractionDigits` + `minimumFractionDigits` control precision.",
|
|
148
|
+
"properties": {
|
|
149
|
+
"call": { "const": "formatNumber" },
|
|
150
|
+
"args": {
|
|
151
|
+
"type": "object",
|
|
152
|
+
"properties": {
|
|
153
|
+
"value": { "$ref": "common_types.json#/$defs/DynamicNumber" },
|
|
154
|
+
"style": { "enum": ["decimal", "percent", "unit"], "default": "decimal" },
|
|
155
|
+
"unit": { "type": "string" },
|
|
156
|
+
"minimumFractionDigits": { "type": "number" },
|
|
157
|
+
"maximumFractionDigits": { "type": "number" },
|
|
158
|
+
"locale": { "type": "string" }
|
|
159
|
+
},
|
|
160
|
+
"required": ["value"],
|
|
161
|
+
"additionalProperties": false
|
|
162
|
+
},
|
|
163
|
+
"returnType": { "const": "string" }
|
|
164
|
+
},
|
|
165
|
+
"required": ["call", "args"],
|
|
166
|
+
"unevaluatedProperties": false
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
"formatCurrency": {
|
|
170
|
+
"type": "object",
|
|
171
|
+
"description": "Render a numeric amount as currency in the given ISO-4217 code.",
|
|
172
|
+
"properties": {
|
|
173
|
+
"call": { "const": "formatCurrency" },
|
|
174
|
+
"args": {
|
|
175
|
+
"type": "object",
|
|
176
|
+
"properties": {
|
|
177
|
+
"value": { "$ref": "common_types.json#/$defs/DynamicNumber" },
|
|
178
|
+
"currency": { "type": "string", "description": "ISO-4217 code (USD, EUR, JPY, …)." },
|
|
179
|
+
"locale": { "type": "string" }
|
|
180
|
+
},
|
|
181
|
+
"required": ["value", "currency"],
|
|
182
|
+
"additionalProperties": false
|
|
183
|
+
},
|
|
184
|
+
"returnType": { "const": "string" }
|
|
185
|
+
},
|
|
186
|
+
"required": ["call", "args"],
|
|
187
|
+
"unevaluatedProperties": false
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
"formatDate": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"description": "Format a date (ISO string or epoch ms). `style` shortcuts: short/medium/long/full; or pass an explicit Intl options shape.",
|
|
193
|
+
"properties": {
|
|
194
|
+
"call": { "const": "formatDate" },
|
|
195
|
+
"args": {
|
|
196
|
+
"type": "object",
|
|
197
|
+
"properties": {
|
|
198
|
+
"value": { "$ref": "common_types.json#/$defs/DynamicString" },
|
|
199
|
+
"style": { "enum": ["short", "medium", "long", "full", "relative"] },
|
|
200
|
+
"locale": { "type": "string" }
|
|
201
|
+
},
|
|
202
|
+
"required": ["value"],
|
|
203
|
+
"additionalProperties": false
|
|
204
|
+
},
|
|
205
|
+
"returnType": { "const": "string" }
|
|
206
|
+
},
|
|
207
|
+
"required": ["call", "args"],
|
|
208
|
+
"unevaluatedProperties": false
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
"pluralize": {
|
|
212
|
+
"type": "object",
|
|
213
|
+
"description": "Pick a variant based on `count`. Supply `one` and `plural` (and optionally `zero` / `other`). The return is the chosen variant string.",
|
|
214
|
+
"properties": {
|
|
215
|
+
"call": { "const": "pluralize" },
|
|
216
|
+
"args": {
|
|
217
|
+
"type": "object",
|
|
218
|
+
"properties": {
|
|
219
|
+
"count": { "$ref": "common_types.json#/$defs/DynamicNumber" },
|
|
220
|
+
"one": { "type": "string" },
|
|
221
|
+
"plural": { "type": "string" },
|
|
222
|
+
"zero": { "type": "string" },
|
|
223
|
+
"other": { "type": "string" }
|
|
224
|
+
},
|
|
225
|
+
"required": ["count", "plural"],
|
|
226
|
+
"additionalProperties": false
|
|
227
|
+
},
|
|
228
|
+
"returnType": { "const": "string" }
|
|
229
|
+
},
|
|
230
|
+
"required": ["call", "args"],
|
|
231
|
+
"unevaluatedProperties": false
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
"not": {
|
|
235
|
+
"type": "object",
|
|
236
|
+
"description": "Logical negation — inverts a boolean result. Useful for composing custom checks.",
|
|
237
|
+
"properties": {
|
|
238
|
+
"call": { "const": "not" },
|
|
239
|
+
"args": {
|
|
240
|
+
"type": "object",
|
|
241
|
+
"properties": {
|
|
242
|
+
"value": { "$ref": "common_types.json#/$defs/DynamicBoolean" }
|
|
243
|
+
},
|
|
244
|
+
"required": ["value"],
|
|
245
|
+
"additionalProperties": false
|
|
246
|
+
},
|
|
247
|
+
"returnType": { "const": "boolean" }
|
|
248
|
+
},
|
|
249
|
+
"required": ["call", "args"],
|
|
250
|
+
"unevaluatedProperties": false
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|