@nextblock-cms/cortex 0.17.6 → 0.17.8

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.
@@ -0,0 +1,1153 @@
1
+ import { CortexBuildSession, CortexSiteBrief } from './site-brief';
2
+ import { z } from './zod-config';
3
+ /**
4
+ * Site-level tools: the ones a "build me a website" request needs and no
5
+ * page-level tool provides.
6
+ *
7
+ * get_site_overview one read that grounds a whole-site plan
8
+ * update_site_identity title / description / keywords / copyright / logo pin
9
+ * save_site_brief persist what the client wants, for this and later chats
10
+ * reset_site_content remove the seeded NextBlock demo content (or everything)
11
+ * start_site_build ONE confirmation that approves a plan and opens a time-boxed
12
+ * build session in which the remaining steps run unattended
13
+ * finish_site_build close the session and mark the brief built
14
+ *
15
+ * Every executor runs with the service-role client, so role checks happen here
16
+ * (`requireActorRole`), never in RLS.
17
+ */
18
+ type SiteToolContext = {
19
+ actorFromOrphanedToken?: boolean;
20
+ actorUserId?: string | null;
21
+ latestUserMessage?: string | null;
22
+ revalidatePath?: (path: string, type?: 'layout' | 'page') => void;
23
+ skipConfirmation?: boolean;
24
+ supabase?: {
25
+ from: (table: string) => any;
26
+ };
27
+ };
28
+ type SupabaseLike = {
29
+ from: (table: string) => any;
30
+ };
31
+ /**
32
+ * What a fresh install ships (libs/db/src/supabase/migrations/02004_baseline_seed.sql
33
+ * plus the FR posts in 02009). Seeded rows carry no marker column, but their
34
+ * translation groups are fixed UUIDs — the same handles the data-fix migrations
35
+ * key on — so they are the most reliable way to tell "NextBlock demo content"
36
+ * from something the operator wrote.
37
+ */
38
+ export declare const NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS: ReadonlySet<string>;
39
+ /** Bundled demo images (served from /public, no storage object behind them). */
40
+ export declare const NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS: ReadonlySet<string>;
41
+ export declare function readCortexSiteBrief(supabase: SupabaseLike): Promise<CortexSiteBrief | null>;
42
+ export declare const saveSiteBriefInputSchema: z.ZodObject<{
43
+ brief: z.ZodObject<{
44
+ audience: z.ZodOptional<z.ZodOptional<z.ZodString>>;
45
+ brand: z.ZodOptional<z.ZodOptional<z.ZodObject<{
46
+ accent_color: z.ZodOptional<z.ZodOptional<z.ZodString>>;
47
+ color_scheme: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
48
+ light: "light";
49
+ dark: "dark";
50
+ }>>>;
51
+ font_style: z.ZodOptional<z.ZodOptional<z.ZodString>>;
52
+ logo_notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
53
+ primary_color: z.ZodOptional<z.ZodOptional<z.ZodString>>;
54
+ secondary_color: z.ZodOptional<z.ZodOptional<z.ZodString>>;
55
+ style_keywords: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
56
+ tone: z.ZodOptional<z.ZodOptional<z.ZodString>>;
57
+ }, z.core.$strict>>>;
58
+ business_name: z.ZodOptional<z.ZodString>;
59
+ contact: z.ZodOptional<z.ZodOptional<z.ZodObject<{
60
+ address: z.ZodOptional<z.ZodOptional<z.ZodString>>;
61
+ email: z.ZodOptional<z.ZodOptional<z.ZodString>>;
62
+ hours: z.ZodOptional<z.ZodOptional<z.ZodString>>;
63
+ phone: z.ZodOptional<z.ZodOptional<z.ZodString>>;
64
+ social: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
65
+ platform: z.ZodString;
66
+ url: z.ZodString;
67
+ }, z.core.$strict>>>>;
68
+ }, z.core.$strict>>>;
69
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
70
+ ecommerce: z.ZodOptional<z.ZodOptional<z.ZodObject<{
71
+ enabled: z.ZodDefault<z.ZodBoolean>;
72
+ products_summary: z.ZodOptional<z.ZodString>;
73
+ }, z.core.$strict>>>;
74
+ goals: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
75
+ keep_existing_content: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
76
+ languages: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
77
+ notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
78
+ pages: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
79
+ purpose: z.ZodOptional<z.ZodString>;
80
+ sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
81
+ slug: z.ZodString;
82
+ title: z.ZodString;
83
+ }, z.core.$strict>>>>;
84
+ primary_language: z.ZodOptional<z.ZodDefault<z.ZodString>>;
85
+ site_type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
86
+ other: "other";
87
+ "landing-page": "landing-page";
88
+ "multi-page": "multi-page";
89
+ blog: "blog";
90
+ store: "store";
91
+ portfolio: "portfolio";
92
+ }>>>;
93
+ status: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
94
+ draft: "draft";
95
+ confirmed: "confirmed";
96
+ built: "built";
97
+ }>>>;
98
+ tagline: z.ZodOptional<z.ZodOptional<z.ZodString>>;
99
+ updated_at: z.ZodOptional<z.ZodOptional<z.ZodString>>;
100
+ }, z.core.$strict>;
101
+ mode: z.ZodDefault<z.ZodEnum<{
102
+ replace: "replace";
103
+ merge: "merge";
104
+ }>>;
105
+ }, z.core.$strict>;
106
+ export type SaveSiteBriefInput = z.input<typeof saveSiteBriefInputSchema>;
107
+ export declare function executeSaveSiteBrief(input: SaveSiteBriefInput, context?: SiteToolContext): Promise<{
108
+ brief: {
109
+ business_name: string;
110
+ keep_existing_content: boolean;
111
+ languages: string[];
112
+ pages: {
113
+ slug: string;
114
+ title: string;
115
+ purpose?: string | undefined;
116
+ sections?: string[] | undefined;
117
+ }[];
118
+ primary_language: string;
119
+ site_type: "other" | "landing-page" | "multi-page" | "blog" | "store" | "portfolio";
120
+ status: "draft" | "confirmed" | "built";
121
+ audience?: string | undefined;
122
+ brand?: {
123
+ accent_color?: string | undefined;
124
+ color_scheme?: "light" | "dark" | undefined;
125
+ font_style?: string | undefined;
126
+ logo_notes?: string | undefined;
127
+ primary_color?: string | undefined;
128
+ secondary_color?: string | undefined;
129
+ style_keywords?: string[] | undefined;
130
+ tone?: string | undefined;
131
+ } | undefined;
132
+ contact?: {
133
+ address?: string | undefined;
134
+ email?: string | undefined;
135
+ hours?: string | undefined;
136
+ phone?: string | undefined;
137
+ social?: {
138
+ platform: string;
139
+ url: string;
140
+ }[] | undefined;
141
+ } | undefined;
142
+ description?: string | undefined;
143
+ ecommerce?: {
144
+ enabled: boolean;
145
+ products_summary?: string | undefined;
146
+ } | undefined;
147
+ goals?: string[] | undefined;
148
+ notes?: string | undefined;
149
+ tagline?: string | undefined;
150
+ updated_at?: string | undefined;
151
+ };
152
+ created: boolean;
153
+ mutationExecuted: boolean;
154
+ success: boolean;
155
+ }>;
156
+ export declare function readCortexBuildSession(supabase: SupabaseLike): Promise<CortexBuildSession | null>;
157
+ /** The session the chat route may honour for this actor right now, or null. */
158
+ export declare function resolveCortexBuildSession(supabase: SupabaseLike, actorUserId: string | null | undefined): Promise<CortexBuildSession | null>;
159
+ export declare const getSiteOverviewInputSchema: z.ZodObject<{
160
+ includeMedia: z.ZodDefault<z.ZodBoolean>;
161
+ includeNavigation: z.ZodDefault<z.ZodBoolean>;
162
+ limit: z.ZodDefault<z.ZodNumber>;
163
+ }, z.core.$strict>;
164
+ export type GetSiteOverviewInput = z.input<typeof getSiteOverviewInputSchema>;
165
+ type NavigationNode = {
166
+ children: NavigationNode[];
167
+ id: number;
168
+ label: string;
169
+ url: string;
170
+ };
171
+ export declare function executeGetSiteOverview(input: GetSiteOverviewInput, context?: SiteToolContext): Promise<{
172
+ brief: {
173
+ business_name: string;
174
+ keep_existing_content: boolean;
175
+ languages: string[];
176
+ pages: {
177
+ slug: string;
178
+ title: string;
179
+ purpose?: string | undefined;
180
+ sections?: string[] | undefined;
181
+ }[];
182
+ primary_language: string;
183
+ site_type: "other" | "landing-page" | "multi-page" | "blog" | "store" | "portfolio";
184
+ status: "draft" | "confirmed" | "built";
185
+ audience?: string | undefined;
186
+ brand?: {
187
+ accent_color?: string | undefined;
188
+ color_scheme?: "light" | "dark" | undefined;
189
+ font_style?: string | undefined;
190
+ logo_notes?: string | undefined;
191
+ primary_color?: string | undefined;
192
+ secondary_color?: string | undefined;
193
+ style_keywords?: string[] | undefined;
194
+ tone?: string | undefined;
195
+ } | undefined;
196
+ contact?: {
197
+ address?: string | undefined;
198
+ email?: string | undefined;
199
+ hours?: string | undefined;
200
+ phone?: string | undefined;
201
+ social?: {
202
+ platform: string;
203
+ url: string;
204
+ }[] | undefined;
205
+ } | undefined;
206
+ description?: string | undefined;
207
+ ecommerce?: {
208
+ enabled: boolean;
209
+ products_summary?: string | undefined;
210
+ } | undefined;
211
+ goals?: string[] | undefined;
212
+ notes?: string | undefined;
213
+ tagline?: string | undefined;
214
+ updated_at?: string | undefined;
215
+ } | null;
216
+ buildSession: {
217
+ expiresAt: string;
218
+ id: string;
219
+ summary: string;
220
+ } | null;
221
+ counts: {
222
+ customBlocks: number;
223
+ drafts: number;
224
+ media: number;
225
+ pages: number;
226
+ posts: number;
227
+ products: number;
228
+ };
229
+ customBlocks: {
230
+ fieldCount: any;
231
+ fields: any;
232
+ name: string;
233
+ slug: string;
234
+ }[];
235
+ drafts: {
236
+ parentId: number;
237
+ parentType: string;
238
+ }[];
239
+ homePage: {
240
+ blockCount: number;
241
+ id: number;
242
+ isHome: boolean;
243
+ isSeeded: boolean;
244
+ languageCode: string;
245
+ slug: string;
246
+ status: string;
247
+ title: string;
248
+ translationGroupId: string | null;
249
+ } | null;
250
+ identity: {
251
+ activeLogo: {
252
+ id: string;
253
+ isSeeded: boolean;
254
+ name: string;
255
+ objectKey: string | null;
256
+ } | null;
257
+ footerCopyright: {} | null;
258
+ footerShowAttribution: boolean;
259
+ siteDescription: unknown;
260
+ siteKeywords: unknown;
261
+ siteTitle: string;
262
+ };
263
+ languages: {
264
+ code: string;
265
+ id: number;
266
+ isActive: boolean;
267
+ isDefault: boolean;
268
+ name: string;
269
+ }[];
270
+ media: {
271
+ count: number;
272
+ sample: {
273
+ altText: any;
274
+ fileName: any;
275
+ id: string;
276
+ isSeeded: boolean;
277
+ }[] | undefined;
278
+ seededCount: number;
279
+ };
280
+ navigation: Record<"footer" | "header", Record<string, NavigationNode[]>> | null;
281
+ nextSteps: string[];
282
+ pages: {
283
+ blockCount: number;
284
+ id: number;
285
+ isHome: boolean;
286
+ isSeeded: boolean;
287
+ languageCode: string;
288
+ slug: string;
289
+ status: string;
290
+ title: string;
291
+ translationGroupId: string | null;
292
+ }[];
293
+ posts: {
294
+ blockCount: number;
295
+ id: number;
296
+ isSeeded: boolean;
297
+ languageCode: string;
298
+ publishedAt: any;
299
+ slug: string;
300
+ status: string;
301
+ title: string;
302
+ translationGroupId: string | null;
303
+ }[];
304
+ products: {
305
+ id: string;
306
+ languageCode: string;
307
+ slug: string;
308
+ status: string;
309
+ title: string;
310
+ }[];
311
+ seeded: {
312
+ anyPresent: boolean;
313
+ copyright: boolean;
314
+ logo: boolean;
315
+ media: number;
316
+ pages: number;
317
+ posts: number;
318
+ siteTitle: boolean;
319
+ };
320
+ success: boolean;
321
+ themes: {
322
+ colorScheme: string;
323
+ isActive: boolean;
324
+ isDefault: boolean;
325
+ name: string;
326
+ slug: string;
327
+ }[];
328
+ }>;
329
+ export declare const updateSiteIdentityInputSchema: z.ZodObject<{
330
+ active_logo_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
331
+ footer_copyright: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
332
+ footer_show_attribution: z.ZodOptional<z.ZodBoolean>;
333
+ site_description: z.ZodOptional<z.ZodString>;
334
+ site_keywords: z.ZodOptional<z.ZodString>;
335
+ site_title: z.ZodOptional<z.ZodString>;
336
+ }, z.core.$strict>;
337
+ export type UpdateSiteIdentityInput = z.input<typeof updateSiteIdentityInputSchema>;
338
+ export declare function executeUpdateSiteIdentity(input: UpdateSiteIdentityInput, context?: SiteToolContext): Promise<{
339
+ confirmationPhrase: string;
340
+ mutationExecuted: boolean;
341
+ preview: Record<string, unknown>;
342
+ requiresConfirmation: boolean;
343
+ success: boolean;
344
+ } | {
345
+ mutationExecuted: boolean;
346
+ success: boolean;
347
+ updatedKeys: string[];
348
+ }>;
349
+ export declare const resetSiteContentInputSchema: z.ZodObject<{
350
+ clearKeptPageBlocks: z.ZodDefault<z.ZodBoolean>;
351
+ dryRun: z.ZodDefault<z.ZodBoolean>;
352
+ keepLanguages: z.ZodOptional<z.ZodArray<z.ZodString>>;
353
+ keepPageSlugs: z.ZodDefault<z.ZodArray<z.ZodString>>;
354
+ onlySeeded: z.ZodDefault<z.ZodBoolean>;
355
+ scope: z.ZodDefault<z.ZodObject<{
356
+ customBlocks: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
357
+ identity: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
358
+ navigation: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
359
+ pages: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
360
+ posts: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
361
+ products: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
362
+ seededMedia: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
363
+ }, z.core.$strict>>;
364
+ }, z.core.$strict>;
365
+ export type ResetSiteContentInput = z.input<typeof resetSiteContentInputSchema>;
366
+ export declare function executeResetSiteContent(input: ResetSiteContentInput, context?: SiteToolContext): Promise<{
367
+ confirmationPhrase: string;
368
+ mutationExecuted: boolean;
369
+ preview: Record<string, unknown>;
370
+ requiresConfirmation: boolean;
371
+ success: boolean;
372
+ } | {
373
+ dryRun: boolean;
374
+ mutationExecuted: boolean;
375
+ nextSteps: string[];
376
+ success: boolean;
377
+ summary: {
378
+ blocksClearedOnPages: number;
379
+ customBlocks: number;
380
+ drafts: number;
381
+ identityCleared: boolean;
382
+ languagesDeactivated: string[];
383
+ logos: number;
384
+ media: number;
385
+ navigationItems: number;
386
+ pages: number;
387
+ pagesKept: string[];
388
+ posts: number;
389
+ products: number;
390
+ };
391
+ wouldDelete: {
392
+ pages: {
393
+ id: number;
394
+ slug: string;
395
+ languageCode: string;
396
+ }[];
397
+ posts: {
398
+ id: number;
399
+ slug: string;
400
+ languageCode: string;
401
+ }[];
402
+ };
403
+ deleted?: undefined;
404
+ } | {
405
+ deleted: {
406
+ blocksClearedOnPages: number;
407
+ customBlocks: number;
408
+ drafts: number;
409
+ identityCleared: boolean;
410
+ languagesDeactivated: string[];
411
+ logos: number;
412
+ media: number;
413
+ navigationItems: number;
414
+ pages: number;
415
+ pagesKept: string[];
416
+ posts: number;
417
+ products: number;
418
+ };
419
+ mutationExecuted: boolean;
420
+ nextSteps: string[];
421
+ success: boolean;
422
+ dryRun?: undefined;
423
+ summary?: undefined;
424
+ wouldDelete?: undefined;
425
+ }>;
426
+ export declare const startSiteBuildInputSchema: z.ZodObject<{
427
+ brief: z.ZodOptional<z.ZodObject<{
428
+ audience: z.ZodOptional<z.ZodOptional<z.ZodString>>;
429
+ brand: z.ZodOptional<z.ZodOptional<z.ZodObject<{
430
+ accent_color: z.ZodOptional<z.ZodOptional<z.ZodString>>;
431
+ color_scheme: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
432
+ light: "light";
433
+ dark: "dark";
434
+ }>>>;
435
+ font_style: z.ZodOptional<z.ZodOptional<z.ZodString>>;
436
+ logo_notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
437
+ primary_color: z.ZodOptional<z.ZodOptional<z.ZodString>>;
438
+ secondary_color: z.ZodOptional<z.ZodOptional<z.ZodString>>;
439
+ style_keywords: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
440
+ tone: z.ZodOptional<z.ZodOptional<z.ZodString>>;
441
+ }, z.core.$strict>>>;
442
+ business_name: z.ZodOptional<z.ZodString>;
443
+ contact: z.ZodOptional<z.ZodOptional<z.ZodObject<{
444
+ address: z.ZodOptional<z.ZodOptional<z.ZodString>>;
445
+ email: z.ZodOptional<z.ZodOptional<z.ZodString>>;
446
+ hours: z.ZodOptional<z.ZodOptional<z.ZodString>>;
447
+ phone: z.ZodOptional<z.ZodOptional<z.ZodString>>;
448
+ social: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
449
+ platform: z.ZodString;
450
+ url: z.ZodString;
451
+ }, z.core.$strict>>>>;
452
+ }, z.core.$strict>>>;
453
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
454
+ ecommerce: z.ZodOptional<z.ZodOptional<z.ZodObject<{
455
+ enabled: z.ZodDefault<z.ZodBoolean>;
456
+ products_summary: z.ZodOptional<z.ZodString>;
457
+ }, z.core.$strict>>>;
458
+ goals: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
459
+ keep_existing_content: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
460
+ languages: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
461
+ notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
462
+ pages: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
463
+ purpose: z.ZodOptional<z.ZodString>;
464
+ sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
465
+ slug: z.ZodString;
466
+ title: z.ZodString;
467
+ }, z.core.$strict>>>>;
468
+ primary_language: z.ZodOptional<z.ZodDefault<z.ZodString>>;
469
+ site_type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
470
+ other: "other";
471
+ "landing-page": "landing-page";
472
+ "multi-page": "multi-page";
473
+ blog: "blog";
474
+ store: "store";
475
+ portfolio: "portfolio";
476
+ }>>>;
477
+ status: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
478
+ draft: "draft";
479
+ confirmed: "confirmed";
480
+ built: "built";
481
+ }>>>;
482
+ tagline: z.ZodOptional<z.ZodOptional<z.ZodString>>;
483
+ updated_at: z.ZodOptional<z.ZodOptional<z.ZodString>>;
484
+ }, z.core.$strict>>;
485
+ durationMinutes: z.ZodDefault<z.ZodNumber>;
486
+ reset: z.ZodOptional<z.ZodObject<{
487
+ clearKeptPageBlocks: z.ZodDefault<z.ZodBoolean>;
488
+ dryRun: z.ZodDefault<z.ZodBoolean>;
489
+ keepLanguages: z.ZodOptional<z.ZodArray<z.ZodString>>;
490
+ keepPageSlugs: z.ZodDefault<z.ZodArray<z.ZodString>>;
491
+ onlySeeded: z.ZodDefault<z.ZodBoolean>;
492
+ scope: z.ZodDefault<z.ZodObject<{
493
+ customBlocks: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
494
+ identity: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
495
+ navigation: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
496
+ pages: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
497
+ posts: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
498
+ products: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
499
+ seededMedia: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
500
+ }, z.core.$strict>>;
501
+ }, z.core.$strict>>;
502
+ summary: z.ZodString;
503
+ }, z.core.$strict>;
504
+ export type StartSiteBuildInput = z.input<typeof startSiteBuildInputSchema>;
505
+ export declare function executeStartSiteBuild(input: StartSiteBuildInput, context?: SiteToolContext): Promise<{
506
+ confirmationPhrase: string;
507
+ mutationExecuted: boolean;
508
+ preview: Record<string, unknown>;
509
+ requiresConfirmation: boolean;
510
+ success: boolean;
511
+ } | {
512
+ brief: {
513
+ business_name: string;
514
+ keep_existing_content: boolean;
515
+ languages: string[];
516
+ pages: {
517
+ slug: string;
518
+ title: string;
519
+ purpose?: string | undefined;
520
+ sections?: string[] | undefined;
521
+ }[];
522
+ primary_language: string;
523
+ site_type: "other" | "landing-page" | "multi-page" | "blog" | "store" | "portfolio";
524
+ status: "draft" | "confirmed" | "built";
525
+ audience?: string | undefined;
526
+ brand?: {
527
+ accent_color?: string | undefined;
528
+ color_scheme?: "light" | "dark" | undefined;
529
+ font_style?: string | undefined;
530
+ logo_notes?: string | undefined;
531
+ primary_color?: string | undefined;
532
+ secondary_color?: string | undefined;
533
+ style_keywords?: string[] | undefined;
534
+ tone?: string | undefined;
535
+ } | undefined;
536
+ contact?: {
537
+ address?: string | undefined;
538
+ email?: string | undefined;
539
+ hours?: string | undefined;
540
+ phone?: string | undefined;
541
+ social?: {
542
+ platform: string;
543
+ url: string;
544
+ }[] | undefined;
545
+ } | undefined;
546
+ description?: string | undefined;
547
+ ecommerce?: {
548
+ enabled: boolean;
549
+ products_summary?: string | undefined;
550
+ } | undefined;
551
+ goals?: string[] | undefined;
552
+ notes?: string | undefined;
553
+ tagline?: string | undefined;
554
+ updated_at?: string | undefined;
555
+ } | null;
556
+ buildSession: {
557
+ expiresAt: string;
558
+ id: string;
559
+ };
560
+ continuePrompt: string;
561
+ mutationExecuted: boolean;
562
+ resetResult: Record<string, unknown> | null;
563
+ success: boolean;
564
+ }>;
565
+ export declare const finishSiteBuildInputSchema: z.ZodObject<{
566
+ outcome: z.ZodDefault<z.ZodEnum<{
567
+ built: "built";
568
+ stopped: "stopped";
569
+ }>>;
570
+ summary: z.ZodOptional<z.ZodString>;
571
+ }, z.core.$strict>;
572
+ export type FinishSiteBuildInput = z.input<typeof finishSiteBuildInputSchema>;
573
+ export declare function executeFinishSiteBuild(input: FinishSiteBuildInput, context?: SiteToolContext): Promise<{
574
+ brief: {
575
+ business_name: string;
576
+ keep_existing_content: boolean;
577
+ languages: string[];
578
+ pages: {
579
+ slug: string;
580
+ title: string;
581
+ purpose?: string | undefined;
582
+ sections?: string[] | undefined;
583
+ }[];
584
+ primary_language: string;
585
+ site_type: "other" | "landing-page" | "multi-page" | "blog" | "store" | "portfolio";
586
+ status: "draft" | "confirmed" | "built";
587
+ audience?: string | undefined;
588
+ brand?: {
589
+ accent_color?: string | undefined;
590
+ color_scheme?: "light" | "dark" | undefined;
591
+ font_style?: string | undefined;
592
+ logo_notes?: string | undefined;
593
+ primary_color?: string | undefined;
594
+ secondary_color?: string | undefined;
595
+ style_keywords?: string[] | undefined;
596
+ tone?: string | undefined;
597
+ } | undefined;
598
+ contact?: {
599
+ address?: string | undefined;
600
+ email?: string | undefined;
601
+ hours?: string | undefined;
602
+ phone?: string | undefined;
603
+ social?: {
604
+ platform: string;
605
+ url: string;
606
+ }[] | undefined;
607
+ } | undefined;
608
+ description?: string | undefined;
609
+ ecommerce?: {
610
+ enabled: boolean;
611
+ products_summary?: string | undefined;
612
+ } | undefined;
613
+ goals?: string[] | undefined;
614
+ notes?: string | undefined;
615
+ tagline?: string | undefined;
616
+ updated_at?: string | undefined;
617
+ } | null;
618
+ buildSessionEnded: boolean;
619
+ hadSession: boolean;
620
+ mutationExecuted: boolean;
621
+ outcome: "built" | "stopped";
622
+ success: boolean;
623
+ }>;
624
+ export declare function createCortexSiteTools(context?: SiteToolContext): {
625
+ get_site_overview: import('ai').Tool<{
626
+ includeMedia: boolean;
627
+ includeNavigation: boolean;
628
+ limit: number;
629
+ }, {
630
+ brief: {
631
+ business_name: string;
632
+ keep_existing_content: boolean;
633
+ languages: string[];
634
+ pages: {
635
+ slug: string;
636
+ title: string;
637
+ purpose?: string | undefined;
638
+ sections?: string[] | undefined;
639
+ }[];
640
+ primary_language: string;
641
+ site_type: "other" | "landing-page" | "multi-page" | "blog" | "store" | "portfolio";
642
+ status: "draft" | "confirmed" | "built";
643
+ audience?: string | undefined;
644
+ brand?: {
645
+ accent_color?: string | undefined;
646
+ color_scheme?: "light" | "dark" | undefined;
647
+ font_style?: string | undefined;
648
+ logo_notes?: string | undefined;
649
+ primary_color?: string | undefined;
650
+ secondary_color?: string | undefined;
651
+ style_keywords?: string[] | undefined;
652
+ tone?: string | undefined;
653
+ } | undefined;
654
+ contact?: {
655
+ address?: string | undefined;
656
+ email?: string | undefined;
657
+ hours?: string | undefined;
658
+ phone?: string | undefined;
659
+ social?: {
660
+ platform: string;
661
+ url: string;
662
+ }[] | undefined;
663
+ } | undefined;
664
+ description?: string | undefined;
665
+ ecommerce?: {
666
+ enabled: boolean;
667
+ products_summary?: string | undefined;
668
+ } | undefined;
669
+ goals?: string[] | undefined;
670
+ notes?: string | undefined;
671
+ tagline?: string | undefined;
672
+ updated_at?: string | undefined;
673
+ } | null;
674
+ buildSession: {
675
+ expiresAt: string;
676
+ id: string;
677
+ summary: string;
678
+ } | null;
679
+ counts: {
680
+ customBlocks: number;
681
+ drafts: number;
682
+ media: number;
683
+ pages: number;
684
+ posts: number;
685
+ products: number;
686
+ };
687
+ customBlocks: {
688
+ fieldCount: any;
689
+ fields: any;
690
+ name: string;
691
+ slug: string;
692
+ }[];
693
+ drafts: {
694
+ parentId: number;
695
+ parentType: string;
696
+ }[];
697
+ homePage: {
698
+ blockCount: number;
699
+ id: number;
700
+ isHome: boolean;
701
+ isSeeded: boolean;
702
+ languageCode: string;
703
+ slug: string;
704
+ status: string;
705
+ title: string;
706
+ translationGroupId: string | null;
707
+ } | null;
708
+ identity: {
709
+ activeLogo: {
710
+ id: string;
711
+ isSeeded: boolean;
712
+ name: string;
713
+ objectKey: string | null;
714
+ } | null;
715
+ footerCopyright: {} | null;
716
+ footerShowAttribution: boolean;
717
+ siteDescription: unknown;
718
+ siteKeywords: unknown;
719
+ siteTitle: string;
720
+ };
721
+ languages: {
722
+ code: string;
723
+ id: number;
724
+ isActive: boolean;
725
+ isDefault: boolean;
726
+ name: string;
727
+ }[];
728
+ media: {
729
+ count: number;
730
+ sample: {
731
+ altText: any;
732
+ fileName: any;
733
+ id: string;
734
+ isSeeded: boolean;
735
+ }[] | undefined;
736
+ seededCount: number;
737
+ };
738
+ navigation: Record<"footer" | "header", Record<string, NavigationNode[]>> | null;
739
+ nextSteps: string[];
740
+ pages: {
741
+ blockCount: number;
742
+ id: number;
743
+ isHome: boolean;
744
+ isSeeded: boolean;
745
+ languageCode: string;
746
+ slug: string;
747
+ status: string;
748
+ title: string;
749
+ translationGroupId: string | null;
750
+ }[];
751
+ posts: {
752
+ blockCount: number;
753
+ id: number;
754
+ isSeeded: boolean;
755
+ languageCode: string;
756
+ publishedAt: any;
757
+ slug: string;
758
+ status: string;
759
+ title: string;
760
+ translationGroupId: string | null;
761
+ }[];
762
+ products: {
763
+ id: string;
764
+ languageCode: string;
765
+ slug: string;
766
+ status: string;
767
+ title: string;
768
+ }[];
769
+ seeded: {
770
+ anyPresent: boolean;
771
+ copyright: boolean;
772
+ logo: boolean;
773
+ media: number;
774
+ pages: number;
775
+ posts: number;
776
+ siteTitle: boolean;
777
+ };
778
+ success: boolean;
779
+ themes: {
780
+ colorScheme: string;
781
+ isActive: boolean;
782
+ isDefault: boolean;
783
+ name: string;
784
+ slug: string;
785
+ }[];
786
+ }>;
787
+ update_site_identity: import('ai').Tool<{
788
+ active_logo_id?: string | null | undefined;
789
+ footer_copyright?: Record<string, string> | undefined;
790
+ footer_show_attribution?: boolean | undefined;
791
+ site_description?: string | undefined;
792
+ site_keywords?: string | undefined;
793
+ site_title?: string | undefined;
794
+ }, {
795
+ confirmationPhrase: string;
796
+ mutationExecuted: boolean;
797
+ preview: Record<string, unknown>;
798
+ requiresConfirmation: boolean;
799
+ success: boolean;
800
+ } | {
801
+ mutationExecuted: boolean;
802
+ success: boolean;
803
+ updatedKeys: string[];
804
+ }>;
805
+ save_site_brief: import('ai').Tool<{
806
+ brief: {
807
+ audience?: string | undefined;
808
+ brand?: {
809
+ accent_color?: string | undefined;
810
+ color_scheme?: "light" | "dark" | undefined;
811
+ font_style?: string | undefined;
812
+ logo_notes?: string | undefined;
813
+ primary_color?: string | undefined;
814
+ secondary_color?: string | undefined;
815
+ style_keywords?: string[] | undefined;
816
+ tone?: string | undefined;
817
+ } | undefined;
818
+ business_name?: string | undefined;
819
+ contact?: {
820
+ address?: string | undefined;
821
+ email?: string | undefined;
822
+ hours?: string | undefined;
823
+ phone?: string | undefined;
824
+ social?: {
825
+ platform: string;
826
+ url: string;
827
+ }[] | undefined;
828
+ } | undefined;
829
+ description?: string | undefined;
830
+ ecommerce?: {
831
+ enabled: boolean;
832
+ products_summary?: string | undefined;
833
+ } | undefined;
834
+ goals?: string[] | undefined;
835
+ keep_existing_content?: boolean | undefined;
836
+ languages?: string[] | undefined;
837
+ notes?: string | undefined;
838
+ pages?: {
839
+ slug: string;
840
+ title: string;
841
+ purpose?: string | undefined;
842
+ sections?: string[] | undefined;
843
+ }[] | undefined;
844
+ primary_language?: string | undefined;
845
+ site_type?: "other" | "landing-page" | "multi-page" | "blog" | "store" | "portfolio" | undefined;
846
+ status?: "draft" | "confirmed" | "built" | undefined;
847
+ tagline?: string | undefined;
848
+ updated_at?: string | undefined;
849
+ };
850
+ mode: "replace" | "merge";
851
+ }, {
852
+ brief: {
853
+ business_name: string;
854
+ keep_existing_content: boolean;
855
+ languages: string[];
856
+ pages: {
857
+ slug: string;
858
+ title: string;
859
+ purpose?: string | undefined;
860
+ sections?: string[] | undefined;
861
+ }[];
862
+ primary_language: string;
863
+ site_type: "other" | "landing-page" | "multi-page" | "blog" | "store" | "portfolio";
864
+ status: "draft" | "confirmed" | "built";
865
+ audience?: string | undefined;
866
+ brand?: {
867
+ accent_color?: string | undefined;
868
+ color_scheme?: "light" | "dark" | undefined;
869
+ font_style?: string | undefined;
870
+ logo_notes?: string | undefined;
871
+ primary_color?: string | undefined;
872
+ secondary_color?: string | undefined;
873
+ style_keywords?: string[] | undefined;
874
+ tone?: string | undefined;
875
+ } | undefined;
876
+ contact?: {
877
+ address?: string | undefined;
878
+ email?: string | undefined;
879
+ hours?: string | undefined;
880
+ phone?: string | undefined;
881
+ social?: {
882
+ platform: string;
883
+ url: string;
884
+ }[] | undefined;
885
+ } | undefined;
886
+ description?: string | undefined;
887
+ ecommerce?: {
888
+ enabled: boolean;
889
+ products_summary?: string | undefined;
890
+ } | undefined;
891
+ goals?: string[] | undefined;
892
+ notes?: string | undefined;
893
+ tagline?: string | undefined;
894
+ updated_at?: string | undefined;
895
+ };
896
+ created: boolean;
897
+ mutationExecuted: boolean;
898
+ success: boolean;
899
+ }>;
900
+ reset_site_content: import('ai').Tool<{
901
+ clearKeptPageBlocks: boolean;
902
+ dryRun: boolean;
903
+ keepPageSlugs: string[];
904
+ onlySeeded: boolean;
905
+ scope: {
906
+ customBlocks?: boolean | undefined;
907
+ identity?: boolean | undefined;
908
+ navigation?: boolean | undefined;
909
+ pages?: boolean | undefined;
910
+ posts?: boolean | undefined;
911
+ products?: boolean | undefined;
912
+ seededMedia?: boolean | undefined;
913
+ };
914
+ keepLanguages?: string[] | undefined;
915
+ }, {
916
+ confirmationPhrase: string;
917
+ mutationExecuted: boolean;
918
+ preview: Record<string, unknown>;
919
+ requiresConfirmation: boolean;
920
+ success: boolean;
921
+ } | {
922
+ dryRun: boolean;
923
+ mutationExecuted: boolean;
924
+ nextSteps: string[];
925
+ success: boolean;
926
+ summary: {
927
+ blocksClearedOnPages: number;
928
+ customBlocks: number;
929
+ drafts: number;
930
+ identityCleared: boolean;
931
+ languagesDeactivated: string[];
932
+ logos: number;
933
+ media: number;
934
+ navigationItems: number;
935
+ pages: number;
936
+ pagesKept: string[];
937
+ posts: number;
938
+ products: number;
939
+ };
940
+ wouldDelete: {
941
+ pages: {
942
+ id: number;
943
+ slug: string;
944
+ languageCode: string;
945
+ }[];
946
+ posts: {
947
+ id: number;
948
+ slug: string;
949
+ languageCode: string;
950
+ }[];
951
+ };
952
+ deleted?: undefined;
953
+ } | {
954
+ deleted: {
955
+ blocksClearedOnPages: number;
956
+ customBlocks: number;
957
+ drafts: number;
958
+ identityCleared: boolean;
959
+ languagesDeactivated: string[];
960
+ logos: number;
961
+ media: number;
962
+ navigationItems: number;
963
+ pages: number;
964
+ pagesKept: string[];
965
+ posts: number;
966
+ products: number;
967
+ };
968
+ mutationExecuted: boolean;
969
+ nextSteps: string[];
970
+ success: boolean;
971
+ dryRun?: undefined;
972
+ summary?: undefined;
973
+ wouldDelete?: undefined;
974
+ }>;
975
+ start_site_build: import('ai').Tool<{
976
+ durationMinutes: number;
977
+ summary: string;
978
+ brief?: {
979
+ audience?: string | undefined;
980
+ brand?: {
981
+ accent_color?: string | undefined;
982
+ color_scheme?: "light" | "dark" | undefined;
983
+ font_style?: string | undefined;
984
+ logo_notes?: string | undefined;
985
+ primary_color?: string | undefined;
986
+ secondary_color?: string | undefined;
987
+ style_keywords?: string[] | undefined;
988
+ tone?: string | undefined;
989
+ } | undefined;
990
+ business_name?: string | undefined;
991
+ contact?: {
992
+ address?: string | undefined;
993
+ email?: string | undefined;
994
+ hours?: string | undefined;
995
+ phone?: string | undefined;
996
+ social?: {
997
+ platform: string;
998
+ url: string;
999
+ }[] | undefined;
1000
+ } | undefined;
1001
+ description?: string | undefined;
1002
+ ecommerce?: {
1003
+ enabled: boolean;
1004
+ products_summary?: string | undefined;
1005
+ } | undefined;
1006
+ goals?: string[] | undefined;
1007
+ keep_existing_content?: boolean | undefined;
1008
+ languages?: string[] | undefined;
1009
+ notes?: string | undefined;
1010
+ pages?: {
1011
+ slug: string;
1012
+ title: string;
1013
+ purpose?: string | undefined;
1014
+ sections?: string[] | undefined;
1015
+ }[] | undefined;
1016
+ primary_language?: string | undefined;
1017
+ site_type?: "other" | "landing-page" | "multi-page" | "blog" | "store" | "portfolio" | undefined;
1018
+ status?: "draft" | "confirmed" | "built" | undefined;
1019
+ tagline?: string | undefined;
1020
+ updated_at?: string | undefined;
1021
+ } | undefined;
1022
+ reset?: {
1023
+ clearKeptPageBlocks: boolean;
1024
+ dryRun: boolean;
1025
+ keepPageSlugs: string[];
1026
+ onlySeeded: boolean;
1027
+ scope: {
1028
+ customBlocks?: boolean | undefined;
1029
+ identity?: boolean | undefined;
1030
+ navigation?: boolean | undefined;
1031
+ pages?: boolean | undefined;
1032
+ posts?: boolean | undefined;
1033
+ products?: boolean | undefined;
1034
+ seededMedia?: boolean | undefined;
1035
+ };
1036
+ keepLanguages?: string[] | undefined;
1037
+ } | undefined;
1038
+ }, {
1039
+ confirmationPhrase: string;
1040
+ mutationExecuted: boolean;
1041
+ preview: Record<string, unknown>;
1042
+ requiresConfirmation: boolean;
1043
+ success: boolean;
1044
+ } | {
1045
+ brief: {
1046
+ business_name: string;
1047
+ keep_existing_content: boolean;
1048
+ languages: string[];
1049
+ pages: {
1050
+ slug: string;
1051
+ title: string;
1052
+ purpose?: string | undefined;
1053
+ sections?: string[] | undefined;
1054
+ }[];
1055
+ primary_language: string;
1056
+ site_type: "other" | "landing-page" | "multi-page" | "blog" | "store" | "portfolio";
1057
+ status: "draft" | "confirmed" | "built";
1058
+ audience?: string | undefined;
1059
+ brand?: {
1060
+ accent_color?: string | undefined;
1061
+ color_scheme?: "light" | "dark" | undefined;
1062
+ font_style?: string | undefined;
1063
+ logo_notes?: string | undefined;
1064
+ primary_color?: string | undefined;
1065
+ secondary_color?: string | undefined;
1066
+ style_keywords?: string[] | undefined;
1067
+ tone?: string | undefined;
1068
+ } | undefined;
1069
+ contact?: {
1070
+ address?: string | undefined;
1071
+ email?: string | undefined;
1072
+ hours?: string | undefined;
1073
+ phone?: string | undefined;
1074
+ social?: {
1075
+ platform: string;
1076
+ url: string;
1077
+ }[] | undefined;
1078
+ } | undefined;
1079
+ description?: string | undefined;
1080
+ ecommerce?: {
1081
+ enabled: boolean;
1082
+ products_summary?: string | undefined;
1083
+ } | undefined;
1084
+ goals?: string[] | undefined;
1085
+ notes?: string | undefined;
1086
+ tagline?: string | undefined;
1087
+ updated_at?: string | undefined;
1088
+ } | null;
1089
+ buildSession: {
1090
+ expiresAt: string;
1091
+ id: string;
1092
+ };
1093
+ continuePrompt: string;
1094
+ mutationExecuted: boolean;
1095
+ resetResult: Record<string, unknown> | null;
1096
+ success: boolean;
1097
+ }>;
1098
+ finish_site_build: import('ai').Tool<{
1099
+ outcome: "built" | "stopped";
1100
+ summary?: string | undefined;
1101
+ }, {
1102
+ brief: {
1103
+ business_name: string;
1104
+ keep_existing_content: boolean;
1105
+ languages: string[];
1106
+ pages: {
1107
+ slug: string;
1108
+ title: string;
1109
+ purpose?: string | undefined;
1110
+ sections?: string[] | undefined;
1111
+ }[];
1112
+ primary_language: string;
1113
+ site_type: "other" | "landing-page" | "multi-page" | "blog" | "store" | "portfolio";
1114
+ status: "draft" | "confirmed" | "built";
1115
+ audience?: string | undefined;
1116
+ brand?: {
1117
+ accent_color?: string | undefined;
1118
+ color_scheme?: "light" | "dark" | undefined;
1119
+ font_style?: string | undefined;
1120
+ logo_notes?: string | undefined;
1121
+ primary_color?: string | undefined;
1122
+ secondary_color?: string | undefined;
1123
+ style_keywords?: string[] | undefined;
1124
+ tone?: string | undefined;
1125
+ } | undefined;
1126
+ contact?: {
1127
+ address?: string | undefined;
1128
+ email?: string | undefined;
1129
+ hours?: string | undefined;
1130
+ phone?: string | undefined;
1131
+ social?: {
1132
+ platform: string;
1133
+ url: string;
1134
+ }[] | undefined;
1135
+ } | undefined;
1136
+ description?: string | undefined;
1137
+ ecommerce?: {
1138
+ enabled: boolean;
1139
+ products_summary?: string | undefined;
1140
+ } | undefined;
1141
+ goals?: string[] | undefined;
1142
+ notes?: string | undefined;
1143
+ tagline?: string | undefined;
1144
+ updated_at?: string | undefined;
1145
+ } | null;
1146
+ buildSessionEnded: boolean;
1147
+ hadSession: boolean;
1148
+ mutationExecuted: boolean;
1149
+ outcome: "built" | "stopped";
1150
+ success: boolean;
1151
+ }>;
1152
+ };
1153
+ export {};