@k8o/arte-odyssey 10.1.1 → 10.2.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/README.md +63 -20
- package/dist/components/form/checkbox-group/index.d.mts +3 -3
- package/dist/components/form/slider/slider.mjs +1 -1
- package/dist/components/icons/index.d.mts +2 -2
- package/dist/components/icons/index.mjs +2 -2
- package/dist/components/icons/lucide.d.mts +4 -1
- package/dist/components/icons/lucide.mjs +14 -2
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/integrations/_shared/openui-defs.d.mts +19 -0
- package/dist/integrations/_shared/openui-defs.mjs +159 -0
- package/dist/integrations/_shared/schemas.d.mts +3 -3
- package/dist/integrations/json-render/catalog.d.mts +393 -317
- package/dist/integrations/json-render/catalog.mjs +75 -2
- package/dist/integrations/json-render/registry.d.mts +27 -1
- package/dist/integrations/json-render/registry.mjs +26 -2
- package/dist/integrations/openui/library.d.mts +205 -1
- package/dist/integrations/openui/library.mjs +60 -416
- package/dist/integrations/openui/prompt.d.mts +6 -0
- package/dist/integrations/openui/prompt.mjs +19 -0
- package/docs/GUIDE.md +1 -0
- package/docs/llms.txt +23 -0
- package/docs/references/generative-ui.md +112 -0
- package/package.json +20 -2
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Spec, UIElement } from "@json-render/core";
|
|
3
|
+
|
|
1
4
|
//#region src/integrations/json-render/catalog.d.ts
|
|
2
5
|
/**
|
|
3
6
|
* `@k8o/arte-odyssey/json-render`(サーバー安全)
|
|
@@ -33,125 +36,125 @@ declare const catalog: import("@json-render/core").Catalog<{
|
|
|
33
36
|
}, {
|
|
34
37
|
components: {
|
|
35
38
|
Stack: {
|
|
36
|
-
props:
|
|
37
|
-
direction:
|
|
39
|
+
props: z.ZodObject<{
|
|
40
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
38
41
|
row: "row";
|
|
39
42
|
column: "column";
|
|
40
43
|
}>>;
|
|
41
|
-
gap:
|
|
44
|
+
gap: z.ZodOptional<z.ZodEnum<{
|
|
45
|
+
none: "none";
|
|
42
46
|
sm: "sm";
|
|
43
47
|
md: "md";
|
|
44
48
|
lg: "lg";
|
|
45
|
-
none: "none";
|
|
46
49
|
xl: "xl";
|
|
47
50
|
}>>;
|
|
48
|
-
padding:
|
|
51
|
+
padding: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
none: "none";
|
|
49
53
|
sm: "sm";
|
|
50
54
|
md: "md";
|
|
51
55
|
lg: "lg";
|
|
52
|
-
none: "none";
|
|
53
56
|
xl: "xl";
|
|
54
57
|
}>>;
|
|
55
|
-
align:
|
|
58
|
+
align: z.ZodOptional<z.ZodEnum<{
|
|
56
59
|
start: "start";
|
|
57
60
|
end: "end";
|
|
58
61
|
stretch: "stretch";
|
|
59
62
|
center: "center";
|
|
60
63
|
}>>;
|
|
61
|
-
justify:
|
|
64
|
+
justify: z.ZodOptional<z.ZodEnum<{
|
|
62
65
|
start: "start";
|
|
63
66
|
end: "end";
|
|
64
67
|
center: "center";
|
|
65
68
|
between: "between";
|
|
66
69
|
}>>;
|
|
67
|
-
},
|
|
70
|
+
}, z.core.$strip>;
|
|
68
71
|
slots: string[];
|
|
69
72
|
description: string;
|
|
70
73
|
};
|
|
71
74
|
Grid: {
|
|
72
|
-
props:
|
|
73
|
-
cols:
|
|
74
|
-
minItemSize:
|
|
75
|
-
gap:
|
|
75
|
+
props: z.ZodObject<{
|
|
76
|
+
cols: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<"auto-fill">, z.ZodLiteral<"auto-fit">]>>;
|
|
77
|
+
minItemSize: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<24>, z.ZodLiteral<32>, z.ZodLiteral<40>, z.ZodLiteral<48>, z.ZodLiteral<64>, z.ZodLiteral<80>]>>;
|
|
78
|
+
gap: z.ZodOptional<z.ZodEnum<{
|
|
79
|
+
none: "none";
|
|
76
80
|
sm: "sm";
|
|
77
81
|
md: "md";
|
|
78
82
|
lg: "lg";
|
|
79
|
-
none: "none";
|
|
80
83
|
xl: "xl";
|
|
81
84
|
}>>;
|
|
82
|
-
},
|
|
85
|
+
}, z.core.$strip>;
|
|
83
86
|
slots: string[];
|
|
84
87
|
description: string;
|
|
85
88
|
};
|
|
86
89
|
Button: {
|
|
87
|
-
props:
|
|
88
|
-
label:
|
|
89
|
-
variant:
|
|
90
|
+
props: z.ZodObject<{
|
|
91
|
+
label: z.ZodString;
|
|
92
|
+
variant: z.ZodOptional<z.ZodEnum<{
|
|
90
93
|
solid: "solid";
|
|
91
94
|
outline: "outline";
|
|
92
95
|
skeleton: "skeleton";
|
|
93
96
|
}>>;
|
|
94
|
-
color:
|
|
97
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
95
98
|
primary: "primary";
|
|
96
99
|
secondary: "secondary";
|
|
97
100
|
gray: "gray";
|
|
98
101
|
}>>;
|
|
99
|
-
size:
|
|
102
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
100
103
|
sm: "sm";
|
|
101
104
|
md: "md";
|
|
102
105
|
lg: "lg";
|
|
103
106
|
}>>;
|
|
104
|
-
fullWidth:
|
|
105
|
-
href:
|
|
106
|
-
},
|
|
107
|
+
fullWidth: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
href: z.ZodOptional<z.ZodString>;
|
|
109
|
+
}, z.core.$strip>;
|
|
107
110
|
description: string;
|
|
108
111
|
};
|
|
109
112
|
Card: {
|
|
110
|
-
props:
|
|
111
|
-
width:
|
|
113
|
+
props: z.ZodObject<{
|
|
114
|
+
width: z.ZodOptional<z.ZodEnum<{
|
|
112
115
|
full: "full";
|
|
113
116
|
fit: "fit";
|
|
114
117
|
}>>;
|
|
115
|
-
appearance:
|
|
118
|
+
appearance: z.ZodOptional<z.ZodEnum<{
|
|
116
119
|
shadow: "shadow";
|
|
117
120
|
bordered: "bordered";
|
|
118
121
|
}>>;
|
|
119
|
-
interactive:
|
|
120
|
-
size:
|
|
122
|
+
interactive: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
121
124
|
sm: "sm";
|
|
122
125
|
md: "md";
|
|
123
126
|
lg: "lg";
|
|
124
127
|
}>>;
|
|
125
|
-
},
|
|
128
|
+
}, z.core.$strip>;
|
|
126
129
|
slots: string[];
|
|
127
130
|
description: string;
|
|
128
131
|
};
|
|
129
132
|
Badge: {
|
|
130
|
-
props:
|
|
131
|
-
text:
|
|
132
|
-
tone:
|
|
133
|
+
props: z.ZodObject<{
|
|
134
|
+
text: z.ZodString;
|
|
135
|
+
tone: z.ZodOptional<z.ZodEnum<{
|
|
133
136
|
success: "success";
|
|
134
137
|
info: "info";
|
|
135
138
|
warning: "warning";
|
|
136
139
|
error: "error";
|
|
137
140
|
neutral: "neutral";
|
|
138
141
|
}>>;
|
|
139
|
-
variant:
|
|
142
|
+
variant: z.ZodOptional<z.ZodEnum<{
|
|
140
143
|
solid: "solid";
|
|
141
144
|
outline: "outline";
|
|
142
145
|
}>>;
|
|
143
|
-
size:
|
|
146
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
144
147
|
sm: "sm";
|
|
145
148
|
md: "md";
|
|
146
149
|
lg: "lg";
|
|
147
150
|
}>>;
|
|
148
|
-
},
|
|
151
|
+
}, z.core.$strip>;
|
|
149
152
|
description: string;
|
|
150
153
|
};
|
|
151
154
|
Heading: {
|
|
152
|
-
props:
|
|
153
|
-
text:
|
|
154
|
-
level:
|
|
155
|
+
props: z.ZodObject<{
|
|
156
|
+
text: z.ZodString;
|
|
157
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
155
158
|
h1: "h1";
|
|
156
159
|
h2: "h2";
|
|
157
160
|
h3: "h3";
|
|
@@ -159,196 +162,196 @@ declare const catalog: import("@json-render/core").Catalog<{
|
|
|
159
162
|
h5: "h5";
|
|
160
163
|
h6: "h6";
|
|
161
164
|
}>>;
|
|
162
|
-
lineClamp:
|
|
163
|
-
},
|
|
165
|
+
lineClamp: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
}, z.core.$strip>;
|
|
164
167
|
description: string;
|
|
165
168
|
};
|
|
166
169
|
Alert: {
|
|
167
|
-
props:
|
|
168
|
-
tone:
|
|
170
|
+
props: z.ZodObject<{
|
|
171
|
+
tone: z.ZodEnum<{
|
|
169
172
|
success: "success";
|
|
170
173
|
info: "info";
|
|
171
174
|
warning: "warning";
|
|
172
175
|
error: "error";
|
|
173
176
|
}>;
|
|
174
|
-
message:
|
|
175
|
-
},
|
|
177
|
+
message: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
178
|
+
}, z.core.$strip>;
|
|
176
179
|
description: string;
|
|
177
180
|
};
|
|
178
181
|
Spinner: {
|
|
179
|
-
props:
|
|
180
|
-
label:
|
|
181
|
-
size:
|
|
182
|
+
props: z.ZodObject<{
|
|
183
|
+
label: z.ZodOptional<z.ZodString>;
|
|
184
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
182
185
|
sm: "sm";
|
|
183
186
|
md: "md";
|
|
184
187
|
lg: "lg";
|
|
185
188
|
}>>;
|
|
186
|
-
},
|
|
189
|
+
}, z.core.$strip>;
|
|
187
190
|
description: string;
|
|
188
191
|
};
|
|
189
192
|
Separator: {
|
|
190
|
-
props:
|
|
191
|
-
orientation:
|
|
193
|
+
props: z.ZodObject<{
|
|
194
|
+
orientation: z.ZodOptional<z.ZodEnum<{
|
|
192
195
|
horizontal: "horizontal";
|
|
193
196
|
vertical: "vertical";
|
|
194
197
|
}>>;
|
|
195
|
-
color:
|
|
198
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
196
199
|
base: "base";
|
|
197
200
|
mute: "mute";
|
|
198
201
|
subtle: "subtle";
|
|
199
202
|
}>>;
|
|
200
|
-
},
|
|
203
|
+
}, z.core.$strip>;
|
|
201
204
|
description: string;
|
|
202
205
|
};
|
|
203
206
|
TextField: {
|
|
204
|
-
props:
|
|
205
|
-
name:
|
|
206
|
-
placeholder:
|
|
207
|
-
defaultValue:
|
|
208
|
-
invalid:
|
|
209
|
-
disabled:
|
|
210
|
-
readOnly:
|
|
211
|
-
},
|
|
207
|
+
props: z.ZodObject<{
|
|
208
|
+
name: z.ZodString;
|
|
209
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
210
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
211
|
+
invalid: z.ZodOptional<z.ZodBoolean>;
|
|
212
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
213
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
214
|
+
}, z.core.$strip>;
|
|
212
215
|
description: string;
|
|
213
216
|
};
|
|
214
217
|
Checkbox: {
|
|
215
|
-
props:
|
|
216
|
-
name:
|
|
217
|
-
label:
|
|
218
|
-
defaultChecked:
|
|
219
|
-
disabled:
|
|
220
|
-
},
|
|
218
|
+
props: z.ZodObject<{
|
|
219
|
+
name: z.ZodString;
|
|
220
|
+
label: z.ZodString;
|
|
221
|
+
defaultChecked: z.ZodOptional<z.ZodBoolean>;
|
|
222
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
223
|
+
}, z.core.$strip>;
|
|
221
224
|
description: string;
|
|
222
225
|
};
|
|
223
226
|
Switch: {
|
|
224
|
-
props:
|
|
225
|
-
name:
|
|
226
|
-
label:
|
|
227
|
-
defaultChecked:
|
|
228
|
-
disabled:
|
|
229
|
-
invalid:
|
|
230
|
-
required:
|
|
231
|
-
},
|
|
227
|
+
props: z.ZodObject<{
|
|
228
|
+
name: z.ZodString;
|
|
229
|
+
label: z.ZodString;
|
|
230
|
+
defaultChecked: z.ZodOptional<z.ZodBoolean>;
|
|
231
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
232
|
+
invalid: z.ZodOptional<z.ZodBoolean>;
|
|
233
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
}, z.core.$strip>;
|
|
232
235
|
description: string;
|
|
233
236
|
};
|
|
234
237
|
Select: {
|
|
235
|
-
props:
|
|
236
|
-
name:
|
|
237
|
-
options:
|
|
238
|
-
value:
|
|
239
|
-
label:
|
|
240
|
-
},
|
|
241
|
-
defaultValue:
|
|
242
|
-
invalid:
|
|
243
|
-
disabled:
|
|
244
|
-
},
|
|
238
|
+
props: z.ZodObject<{
|
|
239
|
+
name: z.ZodString;
|
|
240
|
+
options: z.ZodArray<z.ZodObject<{
|
|
241
|
+
value: z.ZodString;
|
|
242
|
+
label: z.ZodString;
|
|
243
|
+
}, z.core.$strip>>;
|
|
244
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
245
|
+
invalid: z.ZodOptional<z.ZodBoolean>;
|
|
246
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
247
|
+
}, z.core.$strip>;
|
|
245
248
|
description: string;
|
|
246
249
|
};
|
|
247
250
|
Tabs: {
|
|
248
|
-
props:
|
|
249
|
-
label:
|
|
250
|
-
tabs:
|
|
251
|
-
label:
|
|
252
|
-
content:
|
|
253
|
-
},
|
|
254
|
-
},
|
|
251
|
+
props: z.ZodObject<{
|
|
252
|
+
label: z.ZodOptional<z.ZodString>;
|
|
253
|
+
tabs: z.ZodArray<z.ZodObject<{
|
|
254
|
+
label: z.ZodString;
|
|
255
|
+
content: z.ZodString;
|
|
256
|
+
}, z.core.$strip>>;
|
|
257
|
+
}, z.core.$strip>;
|
|
255
258
|
description: string;
|
|
256
259
|
};
|
|
257
260
|
Accordion: {
|
|
258
|
-
props:
|
|
259
|
-
items:
|
|
260
|
-
title:
|
|
261
|
-
content:
|
|
262
|
-
defaultOpen:
|
|
263
|
-
},
|
|
264
|
-
},
|
|
261
|
+
props: z.ZodObject<{
|
|
262
|
+
items: z.ZodArray<z.ZodObject<{
|
|
263
|
+
title: z.ZodString;
|
|
264
|
+
content: z.ZodString;
|
|
265
|
+
defaultOpen: z.ZodOptional<z.ZodBoolean>;
|
|
266
|
+
}, z.core.$strip>>;
|
|
267
|
+
}, z.core.$strip>;
|
|
265
268
|
description: string;
|
|
266
269
|
};
|
|
267
270
|
Breadcrumb: {
|
|
268
|
-
props:
|
|
269
|
-
size:
|
|
271
|
+
props: z.ZodObject<{
|
|
272
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
270
273
|
sm: "sm";
|
|
271
274
|
md: "md";
|
|
272
275
|
lg: "lg";
|
|
273
276
|
}>>;
|
|
274
|
-
items:
|
|
275
|
-
label:
|
|
276
|
-
href:
|
|
277
|
-
current:
|
|
278
|
-
},
|
|
279
|
-
},
|
|
277
|
+
items: z.ZodArray<z.ZodObject<{
|
|
278
|
+
label: z.ZodString;
|
|
279
|
+
href: z.ZodOptional<z.ZodString>;
|
|
280
|
+
current: z.ZodOptional<z.ZodBoolean>;
|
|
281
|
+
}, z.core.$strip>>;
|
|
282
|
+
}, z.core.$strip>;
|
|
280
283
|
description: string;
|
|
281
284
|
};
|
|
282
285
|
Table: {
|
|
283
|
-
props:
|
|
284
|
-
caption:
|
|
285
|
-
columns:
|
|
286
|
-
label:
|
|
287
|
-
align:
|
|
286
|
+
props: z.ZodObject<{
|
|
287
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
288
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
289
|
+
label: z.ZodString;
|
|
290
|
+
align: z.ZodOptional<z.ZodEnum<{
|
|
288
291
|
right: "right";
|
|
289
292
|
left: "left";
|
|
290
293
|
center: "center";
|
|
291
294
|
}>>;
|
|
292
|
-
},
|
|
293
|
-
rows:
|
|
294
|
-
},
|
|
295
|
+
}, z.core.$strip>>;
|
|
296
|
+
rows: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
297
|
+
}, z.core.$strip>;
|
|
295
298
|
description: string;
|
|
296
299
|
};
|
|
297
300
|
Anchor: {
|
|
298
|
-
props:
|
|
299
|
-
text:
|
|
300
|
-
href:
|
|
301
|
-
openInNewTab:
|
|
302
|
-
},
|
|
301
|
+
props: z.ZodObject<{
|
|
302
|
+
text: z.ZodString;
|
|
303
|
+
href: z.ZodString;
|
|
304
|
+
openInNewTab: z.ZodOptional<z.ZodBoolean>;
|
|
305
|
+
}, z.core.$strip>;
|
|
303
306
|
description: string;
|
|
304
307
|
};
|
|
305
308
|
Avatar: {
|
|
306
|
-
props:
|
|
307
|
-
src:
|
|
308
|
-
alt:
|
|
309
|
-
name:
|
|
310
|
-
fallback:
|
|
311
|
-
size:
|
|
309
|
+
props: z.ZodObject<{
|
|
310
|
+
src: z.ZodOptional<z.ZodString>;
|
|
311
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
312
|
+
name: z.ZodOptional<z.ZodString>;
|
|
313
|
+
fallback: z.ZodOptional<z.ZodString>;
|
|
314
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
312
315
|
sm: "sm";
|
|
313
316
|
md: "md";
|
|
314
317
|
lg: "lg";
|
|
315
318
|
}>>;
|
|
316
|
-
},
|
|
319
|
+
}, z.core.$strip>;
|
|
317
320
|
description: string;
|
|
318
321
|
};
|
|
319
322
|
Code: {
|
|
320
|
-
props:
|
|
321
|
-
code:
|
|
322
|
-
},
|
|
323
|
+
props: z.ZodObject<{
|
|
324
|
+
code: z.ZodString;
|
|
325
|
+
}, z.core.$strip>;
|
|
323
326
|
description: string;
|
|
324
327
|
};
|
|
325
328
|
Progress: {
|
|
326
|
-
props:
|
|
327
|
-
progress:
|
|
328
|
-
maxProgress:
|
|
329
|
-
minProgress:
|
|
330
|
-
label:
|
|
331
|
-
},
|
|
329
|
+
props: z.ZodObject<{
|
|
330
|
+
progress: z.ZodNumber;
|
|
331
|
+
maxProgress: z.ZodNumber;
|
|
332
|
+
minProgress: z.ZodOptional<z.ZodNumber>;
|
|
333
|
+
label: z.ZodOptional<z.ZodString>;
|
|
334
|
+
}, z.core.$strip>;
|
|
332
335
|
description: string;
|
|
333
336
|
};
|
|
334
337
|
Skeleton: {
|
|
335
|
-
props:
|
|
336
|
-
shape:
|
|
338
|
+
props: z.ZodObject<{
|
|
339
|
+
shape: z.ZodOptional<z.ZodEnum<{
|
|
337
340
|
circle: "circle";
|
|
338
341
|
rect: "rect";
|
|
339
342
|
}>>;
|
|
340
|
-
size:
|
|
343
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
341
344
|
sm: "sm";
|
|
342
345
|
md: "md";
|
|
343
346
|
lg: "lg";
|
|
344
347
|
}>>;
|
|
345
|
-
animate:
|
|
346
|
-
},
|
|
348
|
+
animate: z.ZodOptional<z.ZodBoolean>;
|
|
349
|
+
}, z.core.$strip>;
|
|
347
350
|
description: string;
|
|
348
351
|
};
|
|
349
352
|
Icon: {
|
|
350
|
-
props:
|
|
351
|
-
name:
|
|
353
|
+
props: z.ZodObject<{
|
|
354
|
+
name: z.ZodEnum<{
|
|
352
355
|
form: "form";
|
|
353
356
|
list: "list";
|
|
354
357
|
link: "link";
|
|
@@ -402,49 +405,49 @@ declare const catalog: import("@json-render/core").Catalog<{
|
|
|
402
405
|
twitter: "twitter";
|
|
403
406
|
qiita: "qiita";
|
|
404
407
|
}>;
|
|
405
|
-
size:
|
|
408
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
406
409
|
sm: "sm";
|
|
407
410
|
md: "md";
|
|
408
411
|
lg: "lg";
|
|
409
412
|
}>>;
|
|
410
|
-
},
|
|
413
|
+
}, z.core.$strip>;
|
|
411
414
|
description: string;
|
|
412
415
|
};
|
|
413
416
|
ChevronIcon: {
|
|
414
|
-
props:
|
|
415
|
-
direction:
|
|
417
|
+
props: z.ZodObject<{
|
|
418
|
+
direction: z.ZodEnum<{
|
|
416
419
|
right: "right";
|
|
417
420
|
left: "left";
|
|
418
421
|
up: "up";
|
|
419
422
|
down: "down";
|
|
420
423
|
}>;
|
|
421
|
-
size:
|
|
424
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
422
425
|
sm: "sm";
|
|
423
426
|
md: "md";
|
|
424
427
|
lg: "lg";
|
|
425
428
|
}>>;
|
|
426
|
-
},
|
|
429
|
+
}, z.core.$strip>;
|
|
427
430
|
description: string;
|
|
428
431
|
};
|
|
429
432
|
StatusIcon: {
|
|
430
|
-
props:
|
|
431
|
-
status:
|
|
433
|
+
props: z.ZodObject<{
|
|
434
|
+
status: z.ZodEnum<{
|
|
432
435
|
success: "success";
|
|
433
436
|
info: "info";
|
|
434
437
|
warning: "warning";
|
|
435
438
|
error: "error";
|
|
436
439
|
}>;
|
|
437
|
-
size:
|
|
440
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
438
441
|
sm: "sm";
|
|
439
442
|
md: "md";
|
|
440
443
|
lg: "lg";
|
|
441
444
|
}>>;
|
|
442
|
-
},
|
|
445
|
+
}, z.core.$strip>;
|
|
443
446
|
description: string;
|
|
444
447
|
};
|
|
445
448
|
IconButton: {
|
|
446
|
-
props:
|
|
447
|
-
icon:
|
|
449
|
+
props: z.ZodObject<{
|
|
450
|
+
icon: z.ZodEnum<{
|
|
448
451
|
form: "form";
|
|
449
452
|
list: "list";
|
|
450
453
|
link: "link";
|
|
@@ -498,272 +501,345 @@ declare const catalog: import("@json-render/core").Catalog<{
|
|
|
498
501
|
twitter: "twitter";
|
|
499
502
|
qiita: "qiita";
|
|
500
503
|
}>;
|
|
501
|
-
label:
|
|
502
|
-
size:
|
|
504
|
+
label: z.ZodString;
|
|
505
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
503
506
|
sm: "sm";
|
|
504
507
|
md: "md";
|
|
505
508
|
lg: "lg";
|
|
506
509
|
}>>;
|
|
507
|
-
color:
|
|
510
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
508
511
|
primary: "primary";
|
|
509
512
|
secondary: "secondary";
|
|
510
513
|
transparent: "transparent";
|
|
511
514
|
base: "base";
|
|
512
515
|
}>>;
|
|
513
|
-
},
|
|
516
|
+
}, z.core.$strip>;
|
|
514
517
|
description: string;
|
|
515
518
|
};
|
|
516
519
|
Textarea: {
|
|
517
|
-
props:
|
|
518
|
-
name:
|
|
519
|
-
placeholder:
|
|
520
|
-
defaultValue:
|
|
521
|
-
invalid:
|
|
522
|
-
disabled:
|
|
523
|
-
readOnly:
|
|
524
|
-
},
|
|
520
|
+
props: z.ZodObject<{
|
|
521
|
+
name: z.ZodString;
|
|
522
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
523
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
524
|
+
invalid: z.ZodOptional<z.ZodBoolean>;
|
|
525
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
526
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
527
|
+
}, z.core.$strip>;
|
|
525
528
|
description: string;
|
|
526
529
|
};
|
|
527
530
|
PasswordInput: {
|
|
528
|
-
props:
|
|
529
|
-
name:
|
|
530
|
-
placeholder:
|
|
531
|
-
defaultValue:
|
|
532
|
-
invalid:
|
|
533
|
-
disabled:
|
|
534
|
-
},
|
|
531
|
+
props: z.ZodObject<{
|
|
532
|
+
name: z.ZodString;
|
|
533
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
534
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
535
|
+
invalid: z.ZodOptional<z.ZodBoolean>;
|
|
536
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
537
|
+
}, z.core.$strip>;
|
|
535
538
|
description: string;
|
|
536
539
|
};
|
|
537
540
|
NumberField: {
|
|
538
|
-
props:
|
|
539
|
-
name:
|
|
540
|
-
defaultValue:
|
|
541
|
-
min:
|
|
542
|
-
max:
|
|
543
|
-
step:
|
|
544
|
-
invalid:
|
|
545
|
-
disabled:
|
|
546
|
-
},
|
|
541
|
+
props: z.ZodObject<{
|
|
542
|
+
name: z.ZodString;
|
|
543
|
+
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
544
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
545
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
546
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
547
|
+
invalid: z.ZodOptional<z.ZodBoolean>;
|
|
548
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
549
|
+
}, z.core.$strip>;
|
|
547
550
|
description: string;
|
|
548
551
|
};
|
|
549
552
|
Slider: {
|
|
550
|
-
props:
|
|
551
|
-
name:
|
|
552
|
-
defaultValue:
|
|
553
|
-
min:
|
|
554
|
-
max:
|
|
555
|
-
step:
|
|
556
|
-
invalid:
|
|
557
|
-
disabled:
|
|
558
|
-
},
|
|
553
|
+
props: z.ZodObject<{
|
|
554
|
+
name: z.ZodString;
|
|
555
|
+
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
556
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
557
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
558
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
559
|
+
invalid: z.ZodOptional<z.ZodBoolean>;
|
|
560
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
561
|
+
}, z.core.$strip>;
|
|
559
562
|
description: string;
|
|
560
563
|
};
|
|
561
564
|
Radio: {
|
|
562
|
-
props:
|
|
563
|
-
name:
|
|
564
|
-
label:
|
|
565
|
-
options:
|
|
566
|
-
value:
|
|
567
|
-
label:
|
|
568
|
-
},
|
|
569
|
-
defaultValue:
|
|
570
|
-
disabled:
|
|
571
|
-
},
|
|
565
|
+
props: z.ZodObject<{
|
|
566
|
+
name: z.ZodString;
|
|
567
|
+
label: z.ZodString;
|
|
568
|
+
options: z.ZodArray<z.ZodObject<{
|
|
569
|
+
value: z.ZodString;
|
|
570
|
+
label: z.ZodString;
|
|
571
|
+
}, z.core.$strip>>;
|
|
572
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
573
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
574
|
+
}, z.core.$strip>;
|
|
572
575
|
description: string;
|
|
573
576
|
};
|
|
574
577
|
RadioCard: {
|
|
575
|
-
props:
|
|
576
|
-
name:
|
|
577
|
-
label:
|
|
578
|
-
options:
|
|
579
|
-
value:
|
|
580
|
-
label:
|
|
581
|
-
description:
|
|
582
|
-
disabled:
|
|
583
|
-
},
|
|
584
|
-
defaultValue:
|
|
585
|
-
invalid:
|
|
586
|
-
disabled:
|
|
587
|
-
},
|
|
578
|
+
props: z.ZodObject<{
|
|
579
|
+
name: z.ZodString;
|
|
580
|
+
label: z.ZodString;
|
|
581
|
+
options: z.ZodArray<z.ZodObject<{
|
|
582
|
+
value: z.ZodString;
|
|
583
|
+
label: z.ZodString;
|
|
584
|
+
description: z.ZodOptional<z.ZodString>;
|
|
585
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
586
|
+
}, z.core.$strip>>;
|
|
587
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
588
|
+
invalid: z.ZodOptional<z.ZodBoolean>;
|
|
589
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
590
|
+
}, z.core.$strip>;
|
|
588
591
|
description: string;
|
|
589
592
|
};
|
|
590
593
|
CheckboxCard: {
|
|
591
|
-
props:
|
|
592
|
-
name:
|
|
593
|
-
options:
|
|
594
|
-
value:
|
|
595
|
-
label:
|
|
596
|
-
description:
|
|
597
|
-
disabled:
|
|
598
|
-
},
|
|
599
|
-
defaultValue:
|
|
600
|
-
invalid:
|
|
601
|
-
disabled:
|
|
602
|
-
},
|
|
594
|
+
props: z.ZodObject<{
|
|
595
|
+
name: z.ZodString;
|
|
596
|
+
options: z.ZodArray<z.ZodObject<{
|
|
597
|
+
value: z.ZodString;
|
|
598
|
+
label: z.ZodString;
|
|
599
|
+
description: z.ZodOptional<z.ZodString>;
|
|
600
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
601
|
+
}, z.core.$strip>>;
|
|
602
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
603
|
+
invalid: z.ZodOptional<z.ZodBoolean>;
|
|
604
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
605
|
+
}, z.core.$strip>;
|
|
603
606
|
description: string;
|
|
604
607
|
};
|
|
605
608
|
Pagination: {
|
|
606
|
-
props:
|
|
607
|
-
name:
|
|
608
|
-
totalPages:
|
|
609
|
-
defaultPage:
|
|
610
|
-
prevLabel:
|
|
611
|
-
nextLabel:
|
|
612
|
-
disabled:
|
|
613
|
-
},
|
|
609
|
+
props: z.ZodObject<{
|
|
610
|
+
name: z.ZodString;
|
|
611
|
+
totalPages: z.ZodNumber;
|
|
612
|
+
defaultPage: z.ZodOptional<z.ZodNumber>;
|
|
613
|
+
prevLabel: z.ZodOptional<z.ZodString>;
|
|
614
|
+
nextLabel: z.ZodOptional<z.ZodString>;
|
|
615
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
616
|
+
}, z.core.$strip>;
|
|
614
617
|
description: string;
|
|
615
618
|
};
|
|
616
619
|
Form: {
|
|
617
|
-
props:
|
|
618
|
-
action:
|
|
619
|
-
},
|
|
620
|
+
props: z.ZodObject<{
|
|
621
|
+
action: z.ZodOptional<z.ZodString>;
|
|
622
|
+
}, z.core.$strip>;
|
|
620
623
|
slots: string[];
|
|
621
624
|
description: string;
|
|
622
625
|
};
|
|
623
626
|
Modal: {
|
|
624
|
-
props:
|
|
625
|
-
triggerLabel:
|
|
626
|
-
title:
|
|
627
|
-
type:
|
|
627
|
+
props: z.ZodObject<{
|
|
628
|
+
triggerLabel: z.ZodString;
|
|
629
|
+
title: z.ZodString;
|
|
630
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
628
631
|
right: "right";
|
|
629
632
|
bottom: "bottom";
|
|
630
633
|
left: "left";
|
|
631
634
|
center: "center";
|
|
632
635
|
}>>;
|
|
633
|
-
},
|
|
636
|
+
}, z.core.$strip>;
|
|
634
637
|
slots: string[];
|
|
635
638
|
description: string;
|
|
636
639
|
};
|
|
637
640
|
Dialog: {
|
|
638
|
-
props:
|
|
639
|
-
triggerLabel:
|
|
640
|
-
title:
|
|
641
|
-
},
|
|
641
|
+
props: z.ZodObject<{
|
|
642
|
+
triggerLabel: z.ZodString;
|
|
643
|
+
title: z.ZodString;
|
|
644
|
+
}, z.core.$strip>;
|
|
642
645
|
slots: string[];
|
|
643
646
|
description: string;
|
|
644
647
|
};
|
|
645
648
|
Drawer: {
|
|
646
|
-
props:
|
|
647
|
-
triggerLabel:
|
|
648
|
-
title:
|
|
649
|
-
side:
|
|
649
|
+
props: z.ZodObject<{
|
|
650
|
+
triggerLabel: z.ZodString;
|
|
651
|
+
title: z.ZodString;
|
|
652
|
+
side: z.ZodOptional<z.ZodEnum<{
|
|
650
653
|
right: "right";
|
|
651
654
|
left: "left";
|
|
652
655
|
}>>;
|
|
653
|
-
},
|
|
656
|
+
}, z.core.$strip>;
|
|
654
657
|
slots: string[];
|
|
655
658
|
description: string;
|
|
656
659
|
};
|
|
657
660
|
Popover: {
|
|
658
|
-
props:
|
|
659
|
-
triggerLabel:
|
|
660
|
-
},
|
|
661
|
+
props: z.ZodObject<{
|
|
662
|
+
triggerLabel: z.ZodString;
|
|
663
|
+
}, z.core.$strip>;
|
|
661
664
|
slots: string[];
|
|
662
665
|
description: string;
|
|
663
666
|
};
|
|
664
667
|
Tooltip: {
|
|
665
|
-
props:
|
|
666
|
-
label:
|
|
667
|
-
text:
|
|
668
|
-
},
|
|
668
|
+
props: z.ZodObject<{
|
|
669
|
+
label: z.ZodString;
|
|
670
|
+
text: z.ZodString;
|
|
671
|
+
}, z.core.$strip>;
|
|
669
672
|
description: string;
|
|
670
673
|
};
|
|
671
674
|
DropdownMenu: {
|
|
672
|
-
props:
|
|
673
|
-
triggerLabel:
|
|
674
|
-
items:
|
|
675
|
-
label:
|
|
676
|
-
},
|
|
677
|
-
},
|
|
675
|
+
props: z.ZodObject<{
|
|
676
|
+
triggerLabel: z.ZodString;
|
|
677
|
+
items: z.ZodArray<z.ZodObject<{
|
|
678
|
+
label: z.ZodString;
|
|
679
|
+
}, z.core.$strip>>;
|
|
680
|
+
}, z.core.$strip>;
|
|
678
681
|
description: string;
|
|
679
682
|
};
|
|
680
683
|
Toast: {
|
|
681
|
-
props:
|
|
682
|
-
triggerLabel:
|
|
683
|
-
tone:
|
|
684
|
+
props: z.ZodObject<{
|
|
685
|
+
triggerLabel: z.ZodString;
|
|
686
|
+
tone: z.ZodEnum<{
|
|
684
687
|
success: "success";
|
|
685
688
|
info: "info";
|
|
686
689
|
warning: "warning";
|
|
687
690
|
error: "error";
|
|
688
691
|
}>;
|
|
689
|
-
message:
|
|
690
|
-
},
|
|
692
|
+
message: z.ZodString;
|
|
693
|
+
}, z.core.$strip>;
|
|
691
694
|
description: string;
|
|
692
695
|
};
|
|
693
696
|
ScrollLinked: {
|
|
694
|
-
props:
|
|
697
|
+
props: z.ZodObject<{}, z.core.$strip>;
|
|
695
698
|
description: string;
|
|
696
699
|
};
|
|
697
700
|
BaselineStatus: {
|
|
698
|
-
props:
|
|
699
|
-
featureId:
|
|
700
|
-
},
|
|
701
|
+
props: z.ZodObject<{
|
|
702
|
+
featureId: z.ZodString;
|
|
703
|
+
}, z.core.$strip>;
|
|
701
704
|
description: string;
|
|
702
705
|
};
|
|
703
706
|
ListBox: {
|
|
704
|
-
props:
|
|
705
|
-
name:
|
|
706
|
-
options:
|
|
707
|
-
value:
|
|
708
|
-
label:
|
|
709
|
-
},
|
|
710
|
-
defaultValue:
|
|
711
|
-
},
|
|
707
|
+
props: z.ZodObject<{
|
|
708
|
+
name: z.ZodString;
|
|
709
|
+
options: z.ZodArray<z.ZodObject<{
|
|
710
|
+
value: z.ZodString;
|
|
711
|
+
label: z.ZodString;
|
|
712
|
+
}, z.core.$strip>>;
|
|
713
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
714
|
+
}, z.core.$strip>;
|
|
712
715
|
description: string;
|
|
713
716
|
};
|
|
714
717
|
CheckboxGroup: {
|
|
715
|
-
props:
|
|
716
|
-
name:
|
|
717
|
-
options:
|
|
718
|
-
value:
|
|
719
|
-
label:
|
|
720
|
-
},
|
|
721
|
-
defaultValue:
|
|
722
|
-
},
|
|
718
|
+
props: z.ZodObject<{
|
|
719
|
+
name: z.ZodString;
|
|
720
|
+
options: z.ZodArray<z.ZodObject<{
|
|
721
|
+
value: z.ZodString;
|
|
722
|
+
label: z.ZodString;
|
|
723
|
+
}, z.core.$strip>>;
|
|
724
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
725
|
+
}, z.core.$strip>;
|
|
723
726
|
description: string;
|
|
724
727
|
};
|
|
725
728
|
Autocomplete: {
|
|
726
|
-
props:
|
|
727
|
-
name:
|
|
728
|
-
options:
|
|
729
|
-
value:
|
|
730
|
-
label:
|
|
731
|
-
},
|
|
732
|
-
defaultValue:
|
|
733
|
-
invalid:
|
|
734
|
-
disabled:
|
|
735
|
-
},
|
|
729
|
+
props: z.ZodObject<{
|
|
730
|
+
name: z.ZodString;
|
|
731
|
+
options: z.ZodArray<z.ZodObject<{
|
|
732
|
+
value: z.ZodString;
|
|
733
|
+
label: z.ZodString;
|
|
734
|
+
}, z.core.$strip>>;
|
|
735
|
+
defaultValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
736
|
+
invalid: z.ZodOptional<z.ZodBoolean>;
|
|
737
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
738
|
+
}, z.core.$strip>;
|
|
736
739
|
description: string;
|
|
737
740
|
};
|
|
738
741
|
FileField: {
|
|
739
|
-
props:
|
|
740
|
-
triggerLabel:
|
|
741
|
-
multiple:
|
|
742
|
-
maxFiles:
|
|
743
|
-
clearable:
|
|
744
|
-
},
|
|
742
|
+
props: z.ZodObject<{
|
|
743
|
+
triggerLabel: z.ZodOptional<z.ZodString>;
|
|
744
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
745
|
+
maxFiles: z.ZodOptional<z.ZodNumber>;
|
|
746
|
+
clearable: z.ZodOptional<z.ZodBoolean>;
|
|
747
|
+
}, z.core.$strip>;
|
|
745
748
|
description: string;
|
|
746
749
|
};
|
|
747
750
|
FormControl: {
|
|
748
|
-
props:
|
|
749
|
-
label:
|
|
750
|
-
fieldType:
|
|
751
|
+
props: z.ZodObject<{
|
|
752
|
+
label: z.ZodString;
|
|
753
|
+
fieldType: z.ZodOptional<z.ZodEnum<{
|
|
751
754
|
text: "text";
|
|
752
755
|
textarea: "textarea";
|
|
753
756
|
password: "password";
|
|
754
757
|
}>>;
|
|
755
|
-
name:
|
|
756
|
-
placeholder:
|
|
757
|
-
defaultValue:
|
|
758
|
-
helpText:
|
|
759
|
-
errorText:
|
|
760
|
-
required:
|
|
761
|
-
invalid:
|
|
762
|
-
},
|
|
758
|
+
name: z.ZodString;
|
|
759
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
760
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
761
|
+
helpText: z.ZodOptional<z.ZodString>;
|
|
762
|
+
errorText: z.ZodOptional<z.ZodString>;
|
|
763
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
764
|
+
invalid: z.ZodOptional<z.ZodBoolean>;
|
|
765
|
+
}, z.core.$strip>;
|
|
763
766
|
description: string;
|
|
764
767
|
};
|
|
765
768
|
};
|
|
766
769
|
actions: {};
|
|
767
770
|
}>;
|
|
771
|
+
/**
|
|
772
|
+
* LLM が破りやすい制約を `catalog.prompt({ customRules })` に注入するための
|
|
773
|
+
* 横断ルール集。json-render のシステムプロンプト本文に追記される。
|
|
774
|
+
*
|
|
775
|
+
* @example
|
|
776
|
+
* const systemPrompt = catalog.prompt({ customRules: [...arteOdysseyRules] });
|
|
777
|
+
*/
|
|
778
|
+
declare const arteOdysseyRules: readonly string[];
|
|
779
|
+
/** catalog に登録されたコンポーネント定義のマップ(型レベル)。 */
|
|
780
|
+
type ComponentSchemas = (typeof catalog)['data']['components'];
|
|
781
|
+
/** catalog に登録されたコンポーネント名のユニオン。 */
|
|
782
|
+
type ComponentName = keyof ComponentSchemas;
|
|
783
|
+
/** 指定したコンポーネントの props 型(Zod スキーマから推論)。 */
|
|
784
|
+
type ComponentProps<K extends ComponentName> = z.infer<ComponentSchemas[K]['props']>;
|
|
785
|
+
/**
|
|
786
|
+
* arte-odyssey のコンポーネントだけで構成された型付き spec の要素。
|
|
787
|
+
* `type` と `props` がコンポーネントごとに検査される。
|
|
788
|
+
*/
|
|
789
|
+
type ArteSpecElement = { [K in ComponentName]: Omit<UIElement, 'type' | 'props'> & {
|
|
790
|
+
type: K;
|
|
791
|
+
props: ComponentProps<K>;
|
|
792
|
+
} }[ComponentName];
|
|
793
|
+
/**
|
|
794
|
+
* arte-odyssey のコンポーネントだけで構成された型付き spec。
|
|
795
|
+
* `satisfies ArteSpec` で書くと component 名・props の typo がコンパイルエラーに
|
|
796
|
+
* なり、エディタ補完も効く。上流の `Spec` へキャストなしで代入できる。
|
|
797
|
+
*
|
|
798
|
+
* @example
|
|
799
|
+
* const spec = {
|
|
800
|
+
* root: 'root',
|
|
801
|
+
* elements: {
|
|
802
|
+
* root: { type: 'Stack', props: { direction: 'column' }, children: ['b'] },
|
|
803
|
+
* b: { type: 'Button', props: { label: 'OK' } },
|
|
804
|
+
* },
|
|
805
|
+
* } satisfies ArteSpec;
|
|
806
|
+
*/
|
|
807
|
+
type ArteSpec = {
|
|
808
|
+
root: string;
|
|
809
|
+
elements: Record<string, ArteSpecElement>;
|
|
810
|
+
state?: Spec['state'];
|
|
811
|
+
};
|
|
812
|
+
/** 検証で見つかった 1 件の問題。 */
|
|
813
|
+
type GeneratedSpecIssue = {
|
|
814
|
+
/** 問題のあった要素キー(spec 全体の問題なら未指定)。 */elementKey?: string; /** 人間(および LLM)向けの説明。 */
|
|
815
|
+
message: string;
|
|
816
|
+
};
|
|
817
|
+
/** {@link validateGeneratedSpec} の結果。 */
|
|
818
|
+
type ValidateGeneratedSpecResult = {
|
|
819
|
+
ok: true;
|
|
820
|
+
spec: ArteSpec;
|
|
821
|
+
fixes: string[];
|
|
822
|
+
} | {
|
|
823
|
+
ok: false;
|
|
824
|
+
issues: GeneratedSpecIssue[];
|
|
825
|
+
repairPrompt: string;
|
|
826
|
+
};
|
|
827
|
+
/**
|
|
828
|
+
* LLM が生成した spec を検証し、描画可能なら型付き spec を、壊れていれば
|
|
829
|
+
* そのまま LLM に投げ返せる修復プロンプトを返す。
|
|
830
|
+
*
|
|
831
|
+
* 内部では (1) 機械修正(`autoFixSpec`)→ (2) 構造検証(`validateSpec`)→
|
|
832
|
+
* (3) 要素ごとに catalog の Zod スキーマで props 検証、を行う。
|
|
833
|
+
* `catalog.validate()` は使わない(現行の上流バージョンでは正常な spec を
|
|
834
|
+
* 誤って弾き、props 検証も実質無効になるため)。
|
|
835
|
+
*
|
|
836
|
+
* @example
|
|
837
|
+
* const result = validateGeneratedSpec(JSON.parse(llmOutput));
|
|
838
|
+
* if (result.ok) {
|
|
839
|
+
* return <JsonRenderUI spec={result.spec} />;
|
|
840
|
+
* }
|
|
841
|
+
* const retried = await llm(result.repairPrompt);
|
|
842
|
+
*/
|
|
843
|
+
declare const validateGeneratedSpec: (input: unknown) => ValidateGeneratedSpecResult;
|
|
768
844
|
//#endregion
|
|
769
|
-
export { catalog };
|
|
845
|
+
export { ArteSpec, ArteSpecElement, ComponentName, ComponentProps, GeneratedSpecIssue, ValidateGeneratedSpecResult, arteOdysseyRules, catalog, validateGeneratedSpec };
|