@sudajs/theme-engine 0.0.2 → 0.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 +495 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +603 -0
- package/dist/agent.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +2 -2
- package/dist/server.d.ts +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -0
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/agent.d.ts
ADDED
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { AiSlotDescriptor, PageData, ThemeManifest, ThemeModule } from "./types";
|
|
3
|
+
export interface AgentFieldSchema {
|
|
4
|
+
type: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
options?: unknown;
|
|
8
|
+
fields?: Record<string, AgentFieldSchema>;
|
|
9
|
+
arrayFields?: Record<string, AgentFieldSchema>;
|
|
10
|
+
dynamic?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface AgentComponentSchema {
|
|
13
|
+
type: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
fields: Record<string, AgentFieldSchema>;
|
|
17
|
+
defaultProps: Record<string, unknown>;
|
|
18
|
+
aiSlots?: AiSlotDescriptor[];
|
|
19
|
+
}
|
|
20
|
+
export interface AgentStarterPageSummary {
|
|
21
|
+
slug: string;
|
|
22
|
+
title: string;
|
|
23
|
+
isHome?: boolean;
|
|
24
|
+
data?: PageData;
|
|
25
|
+
sectionTypes: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface ThemeAgentManifest {
|
|
28
|
+
schemaVersion: "1.0";
|
|
29
|
+
manifest: ThemeManifest;
|
|
30
|
+
/**
|
|
31
|
+
* @internal Legacy Puck root component schema kept for internal compatibility
|
|
32
|
+
* (e.g. theme/layout introspection and historical PageData snapshots). It MUST
|
|
33
|
+
* NOT be surfaced in any AI-facing schema or page content output. AI agents
|
|
34
|
+
* generate only `content` and optional `zones`; `root` is rebuilt by Suda's
|
|
35
|
+
* internal adapter as `{ root: { props: {} }, content, zones? }` before save.
|
|
36
|
+
*/
|
|
37
|
+
root: AgentComponentSchema;
|
|
38
|
+
sections: AgentComponentSchema[];
|
|
39
|
+
layoutComponents: AgentComponentSchema[];
|
|
40
|
+
starterPages: AgentStarterPageSummary[];
|
|
41
|
+
}
|
|
42
|
+
export interface PageValidationIssue {
|
|
43
|
+
path: string;
|
|
44
|
+
message: string;
|
|
45
|
+
}
|
|
46
|
+
export interface PageValidationResult {
|
|
47
|
+
valid: boolean;
|
|
48
|
+
issues: PageValidationIssue[];
|
|
49
|
+
}
|
|
50
|
+
export interface AgentPageContentOutput {
|
|
51
|
+
content: PageData["content"];
|
|
52
|
+
zones?: PageData["zones"];
|
|
53
|
+
}
|
|
54
|
+
export declare const agentFieldOutputSchema: z.ZodType<{
|
|
55
|
+
type: string;
|
|
56
|
+
label?: string | undefined;
|
|
57
|
+
description?: string | undefined;
|
|
58
|
+
required: boolean;
|
|
59
|
+
defaultValue?: unknown;
|
|
60
|
+
options?: unknown;
|
|
61
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
62
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
63
|
+
dynamic?: boolean | undefined;
|
|
64
|
+
generationHint?: string | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
export declare const agentComponentOutputSchema: z.ZodObject<{
|
|
67
|
+
role: z.ZodEnum<["root", "section", "layout"]>;
|
|
68
|
+
type: z.ZodString;
|
|
69
|
+
label: z.ZodOptional<z.ZodString>;
|
|
70
|
+
description: z.ZodOptional<z.ZodString>;
|
|
71
|
+
fields: z.ZodRecord<z.ZodString, z.ZodType<{
|
|
72
|
+
type: string;
|
|
73
|
+
label?: string | undefined;
|
|
74
|
+
description?: string | undefined;
|
|
75
|
+
required: boolean;
|
|
76
|
+
defaultValue?: unknown;
|
|
77
|
+
options?: unknown;
|
|
78
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
79
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
80
|
+
dynamic?: boolean | undefined;
|
|
81
|
+
generationHint?: string | undefined;
|
|
82
|
+
}, z.ZodTypeDef, {
|
|
83
|
+
type: string;
|
|
84
|
+
label?: string | undefined;
|
|
85
|
+
description?: string | undefined;
|
|
86
|
+
required: boolean;
|
|
87
|
+
defaultValue?: unknown;
|
|
88
|
+
options?: unknown;
|
|
89
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
90
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
91
|
+
dynamic?: boolean | undefined;
|
|
92
|
+
generationHint?: string | undefined;
|
|
93
|
+
}>>;
|
|
94
|
+
defaultProps: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
95
|
+
outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
96
|
+
generationHints: z.ZodArray<z.ZodString, "many">;
|
|
97
|
+
aiSlots: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
type: string;
|
|
100
|
+
fields: Record<string, {
|
|
101
|
+
type: string;
|
|
102
|
+
label?: string | undefined;
|
|
103
|
+
description?: string | undefined;
|
|
104
|
+
required: boolean;
|
|
105
|
+
defaultValue?: unknown;
|
|
106
|
+
options?: unknown;
|
|
107
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
108
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
109
|
+
dynamic?: boolean | undefined;
|
|
110
|
+
generationHint?: string | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
role: "layout" | "root" | "section";
|
|
113
|
+
defaultProps: Record<string, unknown>;
|
|
114
|
+
outputSchema: Record<string, unknown>;
|
|
115
|
+
generationHints: string[];
|
|
116
|
+
label?: string | undefined;
|
|
117
|
+
description?: string | undefined;
|
|
118
|
+
aiSlots?: unknown[] | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
type: string;
|
|
121
|
+
fields: Record<string, {
|
|
122
|
+
type: string;
|
|
123
|
+
label?: string | undefined;
|
|
124
|
+
description?: string | undefined;
|
|
125
|
+
required: boolean;
|
|
126
|
+
defaultValue?: unknown;
|
|
127
|
+
options?: unknown;
|
|
128
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
129
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
130
|
+
dynamic?: boolean | undefined;
|
|
131
|
+
generationHint?: string | undefined;
|
|
132
|
+
}>;
|
|
133
|
+
role: "layout" | "root" | "section";
|
|
134
|
+
defaultProps: Record<string, unknown>;
|
|
135
|
+
outputSchema: Record<string, unknown>;
|
|
136
|
+
generationHints: string[];
|
|
137
|
+
label?: string | undefined;
|
|
138
|
+
description?: string | undefined;
|
|
139
|
+
aiSlots?: unknown[] | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
export declare const agentPageSchemaOutputSchema: z.ZodObject<{
|
|
142
|
+
schemaVersion: z.ZodLiteral<"1.0">;
|
|
143
|
+
kind: z.ZodLiteral<"pageContentSchema">;
|
|
144
|
+
theme: z.ZodObject<{
|
|
145
|
+
key: z.ZodString;
|
|
146
|
+
version: z.ZodString;
|
|
147
|
+
name: z.ZodString;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
key: string;
|
|
150
|
+
version: string;
|
|
151
|
+
name: string;
|
|
152
|
+
}, {
|
|
153
|
+
key: string;
|
|
154
|
+
version: string;
|
|
155
|
+
name: string;
|
|
156
|
+
}>;
|
|
157
|
+
pageContentOutputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
158
|
+
components: z.ZodObject<{
|
|
159
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
160
|
+
role: z.ZodEnum<["root", "section", "layout"]>;
|
|
161
|
+
type: z.ZodString;
|
|
162
|
+
label: z.ZodOptional<z.ZodString>;
|
|
163
|
+
description: z.ZodOptional<z.ZodString>;
|
|
164
|
+
fields: z.ZodRecord<z.ZodString, z.ZodType<{
|
|
165
|
+
type: string;
|
|
166
|
+
label?: string | undefined;
|
|
167
|
+
description?: string | undefined;
|
|
168
|
+
required: boolean;
|
|
169
|
+
defaultValue?: unknown;
|
|
170
|
+
options?: unknown;
|
|
171
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
172
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
173
|
+
dynamic?: boolean | undefined;
|
|
174
|
+
generationHint?: string | undefined;
|
|
175
|
+
}, z.ZodTypeDef, {
|
|
176
|
+
type: string;
|
|
177
|
+
label?: string | undefined;
|
|
178
|
+
description?: string | undefined;
|
|
179
|
+
required: boolean;
|
|
180
|
+
defaultValue?: unknown;
|
|
181
|
+
options?: unknown;
|
|
182
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
183
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
184
|
+
dynamic?: boolean | undefined;
|
|
185
|
+
generationHint?: string | undefined;
|
|
186
|
+
}>>;
|
|
187
|
+
defaultProps: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
188
|
+
outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
189
|
+
generationHints: z.ZodArray<z.ZodString, "many">;
|
|
190
|
+
aiSlots: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
191
|
+
}, "strip", z.ZodTypeAny, {
|
|
192
|
+
type: string;
|
|
193
|
+
fields: Record<string, {
|
|
194
|
+
type: string;
|
|
195
|
+
label?: string | undefined;
|
|
196
|
+
description?: string | undefined;
|
|
197
|
+
required: boolean;
|
|
198
|
+
defaultValue?: unknown;
|
|
199
|
+
options?: unknown;
|
|
200
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
201
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
202
|
+
dynamic?: boolean | undefined;
|
|
203
|
+
generationHint?: string | undefined;
|
|
204
|
+
}>;
|
|
205
|
+
role: "layout" | "root" | "section";
|
|
206
|
+
defaultProps: Record<string, unknown>;
|
|
207
|
+
outputSchema: Record<string, unknown>;
|
|
208
|
+
generationHints: string[];
|
|
209
|
+
label?: string | undefined;
|
|
210
|
+
description?: string | undefined;
|
|
211
|
+
aiSlots?: unknown[] | undefined;
|
|
212
|
+
}, {
|
|
213
|
+
type: string;
|
|
214
|
+
fields: Record<string, {
|
|
215
|
+
type: string;
|
|
216
|
+
label?: string | undefined;
|
|
217
|
+
description?: string | undefined;
|
|
218
|
+
required: boolean;
|
|
219
|
+
defaultValue?: unknown;
|
|
220
|
+
options?: unknown;
|
|
221
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
222
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
223
|
+
dynamic?: boolean | undefined;
|
|
224
|
+
generationHint?: string | undefined;
|
|
225
|
+
}>;
|
|
226
|
+
role: "layout" | "root" | "section";
|
|
227
|
+
defaultProps: Record<string, unknown>;
|
|
228
|
+
outputSchema: Record<string, unknown>;
|
|
229
|
+
generationHints: string[];
|
|
230
|
+
label?: string | undefined;
|
|
231
|
+
description?: string | undefined;
|
|
232
|
+
aiSlots?: unknown[] | undefined;
|
|
233
|
+
}>, "many">;
|
|
234
|
+
}, "strip", z.ZodTypeAny, {
|
|
235
|
+
sections: {
|
|
236
|
+
type: string;
|
|
237
|
+
fields: Record<string, {
|
|
238
|
+
type: string;
|
|
239
|
+
label?: string | undefined;
|
|
240
|
+
description?: string | undefined;
|
|
241
|
+
required: boolean;
|
|
242
|
+
defaultValue?: unknown;
|
|
243
|
+
options?: unknown;
|
|
244
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
245
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
246
|
+
dynamic?: boolean | undefined;
|
|
247
|
+
generationHint?: string | undefined;
|
|
248
|
+
}>;
|
|
249
|
+
role: "layout" | "root" | "section";
|
|
250
|
+
defaultProps: Record<string, unknown>;
|
|
251
|
+
outputSchema: Record<string, unknown>;
|
|
252
|
+
generationHints: string[];
|
|
253
|
+
label?: string | undefined;
|
|
254
|
+
description?: string | undefined;
|
|
255
|
+
aiSlots?: unknown[] | undefined;
|
|
256
|
+
}[];
|
|
257
|
+
}, {
|
|
258
|
+
sections: {
|
|
259
|
+
type: string;
|
|
260
|
+
fields: Record<string, {
|
|
261
|
+
type: string;
|
|
262
|
+
label?: string | undefined;
|
|
263
|
+
description?: string | undefined;
|
|
264
|
+
required: boolean;
|
|
265
|
+
defaultValue?: unknown;
|
|
266
|
+
options?: unknown;
|
|
267
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
268
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
269
|
+
dynamic?: boolean | undefined;
|
|
270
|
+
generationHint?: string | undefined;
|
|
271
|
+
}>;
|
|
272
|
+
role: "layout" | "root" | "section";
|
|
273
|
+
defaultProps: Record<string, unknown>;
|
|
274
|
+
outputSchema: Record<string, unknown>;
|
|
275
|
+
generationHints: string[];
|
|
276
|
+
label?: string | undefined;
|
|
277
|
+
description?: string | undefined;
|
|
278
|
+
aiSlots?: unknown[] | undefined;
|
|
279
|
+
}[];
|
|
280
|
+
}>;
|
|
281
|
+
generationGuide: z.ZodArray<z.ZodString, "many">;
|
|
282
|
+
examplePageContent: z.ZodOptional<z.ZodUnknown>;
|
|
283
|
+
}, "strip", z.ZodTypeAny, {
|
|
284
|
+
kind: "pageContentSchema";
|
|
285
|
+
components: {
|
|
286
|
+
sections: {
|
|
287
|
+
type: string;
|
|
288
|
+
fields: Record<string, {
|
|
289
|
+
type: string;
|
|
290
|
+
label?: string | undefined;
|
|
291
|
+
description?: string | undefined;
|
|
292
|
+
required: boolean;
|
|
293
|
+
defaultValue?: unknown;
|
|
294
|
+
options?: unknown;
|
|
295
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
296
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
297
|
+
dynamic?: boolean | undefined;
|
|
298
|
+
generationHint?: string | undefined;
|
|
299
|
+
}>;
|
|
300
|
+
role: "layout" | "root" | "section";
|
|
301
|
+
defaultProps: Record<string, unknown>;
|
|
302
|
+
outputSchema: Record<string, unknown>;
|
|
303
|
+
generationHints: string[];
|
|
304
|
+
label?: string | undefined;
|
|
305
|
+
description?: string | undefined;
|
|
306
|
+
aiSlots?: unknown[] | undefined;
|
|
307
|
+
}[];
|
|
308
|
+
};
|
|
309
|
+
schemaVersion: "1.0";
|
|
310
|
+
theme: {
|
|
311
|
+
key: string;
|
|
312
|
+
version: string;
|
|
313
|
+
name: string;
|
|
314
|
+
};
|
|
315
|
+
pageContentOutputSchema: Record<string, unknown>;
|
|
316
|
+
generationGuide: string[];
|
|
317
|
+
examplePageContent?: unknown;
|
|
318
|
+
}, {
|
|
319
|
+
kind: "pageContentSchema";
|
|
320
|
+
components: {
|
|
321
|
+
sections: {
|
|
322
|
+
type: string;
|
|
323
|
+
fields: Record<string, {
|
|
324
|
+
type: string;
|
|
325
|
+
label?: string | undefined;
|
|
326
|
+
description?: string | undefined;
|
|
327
|
+
required: boolean;
|
|
328
|
+
defaultValue?: unknown;
|
|
329
|
+
options?: unknown;
|
|
330
|
+
fields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
331
|
+
arrayFields?: Record<string, z.infer<typeof agentFieldOutputSchema>> | undefined;
|
|
332
|
+
dynamic?: boolean | undefined;
|
|
333
|
+
generationHint?: string | undefined;
|
|
334
|
+
}>;
|
|
335
|
+
role: "layout" | "root" | "section";
|
|
336
|
+
defaultProps: Record<string, unknown>;
|
|
337
|
+
outputSchema: Record<string, unknown>;
|
|
338
|
+
generationHints: string[];
|
|
339
|
+
label?: string | undefined;
|
|
340
|
+
description?: string | undefined;
|
|
341
|
+
aiSlots?: unknown[] | undefined;
|
|
342
|
+
}[];
|
|
343
|
+
};
|
|
344
|
+
schemaVersion: "1.0";
|
|
345
|
+
theme: {
|
|
346
|
+
key: string;
|
|
347
|
+
version: string;
|
|
348
|
+
name: string;
|
|
349
|
+
};
|
|
350
|
+
pageContentOutputSchema: Record<string, unknown>;
|
|
351
|
+
generationGuide: string[];
|
|
352
|
+
examplePageContent?: unknown;
|
|
353
|
+
}>;
|
|
354
|
+
export declare const agentValidationResultSchema: z.ZodObject<{
|
|
355
|
+
valid: z.ZodBoolean;
|
|
356
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
357
|
+
path: z.ZodString;
|
|
358
|
+
message: z.ZodString;
|
|
359
|
+
}, "strip", z.ZodTypeAny, {
|
|
360
|
+
path: string;
|
|
361
|
+
message: string;
|
|
362
|
+
}, {
|
|
363
|
+
path: string;
|
|
364
|
+
message: string;
|
|
365
|
+
}>, "many">;
|
|
366
|
+
}, "strip", z.ZodTypeAny, {
|
|
367
|
+
issues: {
|
|
368
|
+
path: string;
|
|
369
|
+
message: string;
|
|
370
|
+
}[];
|
|
371
|
+
valid: boolean;
|
|
372
|
+
}, {
|
|
373
|
+
issues: {
|
|
374
|
+
path: string;
|
|
375
|
+
message: string;
|
|
376
|
+
}[];
|
|
377
|
+
valid: boolean;
|
|
378
|
+
}>;
|
|
379
|
+
export declare const agentSectionSummaryOutputSchema: z.ZodObject<{
|
|
380
|
+
type: z.ZodString;
|
|
381
|
+
label: z.ZodOptional<z.ZodString>;
|
|
382
|
+
description: z.ZodOptional<z.ZodString>;
|
|
383
|
+
fieldKeys: z.ZodArray<z.ZodString, "many">;
|
|
384
|
+
requiredFieldKeys: z.ZodArray<z.ZodString, "many">;
|
|
385
|
+
}, "strip", z.ZodTypeAny, {
|
|
386
|
+
type: string;
|
|
387
|
+
fieldKeys: string[];
|
|
388
|
+
requiredFieldKeys: string[];
|
|
389
|
+
label?: string | undefined;
|
|
390
|
+
description?: string | undefined;
|
|
391
|
+
}, {
|
|
392
|
+
type: string;
|
|
393
|
+
fieldKeys: string[];
|
|
394
|
+
requiredFieldKeys: string[];
|
|
395
|
+
label?: string | undefined;
|
|
396
|
+
description?: string | undefined;
|
|
397
|
+
}>;
|
|
398
|
+
export declare const agentThemeSchemaSummaryOutputSchema: z.ZodObject<{
|
|
399
|
+
schemaVersion: z.ZodLiteral<"1.0">;
|
|
400
|
+
kind: z.ZodLiteral<"pageContentSchemaSummary">;
|
|
401
|
+
theme: z.ZodObject<{
|
|
402
|
+
key: z.ZodString;
|
|
403
|
+
version: z.ZodString;
|
|
404
|
+
name: z.ZodString;
|
|
405
|
+
}, "strip", z.ZodTypeAny, {
|
|
406
|
+
key: string;
|
|
407
|
+
version: string;
|
|
408
|
+
name: string;
|
|
409
|
+
}, {
|
|
410
|
+
key: string;
|
|
411
|
+
version: string;
|
|
412
|
+
name: string;
|
|
413
|
+
}>;
|
|
414
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
415
|
+
type: z.ZodString;
|
|
416
|
+
label: z.ZodOptional<z.ZodString>;
|
|
417
|
+
description: z.ZodOptional<z.ZodString>;
|
|
418
|
+
fieldKeys: z.ZodArray<z.ZodString, "many">;
|
|
419
|
+
requiredFieldKeys: z.ZodArray<z.ZodString, "many">;
|
|
420
|
+
}, "strip", z.ZodTypeAny, {
|
|
421
|
+
type: string;
|
|
422
|
+
fieldKeys: string[];
|
|
423
|
+
requiredFieldKeys: string[];
|
|
424
|
+
label?: string | undefined;
|
|
425
|
+
description?: string | undefined;
|
|
426
|
+
}, {
|
|
427
|
+
type: string;
|
|
428
|
+
fieldKeys: string[];
|
|
429
|
+
requiredFieldKeys: string[];
|
|
430
|
+
label?: string | undefined;
|
|
431
|
+
description?: string | undefined;
|
|
432
|
+
}>, "many">;
|
|
433
|
+
generationGuide: z.ZodArray<z.ZodString, "many">;
|
|
434
|
+
}, "strip", z.ZodTypeAny, {
|
|
435
|
+
kind: "pageContentSchemaSummary";
|
|
436
|
+
schemaVersion: "1.0";
|
|
437
|
+
theme: {
|
|
438
|
+
key: string;
|
|
439
|
+
version: string;
|
|
440
|
+
name: string;
|
|
441
|
+
};
|
|
442
|
+
sections: {
|
|
443
|
+
type: string;
|
|
444
|
+
fieldKeys: string[];
|
|
445
|
+
requiredFieldKeys: string[];
|
|
446
|
+
label?: string | undefined;
|
|
447
|
+
description?: string | undefined;
|
|
448
|
+
}[];
|
|
449
|
+
generationGuide: string[];
|
|
450
|
+
}, {
|
|
451
|
+
kind: "pageContentSchemaSummary";
|
|
452
|
+
schemaVersion: "1.0";
|
|
453
|
+
theme: {
|
|
454
|
+
key: string;
|
|
455
|
+
version: string;
|
|
456
|
+
name: string;
|
|
457
|
+
};
|
|
458
|
+
sections: {
|
|
459
|
+
type: string;
|
|
460
|
+
fieldKeys: string[];
|
|
461
|
+
requiredFieldKeys: string[];
|
|
462
|
+
label?: string | undefined;
|
|
463
|
+
description?: string | undefined;
|
|
464
|
+
}[];
|
|
465
|
+
generationGuide: string[];
|
|
466
|
+
}>;
|
|
467
|
+
export type AgentFieldOutput = z.infer<typeof agentFieldOutputSchema>;
|
|
468
|
+
export type AgentComponentOutput = z.infer<typeof agentComponentOutputSchema>;
|
|
469
|
+
export type AgentPageSchemaOutput = z.infer<typeof agentPageSchemaOutputSchema>;
|
|
470
|
+
export type AgentValidationResult = z.infer<typeof agentValidationResultSchema>;
|
|
471
|
+
export type AgentSectionSummaryOutput = z.infer<typeof agentSectionSummaryOutputSchema>;
|
|
472
|
+
export type AgentThemeSchemaSummaryOutput = z.infer<typeof agentThemeSchemaSummaryOutputSchema>;
|
|
473
|
+
export interface AgentPageSchemaOutputOptions {
|
|
474
|
+
includeExample?: boolean;
|
|
475
|
+
}
|
|
476
|
+
export declare function createThemeAgentManifest(theme: ThemeModule): ThemeAgentManifest;
|
|
477
|
+
export declare function createAgentComponentSchemaOutput(component: AgentComponentSchema, role: "root" | "section" | "layout"): AgentComponentOutput;
|
|
478
|
+
export declare function createAgentExamplePageContent(manifest: ThemeAgentManifest): AgentPageContentOutput;
|
|
479
|
+
export declare function createAgentExamplePageData(manifest: ThemeAgentManifest): PageData;
|
|
480
|
+
export declare function createAgentPageSchemaOutput(themeOrManifest: ThemeModule | ThemeAgentManifest, options?: AgentPageSchemaOutputOptions): AgentPageSchemaOutput;
|
|
481
|
+
export declare function findAgentSection(manifest: ThemeAgentManifest, sectionType: string): AgentComponentSchema | null;
|
|
482
|
+
/**
|
|
483
|
+
* Lightweight theme schema summary for AI prompt context. Pair with
|
|
484
|
+
* createAgentComponentSchemaOutput(section, "section") (e.g. via a
|
|
485
|
+
* `getThemeSectionSchema` tool) to fetch the full schema for a single
|
|
486
|
+
* section on demand. Keeps prompts small while preserving the AI page
|
|
487
|
+
* content contract: AI generates only `{ content, zones? }`. Used by the
|
|
488
|
+
* workspace AI chat today; onboarding orchestration will adopt the same
|
|
489
|
+
* contract in a follow-up.
|
|
490
|
+
*/
|
|
491
|
+
export declare function createAgentThemeSchemaSummary(themeOrManifest: ThemeModule | ThemeAgentManifest): AgentThemeSchemaSummaryOutput;
|
|
492
|
+
export declare function createPageDataFromAgentContent(contentOutput: unknown): PageData;
|
|
493
|
+
export declare function validateAgentPageContentWithManifest(data: unknown, manifest: ThemeAgentManifest): PageValidationResult;
|
|
494
|
+
export declare function validatePageDataWithAgentManifest(data: unknown, manifest: ThemeAgentManifest): PageValidationResult;
|
|
495
|
+
//# sourceMappingURL=agent.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,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,MAAM,WAAW,4BAA4B;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAmJD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,WAAW,GAAG,kBAAkB,CAwB/E;AAkKD,wBAAgB,gCAAgC,CAC9C,SAAS,EAAE,oBAAoB,EAC/B,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAClC,oBAAoB,CA2CtB;AAED,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,kBAAkB,GAC3B,sBAAsB,CA0BxB;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,kBAAkB,GAAG,QAAQ,CAEjF;AAgCD,wBAAgB,2BAA2B,CACzC,eAAe,EAAE,WAAW,GAAG,kBAAkB,EACjD,OAAO,GAAE,4BAAiC,GACzC,qBAAqB,CA8BvB;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,kBAAkB,EAC5B,WAAW,EAAE,MAAM,GAClB,oBAAoB,GAAG,IAAI,CAE7B;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
ADDED
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const agentFieldOutputSchema = z.lazy(() => z.object({
|
|
3
|
+
type: z
|
|
4
|
+
.string()
|
|
5
|
+
.describe("Puck or Suda field type, such as text, textarea, select, array, object, custom."),
|
|
6
|
+
label: z.string().optional().describe("Theme-authored label for this field."),
|
|
7
|
+
description: z.string().optional().describe("Theme-authored meaning for this field."),
|
|
8
|
+
required: z.boolean().describe("Whether generated props should include this field."),
|
|
9
|
+
defaultValue: z.unknown().optional().describe("Default value to start from when generating props."),
|
|
10
|
+
options: z.unknown().optional().describe("Allowed options or option metadata for choice fields."),
|
|
11
|
+
fields: z
|
|
12
|
+
.record(agentFieldOutputSchema)
|
|
13
|
+
.optional()
|
|
14
|
+
.describe("Nested object fields when this field contains an object."),
|
|
15
|
+
arrayFields: z
|
|
16
|
+
.record(agentFieldOutputSchema)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Fields for each item when this field contains an array."),
|
|
19
|
+
dynamic: z
|
|
20
|
+
.boolean()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe("True when the field has custom rendering or dynamic visibility."),
|
|
23
|
+
generationHint: z.string().optional().describe("Instruction for AI page generation."),
|
|
24
|
+
}));
|
|
25
|
+
export const agentComponentOutputSchema = z.object({
|
|
26
|
+
role: z.enum(["root", "section", "layout"]).describe("Where this component is used."),
|
|
27
|
+
type: z.string().describe("Component type to emit in page content items."),
|
|
28
|
+
label: z.string().optional().describe("Theme-authored component label."),
|
|
29
|
+
description: z.string().optional().describe("Theme-authored component description."),
|
|
30
|
+
fields: z.record(agentFieldOutputSchema).describe("Props fields accepted by this component."),
|
|
31
|
+
defaultProps: z.record(z.unknown()).describe("Default props to merge before AI overrides."),
|
|
32
|
+
outputSchema: z.record(z.unknown()).describe("JSON Schema-like shape the AI should output."),
|
|
33
|
+
generationHints: z.array(z.string()).describe("Rules for generating this component."),
|
|
34
|
+
aiSlots: z.array(z.unknown()).optional().describe("Editable AI slot descriptors when available."),
|
|
35
|
+
});
|
|
36
|
+
export const agentPageSchemaOutputSchema = z.object({
|
|
37
|
+
schemaVersion: z.literal("1.0"),
|
|
38
|
+
kind: z.literal("pageContentSchema"),
|
|
39
|
+
theme: z.object({
|
|
40
|
+
key: z.string(),
|
|
41
|
+
version: z.string(),
|
|
42
|
+
name: z.string(),
|
|
43
|
+
}),
|
|
44
|
+
pageContentOutputSchema: z
|
|
45
|
+
.record(z.unknown())
|
|
46
|
+
.describe("JSON Schema-like shape for AI-generated page content."),
|
|
47
|
+
components: z.object({
|
|
48
|
+
sections: z.array(agentComponentOutputSchema),
|
|
49
|
+
}),
|
|
50
|
+
generationGuide: z.array(z.string()).describe("Ordered rules an AI should follow."),
|
|
51
|
+
examplePageContent: z.unknown().optional().describe("Example AI-generated page content."),
|
|
52
|
+
});
|
|
53
|
+
export const agentValidationResultSchema = z.object({
|
|
54
|
+
valid: z.boolean(),
|
|
55
|
+
issues: z.array(z.object({
|
|
56
|
+
path: z.string(),
|
|
57
|
+
message: z.string(),
|
|
58
|
+
})),
|
|
59
|
+
});
|
|
60
|
+
export const agentSectionSummaryOutputSchema = z.object({
|
|
61
|
+
type: z.string().describe("Section component type to emit in page content items."),
|
|
62
|
+
label: z.string().optional().describe("Theme-authored section label."),
|
|
63
|
+
description: z.string().optional().describe("Theme-authored section description."),
|
|
64
|
+
fieldKeys: z
|
|
65
|
+
.array(z.string())
|
|
66
|
+
.describe("All prop keys this section accepts. Always includes 'id'. Use getThemeSectionSchema to inspect a field's type, options, and default value before generating its prop."),
|
|
67
|
+
requiredFieldKeys: z
|
|
68
|
+
.array(z.string())
|
|
69
|
+
.describe("Prop keys that MUST be present in generated content. Always includes 'id'."),
|
|
70
|
+
});
|
|
71
|
+
export const agentThemeSchemaSummaryOutputSchema = z.object({
|
|
72
|
+
schemaVersion: z.literal("1.0"),
|
|
73
|
+
kind: z.literal("pageContentSchemaSummary"),
|
|
74
|
+
theme: z.object({
|
|
75
|
+
key: z.string(),
|
|
76
|
+
version: z.string(),
|
|
77
|
+
name: z.string(),
|
|
78
|
+
}),
|
|
79
|
+
sections: z.array(agentSectionSummaryOutputSchema),
|
|
80
|
+
generationGuide: z.array(z.string()).describe("Ordered rules an AI should follow."),
|
|
81
|
+
});
|
|
82
|
+
function isRecord(value) {
|
|
83
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
84
|
+
}
|
|
85
|
+
function asRecord(value) {
|
|
86
|
+
return isRecord(value) ? value : {};
|
|
87
|
+
}
|
|
88
|
+
function serializable(value) {
|
|
89
|
+
if (typeof value === "function" || typeof value === "symbol" || typeof value === "undefined") {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
if (Array.isArray(value)) {
|
|
93
|
+
return value
|
|
94
|
+
.map((item) => serializable(item))
|
|
95
|
+
.filter((item) => item !== undefined);
|
|
96
|
+
}
|
|
97
|
+
if (isRecord(value)) {
|
|
98
|
+
const next = {};
|
|
99
|
+
for (const [key, child] of Object.entries(value)) {
|
|
100
|
+
const serialized = serializable(child);
|
|
101
|
+
if (serialized !== undefined) {
|
|
102
|
+
next[key] = serialized;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return next;
|
|
106
|
+
}
|
|
107
|
+
return value;
|
|
108
|
+
}
|
|
109
|
+
function fieldSchema(field) {
|
|
110
|
+
if (!isRecord(field)) {
|
|
111
|
+
return { type: "unknown", dynamic: true };
|
|
112
|
+
}
|
|
113
|
+
const schema = {
|
|
114
|
+
type: typeof field.type === "string" ? field.type : "unknown",
|
|
115
|
+
};
|
|
116
|
+
if (typeof field.label === "string") {
|
|
117
|
+
schema.label = field.label;
|
|
118
|
+
}
|
|
119
|
+
if (typeof field.description === "string") {
|
|
120
|
+
schema.description = field.description;
|
|
121
|
+
}
|
|
122
|
+
if (field.options !== undefined) {
|
|
123
|
+
schema.options = serializable(field.options);
|
|
124
|
+
}
|
|
125
|
+
if (typeof field.visible === "function") {
|
|
126
|
+
schema.dynamic = true;
|
|
127
|
+
}
|
|
128
|
+
if (isRecord(field.objectFields)) {
|
|
129
|
+
schema.fields = fieldsSchema(field.objectFields);
|
|
130
|
+
}
|
|
131
|
+
else if (isRecord(field.fields)) {
|
|
132
|
+
schema.fields = fieldsSchema(field.fields);
|
|
133
|
+
}
|
|
134
|
+
if (isRecord(field.arrayFields)) {
|
|
135
|
+
schema.arrayFields = fieldsSchema(field.arrayFields);
|
|
136
|
+
}
|
|
137
|
+
if (typeof field.render === "function" || schema.type === "custom") {
|
|
138
|
+
schema.dynamic = true;
|
|
139
|
+
}
|
|
140
|
+
return schema;
|
|
141
|
+
}
|
|
142
|
+
function fieldsSchema(fields) {
|
|
143
|
+
return Object.fromEntries(Object.entries(fields).map(([key, field]) => [key, fieldSchema(field)]));
|
|
144
|
+
}
|
|
145
|
+
function componentSchema(type, component, aiSlots) {
|
|
146
|
+
const schema = {
|
|
147
|
+
type,
|
|
148
|
+
fields: fieldsSchema(asRecord(component.fields)),
|
|
149
|
+
defaultProps: asRecord(serializable(component.defaultProps)),
|
|
150
|
+
};
|
|
151
|
+
if (typeof component.label === "string") {
|
|
152
|
+
schema.label = component.label;
|
|
153
|
+
}
|
|
154
|
+
const description = component.description;
|
|
155
|
+
if (typeof description === "string") {
|
|
156
|
+
schema.description = description;
|
|
157
|
+
}
|
|
158
|
+
if (aiSlots !== undefined) {
|
|
159
|
+
schema.aiSlots = aiSlots;
|
|
160
|
+
}
|
|
161
|
+
return schema;
|
|
162
|
+
}
|
|
163
|
+
function componentSchemas(components, aiSlots) {
|
|
164
|
+
if (!isRecord(components)) {
|
|
165
|
+
return [];
|
|
166
|
+
}
|
|
167
|
+
return Object.entries(components)
|
|
168
|
+
.map(([type, component]) => componentSchema(type, component, aiSlots?.[type]))
|
|
169
|
+
.sort((a, b) => a.type.localeCompare(b.type));
|
|
170
|
+
}
|
|
171
|
+
function sectionTypes(data) {
|
|
172
|
+
if (!Array.isArray(data.content)) {
|
|
173
|
+
return [];
|
|
174
|
+
}
|
|
175
|
+
return data.content
|
|
176
|
+
.map((item) => (isRecord(item) && typeof item.type === "string" ? item.type : null))
|
|
177
|
+
.filter((type) => type !== null);
|
|
178
|
+
}
|
|
179
|
+
function asPageData(value, rootDefaultProps = {}) {
|
|
180
|
+
if (!isRecord(value)) {
|
|
181
|
+
return { root: { props: { ...rootDefaultProps } }, content: [] };
|
|
182
|
+
}
|
|
183
|
+
const root = isRecord(value.root) ? value.root : {};
|
|
184
|
+
const rootProps = isRecord(root.props) ? root.props : {};
|
|
185
|
+
const content = Array.isArray(value.content)
|
|
186
|
+
? value.content
|
|
187
|
+
: [];
|
|
188
|
+
const page = {
|
|
189
|
+
root: {
|
|
190
|
+
...root,
|
|
191
|
+
props: {
|
|
192
|
+
...rootDefaultProps,
|
|
193
|
+
...rootProps,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
content,
|
|
197
|
+
};
|
|
198
|
+
const zones = value.zones;
|
|
199
|
+
if (zones !== undefined) {
|
|
200
|
+
page.zones = zones;
|
|
201
|
+
}
|
|
202
|
+
return page;
|
|
203
|
+
}
|
|
204
|
+
function emptyRootComponent() {
|
|
205
|
+
return { fields: {}, defaultProps: {} };
|
|
206
|
+
}
|
|
207
|
+
export function createThemeAgentManifest(theme) {
|
|
208
|
+
return {
|
|
209
|
+
schemaVersion: "1.0",
|
|
210
|
+
manifest: theme.manifest,
|
|
211
|
+
root: componentSchema("root", theme.pageConfig.root ??
|
|
212
|
+
emptyRootComponent()),
|
|
213
|
+
sections: componentSchemas(theme.pageConfig.components, theme.aiSlots),
|
|
214
|
+
layoutComponents: componentSchemas(theme.layoutConfig.components),
|
|
215
|
+
starterPages: theme.starterPages.map((page) => {
|
|
216
|
+
const summary = {
|
|
217
|
+
slug: page.slug,
|
|
218
|
+
title: page.title,
|
|
219
|
+
data: asPageData(serializable(page.data)),
|
|
220
|
+
sectionTypes: sectionTypes(page.data),
|
|
221
|
+
};
|
|
222
|
+
if (page.isHome !== undefined) {
|
|
223
|
+
summary.isHome = page.isHome;
|
|
224
|
+
}
|
|
225
|
+
return summary;
|
|
226
|
+
}),
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
function defaultValueForField(field, propValue) {
|
|
230
|
+
if (propValue !== undefined) {
|
|
231
|
+
return propValue;
|
|
232
|
+
}
|
|
233
|
+
if (isRecord(field.fields)) {
|
|
234
|
+
return {};
|
|
235
|
+
}
|
|
236
|
+
if (isRecord(field.arrayFields)) {
|
|
237
|
+
return [];
|
|
238
|
+
}
|
|
239
|
+
return undefined;
|
|
240
|
+
}
|
|
241
|
+
function fieldGenerationHint(field) {
|
|
242
|
+
if (field.dynamic) {
|
|
243
|
+
return "Dynamic field: prefer defaultValue or conservative values from the theme schema.";
|
|
244
|
+
}
|
|
245
|
+
if (field.type === "array") {
|
|
246
|
+
return "Generate an array of objects using arrayFields for each item.";
|
|
247
|
+
}
|
|
248
|
+
if (field.type === "object") {
|
|
249
|
+
return "Generate an object using nested fields.";
|
|
250
|
+
}
|
|
251
|
+
if (field.type === "select" || field.type === "radio") {
|
|
252
|
+
return "Choose a value from options when options are present.";
|
|
253
|
+
}
|
|
254
|
+
return "Generate a value that matches the field type and description.";
|
|
255
|
+
}
|
|
256
|
+
function createAgentFieldOutput(field, propValue) {
|
|
257
|
+
const output = {
|
|
258
|
+
type: field.type,
|
|
259
|
+
required: false,
|
|
260
|
+
generationHint: fieldGenerationHint(field),
|
|
261
|
+
};
|
|
262
|
+
if (field.label !== undefined) {
|
|
263
|
+
output.label = field.label;
|
|
264
|
+
}
|
|
265
|
+
if (field.description !== undefined) {
|
|
266
|
+
output.description = field.description;
|
|
267
|
+
}
|
|
268
|
+
const defaultValue = defaultValueForField(field, propValue);
|
|
269
|
+
if (defaultValue !== undefined) {
|
|
270
|
+
output.defaultValue = defaultValue;
|
|
271
|
+
}
|
|
272
|
+
if (field.options !== undefined) {
|
|
273
|
+
output.options = field.options;
|
|
274
|
+
}
|
|
275
|
+
if (field.fields !== undefined) {
|
|
276
|
+
output.fields = createAgentFieldsOutput(field.fields, asRecord(defaultValue));
|
|
277
|
+
}
|
|
278
|
+
if (field.arrayFields !== undefined) {
|
|
279
|
+
output.arrayFields = createAgentFieldsOutput(field.arrayFields, {});
|
|
280
|
+
}
|
|
281
|
+
if (field.dynamic !== undefined) {
|
|
282
|
+
output.dynamic = field.dynamic;
|
|
283
|
+
}
|
|
284
|
+
return agentFieldOutputSchema.parse(output);
|
|
285
|
+
}
|
|
286
|
+
function createAgentFieldsOutput(fields, defaultProps) {
|
|
287
|
+
return Object.fromEntries(Object.entries(fields).map(([key, field]) => [
|
|
288
|
+
key,
|
|
289
|
+
createAgentFieldOutput(field, defaultProps[key]),
|
|
290
|
+
]));
|
|
291
|
+
}
|
|
292
|
+
function jsonTypeForField(field) {
|
|
293
|
+
if (field.type === "number" || field.type === "range") {
|
|
294
|
+
return "number";
|
|
295
|
+
}
|
|
296
|
+
if (field.type === "boolean" || field.type === "checkbox") {
|
|
297
|
+
return "boolean";
|
|
298
|
+
}
|
|
299
|
+
if (field.type === "array") {
|
|
300
|
+
return "array";
|
|
301
|
+
}
|
|
302
|
+
if (field.type === "object") {
|
|
303
|
+
return "object";
|
|
304
|
+
}
|
|
305
|
+
return "string";
|
|
306
|
+
}
|
|
307
|
+
function optionValues(options) {
|
|
308
|
+
if (!Array.isArray(options)) {
|
|
309
|
+
return [];
|
|
310
|
+
}
|
|
311
|
+
return options
|
|
312
|
+
.map((option) => {
|
|
313
|
+
if (isRecord(option) && "value" in option) {
|
|
314
|
+
return serializable(option.value);
|
|
315
|
+
}
|
|
316
|
+
return serializable(option);
|
|
317
|
+
})
|
|
318
|
+
.filter((value) => value !== undefined);
|
|
319
|
+
}
|
|
320
|
+
function createPropsOutputSchema(fields, includeId) {
|
|
321
|
+
const properties = {};
|
|
322
|
+
const required = [];
|
|
323
|
+
if (includeId) {
|
|
324
|
+
properties.id = {
|
|
325
|
+
type: "string",
|
|
326
|
+
description: "Stable unique id for this content item.",
|
|
327
|
+
};
|
|
328
|
+
required.push("id");
|
|
329
|
+
}
|
|
330
|
+
for (const [key, field] of Object.entries(fields)) {
|
|
331
|
+
const property = {
|
|
332
|
+
type: jsonTypeForField(field),
|
|
333
|
+
};
|
|
334
|
+
if (field.label !== undefined) {
|
|
335
|
+
property.title = field.label;
|
|
336
|
+
}
|
|
337
|
+
if (field.description !== undefined) {
|
|
338
|
+
property.description = field.description;
|
|
339
|
+
}
|
|
340
|
+
if (field.options !== undefined) {
|
|
341
|
+
property.options = field.options;
|
|
342
|
+
if (field.type === "select" || field.type === "radio") {
|
|
343
|
+
const values = optionValues(field.options);
|
|
344
|
+
if (values.length > 0) {
|
|
345
|
+
property.enum = values;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (field.fields !== undefined) {
|
|
350
|
+
property.properties = createPropsOutputSchema(field.fields, false).properties;
|
|
351
|
+
property.additionalProperties = true;
|
|
352
|
+
}
|
|
353
|
+
if (field.arrayFields !== undefined) {
|
|
354
|
+
property.items = {
|
|
355
|
+
type: "object",
|
|
356
|
+
properties: createPropsOutputSchema(field.arrayFields, false).properties,
|
|
357
|
+
additionalProperties: true,
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
properties[key] = property;
|
|
361
|
+
}
|
|
362
|
+
const schema = {
|
|
363
|
+
type: "object",
|
|
364
|
+
properties,
|
|
365
|
+
additionalProperties: true,
|
|
366
|
+
};
|
|
367
|
+
if (required.length > 0) {
|
|
368
|
+
schema.required = required;
|
|
369
|
+
}
|
|
370
|
+
return schema;
|
|
371
|
+
}
|
|
372
|
+
export function createAgentComponentSchemaOutput(component, role) {
|
|
373
|
+
const fields = createAgentFieldsOutput(component.fields, component.defaultProps);
|
|
374
|
+
const outputSchema = role === "section"
|
|
375
|
+
? {
|
|
376
|
+
type: "object",
|
|
377
|
+
required: ["type", "props"],
|
|
378
|
+
properties: {
|
|
379
|
+
type: { const: component.type },
|
|
380
|
+
props: createPropsOutputSchema(component.fields, true),
|
|
381
|
+
},
|
|
382
|
+
additionalProperties: true,
|
|
383
|
+
}
|
|
384
|
+
: createPropsOutputSchema(component.fields, false);
|
|
385
|
+
const output = {
|
|
386
|
+
role,
|
|
387
|
+
type: component.type,
|
|
388
|
+
fields,
|
|
389
|
+
defaultProps: component.defaultProps,
|
|
390
|
+
outputSchema,
|
|
391
|
+
generationHints: role === "section"
|
|
392
|
+
? [
|
|
393
|
+
"Always emit this section as a content item with { type, props }.",
|
|
394
|
+
"Always include props.id as a stable unique string.",
|
|
395
|
+
"Start from defaultProps, then override values for the requested page.",
|
|
396
|
+
]
|
|
397
|
+
: [
|
|
398
|
+
"Emit these values only when generating theme or layout configuration.",
|
|
399
|
+
"Start from defaultProps, then override values for the requested page.",
|
|
400
|
+
],
|
|
401
|
+
};
|
|
402
|
+
if (component.label !== undefined) {
|
|
403
|
+
output.label = component.label;
|
|
404
|
+
}
|
|
405
|
+
if (component.description !== undefined) {
|
|
406
|
+
output.description = component.description;
|
|
407
|
+
}
|
|
408
|
+
if (component.aiSlots !== undefined) {
|
|
409
|
+
output.aiSlots = component.aiSlots;
|
|
410
|
+
}
|
|
411
|
+
return agentComponentOutputSchema.parse(output);
|
|
412
|
+
}
|
|
413
|
+
export function createAgentExamplePageContent(manifest) {
|
|
414
|
+
const starter = manifest.starterPages.find((page) => page.isHome === true && page.data !== undefined) ??
|
|
415
|
+
manifest.starterPages.find((page) => page.slug === "home" && page.data !== undefined) ??
|
|
416
|
+
manifest.starterPages.find((page) => page.data !== undefined);
|
|
417
|
+
if (starter?.data !== undefined) {
|
|
418
|
+
const page = asPageData(starter.data);
|
|
419
|
+
const output = {
|
|
420
|
+
content: page.content,
|
|
421
|
+
};
|
|
422
|
+
if (page.zones !== undefined) {
|
|
423
|
+
output.zones = page.zones;
|
|
424
|
+
}
|
|
425
|
+
return output;
|
|
426
|
+
}
|
|
427
|
+
return {
|
|
428
|
+
content: manifest.sections.map((section, index) => ({
|
|
429
|
+
type: section.type,
|
|
430
|
+
props: {
|
|
431
|
+
...section.defaultProps,
|
|
432
|
+
id: `${section.type}-${index + 1}`,
|
|
433
|
+
},
|
|
434
|
+
})),
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
export function createAgentExamplePageData(manifest) {
|
|
438
|
+
return createPageDataFromAgentContent(createAgentExamplePageContent(manifest));
|
|
439
|
+
}
|
|
440
|
+
function createPageContentOutputSchema(manifest) {
|
|
441
|
+
return {
|
|
442
|
+
type: "object",
|
|
443
|
+
required: ["content"],
|
|
444
|
+
properties: {
|
|
445
|
+
content: {
|
|
446
|
+
type: "array",
|
|
447
|
+
items: {
|
|
448
|
+
oneOf: manifest.sections.map((section) => createAgentComponentSchemaOutput(section, "section").outputSchema),
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
zones: {
|
|
452
|
+
type: "object",
|
|
453
|
+
additionalProperties: true,
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
additionalProperties: true,
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
function isThemeModule(value) {
|
|
460
|
+
return "pageConfig" in value;
|
|
461
|
+
}
|
|
462
|
+
function normalizeAgentManifest(value) {
|
|
463
|
+
return isThemeModule(value) ? createThemeAgentManifest(value) : value;
|
|
464
|
+
}
|
|
465
|
+
export function createAgentPageSchemaOutput(themeOrManifest, options = {}) {
|
|
466
|
+
const manifest = normalizeAgentManifest(themeOrManifest);
|
|
467
|
+
const output = {
|
|
468
|
+
schemaVersion: "1.0",
|
|
469
|
+
kind: "pageContentSchema",
|
|
470
|
+
theme: {
|
|
471
|
+
key: manifest.manifest.key,
|
|
472
|
+
version: manifest.manifest.version,
|
|
473
|
+
name: manifest.manifest.name,
|
|
474
|
+
},
|
|
475
|
+
pageContentOutputSchema: createPageContentOutputSchema(manifest),
|
|
476
|
+
components: {
|
|
477
|
+
sections: manifest.sections.map((section) => createAgentComponentSchemaOutput(section, "section")),
|
|
478
|
+
},
|
|
479
|
+
generationGuide: [
|
|
480
|
+
"Generate page content only: an object with content and optional zones.",
|
|
481
|
+
"Do not emit page-level settings; Suda applies theme and layout configuration separately.",
|
|
482
|
+
"Generate content as an array of section items using components.sections outputSchema.",
|
|
483
|
+
"Every content item must include props.id as a stable unique string.",
|
|
484
|
+
"Start from each component defaultProps, then override values for the requested page.",
|
|
485
|
+
"Avoid inventing component types or fields not present in this schema.",
|
|
486
|
+
"Validate the page content before saving, publishing, or creating a page draft.",
|
|
487
|
+
],
|
|
488
|
+
};
|
|
489
|
+
if (options.includeExample === true) {
|
|
490
|
+
output.examplePageContent = createAgentExamplePageContent(manifest);
|
|
491
|
+
}
|
|
492
|
+
return agentPageSchemaOutputSchema.parse(output);
|
|
493
|
+
}
|
|
494
|
+
export function findAgentSection(manifest, sectionType) {
|
|
495
|
+
return manifest.sections.find((section) => section.type === sectionType) ?? null;
|
|
496
|
+
}
|
|
497
|
+
function createAgentSectionSummary(section) {
|
|
498
|
+
const declaredFieldKeys = Object.keys(section.fields);
|
|
499
|
+
const fieldKeys = declaredFieldKeys.includes("id")
|
|
500
|
+
? declaredFieldKeys
|
|
501
|
+
: ["id", ...declaredFieldKeys];
|
|
502
|
+
const summary = {
|
|
503
|
+
type: section.type,
|
|
504
|
+
fieldKeys,
|
|
505
|
+
requiredFieldKeys: ["id"],
|
|
506
|
+
};
|
|
507
|
+
if (section.label !== undefined) {
|
|
508
|
+
summary.label = section.label;
|
|
509
|
+
}
|
|
510
|
+
if (section.description !== undefined) {
|
|
511
|
+
summary.description = section.description;
|
|
512
|
+
}
|
|
513
|
+
return agentSectionSummaryOutputSchema.parse(summary);
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Lightweight theme schema summary for AI prompt context. Pair with
|
|
517
|
+
* createAgentComponentSchemaOutput(section, "section") (e.g. via a
|
|
518
|
+
* `getThemeSectionSchema` tool) to fetch the full schema for a single
|
|
519
|
+
* section on demand. Keeps prompts small while preserving the AI page
|
|
520
|
+
* content contract: AI generates only `{ content, zones? }`. Used by the
|
|
521
|
+
* workspace AI chat today; onboarding orchestration will adopt the same
|
|
522
|
+
* contract in a follow-up.
|
|
523
|
+
*/
|
|
524
|
+
export function createAgentThemeSchemaSummary(themeOrManifest) {
|
|
525
|
+
const manifest = normalizeAgentManifest(themeOrManifest);
|
|
526
|
+
const output = {
|
|
527
|
+
schemaVersion: "1.0",
|
|
528
|
+
kind: "pageContentSchemaSummary",
|
|
529
|
+
theme: {
|
|
530
|
+
key: manifest.manifest.key,
|
|
531
|
+
version: manifest.manifest.version,
|
|
532
|
+
name: manifest.manifest.name,
|
|
533
|
+
},
|
|
534
|
+
sections: manifest.sections.map(createAgentSectionSummary),
|
|
535
|
+
generationGuide: [
|
|
536
|
+
"AI generates page content only: an object { content, zones? }.",
|
|
537
|
+
"content is an array of section items shaped as { type, props } where type is one of the section types listed in this summary.",
|
|
538
|
+
"Every content item must include props.id as a stable unique string.",
|
|
539
|
+
"Before writing or updating a section's props, call getThemeSectionSchema({ section }) to fetch its full field schema and example values.",
|
|
540
|
+
"Do not invent section types or fields outside this summary.",
|
|
541
|
+
"Suda applies theme and layout configuration separately; never emit page-level root settings.",
|
|
542
|
+
],
|
|
543
|
+
};
|
|
544
|
+
return agentThemeSchemaSummaryOutputSchema.parse(output);
|
|
545
|
+
}
|
|
546
|
+
export function createPageDataFromAgentContent(contentOutput) {
|
|
547
|
+
if (!isRecord(contentOutput)) {
|
|
548
|
+
return { root: { props: {} }, content: [] };
|
|
549
|
+
}
|
|
550
|
+
const page = {
|
|
551
|
+
root: { props: {} },
|
|
552
|
+
content: Array.isArray(contentOutput.content)
|
|
553
|
+
? contentOutput.content
|
|
554
|
+
: [],
|
|
555
|
+
};
|
|
556
|
+
const zones = contentOutput.zones;
|
|
557
|
+
if (zones !== undefined) {
|
|
558
|
+
page.zones = zones;
|
|
559
|
+
}
|
|
560
|
+
return page;
|
|
561
|
+
}
|
|
562
|
+
export function validateAgentPageContentWithManifest(data, manifest) {
|
|
563
|
+
const issues = [];
|
|
564
|
+
if (!isRecord(data)) {
|
|
565
|
+
return { valid: false, issues: [{ path: "$", message: "Page content must be an object." }] };
|
|
566
|
+
}
|
|
567
|
+
if (!Array.isArray(data.content)) {
|
|
568
|
+
issues.push({ path: "$.content", message: "content must be an array." });
|
|
569
|
+
return agentValidationResultSchema.parse({ valid: issues.length === 0, issues });
|
|
570
|
+
}
|
|
571
|
+
const knownSections = new Set(manifest.sections.map((section) => section.type));
|
|
572
|
+
data.content.forEach((item, index) => {
|
|
573
|
+
const path = `$.content[${index}]`;
|
|
574
|
+
if (!isRecord(item)) {
|
|
575
|
+
issues.push({ path, message: "Content item must be an object." });
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
if (typeof item.type !== "string" || item.type.length === 0) {
|
|
579
|
+
issues.push({ path: `${path}.type`, message: "Content item type is required." });
|
|
580
|
+
}
|
|
581
|
+
else if (!knownSections.has(item.type)) {
|
|
582
|
+
issues.push({ path: `${path}.type`, message: `Unknown section type "${item.type}".` });
|
|
583
|
+
}
|
|
584
|
+
if (!isRecord(item.props)) {
|
|
585
|
+
issues.push({ path: `${path}.props`, message: "Content item props must be an object." });
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
if (typeof item.props.id !== "string" || item.props.id.length === 0) {
|
|
589
|
+
issues.push({ path: `${path}.props.id`, message: "Content item props.id is required." });
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
return agentValidationResultSchema.parse({ valid: issues.length === 0, issues });
|
|
593
|
+
}
|
|
594
|
+
export function validatePageDataWithAgentManifest(data, manifest) {
|
|
595
|
+
if (!isRecord(data)) {
|
|
596
|
+
return { valid: false, issues: [{ path: "$", message: "Page data must be an object." }] };
|
|
597
|
+
}
|
|
598
|
+
return validateAgentPageContentWithManifest({
|
|
599
|
+
content: data.content,
|
|
600
|
+
zones: data.zones,
|
|
601
|
+
}, manifest);
|
|
602
|
+
}
|
|
603
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgExB,MAAM,CAAC,MAAM,sBAAsB,GAW9B,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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAG5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAG5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAE5B,uCAAuC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAE/B,yCAAyC;AACzC,OAAO,EAAE,mBAAmB,EAAqB,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAE5B,uCAAuC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAE/B,yCAAyC;AACzC,OAAO,EAAE,mBAAmB,EAAqB,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/manifest.d.ts
CHANGED
|
@@ -23,8 +23,8 @@ export declare const themeManifestSchema: z.ZodObject<{
|
|
|
23
23
|
entry: string;
|
|
24
24
|
key: string;
|
|
25
25
|
categories: ("business" | "blog" | "portfolio" | "ecommerce" | "landing" | "other")[];
|
|
26
|
-
name: string;
|
|
27
26
|
version: string;
|
|
27
|
+
name: string;
|
|
28
28
|
minEngineVersion: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
preview?: string | undefined;
|
|
@@ -34,8 +34,8 @@ export declare const themeManifestSchema: z.ZodObject<{
|
|
|
34
34
|
entry: string;
|
|
35
35
|
key: string;
|
|
36
36
|
categories: ("business" | "blog" | "portfolio" | "ecommerce" | "landing" | "other")[];
|
|
37
|
-
name: string;
|
|
38
37
|
version: string;
|
|
38
|
+
name: string;
|
|
39
39
|
minEngineVersion: string;
|
|
40
40
|
description?: string | undefined;
|
|
41
41
|
preview?: string | undefined;
|
package/dist/server.d.ts
CHANGED
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,GAC/B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,cAAc,aAAa,CAAC;AAG5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAC7F,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,GAC/B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,cAAc,aAAa,CAAC;AAG5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAC7F,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
package/dist/server.js
CHANGED
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,0CAA0C;AAC1C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAyB,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAqB,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,YAAY,EAA4B,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EACL,oBAAoB,EACpB,gBAAgB,GAIjB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,cAAc,aAAa,CAAC;AAE5B,sDAAsD;AACtD,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAC7F,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.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