@sudajs/theme-engine 0.2.1 → 1.1.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/dist/agent.d.ts +288 -20
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +73 -9
- package/dist/agent.js.map +1 -1
- package/dist/assets.d.ts +21 -0
- package/dist/assets.d.ts.map +1 -1
- package/dist/assets.js +16 -0
- package/dist/assets.js.map +1 -1
- package/dist/check.d.ts +54 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/check.js +120 -0
- package/dist/check.js.map +1 -0
- package/dist/components/base-blocks.d.ts.map +1 -1
- package/dist/components/base-blocks.js +90 -6
- package/dist/components/base-blocks.js.map +1 -1
- package/dist/components/containers.d.ts.map +1 -1
- package/dist/components/containers.js +51 -2
- package/dist/components/containers.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/registry/filesystem.d.ts +20 -5
- package/dist/registry/filesystem.d.ts.map +1 -1
- package/dist/registry/filesystem.js +36 -25
- package/dist/registry/filesystem.js.map +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +1 -1
- package/dist/runtime.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/dist/types.d.ts +38 -18
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/ai/slots.d.ts +0 -33
- package/dist/ai/slots.d.ts.map +0 -1
- package/dist/ai/slots.js +0 -139
- package/dist/ai/slots.js.map +0 -1
package/dist/agent.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { FieldAiParams } from "@puckeditor/plugin-ai";
|
|
1
2
|
import { z } from "zod";
|
|
2
|
-
import type {
|
|
3
|
+
import type { PageData, SudaComponentAi, ThemeManifest, ThemeModule } from "./types.js";
|
|
3
4
|
export interface AgentFieldSchema {
|
|
4
5
|
type: string;
|
|
5
6
|
label?: string;
|
|
@@ -8,6 +9,12 @@ export interface AgentFieldSchema {
|
|
|
8
9
|
fields?: Record<string, AgentFieldSchema>;
|
|
9
10
|
arrayFields?: Record<string, AgentFieldSchema>;
|
|
10
11
|
dynamic?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Field-level AI configuration forwarded as-is from Puck's plugin-ai
|
|
14
|
+
* (`field.ai`). Hosts that already speak Puck AI's payload shape can pass it
|
|
15
|
+
* through to the LLM without re-mapping.
|
|
16
|
+
*/
|
|
17
|
+
ai?: FieldAiParams;
|
|
11
18
|
}
|
|
12
19
|
export interface AgentComponentSchema {
|
|
13
20
|
type: string;
|
|
@@ -15,7 +22,8 @@ export interface AgentComponentSchema {
|
|
|
15
22
|
description?: string;
|
|
16
23
|
fields: Record<string, AgentFieldSchema>;
|
|
17
24
|
defaultProps: Record<string, unknown>;
|
|
18
|
-
|
|
25
|
+
/** Component-level AI instructions and flags, copied from `component.ai`. */
|
|
26
|
+
ai?: SudaComponentAi;
|
|
19
27
|
}
|
|
20
28
|
export interface AgentStarterPageSummary {
|
|
21
29
|
slug: string;
|
|
@@ -51,6 +59,28 @@ export interface AgentPageContentOutput {
|
|
|
51
59
|
content: PageData["content"];
|
|
52
60
|
zones?: PageData["zones"];
|
|
53
61
|
}
|
|
62
|
+
declare const agentFieldAiSchema: z.ZodObject<{
|
|
63
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
64
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
66
|
+
stream: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
bind: z.ZodOptional<z.ZodString>;
|
|
68
|
+
schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
69
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
70
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
71
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
stream: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
bind: z.ZodOptional<z.ZodString>;
|
|
75
|
+
schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
76
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
77
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
78
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
stream: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
bind: z.ZodOptional<z.ZodString>;
|
|
82
|
+
schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
83
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
54
84
|
export declare const agentFieldOutputSchema: z.ZodType<{
|
|
55
85
|
type: string;
|
|
56
86
|
label?: string | undefined;
|
|
@@ -62,6 +92,7 @@ export declare const agentFieldOutputSchema: z.ZodType<{
|
|
|
62
92
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
63
93
|
dynamic?: boolean | undefined;
|
|
64
94
|
generationHint?: string | undefined;
|
|
95
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
65
96
|
}>;
|
|
66
97
|
export declare const agentComponentOutputSchema: z.ZodObject<{
|
|
67
98
|
role: z.ZodEnum<["root", "section", "layout"]>;
|
|
@@ -79,6 +110,7 @@ export declare const agentComponentOutputSchema: z.ZodObject<{
|
|
|
79
110
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
80
111
|
dynamic?: boolean | undefined;
|
|
81
112
|
generationHint?: string | undefined;
|
|
113
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
82
114
|
}, z.ZodTypeDef, {
|
|
83
115
|
type: string;
|
|
84
116
|
label?: string | undefined;
|
|
@@ -90,11 +122,60 @@ export declare const agentComponentOutputSchema: z.ZodObject<{
|
|
|
90
122
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
91
123
|
dynamic?: boolean | undefined;
|
|
92
124
|
generationHint?: string | undefined;
|
|
125
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
93
126
|
}>>;
|
|
94
127
|
defaultProps: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
95
128
|
outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
96
129
|
generationHints: z.ZodArray<z.ZodString, "many">;
|
|
97
|
-
|
|
130
|
+
ai: z.ZodOptional<z.ZodObject<{
|
|
131
|
+
instructions: z.ZodString;
|
|
132
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
133
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
134
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
135
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
136
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
disabled?: boolean | undefined;
|
|
139
|
+
allow?: string[] | undefined;
|
|
140
|
+
disallow?: string[] | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
disabled?: boolean | undefined;
|
|
143
|
+
allow?: string[] | undefined;
|
|
144
|
+
disallow?: string[] | undefined;
|
|
145
|
+
}>>;
|
|
146
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
147
|
+
instructions: z.ZodString;
|
|
148
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
150
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
151
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
152
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
disabled?: boolean | undefined;
|
|
155
|
+
allow?: string[] | undefined;
|
|
156
|
+
disallow?: string[] | undefined;
|
|
157
|
+
}, {
|
|
158
|
+
disabled?: boolean | undefined;
|
|
159
|
+
allow?: string[] | undefined;
|
|
160
|
+
disallow?: string[] | undefined;
|
|
161
|
+
}>>;
|
|
162
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
163
|
+
instructions: z.ZodString;
|
|
164
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
166
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
167
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
168
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
disabled?: boolean | undefined;
|
|
171
|
+
allow?: string[] | undefined;
|
|
172
|
+
disallow?: string[] | undefined;
|
|
173
|
+
}, {
|
|
174
|
+
disabled?: boolean | undefined;
|
|
175
|
+
allow?: string[] | undefined;
|
|
176
|
+
disallow?: string[] | undefined;
|
|
177
|
+
}>>;
|
|
178
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
98
179
|
}, "strip", z.ZodTypeAny, {
|
|
99
180
|
type: string;
|
|
100
181
|
fields: Record<string, {
|
|
@@ -108,14 +189,31 @@ export declare const agentComponentOutputSchema: z.ZodObject<{
|
|
|
108
189
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
109
190
|
dynamic?: boolean | undefined;
|
|
110
191
|
generationHint?: string | undefined;
|
|
192
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
111
193
|
}>;
|
|
112
|
-
role: "layout" | "root" | "section";
|
|
113
194
|
defaultProps: Record<string, unknown>;
|
|
195
|
+
role: "layout" | "root" | "section";
|
|
114
196
|
outputSchema: Record<string, unknown>;
|
|
115
197
|
generationHints: string[];
|
|
116
198
|
label?: string | undefined;
|
|
199
|
+
ai?: z.objectOutputType<{
|
|
200
|
+
instructions: z.ZodString;
|
|
201
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
202
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
203
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
204
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
205
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
206
|
+
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
disabled?: boolean | undefined;
|
|
208
|
+
allow?: string[] | undefined;
|
|
209
|
+
disallow?: string[] | undefined;
|
|
210
|
+
}, {
|
|
211
|
+
disabled?: boolean | undefined;
|
|
212
|
+
allow?: string[] | undefined;
|
|
213
|
+
disallow?: string[] | undefined;
|
|
214
|
+
}>>;
|
|
215
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
117
216
|
description?: string | undefined;
|
|
118
|
-
aiSlots?: unknown[] | undefined;
|
|
119
217
|
}, {
|
|
120
218
|
type: string;
|
|
121
219
|
fields: Record<string, {
|
|
@@ -129,14 +227,31 @@ export declare const agentComponentOutputSchema: z.ZodObject<{
|
|
|
129
227
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
130
228
|
dynamic?: boolean | undefined;
|
|
131
229
|
generationHint?: string | undefined;
|
|
230
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
132
231
|
}>;
|
|
133
|
-
role: "layout" | "root" | "section";
|
|
134
232
|
defaultProps: Record<string, unknown>;
|
|
233
|
+
role: "layout" | "root" | "section";
|
|
135
234
|
outputSchema: Record<string, unknown>;
|
|
136
235
|
generationHints: string[];
|
|
137
236
|
label?: string | undefined;
|
|
237
|
+
ai?: z.objectInputType<{
|
|
238
|
+
instructions: z.ZodString;
|
|
239
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
240
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
241
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
242
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
243
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
244
|
+
}, "strip", z.ZodTypeAny, {
|
|
245
|
+
disabled?: boolean | undefined;
|
|
246
|
+
allow?: string[] | undefined;
|
|
247
|
+
disallow?: string[] | undefined;
|
|
248
|
+
}, {
|
|
249
|
+
disabled?: boolean | undefined;
|
|
250
|
+
allow?: string[] | undefined;
|
|
251
|
+
disallow?: string[] | undefined;
|
|
252
|
+
}>>;
|
|
253
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
138
254
|
description?: string | undefined;
|
|
139
|
-
aiSlots?: unknown[] | undefined;
|
|
140
255
|
}>;
|
|
141
256
|
export declare const agentPageSchemaOutputSchema: z.ZodObject<{
|
|
142
257
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
@@ -172,6 +287,7 @@ export declare const agentPageSchemaOutputSchema: z.ZodObject<{
|
|
|
172
287
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
173
288
|
dynamic?: boolean | undefined;
|
|
174
289
|
generationHint?: string | undefined;
|
|
290
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
175
291
|
}, z.ZodTypeDef, {
|
|
176
292
|
type: string;
|
|
177
293
|
label?: string | undefined;
|
|
@@ -183,11 +299,60 @@ export declare const agentPageSchemaOutputSchema: z.ZodObject<{
|
|
|
183
299
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
184
300
|
dynamic?: boolean | undefined;
|
|
185
301
|
generationHint?: string | undefined;
|
|
302
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
186
303
|
}>>;
|
|
187
304
|
defaultProps: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
188
305
|
outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
189
306
|
generationHints: z.ZodArray<z.ZodString, "many">;
|
|
190
|
-
|
|
307
|
+
ai: z.ZodOptional<z.ZodObject<{
|
|
308
|
+
instructions: z.ZodString;
|
|
309
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
310
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
311
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
312
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
313
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
314
|
+
}, "strip", z.ZodTypeAny, {
|
|
315
|
+
disabled?: boolean | undefined;
|
|
316
|
+
allow?: string[] | undefined;
|
|
317
|
+
disallow?: string[] | undefined;
|
|
318
|
+
}, {
|
|
319
|
+
disabled?: boolean | undefined;
|
|
320
|
+
allow?: string[] | undefined;
|
|
321
|
+
disallow?: string[] | undefined;
|
|
322
|
+
}>>;
|
|
323
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
324
|
+
instructions: z.ZodString;
|
|
325
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
327
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
328
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
329
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
330
|
+
}, "strip", z.ZodTypeAny, {
|
|
331
|
+
disabled?: boolean | undefined;
|
|
332
|
+
allow?: string[] | undefined;
|
|
333
|
+
disallow?: string[] | undefined;
|
|
334
|
+
}, {
|
|
335
|
+
disabled?: boolean | undefined;
|
|
336
|
+
allow?: string[] | undefined;
|
|
337
|
+
disallow?: string[] | undefined;
|
|
338
|
+
}>>;
|
|
339
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
340
|
+
instructions: z.ZodString;
|
|
341
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
342
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
343
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
344
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
345
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
346
|
+
}, "strip", z.ZodTypeAny, {
|
|
347
|
+
disabled?: boolean | undefined;
|
|
348
|
+
allow?: string[] | undefined;
|
|
349
|
+
disallow?: string[] | undefined;
|
|
350
|
+
}, {
|
|
351
|
+
disabled?: boolean | undefined;
|
|
352
|
+
allow?: string[] | undefined;
|
|
353
|
+
disallow?: string[] | undefined;
|
|
354
|
+
}>>;
|
|
355
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
191
356
|
}, "strip", z.ZodTypeAny, {
|
|
192
357
|
type: string;
|
|
193
358
|
fields: Record<string, {
|
|
@@ -201,14 +366,31 @@ export declare const agentPageSchemaOutputSchema: z.ZodObject<{
|
|
|
201
366
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
202
367
|
dynamic?: boolean | undefined;
|
|
203
368
|
generationHint?: string | undefined;
|
|
369
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
204
370
|
}>;
|
|
205
|
-
role: "layout" | "root" | "section";
|
|
206
371
|
defaultProps: Record<string, unknown>;
|
|
372
|
+
role: "layout" | "root" | "section";
|
|
207
373
|
outputSchema: Record<string, unknown>;
|
|
208
374
|
generationHints: string[];
|
|
209
375
|
label?: string | undefined;
|
|
376
|
+
ai?: z.objectOutputType<{
|
|
377
|
+
instructions: z.ZodString;
|
|
378
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
379
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
380
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
381
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
382
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
383
|
+
}, "strip", z.ZodTypeAny, {
|
|
384
|
+
disabled?: boolean | undefined;
|
|
385
|
+
allow?: string[] | undefined;
|
|
386
|
+
disallow?: string[] | undefined;
|
|
387
|
+
}, {
|
|
388
|
+
disabled?: boolean | undefined;
|
|
389
|
+
allow?: string[] | undefined;
|
|
390
|
+
disallow?: string[] | undefined;
|
|
391
|
+
}>>;
|
|
392
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
210
393
|
description?: string | undefined;
|
|
211
|
-
aiSlots?: unknown[] | undefined;
|
|
212
394
|
}, {
|
|
213
395
|
type: string;
|
|
214
396
|
fields: Record<string, {
|
|
@@ -222,14 +404,31 @@ export declare const agentPageSchemaOutputSchema: z.ZodObject<{
|
|
|
222
404
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
223
405
|
dynamic?: boolean | undefined;
|
|
224
406
|
generationHint?: string | undefined;
|
|
407
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
225
408
|
}>;
|
|
226
|
-
role: "layout" | "root" | "section";
|
|
227
409
|
defaultProps: Record<string, unknown>;
|
|
410
|
+
role: "layout" | "root" | "section";
|
|
228
411
|
outputSchema: Record<string, unknown>;
|
|
229
412
|
generationHints: string[];
|
|
230
413
|
label?: string | undefined;
|
|
414
|
+
ai?: z.objectInputType<{
|
|
415
|
+
instructions: z.ZodString;
|
|
416
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
417
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
418
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
419
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
420
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
421
|
+
}, "strip", z.ZodTypeAny, {
|
|
422
|
+
disabled?: boolean | undefined;
|
|
423
|
+
allow?: string[] | undefined;
|
|
424
|
+
disallow?: string[] | undefined;
|
|
425
|
+
}, {
|
|
426
|
+
disabled?: boolean | undefined;
|
|
427
|
+
allow?: string[] | undefined;
|
|
428
|
+
disallow?: string[] | undefined;
|
|
429
|
+
}>>;
|
|
430
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
231
431
|
description?: string | undefined;
|
|
232
|
-
aiSlots?: unknown[] | undefined;
|
|
233
432
|
}>, "many">;
|
|
234
433
|
}, "strip", z.ZodTypeAny, {
|
|
235
434
|
sections: {
|
|
@@ -245,14 +444,31 @@ export declare const agentPageSchemaOutputSchema: z.ZodObject<{
|
|
|
245
444
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
246
445
|
dynamic?: boolean | undefined;
|
|
247
446
|
generationHint?: string | undefined;
|
|
447
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
248
448
|
}>;
|
|
249
|
-
role: "layout" | "root" | "section";
|
|
250
449
|
defaultProps: Record<string, unknown>;
|
|
450
|
+
role: "layout" | "root" | "section";
|
|
251
451
|
outputSchema: Record<string, unknown>;
|
|
252
452
|
generationHints: string[];
|
|
253
453
|
label?: string | undefined;
|
|
454
|
+
ai?: z.objectOutputType<{
|
|
455
|
+
instructions: z.ZodString;
|
|
456
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
457
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
458
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
459
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
460
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
461
|
+
}, "strip", z.ZodTypeAny, {
|
|
462
|
+
disabled?: boolean | undefined;
|
|
463
|
+
allow?: string[] | undefined;
|
|
464
|
+
disallow?: string[] | undefined;
|
|
465
|
+
}, {
|
|
466
|
+
disabled?: boolean | undefined;
|
|
467
|
+
allow?: string[] | undefined;
|
|
468
|
+
disallow?: string[] | undefined;
|
|
469
|
+
}>>;
|
|
470
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
254
471
|
description?: string | undefined;
|
|
255
|
-
aiSlots?: unknown[] | undefined;
|
|
256
472
|
}[];
|
|
257
473
|
}, {
|
|
258
474
|
sections: {
|
|
@@ -268,14 +484,31 @@ export declare const agentPageSchemaOutputSchema: z.ZodObject<{
|
|
|
268
484
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
269
485
|
dynamic?: boolean | undefined;
|
|
270
486
|
generationHint?: string | undefined;
|
|
487
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
271
488
|
}>;
|
|
272
|
-
role: "layout" | "root" | "section";
|
|
273
489
|
defaultProps: Record<string, unknown>;
|
|
490
|
+
role: "layout" | "root" | "section";
|
|
274
491
|
outputSchema: Record<string, unknown>;
|
|
275
492
|
generationHints: string[];
|
|
276
493
|
label?: string | undefined;
|
|
494
|
+
ai?: z.objectInputType<{
|
|
495
|
+
instructions: z.ZodString;
|
|
496
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
497
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
498
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
499
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
500
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
501
|
+
}, "strip", z.ZodTypeAny, {
|
|
502
|
+
disabled?: boolean | undefined;
|
|
503
|
+
allow?: string[] | undefined;
|
|
504
|
+
disallow?: string[] | undefined;
|
|
505
|
+
}, {
|
|
506
|
+
disabled?: boolean | undefined;
|
|
507
|
+
allow?: string[] | undefined;
|
|
508
|
+
disallow?: string[] | undefined;
|
|
509
|
+
}>>;
|
|
510
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
277
511
|
description?: string | undefined;
|
|
278
|
-
aiSlots?: unknown[] | undefined;
|
|
279
512
|
}[];
|
|
280
513
|
}>;
|
|
281
514
|
generationGuide: z.ZodArray<z.ZodString, "many">;
|
|
@@ -296,14 +529,31 @@ export declare const agentPageSchemaOutputSchema: z.ZodObject<{
|
|
|
296
529
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
297
530
|
dynamic?: boolean | undefined;
|
|
298
531
|
generationHint?: string | undefined;
|
|
532
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
299
533
|
}>;
|
|
300
|
-
role: "layout" | "root" | "section";
|
|
301
534
|
defaultProps: Record<string, unknown>;
|
|
535
|
+
role: "layout" | "root" | "section";
|
|
302
536
|
outputSchema: Record<string, unknown>;
|
|
303
537
|
generationHints: string[];
|
|
304
538
|
label?: string | undefined;
|
|
539
|
+
ai?: z.objectOutputType<{
|
|
540
|
+
instructions: z.ZodString;
|
|
541
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
542
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
543
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
544
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
545
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
546
|
+
}, "strip", z.ZodTypeAny, {
|
|
547
|
+
disabled?: boolean | undefined;
|
|
548
|
+
allow?: string[] | undefined;
|
|
549
|
+
disallow?: string[] | undefined;
|
|
550
|
+
}, {
|
|
551
|
+
disabled?: boolean | undefined;
|
|
552
|
+
allow?: string[] | undefined;
|
|
553
|
+
disallow?: string[] | undefined;
|
|
554
|
+
}>>;
|
|
555
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
305
556
|
description?: string | undefined;
|
|
306
|
-
aiSlots?: unknown[] | undefined;
|
|
307
557
|
}[];
|
|
308
558
|
};
|
|
309
559
|
schemaVersion: "1.0";
|
|
@@ -331,14 +581,31 @@ export declare const agentPageSchemaOutputSchema: z.ZodObject<{
|
|
|
331
581
|
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
332
582
|
dynamic?: boolean | undefined;
|
|
333
583
|
generationHint?: string | undefined;
|
|
584
|
+
ai?: z.infer<typeof agentFieldAiSchema> | undefined;
|
|
334
585
|
}>;
|
|
335
|
-
role: "layout" | "root" | "section";
|
|
336
586
|
defaultProps: Record<string, unknown>;
|
|
587
|
+
role: "layout" | "root" | "section";
|
|
337
588
|
outputSchema: Record<string, unknown>;
|
|
338
589
|
generationHints: string[];
|
|
339
590
|
label?: string | undefined;
|
|
591
|
+
ai?: z.objectInputType<{
|
|
592
|
+
instructions: z.ZodString;
|
|
593
|
+
exclude: z.ZodOptional<z.ZodBoolean>;
|
|
594
|
+
defaultZone: z.ZodOptional<z.ZodObject<{
|
|
595
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
596
|
+
disallow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
597
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
598
|
+
}, "strip", z.ZodTypeAny, {
|
|
599
|
+
disabled?: boolean | undefined;
|
|
600
|
+
allow?: string[] | undefined;
|
|
601
|
+
disallow?: string[] | undefined;
|
|
602
|
+
}, {
|
|
603
|
+
disabled?: boolean | undefined;
|
|
604
|
+
allow?: string[] | undefined;
|
|
605
|
+
disallow?: string[] | undefined;
|
|
606
|
+
}>>;
|
|
607
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
340
608
|
description?: string | undefined;
|
|
341
|
-
aiSlots?: unknown[] | undefined;
|
|
342
609
|
}[];
|
|
343
610
|
};
|
|
344
611
|
schemaVersion: "1.0";
|
|
@@ -492,4 +759,5 @@ export declare function createAgentThemeSchemaSummary(themeOrManifest: ThemeModu
|
|
|
492
759
|
export declare function createPageDataFromAgentContent(contentOutput: unknown): PageData;
|
|
493
760
|
export declare function validateAgentPageContentWithManifest(data: unknown, manifest: ThemeAgentManifest): PageValidationResult;
|
|
494
761
|
export declare function validatePageDataWithAgentManifest(data: unknown, manifest: ThemeAgentManifest): PageValidationResult;
|
|
762
|
+
export {};
|
|
495
763
|
//# sourceMappingURL=agent.d.ts.map
|
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAErF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,EAAE,CAAC,EAAE,aAAa,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAA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;AAqBD;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,WAAW,GAAG,kBAAkB,GAChD,6BAA6B,CAqB/B;AAED,wBAAgB,8BAA8B,CAAC,aAAa,EAAE,OAAO,GAAG,QAAQ,CAe/E;AAED,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,kBAAkB,GAC3B,oBAAoB,CAgCtB;AAED,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,kBAAkB,GAC3B,oBAAoB,CAWtB"}
|
package/dist/agent.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
// `.passthrough()` so any field Puck adds to `FieldAiParams` upstream flows
|
|
3
|
+
// through unchanged. We do not need to re-spec the shape every time Puck
|
|
4
|
+
// extends it — the contract is "whatever plugin-ai accepts".
|
|
5
|
+
const agentFieldAiSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
instructions: z.string().optional(),
|
|
8
|
+
exclude: z.boolean().optional(),
|
|
9
|
+
required: z.boolean().optional(),
|
|
10
|
+
stream: z.boolean().optional(),
|
|
11
|
+
bind: z.string().optional(),
|
|
12
|
+
schema: z.record(z.unknown()).optional(),
|
|
13
|
+
})
|
|
14
|
+
.passthrough()
|
|
15
|
+
.describe("Field-level AI configuration (field.ai), forwarded as-is from Puck plugin-ai.");
|
|
2
16
|
export const agentFieldOutputSchema = z.lazy(() => z.object({
|
|
3
17
|
type: z
|
|
4
18
|
.string()
|
|
@@ -21,7 +35,24 @@ export const agentFieldOutputSchema = z.lazy(() => z.object({
|
|
|
21
35
|
.optional()
|
|
22
36
|
.describe("True when the field has custom rendering or dynamic visibility."),
|
|
23
37
|
generationHint: z.string().optional().describe("Instruction for AI page generation."),
|
|
38
|
+
ai: agentFieldAiSchema.optional(),
|
|
24
39
|
}));
|
|
40
|
+
// `.passthrough()` so any field Puck adds to `ComponentAiParams` upstream
|
|
41
|
+
// (e.g. new placement hints) flows through to the LLM without us having to
|
|
42
|
+
// patch this schema in lock-step.
|
|
43
|
+
const agentComponentAiSchema = z
|
|
44
|
+
.object({
|
|
45
|
+
instructions: z.string(),
|
|
46
|
+
exclude: z.boolean().optional(),
|
|
47
|
+
defaultZone: z
|
|
48
|
+
.object({
|
|
49
|
+
allow: z.array(z.string()).optional(),
|
|
50
|
+
disallow: z.array(z.string()).optional(),
|
|
51
|
+
disabled: z.boolean().optional(),
|
|
52
|
+
})
|
|
53
|
+
.optional(),
|
|
54
|
+
})
|
|
55
|
+
.passthrough();
|
|
25
56
|
export const agentComponentOutputSchema = z.object({
|
|
26
57
|
role: z.enum(["root", "section", "layout"]).describe("Where this component is used."),
|
|
27
58
|
type: z.string().describe("Component type to emit in page content items."),
|
|
@@ -31,7 +62,9 @@ export const agentComponentOutputSchema = z.object({
|
|
|
31
62
|
defaultProps: z.record(z.unknown()).describe("Default props to merge before AI overrides."),
|
|
32
63
|
outputSchema: z.record(z.unknown()).describe("JSON Schema-like shape the AI should output."),
|
|
33
64
|
generationHints: z.array(z.string()).describe("Rules for generating this component."),
|
|
34
|
-
|
|
65
|
+
ai: agentComponentAiSchema
|
|
66
|
+
.optional()
|
|
67
|
+
.describe("Component-level AI instructions and flags (component.ai)."),
|
|
35
68
|
});
|
|
36
69
|
export const agentPageSchemaOutputSchema = z.object({
|
|
37
70
|
schemaVersion: z.literal("1.0"),
|
|
@@ -137,12 +170,42 @@ function fieldSchema(field) {
|
|
|
137
170
|
if (typeof field.render === "function" || schema.type === "custom") {
|
|
138
171
|
schema.dynamic = true;
|
|
139
172
|
}
|
|
173
|
+
if (isRecord(field.ai)) {
|
|
174
|
+
// Forward every serializable key Puck plugin-ai accepts on `FieldAiParams`
|
|
175
|
+
// (instructions/required/exclude/stream/bind/schema today, plus anything
|
|
176
|
+
// added upstream tomorrow) without re-listing the shape here.
|
|
177
|
+
const serialized = serializable(field.ai);
|
|
178
|
+
if (isRecord(serialized) && Object.keys(serialized).length > 0) {
|
|
179
|
+
schema.ai = serialized;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
140
182
|
return schema;
|
|
141
183
|
}
|
|
142
184
|
function fieldsSchema(fields) {
|
|
143
185
|
return Object.fromEntries(Object.entries(fields).map(([key, field]) => [key, fieldSchema(field)]));
|
|
144
186
|
}
|
|
145
|
-
function
|
|
187
|
+
function readComponentAi(component) {
|
|
188
|
+
const raw = component.ai;
|
|
189
|
+
if (!isRecord(raw)) {
|
|
190
|
+
return undefined;
|
|
191
|
+
}
|
|
192
|
+
// Match `check.ts` and trim before deciding if instructions are non-empty,
|
|
193
|
+
// so a manifest built with `--skip-check` still does not ship pure
|
|
194
|
+
// whitespace as a component description.
|
|
195
|
+
const instructions = typeof raw.instructions === "string" ? raw.instructions.trim() : "";
|
|
196
|
+
if (instructions.length === 0) {
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
// Forward every serializable key Puck plugin-ai accepts on `ComponentAiParams`,
|
|
200
|
+
// not only the ones we know today. This lets the AI manifest stay aligned
|
|
201
|
+
// with upstream as Puck adds new component-level AI hints. We trust theme
|
|
202
|
+
// authors to populate sensible values; `suda theme check` is the gate that
|
|
203
|
+
// rejects empty/short instructions before build.
|
|
204
|
+
const serialized = serializable(raw);
|
|
205
|
+
const passthrough = isRecord(serialized) ? serialized : {};
|
|
206
|
+
return { ...passthrough, instructions };
|
|
207
|
+
}
|
|
208
|
+
function componentSchema(type, component) {
|
|
146
209
|
const schema = {
|
|
147
210
|
type,
|
|
148
211
|
fields: fieldsSchema(asRecord(component.fields)),
|
|
@@ -155,17 +218,18 @@ function componentSchema(type, component, aiSlots) {
|
|
|
155
218
|
if (typeof description === "string") {
|
|
156
219
|
schema.description = description;
|
|
157
220
|
}
|
|
158
|
-
|
|
159
|
-
|
|
221
|
+
const ai = readComponentAi(component);
|
|
222
|
+
if (ai !== undefined) {
|
|
223
|
+
schema.ai = ai;
|
|
160
224
|
}
|
|
161
225
|
return schema;
|
|
162
226
|
}
|
|
163
|
-
function componentSchemas(components
|
|
227
|
+
function componentSchemas(components) {
|
|
164
228
|
if (!isRecord(components)) {
|
|
165
229
|
return [];
|
|
166
230
|
}
|
|
167
231
|
return Object.entries(components)
|
|
168
|
-
.map(([type, component]) => componentSchema(type, component
|
|
232
|
+
.map(([type, component]) => componentSchema(type, component))
|
|
169
233
|
.sort((a, b) => a.type.localeCompare(b.type));
|
|
170
234
|
}
|
|
171
235
|
function sectionTypes(data) {
|
|
@@ -210,7 +274,7 @@ export function createThemeAgentManifest(theme) {
|
|
|
210
274
|
manifest: theme.manifest,
|
|
211
275
|
root: componentSchema("root", theme.pageConfig.root ??
|
|
212
276
|
emptyRootComponent()),
|
|
213
|
-
sections: componentSchemas(theme.pageConfig.components
|
|
277
|
+
sections: componentSchemas(theme.pageConfig.components),
|
|
214
278
|
layoutComponents: componentSchemas(theme.layoutConfig.components),
|
|
215
279
|
starterPages: theme.starterPages.map((page) => {
|
|
216
280
|
const summary = {
|
|
@@ -405,8 +469,8 @@ export function createAgentComponentSchemaOutput(component, role) {
|
|
|
405
469
|
if (component.description !== undefined) {
|
|
406
470
|
output.description = component.description;
|
|
407
471
|
}
|
|
408
|
-
if (component.
|
|
409
|
-
output.
|
|
472
|
+
if (component.ai !== undefined) {
|
|
473
|
+
output.ai = component.ai;
|
|
410
474
|
}
|
|
411
475
|
return agentComponentOutputSchema.parse(output);
|
|
412
476
|
}
|