@asteby/metacore-genui 0.0.0-stage → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +21 -2
- package/dist/agent-result.d.ts +29 -0
- package/dist/agent-result.d.ts.map +1 -0
- package/dist/agent-result.js +31 -0
- package/dist/agent-result.js.map +1 -0
- package/dist/generative-ui.d.ts +22 -0
- package/dist/generative-ui.d.ts.map +1 -0
- package/dist/generative-ui.js +158 -0
- package/dist/generative-ui.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +120 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/validate.d.ts +27 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +259 -0
- package/dist/validate.js.map +1 -0
- package/package.json +49 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Asteby, Inc.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @asteby/metacore-genui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Generative UI for agents, by metadata only. The agent (kernel package
|
|
4
|
+
`genui`) returns a `genui/v1` JSON spec; this package validates it again
|
|
5
|
+
(`parseUISpec`) and draws it with SDK components. Whitelisted blocks: `text`,
|
|
6
|
+
`kpi`, `card`, `table`, `links`, `timeline`, `chart` (dependency-free SVG with
|
|
7
|
+
a required text summary) and `confirm` (form + declared actions).
|
|
8
|
+
|
|
9
|
+
No HTML, markdown-to-HTML or scripts; links are http(s) or app-relative only;
|
|
10
|
+
actions are ids plus scalar params that the host maps to real calls.
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { registerAgentResultRenderer } from '@asteby/metacore-runtime-react'
|
|
14
|
+
import { createGenerativeUIResult } from '@asteby/metacore-genui'
|
|
15
|
+
|
|
16
|
+
registerAgentResultRenderer('ui', createGenerativeUIResult({
|
|
17
|
+
onNavigate: (path) => navigate({ to: path }),
|
|
18
|
+
onAction: async ({ id, params }) => {
|
|
19
|
+
if (id === 'automations.confirm') await api.post(`/automations/${params.id}/confirm`)
|
|
20
|
+
},
|
|
21
|
+
}))
|
|
22
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { UIActionHandler } from './types';
|
|
3
|
+
/** Minimal shape of an agent result whose embed carries a genui spec. */
|
|
4
|
+
export interface GenerativeUIAgentResult {
|
|
5
|
+
kind: string;
|
|
6
|
+
embed?: {
|
|
7
|
+
type?: string;
|
|
8
|
+
ui?: unknown;
|
|
9
|
+
};
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface GenerativeUIResultOptions {
|
|
13
|
+
/** Maps declared action ids (e.g. "automations.confirm") to host calls. */
|
|
14
|
+
onAction?: UIActionHandler;
|
|
15
|
+
onNavigate?: (path: string) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Builds a renderer for the agent result registry of
|
|
19
|
+
* @asteby/metacore-runtime-react:
|
|
20
|
+
*
|
|
21
|
+
* registerAgentResultRenderer('ui', createGenerativeUIResult({ onAction }))
|
|
22
|
+
*
|
|
23
|
+
* The chat already turns every embed into a result of its `type`, so `ui`
|
|
24
|
+
* embeds produced by kernel tools render without touching the chat package.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createGenerativeUIResult(opts?: GenerativeUIResultOptions): (props: {
|
|
27
|
+
result: GenerativeUIAgentResult;
|
|
28
|
+
}) => ReactElement;
|
|
29
|
+
//# sourceMappingURL=agent-result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-result.d.ts","sourceRoot":"","sources":["../src/agent-result.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,yEAAyE;AACzE,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,yBAAyB;IACxC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CACpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,GAAE,yBAA8B,GAAG,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,uBAAuB,CAAA;CAAE,KAAK,YAAY,CAoB3I"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { GenerativeUI } from './generative-ui';
|
|
4
|
+
/**
|
|
5
|
+
* Builds a renderer for the agent result registry of
|
|
6
|
+
* @asteby/metacore-runtime-react:
|
|
7
|
+
*
|
|
8
|
+
* registerAgentResultRenderer('ui', createGenerativeUIResult({ onAction }))
|
|
9
|
+
*
|
|
10
|
+
* The chat already turns every embed into a result of its `type`, so `ui`
|
|
11
|
+
* embeds produced by kernel tools render without touching the chat package.
|
|
12
|
+
*/
|
|
13
|
+
export function createGenerativeUIResult(opts = {}) {
|
|
14
|
+
function GenerativeUIResult({ result }) {
|
|
15
|
+
const [busy, setBusy] = useState(false);
|
|
16
|
+
const onAction = opts.onAction
|
|
17
|
+
? async (ev) => {
|
|
18
|
+
setBusy(true);
|
|
19
|
+
try {
|
|
20
|
+
await opts.onAction(ev);
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
setBusy(false);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
: undefined;
|
|
27
|
+
return (_jsx("div", { className: 'w-[min(100%,34rem)]', children: _jsx(GenerativeUI, { spec: result.embed?.ui, onAction: onAction, onNavigate: opts.onNavigate, busy: busy }) }));
|
|
28
|
+
}
|
|
29
|
+
return GenerativeUIResult;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=agent-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-result.js","sourceRoot":"","sources":["../src/agent-result.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAqB,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAgB9C;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAkC,EAAE;IAC3E,SAAS,kBAAkB,CAAC,EAAE,MAAM,EAAuC;QACzE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;QACvC,MAAM,QAAQ,GAAgC,IAAI,CAAC,QAAQ;YACzD,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;gBACX,OAAO,CAAC,IAAI,CAAC,CAAA;gBACb,IAAI,CAAC;oBACH,MAAM,IAAI,CAAC,QAAS,CAAC,EAAE,CAAC,CAAA;gBAC1B,CAAC;wBAAS,CAAC;oBACT,OAAO,CAAC,KAAK,CAAC,CAAA;gBAChB,CAAC;YACH,CAAC;YACH,CAAC,CAAC,SAAS,CAAA;QACb,OAAO,CACL,cAAK,SAAS,EAAC,qBAAqB,YAClC,KAAC,YAAY,IAAC,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,GAAI,GACjG,CACP,CAAA;IACH,CAAC;IACD,OAAO,kBAAkB,CAAA;AAC3B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { UIActionHandler } from './types';
|
|
3
|
+
export interface GenerativeUIProps {
|
|
4
|
+
/** Untrusted spec (validated here before anything is drawn). */
|
|
5
|
+
spec: unknown;
|
|
6
|
+
/** Called with a declared action; the host maps the id to a real call. */
|
|
7
|
+
onAction?: UIActionHandler;
|
|
8
|
+
/** Opens an app-relative link ('/m/…') with the host router. */
|
|
9
|
+
onNavigate?: (path: string) => void;
|
|
10
|
+
/** Disables actions while the host processes one. */
|
|
11
|
+
busy?: boolean;
|
|
12
|
+
/** Rendered when the spec is invalid (default: nothing). */
|
|
13
|
+
fallback?: ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Renders a genui/v1 spec with the SDK's own components. Text is always
|
|
18
|
+
* rendered as text (React escapes it): there is no HTML, markdown-to-HTML or
|
|
19
|
+
* script path. Links are limited to http(s) and app-relative paths.
|
|
20
|
+
*/
|
|
21
|
+
export declare function GenerativeUI({ spec, onAction, onNavigate, busy, fallback, className }: GenerativeUIProps): import("react").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=generative-ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generative-ui.d.ts","sourceRoot":"","sources":["../src/generative-ui.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAwBhE,OAAO,KAAK,EAWV,eAAe,EAKhB,MAAM,SAAS,CAAA;AAGhB,MAAM,WAAW,iBAAiB;IAChC,gEAAgE;IAChE,IAAI,EAAE,OAAO,CAAA;IACb,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B,gEAAgE;IAChE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,qDAAqD;IACrD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAoBD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,QAAe,EAAE,SAAS,EAAE,EAAE,iBAAiB,+BAY/G"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId, useMemo, useState } from 'react';
|
|
3
|
+
import { ArrowDownRight, ArrowRight, ArrowUpRight, Check, ExternalLink } from 'lucide-react';
|
|
4
|
+
import { Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, Label, Switch, Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, Textarea, cn, } from '@asteby/metacore-ui';
|
|
5
|
+
import { isSafeLink, parseUISpec } from './validate';
|
|
6
|
+
const BADGE_VARIANT = {
|
|
7
|
+
default: 'secondary',
|
|
8
|
+
muted: 'muted',
|
|
9
|
+
info: 'info',
|
|
10
|
+
success: 'success',
|
|
11
|
+
warning: 'warning',
|
|
12
|
+
danger: 'danger',
|
|
13
|
+
};
|
|
14
|
+
const TEXT_TONE = {
|
|
15
|
+
default: 'text-foreground',
|
|
16
|
+
muted: 'text-muted-foreground',
|
|
17
|
+
info: 'text-[var(--info,oklch(0.55_0.13_235))]',
|
|
18
|
+
success: 'text-[var(--success,oklch(0.6_0.15_155))]',
|
|
19
|
+
warning: 'text-[var(--warning,oklch(0.6_0.15_65))]',
|
|
20
|
+
danger: 'text-destructive',
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Renders a genui/v1 spec with the SDK's own components. Text is always
|
|
24
|
+
* rendered as text (React escapes it): there is no HTML, markdown-to-HTML or
|
|
25
|
+
* script path. Links are limited to http(s) and app-relative paths.
|
|
26
|
+
*/
|
|
27
|
+
export function GenerativeUI({ spec, onAction, onNavigate, busy, fallback = null, className }) {
|
|
28
|
+
const parsed = useMemo(() => parseUISpec(spec), [spec]);
|
|
29
|
+
if (!parsed.ok)
|
|
30
|
+
return _jsx(_Fragment, { children: fallback });
|
|
31
|
+
const s = parsed.spec;
|
|
32
|
+
return (_jsxs("section", { className: cn('@container flex w-full flex-col gap-2', className), "aria-label": s.title || undefined, "data-genui": '', children: [s.title ? _jsx("h3", { className: 'm-0 text-sm font-semibold text-foreground', children: s.title }) : null, s.blocks.map((b, i) => (_jsx(Block, { block: b, onAction: onAction, onNavigate: onNavigate, busy: busy }, i)))] }));
|
|
33
|
+
}
|
|
34
|
+
function Block({ block, ...rest }) {
|
|
35
|
+
switch (block.type) {
|
|
36
|
+
case 'text':
|
|
37
|
+
return _jsx(TextView, { block: block });
|
|
38
|
+
case 'kpi':
|
|
39
|
+
return _jsx(KPIView, { block: block });
|
|
40
|
+
case 'card':
|
|
41
|
+
return _jsx(CardView, { block: block, onNavigate: rest.onNavigate });
|
|
42
|
+
case 'table':
|
|
43
|
+
return _jsx(TableView, { block: block });
|
|
44
|
+
case 'links':
|
|
45
|
+
return _jsx(LinksView, { block: block, onNavigate: rest.onNavigate });
|
|
46
|
+
case 'timeline':
|
|
47
|
+
return _jsx(TimelineView, { block: block, onNavigate: rest.onNavigate });
|
|
48
|
+
case 'chart':
|
|
49
|
+
return _jsx(ChartView, { block: block });
|
|
50
|
+
case 'confirm':
|
|
51
|
+
return _jsx(ConfirmView, { block: block, ...rest });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function SmartLink({ href, children, onNavigate, className }) {
|
|
55
|
+
if (!isSafeLink(href) || !href)
|
|
56
|
+
return _jsx(_Fragment, { children: children });
|
|
57
|
+
if (href.startsWith('/')) {
|
|
58
|
+
return (_jsx("a", { href: href, className: className, onClick: (e) => {
|
|
59
|
+
if (!onNavigate)
|
|
60
|
+
return;
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
onNavigate(href);
|
|
63
|
+
}, children: children }));
|
|
64
|
+
}
|
|
65
|
+
return (_jsxs("a", { href: href, target: '_blank', rel: 'noopener noreferrer nofollow', className: className, children: [children, _jsx(ExternalLink, { className: 'ml-1 inline size-3 align-baseline', "aria-hidden": true }), _jsx("span", { className: 'sr-only', children: " (se abre en otra pesta\u00F1a)" })] }));
|
|
66
|
+
}
|
|
67
|
+
function Badges({ badges }) {
|
|
68
|
+
if (!badges?.length)
|
|
69
|
+
return null;
|
|
70
|
+
return (_jsx("span", { className: 'flex flex-wrap gap-1', children: badges.map((b, i) => (_jsx(Badge, { variant: BADGE_VARIANT[b.tone || 'default'], children: b.label }, i))) }));
|
|
71
|
+
}
|
|
72
|
+
function Fields({ fields }) {
|
|
73
|
+
if (!fields?.length)
|
|
74
|
+
return null;
|
|
75
|
+
return (_jsx("dl", { className: 'm-0 grid grid-cols-1 gap-x-4 gap-y-1 text-sm @sm:grid-cols-[minmax(6rem,auto)_1fr] @sm:gap-y-1.5', children: fields.map((f, i) => (_jsxs("div", { className: 'contents', children: [_jsx("dt", { className: 'text-xs text-muted-foreground @sm:text-sm', children: f.label }), _jsx("dd", { className: 'm-0 whitespace-pre-line break-words text-foreground', children: f.value })] }, i))) }));
|
|
76
|
+
}
|
|
77
|
+
function TextView({ block }) {
|
|
78
|
+
return _jsx("p", { className: cn('m-0 whitespace-pre-line break-words text-sm', TEXT_TONE[block.tone || 'default']), children: block.text });
|
|
79
|
+
}
|
|
80
|
+
const TREND_ICON = { up: ArrowUpRight, down: ArrowDownRight, flat: ArrowRight };
|
|
81
|
+
const TREND_LABEL = { up: 'al alza', down: 'a la baja', flat: 'estable' };
|
|
82
|
+
function KPIView({ block }) {
|
|
83
|
+
return (_jsxs("div", { className: 'w-full', children: [block.title ? _jsx("p", { className: 'mb-1 text-xs font-medium text-muted-foreground', children: block.title }) : null, _jsx("ul", { className: 'm-0 grid list-none grid-cols-2 gap-2 p-0 @md:grid-cols-3', children: block.items.map((it, i) => {
|
|
84
|
+
const Icon = it.trend ? TREND_ICON[it.trend] : null;
|
|
85
|
+
return (_jsxs("li", { className: 'rounded-lg border bg-card p-2.5', children: [_jsx("p", { className: 'm-0 text-xs text-muted-foreground', children: it.label }), _jsxs("p", { className: cn('m-0 flex items-center gap-1 text-lg font-semibold tabular-nums', TEXT_TONE[it.tone || 'default']), children: [it.value, Icon && it.trend ? (_jsxs(_Fragment, { children: [_jsx(Icon, { className: 'size-4', "aria-hidden": true }), _jsx("span", { className: 'sr-only', children: TREND_LABEL[it.trend] })] })) : null] }), it.hint ? _jsx("p", { className: 'm-0 text-xs text-muted-foreground', children: it.hint }) : null] }, i));
|
|
86
|
+
}) })] }));
|
|
87
|
+
}
|
|
88
|
+
function CardView({ block, onNavigate }) {
|
|
89
|
+
return (_jsxs(Card, { className: 'w-full gap-3 py-4', children: [_jsxs(CardHeader, { className: 'px-4', children: [_jsxs(CardTitle, { className: 'flex flex-wrap items-center gap-2 text-sm', children: [block.link ? (_jsx(SmartLink, { href: block.link, onNavigate: onNavigate, className: 'hover:underline', children: block.title })) : (block.title), _jsx(Badges, { badges: block.badges })] }), block.subtitle ? _jsx(CardDescription, { children: block.subtitle }) : null] }), block.body || block.fields?.length ? (_jsxs(CardContent, { className: 'flex flex-col gap-2 px-4', children: [block.body ? _jsx("p", { className: 'm-0 whitespace-pre-line text-sm', children: block.body }) : null, _jsx(Fields, { fields: block.fields })] })) : null] }));
|
|
90
|
+
}
|
|
91
|
+
const cell = (v) => (v === null || v === undefined ? '—' : typeof v === 'boolean' ? (v ? 'Sí' : 'No') : String(v));
|
|
92
|
+
function TableView({ block }) {
|
|
93
|
+
const rows = block.rows ?? [];
|
|
94
|
+
return (_jsxs("div", { className: 'w-full', children: [block.title ? _jsx("p", { className: 'mb-1 text-xs font-medium text-muted-foreground', children: block.title }) : null, _jsx("div", { className: 'hidden overflow-x-auto rounded-lg border @md:block', children: _jsxs(Table, { children: [block.caption ? _jsx(TableCaption, { children: block.caption }) : null, _jsx(TableHeader, { children: _jsx(TableRow, { children: block.columns.map((c) => (_jsx(TableHead, { children: c.label }, c.key))) }) }), _jsx(TableBody, { children: rows.map((r, i) => (_jsx(TableRow, { children: block.columns.map((c) => (_jsx(TableCell, { className: 'whitespace-normal', children: cell(r[c.key]) }, c.key))) }, i))) })] }) }), _jsx("ul", { className: 'm-0 flex list-none flex-col gap-2 p-0 @md:hidden', children: rows.map((r, i) => (_jsx("li", { className: 'rounded-lg border bg-card p-2.5', children: _jsx(Fields, { fields: block.columns.map((c) => ({ label: c.label, value: cell(r[c.key]) })) }) }, i))) })] }));
|
|
95
|
+
}
|
|
96
|
+
function LinksView({ block, onNavigate }) {
|
|
97
|
+
return (_jsxs("div", { className: 'w-full', children: [block.title ? _jsx("p", { className: 'mb-1 text-xs font-medium text-muted-foreground', children: block.title }) : null, _jsx("ul", { className: 'm-0 flex list-none flex-col divide-y rounded-lg border bg-card p-0', children: block.items.map((it, i) => (_jsxs("li", { className: 'flex flex-col gap-0.5 px-3 py-2', children: [it.url ? (_jsx(SmartLink, { href: it.url, onNavigate: onNavigate, className: 'text-sm font-medium text-primary hover:underline', children: it.title })) : (_jsx("span", { className: 'text-sm font-medium', children: it.title })), it.source || it.date ? (_jsx("span", { className: 'text-xs text-muted-foreground', children: [it.source, it.date].filter(Boolean).join(' · ') })) : null, it.description ? _jsx("span", { className: 'text-xs text-muted-foreground', children: it.description }) : null] }, i))) })] }));
|
|
98
|
+
}
|
|
99
|
+
const DOT = {
|
|
100
|
+
completed: 'bg-[var(--success,oklch(0.6_0.15_155))]',
|
|
101
|
+
skipped: 'bg-muted-foreground',
|
|
102
|
+
failed: 'bg-destructive',
|
|
103
|
+
running: 'bg-[var(--info,oklch(0.62_0.13_235))]',
|
|
104
|
+
};
|
|
105
|
+
function TimelineView({ block, onNavigate }) {
|
|
106
|
+
return (_jsxs("div", { className: 'w-full', children: [block.title ? _jsx("p", { className: 'mb-1 text-xs font-medium text-muted-foreground', children: block.title }) : null, _jsx("ol", { className: 'm-0 flex list-none flex-col gap-3 border-l pl-4', children: block.items.map((it, i) => (_jsxs("li", { className: 'relative', children: [_jsx("span", { className: cn('absolute -left-[1.3rem] top-1.5 size-2.5 rounded-full ring-2 ring-background', DOT[it.status || ''] || 'bg-primary'), "aria-hidden": true }), _jsxs("p", { className: 'm-0 text-sm font-medium', children: [it.url ? (_jsx(SmartLink, { href: it.url, onNavigate: onNavigate, className: 'hover:underline', children: it.title })) : (it.title), it.status ? _jsxs("span", { className: 'sr-only', children: [" (", it.status, ")"] }) : null] }), it.time ? _jsx("p", { className: 'm-0 text-xs text-muted-foreground', children: it.time }) : null, it.description ? _jsx("p", { className: 'm-0 text-xs text-muted-foreground', children: it.description }) : null] }, i))) })] }));
|
|
107
|
+
}
|
|
108
|
+
const SERIES_COLORS = ['var(--chart-1, #102E6B)', 'var(--chart-2, #5D646C)', 'var(--chart-3, #313D4C)', 'var(--chart-4, #051C35)'];
|
|
109
|
+
/** Small dependency-free SVG chart with a mandatory text summary. */
|
|
110
|
+
function ChartView({ block }) {
|
|
111
|
+
const rows = block.rows ?? [];
|
|
112
|
+
const W = 320;
|
|
113
|
+
const H = 140;
|
|
114
|
+
const pad = 20;
|
|
115
|
+
const nums = rows.flatMap((r) => block.series.map((s) => Number(r[s.key]) || 0));
|
|
116
|
+
const max = Math.max(1, ...nums);
|
|
117
|
+
const n = Math.max(1, rows.length);
|
|
118
|
+
const slot = (W - pad * 2) / n;
|
|
119
|
+
const y = (v) => H - pad - (v / max) * (H - pad * 2);
|
|
120
|
+
return (_jsxs("figure", { className: 'm-0 w-full rounded-lg border bg-card p-3', children: [block.title ? _jsx("figcaption", { className: 'mb-1 text-xs font-medium text-muted-foreground', children: block.title }) : null, _jsxs("svg", { viewBox: `0 0 ${W} ${H}`, className: 'h-auto w-full', role: 'img', "aria-label": block.summary, children: [_jsx("line", { x1: pad, y1: H - pad, x2: W - pad, y2: H - pad, stroke: 'currentColor', strokeOpacity: 0.2 }), block.kind === 'bar'
|
|
121
|
+
? rows.map((r, i) => block.series.map((s, j) => {
|
|
122
|
+
const bw = (slot * 0.7) / block.series.length;
|
|
123
|
+
const v = Number(r[s.key]) || 0;
|
|
124
|
+
return (_jsx("rect", { x: pad + i * slot + slot * 0.15 + j * bw, y: y(v), width: Math.max(1, bw - 1), height: H - pad - y(v), fill: SERIES_COLORS[j % 4], rx: 2 }, `${i}-${j}`));
|
|
125
|
+
}))
|
|
126
|
+
: block.series.map((s, j) => (_jsx("polyline", { fill: 'none', stroke: SERIES_COLORS[j % 4], strokeWidth: 2, points: rows.map((r, i) => `${pad + i * slot + slot / 2},${y(Number(r[s.key]) || 0)}`).join(' ') }, s.key))), rows.map((r, i) => (_jsx("text", { x: pad + i * slot + slot / 2, y: H - 6, textAnchor: 'middle', fontSize: 9, fill: 'currentColor', fillOpacity: 0.6, children: cell(r[block.x]) }, i)))] }), _jsx("p", { className: 'm-0 mt-1 text-xs text-muted-foreground', children: block.summary }), block.series.length > 1 ? (_jsx("ul", { className: 'm-0 mt-1 flex list-none flex-wrap gap-3 p-0 text-xs', children: block.series.map((s, j) => (_jsxs("li", { className: 'flex items-center gap-1', children: [_jsx("span", { className: 'inline-block size-2.5 rounded-sm', style: { background: SERIES_COLORS[j % 4] }, "aria-hidden": true }), s.label] }, s.key))) })) : null] }));
|
|
127
|
+
}
|
|
128
|
+
const BUTTON_VARIANT = { primary: 'default', secondary: 'secondary', ghost: 'ghost', danger: 'destructive' };
|
|
129
|
+
function ConfirmView({ block, onAction, onNavigate, busy }) {
|
|
130
|
+
const baseId = useId();
|
|
131
|
+
const [values, setValues] = useState(() => Object.fromEntries((block.inputs ?? []).map((i) => [i.name, i.value ?? (i.kind === 'switch' ? false : '')])));
|
|
132
|
+
const [pending, setPending] = useState(null);
|
|
133
|
+
const [done, setDone] = useState(null);
|
|
134
|
+
const missing = (block.inputs ?? []).some((i) => i.required && (values[i.name] === '' || values[i.name] === null));
|
|
135
|
+
const run = async (id, params = {}) => {
|
|
136
|
+
if (!onAction)
|
|
137
|
+
return;
|
|
138
|
+
setPending(id);
|
|
139
|
+
try {
|
|
140
|
+
await onAction({ id, params, values });
|
|
141
|
+
setDone(id);
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
// The host already reported the failure; keep the actions available.
|
|
145
|
+
}
|
|
146
|
+
finally {
|
|
147
|
+
setPending(null);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
void onNavigate;
|
|
151
|
+
return (_jsxs(Card, { className: 'w-full gap-3 border-primary/30 py-4', role: 'group', "aria-labelledby": `${baseId}-t`, children: [_jsxs(CardHeader, { className: 'px-4', children: [_jsxs(CardTitle, { id: `${baseId}-t`, className: 'flex flex-wrap items-center gap-2 text-sm', children: [block.title, _jsx(Badges, { badges: block.badges })] }), block.description ? _jsx(CardDescription, { className: 'whitespace-pre-line', children: block.description }) : null] }), block.fields?.length || block.inputs?.length ? (_jsxs(CardContent, { className: 'flex flex-col gap-3 px-4', children: [_jsx(Fields, { fields: block.fields }), (block.inputs ?? []).map((inp) => {
|
|
152
|
+
const id = `${baseId}-${inp.name}`;
|
|
153
|
+
const v = values[inp.name];
|
|
154
|
+
const set = (nv) => setValues((p) => ({ ...p, [inp.name]: nv }));
|
|
155
|
+
return (_jsxs("div", { className: 'flex flex-col gap-1', children: [_jsxs(Label, { htmlFor: id, children: [inp.label, inp.required ? _jsx("span", { "aria-hidden": true, children: " *" }) : null] }), inp.kind === 'textarea' ? (_jsx(Textarea, { id: id, value: String(v ?? ''), onChange: (e) => set(e.target.value), required: inp.required })) : inp.kind === 'switch' ? (_jsx(Switch, { id: id, checked: Boolean(v), onCheckedChange: (c) => set(c) })) : inp.kind === 'select' ? (_jsx("select", { id: id, className: 'h-9 rounded-md border bg-background px-2 text-sm focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50', value: String(v ?? ''), onChange: (e) => set(e.target.value), required: inp.required, children: (inp.options ?? []).map((o) => (_jsx("option", { value: o.value, children: o.label }, o.value))) })) : (_jsx(Input, { id: id, type: inp.kind === 'number' ? 'number' : inp.kind === 'time' ? 'time' : inp.kind === 'date' ? 'date' : 'text', value: String(v ?? ''), onChange: (e) => set(inp.kind === 'number' && e.target.value !== '' ? Number(e.target.value) : e.target.value), required: inp.required })), inp.help ? _jsx("p", { className: 'm-0 text-xs text-muted-foreground', children: inp.help }) : null] }, inp.name));
|
|
156
|
+
})] })) : null, _jsxs(CardFooter, { className: 'flex flex-wrap gap-2 px-4', children: [done ? (_jsxs("p", { role: 'status', className: 'm-0 flex items-center gap-1.5 text-sm font-medium text-[var(--success,oklch(0.6_0.15_155))]', children: [_jsx(Check, { className: 'size-4', "aria-hidden": true }), block.actions.find((a) => a.id === done)?.label] })) : null, !done && block.actions.map((a) => (_jsx(Button, { type: 'button', size: 'sm', variant: BUTTON_VARIANT[a.variant || 'secondary'], disabled: busy || pending !== null || !onAction || (a.variant === 'primary' && missing), "aria-busy": pending === a.id, onClick: () => void run(a.id, a.params), children: pending === a.id ? '…' : a.label }, a.id)))] })] }));
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=generative-ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generative-ui.js","sourceRoot":"","sources":["../src/generative-ui.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK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CAAC,OAAO,IAAI,WAAW,CAAC,EACjD,QAAQ,EAAE,IAAI,IAAI,OAAO,KAAK,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,eAC5E,OAAO,KAAK,CAAC,CAAC,EAAE,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,YAEtC,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAR5B,CAAC,CAAC,EAAE,CASF,CACV,CAAC,IACS,IACR,CACR,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/** genui/v1 — the declarative UI contract shared with the Go kernel (package genui). */
|
|
2
|
+
export declare const GENUI_VERSION: "genui/v1";
|
|
3
|
+
export type Tone = 'default' | 'muted' | 'info' | 'success' | 'warning' | 'danger';
|
|
4
|
+
export type Scalar = string | number | boolean | null;
|
|
5
|
+
export interface UIBadge {
|
|
6
|
+
label: string;
|
|
7
|
+
tone?: Tone;
|
|
8
|
+
}
|
|
9
|
+
export interface UIField {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
13
|
+
export interface UIItem {
|
|
14
|
+
label?: string;
|
|
15
|
+
value?: string;
|
|
16
|
+
hint?: string;
|
|
17
|
+
trend?: 'up' | 'down' | 'flat';
|
|
18
|
+
title?: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
source?: string;
|
|
21
|
+
date?: string;
|
|
22
|
+
time?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
status?: string;
|
|
25
|
+
tone?: Tone;
|
|
26
|
+
}
|
|
27
|
+
export interface UIColumn {
|
|
28
|
+
key: string;
|
|
29
|
+
label: string;
|
|
30
|
+
}
|
|
31
|
+
export interface UIOption {
|
|
32
|
+
value: string;
|
|
33
|
+
label: string;
|
|
34
|
+
}
|
|
35
|
+
export interface UIInput {
|
|
36
|
+
name: string;
|
|
37
|
+
label: string;
|
|
38
|
+
kind: 'text' | 'textarea' | 'number' | 'switch' | 'select' | 'time' | 'date';
|
|
39
|
+
value?: Scalar;
|
|
40
|
+
required?: boolean;
|
|
41
|
+
options?: UIOption[];
|
|
42
|
+
help?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface UIAction {
|
|
45
|
+
id: string;
|
|
46
|
+
label: string;
|
|
47
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
48
|
+
params?: Record<string, Scalar>;
|
|
49
|
+
}
|
|
50
|
+
interface BlockBase {
|
|
51
|
+
title?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface TextBlock {
|
|
54
|
+
type: 'text';
|
|
55
|
+
text: string;
|
|
56
|
+
tone?: Tone;
|
|
57
|
+
}
|
|
58
|
+
export interface KPIBlock extends BlockBase {
|
|
59
|
+
type: 'kpi';
|
|
60
|
+
items: UIItem[];
|
|
61
|
+
}
|
|
62
|
+
export interface CardBlock extends BlockBase {
|
|
63
|
+
type: 'card';
|
|
64
|
+
title: string;
|
|
65
|
+
subtitle?: string;
|
|
66
|
+
body?: string;
|
|
67
|
+
badges?: UIBadge[];
|
|
68
|
+
fields?: UIField[];
|
|
69
|
+
link?: string;
|
|
70
|
+
tone?: Tone;
|
|
71
|
+
}
|
|
72
|
+
export interface TableBlock extends BlockBase {
|
|
73
|
+
type: 'table';
|
|
74
|
+
columns: UIColumn[];
|
|
75
|
+
rows?: Record<string, Scalar>[];
|
|
76
|
+
caption?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface LinksBlock extends BlockBase {
|
|
79
|
+
type: 'links';
|
|
80
|
+
items: UIItem[];
|
|
81
|
+
}
|
|
82
|
+
export interface TimelineBlock extends BlockBase {
|
|
83
|
+
type: 'timeline';
|
|
84
|
+
items: UIItem[];
|
|
85
|
+
}
|
|
86
|
+
export interface ChartBlock extends BlockBase {
|
|
87
|
+
type: 'chart';
|
|
88
|
+
kind: 'bar' | 'line';
|
|
89
|
+
x: string;
|
|
90
|
+
series: UIColumn[];
|
|
91
|
+
rows?: Record<string, Scalar>[];
|
|
92
|
+
summary: string;
|
|
93
|
+
caption?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface ConfirmBlock extends BlockBase {
|
|
96
|
+
type: 'confirm';
|
|
97
|
+
title: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
fields?: UIField[];
|
|
100
|
+
inputs?: UIInput[];
|
|
101
|
+
actions: UIAction[];
|
|
102
|
+
badges?: UIBadge[];
|
|
103
|
+
tone?: Tone;
|
|
104
|
+
}
|
|
105
|
+
export type UIBlock = TextBlock | KPIBlock | CardBlock | TableBlock | LinksBlock | TimelineBlock | ChartBlock | ConfirmBlock;
|
|
106
|
+
export interface UISpec {
|
|
107
|
+
version: typeof GENUI_VERSION;
|
|
108
|
+
title?: string;
|
|
109
|
+
blocks: UIBlock[];
|
|
110
|
+
}
|
|
111
|
+
/** What the renderer hands to the host when a declared action is pressed. */
|
|
112
|
+
export interface UIActionEvent {
|
|
113
|
+
id: string;
|
|
114
|
+
params: Record<string, Scalar>;
|
|
115
|
+
/** Current values of the confirm block inputs (if any). */
|
|
116
|
+
values: Record<string, Scalar>;
|
|
117
|
+
}
|
|
118
|
+
export type UIActionHandler = (event: UIActionEvent) => void | Promise<void>;
|
|
119
|
+
export {};
|
|
120
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,eAAO,MAAM,aAAa,EAAG,UAAmB,CAAA;AAEhD,MAAM,MAAM,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAA;AAClF,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AAErD,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ;AACD,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AACD,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ;AACD,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,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AU,GAAG,aAAa,GAAG,UAAU,GAAG,YAAY,CAAA;AAE5H,MAAM,WAAW,MAAM;IACrB,OAAO,EAAE,OAAO,aAAa,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,OAAO,EAAE,CAAA;CAClB;AAED,6EAA6E;AAC7E,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,CAAC,MAAM,aAAa,GAAG,UAAmB,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type UISpec } from './types';
|
|
2
|
+
/** Limits mirror the Go validator (kernel package genui). */
|
|
3
|
+
export declare const GENUI_LIMITS: {
|
|
4
|
+
readonly blocks: 12;
|
|
5
|
+
readonly items: 50;
|
|
6
|
+
readonly columns: 8;
|
|
7
|
+
readonly fields: 12;
|
|
8
|
+
readonly actions: 4;
|
|
9
|
+
readonly text: 2000;
|
|
10
|
+
readonly label: 160;
|
|
11
|
+
readonly bytes: number;
|
|
12
|
+
};
|
|
13
|
+
export type ParseResult = {
|
|
14
|
+
ok: true;
|
|
15
|
+
spec: UISpec;
|
|
16
|
+
} | {
|
|
17
|
+
ok: false;
|
|
18
|
+
error: string;
|
|
19
|
+
};
|
|
20
|
+
/** True for '', app-relative paths ('/m/x', not '//host') and http(s) URLs. */
|
|
21
|
+
export declare function isSafeLink(link: unknown): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Strictly validates an untrusted value (an agent embed) as a genui/v1 spec.
|
|
24
|
+
* Never throws; an invalid spec is reported and must not be rendered.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseUISpec(value: unknown): ParseResult;
|
|
27
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAEpD,6DAA6D;AAC7D,eAAO,MAAM,YAAY;;;;;;;;;CASf,CAAA;AAoBV,MAAM,MAAM,WAAW,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAoBnF,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAUjD;AAwID;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAmBvD"}
|
package/dist/validate.js
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { GENUI_VERSION } from './types';
|
|
2
|
+
/** Limits mirror the Go validator (kernel package genui). */
|
|
3
|
+
export const GENUI_LIMITS = {
|
|
4
|
+
blocks: 12,
|
|
5
|
+
items: 50,
|
|
6
|
+
columns: 8,
|
|
7
|
+
fields: 12,
|
|
8
|
+
actions: 4,
|
|
9
|
+
text: 2000,
|
|
10
|
+
label: 160,
|
|
11
|
+
bytes: 64 * 1024,
|
|
12
|
+
};
|
|
13
|
+
const ACTION_ID = /^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*){1,3}$/;
|
|
14
|
+
const KEY = /^[A-Za-z_][A-Za-z0-9_.]{0,63}$/;
|
|
15
|
+
const TONES = new Set(['', 'default', 'muted', 'info', 'success', 'warning', 'danger']);
|
|
16
|
+
const TRENDS = new Set(['', 'up', 'down', 'flat']);
|
|
17
|
+
const VARIANTS = new Set(['', 'primary', 'secondary', 'ghost', 'danger']);
|
|
18
|
+
const INPUT_KINDS = new Set(['text', 'textarea', 'number', 'switch', 'select', 'time', 'date']);
|
|
19
|
+
const ALLOWED = {
|
|
20
|
+
text: ['type', 'text', 'tone'],
|
|
21
|
+
kpi: ['type', 'items', 'title'],
|
|
22
|
+
card: ['type', 'title', 'subtitle', 'body', 'badges', 'fields', 'link', 'tone'],
|
|
23
|
+
table: ['type', 'title', 'columns', 'rows', 'caption'],
|
|
24
|
+
links: ['type', 'title', 'items'],
|
|
25
|
+
timeline: ['type', 'title', 'items'],
|
|
26
|
+
chart: ['type', 'title', 'kind', 'x', 'series', 'rows', 'summary', 'caption'],
|
|
27
|
+
confirm: ['type', 'title', 'description', 'fields', 'inputs', 'actions', 'badges', 'tone'],
|
|
28
|
+
};
|
|
29
|
+
class Invalid extends Error {
|
|
30
|
+
}
|
|
31
|
+
const fail = (msg) => {
|
|
32
|
+
throw new Invalid(msg);
|
|
33
|
+
};
|
|
34
|
+
const isObj = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
35
|
+
const isScalar = (v) => v === null || v === undefined || ['string', 'number', 'boolean'].includes(typeof v);
|
|
36
|
+
function str(v, name, max, required = false) {
|
|
37
|
+
if (v === undefined || v === null || v === '') {
|
|
38
|
+
if (required)
|
|
39
|
+
fail(`${name} required`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (typeof v !== 'string')
|
|
43
|
+
fail(`${name} must be text`);
|
|
44
|
+
if (v.length > max)
|
|
45
|
+
fail(`${name} exceeds ${max} characters`);
|
|
46
|
+
}
|
|
47
|
+
/** True for '', app-relative paths ('/m/x', not '//host') and http(s) URLs. */
|
|
48
|
+
export function isSafeLink(link) {
|
|
49
|
+
if (link === undefined || link === null || link === '')
|
|
50
|
+
return true;
|
|
51
|
+
if (typeof link !== 'string' || link.length > 2048)
|
|
52
|
+
return false;
|
|
53
|
+
if (link.startsWith('/') && !link.startsWith('//') && !/[\\\n\r\t]/.test(link))
|
|
54
|
+
return true;
|
|
55
|
+
try {
|
|
56
|
+
const u = new URL(link);
|
|
57
|
+
return (u.protocol === 'http:' || u.protocol === 'https:') && !!u.host;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function list(v, name, max, min = 0) {
|
|
64
|
+
if (v === undefined) {
|
|
65
|
+
if (min > 0)
|
|
66
|
+
fail(`${name} required`);
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
if (!Array.isArray(v))
|
|
70
|
+
fail(`${name} must be a list`);
|
|
71
|
+
const arr = v;
|
|
72
|
+
if (arr.length < min || arr.length > max)
|
|
73
|
+
fail(`${name}: ${min}..${max} entries`);
|
|
74
|
+
return arr;
|
|
75
|
+
}
|
|
76
|
+
function tone(v) {
|
|
77
|
+
if (v !== undefined && !TONES.has(String(v)))
|
|
78
|
+
fail(`unknown tone ${String(v)}`);
|
|
79
|
+
}
|
|
80
|
+
function rows(v) {
|
|
81
|
+
for (const r of list(v, 'rows', GENUI_LIMITS.items)) {
|
|
82
|
+
if (!isObj(r))
|
|
83
|
+
fail('row must be an object');
|
|
84
|
+
const entries = Object.entries(r);
|
|
85
|
+
if (entries.length > 16)
|
|
86
|
+
fail('row has too many cells');
|
|
87
|
+
for (const [k, c] of entries) {
|
|
88
|
+
if (!KEY.test(k) || !isScalar(c))
|
|
89
|
+
fail(`cell ${k} must be a scalar`);
|
|
90
|
+
if (typeof c === 'string' && c.length > GENUI_LIMITS.text)
|
|
91
|
+
fail(`cell ${k} too long`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function columns(v, max) {
|
|
96
|
+
for (const c of list(v, 'columns', max, 1)) {
|
|
97
|
+
if (!isObj(c) || typeof c.key !== 'string' || !KEY.test(c.key))
|
|
98
|
+
fail('invalid column');
|
|
99
|
+
str(c.label, 'column label', GENUI_LIMITS.label, true);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function items(v, kind) {
|
|
103
|
+
const max = kind === 'kpi' ? GENUI_LIMITS.fields : GENUI_LIMITS.items;
|
|
104
|
+
for (const raw of list(v, 'items', max, 1)) {
|
|
105
|
+
if (!isObj(raw))
|
|
106
|
+
fail('item must be an object');
|
|
107
|
+
const it = raw;
|
|
108
|
+
for (const k of ['label', 'value', 'hint', 'title', 'source', 'date', 'time', 'status'])
|
|
109
|
+
str(it[k], k, GENUI_LIMITS.label);
|
|
110
|
+
str(it.description, 'description', GENUI_LIMITS.text);
|
|
111
|
+
tone(it.tone);
|
|
112
|
+
if (it.trend !== undefined && !TRENDS.has(String(it.trend)))
|
|
113
|
+
fail('unknown trend');
|
|
114
|
+
if (kind === 'kpi' && (!it.label || !it.value))
|
|
115
|
+
fail('kpi items need label and value');
|
|
116
|
+
if (kind !== 'kpi' && !it.title)
|
|
117
|
+
fail(`${kind} item needs a title`);
|
|
118
|
+
if (!isSafeLink(it.url))
|
|
119
|
+
fail(`unsafe link ${String(it.url)}`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function block(raw, i) {
|
|
123
|
+
if (!isObj(raw))
|
|
124
|
+
fail(`block ${i} must be an object`);
|
|
125
|
+
const b = raw;
|
|
126
|
+
const type = String(b.type);
|
|
127
|
+
const allowed = ALLOWED[type];
|
|
128
|
+
if (!allowed)
|
|
129
|
+
fail(`block ${i}: unknown type ${type}`);
|
|
130
|
+
for (const k of Object.keys(b)) {
|
|
131
|
+
const v = b[k];
|
|
132
|
+
const empty = v === undefined || v === null || v === '' || (Array.isArray(v) && v.length === 0);
|
|
133
|
+
if (!empty && !allowed.includes(k))
|
|
134
|
+
fail(`block ${i} (${type}): field ${k} not allowed`);
|
|
135
|
+
}
|
|
136
|
+
tone(b.tone);
|
|
137
|
+
str(b.title, 'title', GENUI_LIMITS.label);
|
|
138
|
+
str(b.subtitle, 'subtitle', GENUI_LIMITS.label);
|
|
139
|
+
str(b.caption, 'caption', GENUI_LIMITS.label);
|
|
140
|
+
for (const k of ['text', 'body', 'summary', 'description'])
|
|
141
|
+
str(b[k], k, GENUI_LIMITS.text);
|
|
142
|
+
if (!isSafeLink(b.link))
|
|
143
|
+
fail(`unsafe link ${String(b.link)}`);
|
|
144
|
+
for (const bd of list(b.badges, 'badges', 6)) {
|
|
145
|
+
if (!isObj(bd))
|
|
146
|
+
fail('invalid badge');
|
|
147
|
+
str(bd.label, 'badge', 60, true);
|
|
148
|
+
tone(bd.tone);
|
|
149
|
+
}
|
|
150
|
+
for (const f of list(b.fields, 'fields', GENUI_LIMITS.fields)) {
|
|
151
|
+
if (!isObj(f))
|
|
152
|
+
fail('invalid field');
|
|
153
|
+
str(f.label, 'field label', GENUI_LIMITS.label, true);
|
|
154
|
+
str(f.value, 'field value', GENUI_LIMITS.text);
|
|
155
|
+
}
|
|
156
|
+
switch (type) {
|
|
157
|
+
case 'text':
|
|
158
|
+
str(b.text, 'text', GENUI_LIMITS.text, true);
|
|
159
|
+
break;
|
|
160
|
+
case 'card':
|
|
161
|
+
str(b.title, 'title', GENUI_LIMITS.label, true);
|
|
162
|
+
break;
|
|
163
|
+
case 'kpi':
|
|
164
|
+
case 'links':
|
|
165
|
+
case 'timeline':
|
|
166
|
+
items(b.items, type);
|
|
167
|
+
break;
|
|
168
|
+
case 'table':
|
|
169
|
+
columns(b.columns, GENUI_LIMITS.columns);
|
|
170
|
+
rows(b.rows);
|
|
171
|
+
break;
|
|
172
|
+
case 'chart':
|
|
173
|
+
if (b.kind !== 'bar' && b.kind !== 'line')
|
|
174
|
+
fail('chart kind must be bar or line');
|
|
175
|
+
if (typeof b.x !== 'string' || !KEY.test(b.x))
|
|
176
|
+
fail('chart x key invalid');
|
|
177
|
+
columns(b.series, 4);
|
|
178
|
+
rows(b.rows);
|
|
179
|
+
str(b.summary, 'summary (accessible text)', GENUI_LIMITS.text, true);
|
|
180
|
+
break;
|
|
181
|
+
case 'confirm': {
|
|
182
|
+
str(b.title, 'title', GENUI_LIMITS.label, true);
|
|
183
|
+
for (const raw of list(b.inputs, 'inputs', GENUI_LIMITS.fields)) {
|
|
184
|
+
if (!isObj(raw))
|
|
185
|
+
fail('invalid input');
|
|
186
|
+
const inp = raw;
|
|
187
|
+
if (typeof inp.name !== 'string' || !KEY.test(inp.name))
|
|
188
|
+
fail('invalid input name');
|
|
189
|
+
str(inp.label, 'input label', GENUI_LIMITS.label, true);
|
|
190
|
+
str(inp.help, 'input help', GENUI_LIMITS.label);
|
|
191
|
+
if (!INPUT_KINDS.has(String(inp.kind)))
|
|
192
|
+
fail(`invalid input kind ${String(inp.kind)}`);
|
|
193
|
+
if (!isScalar(inp.value))
|
|
194
|
+
fail('input value must be scalar');
|
|
195
|
+
const opts = list(inp.options, 'options', 30);
|
|
196
|
+
if (inp.kind === 'select' && opts.length === 0)
|
|
197
|
+
fail('select needs options');
|
|
198
|
+
if (inp.kind !== 'select' && opts.length > 0)
|
|
199
|
+
fail('options only for select');
|
|
200
|
+
}
|
|
201
|
+
for (const raw of list(b.actions, 'actions', GENUI_LIMITS.actions, 1)) {
|
|
202
|
+
if (!isObj(raw))
|
|
203
|
+
fail('invalid action');
|
|
204
|
+
const a = raw;
|
|
205
|
+
if (typeof a.id !== 'string' || !ACTION_ID.test(a.id))
|
|
206
|
+
fail(`invalid action id ${String(a.id)}`);
|
|
207
|
+
str(a.label, 'action label', 60, true);
|
|
208
|
+
if (a.variant !== undefined && !VARIANTS.has(String(a.variant)))
|
|
209
|
+
fail('invalid action variant');
|
|
210
|
+
if (a.params !== undefined) {
|
|
211
|
+
if (!isObj(a.params))
|
|
212
|
+
fail('action params must be an object');
|
|
213
|
+
const ps = Object.entries(a.params);
|
|
214
|
+
if (ps.length > 8)
|
|
215
|
+
fail('too many params');
|
|
216
|
+
for (const [k, v] of ps) {
|
|
217
|
+
if (!KEY.test(k) || !isScalar(v))
|
|
218
|
+
fail(`param ${k} must be a scalar`);
|
|
219
|
+
if (typeof v === 'string' && v.length > GENUI_LIMITS.label)
|
|
220
|
+
fail(`param ${k} too long`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Strictly validates an untrusted value (an agent embed) as a genui/v1 spec.
|
|
230
|
+
* Never throws; an invalid spec is reported and must not be rendered.
|
|
231
|
+
*/
|
|
232
|
+
export function parseUISpec(value) {
|
|
233
|
+
try {
|
|
234
|
+
let v = value;
|
|
235
|
+
if (typeof v === 'string') {
|
|
236
|
+
if (v.length > GENUI_LIMITS.bytes)
|
|
237
|
+
fail('spec too large');
|
|
238
|
+
v = JSON.parse(v);
|
|
239
|
+
}
|
|
240
|
+
else if (JSON.stringify(v ?? null).length > GENUI_LIMITS.bytes) {
|
|
241
|
+
fail('spec too large');
|
|
242
|
+
}
|
|
243
|
+
if (!isObj(v))
|
|
244
|
+
fail('spec must be an object');
|
|
245
|
+
const s = v;
|
|
246
|
+
for (const k of Object.keys(s))
|
|
247
|
+
if (!['version', 'title', 'blocks'].includes(k))
|
|
248
|
+
fail(`unknown field ${k}`);
|
|
249
|
+
if (s.version !== GENUI_VERSION)
|
|
250
|
+
fail(`version must be ${GENUI_VERSION}`);
|
|
251
|
+
str(s.title, 'title', GENUI_LIMITS.label);
|
|
252
|
+
list(s.blocks, 'blocks', GENUI_LIMITS.blocks, 1).forEach(block);
|
|
253
|
+
return { ok: true, spec: s };
|
|
254
|
+
}
|
|
255
|
+
catch (e) {
|
|
256
|
+
return { ok: false, error: e instanceof Error ? e.message : String(e) };
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","s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G,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,CAAA;QACzC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAC/D,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAsB,EAAE,CAAA;IACnD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;IACzE,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asteby/metacore-genui",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Metacore generative UI - validates and renders the agent's declarative genui/v1 specs (cards, KPIs, tables, links, timelines, charts, confirmation forms) from a closed whitelist, with no HTML or scripts.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/asteby/metacore-sdk",
|
|
9
|
+
"directory": "packages/genui"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@asteby/metacore-ui": ">=2.28.0",
|
|
26
|
+
"react": ">=18",
|
|
27
|
+
"react-dom": ">=18",
|
|
28
|
+
"lucide-react": ">=0.460"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@asteby/metacore-ui": "2.28.0",
|
|
32
|
+
"@testing-library/react": "^16.3.2",
|
|
33
|
+
"@types/react": "^19.0.0",
|
|
34
|
+
"@types/react-dom": "^19.0.0",
|
|
35
|
+
"happy-dom": "^20.10.2",
|
|
36
|
+
"react": "^19.2.4",
|
|
37
|
+
"react-dom": "^19.2.4",
|
|
38
|
+
"typescript": "^6.0.0",
|
|
39
|
+
"vitest": "^4.0.0",
|
|
40
|
+
"lucide-react": "^1.0.0"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsc -p tsconfig.json",
|
|
47
|
+
"dev": "tsc -w -p tsconfig.json",
|
|
48
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
49
|
+
"clean": "rm -rf dist",
|
|
50
|
+
"test": "vitest run"
|
|
51
|
+
}
|
|
6
52
|
}
|