@lynx-js/genui 0.0.2 → 0.0.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.
- package/README.md +5 -9
- package/a2ui/AGENTS.md +167 -0
- package/a2ui/README.md +76 -780
- package/a2ui/README_zh.md +103 -0
- package/a2ui/dist/catalog/DateTimeInput/index.jsx +1 -10
- package/a2ui/dist/catalog/DateTimeInput/index.jsx.map +1 -1
- package/a2ui/dist/catalog/DateTimeInput/utils.d.ts +0 -1
- package/a2ui/dist/catalog/DateTimeInput/utils.js +0 -3
- package/a2ui/dist/catalog/DateTimeInput/utils.js.map +1 -1
- package/a2ui/dist/catalog/Loading/catalog.json +15 -0
- package/a2ui/dist/catalog/Loading/index.d.ts +10 -0
- package/a2ui/dist/catalog/Loading/index.jsx +11 -0
- package/a2ui/dist/catalog/Loading/index.jsx.map +1 -0
- package/a2ui/dist/catalog/defineCatalog.d.ts +0 -4
- package/a2ui/dist/catalog/defineCatalog.js.map +1 -1
- package/a2ui/dist/catalog/index.d.ts +1 -0
- package/a2ui/dist/catalog/index.js +16 -0
- package/a2ui/dist/catalog/index.js.map +1 -1
- package/a2ui/dist/catalog.json +2548 -0
- package/a2ui/dist/index.d.ts +1 -1
- package/a2ui/dist/index.js +2 -2
- package/a2ui/dist/index.js.map +1 -1
- package/a2ui/dist/react/A2UIRenderer.jsx +3 -13
- package/a2ui/dist/react/A2UIRenderer.jsx.map +1 -1
- package/a2ui/dist/tsconfig.build.tsbuildinfo +1 -1
- package/a2ui/docs/catalog-guide.md +401 -0
- package/a2ui/docs/catalog-guide_zh.md +373 -0
- package/a2ui/docs/overview.md +312 -0
- package/a2ui/docs/overview_zh.md +289 -0
- package/a2ui/docs/system-prompts.md +187 -0
- package/a2ui/docs/system-prompts_zh.md +187 -0
- package/a2ui/src/catalog/README.md +12 -0
- package/a2ui/src/catalog/index.ts +51 -0
- package/a2ui/src/catalog/readme_zh.md +11 -0
- package/a2ui/src/index.ts +115 -0
- package/a2ui/styles/catalog/Button.css +5 -5
- package/a2ui/styles/catalog/DateTimeInput.css +22 -30
- package/a2ui/styles/catalog/Loading.css +61 -0
- package/a2ui-catalog-extractor/README.md +14 -7
- package/a2ui-catalog-extractor/dist/cli.d.ts +1 -0
- package/a2ui-catalog-extractor/dist/cli.js +15 -6
- package/a2ui-catalog-extractor/dist/cli.js.map +1 -1
- package/a2ui-catalog-extractor/dist/index.d.ts +9 -2
- package/a2ui-catalog-extractor/dist/index.js +52 -6
- package/a2ui-catalog-extractor/dist/index.js.map +1 -1
- package/a2ui-catalog-extractor/dist/tsconfig.build.tsbuildinfo +1 -1
- package/a2ui-catalog-extractor/skills/a2ui-catalog-extractor/SKILL.md +1 -1
- package/a2ui-prompt/README.md +3 -2
- package/a2ui-prompt/dist/index.d.ts +2 -0
- package/a2ui-prompt/dist/index.js +159 -84
- package/cli/README.md +26 -0
- package/cli/bin/cli.js +7 -265
- package/cli/dist/a2ui/create.d.ts +5 -0
- package/cli/dist/a2ui/create.js +178 -0
- package/cli/dist/a2ui/create.js.map +1 -0
- package/cli/dist/a2ui/index.d.ts +5 -0
- package/cli/dist/a2ui/index.js +170 -0
- package/cli/dist/a2ui/index.js.map +1 -0
- package/cli/dist/cli.d.ts +4 -0
- package/cli/dist/cli.js +40 -0
- package/cli/dist/cli.js.map +1 -0
- package/cli/dist/openui.d.ts +1 -0
- package/cli/dist/openui.js +21 -0
- package/cli/dist/openui.js.map +1 -0
- package/cli/dist/tsconfig.build.tsbuildinfo +1 -0
- package/cli/dist/utils.d.ts +2 -0
- package/cli/dist/utils.js +17 -0
- package/cli/dist/utils.js.map +1 -0
- package/cli/templates/default/lynx.config.ts +13 -0
- package/cli/templates/default/package.json +27 -0
- package/cli/templates/default/src/App.css +88 -0
- package/cli/templates/default/src/App.tsx +100 -0
- package/cli/templates/default/src/index.tsx +10 -0
- package/cli/templates/default/src/messages.ts +158 -0
- package/cli/templates/default/src/rspeedy-env.d.ts +14 -0
- package/cli/templates/default/src/tsconfig.json +17 -0
- package/cli/templates/default/tsconfig.json +15 -0
- package/cli/templates/default/tsconfig.node.json +16 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/openui/README.md +50 -46
- package/openui/dist/catalog/Action/{index.js → index.jsx} +1 -1
- package/openui/dist/catalog/Action/index.jsx.map +1 -0
- package/openui/dist/catalog/Button/index.d.ts +8 -8
- package/openui/dist/catalog/Button/{index.js → index.jsx} +28 -14
- package/openui/dist/catalog/Button/index.jsx.map +1 -0
- package/openui/dist/catalog/Card/index.d.ts +1 -1
- package/openui/dist/catalog/Card/{index.js → index.jsx} +5 -4
- package/openui/dist/catalog/Card/{index.js.map → index.jsx.map} +1 -1
- package/openui/dist/catalog/CardHeader/index.d.ts +1 -1
- package/openui/dist/catalog/CardHeader/index.jsx +20 -0
- package/openui/dist/catalog/CardHeader/index.jsx.map +1 -0
- package/openui/dist/catalog/CheckBox/index.d.ts +16 -0
- package/openui/dist/catalog/CheckBox/index.jsx +82 -0
- package/openui/dist/catalog/CheckBox/index.jsx.map +1 -0
- package/openui/dist/catalog/Icon/index.d.ts +44 -0
- package/openui/dist/catalog/Icon/index.jsx +66 -0
- package/openui/dist/catalog/Icon/index.jsx.map +1 -0
- package/openui/dist/catalog/Image/index.d.ts +19 -0
- package/openui/dist/catalog/Image/index.jsx +40 -0
- package/openui/dist/catalog/Image/index.jsx.map +1 -0
- package/openui/dist/catalog/Loading/index.d.ts +7 -0
- package/openui/dist/catalog/Loading/index.jsx +25 -0
- package/openui/dist/catalog/Loading/index.jsx.map +1 -0
- package/openui/dist/catalog/RadioGroup/index.d.ts +21 -0
- package/openui/dist/catalog/RadioGroup/index.jsx +99 -0
- package/openui/dist/catalog/RadioGroup/index.jsx.map +1 -0
- package/openui/dist/catalog/Separator/index.d.ts +1 -1
- package/openui/dist/catalog/Separator/{index.js → index.jsx} +3 -4
- package/openui/dist/catalog/Separator/index.jsx.map +1 -0
- package/openui/dist/catalog/Slider/index.d.ts +19 -0
- package/openui/dist/catalog/Slider/index.jsx +139 -0
- package/openui/dist/catalog/Slider/index.jsx.map +1 -0
- package/openui/dist/catalog/Stack/index.d.ts +1 -1
- package/openui/dist/catalog/Stack/{index.js → index.jsx} +3 -4
- package/openui/dist/catalog/Stack/{index.js.map → index.jsx.map} +1 -1
- package/openui/dist/catalog/Tag/index.d.ts +1 -1
- package/openui/dist/catalog/Tag/{index.js → index.jsx} +5 -4
- package/openui/dist/catalog/Tag/index.jsx.map +1 -0
- package/openui/dist/catalog/TextContent/index.d.ts +1 -1
- package/openui/dist/catalog/TextContent/{index.js → index.jsx} +5 -4
- package/openui/dist/catalog/TextContent/{index.js.map → index.jsx.map} +1 -1
- package/openui/dist/catalog/TextField/index.d.ts +23 -0
- package/openui/dist/catalog/TextField/index.jsx +132 -0
- package/openui/dist/catalog/TextField/index.jsx.map +1 -0
- package/openui/dist/catalog/index.d.ts +14 -7
- package/openui/dist/catalog/index.js +14 -7
- package/openui/dist/catalog/index.js.map +1 -1
- package/openui/dist/core/context.d.ts +17 -7
- package/openui/dist/core/{context.js → context.jsx} +8 -2
- package/openui/dist/core/context.jsx.map +1 -0
- package/openui/dist/core/createLibrary.d.ts +1 -1
- package/openui/dist/core/{createLibrary.js → createLibrary.jsx} +14 -3
- package/openui/dist/core/createLibrary.jsx.map +1 -0
- package/openui/dist/core/hooks/index.d.ts +1 -0
- package/openui/dist/core/hooks/index.js +1 -0
- package/openui/dist/core/hooks/index.js.map +1 -1
- package/openui/dist/core/hooks/useOpenUIState.d.ts +2 -2
- package/openui/dist/core/hooks/useOpenUIState.js +3 -1
- package/openui/dist/core/hooks/useOpenUIState.js.map +1 -1
- package/openui/dist/core/hooks/useStateField.js +1 -1
- package/openui/dist/core/hooks/useStateField.js.map +1 -1
- package/openui/dist/core/index.d.ts +13 -7
- package/openui/dist/core/index.js +7 -4
- package/openui/dist/core/index.js.map +1 -1
- package/openui/dist/core/{library.js → library.jsx} +1 -1
- package/openui/dist/core/library.jsx.map +1 -0
- package/openui/dist/core/renderer.css +527 -0
- package/openui/dist/core/renderer.d.ts +31 -4
- package/openui/dist/core/renderer.jsx +281 -0
- package/openui/dist/core/renderer.jsx.map +1 -0
- package/openui/dist/core/runtime/index.d.ts +1 -0
- package/openui/dist/core/runtime/index.js +5 -0
- package/openui/dist/core/runtime/index.js.map +1 -0
- package/openui/dist/core/runtime/reactive.d.ts +7 -0
- package/openui/dist/core/runtime/reactive.js +10 -0
- package/openui/dist/core/runtime/reactive.js.map +1 -0
- package/package.json +17 -7
- package/openui/dist/catalog/Action/index.js.map +0 -1
- package/openui/dist/catalog/Button/index.js.map +0 -1
- package/openui/dist/catalog/CardHeader/index.js +0 -18
- package/openui/dist/catalog/CardHeader/index.js.map +0 -1
- package/openui/dist/catalog/Separator/index.js.map +0 -1
- package/openui/dist/catalog/Tag/index.js.map +0 -1
- package/openui/dist/core/context.js.map +0 -1
- package/openui/dist/core/createLibrary.js.map +0 -1
- package/openui/dist/core/library.js.map +0 -1
- package/openui/dist/core/renderer.js +0 -139
- package/openui/dist/core/renderer.js.map +0 -1
|
@@ -15,7 +15,7 @@ Use this skill when a task involves authoring, updating, debugging, or generatin
|
|
|
15
15
|
4. Generate component catalog files with:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
a2ui-catalog-extractor --catalog-dir src/catalog --out-dir dist
|
|
18
|
+
a2ui-catalog-extractor --catalog-dir src/catalog --out-dir dist
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Supported Type Shapes
|
package/a2ui-prompt/README.md
CHANGED
|
@@ -35,8 +35,9 @@ const catalog = readA2UICatalogFromDirectory({
|
|
|
35
35
|
const prompt = buildA2UISystemPrompt({ catalog });
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
`readA2UICatalogFromDirectory`
|
|
39
|
-
|
|
38
|
+
`readA2UICatalogFromDirectory` prefers the full catalog file, such as
|
|
39
|
+
`dist/catalog.json`, and falls back to generated component files such as
|
|
40
|
+
`catalog/<Component>/catalog.json`.
|
|
40
41
|
Use `genui a2ui generate catalog` to create those artifacts.
|
|
41
42
|
|
|
42
43
|
## Exports
|
|
@@ -66,6 +66,7 @@ export declare function createA2UICatalogFromManifests(options: {
|
|
|
66
66
|
}): A2UICatalog;
|
|
67
67
|
|
|
68
68
|
export declare interface JsonSchema {
|
|
69
|
+
const?: unknown;
|
|
69
70
|
type?: string;
|
|
70
71
|
enum?: unknown;
|
|
71
72
|
oneOf?: JsonSchema[];
|
|
@@ -74,6 +75,7 @@ export declare interface JsonSchema {
|
|
|
74
75
|
required?: string[];
|
|
75
76
|
description?: string;
|
|
76
77
|
additionalProperties?: unknown;
|
|
78
|
+
unevaluatedProperties?: unknown;
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
export declare interface ReadA2UICatalogDirectoryOptions {
|
|
@@ -99,7 +99,7 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
name: 'dynamic-list',
|
|
102
|
-
user: 'Show three trip ideas as a compact
|
|
102
|
+
user: 'Show three trip ideas as a compact vertical group.',
|
|
103
103
|
messages: [
|
|
104
104
|
{
|
|
105
105
|
version: 'v0.9',
|
|
@@ -139,7 +139,7 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
139
139
|
component: 'Column',
|
|
140
140
|
children: [
|
|
141
141
|
'title',
|
|
142
|
-
'trip-
|
|
142
|
+
'trip-items'
|
|
143
143
|
]
|
|
144
144
|
},
|
|
145
145
|
{
|
|
@@ -149,9 +149,8 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
149
149
|
variant: 'h2'
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
|
-
id: 'trip-
|
|
153
|
-
component: '
|
|
154
|
-
direction: 'vertical',
|
|
152
|
+
id: 'trip-items',
|
|
153
|
+
component: 'Column',
|
|
155
154
|
children: {
|
|
156
155
|
path: '/items',
|
|
157
156
|
componentId: 'trip-row'
|
|
@@ -183,7 +182,7 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
183
182
|
id: 'trip-name',
|
|
184
183
|
component: 'Text',
|
|
185
184
|
text: {
|
|
186
|
-
path: '
|
|
185
|
+
path: 'name'
|
|
187
186
|
},
|
|
188
187
|
variant: 'h3'
|
|
189
188
|
},
|
|
@@ -191,7 +190,7 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
191
190
|
id: 'trip-detail',
|
|
192
191
|
component: 'Text',
|
|
193
192
|
text: {
|
|
194
|
-
path: '
|
|
193
|
+
path: 'detail'
|
|
195
194
|
},
|
|
196
195
|
variant: 'body'
|
|
197
196
|
}
|
|
@@ -335,60 +334,25 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
335
334
|
]
|
|
336
335
|
}
|
|
337
336
|
];
|
|
338
|
-
var catalog_namespaceObject = JSON.parse('{"Button":{"properties":{"child":{"type":"string"},"variant":{"type":"string","enum":["primary","borderless"]},"isValid":{"type":"boolean"},"action":{"oneOf":[{"type":"object","properties":{"event":{"type":"object","properties":{"name":{"type":"string"},"context":{"type":"object","additionalProperties":true,"description":"Context is a JSON object map in v0.9."}},"required":["name"],"additionalProperties":false}},"required":["event"],"additionalProperties":false},{"type":"object","properties":{"functionCall":{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}},"required":["functionCall"],"additionalProperties":false}],"description":"v0.9 actions should use the `event` wrapper for server-dispatched clicks."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"message":{"type":"string"}},"required":["condition","message"],"additionalProperties":false}}},"required":["child","action"]}}');
|
|
339
|
-
var Card_catalog_namespaceObject = JSON.parse('{"Card":{"properties":{"child":{"type":"string"},"variant":{"type":"string","enum":["elevated","outlined","filled","ghost"]},"weight":{"type":"number"}},"required":["child"]}}');
|
|
340
|
-
var CheckBox_catalog_namespaceObject = JSON.parse('{"CheckBox":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"value":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"message":{"type":"string"}},"required":["condition","message"],"additionalProperties":false}}},"required":["label","value"]}}');
|
|
341
|
-
var ChoicePicker_catalog_namespaceObject = JSON.parse('{"ChoicePicker":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The label for the group of options."},"variant":{"type":"string","enum":["multipleSelection","mutuallyExclusive"],"description":"A hint for how the choice picker should be displayed and behave."},"options":{"type":"array","items":{"type":"object","properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The text to display for this option."},"value":{"type":"string","description":"The stable value associated with this option."}},"required":["label","value"],"additionalProperties":false},"description":"The list of available options to choose from."},"value":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The list of currently selected values."},"displayStyle":{"type":"string","enum":["checkbox","chips"],"description":"The display style of the component."},"filterable":{"type":"boolean","description":"If true, displays a search input to filter the options."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["options","value"]}}');
|
|
342
|
-
var Column_catalog_namespaceObject = JSON.parse('{"Column":{"properties":{"children":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"componentId":{"type":"string"},"path":{"type":"string"}},"required":["componentId","path"],"additionalProperties":false}],"description":"Static child IDs array or template object."},"align":{"type":"string","enum":["start","center","end","stretch"]},"justify":{"type":"string","enum":["start","center","end","stretch","spaceBetween","spaceAround","spaceEvenly"]}},"required":["children"]}}');
|
|
343
|
-
var DateTimeInput_catalog_namespaceObject = JSON.parse('{"DateTimeInput":{"properties":{"value":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"The current date/time value. Typically bound to a data path."},"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The text label for the input field."},"enableDate":{"type":"boolean","description":"Whether to show the date picker."},"enableTime":{"type":"boolean","description":"Whether to show the time picker."},"outputFormat":{"type":"string","description":"Format string for the output value. Supports YYYY, MM, DD, HH, and mm."},"min":{"type":"string","description":"Minimum allowed date/time value."},"max":{"type":"string","description":"Maximum allowed date/time value."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["value"]}}');
|
|
344
|
-
var Divider_catalog_namespaceObject = JSON.parse('{"Divider":{"properties":{"axis":{"type":"string","enum":["horizontal","vertical"]}},"required":[]}}');
|
|
345
|
-
var Icon_catalog_namespaceObject = JSON.parse('{"Icon":{"properties":{"name":{"oneOf":[{"type":"string","enum":["account_circle","add","arrow_back","arrow_forward","camera","check","close","delete","edit","error","favorite","help","home","info","location_on","lock","mail","menu","more_vert","pause","person","play_arrow","refresh","search","send","settings","share","star","warning"]},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"Google Material icon ligature name, e.g. \\"info\\", \\"account_circle\\", \\"arrow_back\\"."},"size":{"type":"string","enum":["sm","md","lg"]},"color":{"type":"string","enum":["primary","muted","inherit"]}},"required":["name"]}}');
|
|
346
|
-
var Image_catalog_namespaceObject = JSON.parse('{"Image":{"properties":{"url":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"Image URL or path binding."},"fit":{"type":"string","enum":["contain","cover","fill","none","scale-down"]},"mode":{"type":"string","enum":["center","scaleToFill","aspectFit","aspectFill"]},"variant":{"type":"string","enum":["icon","avatar","smallFeature","mediumFeature","largeFeature","header"]},"weight":{"type":"number"}},"required":["url"]}}');
|
|
347
|
-
var LineChart_catalog_namespaceObject = JSON.parse('{"LineChart":{"properties":{"labels":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"Category labels shown along the x axis."},"series":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"values":{"type":"array","items":{"type":"number"}},"color":{"type":"string"}},"required":["name","values"],"additionalProperties":false}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"One or more line series to render over the shared labels."},"variant":{"type":"string","enum":["linear","natural","step"]},"xLabel":{"type":"string"},"yLabel":{"type":"string"},"showGrid":{"type":"boolean"},"showLegend":{"type":"boolean"},"height":{"type":"number"}},"required":["labels","series"]}}');
|
|
348
|
-
var List_catalog_namespaceObject = JSON.parse('{"List":{"properties":{"children":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"componentId":{"type":"string"},"path":{"type":"string"}},"required":["componentId","path"],"additionalProperties":false}],"description":"Static child IDs array or template object."},"direction":{"type":"string","enum":["horizontal","vertical"]},"align":{"type":"string","enum":["start","center","end","stretch"]}},"required":["children"]}}');
|
|
349
|
-
var Modal_catalog_namespaceObject = JSON.parse('{"Modal":{"properties":{"trigger":{"type":"string","description":"The ID of the component that opens the modal when interacted with."},"content":{"type":"string","description":"The ID of the component to display inside the modal."}},"required":["trigger","content"]}}');
|
|
350
|
-
var RadioGroup_catalog_namespaceObject = JSON.parse('{"RadioGroup":{"properties":{"items":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The list of string options to display."},"value":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The currently selected value."},"usageHint":{"type":"string","enum":["default","card","row"],"description":"A hint for the visual style of the radio group."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"message":{"type":"string"}},"required":["condition","message"],"additionalProperties":false}}},"required":["items","value"]}}');
|
|
351
|
-
var Row_catalog_namespaceObject = JSON.parse('{"Row":{"properties":{"children":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"componentId":{"type":"string"},"path":{"type":"string"}},"required":["componentId","path"],"additionalProperties":false}],"description":"Static child IDs array or template object."},"justify":{"type":"string","enum":["start","center","end","stretch","spaceBetween","spaceAround","spaceEvenly"]},"align":{"type":"string","enum":["start","center","end","stretch"]}},"required":["children"]}}');
|
|
352
|
-
var Slider_catalog_namespaceObject = JSON.parse('{"Slider":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The label for the slider."},"min":{"type":"number","description":"The minimum value of the slider."},"max":{"type":"number","description":"The maximum value of the slider."},"value":{"oneOf":[{"type":"number"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The current value of the slider."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["max","value"]}}');
|
|
353
|
-
var Tabs_catalog_namespaceObject = JSON.parse('{"Tabs":{"properties":{"tabs":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"child":{"type":"string"}},"required":["title","child"],"additionalProperties":false}}},"required":["tabs"]}}');
|
|
354
|
-
var Text_catalog_namespaceObject = JSON.parse('{"Text":{"properties":{"text":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"Literal text, path binding, or function call."},"variant":{"type":"string","enum":["h1","h2","h3","h4","h5","caption","body","markdown"]},"emphasis":{"type":"string","enum":["medium","strong"]}},"required":["text"]}}');
|
|
355
|
-
var TextField_catalog_namespaceObject = JSON.parse('{"TextField":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"The text label for the input field."},"value":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"The value of the text field."},"variant":{"type":"string","enum":["number","longText","shortText","obscured"],"description":"The type of input field to display."},"validationRegexp":{"type":"string","description":"A regular expression used for client-side validation of the input."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}]}},"returnType":{"type":"string","enum":["boolean"]}},"required":["call"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["label"]}}');
|
|
337
|
+
var catalog_namespaceObject = JSON.parse('{"catalogId":"https://unpkg.com/@lynx-js/genui/a2ui/dist/catalog.json","components":{"Button":{"properties":{"child":{"type":"string"},"variant":{"type":"string","enum":["primary","borderless"]},"isValid":{"type":"boolean"},"action":{"oneOf":[{"type":"object","properties":{"event":{"type":"object","properties":{"name":{"type":"string"},"context":{"type":"object","additionalProperties":true,"description":"Context is a JSON object map in v0.9."}},"required":["name"],"additionalProperties":false}},"required":["event"],"additionalProperties":false},{"type":"object","properties":{"functionCall":{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}},"required":["functionCall"],"additionalProperties":false}],"description":"v0.9 actions should use the `event` wrapper for server-dispatched clicks."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"message":{"type":"string"}},"required":["condition","message"],"additionalProperties":false}}},"required":["child","action"]},"Card":{"properties":{"child":{"type":"string"},"variant":{"type":"string","enum":["elevated","outlined","filled","ghost"]},"weight":{"type":"number"}},"required":["child"]},"CheckBox":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"value":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"message":{"type":"string"}},"required":["condition","message"],"additionalProperties":false}}},"required":["label","value"]},"ChoicePicker":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The label for the group of options."},"variant":{"type":"string","enum":["multipleSelection","mutuallyExclusive"],"description":"A hint for how the choice picker should be displayed and behave."},"options":{"type":"array","items":{"type":"object","properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The text to display for this option."},"value":{"type":"string","description":"The stable value associated with this option."}},"required":["label","value"],"additionalProperties":false},"description":"The list of available options to choose from."},"value":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The list of currently selected values."},"displayStyle":{"type":"string","enum":["checkbox","chips"],"description":"The display style of the component."},"filterable":{"type":"boolean","description":"If true, displays a search input to filter the options."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["options","value"]},"Column":{"properties":{"children":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"componentId":{"type":"string"},"path":{"type":"string"}},"required":["componentId","path"],"additionalProperties":false}],"description":"Static child IDs array or template object."},"align":{"type":"string","enum":["start","center","end","stretch"]},"justify":{"type":"string","enum":["start","center","end","stretch","spaceBetween","spaceAround","spaceEvenly"]}},"required":["children"]},"DateTimeInput":{"properties":{"value":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"The current date/time value. Typically bound to a data path."},"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The text label for the input field."},"enableDate":{"type":"boolean","description":"Whether to show the date picker."},"enableTime":{"type":"boolean","description":"Whether to show the time picker."},"outputFormat":{"type":"string","description":"Format string for the output value. Supports YYYY, MM, DD, HH, and mm."},"min":{"type":"string","description":"Minimum allowed date/time value."},"max":{"type":"string","description":"Maximum allowed date/time value."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["value"]},"Divider":{"properties":{"axis":{"type":"string","enum":["horizontal","vertical"]}},"required":[]},"Icon":{"properties":{"name":{"oneOf":[{"type":"string","enum":["account_circle"]},{"type":"string","enum":["add"]},{"type":"string","enum":["arrow_back"]},{"type":"string","enum":["arrow_forward"]},{"type":"string","enum":["camera"]},{"type":"string","enum":["check"]},{"type":"string","enum":["close"]},{"type":"string","enum":["delete"]},{"type":"string","enum":["edit"]},{"type":"string","enum":["error"]},{"type":"string","enum":["favorite"]},{"type":"string","enum":["help"]},{"type":"string","enum":["home"]},{"type":"string","enum":["info"]},{"type":"string","enum":["location_on"]},{"type":"string","enum":["lock"]},{"type":"string","enum":["mail"]},{"type":"string","enum":["menu"]},{"type":"string","enum":["more_vert"]},{"type":"string","enum":["pause"]},{"type":"string","enum":["person"]},{"type":"string","enum":["play_arrow"]},{"type":"string","enum":["refresh"]},{"type":"string","enum":["search"]},{"type":"string","enum":["send"]},{"type":"string","enum":["settings"]},{"type":"string","enum":["share"]},{"type":"string","enum":["star"]},{"type":"string","enum":["warning"]},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"Google Material icon ligature name, e.g. \\"info\\", \\"account_circle\\", \\"arrow_back\\"."},"size":{"type":"string","enum":["sm","md","lg"]},"color":{"type":"string","enum":["primary","muted","inherit"]}},"required":["name"]},"Image":{"properties":{"url":{"type":"string","description":"Image URL or path binding."},"fit":{"type":"string","enum":["contain","cover","fill","none","scale-down"]},"mode":{"type":"string","enum":["center","scaleToFill","aspectFit","aspectFill"]},"variant":{"type":"string","enum":["icon","avatar","smallFeature","mediumFeature","largeFeature","header"]},"weight":{"type":"number"}},"required":["url"]},"LineChart":{"properties":{"labels":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"Category labels shown along the x axis."},"series":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"values":{"type":"array","items":{"type":"number"}},"color":{"type":"string"}},"required":["name","values"],"additionalProperties":false}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"One or more line series to render over the shared labels."},"variant":{"type":"string","enum":["linear","natural","step"]},"xLabel":{"type":"string"},"yLabel":{"type":"string"},"showGrid":{"type":"boolean"},"showLegend":{"type":"boolean"},"height":{"type":"number"}},"required":["labels","series"]},"List":{"properties":{"children":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"componentId":{"type":"string"},"path":{"type":"string"}},"required":["componentId","path"],"additionalProperties":false}],"description":"Static child IDs array or template object."},"direction":{"type":"string","enum":["horizontal","vertical"]},"align":{"type":"string","enum":["start","center","end","stretch"]}},"required":["children"]},"Loading":{"properties":{"variant":{"type":"string","enum":["inline","block"],"description":"Visual density for the skeleton placeholder."}},"required":[]},"Modal":{"properties":{"trigger":{"type":"string","description":"The ID of the component that opens the modal when interacted with."},"content":{"type":"string","description":"The ID of the component to display inside the modal."}},"required":["trigger","content"]},"PieChart":{"properties":{"data":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"number"},"color":{"type":"string"}},"required":["name","value"],"additionalProperties":false}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"Pie slices to render."},"variant":{"type":"string","enum":["pie","donut"],"description":"Render the chart as a flat pie or a donut."},"title":{"type":"string","description":"Optional title shown above the chart."},"subtitle":{"type":"string","description":"Optional subtitle shown under the title."},"showLegend":{"type":"boolean","description":"Show the legend below the chart."},"showPercentages":{"type":"boolean","description":"Show percentage values in the legend."},"height":{"type":"number","description":"Chart height in pixels."},"paddingAngle":{"type":"number","description":"Padding angle between slices, in degrees."},"colors":{"type":"array","items":{"type":"string"},"description":"Custom color palette for the slices."}},"required":["data"]},"RadioGroup":{"properties":{"items":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The list of string options to display."},"value":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The currently selected value."},"usageHint":{"type":"string","enum":["default","card","row"],"description":"A hint for the visual style of the radio group."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"message":{"type":"string"}},"required":["condition","message"],"additionalProperties":false}}},"required":["items","value"]},"Row":{"properties":{"children":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"componentId":{"type":"string"},"path":{"type":"string"}},"required":["componentId","path"],"additionalProperties":false}],"description":"Static child IDs array or template object."},"justify":{"type":"string","enum":["start","center","end","stretch","spaceBetween","spaceAround","spaceEvenly"]},"align":{"type":"string","enum":["start","center","end","stretch"]}},"required":["children"]},"Slider":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The label for the slider."},"min":{"type":"number","description":"The minimum value of the slider."},"max":{"type":"number","description":"The maximum value of the slider."},"value":{"oneOf":[{"type":"number"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The current value of the slider."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["max","value"]},"Tabs":{"properties":{"tabs":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"child":{"type":"string"}},"required":["title","child"],"additionalProperties":false}}},"required":["tabs"]},"Text":{"properties":{"text":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"Literal text, path binding, or function call."},"variant":{"type":"string","enum":["h1","h2","h3","h4","h5","caption","body","markdown"]},"emphasis":{"type":"string","enum":["medium","strong"]}},"required":["text"]},"TextField":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"The text label for the input field."},"value":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"The value of the text field."},"variant":{"type":"string","enum":["number","longText","shortText","obscured"],"description":"The type of input field to display."},"validationRegexp":{"type":"string","description":"A regular expression used for client-side validation of the input."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}]}},"returnType":{"type":"string","enum":["boolean"]}},"required":["call"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["label"]}},"functions":{"required":{"type":"object","description":"Checks that the value is not null, undefined, or empty.","properties":{"call":{"const":"required"},"args":{"type":"object","properties":{"value":{"description":"The value to check."}},"required":["value"],"additionalProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"regex":{"type":"object","description":"Checks that the value matches a regular expression string.","properties":{"call":{"const":"regex"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicString"},"pattern":{"type":"string","description":"The regex pattern to match against."}},"required":["value","pattern"],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"length":{"type":"object","description":"Checks string length constraints.","properties":{"call":{"const":"length"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicString"},"min":{"type":"integer","minimum":0,"description":"The minimum allowed length."},"max":{"type":"integer","minimum":0,"description":"The maximum allowed length."}},"required":["value"],"anyOf":[{"required":["min"]},{"required":["max"]}],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"numeric":{"type":"object","description":"Checks numeric range constraints.","properties":{"call":{"const":"numeric"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicNumber"},"min":{"type":"number","description":"The minimum allowed value."},"max":{"type":"number","description":"The maximum allowed value."}},"required":["value"],"anyOf":[{"required":["min"]},{"required":["max"]}],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"email":{"type":"object","description":"Checks that the value is a valid email address.","properties":{"call":{"const":"email"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicString"}},"required":["value"],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"formatString":{"type":"object","description":"Performs string interpolation of data model values and other functions in the catalog functions list and returns the resulting string. The value string can contain interpolated expressions in the `${expression}` format. Supported expression types include: JSON Pointer paths to the data model (e.g., `${/absolute/path}` or `${relative/path}`), and client-side function calls (e.g., `${now()}`). Function arguments must be named (e.g., `${formatDate(value:${/currentDate}, format:\'MM-dd\')}`). To include a literal `${` sequence, escape it as `\\\\${`.","properties":{"call":{"const":"formatString"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicString"}},"required":["value"],"unevaluatedProperties":false},"returnType":{"const":"string"}},"required":["call","args"],"unevaluatedProperties":false},"formatNumber":{"type":"object","description":"Formats a number with the specified grouping and decimal precision.","properties":{"call":{"const":"formatNumber"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicNumber","description":"The number to format."},"decimals":{"$ref":"common_types.json#/$defs/DynamicNumber","description":"Optional. The number of decimal places to show. Defaults to 0 or 2 depending on locale."},"grouping":{"$ref":"common_types.json#/$defs/DynamicBoolean","description":"Optional. If true, uses locale-specific grouping separators (e.g. \'1,000\'). If false, returns raw digits (e.g. \'1000\'). Defaults to true."}},"required":["value"],"unevaluatedProperties":false},"returnType":{"const":"string"}},"required":["call","args"],"unevaluatedProperties":false},"formatCurrency":{"type":"object","description":"Formats a number as a currency string.","properties":{"call":{"const":"formatCurrency"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicNumber","description":"The monetary amount."},"currency":{"$ref":"common_types.json#/$defs/DynamicString","description":"The ISO 4217 currency code (e.g., \'USD\', \'EUR\')."},"decimals":{"$ref":"common_types.json#/$defs/DynamicNumber","description":"Optional. The number of decimal places to show. Defaults to 0 or 2 depending on locale."},"grouping":{"$ref":"common_types.json#/$defs/DynamicBoolean","description":"Optional. If true, uses locale-specific grouping separators (e.g. \'1,000\'). If false, returns raw digits (e.g. \'1000\'). Defaults to true."}},"required":["currency","value"],"unevaluatedProperties":false},"returnType":{"const":"string"}},"required":["call","args"],"unevaluatedProperties":false},"formatDate":{"type":"object","description":"Formats a timestamp into a string using a pattern.","properties":{"call":{"const":"formatDate"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicValue","description":"The date to format."},"format":{"$ref":"common_types.json#/$defs/DynamicString","description":"A Unicode TR35 date pattern string.\\n\\nToken Reference:\\n- Year: \'yy\' (26), \'yyyy\' (2026)\\n- Month: \'M\' (1), \'MM\' (01), \'MMM\' (Jan), \'MMMM\' (January)\\n- Day: \'d\' (1), \'dd\' (01), \'E\' (Tue), \'EEEE\' (Tuesday)\\n- Hour (12h): \'h\' (1-12), \'hh\' (01-12) - requires \'a\' for AM/PM\\n- Hour (24h): \'H\' (0-23), \'HH\' (00-23) - Military Time\\n- Minute: \'mm\' (00-59)\\n- Second: \'ss\' (00-59)\\n- Period: \'a\' (AM/PM)\\n\\nExamples:\\n- \'MMM dd, yyyy\' -> \'Jan 16, 2026\'\\n- \'HH:mm\' -> \'14:30\' (Military)\\n- \'h:mm a\' -> \'2:30 PM\'\\n- \'EEEE, d MMMM\' -> \'Friday, 16 January\'"}},"required":["format","value"],"unevaluatedProperties":false},"returnType":{"const":"string"}},"required":["call","args"],"unevaluatedProperties":false},"pluralize":{"type":"object","description":"Returns a localized string based on the Common Locale Data Repository (CLDR) plural category of the count (zero, one, two, few, many, other). Requires an \'other\' fallback. For English, just use \'one\' and \'other\'.","properties":{"call":{"const":"pluralize"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicNumber","description":"The numeric value used to determine the plural category."},"zero":{"$ref":"common_types.json#/$defs/DynamicString","description":"String for the \'zero\' category (e.g., 0 items)."},"one":{"$ref":"common_types.json#/$defs/DynamicString","description":"String for the \'one\' category (e.g., 1 item)."},"two":{"$ref":"common_types.json#/$defs/DynamicString","description":"String for the \'two\' category (used in Arabic, Welsh, etc.)."},"few":{"$ref":"common_types.json#/$defs/DynamicString","description":"String for the \'few\' category (e.g., small groups in Slavic languages)."},"many":{"$ref":"common_types.json#/$defs/DynamicString","description":"String for the \'many\' category (e.g., large groups in various languages)."},"other":{"$ref":"common_types.json#/$defs/DynamicString","description":"The default/fallback string (used for general plural cases)."}},"required":["value","other"],"unevaluatedProperties":false},"returnType":{"const":"string"}},"required":["call","args"],"unevaluatedProperties":false},"openUrl":{"type":"object","description":"Opens the specified URL in a browser or handler. This function has no return value.","properties":{"call":{"const":"openUrl"},"args":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL to open."}},"required":["url"],"additionalProperties":false},"returnType":{"const":"void"}},"required":["call","args"],"unevaluatedProperties":false},"and":{"type":"object","description":"Performs a logical AND operation on a list of boolean values.","properties":{"call":{"const":"and"},"args":{"type":"object","properties":{"values":{"type":"array","description":"The list of boolean values to evaluate.","items":{"$ref":"common_types.json#/$defs/DynamicBoolean"},"minItems":2}},"required":["values"],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"or":{"type":"object","description":"Performs a logical OR operation on a list of boolean values.","properties":{"call":{"const":"or"},"args":{"type":"object","properties":{"values":{"type":"array","description":"The list of boolean values to evaluate.","items":{"$ref":"common_types.json#/$defs/DynamicBoolean"},"minItems":2}},"required":["values"],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"not":{"type":"object","description":"Performs a logical NOT operation on a boolean value.","properties":{"call":{"const":"not"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicBoolean","description":"The boolean value to negate."}},"required":["value"],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false}}}');
|
|
356
338
|
const a2ui_catalog_BASIC_CATALOG_ID = 'https://a2ui.org/specification/v0_9/basic_catalog.json';
|
|
357
|
-
const CATALOG_MANIFESTS = [
|
|
358
|
-
Text_catalog_namespaceObject,
|
|
359
|
-
Image_catalog_namespaceObject,
|
|
360
|
-
Icon_catalog_namespaceObject,
|
|
361
|
-
Divider_catalog_namespaceObject,
|
|
362
|
-
LineChart_catalog_namespaceObject,
|
|
363
|
-
Row_catalog_namespaceObject,
|
|
364
|
-
Column_catalog_namespaceObject,
|
|
365
|
-
List_catalog_namespaceObject,
|
|
366
|
-
Card_catalog_namespaceObject,
|
|
367
|
-
Tabs_catalog_namespaceObject,
|
|
368
|
-
Modal_catalog_namespaceObject,
|
|
369
|
-
catalog_namespaceObject,
|
|
370
|
-
TextField_catalog_namespaceObject,
|
|
371
|
-
CheckBox_catalog_namespaceObject,
|
|
372
|
-
ChoicePicker_catalog_namespaceObject,
|
|
373
|
-
DateTimeInput_catalog_namespaceObject,
|
|
374
|
-
RadioGroup_catalog_namespaceObject,
|
|
375
|
-
Slider_catalog_namespaceObject
|
|
376
|
-
];
|
|
377
339
|
const COMPONENT_SUMMARIES = {
|
|
378
340
|
Button: 'Clickable button. MUST always include an action. Has no "label" prop; use a child Text component for the visible label.',
|
|
379
341
|
Card: 'Card container with exactly one child. Wrap multiple elements in a Column/Row/List first.',
|
|
380
342
|
CheckBox: 'Boolean checkbox with a label and optional validation checks.',
|
|
381
343
|
ChoicePicker: 'Single- or multi-select choice picker with checkbox and chip display styles.',
|
|
382
|
-
Column: 'Vertical layout container.',
|
|
344
|
+
Column: 'Vertical layout container. Preferred for ordinary non-scrollable repeated content using template children.',
|
|
383
345
|
DateTimeInput: 'Date and/or time input with a calendar panel. Without outputFormat, date-enabled inputs write YYYY-MM-DD.',
|
|
384
346
|
Divider: 'Horizontal or vertical separator line.',
|
|
385
347
|
Icon: 'Display an icon by name.',
|
|
386
348
|
Image: 'Display an image by URL.',
|
|
387
349
|
LineChart: 'Display one or more numeric line series over shared labels.',
|
|
388
|
-
List: '
|
|
350
|
+
List: 'Scrollable repeating layout container. Use when repeated content needs scrolling; otherwise prefer Column or Row template children.',
|
|
351
|
+
Loading: 'Animated progress indicator for pending content.',
|
|
389
352
|
Modal: 'Modal dialog with a trigger component and a content component. The trigger opens the modal locally when tapped.',
|
|
353
|
+
PieChart: 'Display numeric slices as a pie or donut chart.',
|
|
390
354
|
RadioGroup: 'Single-choice selector for a list of string options.',
|
|
391
|
-
Row: 'Horizontal layout container.',
|
|
355
|
+
Row: 'Horizontal layout container. Preferred for ordinary non-scrollable repeated content using template children.',
|
|
392
356
|
Slider: 'Numeric slider with an optional label and validation checks.',
|
|
393
357
|
Tabs: 'Tabbed container; each tab references a child component id.',
|
|
394
358
|
Text: 'Display styled text. Supports literal text, data bindings, and function calls.',
|
|
@@ -471,6 +435,48 @@ function componentFromManifest(manifest) {
|
|
|
471
435
|
} : {}
|
|
472
436
|
};
|
|
473
437
|
}
|
|
438
|
+
function functionsFromGeneratedCatalog(catalog) {
|
|
439
|
+
if (!isRecord(catalog)) return [];
|
|
440
|
+
const { functions } = catalog;
|
|
441
|
+
if (Array.isArray(functions)) return functions.filter((fn)=>{
|
|
442
|
+
if (!isRecord(fn)) return false;
|
|
443
|
+
const candidate = fn;
|
|
444
|
+
return 'string' == typeof candidate.name && isRecord(candidate.parameters) && isFunctionReturnType(candidate.returnType);
|
|
445
|
+
});
|
|
446
|
+
if (!isRecord(functions)) return [];
|
|
447
|
+
return Object.entries(functions).map(([name, schema])=>functionSpecFromSchema(name, schema)).filter((fn)=>null !== fn);
|
|
448
|
+
}
|
|
449
|
+
function functionSpecFromSchema(name, schema) {
|
|
450
|
+
if (!isRecord(schema)) return null;
|
|
451
|
+
const schemaRecord = schema;
|
|
452
|
+
if (!isRecord(schemaRecord.properties)) return null;
|
|
453
|
+
const properties = schemaRecord.properties;
|
|
454
|
+
const args = properties.args;
|
|
455
|
+
const returnType = properties.returnType;
|
|
456
|
+
if (!isRecord(args) || !isRecord(returnType)) return null;
|
|
457
|
+
const returnTypeValue = returnType.const;
|
|
458
|
+
if (!isFunctionReturnType(returnTypeValue)) return null;
|
|
459
|
+
const description = schemaRecord.description;
|
|
460
|
+
return {
|
|
461
|
+
name,
|
|
462
|
+
...'string' == typeof description ? {
|
|
463
|
+
description
|
|
464
|
+
} : {},
|
|
465
|
+
parameters: args,
|
|
466
|
+
returnType: returnTypeValue
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
function isFunctionReturnType(value) {
|
|
470
|
+
return 'string' === value || 'number' === value || 'boolean' === value || 'array' === value || 'object' === value || 'any' === value || 'void' === value;
|
|
471
|
+
}
|
|
472
|
+
function componentManifestsFromGeneratedCatalog(catalog) {
|
|
473
|
+
if (!isRecord(catalog)) return [];
|
|
474
|
+
const { components } = catalog;
|
|
475
|
+
if (!isRecord(components)) return [];
|
|
476
|
+
return Object.entries(components).filter((entry)=>isRecord(entry[1])).map(([name, schema])=>({
|
|
477
|
+
[name]: schema
|
|
478
|
+
}));
|
|
479
|
+
}
|
|
474
480
|
function createA2UICatalogFromManifests(options) {
|
|
475
481
|
return {
|
|
476
482
|
id: options.catalogId,
|
|
@@ -494,11 +500,12 @@ const BASIC_CATALOG = {
|
|
|
494
500
|
id: a2ui_catalog_BASIC_CATALOG_ID,
|
|
495
501
|
label: 'Lynx A2UI basic catalog (v0.9)',
|
|
496
502
|
version: 'v0.9',
|
|
497
|
-
components:
|
|
503
|
+
components: componentManifestsFromGeneratedCatalog(catalog_namespaceObject).map((manifest)=>componentFromManifest(manifest)).filter((component)=>null !== component),
|
|
498
504
|
extraRules: [
|
|
499
505
|
'Use only components listed in this catalog; unsupported examples such as Video, AudioPlayer, DatePicker, or Checkbox are not available unless they appear here.',
|
|
500
506
|
'The implemented checkbox component is named "CheckBox" with a capital B.'
|
|
501
507
|
],
|
|
508
|
+
functions: functionsFromGeneratedCatalog(catalog_namespaceObject),
|
|
502
509
|
examples: BASIC_CATALOG_EXAMPLES
|
|
503
510
|
};
|
|
504
511
|
function renderCatalogReference(catalog) {
|
|
@@ -598,16 +605,38 @@ and exactly ONE of the following keys:
|
|
|
598
605
|
}
|
|
599
606
|
- The component with id "root" is the entry point of the tree.
|
|
600
607
|
- Layout containers (Row / Column / List) take "children": ["id1", "id2", ...].
|
|
601
|
-
To repeat from the data model, use "children":
|
|
608
|
+
To repeat from the data model, any of these containers can use "children":
|
|
602
609
|
{ "path": "/items", "componentId": "itemRow" }
|
|
610
|
+
Prefer Column for ordinary vertical repeated content and Row for ordinary
|
|
611
|
+
horizontal repeated content. Use List only when the repeated content should
|
|
612
|
+
be scrollable.
|
|
603
613
|
- Card uses "child": "id". Modal uses "trigger" + "content". Tabs uses an
|
|
604
614
|
array of {title, child}.
|
|
605
615
|
|
|
606
616
|
## Data binding
|
|
607
617
|
- Static text: "text": "Hello"
|
|
608
618
|
- Bound text: "text": { "path": "/user/name" }
|
|
609
|
-
- Bound
|
|
619
|
+
- Bound repeating children:
|
|
610
620
|
"children": { "path": "/items", "componentId": "itemRow" }
|
|
621
|
+
- Inside the template component tree for a bound repeating container, bind item
|
|
622
|
+
fields with relative paths that match the object fields in each data-model
|
|
623
|
+
item. Example
|
|
624
|
+
data model:
|
|
625
|
+
{ "items": [{ "item": "Alpha" }, { "item": "Beta" }] }
|
|
626
|
+
paired with:
|
|
627
|
+
"children": { "path": "/items", "componentId": "itemRow" }
|
|
628
|
+
"text": { "path": "item" }
|
|
629
|
+
If each array item is { "name": "Alpha" }, use { "path": "name" } instead.
|
|
630
|
+
Templated children require each list item to be an object with named fields.
|
|
631
|
+
A2UI data bindings are JSON Pointer paths to named data fields, not current
|
|
632
|
+
item references. Always use this object-item shape:
|
|
633
|
+
{ "items": [{ "label": "Alpha" }, { "label": "Beta" }] }
|
|
634
|
+
"children": { "path": "/items", "componentId": "itemRow" }
|
|
635
|
+
"text": { "path": "label" }
|
|
636
|
+
If the source values are strings, numbers, booleans, or other primitive
|
|
637
|
+
values, wrap each value in an object field before using it in a template.
|
|
638
|
+
Do NOT use wildcard paths like "/items/*/item"; collection scope makes the
|
|
639
|
+
current item the base path automatically.
|
|
611
640
|
- Use updateDataModel messages to populate values at those paths.
|
|
612
641
|
- DynamicString/DynamicNumber/DynamicBoolean props accept either a literal value
|
|
613
642
|
or { "path": "/json/pointer" }. If you bind a prop to a path, create the
|
|
@@ -643,6 +672,16 @@ function buildHardRules(catalogId) {
|
|
|
643
672
|
updateComponents message that contains components reading those paths. After
|
|
644
673
|
createSurface, either send a literal root/skeleton updateComponents first, or
|
|
645
674
|
send updateDataModel first when the first visible components use bindings.
|
|
675
|
+
In template children, use relative paths from the current item, for example
|
|
676
|
+
{ "path": "item" }, never absolute wildcard paths like "/items/*/item".
|
|
677
|
+
Never use { "path": "." }; A2UI cannot resolve "." as the current item.
|
|
678
|
+
Any data-model array used by template children MUST contain objects with
|
|
679
|
+
named fields. Never bind template children to an array of strings, numbers,
|
|
680
|
+
booleans, or other primitive values. Wrap primitive values as objects, e.g.
|
|
681
|
+
[{ "label": "Alpha" }], then bind { "path": "label" }.
|
|
682
|
+
Do not use List merely because data is repeated. Prefer Column/Row
|
|
683
|
+
template children for non-scrollable repeated content; reserve List for
|
|
684
|
+
scrollable collections.
|
|
646
685
|
7. For a fresh non-action response, the first updateComponents message MUST
|
|
647
686
|
contain exactly one component with id "root".
|
|
648
687
|
8. Use property-based component discriminators: "component": "Text", not
|
|
@@ -683,6 +722,9 @@ function buildHardRules(catalogId) {
|
|
|
683
722
|
23. For Image.url, provide a short English image search query such as
|
|
684
723
|
"fresh pasta on a table" or "city skyline at night". Do NOT invent photo
|
|
685
724
|
CDN URLs. The server resolves Image.url values through its image provider.
|
|
725
|
+
24. Function calls are allowed only when the "call" name exactly matches a
|
|
726
|
+
function listed under "Available functions" in the active catalog. Do NOT
|
|
727
|
+
invent function names.
|
|
686
728
|
`;
|
|
687
729
|
}
|
|
688
730
|
function renderCatalogExamples(catalog) {
|
|
@@ -724,19 +766,35 @@ function readA2UICatalogFromDirectory(options) {
|
|
|
724
766
|
const catalogDir = __rspack_external_node_path_c5b9b54f.resolve(cwd, options.catalogDir);
|
|
725
767
|
if (!__rspack_external_node_fs_5ea92f0c.existsSync(catalogDir)) throw new Error(`[a2ui-prompt] Catalog directory does not exist: ${options.catalogDir}`);
|
|
726
768
|
if (!__rspack_external_node_fs_5ea92f0c.statSync(catalogDir).isDirectory()) throw new Error(`[a2ui-prompt] Catalog path is not a directory: ${options.catalogDir}`);
|
|
769
|
+
const fullCatalog = readFullCatalog(catalogDir);
|
|
770
|
+
if (fullCatalog) {
|
|
771
|
+
const componentManifests = componentManifestsFromFullCatalog(fullCatalog);
|
|
772
|
+
if (0 === componentManifests.length) throw new Error(`[a2ui-prompt] Full catalog for ${options.catalogId} did not contain any valid component schemas.`);
|
|
773
|
+
return createA2UICatalogFromManifests({
|
|
774
|
+
catalogId: options.catalogId,
|
|
775
|
+
componentManifests,
|
|
776
|
+
functions: functionDefinitionsFromFullCatalog(fullCatalog),
|
|
777
|
+
...options.label ? {
|
|
778
|
+
label: options.label
|
|
779
|
+
} : {},
|
|
780
|
+
...options.version ? {
|
|
781
|
+
version: options.version
|
|
782
|
+
} : {}
|
|
783
|
+
});
|
|
784
|
+
}
|
|
727
785
|
const componentManifests = [];
|
|
728
|
-
|
|
786
|
+
const componentCatalogDir = resolveComponentCatalogDir(catalogDir);
|
|
787
|
+
for (const entry of __rspack_external_node_fs_5ea92f0c.readdirSync(componentCatalogDir, {
|
|
729
788
|
withFileTypes: true
|
|
730
789
|
})){
|
|
731
790
|
if (!entry.isDirectory() || 'functions' === entry.name) continue;
|
|
732
|
-
const catalogJsonPath = __rspack_external_node_path_c5b9b54f.join(
|
|
791
|
+
const catalogJsonPath = __rspack_external_node_path_c5b9b54f.join(componentCatalogDir, entry.name, 'catalog.json');
|
|
733
792
|
if (__rspack_external_node_fs_5ea92f0c.existsSync(catalogJsonPath)) componentManifests.push(readCatalogManifest(catalogJsonPath));
|
|
734
793
|
}
|
|
735
|
-
if (0 === componentManifests.length) throw new Error(`[a2ui-prompt] No component catalog files found in ${options.catalogDir}. Expected files like
|
|
794
|
+
if (0 === componentManifests.length) throw new Error(`[a2ui-prompt] No component catalog files found in ${options.catalogDir}. Expected a full catalog.json or files like catalog/<Component>/catalog.json. Run "genui a2ui generate catalog" first or pass --catalog-dir to the generated catalog directory.`);
|
|
736
795
|
return createA2UICatalogFromManifests({
|
|
737
796
|
catalogId: options.catalogId,
|
|
738
797
|
componentManifests,
|
|
739
|
-
functions: readFunctionDefinitions(catalogDir),
|
|
740
798
|
...options.label ? {
|
|
741
799
|
label: options.label
|
|
742
800
|
} : {},
|
|
@@ -745,36 +803,53 @@ function readA2UICatalogFromDirectory(options) {
|
|
|
745
803
|
} : {}
|
|
746
804
|
});
|
|
747
805
|
}
|
|
748
|
-
function
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
for (const
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
if (
|
|
757
|
-
const functionRecord = readJsonObject(__rspack_external_node_path_c5b9b54f.join(functionsDir, entry.name));
|
|
758
|
-
for (const [name, value] of Object.entries(functionRecord)){
|
|
759
|
-
if (!src_isRecord(value)) continue;
|
|
760
|
-
const description = value["description"];
|
|
761
|
-
const parameters = value['parameters'];
|
|
762
|
-
const returnType = value['returnType'];
|
|
763
|
-
functions.push({
|
|
764
|
-
name,
|
|
765
|
-
...'string' == typeof description ? {
|
|
766
|
-
description
|
|
767
|
-
} : {},
|
|
768
|
-
parameters: src_isRecord(parameters) ? parameters : {
|
|
769
|
-
type: 'object',
|
|
770
|
-
properties: {},
|
|
771
|
-
additionalProperties: false
|
|
772
|
-
},
|
|
773
|
-
returnType: isReturnType(returnType) ? returnType : 'any'
|
|
774
|
-
});
|
|
775
|
-
}
|
|
806
|
+
function readFullCatalog(catalogDir) {
|
|
807
|
+
const candidates = [
|
|
808
|
+
__rspack_external_node_path_c5b9b54f.join(catalogDir, 'catalog.json'),
|
|
809
|
+
__rspack_external_node_path_c5b9b54f.join(__rspack_external_node_path_c5b9b54f.dirname(catalogDir), 'catalog.json')
|
|
810
|
+
];
|
|
811
|
+
for (const candidate of candidates){
|
|
812
|
+
if (!__rspack_external_node_fs_5ea92f0c.existsSync(candidate)) continue;
|
|
813
|
+
const catalog = readJsonObject(candidate);
|
|
814
|
+
if (src_isRecord(catalog['components'])) return catalog;
|
|
776
815
|
}
|
|
777
|
-
return
|
|
816
|
+
return null;
|
|
817
|
+
}
|
|
818
|
+
function resolveComponentCatalogDir(catalogDir) {
|
|
819
|
+
const nestedCatalogDir = __rspack_external_node_path_c5b9b54f.join(catalogDir, 'catalog');
|
|
820
|
+
if (__rspack_external_node_fs_5ea92f0c.existsSync(nestedCatalogDir) && __rspack_external_node_fs_5ea92f0c.statSync(nestedCatalogDir).isDirectory()) return nestedCatalogDir;
|
|
821
|
+
return catalogDir;
|
|
822
|
+
}
|
|
823
|
+
function componentManifestsFromFullCatalog(catalog) {
|
|
824
|
+
const components = catalog['components'];
|
|
825
|
+
if (!src_isRecord(components)) return [];
|
|
826
|
+
return Object.entries(components).filter((entry)=>src_isRecord(entry[1])).map(([name, schema])=>({
|
|
827
|
+
[name]: schema
|
|
828
|
+
}));
|
|
829
|
+
}
|
|
830
|
+
function functionDefinitionsFromFullCatalog(catalog) {
|
|
831
|
+
const functions = catalog['functions'];
|
|
832
|
+
if (src_isRecord(functions)) return Object.entries(functions).map(([name, schema])=>src_functionSpecFromSchema(name, schema)).filter((fn)=>null !== fn).sort((left, right)=>left.name.localeCompare(right.name));
|
|
833
|
+
if (!Array.isArray(functions)) return [];
|
|
834
|
+
return functions.filter((fn)=>src_isRecord(fn) && 'string' == typeof fn['name'] && src_isRecord(fn['parameters']) && isReturnType(fn['returnType'])).sort((left, right)=>left.name.localeCompare(right.name));
|
|
835
|
+
}
|
|
836
|
+
function src_functionSpecFromSchema(name, schema) {
|
|
837
|
+
if (!src_isRecord(schema) || !src_isRecord(schema['properties'])) return null;
|
|
838
|
+
const properties = schema['properties'];
|
|
839
|
+
const args = properties['args'];
|
|
840
|
+
const returnType = properties['returnType'];
|
|
841
|
+
if (!src_isRecord(args) || !src_isRecord(returnType)) return null;
|
|
842
|
+
const returnTypeValue = returnType['const'];
|
|
843
|
+
if (!isReturnType(returnTypeValue)) return null;
|
|
844
|
+
const description = schema["description"];
|
|
845
|
+
return {
|
|
846
|
+
name,
|
|
847
|
+
...'string' == typeof description ? {
|
|
848
|
+
description
|
|
849
|
+
} : {},
|
|
850
|
+
parameters: args,
|
|
851
|
+
returnType: returnTypeValue
|
|
852
|
+
};
|
|
778
853
|
}
|
|
779
854
|
function readJsonObject(filePath) {
|
|
780
855
|
const value = JSON.parse(__rspack_external_node_fs_5ea92f0c.readFileSync(filePath, 'utf8'));
|
package/cli/README.md
CHANGED
|
@@ -20,6 +20,12 @@ a compatibility alias for existing A2UI-only scripts.
|
|
|
20
20
|
|
|
21
21
|
## A2UI Commands
|
|
22
22
|
|
|
23
|
+
Create a new A2UI project:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
genui a2ui create my-a2ui-app
|
|
27
|
+
```
|
|
28
|
+
|
|
23
29
|
Generate a system prompt with the built-in A2UI basic catalog:
|
|
24
30
|
|
|
25
31
|
```bash
|
|
@@ -49,6 +55,26 @@ genui a2ui generate prompt \
|
|
|
49
55
|
artifacts. When `--catalog-dir` is provided, the directory must contain files
|
|
50
56
|
like `<Component>/catalog.json`.
|
|
51
57
|
|
|
58
|
+
### `genui a2ui create`
|
|
59
|
+
|
|
60
|
+
Creates a new ReactLynx A2UI project from the bundled template.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
genui a2ui create my-a2ui-app
|
|
64
|
+
cd my-a2ui-app
|
|
65
|
+
pnpm install
|
|
66
|
+
pnpm run dev
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Useful options:
|
|
70
|
+
|
|
71
|
+
- `[project-name]`: target directory name. Defaults to `my-a2ui-app`.
|
|
72
|
+
- `--template <name>`: template to use. Defaults to `default`.
|
|
73
|
+
|
|
74
|
+
The target directory must be empty. The generated `package.json` replaces the
|
|
75
|
+
template workspace dependency placeholders with installable package versions
|
|
76
|
+
resolved from the parent `@lynx-js/genui` package metadata.
|
|
77
|
+
|
|
52
78
|
### `genui a2ui generate catalog`
|
|
53
79
|
|
|
54
80
|
Delegates catalog extraction to `@lynx-js/genui/a2ui-catalog-extractor`.
|