@koda-sl/baker-cli 0.164.0 → 0.165.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/cli.js CHANGED
@@ -2328,9 +2328,51 @@ var linkedinDraftErrorResponseSchema = z4.object({
2328
2328
  fields: z4.array(linkedinFieldErrorSchema).optional()
2329
2329
  });
2330
2330
 
2331
- // ../api/src/chats.ts
2331
+ // ../api/src/brand.ts
2332
2332
  import { z as z5 } from "zod";
2333
- var chatInspectStatusSchema = z5.enum([
2333
+ var BRAND_TOKENS_VERSION = 1;
2334
+ var BRAND_COLOR_ROLES = ["background", "surface", "cta", "accent", "foreground", "other"];
2335
+ var BRAND_FONT_ROLES = ["heading", "body", "mono"];
2336
+ var BRAND_LOGO_VARIANTS = ["logo", "symbol", "icon"];
2337
+ var hexColorSchema = z5.string().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, "expected #RRGGBB or #RRGGBBAA").transform((value) => value.toUpperCase());
2338
+ var brandColorSchema = z5.strictObject({
2339
+ name: z5.string().min(1),
2340
+ value: hexColorSchema,
2341
+ role: z5.enum(BRAND_COLOR_ROLES),
2342
+ palette: z5.string().min(1).default("primary")
2343
+ });
2344
+ var brandFontSchema = z5.strictObject({
2345
+ family: z5.string().min(1),
2346
+ role: z5.enum(BRAND_FONT_ROLES),
2347
+ weights: z5.array(z5.number().int().min(1).max(1e3)).min(1),
2348
+ source: z5.enum(["local", "google"]),
2349
+ files: z5.array(z5.string().startsWith("src/brand/fonts/")).optional()
2350
+ }).refine((font) => font.source !== "local" || (font.files?.length ?? 0) > 0, {
2351
+ message: "a local font must list its files under src/brand/fonts/",
2352
+ path: ["files"]
2353
+ });
2354
+ var brandLogoSchema = z5.strictObject({
2355
+ variant: z5.enum(BRAND_LOGO_VARIANTS),
2356
+ /** The background the mark is designed to sit on; null = works on any. */
2357
+ background: z5.enum(["light", "dark"]).nullable().default(null),
2358
+ path: z5.string().startsWith("src/brand/logos/")
2359
+ });
2360
+ var brandTokensSchema = z5.strictObject({
2361
+ version: z5.literal(BRAND_TOKENS_VERSION),
2362
+ colors: z5.array(brandColorSchema).default([]),
2363
+ fonts: z5.array(brandFontSchema).default([]),
2364
+ logos: z5.array(brandLogoSchema).default([]),
2365
+ radius: z5.record(z5.string().min(1), z5.string().min(1)).optional()
2366
+ });
2367
+ var putBrandRequestSchema = z5.object({
2368
+ content: z5.string(),
2369
+ tokens: brandTokensSchema.optional(),
2370
+ chatId: z5.string().optional()
2371
+ });
2372
+
2373
+ // ../api/src/chats.ts
2374
+ import { z as z6 } from "zod";
2375
+ var chatInspectStatusSchema = z6.enum([
2334
2376
  "draft",
2335
2377
  "in_progress",
2336
2378
  "publishing",
@@ -2338,8 +2380,8 @@ var chatInspectStatusSchema = z5.enum([
2338
2380
  "completed",
2339
2381
  "discarded"
2340
2382
  ]);
2341
- var chatStatusGroupSchema = z5.enum(["active", "archived", "all"]);
2342
- var chatChangeTypeSchema = z5.enum([
2383
+ var chatStatusGroupSchema = z6.enum(["active", "archived", "all"]);
2384
+ var chatChangeTypeSchema = z6.enum([
2343
2385
  "landing",
2344
2386
  "document",
2345
2387
  "knowledge",
@@ -2360,197 +2402,197 @@ var chatChangeTypeSchema = z5.enum([
2360
2402
  "followed-advertiser",
2361
2403
  "briefs"
2362
2404
  ]);
2363
- var chatChangeActionSchema = z5.enum(["created", "updated", "deleted"]);
2364
- var chatChangeSummarySchema = z5.object({
2405
+ var chatChangeActionSchema = z6.enum(["created", "updated", "deleted"]);
2406
+ var chatChangeSummarySchema = z6.object({
2365
2407
  type: chatChangeTypeSchema,
2366
- slug: z5.string(),
2408
+ slug: z6.string(),
2367
2409
  action: chatChangeActionSchema,
2368
- title: z5.string().optional()
2410
+ title: z6.string().optional()
2369
2411
  });
2370
- var repoSurfaceSchema = z5.enum(["knowledge", "company", "brand", "landings", "flows", "creatives"]);
2371
- var chatsListRequestSchema = z5.object({
2412
+ var repoSurfaceSchema = z6.enum(["knowledge", "company", "brand", "landings", "flows", "creatives"]);
2413
+ var chatsListRequestSchema = z6.object({
2372
2414
  status: chatStatusGroupSchema.optional(),
2373
- limit: z5.number().int().min(1).max(100).optional(),
2415
+ limit: z6.number().int().min(1).max(100).optional(),
2374
2416
  /** Include each Session's full `changes[]` list (compact returns counts only). */
2375
- full: z5.boolean().optional(),
2417
+ full: z6.boolean().optional(),
2376
2418
  /**
2377
2419
  * The caller's OWN Session id — excluded from results so an agent never sees
2378
2420
  * its own in-flight chat listed as a separate "other Session" to reuse.
2379
2421
  */
2380
- excludeChatId: z5.string().optional()
2422
+ excludeChatId: z6.string().optional()
2381
2423
  });
2382
- var chatSummarySchema = z5.object({
2383
- id: z5.string(),
2384
- title: z5.string(),
2424
+ var chatSummarySchema = z6.object({
2425
+ id: z6.string(),
2426
+ title: z6.string(),
2385
2427
  status: chatInspectStatusSchema,
2386
- createdAt: z5.number(),
2387
- updatedAt: z5.number(),
2428
+ createdAt: z6.number(),
2429
+ updatedAt: z6.number(),
2388
2430
  /** Counts of produced outputs keyed by change type. */
2389
- outputs: z5.record(z5.string(), z5.number()),
2390
- outputTotal: z5.number(),
2391
- changes: z5.array(chatChangeSummarySchema).optional()
2392
- });
2393
- var chatsListResponseSchema = z5.object({
2394
- ok: z5.literal(true),
2395
- data: z5.object({ chats: z5.array(chatSummarySchema) })
2396
- });
2397
- var chatsViewRequestSchema = z5.object({
2398
- chatId: z5.string(),
2399
- full: z5.boolean().optional()
2400
- });
2401
- var chatThreadSummarySchema = z5.object({
2402
- id: z5.string(),
2403
- title: z5.string().nullable(),
2404
- status: z5.string(),
2405
- createdAt: z5.number()
2406
- });
2407
- var chatCommitSummarySchema = z5.object({
2408
- sha: z5.string(),
2409
- message: z5.string().nullable(),
2410
- surfaces: z5.array(z5.string()),
2411
- createdAt: z5.number()
2412
- });
2413
- var effectOpSchema = z5.enum(["created", "updated", "completed", "discarded", "deleted", "linked", "unlinked"]);
2414
- var contentEffectSchema = z5.object({
2431
+ outputs: z6.record(z6.string(), z6.number()),
2432
+ outputTotal: z6.number(),
2433
+ changes: z6.array(chatChangeSummarySchema).optional()
2434
+ });
2435
+ var chatsListResponseSchema = z6.object({
2436
+ ok: z6.literal(true),
2437
+ data: z6.object({ chats: z6.array(chatSummarySchema) })
2438
+ });
2439
+ var chatsViewRequestSchema = z6.object({
2440
+ chatId: z6.string(),
2441
+ full: z6.boolean().optional()
2442
+ });
2443
+ var chatThreadSummarySchema = z6.object({
2444
+ id: z6.string(),
2445
+ title: z6.string().nullable(),
2446
+ status: z6.string(),
2447
+ createdAt: z6.number()
2448
+ });
2449
+ var chatCommitSummarySchema = z6.object({
2450
+ sha: z6.string(),
2451
+ message: z6.string().nullable(),
2452
+ surfaces: z6.array(z6.string()),
2453
+ createdAt: z6.number()
2454
+ });
2455
+ var effectOpSchema = z6.enum(["created", "updated", "completed", "discarded", "deleted", "linked", "unlinked"]);
2456
+ var contentEffectSchema = z6.object({
2415
2457
  surface: chatChangeTypeSchema,
2416
- slug: z5.string(),
2458
+ slug: z6.string(),
2417
2459
  op: effectOpSchema,
2418
- staged: z5.boolean()
2460
+ staged: z6.boolean()
2419
2461
  });
2420
- var actionEffectSchema = z5.object({
2462
+ var actionEffectSchema = z6.object({
2421
2463
  op: effectOpSchema,
2422
- staged: z5.boolean(),
2423
- name: z5.string(),
2424
- description: z5.string().nullable(),
2425
- priority: z5.string().nullable(),
2426
- tags: z5.array(z5.string()),
2427
- status: z5.string().nullable(),
2428
- note: z5.string().nullable(),
2429
- reason: z5.string().nullable()
2430
- });
2431
- var scheduledEffectSchema = z5.object({
2464
+ staged: z6.boolean(),
2465
+ name: z6.string(),
2466
+ description: z6.string().nullable(),
2467
+ priority: z6.string().nullable(),
2468
+ tags: z6.array(z6.string()),
2469
+ status: z6.string().nullable(),
2470
+ note: z6.string().nullable(),
2471
+ reason: z6.string().nullable()
2472
+ });
2473
+ var scheduledEffectSchema = z6.object({
2432
2474
  op: effectOpSchema,
2433
- staged: z5.boolean(),
2434
- name: z5.string(),
2435
- summary: z5.string().nullable()
2475
+ staged: z6.boolean(),
2476
+ name: z6.string(),
2477
+ summary: z6.string().nullable()
2436
2478
  });
2437
- var tagEffectSchema = z5.object({
2479
+ var tagEffectSchema = z6.object({
2438
2480
  op: effectOpSchema,
2439
- staged: z5.boolean(),
2440
- tagType: z5.string(),
2441
- title: z5.string().nullable(),
2442
- summary: z5.string().nullable(),
2443
- configKeys: z5.array(z5.string()),
2444
- hasSecrets: z5.boolean()
2445
- });
2446
- var adEffectSchema = z5.object({
2447
- platform: z5.enum(["google", "meta", "linkedin"]),
2481
+ staged: z6.boolean(),
2482
+ tagType: z6.string(),
2483
+ title: z6.string().nullable(),
2484
+ summary: z6.string().nullable(),
2485
+ configKeys: z6.array(z6.string()),
2486
+ hasSecrets: z6.boolean()
2487
+ });
2488
+ var adEffectSchema = z6.object({
2489
+ platform: z6.enum(["google", "meta", "linkedin"]),
2448
2490
  op: effectOpSchema,
2449
- staged: z5.boolean(),
2450
- entity: z5.string().nullable(),
2451
- operation: z5.string().nullable(),
2452
- summary: z5.string().nullable()
2491
+ staged: z6.boolean(),
2492
+ entity: z6.string().nullable(),
2493
+ operation: z6.string().nullable(),
2494
+ summary: z6.string().nullable()
2453
2495
  });
2454
- var creativeEffectSchema = z5.object({
2496
+ var creativeEffectSchema = z6.object({
2455
2497
  op: effectOpSchema,
2456
- staged: z5.boolean(),
2457
- slug: z5.string(),
2458
- title: z5.string().nullable(),
2459
- status: z5.string().nullable()
2460
- });
2461
- var chatEffectsSchema = z5.object({
2462
- content: z5.array(contentEffectSchema),
2463
- actions: z5.array(actionEffectSchema),
2464
- scheduledActions: z5.array(scheduledEffectSchema),
2465
- tags: z5.array(tagEffectSchema),
2466
- ads: z5.object({
2467
- google: z5.array(adEffectSchema),
2468
- meta: z5.array(adEffectSchema),
2469
- linkedin: z5.array(adEffectSchema)
2498
+ staged: z6.boolean(),
2499
+ slug: z6.string(),
2500
+ title: z6.string().nullable(),
2501
+ status: z6.string().nullable()
2502
+ });
2503
+ var chatEffectsSchema = z6.object({
2504
+ content: z6.array(contentEffectSchema),
2505
+ actions: z6.array(actionEffectSchema),
2506
+ scheduledActions: z6.array(scheduledEffectSchema),
2507
+ tags: z6.array(tagEffectSchema),
2508
+ ads: z6.object({
2509
+ google: z6.array(adEffectSchema),
2510
+ meta: z6.array(adEffectSchema),
2511
+ linkedin: z6.array(adEffectSchema)
2470
2512
  }),
2471
- creatives: z5.array(creativeEffectSchema)
2513
+ creatives: z6.array(creativeEffectSchema)
2472
2514
  });
2473
- var chatDetailSchema = z5.object({
2474
- id: z5.string(),
2475
- title: z5.string(),
2515
+ var chatDetailSchema = z6.object({
2516
+ id: z6.string(),
2517
+ title: z6.string(),
2476
2518
  status: chatInspectStatusSchema,
2477
- createdAt: z5.number(),
2478
- updatedAt: z5.number(),
2479
- completedBySource: z5.enum(["user", "bridge"]).nullable(),
2480
- publishedAt: z5.number().nullable(),
2519
+ createdAt: z6.number(),
2520
+ updatedAt: z6.number(),
2521
+ completedBySource: z6.enum(["user", "bridge"]).nullable(),
2522
+ publishedAt: z6.number().nullable(),
2481
2523
  /** The first user message — how this Session was originally asked. */
2482
- kickoff: z5.string().nullable(),
2483
- outputs: z5.record(z5.string(), z5.number()),
2484
- outputTotal: z5.number(),
2524
+ kickoff: z6.string().nullable(),
2525
+ outputs: z6.record(z6.string(), z6.number()),
2526
+ outputTotal: z6.number(),
2485
2527
  /** The unified picture of everything this Session changed — git + DB. */
2486
2528
  effects: chatEffectsSchema,
2487
- threads: z5.array(chatThreadSummarySchema),
2488
- commits: z5.array(chatCommitSummarySchema),
2529
+ threads: z6.array(chatThreadSummarySchema),
2530
+ commits: z6.array(chatCommitSummarySchema),
2489
2531
  /** True when a real file-level diff is available via `baker chats diff`. */
2490
- diffAvailable: z5.boolean()
2532
+ diffAvailable: z6.boolean()
2491
2533
  });
2492
- var chatsViewResponseSchema = z5.object({
2493
- ok: z5.literal(true),
2534
+ var chatsViewResponseSchema = z6.object({
2535
+ ok: z6.literal(true),
2494
2536
  data: chatDetailSchema
2495
2537
  });
2496
- var chatsTranscriptRequestSchema = z5.object({
2497
- chatId: z5.string(),
2498
- limit: z5.number().int().min(1).max(1e3).optional(),
2538
+ var chatsTranscriptRequestSchema = z6.object({
2539
+ chatId: z6.string(),
2540
+ limit: z6.number().int().min(1).max(1e3).optional(),
2499
2541
  /** Return untruncated message text (compact truncates each entry). */
2500
- full: z5.boolean().optional()
2542
+ full: z6.boolean().optional()
2501
2543
  });
2502
- var transcriptEntrySchema = z5.object({
2503
- role: z5.string(),
2504
- text: z5.string()
2544
+ var transcriptEntrySchema = z6.object({
2545
+ role: z6.string(),
2546
+ text: z6.string()
2505
2547
  });
2506
- var chatsTranscriptResponseSchema = z5.object({
2507
- ok: z5.literal(true),
2508
- data: z5.object({
2509
- chatId: z5.string(),
2510
- entries: z5.array(transcriptEntrySchema),
2548
+ var chatsTranscriptResponseSchema = z6.object({
2549
+ ok: z6.literal(true),
2550
+ data: z6.object({
2551
+ chatId: z6.string(),
2552
+ entries: z6.array(transcriptEntrySchema),
2511
2553
  /** True when older entries were dropped to fit `limit`. */
2512
- truncated: z5.boolean()
2554
+ truncated: z6.boolean()
2513
2555
  })
2514
2556
  });
2515
- var chatsDiffRequestSchema = z5.object({
2516
- chatId: z5.string(),
2557
+ var chatsDiffRequestSchema = z6.object({
2558
+ chatId: z6.string(),
2517
2559
  surface: repoSurfaceSchema.optional(),
2518
2560
  /** Include the unified-diff `patch` text per file (compact omits it). */
2519
- full: z5.boolean().optional(),
2561
+ full: z6.boolean().optional(),
2520
2562
  /**
2521
2563
  * Opt in to reading an in-progress (unpublished) Session's changes straight
2522
2564
  * from its live Runtime — resumes the paused sandbox and runs a read-only git
2523
2565
  * diff. Slower and only works while the sandbox still exists (not discarded).
2524
2566
  * Ignored for published Sessions, which always read from git.
2525
2567
  */
2526
- live: z5.boolean().optional()
2568
+ live: z6.boolean().optional()
2527
2569
  });
2528
- var diffFileSchema = z5.object({
2529
- path: z5.string(),
2570
+ var diffFileSchema = z6.object({
2571
+ path: z6.string(),
2530
2572
  surface: repoSurfaceSchema.nullable(),
2531
- status: z5.string(),
2532
- additions: z5.number(),
2533
- deletions: z5.number(),
2534
- patch: z5.string().optional()
2535
- });
2536
- var diffSourceSchema = z5.enum(["published", "live"]);
2537
- var chatsDiffResponseSchema = z5.object({
2538
- ok: z5.literal(true),
2539
- data: z5.object({
2540
- chatId: z5.string(),
2573
+ status: z6.string(),
2574
+ additions: z6.number(),
2575
+ deletions: z6.number(),
2576
+ patch: z6.string().optional()
2577
+ });
2578
+ var diffSourceSchema = z6.enum(["published", "live"]);
2579
+ var chatsDiffResponseSchema = z6.object({
2580
+ ok: z6.literal(true),
2581
+ data: z6.object({
2582
+ chatId: z6.string(),
2541
2583
  /** False when no published git diff exists (in-progress Session or unlinked repo). */
2542
- available: z5.boolean(),
2543
- reason: z5.string().optional(),
2584
+ available: z6.boolean(),
2585
+ reason: z6.string().optional(),
2544
2586
  /** Present when available — how the diff was obtained. */
2545
2587
  source: diffSourceSchema.optional(),
2546
2588
  /** True when the live diff was capped (very large in-progress change set). */
2547
- truncated: z5.boolean().optional(),
2548
- files: z5.array(diffFileSchema)
2589
+ truncated: z6.boolean().optional(),
2590
+ files: z6.array(diffFileSchema)
2549
2591
  })
2550
2592
  });
2551
2593
 
2552
2594
  // ../api/src/flows.ts
2553
- import { z as z6 } from "zod";
2595
+ import { z as z7 } from "zod";
2554
2596
  var FLOW_SECRET_SIDE_EFFECT_TYPES = [
2555
2597
  "email",
2556
2598
  "zapier",
@@ -2561,7 +2603,7 @@ var FLOW_SECRET_SIDE_EFFECT_TYPES = [
2561
2603
  "crmble",
2562
2604
  "goHighlevelContact"
2563
2605
  ];
2564
- var flowSideEffectTypeSchema = z6.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
2606
+ var flowSideEffectTypeSchema = z7.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
2565
2607
  var FLOW_SECRET_FIELDS = {
2566
2608
  email: [],
2567
2609
  zapier: ["zapUrl"],
@@ -2589,94 +2631,94 @@ var FLOW_RESOURCE_NODE_TYPES = [
2589
2631
  "highlevel",
2590
2632
  "highlevelForm"
2591
2633
  ];
2592
- var flowResourceNodeTypeSchema = z6.enum(FLOW_RESOURCE_NODE_TYPES);
2593
- var flowInputRequestSchema = z6.discriminatedUnion("target", [
2594
- z6.object({
2634
+ var flowResourceNodeTypeSchema = z7.enum(FLOW_RESOURCE_NODE_TYPES);
2635
+ var flowInputRequestSchema = z7.discriminatedUnion("target", [
2636
+ z7.object({
2595
2637
  /** Configure a side effect's `encryptedConfig` (+ `oauthProviderId` for OAuth types). */
2596
- target: z6.literal("sideEffect"),
2597
- flowSlug: z6.string(),
2638
+ target: z7.literal("sideEffect"),
2639
+ flowSlug: z7.string(),
2598
2640
  /** `id` of the FlowNode holding the side effect. */
2599
- nodeId: z6.string(),
2641
+ nodeId: z7.string(),
2600
2642
  /** `id` of the side effect within that node's `sideEffects[]`. */
2601
- sideEffectId: z6.string(),
2643
+ sideEffectId: z7.string(),
2602
2644
  sideEffectType: flowSideEffectTypeSchema,
2603
2645
  /** Non-secret `encryptedConfig` values the agent proposes (e.g. webhook apiUrl, auth type). Secret keys are stripped at every boundary. */
2604
- prefilledConfig: z6.record(z6.string(), z6.string()).optional(),
2646
+ prefilledConfig: z7.record(z7.string(), z7.string()).optional(),
2605
2647
  /** Secret credential field names the agent asks the user to provide. */
2606
- requestedSecretFields: z6.array(z6.string()).optional(),
2607
- message: z6.string().optional()
2648
+ requestedSecretFields: z7.array(z7.string()).optional(),
2649
+ message: z7.string().optional()
2608
2650
  }),
2609
- z6.object({
2651
+ z7.object({
2610
2652
  /** Configure a widget node's third-party `form.external` (+ `providerId`). */
2611
- target: z6.literal("node"),
2612
- flowSlug: z6.string(),
2653
+ target: z7.literal("node"),
2654
+ flowSlug: z7.string(),
2613
2655
  /** `id` of the widget FlowNode. */
2614
- nodeId: z6.string(),
2656
+ nodeId: z7.string(),
2615
2657
  nodeType: flowResourceNodeTypeSchema,
2616
- message: z6.string().optional()
2658
+ message: z7.string().optional()
2617
2659
  })
2618
2660
  ]);
2619
- var flowInputToolInputSchema = z6.object({
2620
- requests: z6.array(flowInputRequestSchema).min(1).max(8)
2661
+ var flowInputToolInputSchema = z7.object({
2662
+ requests: z7.array(flowInputRequestSchema).min(1).max(8)
2621
2663
  });
2622
- var flowInputResultSchema = z6.discriminatedUnion("status", [
2623
- z6.object({
2624
- status: z6.literal("submitted"),
2664
+ var flowInputResultSchema = z7.discriminatedUnion("status", [
2665
+ z7.object({
2666
+ status: z7.literal("submitted"),
2625
2667
  /** Echoes which piece this result resolves. */
2626
- nodeId: z6.string(),
2627
- sideEffectId: z6.string().optional(),
2668
+ nodeId: z7.string(),
2669
+ sideEffectId: z7.string().optional(),
2628
2670
  /** Names of secret fields the user provided. Never values. */
2629
- secretFieldsSet: z6.array(z6.string()),
2671
+ secretFieldsSet: z7.array(z7.string()),
2630
2672
  /** Non-secret human summary of what was configured (e.g. "HubSpot form 'Contact us' — 7 fields"). */
2631
- note: z6.string().optional()
2673
+ note: z7.string().optional()
2632
2674
  }),
2633
- z6.object({
2634
- status: z6.literal("declined"),
2635
- nodeId: z6.string(),
2636
- sideEffectId: z6.string().optional(),
2637
- reason: z6.string().optional()
2675
+ z7.object({
2676
+ status: z7.literal("declined"),
2677
+ nodeId: z7.string(),
2678
+ sideEffectId: z7.string().optional(),
2679
+ reason: z7.string().optional()
2638
2680
  })
2639
2681
  ]);
2640
- var flowInputToolResultSchema = z6.object({
2641
- results: z6.array(flowInputResultSchema)
2682
+ var flowInputToolResultSchema = z7.object({
2683
+ results: z7.array(flowInputResultSchema)
2642
2684
  });
2643
- var flowsListRequestSchema = z6.object({ chatId: z6.string() });
2644
- var flowSummarySchema = z6.object({
2645
- slug: z6.string(),
2646
- name: z6.string(),
2685
+ var flowsListRequestSchema = z7.object({ chatId: z7.string() });
2686
+ var flowSummarySchema = z7.object({
2687
+ slug: z7.string(),
2688
+ name: z7.string(),
2647
2689
  /** Count of nodes with an unconfigured confidential field (secret missing / resource not picked / connection needed). */
2648
- needsConfig: z6.number()
2690
+ needsConfig: z7.number()
2649
2691
  });
2650
- var flowsListResponseSchema = z6.object({ flows: z6.array(flowSummarySchema) });
2651
- var flowsShowRequestSchema = z6.object({
2652
- chatId: z6.string(),
2653
- slug: z6.string(),
2654
- full: z6.boolean().optional()
2692
+ var flowsListResponseSchema = z7.object({ flows: z7.array(flowSummarySchema) });
2693
+ var flowsShowRequestSchema = z7.object({
2694
+ chatId: z7.string(),
2695
+ slug: z7.string(),
2696
+ full: z7.boolean().optional()
2655
2697
  });
2656
- var flowConfigStatusSchema = z6.object({
2657
- nodeId: z6.string(),
2658
- nodeName: z6.string().optional(),
2698
+ var flowConfigStatusSchema = z7.object({
2699
+ nodeId: z7.string(),
2700
+ nodeName: z7.string().optional(),
2659
2701
  /** "sideEffect" credential/connection, or "node" widget resource. */
2660
- target: z6.enum(["sideEffect", "node"]),
2661
- sideEffectId: z6.string().optional(),
2662
- kind: z6.string(),
2702
+ target: z7.enum(["sideEffect", "node"]),
2703
+ sideEffectId: z7.string().optional(),
2704
+ kind: z7.string(),
2663
2705
  /** Human status, e.g. "webhook — apiKeyValue [set], bearerToken [missing]" / "HubSpot form [not selected]" / "Pipedrive [needs connection]". */
2664
- status: z6.string(),
2706
+ status: z7.string(),
2665
2707
  /** True when a `request_flow_input` call is still needed for this piece. */
2666
- needsInput: z6.boolean()
2708
+ needsInput: z7.boolean()
2667
2709
  });
2668
- var flowsShowResponseSchema = z6.object({
2669
- slug: z6.string(),
2670
- name: z6.string(),
2710
+ var flowsShowResponseSchema = z7.object({
2711
+ slug: z7.string(),
2712
+ name: z7.string(),
2671
2713
  /** Confidential fields and whether each is configured. */
2672
- config: z6.array(flowConfigStatusSchema),
2714
+ config: z7.array(flowConfigStatusSchema),
2673
2715
  /** Present only with `--full`: the whole flow tree, secret values redacted. */
2674
- tree: z6.unknown().optional()
2716
+ tree: z7.unknown().optional()
2675
2717
  });
2676
2718
 
2677
2719
  // ../api/src/history.ts
2678
- import { z as z7 } from "zod";
2679
- var historyCategorySchema = z7.enum([
2720
+ import { z as z8 } from "zod";
2721
+ var historyCategorySchema = z8.enum([
2680
2722
  "publish",
2681
2723
  "chat",
2682
2724
  "action",
@@ -2694,184 +2736,184 @@ var historyCategorySchema = z7.enum([
2694
2736
  "integration",
2695
2737
  "tag_manager"
2696
2738
  ]);
2697
- var historyListRequestSchema = z7.object({
2698
- limit: z7.number().int().min(1).max(200).optional(),
2739
+ var historyListRequestSchema = z8.object({
2740
+ limit: z8.number().int().min(1).max(200).optional(),
2699
2741
  category: historyCategorySchema.optional(),
2700
2742
  /** Only entries from the last N days. */
2701
- days: z7.number().int().min(1).max(365).optional(),
2743
+ days: z8.number().int().min(1).max(365).optional(),
2702
2744
  /** Include raw metadata on each entry (compact by default). */
2703
- full: z7.boolean().optional()
2745
+ full: z8.boolean().optional()
2704
2746
  });
2705
- var historyEntrySchema = z7.object({
2706
- id: z7.string(),
2747
+ var historyEntrySchema = z8.object({
2748
+ id: z8.string(),
2707
2749
  /** Epoch ms. */
2708
- at: z7.number(),
2750
+ at: z8.number(),
2709
2751
  category: historyCategorySchema,
2710
2752
  /** Dotted action id, e.g. "publish.commit", "member.invite_create". */
2711
- action: z7.string(),
2712
- actorType: z7.enum(["user", "agent", "system"]),
2753
+ action: z8.string(),
2754
+ actorType: z8.enum(["user", "agent", "system"]),
2713
2755
  /** Display name of the acting user, when the actor is a user. */
2714
- actor: z7.string().nullable(),
2756
+ actor: z8.string().nullable(),
2715
2757
  /** What the change touched — commit subject, chat title, member email, tag type, … */
2716
- target: z7.string().nullable(),
2717
- metadata: z7.record(z7.string(), z7.unknown()).optional()
2758
+ target: z8.string().nullable(),
2759
+ metadata: z8.record(z8.string(), z8.unknown()).optional()
2718
2760
  });
2719
- var historyListResponseSchema = z7.object({
2720
- ok: z7.literal(true),
2721
- data: z7.object({ entries: z7.array(historyEntrySchema) })
2761
+ var historyListResponseSchema = z8.object({
2762
+ ok: z8.literal(true),
2763
+ data: z8.object({ entries: z8.array(historyEntrySchema) })
2722
2764
  });
2723
2765
 
2724
2766
  // ../api/src/hubspot.ts
2725
- import { z as z8 } from "zod";
2726
- var hubspotEmbedTypeSchema = z8.enum(["legacy", "v4", "unknown"]);
2727
- var hubspotPostSubmitActionSchema = z8.object({
2728
- type: z8.enum(["redirect_url", "thank_you"]),
2729
- value: z8.string()
2730
- });
2731
- var hubspotFormFieldSchema = z8.object({
2732
- name: z8.string(),
2733
- label: z8.string(),
2734
- fieldType: z8.string(),
2735
- objectTypeId: z8.string().optional(),
2736
- required: z8.boolean().optional(),
2737
- hidden: z8.boolean().optional(),
2738
- placeholder: z8.string().optional(),
2739
- description: z8.string().optional(),
2740
- options: z8.array(z8.object({ label: z8.string(), value: z8.string() })).optional()
2741
- });
2742
- var hubspotFormSummarySchema = z8.object({
2743
- id: z8.string(),
2744
- name: z8.string(),
2767
+ import { z as z9 } from "zod";
2768
+ var hubspotEmbedTypeSchema = z9.enum(["legacy", "v4", "unknown"]);
2769
+ var hubspotPostSubmitActionSchema = z9.object({
2770
+ type: z9.enum(["redirect_url", "thank_you"]),
2771
+ value: z9.string()
2772
+ });
2773
+ var hubspotFormFieldSchema = z9.object({
2774
+ name: z9.string(),
2775
+ label: z9.string(),
2776
+ fieldType: z9.string(),
2777
+ objectTypeId: z9.string().optional(),
2778
+ required: z9.boolean().optional(),
2779
+ hidden: z9.boolean().optional(),
2780
+ placeholder: z9.string().optional(),
2781
+ description: z9.string().optional(),
2782
+ options: z9.array(z9.object({ label: z9.string(), value: z9.string() })).optional()
2783
+ });
2784
+ var hubspotFormSummarySchema = z9.object({
2785
+ id: z9.string(),
2786
+ name: z9.string(),
2745
2787
  embedType: hubspotEmbedTypeSchema,
2746
2788
  /** Total visible + hidden fields across every field group. */
2747
- fieldCount: z8.number().int(),
2789
+ fieldCount: z9.number().int(),
2748
2790
  postSubmitAction: hubspotPostSubmitActionSchema.nullable()
2749
2791
  });
2750
- var hubspotFormsListRequestSchema = z8.object({
2792
+ var hubspotFormsListRequestSchema = z9.object({
2751
2793
  /** Case-insensitive substring match on the form name. */
2752
- search: z8.string().min(1).max(200).optional(),
2794
+ search: z9.string().min(1).max(200).optional(),
2753
2795
  /** Only forms whose post-submit action redirects away. */
2754
- redirectingOnly: z8.boolean().optional(),
2796
+ redirectingOnly: z9.boolean().optional(),
2755
2797
  embedType: hubspotEmbedTypeSchema.optional()
2756
2798
  });
2757
- var hubspotFormsListResponseSchema = z8.object({
2758
- ok: z8.literal(true),
2759
- data: z8.object({
2799
+ var hubspotFormsListResponseSchema = z9.object({
2800
+ ok: z9.literal(true),
2801
+ data: z9.object({
2760
2802
  /** Same for every form on the account — sent once, not per row. */
2761
- portalId: z8.number().nullable(),
2762
- forms: z8.array(hubspotFormSummarySchema)
2803
+ portalId: z9.number().nullable(),
2804
+ forms: z9.array(hubspotFormSummarySchema)
2763
2805
  })
2764
2806
  });
2765
- var hubspotFormsViewRequestSchema = z8.object({
2766
- formId: z8.string().min(1),
2807
+ var hubspotFormsViewRequestSchema = z9.object({
2808
+ formId: z9.string().min(1),
2767
2809
  /** Include the untouched HubSpot payload alongside the summarized view. */
2768
- full: z8.boolean().optional(),
2810
+ full: z9.boolean().optional(),
2769
2811
  /**
2770
2812
  * Return the resource blob to write into a flow node's `form.external`
2771
2813
  * instead of the human-readable view.
2772
2814
  */
2773
- asNode: z8.boolean().optional()
2815
+ asNode: z9.boolean().optional()
2774
2816
  });
2775
2817
  var hubspotFormDetailSchema = hubspotFormSummarySchema.extend({
2776
- portalId: z8.number().nullable(),
2777
- captchaEnabled: z8.boolean(),
2778
- language: z8.string().nullable(),
2779
- fields: z8.array(hubspotFormFieldSchema),
2818
+ portalId: z9.number().nullable(),
2819
+ captchaEnabled: z9.boolean(),
2820
+ language: z9.string().nullable(),
2821
+ fields: z9.array(hubspotFormFieldSchema),
2780
2822
  /** HubSpot's "Data privacy and consent options"; `null` when not configured. */
2781
- legalConsentType: z8.string().nullable(),
2782
- raw: z8.record(z8.string(), z8.unknown()).optional()
2823
+ legalConsentType: z9.string().nullable(),
2824
+ raw: z9.record(z9.string(), z9.unknown()).optional()
2783
2825
  });
2784
- var hubspotFormNodeExternalSchema = z8.object({
2785
- id: z8.string(),
2786
- name: z8.string(),
2787
- providerId: z8.string(),
2788
- portalId: z8.number(),
2789
- embedType: z8.enum(["legacy", "v4"]).optional(),
2790
- region: z8.string().optional(),
2791
- captchaEnabled: z8.boolean(),
2792
- fieldGroups: z8.array(z8.object({ fields: z8.array(hubspotFormFieldSchema) })),
2793
- configuration: z8.object({ postSubmitAction: hubspotPostSubmitActionSchema }).optional(),
2794
- legalConsentOptions: z8.record(z8.string(), z8.unknown()).optional()
2795
- });
2796
- var hubspotFormsViewResponseSchema = z8.object({
2797
- ok: z8.literal(true),
2798
- data: z8.object({
2826
+ var hubspotFormNodeExternalSchema = z9.object({
2827
+ id: z9.string(),
2828
+ name: z9.string(),
2829
+ providerId: z9.string(),
2830
+ portalId: z9.number(),
2831
+ embedType: z9.enum(["legacy", "v4"]).optional(),
2832
+ region: z9.string().optional(),
2833
+ captchaEnabled: z9.boolean(),
2834
+ fieldGroups: z9.array(z9.object({ fields: z9.array(hubspotFormFieldSchema) })),
2835
+ configuration: z9.object({ postSubmitAction: hubspotPostSubmitActionSchema }).optional(),
2836
+ legalConsentOptions: z9.record(z9.string(), z9.unknown()).optional()
2837
+ });
2838
+ var hubspotFormsViewResponseSchema = z9.object({
2839
+ ok: z9.literal(true),
2840
+ data: z9.object({
2799
2841
  form: hubspotFormDetailSchema.optional(),
2800
2842
  /** Present instead of `form` when `asNode` was requested. */
2801
2843
  external: hubspotFormNodeExternalSchema.optional()
2802
2844
  })
2803
2845
  });
2804
- var hubspotMeetingFieldSchema = z8.object({
2805
- name: z8.string(),
2806
- label: z8.string(),
2807
- fieldType: z8.string(),
2808
- isRequired: z8.boolean(),
2809
- isCustom: z8.boolean(),
2810
- options: z8.array(z8.object({ label: z8.string(), value: z8.string() })).optional()
2811
- });
2812
- var hubspotMeetingSummarySchema = z8.object({
2813
- id: z8.string(),
2814
- name: z8.string(),
2815
- slug: z8.string(),
2816
- linkType: z8.string(),
2846
+ var hubspotMeetingFieldSchema = z9.object({
2847
+ name: z9.string(),
2848
+ label: z9.string(),
2849
+ fieldType: z9.string(),
2850
+ isRequired: z9.boolean(),
2851
+ isCustom: z9.boolean(),
2852
+ options: z9.array(z9.object({ label: z9.string(), value: z9.string() })).optional()
2853
+ });
2854
+ var hubspotMeetingSummarySchema = z9.object({
2855
+ id: z9.string(),
2856
+ name: z9.string(),
2857
+ slug: z9.string(),
2858
+ linkType: z9.string(),
2817
2859
  /**
2818
2860
  * Where HubSpot sends the visitor after booking. `null` means either "no
2819
2861
  * redirect" or "not known" — read `redirectKnown` before concluding.
2820
2862
  */
2821
- redirectUrl: z8.string().nullable(),
2863
+ redirectUrl: z9.string().nullable(),
2822
2864
  /**
2823
2865
  * False when the list endpoint omitted `customParams` entirely, in which case
2824
2866
  * `redirectUrl: null` is an absence of information, not a confirmed absence
2825
2867
  * of a redirect. `meetings view <slug>` resolves it.
2826
2868
  */
2827
- redirectKnown: z8.boolean(),
2869
+ redirectKnown: z9.boolean(),
2828
2870
  /**
2829
2871
  * Booking-form field count, or `null` when the list endpoint did not carry
2830
2872
  * `customParams` — HubSpot only populates those reliably on the per-slug
2831
2873
  * booking endpoint, so `meetings view <slug>` is the source of truth.
2832
2874
  */
2833
- fieldCount: z8.number().int().nullable()
2875
+ fieldCount: z9.number().int().nullable()
2834
2876
  });
2835
- var hubspotMeetingsListRequestSchema = z8.object({
2836
- search: z8.string().min(1).max(200).optional(),
2877
+ var hubspotMeetingsListRequestSchema = z9.object({
2878
+ search: z9.string().min(1).max(200).optional(),
2837
2879
  /** Only meeting links that redirect after booking. */
2838
- redirectingOnly: z8.boolean().optional()
2880
+ redirectingOnly: z9.boolean().optional()
2839
2881
  });
2840
- var hubspotMeetingsListResponseSchema = z8.object({
2841
- ok: z8.literal(true),
2842
- data: z8.object({ meetings: z8.array(hubspotMeetingSummarySchema) })
2882
+ var hubspotMeetingsListResponseSchema = z9.object({
2883
+ ok: z9.literal(true),
2884
+ data: z9.object({ meetings: z9.array(hubspotMeetingSummarySchema) })
2843
2885
  });
2844
- var hubspotMeetingsViewRequestSchema = z8.object({
2845
- slug: z8.string().min(1),
2886
+ var hubspotMeetingsViewRequestSchema = z9.object({
2887
+ slug: z9.string().min(1),
2846
2888
  /**
2847
2889
  * Return the resource blob to write into a flow node's `form.external`
2848
2890
  * instead of the human-readable view.
2849
2891
  */
2850
- asNode: z8.boolean().optional()
2851
- });
2852
- var hubspotMeetingDetailSchema = z8.object({
2853
- name: z8.string(),
2854
- slug: z8.string(),
2855
- link: z8.string(),
2856
- linkType: z8.string(),
2857
- redirectUrl: z8.string().nullable(),
2858
- fields: z8.array(hubspotMeetingFieldSchema)
2859
- });
2860
- var hubspotMeetingNodeExternalSchema = z8.object({
2861
- name: z8.string(),
2862
- slug: z8.string(),
2892
+ asNode: z9.boolean().optional()
2893
+ });
2894
+ var hubspotMeetingDetailSchema = z9.object({
2895
+ name: z9.string(),
2896
+ slug: z9.string(),
2897
+ link: z9.string(),
2898
+ linkType: z9.string(),
2899
+ redirectUrl: z9.string().nullable(),
2900
+ fields: z9.array(hubspotMeetingFieldSchema)
2901
+ });
2902
+ var hubspotMeetingNodeExternalSchema = z9.object({
2903
+ name: z9.string(),
2904
+ slug: z9.string(),
2863
2905
  /** Non-empty: an empty booking link renders an iframe pointed at nothing. */
2864
- link: z8.string().min(1),
2865
- linkType: z8.enum(["PERSONAL_LINK", "GROUP_CALENDAR", "ROUND_ROBIN_CALENDAR"]),
2866
- providerId: z8.string(),
2867
- customParams: z8.object({
2868
- formFields: z8.array(hubspotMeetingFieldSchema),
2869
- redirectUrl: z8.string().nullable()
2906
+ link: z9.string().min(1),
2907
+ linkType: z9.enum(["PERSONAL_LINK", "GROUP_CALENDAR", "ROUND_ROBIN_CALENDAR"]),
2908
+ providerId: z9.string(),
2909
+ customParams: z9.object({
2910
+ formFields: z9.array(hubspotMeetingFieldSchema),
2911
+ redirectUrl: z9.string().nullable()
2870
2912
  })
2871
2913
  });
2872
- var hubspotMeetingsViewResponseSchema = z8.object({
2873
- ok: z8.literal(true),
2874
- data: z8.object({
2914
+ var hubspotMeetingsViewResponseSchema = z9.object({
2915
+ ok: z9.literal(true),
2916
+ data: z9.object({
2875
2917
  meeting: hubspotMeetingDetailSchema.optional(),
2876
2918
  /** Present instead of `meeting` when `asNode` was requested. */
2877
2919
  external: hubspotMeetingNodeExternalSchema.optional()
@@ -2879,8 +2921,8 @@ var hubspotMeetingsViewResponseSchema = z8.object({
2879
2921
  });
2880
2922
 
2881
2923
  // ../api/src/images.ts
2882
- import { z as z9 } from "zod";
2883
- var imageSourceSchema = z9.enum([
2924
+ import { z as z10 } from "zod";
2925
+ var imageSourceSchema = z10.enum([
2884
2926
  "uploaded",
2885
2927
  "website",
2886
2928
  "google_testimonial",
@@ -2896,49 +2938,49 @@ var imageSourceSchema = z9.enum([
2896
2938
  "pinterest",
2897
2939
  "ai_generated"
2898
2940
  ]);
2899
- var imageStatusSchema = z9.enum(["uploading", "processing", "ready", "error"]);
2900
- var upscaleConfigSchema = z9.object({
2901
- model: z9.literal("philz1337x/crystal-upscaler"),
2902
- input: z9.object({
2903
- scale_factor: z9.number(),
2904
- creativity: z9.number(),
2905
- output_format: z9.string()
2941
+ var imageStatusSchema = z10.enum(["uploading", "processing", "ready", "error"]);
2942
+ var upscaleConfigSchema = z10.object({
2943
+ model: z10.literal("philz1337x/crystal-upscaler"),
2944
+ input: z10.object({
2945
+ scale_factor: z10.number(),
2946
+ creativity: z10.number(),
2947
+ output_format: z10.string()
2906
2948
  }),
2907
- status: z9.enum(["pending", "completed"])
2949
+ status: z10.enum(["pending", "completed"])
2908
2950
  });
2909
- var imageDocSchema = z9.object({
2910
- _id: z9.string(),
2911
- _creationTime: z9.number(),
2912
- companyId: z9.string(),
2913
- storageKey: z9.string(),
2951
+ var imageDocSchema = z10.object({
2952
+ _id: z10.string(),
2953
+ _creationTime: z10.number(),
2954
+ companyId: z10.string(),
2955
+ storageKey: z10.string(),
2914
2956
  upscaleConfig: upscaleConfigSchema.optional(),
2915
- upscaledStorageKey: z9.string().optional(),
2916
- name: z9.string(),
2917
- description: z9.string(),
2918
- tags: z9.array(z9.string()),
2919
- source: z9.string(),
2920
- externalId: z9.string().optional(),
2921
- externalUrl: z9.string().optional(),
2922
- contentHash: z9.string().optional(),
2923
- sourceId: z9.string().optional(),
2924
- descriptionContext: z9.string().optional(),
2925
- width: z9.number().optional(),
2926
- height: z9.number().optional(),
2927
- aspectRatio: z9.number().optional(),
2928
- dominantColor: z9.string().optional(),
2929
- imagePalette: z9.array(z9.string()).optional(),
2930
- thumbhashDataUri: z9.string().optional(),
2931
- isLightImage: z9.boolean().optional(),
2932
- descriptionEmbedding: z9.array(z9.number()).optional(),
2933
- imageEmbedding: z9.array(z9.number()).optional(),
2934
- searchText: z9.string().optional(),
2957
+ upscaledStorageKey: z10.string().optional(),
2958
+ name: z10.string(),
2959
+ description: z10.string(),
2960
+ tags: z10.array(z10.string()),
2961
+ source: z10.string(),
2962
+ externalId: z10.string().optional(),
2963
+ externalUrl: z10.string().optional(),
2964
+ contentHash: z10.string().optional(),
2965
+ sourceId: z10.string().optional(),
2966
+ descriptionContext: z10.string().optional(),
2967
+ width: z10.number().optional(),
2968
+ height: z10.number().optional(),
2969
+ aspectRatio: z10.number().optional(),
2970
+ dominantColor: z10.string().optional(),
2971
+ imagePalette: z10.array(z10.string()).optional(),
2972
+ thumbhashDataUri: z10.string().optional(),
2973
+ isLightImage: z10.boolean().optional(),
2974
+ descriptionEmbedding: z10.array(z10.number()).optional(),
2975
+ imageEmbedding: z10.array(z10.number()).optional(),
2976
+ searchText: z10.string().optional(),
2935
2977
  status: imageStatusSchema,
2936
- errorMessage: z9.string().optional(),
2937
- createdAt: z9.number(),
2938
- updatedAt: z9.number(),
2939
- imageUrl: z9.string()
2978
+ errorMessage: z10.string().optional(),
2979
+ createdAt: z10.number(),
2980
+ updatedAt: z10.number(),
2981
+ imageUrl: z10.string()
2940
2982
  });
2941
- var imageHitSourceSchema = z9.enum([
2983
+ var imageHitSourceSchema = z10.enum([
2942
2984
  "library",
2943
2985
  "magnific",
2944
2986
  "google_images",
@@ -2949,145 +2991,145 @@ var imageHitSourceSchema = z9.enum([
2949
2991
  "giphy",
2950
2992
  "pinterest"
2951
2993
  ]);
2952
- var imageHitSchema = z9.object({
2994
+ var imageHitSchema = z10.object({
2953
2995
  source: imageHitSourceSchema,
2954
- url: z9.string(),
2955
- thumbnailUrl: z9.string().optional(),
2956
- width: z9.number().optional(),
2957
- height: z9.number().optional(),
2958
- aspectRatio: z9.number().optional(),
2959
- dominantColor: z9.string().optional(),
2960
- externalId: z9.string().optional(),
2961
- externalUrl: z9.string().optional(),
2962
- providerMeta: z9.record(z9.string(), z9.unknown()).optional(),
2963
- descriptionContext: z9.string().optional(),
2964
- _id: z9.string().optional(),
2965
- name: z9.string().optional(),
2966
- description: z9.string().optional(),
2967
- tags: z9.array(z9.string()).optional(),
2968
- score: z9.number().optional(),
2969
- alsoInLibrary: z9.string().optional(),
2970
- prefetchedBytes: z9.string().optional(),
2971
- prefetchedContentType: z9.string().optional()
2996
+ url: z10.string(),
2997
+ thumbnailUrl: z10.string().optional(),
2998
+ width: z10.number().optional(),
2999
+ height: z10.number().optional(),
3000
+ aspectRatio: z10.number().optional(),
3001
+ dominantColor: z10.string().optional(),
3002
+ externalId: z10.string().optional(),
3003
+ externalUrl: z10.string().optional(),
3004
+ providerMeta: z10.record(z10.string(), z10.unknown()).optional(),
3005
+ descriptionContext: z10.string().optional(),
3006
+ _id: z10.string().optional(),
3007
+ name: z10.string().optional(),
3008
+ description: z10.string().optional(),
3009
+ tags: z10.array(z10.string()).optional(),
3010
+ score: z10.number().optional(),
3011
+ alsoInLibrary: z10.string().optional(),
3012
+ prefetchedBytes: z10.string().optional(),
3013
+ prefetchedContentType: z10.string().optional()
2972
3014
  });
2973
3015
  var ingestedImageHitSchema = imageHitSchema.extend({
2974
- imageId: z9.string().optional(),
2975
- imageUrl: z9.string().optional(),
2976
- deduped: z9.boolean().optional(),
2977
- sourceUrl: z9.string().optional()
2978
- });
2979
- var autoIngestItemSchema = z9.object({
2980
- imageId: z9.string(),
2981
- deduped: z9.boolean(),
2982
- imageUrl: z9.string(),
2983
- sourceUrl: z9.string(),
2984
- externalUrl: z9.string().optional()
3016
+ imageId: z10.string().optional(),
3017
+ imageUrl: z10.string().optional(),
3018
+ deduped: z10.boolean().optional(),
3019
+ sourceUrl: z10.string().optional()
3020
+ });
3021
+ var autoIngestItemSchema = z10.object({
3022
+ imageId: z10.string(),
3023
+ deduped: z10.boolean(),
3024
+ imageUrl: z10.string(),
3025
+ sourceUrl: z10.string(),
3026
+ externalUrl: z10.string().optional()
2985
3027
  });
2986
3028
  function providerHitsResponseSchema() {
2987
- return z9.object({
2988
- hits: z9.array(ingestedImageHitSchema),
2989
- ingested: z9.array(autoIngestItemSchema)
3029
+ return z10.object({
3030
+ hits: z10.array(ingestedImageHitSchema),
3031
+ ingested: z10.array(autoIngestItemSchema)
2990
3032
  });
2991
3033
  }
2992
- var imagesGetRequestSchema = z9.object({ id: z9.string().min(1, "Missing id parameter") });
2993
- var imagesSearchRequestSchema = z9.object({
2994
- query: z9.string().min(1),
2995
- limit: z9.coerce.number().int().positive().max(100).optional(),
2996
- aspectRatio: z9.string().optional(),
2997
- tags: z9.array(z9.string()).optional(),
2998
- source: z9.string().optional(),
2999
- externalUrlHost: z9.string().optional()
3000
- });
3001
- var imageSearchResultSchema = z9.object({
3002
- _id: z9.string(),
3003
- imageUrl: z9.string(),
3004
- name: z9.string(),
3005
- description: z9.string(),
3006
- tags: z9.array(z9.string()),
3007
- width: z9.number().optional(),
3008
- height: z9.number().optional(),
3009
- aspectRatio: z9.number().optional(),
3010
- dominantColor: z9.string().optional(),
3011
- imagePalette: z9.array(z9.string()).optional(),
3012
- source: z9.string(),
3013
- externalUrl: z9.string().optional(),
3014
- score: z9.number()
3015
- });
3016
- var imagesSearchResponseSchema = z9.array(imageSearchResultSchema);
3017
- var imagesUploadRequestSchema = z9.object({
3018
- base64: z9.string().min(1),
3019
- contentType: z9.string().min(1),
3020
- source: z9.string().optional(),
3021
- descriptionContext: z9.string().optional()
3022
- });
3023
- var imagesUploadResponseSchema = z9.object({ imageId: z9.string() });
3024
- var imagesDeleteRequestSchema = z9.object({ id: z9.string().min(1, "Missing image ID") });
3025
- var imagesDeleteResponseSchema = z9.object({ ok: z9.literal(true) });
3026
- var imagesUpscaleRequestSchema = z9.object({ imageId: z9.string().min(1, "Missing image ID") });
3027
- var imagesUpscaleResponseSchema = z9.object({
3028
- imageId: z9.string(),
3029
- status: z9.literal("processing")
3034
+ var imagesGetRequestSchema = z10.object({ id: z10.string().min(1, "Missing id parameter") });
3035
+ var imagesSearchRequestSchema = z10.object({
3036
+ query: z10.string().min(1),
3037
+ limit: z10.coerce.number().int().positive().max(100).optional(),
3038
+ aspectRatio: z10.string().optional(),
3039
+ tags: z10.array(z10.string()).optional(),
3040
+ source: z10.string().optional(),
3041
+ externalUrlHost: z10.string().optional()
3042
+ });
3043
+ var imageSearchResultSchema = z10.object({
3044
+ _id: z10.string(),
3045
+ imageUrl: z10.string(),
3046
+ name: z10.string(),
3047
+ description: z10.string(),
3048
+ tags: z10.array(z10.string()),
3049
+ width: z10.number().optional(),
3050
+ height: z10.number().optional(),
3051
+ aspectRatio: z10.number().optional(),
3052
+ dominantColor: z10.string().optional(),
3053
+ imagePalette: z10.array(z10.string()).optional(),
3054
+ source: z10.string(),
3055
+ externalUrl: z10.string().optional(),
3056
+ score: z10.number()
3057
+ });
3058
+ var imagesSearchResponseSchema = z10.array(imageSearchResultSchema);
3059
+ var imagesUploadRequestSchema = z10.object({
3060
+ base64: z10.string().min(1),
3061
+ contentType: z10.string().min(1),
3062
+ source: z10.string().optional(),
3063
+ descriptionContext: z10.string().optional()
3064
+ });
3065
+ var imagesUploadResponseSchema = z10.object({ imageId: z10.string() });
3066
+ var imagesDeleteRequestSchema = z10.object({ id: z10.string().min(1, "Missing image ID") });
3067
+ var imagesDeleteResponseSchema = z10.object({ ok: z10.literal(true) });
3068
+ var imagesUpscaleRequestSchema = z10.object({ imageId: z10.string().min(1, "Missing image ID") });
3069
+ var imagesUpscaleResponseSchema = z10.object({
3070
+ imageId: z10.string(),
3071
+ status: z10.literal("processing")
3030
3072
  });
3031
3073
  var IMAGES_FIND_SOURCES = ["library", "magnific", "google", "iconify", "giphy", "pinterest"];
3032
- var imagesFindRequestSchema = z9.object({
3033
- query: z9.string().min(1),
3034
- sources: z9.array(z9.enum(IMAGES_FIND_SOURCES)).optional(),
3035
- limit: z9.coerce.number().int().positive().max(50).optional(),
3036
- fallback: z9.boolean().optional(),
3037
- threshold: z9.number().min(0).max(1).optional(),
3038
- autoIngest: z9.coerce.number().int().min(0).max(20).optional(),
3039
- descriptionContext: z9.string().optional()
3040
- });
3041
- var imagesFindResponseSchema = z9.object({
3042
- groups: z9.object({
3043
- library: z9.array(imageHitSchema),
3044
- external: z9.array(ingestedImageHitSchema)
3074
+ var imagesFindRequestSchema = z10.object({
3075
+ query: z10.string().min(1),
3076
+ sources: z10.array(z10.enum(IMAGES_FIND_SOURCES)).optional(),
3077
+ limit: z10.coerce.number().int().positive().max(50).optional(),
3078
+ fallback: z10.boolean().optional(),
3079
+ threshold: z10.number().min(0).max(1).optional(),
3080
+ autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
3081
+ descriptionContext: z10.string().optional()
3082
+ });
3083
+ var imagesFindResponseSchema = z10.object({
3084
+ groups: z10.object({
3085
+ library: z10.array(imageHitSchema),
3086
+ external: z10.array(ingestedImageHitSchema)
3045
3087
  }),
3046
- meta: z9.object({
3047
- counts: z9.record(z9.string(), z9.number()),
3048
- errors: z9.array(z9.object({ source: imageHitSourceSchema, message: z9.string() }))
3088
+ meta: z10.object({
3089
+ counts: z10.record(z10.string(), z10.number()),
3090
+ errors: z10.array(z10.object({ source: imageHitSourceSchema, message: z10.string() }))
3049
3091
  }),
3050
- ingested: z9.array(autoIngestItemSchema)
3051
- });
3052
- var imagesStockRequestSchema = z9.object({
3053
- query: z9.string().min(1),
3054
- orientation: z9.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
3055
- contentType: z9.enum(["photo", "vector", "psd"]).optional(),
3056
- license: z9.enum(["freemium", "premium"]).optional(),
3057
- color: z9.string().optional(),
3058
- aiGenerated: z9.enum(["exclude", "only"]).optional(),
3059
- people: z9.enum(["include", "exclude", "only"]).optional(),
3060
- order: z9.enum(["relevance", "recent"]).optional(),
3061
- limit: z9.coerce.number().int().positive().max(50).optional(),
3062
- page: z9.coerce.number().int().positive().optional(),
3063
- autoIngest: z9.coerce.number().int().min(0).max(20).optional(),
3064
- descriptionContext: z9.string().optional()
3092
+ ingested: z10.array(autoIngestItemSchema)
3093
+ });
3094
+ var imagesStockRequestSchema = z10.object({
3095
+ query: z10.string().min(1),
3096
+ orientation: z10.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
3097
+ contentType: z10.enum(["photo", "vector", "psd"]).optional(),
3098
+ license: z10.enum(["freemium", "premium"]).optional(),
3099
+ color: z10.string().optional(),
3100
+ aiGenerated: z10.enum(["exclude", "only"]).optional(),
3101
+ people: z10.enum(["include", "exclude", "only"]).optional(),
3102
+ order: z10.enum(["relevance", "recent"]).optional(),
3103
+ limit: z10.coerce.number().int().positive().max(50).optional(),
3104
+ page: z10.coerce.number().int().positive().optional(),
3105
+ autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
3106
+ descriptionContext: z10.string().optional()
3065
3107
  });
3066
3108
  var imagesStockResponseSchema = providerHitsResponseSchema();
3067
- var imagesGoogleRequestSchema = z9.object({
3068
- query: z9.string().min(1),
3069
- type: z9.string().optional(),
3070
- size: z9.string().optional(),
3071
- color: z9.string().optional(),
3072
- safe: z9.enum(["off", "active"]).optional(),
3073
- limit: z9.coerce.number().int().positive().max(50).optional(),
3074
- autoIngest: z9.coerce.number().int().min(0).max(20).optional(),
3075
- descriptionContext: z9.string().optional()
3109
+ var imagesGoogleRequestSchema = z10.object({
3110
+ query: z10.string().min(1),
3111
+ type: z10.string().optional(),
3112
+ size: z10.string().optional(),
3113
+ color: z10.string().optional(),
3114
+ safe: z10.enum(["off", "active"]).optional(),
3115
+ limit: z10.coerce.number().int().positive().max(50).optional(),
3116
+ autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
3117
+ descriptionContext: z10.string().optional()
3076
3118
  });
3077
3119
  var imagesGoogleResponseSchema = providerHitsResponseSchema();
3078
- var imagesPinterestRequestSchema = z9.object({
3079
- query: z9.string().min(1),
3080
- limit: z9.coerce.number().int().positive().max(20).optional(),
3081
- autoIngest: z9.coerce.number().int().min(0).max(20).optional(),
3082
- descriptionContext: z9.string().optional()
3120
+ var imagesPinterestRequestSchema = z10.object({
3121
+ query: z10.string().min(1),
3122
+ limit: z10.coerce.number().int().positive().max(20).optional(),
3123
+ autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
3124
+ descriptionContext: z10.string().optional()
3083
3125
  });
3084
3126
  var imagesPinterestResponseSchema = providerHitsResponseSchema();
3085
- var rgbTriple = z9.tuple([
3086
- z9.number().int().min(0).max(255),
3087
- z9.number().int().min(0).max(255),
3088
- z9.number().int().min(0).max(255)
3127
+ var rgbTriple = z10.tuple([
3128
+ z10.number().int().min(0).max(255),
3129
+ z10.number().int().min(0).max(255),
3130
+ z10.number().int().min(0).max(255)
3089
3131
  ]);
3090
- var imageGenerateModelSchema = z9.enum([
3132
+ var imageGenerateModelSchema = z10.enum([
3091
3133
  "openai/gpt-image-2",
3092
3134
  // Legacy — see the registry entry; kept so pre-switch canvases still run.
3093
3135
  "openai/gpt-5.4-image-2",
@@ -3095,97 +3137,97 @@ var imageGenerateModelSchema = z9.enum([
3095
3137
  "google/gemini-3-pro-image-preview",
3096
3138
  "recraft/recraft-v4.1-pro-vector"
3097
3139
  ]);
3098
- var imagesGenerateRequestSchema = z9.object({
3099
- prompt: z9.string().min(1),
3140
+ var imagesGenerateRequestSchema = z10.object({
3141
+ prompt: z10.string().min(1),
3100
3142
  model: imageGenerateModelSchema.optional(),
3101
3143
  // Aspect ratio + size are validated loosely as strings; the per-model enum
3102
3144
  // lives in canvas-contract and OpenRouter rejects unsupported combinations.
3103
- aspectRatio: z9.string().optional(),
3104
- imageSize: z9.string().optional(),
3145
+ aspectRatio: z10.string().optional(),
3146
+ imageSize: z10.string().optional(),
3105
3147
  // Rendering quality (auto|low|medium|high) — honored by gpt-image / Gemini, ignored elsewhere.
3106
- quality: z9.enum(["auto", "low", "medium", "high"]).optional(),
3148
+ quality: z10.enum(["auto", "low", "medium", "high"]).optional(),
3107
3149
  // Recraft v4.1 Pro Vector levers (ignored by other models).
3108
- strength: z9.coerce.number().min(0).max(1).optional(),
3109
- rgbColors: z9.array(rgbTriple).optional(),
3150
+ strength: z10.coerce.number().min(0).max(1).optional(),
3151
+ rgbColors: z10.array(rgbTriple).optional(),
3110
3152
  backgroundRgbColor: rgbTriple.optional(),
3111
3153
  // Public image URLs used as visual references (multi-reference, in order).
3112
- referenceUrls: z9.array(z9.string().url()).optional(),
3113
- descriptionContext: z9.string().optional()
3114
- });
3115
- var generatedImageSchema = z9.object({
3116
- imageId: z9.string(),
3117
- deduped: z9.boolean(),
3118
- imageUrl: z9.string(),
3119
- width: z9.number().optional(),
3120
- height: z9.number().optional()
3121
- });
3122
- var imagesGenerateResponseSchema = z9.object({
3123
- model: z9.string(),
3124
- costUsd: z9.number(),
3125
- images: z9.array(generatedImageSchema)
3126
- });
3127
- var imagesLogoRequestSchema = z9.object({
3128
- domain: z9.string().min(1),
3129
- variant: z9.enum(["icon", "logo", "symbol"]).optional(),
3130
- autoIngest: z9.coerce.number().int().min(0).max(5).optional(),
3131
- descriptionContext: z9.string().optional()
3154
+ referenceUrls: z10.array(z10.string().url()).optional(),
3155
+ descriptionContext: z10.string().optional()
3156
+ });
3157
+ var generatedImageSchema = z10.object({
3158
+ imageId: z10.string(),
3159
+ deduped: z10.boolean(),
3160
+ imageUrl: z10.string(),
3161
+ width: z10.number().optional(),
3162
+ height: z10.number().optional()
3163
+ });
3164
+ var imagesGenerateResponseSchema = z10.object({
3165
+ model: z10.string(),
3166
+ costUsd: z10.number(),
3167
+ images: z10.array(generatedImageSchema)
3168
+ });
3169
+ var imagesLogoRequestSchema = z10.object({
3170
+ domain: z10.string().min(1),
3171
+ variant: z10.enum(["icon", "logo", "symbol"]).optional(),
3172
+ autoIngest: z10.coerce.number().int().min(0).max(5).optional(),
3173
+ descriptionContext: z10.string().optional()
3132
3174
  });
3133
3175
  var imagesLogoResponseSchema = providerHitsResponseSchema();
3134
- var imagesIconRequestSchema = z9.object({
3135
- name: z9.string().min(1),
3136
- set: z9.string().optional(),
3137
- color: z9.string().optional(),
3138
- width: z9.coerce.number().int().positive().optional(),
3139
- autoIngest: z9.coerce.number().int().min(0).max(20).optional(),
3140
- descriptionContext: z9.string().optional()
3176
+ var imagesIconRequestSchema = z10.object({
3177
+ name: z10.string().min(1),
3178
+ set: z10.string().optional(),
3179
+ color: z10.string().optional(),
3180
+ width: z10.coerce.number().int().positive().optional(),
3181
+ autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
3182
+ descriptionContext: z10.string().optional()
3141
3183
  });
3142
3184
  var imagesIconResponseSchema = providerHitsResponseSchema();
3143
- var imagesExtractRequestSchema = z9.object({
3144
- url: z9.string().url(),
3145
- waitFor: z9.coerce.number().int().min(0).max(3e4).optional(),
3146
- limit: z9.coerce.number().int().positive().max(50).optional(),
3147
- autoIngest: z9.coerce.number().int().min(0).max(20).optional(),
3148
- descriptionContext: z9.string().optional()
3185
+ var imagesExtractRequestSchema = z10.object({
3186
+ url: z10.string().url(),
3187
+ waitFor: z10.coerce.number().int().min(0).max(3e4).optional(),
3188
+ limit: z10.coerce.number().int().positive().max(50).optional(),
3189
+ autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
3190
+ descriptionContext: z10.string().optional()
3149
3191
  });
3150
3192
  var imagesExtractResponseSchema = providerHitsResponseSchema();
3151
- var imagesScreenshotRequestSchema = z9.object({
3152
- url: z9.string().url(),
3153
- fullPage: z9.boolean().optional(),
3154
- viewportWidth: z9.coerce.number().int().positive().max(3840).optional(),
3155
- viewportHeight: z9.coerce.number().int().positive().max(2160).optional(),
3156
- format: z9.enum(["webp", "png", "jpg"]).optional(),
3157
- descriptionContext: z9.string().optional()
3193
+ var imagesScreenshotRequestSchema = z10.object({
3194
+ url: z10.string().url(),
3195
+ fullPage: z10.boolean().optional(),
3196
+ viewportWidth: z10.coerce.number().int().positive().max(3840).optional(),
3197
+ viewportHeight: z10.coerce.number().int().positive().max(2160).optional(),
3198
+ format: z10.enum(["webp", "png", "jpg"]).optional(),
3199
+ descriptionContext: z10.string().optional()
3158
3200
  });
3159
3201
  var imagesScreenshotResponseSchema = providerHitsResponseSchema();
3160
- var imagesGiphyRequestSchema = z9.object({
3161
- query: z9.string().min(1).optional(),
3162
- trending: z9.coerce.boolean().optional(),
3163
- limit: z9.coerce.number().int().positive().max(50).optional(),
3164
- rating: z9.enum(["g", "pg", "pg-13", "r"]).optional(),
3165
- lang: z9.string().optional(),
3166
- autoIngest: z9.coerce.number().int().min(0).max(20).optional(),
3167
- descriptionContext: z9.string().optional()
3202
+ var imagesGiphyRequestSchema = z10.object({
3203
+ query: z10.string().min(1).optional(),
3204
+ trending: z10.coerce.boolean().optional(),
3205
+ limit: z10.coerce.number().int().positive().max(50).optional(),
3206
+ rating: z10.enum(["g", "pg", "pg-13", "r"]).optional(),
3207
+ lang: z10.string().optional(),
3208
+ autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
3209
+ descriptionContext: z10.string().optional()
3168
3210
  });
3169
3211
  var imagesGifResponseSchema = providerHitsResponseSchema();
3170
3212
  var imagesStickerResponseSchema = providerHitsResponseSchema();
3171
- var imagesIngestRequestSchema = z9.object({
3172
- url: z9.string().url(),
3213
+ var imagesIngestRequestSchema = z10.object({
3214
+ url: z10.string().url(),
3173
3215
  // Validate source at the HTTP boundary so unknown values produce the standard
3174
3216
  // `{ code: "BAD_REQUEST", message }` shape instead of a plain Error from
3175
3217
  // `assertImageSource` inside the action.
3176
3218
  source: imageSourceSchema,
3177
- externalId: z9.string().optional(),
3178
- externalUrl: z9.string().optional(),
3179
- descriptionContext: z9.string().optional()
3219
+ externalId: z10.string().optional(),
3220
+ externalUrl: z10.string().optional(),
3221
+ descriptionContext: z10.string().optional()
3180
3222
  });
3181
- var imagesIngestResponseSchema = z9.object({
3182
- imageId: z9.string(),
3183
- deduped: z9.boolean(),
3184
- contentHash: z9.string()
3223
+ var imagesIngestResponseSchema = z10.object({
3224
+ imageId: z10.string(),
3225
+ deduped: z10.boolean(),
3226
+ contentHash: z10.string()
3185
3227
  });
3186
3228
 
3187
3229
  // ../api/src/tags.ts
3188
- import { z as z10 } from "zod";
3230
+ import { z as z11 } from "zod";
3189
3231
  var TAG_TYPES = [
3190
3232
  "meta",
3191
3233
  "amplitude",
@@ -3206,7 +3248,7 @@ var TAG_TYPES = [
3206
3248
  "recaptcha",
3207
3249
  "twitterAds"
3208
3250
  ];
3209
- var tagTypeSchema = z10.enum(TAG_TYPES);
3251
+ var tagTypeSchema = z11.enum(TAG_TYPES);
3210
3252
  var TAG_IDENTIFYING_FIELD = {
3211
3253
  meta: "pixelId",
3212
3254
  googleAds: "conversionID",
@@ -3227,218 +3269,218 @@ var TAG_IDENTIFYING_FIELD = {
3227
3269
  recaptcha: "siteKey",
3228
3270
  twitterAds: "pixelId"
3229
3271
  };
3230
- var tagDraftOpKindSchema = z10.enum(["create", "update", "delete"]);
3231
- var tagDraftOpViewSchema = z10.object({
3272
+ var tagDraftOpKindSchema = z11.enum(["create", "update", "delete"]);
3273
+ var tagDraftOpViewSchema = z11.object({
3232
3274
  /** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
3233
- ref: z10.string(),
3275
+ ref: z11.string(),
3234
3276
  kind: tagDraftOpKindSchema,
3235
3277
  type: tagTypeSchema,
3236
3278
  /** Present on update/delete ops — the real tag this op targets. */
3237
- tagId: z10.string().optional(),
3279
+ tagId: z11.string().optional(),
3238
3280
  /** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
3239
- config: z10.record(z10.string(), z10.string()),
3281
+ config: z11.record(z11.string(), z11.string()),
3240
3282
  /** Update only — fields the op explicitly clears. */
3241
- clearFields: z10.array(z10.string()).optional(),
3283
+ clearFields: z11.array(z11.string()).optional(),
3242
3284
  /** Names of secret fields already provided via the dashboard secure form. Never values. */
3243
- secretsSet: z10.array(z10.string()),
3285
+ secretsSet: z11.array(z11.string()),
3244
3286
  /** Names of secret fields still awaiting user input. */
3245
- secretsPending: z10.array(z10.string()),
3246
- summary: z10.string(),
3247
- stagedAt: z10.number()
3287
+ secretsPending: z11.array(z11.string()),
3288
+ summary: z11.string(),
3289
+ stagedAt: z11.number()
3248
3290
  });
3249
- var tagsEffectiveEntrySchema = z10.object({
3291
+ var tagsEffectiveEntrySchema = z11.object({
3250
3292
  /** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
3251
- ref: z10.string(),
3252
- tagId: z10.string().optional(),
3293
+ ref: z11.string(),
3294
+ tagId: z11.string().optional(),
3253
3295
  type: tagTypeSchema,
3254
3296
  /** Value of the type's identifying field, when set. */
3255
- identifier: z10.string().optional(),
3297
+ identifier: z11.string().optional(),
3256
3298
  /** Redacted config; for staged updates, production config with the patch merged. */
3257
- config: z10.record(z10.string(), z10.string()),
3299
+ config: z11.record(z11.string(), z11.string()),
3258
3300
  /** Absent = live production tag with no staged changes in this chat. */
3259
3301
  staged: tagDraftOpKindSchema.optional(),
3260
- secretsSet: z10.array(z10.string()),
3261
- secretsPending: z10.array(z10.string())
3302
+ secretsSet: z11.array(z11.string()),
3303
+ secretsPending: z11.array(z11.string())
3262
3304
  });
3263
- var tagsListRequestSchema = z10.object({ chatId: z10.string() });
3264
- var tagsListResponseSchema = z10.object({ tags: z10.array(tagsEffectiveEntrySchema) });
3265
- var tagsDraftListRequestSchema = z10.object({ chatId: z10.string() });
3266
- var tagsDraftListResponseSchema = z10.object({
3267
- status: z10.enum(["active", "publishing", "applied", "discarded", "none"]),
3268
- ops: z10.array(tagDraftOpViewSchema)
3305
+ var tagsListRequestSchema = z11.object({ chatId: z11.string() });
3306
+ var tagsListResponseSchema = z11.object({ tags: z11.array(tagsEffectiveEntrySchema) });
3307
+ var tagsDraftListRequestSchema = z11.object({ chatId: z11.string() });
3308
+ var tagsDraftListResponseSchema = z11.object({
3309
+ status: z11.enum(["active", "publishing", "applied", "discarded", "none"]),
3310
+ ops: z11.array(tagDraftOpViewSchema)
3269
3311
  });
3270
- var tagInputRequestSchema = z10.object({
3312
+ var tagInputRequestSchema = z11.object({
3271
3313
  // Every tag change is a tab in the approval form: create/edit show the full
3272
3314
  // body; delete shows a confirm. No tag change bypasses this approval.
3273
- mode: z10.enum(["create", "edit", "delete"]),
3315
+ mode: z11.enum(["create", "edit", "delete"]),
3274
3316
  tagType: tagTypeSchema,
3275
3317
  /** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
3276
- ref: z10.string().optional(),
3318
+ ref: z11.string().optional(),
3277
3319
  /** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
3278
- prefilledConfig: z10.record(z10.string(), z10.string()).optional(),
3320
+ prefilledConfig: z11.record(z11.string(), z11.string()).optional(),
3279
3321
  /** Secret field names the agent asks the user to provide. */
3280
- requestedSecretFields: z10.array(z10.string()).optional(),
3322
+ requestedSecretFields: z11.array(z11.string()).optional(),
3281
3323
  /** Short message shown above the form explaining why the input is needed. */
3282
- message: z10.string().optional()
3324
+ message: z11.string().optional()
3283
3325
  });
3284
- var tagChangeToolInputSchema = z10.object({
3285
- changes: z10.array(tagInputRequestSchema).min(1).max(8)
3326
+ var tagChangeToolInputSchema = z11.object({
3327
+ changes: z11.array(tagInputRequestSchema).min(1).max(8)
3286
3328
  });
3287
- var tagInputResultSchema = z10.discriminatedUnion("status", [
3288
- z10.object({
3289
- status: z10.literal("submitted"),
3290
- ref: z10.string(),
3329
+ var tagInputResultSchema = z11.discriminatedUnion("status", [
3330
+ z11.object({
3331
+ status: z11.literal("submitted"),
3332
+ ref: z11.string(),
3291
3333
  type: tagTypeSchema,
3292
3334
  /** Identifying field name → value (non-secret), when the type has one. */
3293
- identifier: z10.record(z10.string(), z10.string()).optional(),
3294
- secretFieldsSet: z10.array(z10.string()),
3295
- note: z10.string().optional()
3335
+ identifier: z11.record(z11.string(), z11.string()).optional(),
3336
+ secretFieldsSet: z11.array(z11.string()),
3337
+ note: z11.string().optional()
3296
3338
  }),
3297
- z10.object({
3298
- status: z10.literal("declined"),
3299
- reason: z10.string().optional()
3339
+ z11.object({
3340
+ status: z11.literal("declined"),
3341
+ reason: z11.string().optional()
3300
3342
  })
3301
3343
  ]);
3302
- var tagChangeToolResultSchema = z10.object({
3303
- results: z10.array(tagInputResultSchema)
3344
+ var tagChangeToolResultSchema = z11.object({
3345
+ results: z11.array(tagInputResultSchema)
3304
3346
  });
3305
3347
 
3306
3348
  // ../api/src/testimonials.ts
3307
- import { z as z11 } from "zod";
3308
- var testimonialSourceTypeSchema = z11.enum(["google", "trustpilot"]);
3309
- var testimonialStatusSchema = z11.enum(["pending", "processing", "ready", "error"]);
3310
- var testimonialSentimentSchema = z11.enum(["positive", "neutral", "negative"]);
3311
- var testimonialDocSchema = z11.object({
3312
- _id: z11.string(),
3313
- _creationTime: z11.number(),
3314
- companyId: z11.string(),
3315
- sourceId: z11.string(),
3349
+ import { z as z12 } from "zod";
3350
+ var testimonialSourceTypeSchema = z12.enum(["google", "trustpilot"]);
3351
+ var testimonialStatusSchema = z12.enum(["pending", "processing", "ready", "error"]);
3352
+ var testimonialSentimentSchema = z12.enum(["positive", "neutral", "negative"]);
3353
+ var testimonialDocSchema = z12.object({
3354
+ _id: z12.string(),
3355
+ _creationTime: z12.number(),
3356
+ companyId: z12.string(),
3357
+ sourceId: z12.string(),
3316
3358
  sourceType: testimonialSourceTypeSchema,
3317
- reviewText: z11.string(),
3318
- reviewTitle: z11.string().optional(),
3319
- searchText: z11.string().optional(),
3320
- reviewerName: z11.string().optional(),
3321
- reviewerImageUrl: z11.string().optional(),
3322
- reviewerImageId: z11.string().optional(),
3323
- reviewerLocation: z11.string().optional(),
3324
- rating: z11.number().optional(),
3325
- reviewDate: z11.number().optional(),
3326
- ownerAnswer: z11.string().optional(),
3327
- mediaUrls: z11.array(z11.string()).optional(),
3328
- imageIds: z11.array(z11.string()).optional(),
3329
- videoIds: z11.array(z11.string()).optional(),
3330
- sourceUrl: z11.string().optional(),
3331
- rawData: z11.unknown().optional(),
3332
- tags: z11.array(z11.string()),
3333
- highlight: z11.string().optional(),
3334
- language: z11.string().optional(),
3335
- summary: z11.string().optional(),
3359
+ reviewText: z12.string(),
3360
+ reviewTitle: z12.string().optional(),
3361
+ searchText: z12.string().optional(),
3362
+ reviewerName: z12.string().optional(),
3363
+ reviewerImageUrl: z12.string().optional(),
3364
+ reviewerImageId: z12.string().optional(),
3365
+ reviewerLocation: z12.string().optional(),
3366
+ rating: z12.number().optional(),
3367
+ reviewDate: z12.number().optional(),
3368
+ ownerAnswer: z12.string().optional(),
3369
+ mediaUrls: z12.array(z12.string()).optional(),
3370
+ imageIds: z12.array(z12.string()).optional(),
3371
+ videoIds: z12.array(z12.string()).optional(),
3372
+ sourceUrl: z12.string().optional(),
3373
+ rawData: z12.unknown().optional(),
3374
+ tags: z12.array(z12.string()),
3375
+ highlight: z12.string().optional(),
3376
+ language: z12.string().optional(),
3377
+ summary: z12.string().optional(),
3336
3378
  sentiment: testimonialSentimentSchema.optional(),
3337
- textEmbedding: z11.array(z11.number()).optional(),
3338
- externalId: z11.string().optional(),
3339
- contentHash: z11.string().optional(),
3379
+ textEmbedding: z12.array(z12.number()).optional(),
3380
+ externalId: z12.string().optional(),
3381
+ contentHash: z12.string().optional(),
3340
3382
  status: testimonialStatusSchema,
3341
- errorMessage: z11.string().optional(),
3342
- createdAt: z11.number(),
3343
- updatedAt: z11.number()
3383
+ errorMessage: z12.string().optional(),
3384
+ createdAt: z12.number(),
3385
+ updatedAt: z12.number()
3344
3386
  });
3345
- var testimonialsListRequestSchema = z11.object({
3387
+ var testimonialsListRequestSchema = z12.object({
3346
3388
  source: testimonialSourceTypeSchema.optional(),
3347
- rating_min: z11.coerce.number().int().min(1).max(5).optional(),
3348
- rating_max: z11.coerce.number().int().min(1).max(5).optional(),
3349
- tags: z11.string().transform((s) => s.split(",").filter(Boolean)).optional(),
3389
+ rating_min: z12.coerce.number().int().min(1).max(5).optional(),
3390
+ rating_max: z12.coerce.number().int().min(1).max(5).optional(),
3391
+ tags: z12.string().transform((s) => s.split(",").filter(Boolean)).optional(),
3350
3392
  status: testimonialStatusSchema.optional(),
3351
3393
  sentiment: testimonialSentimentSchema.optional(),
3352
- language: z11.string().min(2).max(5).optional(),
3353
- limit: z11.coerce.number().int().positive().max(200).optional()
3354
- });
3355
- var testimonialsListResponseSchema = z11.array(testimonialDocSchema);
3356
- var testimonialsGetRequestSchema = z11.object({ id: z11.string().min(1, "Missing id parameter") });
3357
- var testimonialsSearchRequestSchema = z11.object({
3358
- query: z11.string().min(1),
3359
- limit: z11.coerce.number().int().positive().max(100).optional(),
3394
+ language: z12.string().min(2).max(5).optional(),
3395
+ limit: z12.coerce.number().int().positive().max(200).optional()
3396
+ });
3397
+ var testimonialsListResponseSchema = z12.array(testimonialDocSchema);
3398
+ var testimonialsGetRequestSchema = z12.object({ id: z12.string().min(1, "Missing id parameter") });
3399
+ var testimonialsSearchRequestSchema = z12.object({
3400
+ query: z12.string().min(1),
3401
+ limit: z12.coerce.number().int().positive().max(100).optional(),
3360
3402
  source: testimonialSourceTypeSchema.optional(),
3361
- rating_min: z11.coerce.number().int().min(1).max(5).optional(),
3362
- rating_max: z11.coerce.number().int().min(1).max(5).optional(),
3363
- tags: z11.array(z11.string()).optional(),
3403
+ rating_min: z12.coerce.number().int().min(1).max(5).optional(),
3404
+ rating_max: z12.coerce.number().int().min(1).max(5).optional(),
3405
+ tags: z12.array(z12.string()).optional(),
3364
3406
  status: testimonialStatusSchema.optional(),
3365
3407
  sentiment: testimonialSentimentSchema.optional(),
3366
- language: z11.string().min(2).max(5).optional()
3408
+ language: z12.string().min(2).max(5).optional()
3367
3409
  }).refine(
3368
3410
  (data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
3369
3411
  { message: "rating_min must be less than or equal to rating_max" }
3370
3412
  );
3371
- var testimonialsSearchResponseSchema = z11.array(testimonialDocSchema);
3372
- var testimonialsOutscraperWebhookResponseSchema = z11.object({
3373
- ok: z11.literal(true),
3374
- note: z11.string().optional()
3413
+ var testimonialsSearchResponseSchema = z12.array(testimonialDocSchema);
3414
+ var testimonialsOutscraperWebhookResponseSchema = z12.object({
3415
+ ok: z12.literal(true),
3416
+ note: z12.string().optional()
3375
3417
  });
3376
3418
 
3377
3419
  // ../api/src/videos.ts
3378
- import { z as z12 } from "zod";
3379
- var videoStatusSchema = z12.enum(["uploading", "uploaded", "processing", "ready", "error"]);
3380
- var videoTranscriptSegmentSchema = z12.object({
3381
- text: z12.string(),
3382
- startSecond: z12.number(),
3383
- endSecond: z12.number()
3384
- });
3385
- var videoSceneSchema = z12.object({
3386
- title: z12.string(),
3387
- description: z12.string(),
3388
- startSecond: z12.number(),
3389
- endSecond: z12.number(),
3390
- thumbnailTime: z12.number()
3391
- });
3392
- var videoDocSchema = z12.object({
3393
- _id: z12.string(),
3394
- _creationTime: z12.number(),
3395
- companyId: z12.string(),
3396
- muxAssetId: z12.string(),
3397
- muxPlaybackId: z12.string(),
3398
- muxUploadId: z12.string(),
3399
- name: z12.string(),
3400
- description: z12.string(),
3401
- tags: z12.array(z12.string()),
3402
- source: z12.string(),
3403
- externalId: z12.string().optional(),
3404
- sourceId: z12.string().optional(),
3405
- width: z12.number().optional(),
3406
- height: z12.number().optional(),
3407
- aspectRatio: z12.number().optional(),
3408
- duration: z12.number().optional(),
3409
- transcript: z12.string().optional(),
3410
- transcriptSegments: z12.array(videoTranscriptSegmentSchema).optional(),
3411
- scenes: z12.array(videoSceneSchema).optional(),
3412
- descriptionEmbedding: z12.array(z12.number()).optional(),
3413
- searchText: z12.string().optional(),
3420
+ import { z as z13 } from "zod";
3421
+ var videoStatusSchema = z13.enum(["uploading", "uploaded", "processing", "ready", "error"]);
3422
+ var videoTranscriptSegmentSchema = z13.object({
3423
+ text: z13.string(),
3424
+ startSecond: z13.number(),
3425
+ endSecond: z13.number()
3426
+ });
3427
+ var videoSceneSchema = z13.object({
3428
+ title: z13.string(),
3429
+ description: z13.string(),
3430
+ startSecond: z13.number(),
3431
+ endSecond: z13.number(),
3432
+ thumbnailTime: z13.number()
3433
+ });
3434
+ var videoDocSchema = z13.object({
3435
+ _id: z13.string(),
3436
+ _creationTime: z13.number(),
3437
+ companyId: z13.string(),
3438
+ muxAssetId: z13.string(),
3439
+ muxPlaybackId: z13.string(),
3440
+ muxUploadId: z13.string(),
3441
+ name: z13.string(),
3442
+ description: z13.string(),
3443
+ tags: z13.array(z13.string()),
3444
+ source: z13.string(),
3445
+ externalId: z13.string().optional(),
3446
+ sourceId: z13.string().optional(),
3447
+ width: z13.number().optional(),
3448
+ height: z13.number().optional(),
3449
+ aspectRatio: z13.number().optional(),
3450
+ duration: z13.number().optional(),
3451
+ transcript: z13.string().optional(),
3452
+ transcriptSegments: z13.array(videoTranscriptSegmentSchema).optional(),
3453
+ scenes: z13.array(videoSceneSchema).optional(),
3454
+ descriptionEmbedding: z13.array(z13.number()).optional(),
3455
+ searchText: z13.string().optional(),
3414
3456
  status: videoStatusSchema,
3415
- errorMessage: z12.string().optional(),
3416
- createdAt: z12.number(),
3417
- updatedAt: z12.number(),
3418
- thumbnailUrl: z12.string()
3419
- });
3420
- var videosWebhookResponseSchema = z12.object({ ok: z12.literal(true) });
3421
- var videosGetRequestSchema = z12.object({ id: z12.string().min(1, "Missing id parameter") });
3422
- var videosSearchRequestSchema = z12.object({
3423
- query: z12.string().min(1),
3424
- limit: z12.coerce.number().int().positive().max(100).optional(),
3425
- tags: z12.array(z12.string()).optional()
3426
- });
3427
- var videoSearchResultSchema = z12.object({
3428
- _id: z12.string(),
3429
- thumbnailUrl: z12.string(),
3430
- name: z12.string(),
3431
- description: z12.string(),
3432
- tags: z12.array(z12.string()),
3433
- status: z12.string(),
3434
- duration: z12.number().optional(),
3435
- muxPlaybackId: z12.string(),
3436
- createdAt: z12.number()
3437
- });
3438
- var videosSearchResponseSchema = z12.array(videoSearchResultSchema);
3439
- var videosUploadResponseSchema = z12.object({ uploadUrl: z12.string(), videoId: z12.string() });
3440
- var videosDeleteRequestSchema = z12.object({ id: z12.string().min(1, "Missing video ID") });
3441
- var videosDeleteResponseSchema = z12.object({ ok: z12.literal(true) });
3457
+ errorMessage: z13.string().optional(),
3458
+ createdAt: z13.number(),
3459
+ updatedAt: z13.number(),
3460
+ thumbnailUrl: z13.string()
3461
+ });
3462
+ var videosWebhookResponseSchema = z13.object({ ok: z13.literal(true) });
3463
+ var videosGetRequestSchema = z13.object({ id: z13.string().min(1, "Missing id parameter") });
3464
+ var videosSearchRequestSchema = z13.object({
3465
+ query: z13.string().min(1),
3466
+ limit: z13.coerce.number().int().positive().max(100).optional(),
3467
+ tags: z13.array(z13.string()).optional()
3468
+ });
3469
+ var videoSearchResultSchema = z13.object({
3470
+ _id: z13.string(),
3471
+ thumbnailUrl: z13.string(),
3472
+ name: z13.string(),
3473
+ description: z13.string(),
3474
+ tags: z13.array(z13.string()),
3475
+ status: z13.string(),
3476
+ duration: z13.number().optional(),
3477
+ muxPlaybackId: z13.string(),
3478
+ createdAt: z13.number()
3479
+ });
3480
+ var videosSearchResponseSchema = z13.array(videoSearchResultSchema);
3481
+ var videosUploadResponseSchema = z13.object({ uploadUrl: z13.string(), videoId: z13.string() });
3482
+ var videosDeleteRequestSchema = z13.object({ id: z13.string().min(1, "Missing video ID") });
3483
+ var videosDeleteResponseSchema = z13.object({ ok: z13.literal(true) });
3442
3484
 
3443
3485
  // src/commands/actions/complete.ts
3444
3486
  import { defineCommand as defineCommand2 } from "citty";
@@ -4698,55 +4740,55 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
4698
4740
  var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
4699
4741
 
4700
4742
  // ../api/src/ads-google/ops.ts
4701
- import { z as z13 } from "zod";
4702
- var tempRefSchema2 = z13.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4703
- var refSchema = z13.union([
4704
- z13.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4705
- z13.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4743
+ import { z as z14 } from "zod";
4744
+ var tempRefSchema2 = z14.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4745
+ var refSchema = z14.union([
4746
+ z14.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4747
+ z14.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
4706
4748
  tempRefSchema2
4707
4749
  ]);
4708
4750
  var targetRefSchema = refSchema;
4709
- var microsSchema = z13.number().int().positive("expected a positive micros amount");
4710
- var httpsUrlSchema2 = z13.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4711
- var customerIdSchema = z13.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4712
- var stageableStatusSchema2 = z13.enum(STAGEABLE_CREATE_STATUSES2);
4713
- var matchTypeSchema = z13.enum(KEYWORD_MATCH_TYPES);
4714
- var finalUrlSuffixSchema = z13.string().max(GOOGLE_ADS_LIMITS.campaign.finalUrlSuffixMax).refine((s) => !/^[?&]/.test(s), "drop the leading ? or & \u2014 a final URL suffix is bare query parameters").refine((s) => !s.includes("{lpurl}"), "{lpurl} belongs in a tracking template, not in a final URL suffix").refine((s) => !/\s/.test(s), "a final URL suffix cannot contain whitespace").refine((s) => s === "" || s.includes("="), 'expected key=value pairs, e.g. "utm_source=google&utm_agency=baker"');
4751
+ var microsSchema = z14.number().int().positive("expected a positive micros amount");
4752
+ var httpsUrlSchema2 = z14.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4753
+ var customerIdSchema = z14.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4754
+ var stageableStatusSchema2 = z14.enum(STAGEABLE_CREATE_STATUSES2);
4755
+ var matchTypeSchema = z14.enum(KEYWORD_MATCH_TYPES);
4756
+ var finalUrlSuffixSchema = z14.string().max(GOOGLE_ADS_LIMITS.campaign.finalUrlSuffixMax).refine((s) => !/^[?&]/.test(s), "drop the leading ? or & \u2014 a final URL suffix is bare query parameters").refine((s) => !s.includes("{lpurl}"), "{lpurl} belongs in a tracking template, not in a final URL suffix").refine((s) => !/\s/.test(s), "a final URL suffix cannot contain whitespace").refine((s) => s === "" || s.includes("="), 'expected key=value pairs, e.g. "utm_source=google&utm_agency=baker"');
4715
4757
  var LANDING_PAGE_TAGS = ["{lpurl}", "{unescapedlpurl}", "{escapedlpurl}", "{lpurl+2}", "{lpurl+3}"];
4716
- var trackingUrlTemplateSchema = z13.string().max(GOOGLE_ADS_LIMITS.campaign.trackingUrlTemplateMax).refine((t) => !/\s/.test(t), "a tracking template cannot contain whitespace").refine(
4758
+ var trackingUrlTemplateSchema = z14.string().max(GOOGLE_ADS_LIMITS.campaign.trackingUrlTemplateMax).refine((t) => !/\s/.test(t), "a tracking template cannot contain whitespace").refine(
4717
4759
  (t) => t === "" || LANDING_PAGE_TAGS.some((tag) => t.includes(tag)),
4718
4760
  `a tracking template must carry the landing page through one of ${LANDING_PAGE_TAGS.join(", ")}, e.g. "https://tracker.example/?url={lpurl}"`
4719
4761
  ).refine(
4720
4762
  (t) => t === "" || /^(https?:\/\/|\{)/.test(t),
4721
4763
  "a tracking template must start with http://, https:// or a {lpurl} tag"
4722
4764
  );
4723
- var urlCustomParametersSchema = z13.array(
4724
- z13.strictObject({
4725
- key: z13.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.urlCustomParameterKeyMax).regex(/^[A-Za-z0-9_]+$/, "a custom parameter key is letters, digits and underscores only"),
4726
- value: z13.string().max(GOOGLE_ADS_LIMITS.campaign.urlCustomParameterValueMax)
4765
+ var urlCustomParametersSchema = z14.array(
4766
+ z14.strictObject({
4767
+ key: z14.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.urlCustomParameterKeyMax).regex(/^[A-Za-z0-9_]+$/, "a custom parameter key is letters, digits and underscores only"),
4768
+ value: z14.string().max(GOOGLE_ADS_LIMITS.campaign.urlCustomParameterValueMax)
4727
4769
  })
4728
4770
  ).max(GOOGLE_ADS_LIMITS.campaign.urlCustomParametersMax).refine(
4729
4771
  (params) => new Set(params.map((p) => p.key)).size === params.length,
4730
4772
  "each custom parameter key can appear only once"
4731
4773
  );
4732
- var keywordTextSchema = z13.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
4733
- var budgetCreateSchema = z13.object({
4734
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4774
+ var keywordTextSchema = z14.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
4775
+ var budgetCreateSchema = z14.object({
4776
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
4735
4777
  amountMicros: microsSchema,
4736
- deliveryMethod: z13.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4737
- explicitlyShared: z13.boolean().default(false)
4778
+ deliveryMethod: z14.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4779
+ explicitlyShared: z14.boolean().default(false)
4738
4780
  });
4739
- var budgetUpdateSchema = z13.object({
4740
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4781
+ var budgetUpdateSchema = z14.object({
4782
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
4741
4783
  amountMicros: microsSchema.optional(),
4742
- deliveryMethod: z13.enum(BUDGET_DELIVERY_METHODS).optional()
4784
+ deliveryMethod: z14.enum(BUDGET_DELIVERY_METHODS).optional()
4743
4785
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4744
- var biddingConfigSchema = z13.object({
4745
- type: z13.enum(BIDDING_STRATEGY_TYPES),
4786
+ var biddingConfigSchema = z14.object({
4787
+ type: z14.enum(BIDDING_STRATEGY_TYPES),
4746
4788
  targetCpaMicros: microsSchema.optional(),
4747
- targetRoas: z13.number().positive().optional(),
4789
+ targetRoas: z14.number().positive().optional(),
4748
4790
  cpcBidCeilingMicros: microsSchema.optional(),
4749
- enhancedCpcEnabled: z13.boolean().optional()
4791
+ enhancedCpcEnabled: z14.boolean().optional()
4750
4792
  }).superRefine((p, ctx) => {
4751
4793
  if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
4752
4794
  ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
@@ -4755,24 +4797,24 @@ var biddingConfigSchema = z13.object({
4755
4797
  ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
4756
4798
  }
4757
4799
  });
4758
- var networkSettingsSchema = z13.object({
4759
- targetGoogleSearch: z13.boolean().optional(),
4760
- targetSearchNetwork: z13.boolean().optional(),
4761
- targetContentNetwork: z13.boolean().optional(),
4762
- targetPartnerSearchNetwork: z13.boolean().optional()
4800
+ var networkSettingsSchema = z14.object({
4801
+ targetGoogleSearch: z14.boolean().optional(),
4802
+ targetSearchNetwork: z14.boolean().optional(),
4803
+ targetContentNetwork: z14.boolean().optional(),
4804
+ targetPartnerSearchNetwork: z14.boolean().optional()
4763
4805
  });
4764
- var dateSchema = z13.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4765
- var geoTargetTypeSettingSchema = z13.strictObject({
4766
- positiveGeoTargetType: z13.enum(POSITIVE_GEO_TARGET_TYPES).optional(),
4767
- negativeGeoTargetType: z13.enum(NEGATIVE_GEO_TARGET_TYPES).optional()
4806
+ var dateSchema = z14.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4807
+ var geoTargetTypeSettingSchema = z14.strictObject({
4808
+ positiveGeoTargetType: z14.enum(POSITIVE_GEO_TARGET_TYPES).optional(),
4809
+ negativeGeoTargetType: z14.enum(NEGATIVE_GEO_TARGET_TYPES).optional()
4768
4810
  }).refine(
4769
4811
  (p) => p.positiveGeoTargetType !== void 0 || p.negativeGeoTargetType !== void 0,
4770
4812
  "geoTargetTypeSetting needs positiveGeoTargetType and/or negativeGeoTargetType"
4771
4813
  );
4772
- var campaignCreateSchema2 = z13.strictObject({
4773
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4774
- channelType: z13.enum(ADVERTISING_CHANNEL_TYPES),
4775
- channelSubType: z13.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4814
+ var campaignCreateSchema2 = z14.strictObject({
4815
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4816
+ channelType: z14.enum(ADVERTISING_CHANNEL_TYPES),
4817
+ channelSubType: z14.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
4776
4818
  budget: refSchema,
4777
4819
  /** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
4778
4820
  bidding: biddingConfigSchema.optional(),
@@ -4792,12 +4834,12 @@ var campaignCreateSchema2 = z13.strictObject({
4792
4834
  /** The `{_name}` parameters this campaign's tracking template and final URLs can reference. */
4793
4835
  urlCustomParameters: urlCustomParametersSchema.optional(),
4794
4836
  /** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
4795
- objective: z13.enum(CAMPAIGN_OBJECTIVES).optional(),
4837
+ objective: z14.enum(CAMPAIGN_OBJECTIVES).optional(),
4796
4838
  /**
4797
4839
  * Whether the campaign contains EU political advertising. Google requires the declaration on
4798
4840
  * every campaign create (FieldError.REQUIRED without it); omitted means it does not.
4799
4841
  */
4800
- euPoliticalAds: z13.boolean().optional(),
4842
+ euPoliticalAds: z14.boolean().optional(),
4801
4843
  status: stageableStatusSchema2.default("PAUSED")
4802
4844
  }).superRefine((p, ctx) => {
4803
4845
  if (!p.bidding && !p.biddingStrategy) {
@@ -4821,8 +4863,8 @@ var campaignCreateSchema2 = z13.strictObject({
4821
4863
  ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
4822
4864
  }
4823
4865
  });
4824
- var campaignUpdateSchema2 = z13.strictObject({
4825
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4866
+ var campaignUpdateSchema2 = z14.strictObject({
4867
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
4826
4868
  budget: refSchema.optional(),
4827
4869
  bidding: biddingConfigSchema.optional(),
4828
4870
  networkSettings: networkSettingsSchema.optional(),
@@ -4837,130 +4879,130 @@ var campaignUpdateSchema2 = z13.strictObject({
4837
4879
  /** Replaces the campaign's custom parameters wholesale; `[]` removes them all. */
4838
4880
  urlCustomParameters: urlCustomParametersSchema.optional(),
4839
4881
  /** Corrects the campaign's EU political advertising declaration (true = contains, false = does not). */
4840
- euPoliticalAds: z13.boolean().optional(),
4841
- status: z13.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4882
+ euPoliticalAds: z14.boolean().optional(),
4883
+ status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4842
4884
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4843
- var adGroupCreateSchema = z13.object({
4844
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4885
+ var adGroupCreateSchema = z14.object({
4886
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
4845
4887
  campaign: refSchema,
4846
- type: z13.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4888
+ type: z14.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4847
4889
  cpcBidMicros: microsSchema.optional(),
4848
4890
  status: stageableStatusSchema2.default("PAUSED")
4849
4891
  });
4850
- var adGroupUpdateSchema = z13.object({
4851
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4892
+ var adGroupUpdateSchema = z14.object({
4893
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
4852
4894
  cpcBidMicros: microsSchema.optional(),
4853
- status: z13.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4895
+ status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4854
4896
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4855
- var keywordAddSchema = z13.object({
4897
+ var keywordAddSchema = z14.object({
4856
4898
  adGroup: refSchema,
4857
4899
  text: keywordTextSchema,
4858
4900
  matchType: matchTypeSchema,
4859
4901
  cpcBidMicros: microsSchema.optional(),
4860
- finalUrls: z13.array(httpsUrlSchema2).optional(),
4902
+ finalUrls: z14.array(httpsUrlSchema2).optional(),
4861
4903
  status: stageableStatusSchema2.default("ENABLED")
4862
4904
  });
4863
- var keywordUpdateSchema = z13.object({
4905
+ var keywordUpdateSchema = z14.object({
4864
4906
  cpcBidMicros: microsSchema.optional(),
4865
- finalUrls: z13.array(httpsUrlSchema2).optional(),
4866
- status: z13.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4907
+ finalUrls: z14.array(httpsUrlSchema2).optional(),
4908
+ status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4867
4909
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4868
- var negativeKeywordAddSchema = z13.object({
4869
- level: z13.enum(["adGroup", "campaign"]),
4910
+ var negativeKeywordAddSchema = z14.object({
4911
+ level: z14.enum(["adGroup", "campaign"]),
4870
4912
  parent: refSchema,
4871
4913
  text: keywordTextSchema,
4872
4914
  matchType: matchTypeSchema
4873
4915
  });
4874
- var sharedSetCreateSchema = z13.object({
4875
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4876
- type: z13.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4916
+ var sharedSetCreateSchema = z14.object({
4917
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4918
+ type: z14.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
4877
4919
  });
4878
- var sharedSetMemberAddSchema = z13.object({
4920
+ var sharedSetMemberAddSchema = z14.object({
4879
4921
  sharedSet: refSchema,
4880
4922
  text: keywordTextSchema,
4881
4923
  matchType: matchTypeSchema
4882
4924
  });
4883
- var campaignSharedSetAttachSchema = z13.object({
4925
+ var campaignSharedSetAttachSchema = z14.object({
4884
4926
  campaign: refSchema,
4885
4927
  sharedSet: refSchema
4886
4928
  });
4887
- var adTextAssetSchema = z13.object({
4888
- text: z13.string().min(1),
4889
- pinnedField: z13.enum(PINNED_FIELDS).optional()
4929
+ var adTextAssetSchema = z14.object({
4930
+ text: z14.string().min(1),
4931
+ pinnedField: z14.enum(PINNED_FIELDS).optional()
4890
4932
  });
4891
- var responsiveSearchAdSchema = z13.strictObject({
4892
- format: z13.literal("responsiveSearch"),
4893
- headlines: z13.array(
4933
+ var responsiveSearchAdSchema = z14.strictObject({
4934
+ format: z14.literal("responsiveSearch"),
4935
+ headlines: z14.array(
4894
4936
  adTextAssetSchema.refine(
4895
4937
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
4896
4938
  "headline exceeds 30 chars"
4897
4939
  )
4898
4940
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
4899
- descriptions: z13.array(
4941
+ descriptions: z14.array(
4900
4942
  adTextAssetSchema.refine(
4901
4943
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
4902
4944
  "description exceeds 90 chars"
4903
4945
  )
4904
4946
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
4905
- path1: z13.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4906
- path2: z13.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4907
- finalUrls: z13.array(httpsUrlSchema2).min(1)
4908
- });
4909
- var responsiveDisplayAdSchema = z13.strictObject({
4910
- format: z13.literal("responsiveDisplay"),
4911
- headlines: z13.array(z13.object({ text: z13.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4912
- longHeadline: z13.object({ text: z13.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4913
- descriptions: z13.array(z13.object({ text: z13.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4914
- businessName: z13.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4947
+ path1: z14.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4948
+ path2: z14.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4949
+ finalUrls: z14.array(httpsUrlSchema2).min(1)
4950
+ });
4951
+ var responsiveDisplayAdSchema = z14.strictObject({
4952
+ format: z14.literal("responsiveDisplay"),
4953
+ headlines: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4954
+ longHeadline: z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4955
+ descriptions: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4956
+ businessName: z14.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
4915
4957
  // A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
4916
4958
  // asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
4917
4959
  // image (1:1) to serve; the logo images are optional.
4918
- marketingImageAssets: z13.array(refSchema).optional(),
4919
- squareMarketingImageAssets: z13.array(refSchema).optional(),
4920
- logoImageAssets: z13.array(refSchema).optional(),
4921
- finalUrls: z13.array(httpsUrlSchema2).min(1)
4922
- });
4923
- var callAdSchema = z13.strictObject({
4924
- format: z13.literal("call"),
4925
- countryCode: z13.string().length(2),
4926
- phoneNumber: z13.string().min(3),
4927
- headline1: z13.string().min(1).max(30),
4928
- headline2: z13.string().min(1).max(30),
4929
- description1: z13.string().min(1).max(90),
4930
- description2: z13.string().min(1).max(90),
4931
- businessName: z13.string().min(1).max(25),
4932
- finalUrls: z13.array(httpsUrlSchema2).min(1)
4933
- });
4934
- var appAdSchema = z13.strictObject({
4935
- format: z13.literal("app"),
4936
- headlines: z13.array(z13.object({ text: z13.string().min(1).max(GOOGLE_ADS_LIMITS.appAd.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.appAd.headlinesMin).max(GOOGLE_ADS_LIMITS.appAd.headlinesMax),
4937
- descriptions: z13.array(z13.object({ text: z13.string().min(1).max(GOOGLE_ADS_LIMITS.appAd.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.appAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.appAd.descriptionsMax),
4960
+ marketingImageAssets: z14.array(refSchema).optional(),
4961
+ squareMarketingImageAssets: z14.array(refSchema).optional(),
4962
+ logoImageAssets: z14.array(refSchema).optional(),
4963
+ finalUrls: z14.array(httpsUrlSchema2).min(1)
4964
+ });
4965
+ var callAdSchema = z14.strictObject({
4966
+ format: z14.literal("call"),
4967
+ countryCode: z14.string().length(2),
4968
+ phoneNumber: z14.string().min(3),
4969
+ headline1: z14.string().min(1).max(30),
4970
+ headline2: z14.string().min(1).max(30),
4971
+ description1: z14.string().min(1).max(90),
4972
+ description2: z14.string().min(1).max(90),
4973
+ businessName: z14.string().min(1).max(25),
4974
+ finalUrls: z14.array(httpsUrlSchema2).min(1)
4975
+ });
4976
+ var appAdSchema = z14.strictObject({
4977
+ format: z14.literal("app"),
4978
+ headlines: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.appAd.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.appAd.headlinesMin).max(GOOGLE_ADS_LIMITS.appAd.headlinesMax),
4979
+ descriptions: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.appAd.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.appAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.appAd.descriptionsMax),
4938
4980
  // An App campaign ad carries its images on its own content (`AppAdInfo.images`), not as
4939
4981
  // campaign-level asset links — same shape as a responsive display ad's marketing images.
4940
- images: z13.array(refSchema).max(GOOGLE_ADS_LIMITS.appAd.imagesMax).optional(),
4982
+ images: z14.array(refSchema).max(GOOGLE_ADS_LIMITS.appAd.imagesMax).optional(),
4941
4983
  // `AppAdInfo.youtube_videos` — an App ad's videos live on its content too. Without this field
4942
4984
  // there is no way to express "keep these videos on the ad", so a content update that only
4943
4985
  // restated headlines silently left the ad's videos to whatever the mask happened to omit.
4944
- youtubeVideos: z13.array(refSchema).max(GOOGLE_ADS_LIMITS.appAd.youtubeVideosMax).optional()
4986
+ youtubeVideos: z14.array(refSchema).max(GOOGLE_ADS_LIMITS.appAd.youtubeVideosMax).optional()
4945
4987
  });
4946
- var videoAdSchema = z13.strictObject({
4947
- format: z13.literal("video"),
4988
+ var videoAdSchema = z14.strictObject({
4989
+ format: z14.literal("video"),
4948
4990
  // A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
4949
4991
  // its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
4950
- videoAssets: z13.array(refSchema).min(1),
4951
- finalUrls: z13.array(httpsUrlSchema2).min(1)
4952
- });
4953
- var demandGenAdSchema = z13.strictObject({
4954
- format: z13.literal("demandGen"),
4955
- headlines: z13.array(z13.object({ text: z13.string().min(1).max(40) })).min(1).max(5),
4956
- descriptions: z13.array(z13.object({ text: z13.string().min(1).max(90) })).min(1).max(5),
4957
- businessName: z13.string().min(1).max(25),
4958
- finalUrls: z13.array(httpsUrlSchema2).min(1),
4959
- imageAssets: z13.array(refSchema).optional(),
4960
- squareImageAssets: z13.array(refSchema).optional(),
4961
- logoImageAssets: z13.array(refSchema).optional()
4962
- });
4963
- var adContentSchema2 = z13.discriminatedUnion("format", [
4992
+ videoAssets: z14.array(refSchema).min(1),
4993
+ finalUrls: z14.array(httpsUrlSchema2).min(1)
4994
+ });
4995
+ var demandGenAdSchema = z14.strictObject({
4996
+ format: z14.literal("demandGen"),
4997
+ headlines: z14.array(z14.object({ text: z14.string().min(1).max(40) })).min(1).max(5),
4998
+ descriptions: z14.array(z14.object({ text: z14.string().min(1).max(90) })).min(1).max(5),
4999
+ businessName: z14.string().min(1).max(25),
5000
+ finalUrls: z14.array(httpsUrlSchema2).min(1),
5001
+ imageAssets: z14.array(refSchema).optional(),
5002
+ squareImageAssets: z14.array(refSchema).optional(),
5003
+ logoImageAssets: z14.array(refSchema).optional()
5004
+ });
5005
+ var adContentSchema2 = z14.discriminatedUnion("format", [
4964
5006
  responsiveSearchAdSchema,
4965
5007
  responsiveDisplayAdSchema,
4966
5008
  callAdSchema,
@@ -4968,45 +5010,45 @@ var adContentSchema2 = z13.discriminatedUnion("format", [
4968
5010
  videoAdSchema,
4969
5011
  demandGenAdSchema
4970
5012
  ]);
4971
- var adCreateSchema = z13.object({
5013
+ var adCreateSchema = z14.object({
4972
5014
  adGroup: refSchema,
4973
5015
  status: stageableStatusSchema2.default("PAUSED"),
4974
5016
  content: adContentSchema2
4975
5017
  });
4976
- var adUpdateSchema = z13.object({
4977
- status: z13.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
5018
+ var adUpdateSchema = z14.object({
5019
+ status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4978
5020
  /** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
4979
- content: z13.record(z13.string(), z13.unknown()).optional()
5021
+ content: z14.record(z14.string(), z14.unknown()).optional()
4980
5022
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4981
- var textAssetSchema = z13.object({ type: z13.literal("text"), text: z13.string().min(1) });
4982
- var imageAssetSchema = z13.object({
4983
- type: z13.literal("image"),
4984
- imageId: z13.string().min(1),
4985
- name: z13.string().optional()
4986
- });
4987
- var youtubeVideoAssetSchema = z13.object({
4988
- type: z13.literal("youtubeVideo"),
4989
- youtubeVideoId: z13.string().min(1),
4990
- name: z13.string().optional()
4991
- });
4992
- var sitelinkAssetSchema = z13.object({
4993
- type: z13.literal("sitelink"),
4994
- linkText: z13.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4995
- description1: z13.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4996
- description2: z13.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4997
- finalUrls: z13.array(httpsUrlSchema2).min(1)
4998
- });
4999
- var calloutAssetSchema = z13.object({
5000
- type: z13.literal("callout"),
5001
- calloutText: z13.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
5002
- });
5003
- var structuredSnippetAssetSchema = z13.object({
5004
- type: z13.literal("structuredSnippet"),
5005
- header: z13.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
5006
- values: z13.array(z13.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
5007
- });
5008
- var callToActionAssetSchema = z13.object({ type: z13.literal("callToAction"), callToAction: z13.string().min(1) });
5009
- var assetCreateSchema = z13.discriminatedUnion("type", [
5023
+ var textAssetSchema = z14.object({ type: z14.literal("text"), text: z14.string().min(1) });
5024
+ var imageAssetSchema = z14.object({
5025
+ type: z14.literal("image"),
5026
+ imageId: z14.string().min(1),
5027
+ name: z14.string().optional()
5028
+ });
5029
+ var youtubeVideoAssetSchema = z14.object({
5030
+ type: z14.literal("youtubeVideo"),
5031
+ youtubeVideoId: z14.string().min(1),
5032
+ name: z14.string().optional()
5033
+ });
5034
+ var sitelinkAssetSchema = z14.object({
5035
+ type: z14.literal("sitelink"),
5036
+ linkText: z14.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
5037
+ description1: z14.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
5038
+ description2: z14.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
5039
+ finalUrls: z14.array(httpsUrlSchema2).min(1)
5040
+ });
5041
+ var calloutAssetSchema = z14.object({
5042
+ type: z14.literal("callout"),
5043
+ calloutText: z14.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
5044
+ });
5045
+ var structuredSnippetAssetSchema = z14.object({
5046
+ type: z14.literal("structuredSnippet"),
5047
+ header: z14.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
5048
+ values: z14.array(z14.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
5049
+ });
5050
+ var callToActionAssetSchema = z14.object({ type: z14.literal("callToAction"), callToAction: z14.string().min(1) });
5051
+ var assetCreateSchema = z14.discriminatedUnion("type", [
5010
5052
  textAssetSchema,
5011
5053
  imageAssetSchema,
5012
5054
  youtubeVideoAssetSchema,
@@ -5015,136 +5057,136 @@ var assetCreateSchema = z13.discriminatedUnion("type", [
5015
5057
  structuredSnippetAssetSchema,
5016
5058
  callToActionAssetSchema
5017
5059
  ]);
5018
- var assetUpdateSchema = z13.object({
5019
- name: z13.string().min(1).optional(),
5020
- linkText: z13.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
5021
- description1: z13.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
5022
- description2: z13.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
5023
- finalUrls: z13.array(httpsUrlSchema2).min(1).optional(),
5024
- calloutText: z13.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
5025
- header: z13.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
5026
- values: z13.array(z13.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
5027
- callToAction: z13.string().min(1).optional(),
5028
- text: z13.string().min(1).optional()
5060
+ var assetUpdateSchema = z14.object({
5061
+ name: z14.string().min(1).optional(),
5062
+ linkText: z14.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
5063
+ description1: z14.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
5064
+ description2: z14.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
5065
+ finalUrls: z14.array(httpsUrlSchema2).min(1).optional(),
5066
+ calloutText: z14.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
5067
+ header: z14.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
5068
+ values: z14.array(z14.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
5069
+ callToAction: z14.string().min(1).optional(),
5070
+ text: z14.string().min(1).optional()
5029
5071
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
5030
- var assetLinkAttachSchema = z13.object({
5031
- level: z13.enum(["campaign", "adGroup", "customer"]),
5072
+ var assetLinkAttachSchema = z14.object({
5073
+ level: z14.enum(["campaign", "adGroup", "customer"]),
5032
5074
  parent: refSchema.optional(),
5033
5075
  asset: refSchema,
5034
- fieldType: z13.enum(ASSET_FIELD_TYPES)
5076
+ fieldType: z14.enum(ASSET_FIELD_TYPES)
5035
5077
  }).superRefine((value, ctx) => {
5036
5078
  if (value.level !== "customer" && !value.parent) {
5037
5079
  ctx.addIssue({
5038
- code: z13.ZodIssueCode.custom,
5080
+ code: z14.ZodIssueCode.custom,
5039
5081
  path: ["parent"],
5040
5082
  message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
5041
5083
  });
5042
5084
  }
5043
5085
  });
5044
- var assetGroupCreateSchema = z13.object({
5086
+ var assetGroupCreateSchema = z14.object({
5045
5087
  campaign: refSchema,
5046
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
5047
- finalUrls: z13.array(httpsUrlSchema2).min(1),
5048
- headlines: z13.array(z13.object({ text: z13.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
5049
- longHeadlines: z13.array(z13.object({ text: z13.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
5050
- descriptions: z13.array(z13.object({ text: z13.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
5051
- businessName: z13.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
5052
- imageAssets: z13.array(refSchema).optional(),
5053
- squareImageAssets: z13.array(refSchema).optional(),
5054
- logoAssets: z13.array(refSchema).optional(),
5055
- status: z13.enum(["ENABLED", "PAUSED"]).default("PAUSED")
5056
- });
5057
- var assetGroupUpdateSchema = z13.object({
5058
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
5059
- finalUrls: z13.array(httpsUrlSchema2).min(1).optional(),
5060
- status: z13.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
5088
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
5089
+ finalUrls: z14.array(httpsUrlSchema2).min(1),
5090
+ headlines: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
5091
+ longHeadlines: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
5092
+ descriptions: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
5093
+ businessName: z14.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
5094
+ imageAssets: z14.array(refSchema).optional(),
5095
+ squareImageAssets: z14.array(refSchema).optional(),
5096
+ logoAssets: z14.array(refSchema).optional(),
5097
+ status: z14.enum(["ENABLED", "PAUSED"]).default("PAUSED")
5098
+ });
5099
+ var assetGroupUpdateSchema = z14.object({
5100
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
5101
+ finalUrls: z14.array(httpsUrlSchema2).min(1).optional(),
5102
+ status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
5061
5103
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
5062
- var audienceCreateSchema2 = z13.object({
5063
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
5064
- type: z13.enum(USER_LIST_TYPES).default("BASIC"),
5065
- description: z13.string().optional(),
5104
+ var audienceCreateSchema2 = z14.object({
5105
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
5106
+ type: z14.enum(USER_LIST_TYPES).default("BASIC"),
5107
+ description: z14.string().optional(),
5066
5108
  /** Customer-match members (crm-based) — file-first for large lists. */
5067
- members: z13.array(z13.record(z13.string(), z13.string())).optional(),
5068
- sourceFileRef: z13.string().optional()
5109
+ members: z14.array(z14.record(z14.string(), z14.string())).optional(),
5110
+ sourceFileRef: z14.string().optional()
5069
5111
  });
5070
- var audienceCriterionAttachSchema = z13.object({
5071
- level: z13.enum(["campaign", "adGroup"]),
5112
+ var audienceCriterionAttachSchema = z14.object({
5113
+ level: z14.enum(["campaign", "adGroup"]),
5072
5114
  parent: refSchema,
5073
5115
  userList: refSchema,
5074
- negative: z13.boolean().default(false)
5116
+ negative: z14.boolean().default(false)
5075
5117
  });
5076
- var conversionActionCreateSchema = z13.object({
5077
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
5078
- type: z13.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
5079
- category: z13.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
5080
- countingType: z13.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
5118
+ var conversionActionCreateSchema = z14.object({
5119
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
5120
+ type: z14.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
5121
+ category: z14.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
5122
+ countingType: z14.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
5081
5123
  defaultValueMicros: microsSchema.optional(),
5082
- defaultCurrencyCode: z13.string().length(3).optional(),
5083
- clickThroughLookbackWindowDays: z13.number().int().positive().optional(),
5084
- viewThroughLookbackWindowDays: z13.number().int().positive().optional(),
5085
- status: z13.enum(["ENABLED", "PAUSED"]).default("ENABLED")
5086
- });
5087
- var conversionActionUpdateSchema = z13.object({
5088
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
5089
- category: z13.enum(CONVERSION_ACTION_CATEGORIES).optional(),
5090
- countingType: z13.enum(CONVERSION_COUNTING_TYPES).optional(),
5124
+ defaultCurrencyCode: z14.string().length(3).optional(),
5125
+ clickThroughLookbackWindowDays: z14.number().int().positive().optional(),
5126
+ viewThroughLookbackWindowDays: z14.number().int().positive().optional(),
5127
+ status: z14.enum(["ENABLED", "PAUSED"]).default("ENABLED")
5128
+ });
5129
+ var conversionActionUpdateSchema = z14.object({
5130
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
5131
+ category: z14.enum(CONVERSION_ACTION_CATEGORIES).optional(),
5132
+ countingType: z14.enum(CONVERSION_COUNTING_TYPES).optional(),
5091
5133
  defaultValueMicros: microsSchema.optional(),
5092
- defaultCurrencyCode: z13.string().length(3).optional(),
5093
- clickThroughLookbackWindowDays: z13.number().int().positive().optional(),
5094
- viewThroughLookbackWindowDays: z13.number().int().positive().optional(),
5095
- status: z13.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
5134
+ defaultCurrencyCode: z14.string().length(3).optional(),
5135
+ clickThroughLookbackWindowDays: z14.number().int().positive().optional(),
5136
+ viewThroughLookbackWindowDays: z14.number().int().positive().optional(),
5137
+ status: z14.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
5096
5138
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
5097
- var biddingStrategyCreateSchema = z13.object({
5098
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
5139
+ var biddingStrategyCreateSchema = z14.object({
5140
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
5099
5141
  config: biddingConfigSchema
5100
5142
  }).superRefine((p, ctx) => {
5101
5143
  if (p.config.type === "MANUAL_CPC") {
5102
5144
  ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
5103
5145
  }
5104
5146
  });
5105
- var biddingStrategyUpdateSchema = z13.object({
5106
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
5147
+ var biddingStrategyUpdateSchema = z14.object({
5148
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
5107
5149
  config: biddingConfigSchema.optional()
5108
5150
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
5109
- var labelCreateSchema = z13.object({
5110
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
5111
- backgroundColor: z13.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
5112
- description: z13.string().optional()
5151
+ var labelCreateSchema = z14.object({
5152
+ name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
5153
+ backgroundColor: z14.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
5154
+ description: z14.string().optional()
5113
5155
  });
5114
- var labelAttachSchema = z13.object({
5115
- level: z13.enum(["campaign", "adGroup", "ad"]),
5156
+ var labelAttachSchema = z14.object({
5157
+ level: z14.enum(["campaign", "adGroup", "ad"]),
5116
5158
  parent: refSchema,
5117
5159
  label: refSchema
5118
5160
  });
5119
- var locationCriterionSchema = z13.object({
5120
- criterionType: z13.literal("location"),
5121
- geoTargetConstant: z13.union([z13.string().regex(GEO_TARGET_CONSTANT_REGEX), z13.string().regex(NUMERIC_ID_REGEX2)])
5122
- });
5123
- var languageCriterionSchema = z13.object({
5124
- criterionType: z13.literal("language"),
5125
- languageConstant: z13.union([z13.string().regex(LANGUAGE_CONSTANT_REGEX), z13.string().regex(NUMERIC_ID_REGEX2)])
5126
- });
5127
- var adScheduleCriterionSchema = z13.object({
5128
- criterionType: z13.literal("adSchedule"),
5129
- dayOfWeek: z13.enum(DAYS_OF_WEEK),
5130
- startHour: z13.number().int().min(0).max(23),
5131
- startMinute: z13.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
5132
- endHour: z13.number().int().min(0).max(24),
5133
- endMinute: z13.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
5134
- });
5135
- var deviceCriterionSchema = z13.object({
5136
- criterionType: z13.literal("device"),
5137
- device: z13.enum(DEVICE_TYPES),
5161
+ var locationCriterionSchema = z14.object({
5162
+ criterionType: z14.literal("location"),
5163
+ geoTargetConstant: z14.union([z14.string().regex(GEO_TARGET_CONSTANT_REGEX), z14.string().regex(NUMERIC_ID_REGEX2)])
5164
+ });
5165
+ var languageCriterionSchema = z14.object({
5166
+ criterionType: z14.literal("language"),
5167
+ languageConstant: z14.union([z14.string().regex(LANGUAGE_CONSTANT_REGEX), z14.string().regex(NUMERIC_ID_REGEX2)])
5168
+ });
5169
+ var adScheduleCriterionSchema = z14.object({
5170
+ criterionType: z14.literal("adSchedule"),
5171
+ dayOfWeek: z14.enum(DAYS_OF_WEEK),
5172
+ startHour: z14.number().int().min(0).max(23),
5173
+ startMinute: z14.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
5174
+ endHour: z14.number().int().min(0).max(24),
5175
+ endMinute: z14.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
5176
+ });
5177
+ var deviceCriterionSchema = z14.object({
5178
+ criterionType: z14.literal("device"),
5179
+ device: z14.enum(DEVICE_TYPES),
5138
5180
  // Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
5139
5181
  // to opt out of a Device type." So 0 (exclude the device) and 0.1–10.0 are valid; the (0, 0.1) gap is not.
5140
- bidModifier: z13.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
5182
+ bidModifier: z14.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
5141
5183
  message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
5142
5184
  })
5143
5185
  });
5144
- var campaignCriterionAddSchema = z13.object({
5186
+ var campaignCriterionAddSchema = z14.object({
5145
5187
  campaign: refSchema,
5146
- negative: z13.boolean().default(false),
5147
- criterion: z13.discriminatedUnion("criterionType", [
5188
+ negative: z14.boolean().default(false),
5189
+ criterion: z14.discriminatedUnion("criterionType", [
5148
5190
  locationCriterionSchema,
5149
5191
  languageCriterionSchema,
5150
5192
  adScheduleCriterionSchema,
@@ -5154,7 +5196,7 @@ var campaignCriterionAddSchema = z13.object({
5154
5196
  const c = val.criterion;
5155
5197
  if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
5156
5198
  ctx.addIssue({
5157
- code: z13.ZodIssueCode.custom,
5199
+ code: z14.ZodIssueCode.custom,
5158
5200
  message: "endHour 24 (midnight) cannot have a non-zero endMinute",
5159
5201
  path: ["criterion", "endMinute"]
5160
5202
  });
@@ -5206,17 +5248,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
5206
5248
  "google.campaignCriterion.add",
5207
5249
  "google.campaignCriterion.remove"
5208
5250
  ];
5209
- var googleDraftOpKindSchema = z13.enum(GOOGLE_DRAFT_OP_KINDS);
5251
+ var googleDraftOpKindSchema = z14.enum(GOOGLE_DRAFT_OP_KINDS);
5210
5252
  function createOp2(kind, payload) {
5211
- return z13.object({ kind: z13.literal(kind), customerId: customerIdSchema, payload });
5253
+ return z14.object({ kind: z14.literal(kind), customerId: customerIdSchema, payload });
5212
5254
  }
5213
5255
  function updateOp2(kind, payload) {
5214
- return z13.object({ kind: z13.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
5256
+ return z14.object({ kind: z14.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
5215
5257
  }
5216
5258
  function targetOp(kind) {
5217
- return z13.object({ kind: z13.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
5259
+ return z14.object({ kind: z14.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
5218
5260
  }
5219
- var googleDraftOpInputSchema = z13.discriminatedUnion("kind", [
5261
+ var googleDraftOpInputSchema = z14.discriminatedUnion("kind", [
5220
5262
  createOp2("google.budget.create", budgetCreateSchema),
5221
5263
  updateOp2("google.budget.update", budgetUpdateSchema),
5222
5264
  createOp2("google.campaign.create", campaignCreateSchema2),
@@ -5264,48 +5306,48 @@ var googleDraftOpInputSchema = z13.discriminatedUnion("kind", [
5264
5306
  ]);
5265
5307
 
5266
5308
  // ../api/src/ads-google/url-options.ts
5267
- import { z as z14 } from "zod";
5309
+ import { z as z15 } from "zod";
5268
5310
  var URL_OPTION_LEVELS = ["account", "campaign", "ad_group", "ad"];
5269
- var googleUrlOptionValueSchema = z14.discriminatedUnion("state", [
5270
- z14.object({ state: z14.literal("set"), value: z14.string() }),
5271
- z14.object({ state: z14.literal("not_set") }),
5272
- z14.object({ state: z14.literal("not_read"), reason: z14.string() })
5311
+ var googleUrlOptionValueSchema = z15.discriminatedUnion("state", [
5312
+ z15.object({ state: z15.literal("set"), value: z15.string() }),
5313
+ z15.object({ state: z15.literal("not_set") }),
5314
+ z15.object({ state: z15.literal("not_read"), reason: z15.string() })
5273
5315
  ]);
5274
- var googleUrlOptionsRequestSchema = z14.object({
5275
- customerId: z14.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id"),
5276
- managerId: z14.string().optional(),
5316
+ var googleUrlOptionsRequestSchema = z15.object({
5317
+ customerId: z15.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id"),
5318
+ managerId: z15.string().optional(),
5277
5319
  /** Compact by default: only campaigns that actually override the account. `full` lists every campaign. */
5278
- full: z14.boolean().optional(),
5279
- skipCache: z14.boolean().optional()
5320
+ full: z15.boolean().optional(),
5321
+ skipCache: z15.boolean().optional()
5280
5322
  });
5281
- var googleUrlOptionsCampaignSchema = z14.object({
5282
- id: z14.string(),
5283
- name: z14.string(),
5284
- status: z14.string(),
5323
+ var googleUrlOptionsCampaignSchema = z15.object({
5324
+ id: z15.string(),
5325
+ name: z15.string(),
5326
+ status: z15.string(),
5285
5327
  final_url_suffix: googleUrlOptionValueSchema,
5286
5328
  tracking_url_template: googleUrlOptionValueSchema
5287
5329
  });
5288
- var googleUrlOptionsResponseSchema = z14.object({
5289
- customer_id: z14.string(),
5290
- account: z14.object({
5291
- level: z14.literal("account"),
5292
- read: z14.boolean(),
5330
+ var googleUrlOptionsResponseSchema = z15.object({
5331
+ customer_id: z15.string(),
5332
+ account: z15.object({
5333
+ level: z15.literal("account"),
5334
+ read: z15.boolean(),
5293
5335
  final_url_suffix: googleUrlOptionValueSchema,
5294
5336
  tracking_url_template: googleUrlOptionValueSchema
5295
5337
  }),
5296
- campaigns: z14.object({
5297
- level: z14.literal("campaign"),
5298
- read: z14.boolean(),
5338
+ campaigns: z15.object({
5339
+ level: z15.literal("campaign"),
5340
+ read: z15.boolean(),
5299
5341
  /** Campaigns actually observed. 0 with `read: true` means the account has no non-removed campaigns. */
5300
- campaigns_read: z14.number().int().nonnegative(),
5342
+ campaigns_read: z15.number().int().nonnegative(),
5301
5343
  /** Campaigns observed to carry no override of their own — an explicit finding, not an omission. */
5302
- campaigns_without_override: z14.number().int().nonnegative(),
5303
- overrides: z14.array(googleUrlOptionsCampaignSchema),
5344
+ campaigns_without_override: z15.number().int().nonnegative(),
5345
+ overrides: z15.array(googleUrlOptionsCampaignSchema),
5304
5346
  /** Compact mode only: campaigns read but not listed because they carry no override. */
5305
- omitted: z14.number().int().nonnegative()
5347
+ omitted: z15.number().int().nonnegative()
5306
5348
  }),
5307
5349
  /** Levels this command never queried. Nothing here may be reported as "not configured". */
5308
- levels_not_read: z14.array(z14.object({ level: z14.enum(URL_OPTION_LEVELS), reason: z14.string() }))
5350
+ levels_not_read: z15.array(z15.object({ level: z15.enum(URL_OPTION_LEVELS), reason: z15.string() }))
5309
5351
  });
5310
5352
  var ACCOUNT_URL_OPTIONS_LOCATION = "Google Ads UI \u2192 Admin \u2192 Account settings \u2192 Tracking (account-level tracking template and final URL suffix)";
5311
5353
  var ACCOUNT_URL_OPTIONS_NOT_STAGEABLE = "Account-level URL options are written by a different Google service than the one Baker's staged changes apply through, so they can't be staged or published from here.";
@@ -5350,143 +5392,143 @@ function urlOptionsHints(report) {
5350
5392
  }
5351
5393
 
5352
5394
  // ../api/src/ads-google/wire.ts
5353
- import { z as z15 } from "zod";
5354
- var googleWriteModeSchema = z15.enum(["live", "simulated"]);
5355
- var googleDraftOpResultSchema = z15.object({
5356
- status: z15.enum(["applied", "simulated", "failed", "skipped"]),
5357
- resourceName: z15.string().optional(),
5358
- error: z15.string().optional(),
5359
- skippedBecause: z15.string().optional(),
5360
- executedAt: z15.number().optional()
5361
- });
5362
- var googleDraftStageRequestSchema = z15.object({
5363
- chatId: z15.string(),
5395
+ import { z as z16 } from "zod";
5396
+ var googleWriteModeSchema = z16.enum(["live", "simulated"]);
5397
+ var googleDraftOpResultSchema = z16.object({
5398
+ status: z16.enum(["applied", "simulated", "failed", "skipped"]),
5399
+ resourceName: z16.string().optional(),
5400
+ error: z16.string().optional(),
5401
+ skippedBecause: z16.string().optional(),
5402
+ executedAt: z16.number().optional()
5403
+ });
5404
+ var googleDraftStageRequestSchema = z16.object({
5405
+ chatId: z16.string(),
5364
5406
  op: googleDraftOpInputSchema
5365
5407
  });
5366
- var googleDraftStageResponseSchema = z15.discriminatedUnion("staged", [
5367
- z15.object({
5368
- staged: z15.literal(true),
5369
- ref: z15.string(),
5408
+ var googleDraftStageResponseSchema = z16.discriminatedUnion("staged", [
5409
+ z16.object({
5410
+ staged: z16.literal(true),
5411
+ ref: z16.string(),
5370
5412
  kind: googleDraftOpKindSchema,
5371
5413
  mode: googleWriteModeSchema,
5372
- dependsOn: z15.array(z15.string()),
5373
- summary: z15.string(),
5374
- warnings: z15.array(z15.string()),
5414
+ dependsOn: z16.array(z16.string()),
5415
+ summary: z16.string(),
5416
+ warnings: z16.array(z16.string()),
5375
5417
  /** True when the op amended an already-staged op in place instead of appending a new one. */
5376
- amended: z15.boolean().optional()
5418
+ amended: z16.boolean().optional()
5377
5419
  }),
5378
- z15.object({
5379
- staged: z15.literal(false),
5380
- noop: z15.literal(true),
5420
+ z16.object({
5421
+ staged: z16.literal(false),
5422
+ noop: z16.literal(true),
5381
5423
  kind: googleDraftOpKindSchema,
5382
5424
  mode: googleWriteModeSchema,
5383
- summary: z15.string(),
5384
- reason: z15.string()
5425
+ summary: z16.string(),
5426
+ reason: z16.string()
5385
5427
  })
5386
5428
  ]);
5387
- var googleDraftAmendRequestSchema = z15.object({
5388
- chatId: z15.string(),
5389
- ref: z15.string(),
5390
- patch: z15.record(z15.string(), z15.unknown())
5429
+ var googleDraftAmendRequestSchema = z16.object({
5430
+ chatId: z16.string(),
5431
+ ref: z16.string(),
5432
+ patch: z16.record(z16.string(), z16.unknown())
5391
5433
  });
5392
- var googleDraftShowRequestSchema = z15.object({
5393
- chatId: z15.string(),
5394
- ref: z15.string()
5434
+ var googleDraftShowRequestSchema = z16.object({
5435
+ chatId: z16.string(),
5436
+ ref: z16.string()
5395
5437
  });
5396
5438
  var GOOGLE_DRAFT_BATCH_MAX = 500;
5397
- var googleDraftStageBatchRequestSchema = z15.object({
5398
- chatId: z15.string(),
5399
- ops: z15.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
5439
+ var googleDraftStageBatchRequestSchema = z16.object({
5440
+ chatId: z16.string(),
5441
+ ops: z16.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
5400
5442
  });
5401
- var googleDraftStageBatchResponseSchema = z15.object({
5402
- staged: z15.literal(true),
5443
+ var googleDraftStageBatchResponseSchema = z16.object({
5444
+ staged: z16.literal(true),
5403
5445
  mode: googleWriteModeSchema,
5404
- count: z15.number(),
5405
- ops: z15.array(
5406
- z15.object({
5407
- ref: z15.string(),
5446
+ count: z16.number(),
5447
+ ops: z16.array(
5448
+ z16.object({
5449
+ ref: z16.string(),
5408
5450
  kind: googleDraftOpKindSchema,
5409
- dependsOn: z15.array(z15.string()),
5410
- summary: z15.string(),
5411
- warnings: z15.array(z15.string())
5451
+ dependsOn: z16.array(z16.string()),
5452
+ summary: z16.string(),
5453
+ warnings: z16.array(z16.string())
5412
5454
  })
5413
5455
  ),
5414
- skipped: z15.array(z15.object({ kind: googleDraftOpKindSchema, summary: z15.string(), reason: z15.string() })).optional()
5456
+ skipped: z16.array(z16.object({ kind: googleDraftOpKindSchema, summary: z16.string(), reason: z16.string() })).optional()
5415
5457
  });
5416
- var googleDraftOpViewSchema = z15.object({
5417
- ref: z15.string(),
5458
+ var googleDraftOpViewSchema = z16.object({
5459
+ ref: z16.string(),
5418
5460
  kind: googleDraftOpKindSchema,
5419
- customerId: z15.string(),
5420
- target: z15.string().optional(),
5421
- dependsOn: z15.array(z15.string()),
5422
- summary: z15.string(),
5423
- stagedAt: z15.number(),
5461
+ customerId: z16.string(),
5462
+ target: z16.string().optional(),
5463
+ dependsOn: z16.array(z16.string()),
5464
+ summary: z16.string(),
5465
+ stagedAt: z16.number(),
5424
5466
  result: googleDraftOpResultSchema.optional()
5425
5467
  });
5426
- var googleDraftShowResponseSchema = z15.object({
5468
+ var googleDraftShowResponseSchema = z16.object({
5427
5469
  op: googleDraftOpViewSchema.extend({
5428
- payload: z15.unknown().optional(),
5429
- warnings: z15.array(z15.string()).optional(),
5430
- annotations: z15.unknown().optional()
5470
+ payload: z16.unknown().optional(),
5471
+ warnings: z16.array(z16.string()).optional(),
5472
+ annotations: z16.unknown().optional()
5431
5473
  })
5432
5474
  });
5433
- var googleDraftListRequestSchema = z15.object({
5434
- chatId: z15.string()
5475
+ var googleDraftListRequestSchema = z16.object({
5476
+ chatId: z16.string()
5435
5477
  });
5436
- var googleDraftAdvisorySchema = z15.object({
5437
- scope: z15.enum(["campaign", "adGroup"]),
5438
- message: z15.string()
5478
+ var googleDraftAdvisorySchema = z16.object({
5479
+ scope: z16.enum(["campaign", "adGroup"]),
5480
+ message: z16.string()
5439
5481
  });
5440
- var googleDraftStatusCollectionSchema = z15.object({
5441
- label: z15.string(),
5442
- added: z15.number(),
5443
- removed: z15.number(),
5444
- existing: z15.number()
5482
+ var googleDraftStatusCollectionSchema = z16.object({
5483
+ label: z16.string(),
5484
+ added: z16.number(),
5485
+ removed: z16.number(),
5486
+ existing: z16.number()
5445
5487
  });
5446
- var googleDraftChangeOperationSchema = z15.enum(["create", "update", "pause", "resume", "remove"]);
5447
- var googleDraftStatusNodeSchema = z15.lazy(
5448
- () => z15.object({
5449
- entity: z15.string(),
5450
- name: z15.string(),
5488
+ var googleDraftChangeOperationSchema = z16.enum(["create", "update", "pause", "resume", "remove"]);
5489
+ var googleDraftStatusNodeSchema = z16.lazy(
5490
+ () => z16.object({
5491
+ entity: z16.string(),
5492
+ name: z16.string(),
5451
5493
  operation: googleDraftChangeOperationSchema.optional(),
5452
- existing: z15.boolean(),
5453
- collections: z15.array(googleDraftStatusCollectionSchema),
5454
- children: z15.array(googleDraftStatusNodeSchema),
5455
- warnings: z15.array(z15.string()).optional()
5494
+ existing: z16.boolean(),
5495
+ collections: z16.array(googleDraftStatusCollectionSchema),
5496
+ children: z16.array(googleDraftStatusNodeSchema),
5497
+ warnings: z16.array(z16.string()).optional()
5456
5498
  })
5457
5499
  );
5458
- var googleDraftListResponseSchema = z15.object({
5459
- status: z15.enum(["active", "publishing", "applied", "discarded", "none"]),
5500
+ var googleDraftListResponseSchema = z16.object({
5501
+ status: z16.enum(["active", "publishing", "applied", "discarded", "none"]),
5460
5502
  mode: googleWriteModeSchema,
5461
- count: z15.number(),
5462
- ops: z15.array(googleDraftOpViewSchema),
5503
+ count: z16.number(),
5504
+ ops: z16.array(googleDraftOpViewSchema),
5463
5505
  /** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
5464
- tree: z15.array(googleDraftStatusNodeSchema).optional(),
5506
+ tree: z16.array(googleDraftStatusNodeSchema).optional(),
5465
5507
  /** Non-blocking completeness advisories for the whole draft. */
5466
- advisories: z15.array(googleDraftAdvisorySchema).optional()
5508
+ advisories: z16.array(googleDraftAdvisorySchema).optional()
5467
5509
  });
5468
- var googleDraftRemoveRequestSchema = z15.object({
5469
- chatId: z15.string(),
5470
- ref: z15.string()
5510
+ var googleDraftRemoveRequestSchema = z16.object({
5511
+ chatId: z16.string(),
5512
+ ref: z16.string()
5471
5513
  });
5472
- var googleDraftRemoveResponseSchema = z15.object({
5514
+ var googleDraftRemoveResponseSchema = z16.object({
5473
5515
  /** The requested ref plus any dependents removed by cascade. */
5474
- removed: z15.array(z15.string())
5516
+ removed: z16.array(z16.string())
5475
5517
  });
5476
- var googleDraftClearRequestSchema = z15.object({
5477
- chatId: z15.string()
5518
+ var googleDraftClearRequestSchema = z16.object({
5519
+ chatId: z16.string()
5478
5520
  });
5479
- var googleDraftClearResponseSchema = z15.object({
5480
- cleared: z15.number()
5521
+ var googleDraftClearResponseSchema = z16.object({
5522
+ cleared: z16.number()
5481
5523
  });
5482
- var googleFieldErrorSchema = z15.object({
5483
- path: z15.string(),
5484
- message: z15.string()
5524
+ var googleFieldErrorSchema = z16.object({
5525
+ path: z16.string(),
5526
+ message: z16.string()
5485
5527
  });
5486
- var googleDraftErrorResponseSchema = z15.object({
5487
- code: z15.string(),
5488
- error: z15.string(),
5489
- fields: z15.array(googleFieldErrorSchema).optional()
5528
+ var googleDraftErrorResponseSchema = z16.object({
5529
+ code: z16.string(),
5530
+ error: z16.string(),
5531
+ fields: z16.array(googleFieldErrorSchema).optional()
5490
5532
  });
5491
5533
 
5492
5534
  // src/commands/ads/google/changes-window.ts
@@ -13618,17 +13660,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
13618
13660
  var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
13619
13661
 
13620
13662
  // ../api/src/ads-meta/ops.ts
13621
- import { z as z16 } from "zod";
13622
- var tempRefSchema3 = z16.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
13623
- var parentRefSchema2 = z16.union([z16.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
13624
- var moneySchema2 = z16.object({
13625
- amount: z16.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
13626
- currencyCode: z16.string().length(3).optional()
13627
- });
13628
- var httpsUrlSchema3 = z16.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
13629
- var bakerMediaIdSchema2 = z16.string().min(1);
13630
- var stageableStatusSchema3 = z16.enum(STAGEABLE_CREATE_STATUSES3);
13631
- var updateStatusSchema = z16.enum(UPDATE_STATUSES);
13663
+ import { z as z17 } from "zod";
13664
+ var tempRefSchema3 = z17.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
13665
+ var parentRefSchema2 = z17.union([z17.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
13666
+ var moneySchema2 = z17.object({
13667
+ amount: z17.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
13668
+ currencyCode: z17.string().length(3).optional()
13669
+ });
13670
+ var httpsUrlSchema3 = z17.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
13671
+ var bakerMediaIdSchema2 = z17.string().min(1);
13672
+ var stageableStatusSchema3 = z17.enum(STAGEABLE_CREATE_STATUSES3);
13673
+ var updateStatusSchema = z17.enum(UPDATE_STATUSES);
13632
13674
  function currencyMinimums2(currencyCode) {
13633
13675
  return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
13634
13676
  }
@@ -13640,35 +13682,35 @@ function validateDailyBudgetFloor(money, ctx, path28) {
13640
13682
  }
13641
13683
  }
13642
13684
  }
13643
- var geoLocationsSchema = z16.object({
13644
- countries: z16.array(z16.string().length(2)).optional(),
13645
- regions: z16.array(z16.object({ key: z16.string() })).optional(),
13646
- cities: z16.array(z16.object({ key: z16.string(), radius: z16.number().optional(), distance_unit: z16.string().optional() })).optional(),
13647
- zips: z16.array(z16.object({ key: z16.string() })).optional(),
13648
- location_types: z16.array(z16.string()).optional()
13649
- }).catchall(z16.unknown());
13650
- var idNameSchema = z16.object({ id: z16.string(), name: z16.string().optional() });
13651
- var metaTargetingSchema = z16.object({
13685
+ var geoLocationsSchema = z17.object({
13686
+ countries: z17.array(z17.string().length(2)).optional(),
13687
+ regions: z17.array(z17.object({ key: z17.string() })).optional(),
13688
+ cities: z17.array(z17.object({ key: z17.string(), radius: z17.number().optional(), distance_unit: z17.string().optional() })).optional(),
13689
+ zips: z17.array(z17.object({ key: z17.string() })).optional(),
13690
+ location_types: z17.array(z17.string()).optional()
13691
+ }).catchall(z17.unknown());
13692
+ var idNameSchema = z17.object({ id: z17.string(), name: z17.string().optional() });
13693
+ var metaTargetingSchema = z17.object({
13652
13694
  geo_locations: geoLocationsSchema.optional(),
13653
13695
  excluded_geo_locations: geoLocationsSchema.optional(),
13654
- age_min: z16.number().int().min(13).max(65).optional(),
13655
- age_max: z16.number().int().min(13).max(65).optional(),
13656
- genders: z16.array(z16.union([z16.literal(1), z16.literal(2)])).optional(),
13657
- locales: z16.array(z16.number().int()).optional(),
13658
- interests: z16.array(idNameSchema).optional(),
13659
- behaviors: z16.array(idNameSchema).optional(),
13660
- custom_audiences: z16.array(z16.object({ id: parentRefSchema2 })).optional(),
13661
- excluded_custom_audiences: z16.array(z16.object({ id: parentRefSchema2 })).optional(),
13662
- flexible_spec: z16.array(z16.record(z16.string(), z16.unknown())).optional(),
13663
- exclusions: z16.record(z16.string(), z16.unknown()).optional(),
13664
- publisher_platforms: z16.array(z16.string()).optional(),
13665
- facebook_positions: z16.array(z16.string()).optional(),
13666
- instagram_positions: z16.array(z16.string()).optional(),
13667
- audience_network_positions: z16.array(z16.string()).optional(),
13668
- messenger_positions: z16.array(z16.string()).optional(),
13669
- device_platforms: z16.array(z16.string()).optional(),
13670
- targeting_automation: z16.object({ advantage_audience: z16.union([z16.literal(0), z16.literal(1)]) }).partial().optional()
13671
- }).catchall(z16.unknown());
13696
+ age_min: z17.number().int().min(13).max(65).optional(),
13697
+ age_max: z17.number().int().min(13).max(65).optional(),
13698
+ genders: z17.array(z17.union([z17.literal(1), z17.literal(2)])).optional(),
13699
+ locales: z17.array(z17.number().int()).optional(),
13700
+ interests: z17.array(idNameSchema).optional(),
13701
+ behaviors: z17.array(idNameSchema).optional(),
13702
+ custom_audiences: z17.array(z17.object({ id: parentRefSchema2 })).optional(),
13703
+ excluded_custom_audiences: z17.array(z17.object({ id: parentRefSchema2 })).optional(),
13704
+ flexible_spec: z17.array(z17.record(z17.string(), z17.unknown())).optional(),
13705
+ exclusions: z17.record(z17.string(), z17.unknown()).optional(),
13706
+ publisher_platforms: z17.array(z17.string()).optional(),
13707
+ facebook_positions: z17.array(z17.string()).optional(),
13708
+ instagram_positions: z17.array(z17.string()).optional(),
13709
+ audience_network_positions: z17.array(z17.string()).optional(),
13710
+ messenger_positions: z17.array(z17.string()).optional(),
13711
+ device_platforms: z17.array(z17.string()).optional(),
13712
+ targeting_automation: z17.object({ advantage_audience: z17.union([z17.literal(0), z17.literal(1)]) }).partial().optional()
13713
+ }).catchall(z17.unknown());
13672
13714
  var GEO_INCLUSION_KEYS = [
13673
13715
  "countries",
13674
13716
  "country_groups",
@@ -13707,21 +13749,21 @@ function targetingHardLimitsDemographics(t) {
13707
13749
  const narrowsGender = Array.isArray(t.genders) && t.genders.length === 1;
13708
13750
  return narrowsAgeMax || narrowsAgeMin || narrowsGender;
13709
13751
  }
13710
- var specialAdCategoriesSchema = z16.array(z16.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
13711
- var campaignCreateSchema3 = z16.object({
13712
- name: z16.string().min(1).max(META_LIMITS.campaign.nameMax),
13713
- objective: z16.enum(OBJECTIVES),
13752
+ var specialAdCategoriesSchema = z17.array(z17.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
13753
+ var campaignCreateSchema3 = z17.object({
13754
+ name: z17.string().min(1).max(META_LIMITS.campaign.nameMax),
13755
+ objective: z17.enum(OBJECTIVES),
13714
13756
  status: stageableStatusSchema3.default("PAUSED"),
13715
13757
  special_ad_categories: specialAdCategoriesSchema,
13716
- special_ad_category_country: z16.array(z16.string().length(2)).optional(),
13717
- buying_type: z16.enum(BUYING_TYPES).default("AUCTION"),
13718
- bid_strategy: z16.enum(BID_STRATEGIES).optional(),
13758
+ special_ad_category_country: z17.array(z17.string().length(2)).optional(),
13759
+ buying_type: z17.enum(BUYING_TYPES).default("AUCTION"),
13760
+ bid_strategy: z17.enum(BID_STRATEGIES).optional(),
13719
13761
  /** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
13720
13762
  dailyBudget: moneySchema2.optional(),
13721
13763
  lifetimeBudget: moneySchema2.optional(),
13722
13764
  spendCap: moneySchema2.optional(),
13723
- start_time: z16.number().int().positive().optional(),
13724
- stop_time: z16.number().int().positive().optional()
13765
+ start_time: z17.number().int().positive().optional(),
13766
+ stop_time: z17.number().int().positive().optional()
13725
13767
  }).superRefine((p, ctx) => {
13726
13768
  if (p.dailyBudget && p.lifetimeBudget) {
13727
13769
  ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
@@ -13739,15 +13781,15 @@ var campaignCreateSchema3 = z16.object({
13739
13781
  });
13740
13782
  }
13741
13783
  });
13742
- var campaignUpdateSchema3 = z16.object({
13743
- name: z16.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
13784
+ var campaignUpdateSchema3 = z17.object({
13785
+ name: z17.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
13744
13786
  status: updateStatusSchema.optional(),
13745
- bid_strategy: z16.enum(BID_STRATEGIES).optional(),
13787
+ bid_strategy: z17.enum(BID_STRATEGIES).optional(),
13746
13788
  dailyBudget: moneySchema2.optional(),
13747
13789
  lifetimeBudget: moneySchema2.optional(),
13748
13790
  spendCap: moneySchema2.optional(),
13749
- start_time: z16.number().int().positive().optional(),
13750
- stop_time: z16.number().int().positive().optional()
13791
+ start_time: z17.number().int().positive().optional(),
13792
+ stop_time: z17.number().int().positive().optional()
13751
13793
  }).superRefine((p, ctx) => {
13752
13794
  if (!Object.values(p).some((val) => val !== void 0)) {
13753
13795
  ctx.addIssue({ code: "custom", message: "update needs at least one field" });
@@ -13757,42 +13799,42 @@ var campaignUpdateSchema3 = z16.object({
13757
13799
  }
13758
13800
  validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
13759
13801
  });
13760
- var promotedObjectSchema = z16.object({
13802
+ var promotedObjectSchema = z17.object({
13761
13803
  page_id: parentRefSchema2.optional(),
13762
- pixel_id: z16.string().regex(NUMERIC_ID_REGEX3).optional(),
13763
- custom_event_type: z16.enum(CUSTOM_EVENT_TYPES).optional(),
13764
- application_id: z16.string().regex(NUMERIC_ID_REGEX3).optional(),
13765
- object_store_url: z16.string().url().optional(),
13766
- product_catalog_id: z16.string().regex(NUMERIC_ID_REGEX3).optional(),
13767
- product_set_id: z16.string().regex(NUMERIC_ID_REGEX3).optional(),
13768
- whatsapp_phone_number: z16.string().optional(),
13769
- offline_conversion_data_set_id: z16.string().regex(NUMERIC_ID_REGEX3).optional()
13804
+ pixel_id: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
13805
+ custom_event_type: z17.enum(CUSTOM_EVENT_TYPES).optional(),
13806
+ application_id: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
13807
+ object_store_url: z17.string().url().optional(),
13808
+ product_catalog_id: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
13809
+ product_set_id: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
13810
+ whatsapp_phone_number: z17.string().optional(),
13811
+ offline_conversion_data_set_id: z17.string().regex(NUMERIC_ID_REGEX3).optional()
13770
13812
  }).partial();
13771
- var attributionSpecSchema = z16.array(
13772
- z16.object({
13773
- event_type: z16.enum(ATTRIBUTION_EVENT_TYPES),
13774
- window_days: z16.union([z16.literal(1), z16.literal(7), z16.literal(28)])
13813
+ var attributionSpecSchema = z17.array(
13814
+ z17.object({
13815
+ event_type: z17.enum(ATTRIBUTION_EVENT_TYPES),
13816
+ window_days: z17.union([z17.literal(1), z17.literal(7), z17.literal(28)])
13775
13817
  })
13776
13818
  );
13777
13819
  var adSetFields = {
13778
- name: z16.string().min(1).max(META_LIMITS.adSet.nameMax),
13820
+ name: z17.string().min(1).max(META_LIMITS.adSet.nameMax),
13779
13821
  campaign_id: parentRefSchema2,
13780
13822
  status: stageableStatusSchema3.default("PAUSED"),
13781
13823
  dailyBudget: moneySchema2.optional(),
13782
13824
  lifetimeBudget: moneySchema2.optional(),
13783
13825
  bidAmount: moneySchema2.optional(),
13784
- bid_strategy: z16.enum(BID_STRATEGIES).optional(),
13785
- billing_event: z16.enum(BILLING_EVENTS),
13786
- optimization_goal: z16.enum(OPTIMIZATION_GOALS),
13787
- destination_type: z16.enum(DESTINATION_TYPES).optional(),
13826
+ bid_strategy: z17.enum(BID_STRATEGIES).optional(),
13827
+ billing_event: z17.enum(BILLING_EVENTS),
13828
+ optimization_goal: z17.enum(OPTIMIZATION_GOALS),
13829
+ destination_type: z17.enum(DESTINATION_TYPES).optional(),
13788
13830
  promoted_object: promotedObjectSchema.optional(),
13789
13831
  attribution_spec: attributionSpecSchema.optional(),
13790
- start_time: z16.number().int().positive().optional(),
13791
- end_time: z16.number().int().positive().optional(),
13832
+ start_time: z17.number().int().positive().optional(),
13833
+ end_time: z17.number().int().positive().optional(),
13792
13834
  targeting: metaTargetingSchema,
13793
13835
  /** EU Digital Services Act: who benefits from / pays for the ad. Auto-filled from the account for EU geo when omitted. */
13794
- dsa_beneficiary: z16.string().min(1).max(100).optional(),
13795
- dsa_payor: z16.string().min(1).max(100).optional()
13836
+ dsa_beneficiary: z17.string().min(1).max(100).optional(),
13837
+ dsa_payor: z17.string().min(1).max(100).optional()
13796
13838
  };
13797
13839
  function validateBidStrategy(p, ctx) {
13798
13840
  const strategy = p.bid_strategy;
@@ -13889,7 +13931,7 @@ function validateAdvantageAudience(p, ctx) {
13889
13931
  });
13890
13932
  }
13891
13933
  }
13892
- var adSetCreateSchema = z16.object(adSetFields).superRefine((p, ctx) => {
13934
+ var adSetCreateSchema = z17.object(adSetFields).superRefine((p, ctx) => {
13893
13935
  validateAdSetBudgetAndBid(p, ctx);
13894
13936
  validateAdSetPromotedObject(p, ctx);
13895
13937
  validateAdvantageAudience(p, ctx);
@@ -13901,22 +13943,22 @@ var adSetCreateSchema = z16.object(adSetFields).superRefine((p, ctx) => {
13901
13943
  });
13902
13944
  }
13903
13945
  });
13904
- var adSetUpdateSchema = z16.object({
13946
+ var adSetUpdateSchema = z17.object({
13905
13947
  name: adSetFields.name.optional(),
13906
13948
  status: updateStatusSchema.optional(),
13907
13949
  dailyBudget: moneySchema2.optional(),
13908
13950
  lifetimeBudget: moneySchema2.optional(),
13909
13951
  bidAmount: moneySchema2.optional(),
13910
- bid_strategy: z16.enum(BID_STRATEGIES).optional(),
13911
- optimization_goal: z16.enum(OPTIMIZATION_GOALS).optional(),
13912
- destination_type: z16.enum(DESTINATION_TYPES).optional(),
13952
+ bid_strategy: z17.enum(BID_STRATEGIES).optional(),
13953
+ optimization_goal: z17.enum(OPTIMIZATION_GOALS).optional(),
13954
+ destination_type: z17.enum(DESTINATION_TYPES).optional(),
13913
13955
  promoted_object: promotedObjectSchema.optional(),
13914
13956
  attribution_spec: attributionSpecSchema.optional(),
13915
- start_time: z16.number().int().positive().optional(),
13916
- end_time: z16.number().int().positive().optional(),
13957
+ start_time: z17.number().int().positive().optional(),
13958
+ end_time: z17.number().int().positive().optional(),
13917
13959
  targeting: metaTargetingSchema.optional(),
13918
- dsa_beneficiary: z16.string().min(1).max(100).optional(),
13919
- dsa_payor: z16.string().min(1).max(100).optional()
13960
+ dsa_beneficiary: z17.string().min(1).max(100).optional(),
13961
+ dsa_payor: z17.string().min(1).max(100).optional()
13920
13962
  }).superRefine((p, ctx) => {
13921
13963
  if (!Object.values(p).some((val) => val !== void 0)) {
13922
13964
  ctx.addIssue({ code: "custom", message: "update needs at least one field" });
@@ -13927,38 +13969,38 @@ var adSetUpdateSchema = z16.object({
13927
13969
  }
13928
13970
  validateAdvantageAudience(p, ctx);
13929
13971
  });
13930
- var messageSchema = z16.string().min(1).max(META_LIMITS.creative.messageHardMax);
13931
- var headlineSchema2 = z16.string().min(1).max(META_LIMITS.creative.headlineMax);
13932
- var descriptionSchema = z16.string().min(1).max(META_LIMITS.creative.descriptionMax);
13933
- var callToActionSchema = z16.object({
13934
- type: z16.enum(CTA_TYPES2),
13972
+ var messageSchema = z17.string().min(1).max(META_LIMITS.creative.messageHardMax);
13973
+ var headlineSchema2 = z17.string().min(1).max(META_LIMITS.creative.headlineMax);
13974
+ var descriptionSchema = z17.string().min(1).max(META_LIMITS.creative.descriptionMax);
13975
+ var callToActionSchema = z17.object({
13976
+ type: z17.enum(CTA_TYPES2),
13935
13977
  /** Overrides the base link for the CTA button; defaults to the ad's link. */
13936
13978
  link: httpsUrlSchema3.optional()
13937
13979
  });
13938
- var creativeEnhancementsSchema = z16.object({
13939
- standardEnhancements: z16.enum(ENROLL_STATUSES).optional(),
13940
- features: z16.record(z16.string(), z16.enum(ENROLL_STATUSES)).optional()
13980
+ var creativeEnhancementsSchema = z17.object({
13981
+ standardEnhancements: z17.enum(ENROLL_STATUSES).optional(),
13982
+ features: z17.record(z17.string(), z17.enum(ENROLL_STATUSES)).optional()
13941
13983
  });
13942
13984
  var creativeSharedFields = {
13943
- name: z16.string().max(META_LIMITS.creative.nameMax).optional(),
13985
+ name: z17.string().max(META_LIMITS.creative.nameMax).optional(),
13944
13986
  /** Facebook Page id backing the ad's identity. */
13945
13987
  page_id: parentRefSchema2,
13946
13988
  /** Instagram account id for IG placements (aka instagram_actor_id on read). */
13947
- instagram_user_id: z16.string().regex(NUMERIC_ID_REGEX3).optional(),
13989
+ instagram_user_id: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
13948
13990
  /** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
13949
- url_tags: z16.string().max(1e3).optional(),
13991
+ url_tags: z17.string().max(1e3).optional(),
13950
13992
  enhancements: creativeEnhancementsSchema.optional()
13951
13993
  };
13952
13994
  var imageMediaFields = {
13953
- imageHash: z16.string().regex(IMAGE_HASH_REGEX).optional(),
13995
+ imageHash: z17.string().regex(IMAGE_HASH_REGEX).optional(),
13954
13996
  imageRef: tempRefSchema3.optional()
13955
13997
  };
13956
13998
  var videoMediaFields = {
13957
- videoId: z16.string().regex(NUMERIC_ID_REGEX3).optional(),
13999
+ videoId: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
13958
14000
  videoRef: tempRefSchema3.optional(),
13959
14001
  /** Thumbnail for a video creative — image hash, ref, or public url. */
13960
- thumbnailHash: z16.string().regex(IMAGE_HASH_REGEX).optional(),
13961
- imageUrl: z16.string().url().optional()
14002
+ thumbnailHash: z17.string().regex(IMAGE_HASH_REGEX).optional(),
14003
+ imageUrl: z17.string().url().optional()
13962
14004
  };
13963
14005
  function countImageRefs(p) {
13964
14006
  return [p.imageHash, p.imageRef].filter(Boolean).length;
@@ -13966,8 +14008,8 @@ function countImageRefs(p) {
13966
14008
  function countVideoRefs(p) {
13967
14009
  return [p.videoId, p.videoRef].filter(Boolean).length;
13968
14010
  }
13969
- var singleCreativeSchema = z16.object({
13970
- creativeType: z16.literal("single"),
14011
+ var singleCreativeSchema = z17.object({
14012
+ creativeType: z17.literal("single"),
13971
14013
  ...creativeSharedFields,
13972
14014
  /** Primary text. */
13973
14015
  message: messageSchema,
@@ -13976,7 +14018,7 @@ var singleCreativeSchema = z16.object({
13976
14018
  headline: headlineSchema2.optional(),
13977
14019
  description: descriptionSchema.optional(),
13978
14020
  /** Display URL / caption shown under the headline. */
13979
- caption: z16.string().max(255).optional(),
14021
+ caption: z17.string().max(255).optional(),
13980
14022
  call_to_action: callToActionSchema.optional(),
13981
14023
  ...imageMediaFields,
13982
14024
  ...videoMediaFields
@@ -14000,10 +14042,10 @@ var singleCreativeSchema = z16.object({
14000
14042
  });
14001
14043
  }
14002
14044
  });
14003
- var carouselCardSchema = z16.object({
14045
+ var carouselCardSchema = z17.object({
14004
14046
  link: httpsUrlSchema3,
14005
- headline: z16.string().max(META_LIMITS.creative.headlineMax).optional(),
14006
- description: z16.string().max(META_LIMITS.creative.descriptionMax).optional(),
14047
+ headline: z17.string().max(META_LIMITS.creative.headlineMax).optional(),
14048
+ description: z17.string().max(META_LIMITS.creative.descriptionMax).optional(),
14007
14049
  call_to_action: callToActionSchema.optional(),
14008
14050
  ...imageMediaFields,
14009
14051
  ...videoMediaFields
@@ -14023,35 +14065,35 @@ var carouselCardSchema = z16.object({
14023
14065
  ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
14024
14066
  }
14025
14067
  });
14026
- var carouselCreativeSchema2 = z16.object({
14027
- creativeType: z16.literal("carousel"),
14068
+ var carouselCreativeSchema2 = z17.object({
14069
+ creativeType: z17.literal("carousel"),
14028
14070
  ...creativeSharedFields,
14029
14071
  message: messageSchema,
14030
14072
  /** Optional "see more" card destination applied when a card has no own link. */
14031
14073
  link: httpsUrlSchema3.optional(),
14032
14074
  call_to_action: callToActionSchema.optional(),
14033
- cards: z16.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
14075
+ cards: z17.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
14034
14076
  });
14035
- var dynamicImageSchema = z16.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
14036
- var dynamicVideoSchema = z16.object({
14077
+ var dynamicImageSchema = z17.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
14078
+ var dynamicVideoSchema = z17.object({
14037
14079
  videoId: videoMediaFields.videoId,
14038
14080
  videoRef: videoMediaFields.videoRef,
14039
14081
  thumbnailHash: videoMediaFields.thumbnailHash
14040
14082
  }).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
14041
14083
  var DYN = META_LIMITS.creative;
14042
- var dynamicCreativeSchema = z16.object({
14043
- creativeType: z16.literal("dynamic"),
14084
+ var dynamicCreativeSchema = z17.object({
14085
+ creativeType: z17.literal("dynamic"),
14044
14086
  ...creativeSharedFields,
14045
- bodies: z16.array(z16.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
14046
- titles: z16.array(z16.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
14047
- descriptions: z16.array(z16.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
14048
- images: z16.array(dynamicImageSchema).optional(),
14049
- videos: z16.array(dynamicVideoSchema).optional(),
14050
- ad_formats: z16.array(z16.enum(AD_FORMATS2)).min(1),
14051
- call_to_action_types: z16.array(z16.enum(CTA_TYPES2)).optional(),
14052
- link_urls: z16.array(z16.object({ website_url: httpsUrlSchema3, display_url: z16.string().optional() })).min(1),
14087
+ bodies: z17.array(z17.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
14088
+ titles: z17.array(z17.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
14089
+ descriptions: z17.array(z17.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
14090
+ images: z17.array(dynamicImageSchema).optional(),
14091
+ videos: z17.array(dynamicVideoSchema).optional(),
14092
+ ad_formats: z17.array(z17.enum(AD_FORMATS2)).min(1),
14093
+ call_to_action_types: z17.array(z17.enum(CTA_TYPES2)).optional(),
14094
+ link_urls: z17.array(z17.object({ website_url: httpsUrlSchema3, display_url: z17.string().optional() })).min(1),
14053
14095
  /** Multi-language / placement customization — structural passthrough for v1. */
14054
- asset_customization_rules: z16.array(z16.record(z16.string(), z16.unknown())).optional()
14096
+ asset_customization_rules: z17.array(z17.record(z17.string(), z17.unknown())).optional()
14055
14097
  }).superRefine((p, ctx) => {
14056
14098
  if (!(p.images?.length || p.videos?.length)) {
14057
14099
  ctx.addIssue({
@@ -14061,57 +14103,57 @@ var dynamicCreativeSchema = z16.object({
14061
14103
  });
14062
14104
  }
14063
14105
  });
14064
- var existingPostCreativeSchema = z16.object({
14065
- creativeType: z16.literal("existing_post"),
14106
+ var existingPostCreativeSchema = z17.object({
14107
+ creativeType: z17.literal("existing_post"),
14066
14108
  name: creativeSharedFields.name,
14067
14109
  /** "<page_id>_<post_id>" object story id of the post to promote. */
14068
- object_story_id: z16.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
14110
+ object_story_id: z17.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
14069
14111
  instagram_user_id: creativeSharedFields.instagram_user_id,
14070
14112
  url_tags: creativeSharedFields.url_tags,
14071
14113
  enhancements: creativeSharedFields.enhancements
14072
14114
  });
14073
- var creativeContentSchema2 = z16.discriminatedUnion("creativeType", [
14115
+ var creativeContentSchema2 = z17.discriminatedUnion("creativeType", [
14074
14116
  singleCreativeSchema,
14075
14117
  carouselCreativeSchema2,
14076
14118
  dynamicCreativeSchema,
14077
14119
  existingPostCreativeSchema
14078
14120
  ]);
14079
14121
  var adCreativeCreateSchema = creativeContentSchema2;
14080
- var adCreativeUpdateSchema = z16.object({
14081
- name: z16.string().max(META_LIMITS.creative.nameMax).optional(),
14122
+ var adCreativeUpdateSchema = z17.object({
14123
+ name: z17.string().max(META_LIMITS.creative.nameMax).optional(),
14082
14124
  status: updateStatusSchema.optional(),
14083
14125
  /** Content patch — only honored when the target is a staged meta_temp_* creative. */
14084
- content: z16.record(z16.string(), z16.unknown()).optional()
14126
+ content: z17.record(z17.string(), z17.unknown()).optional()
14085
14127
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
14086
- var adCreateSchema2 = z16.object({
14087
- name: z16.string().min(1).max(META_LIMITS.ad.nameMax),
14128
+ var adCreateSchema2 = z17.object({
14129
+ name: z17.string().min(1).max(META_LIMITS.ad.nameMax),
14088
14130
  adset_id: parentRefSchema2,
14089
14131
  status: stageableStatusSchema3.default("PAUSED"),
14090
- creative: z16.object({ creative_id: parentRefSchema2 }),
14132
+ creative: z17.object({ creative_id: parentRefSchema2 }),
14091
14133
  /** Conversion pixel / offline event set / view tags — structural passthrough. */
14092
- tracking_specs: z16.array(z16.record(z16.string(), z16.unknown())).optional()
14134
+ tracking_specs: z17.array(z17.record(z17.string(), z17.unknown())).optional()
14093
14135
  });
14094
- var adUpdateSchema2 = z16.object({
14095
- name: z16.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
14136
+ var adUpdateSchema2 = z17.object({
14137
+ name: z17.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
14096
14138
  status: updateStatusSchema.optional(),
14097
14139
  /** Swapping the creative is the Meta way to "edit" an ad's creative. */
14098
- creative: z16.object({ creative_id: parentRefSchema2 }).optional(),
14099
- tracking_specs: z16.array(z16.record(z16.string(), z16.unknown())).optional()
14140
+ creative: z17.object({ creative_id: parentRefSchema2 }).optional(),
14141
+ tracking_specs: z17.array(z17.record(z17.string(), z17.unknown())).optional()
14100
14142
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
14101
- var lookalikeSpecSchema = z16.object({
14102
- origin: z16.array(z16.object({ id: parentRefSchema2 })).min(1),
14103
- ratio: z16.number().min(0.01).max(0.2).optional(),
14104
- country: z16.string().length(2).optional()
14105
- });
14106
- var customAudienceCreateSchema = z16.object({
14107
- name: z16.string().min(1).max(META_LIMITS.audience.nameMax),
14108
- subtype: z16.enum(CUSTOM_AUDIENCE_SUBTYPES),
14109
- description: z16.string().max(500).optional(),
14110
- customer_file_source: z16.string().optional(),
14111
- retention_days: z16.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
14143
+ var lookalikeSpecSchema = z17.object({
14144
+ origin: z17.array(z17.object({ id: parentRefSchema2 })).min(1),
14145
+ ratio: z17.number().min(0.01).max(0.2).optional(),
14146
+ country: z17.string().length(2).optional()
14147
+ });
14148
+ var customAudienceCreateSchema = z17.object({
14149
+ name: z17.string().min(1).max(META_LIMITS.audience.nameMax),
14150
+ subtype: z17.enum(CUSTOM_AUDIENCE_SUBTYPES),
14151
+ description: z17.string().max(500).optional(),
14152
+ customer_file_source: z17.string().optional(),
14153
+ retention_days: z17.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
14112
14154
  lookalike_spec: lookalikeSpecSchema.optional(),
14113
14155
  /** Website/engagement rule — structural passthrough validated by Meta. */
14114
- rule: z16.record(z16.string(), z16.unknown()).optional()
14156
+ rule: z17.record(z17.string(), z17.unknown()).optional()
14115
14157
  }).superRefine((p, ctx) => {
14116
14158
  if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
14117
14159
  ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
@@ -14120,16 +14162,16 @@ var customAudienceCreateSchema = z16.object({
14120
14162
  ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
14121
14163
  }
14122
14164
  });
14123
- var customAudienceUpdateSchema = z16.object({
14124
- name: z16.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
14125
- description: z16.string().max(500).optional()
14165
+ var customAudienceUpdateSchema = z17.object({
14166
+ name: z17.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
14167
+ description: z17.string().max(500).optional()
14126
14168
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
14127
- var mediaUploadSchema = z16.object({
14128
- kind: z16.enum(MEDIA_KINDS),
14169
+ var mediaUploadSchema = z17.object({
14170
+ kind: z17.enum(MEDIA_KINDS),
14129
14171
  bakerImageId: bakerMediaIdSchema2.optional(),
14130
14172
  bakerVideoId: bakerMediaIdSchema2.optional(),
14131
14173
  /** Optional display name / filename hint. */
14132
- name: z16.string().max(255).optional()
14174
+ name: z17.string().max(255).optional()
14133
14175
  }).superRefine((p, ctx) => {
14134
14176
  if (p.kind === "image" && !p.bakerImageId) {
14135
14177
  ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
@@ -14151,16 +14193,16 @@ var META_DRAFT_OP_KINDS = [
14151
14193
  "customAudience.update",
14152
14194
  "media.upload"
14153
14195
  ];
14154
- var metaDraftOpKindSchema = z16.enum(META_DRAFT_OP_KINDS);
14155
- var accountIdSchema2 = z16.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
14156
- var updateTargetSchema2 = z16.union([z16.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
14196
+ var metaDraftOpKindSchema = z17.enum(META_DRAFT_OP_KINDS);
14197
+ var accountIdSchema2 = z17.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
14198
+ var updateTargetSchema2 = z17.union([z17.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
14157
14199
  function createOp3(kind, payload) {
14158
- return z16.object({ kind: z16.literal(kind), accountId: accountIdSchema2, payload });
14200
+ return z17.object({ kind: z17.literal(kind), accountId: accountIdSchema2, payload });
14159
14201
  }
14160
14202
  function updateOp3(kind, payload) {
14161
- return z16.object({ kind: z16.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
14203
+ return z17.object({ kind: z17.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
14162
14204
  }
14163
- var metaDraftOpInputSchema = z16.discriminatedUnion("kind", [
14205
+ var metaDraftOpInputSchema = z17.discriminatedUnion("kind", [
14164
14206
  createOp3("campaign.create", campaignCreateSchema3),
14165
14207
  updateOp3("campaign.update", campaignUpdateSchema3),
14166
14208
  createOp3("adSet.create", adSetCreateSchema),
@@ -14175,89 +14217,89 @@ var metaDraftOpInputSchema = z16.discriminatedUnion("kind", [
14175
14217
  ]);
14176
14218
 
14177
14219
  // ../api/src/ads-meta/wire.ts
14178
- import { z as z17 } from "zod";
14179
- var metaWriteModeSchema = z17.enum(["live", "simulated"]);
14180
- var metaDraftOpResultSchema = z17.object({
14181
- status: z17.enum(["applied", "simulated", "failed", "skipped"]),
14220
+ import { z as z18 } from "zod";
14221
+ var metaWriteModeSchema = z18.enum(["live", "simulated"]);
14222
+ var metaDraftOpResultSchema = z18.object({
14223
+ status: z18.enum(["applied", "simulated", "failed", "skipped"]),
14182
14224
  /** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
14183
- id: z17.string().optional(),
14225
+ id: z18.string().optional(),
14184
14226
  /** For media.upload ops: the resulting image hash. */
14185
- hash: z17.string().optional(),
14186
- error: z17.string().optional(),
14187
- skippedBecause: z17.string().optional(),
14188
- executedAt: z17.number().optional()
14227
+ hash: z18.string().optional(),
14228
+ error: z18.string().optional(),
14229
+ skippedBecause: z18.string().optional(),
14230
+ executedAt: z18.number().optional()
14189
14231
  });
14190
- var metaDraftStageRequestSchema = z17.object({
14191
- chatId: z17.string(),
14232
+ var metaDraftStageRequestSchema = z18.object({
14233
+ chatId: z18.string(),
14192
14234
  op: metaDraftOpInputSchema
14193
14235
  });
14194
- var metaDraftStageResponseSchema = z17.object({
14195
- staged: z17.literal(true),
14196
- ref: z17.string(),
14236
+ var metaDraftStageResponseSchema = z18.object({
14237
+ staged: z18.literal(true),
14238
+ ref: z18.string(),
14197
14239
  kind: metaDraftOpKindSchema,
14198
14240
  mode: metaWriteModeSchema,
14199
- dependsOn: z17.array(z17.string()),
14200
- summary: z17.string(),
14201
- warnings: z17.array(z17.string()),
14241
+ dependsOn: z18.array(z18.string()),
14242
+ summary: z18.string(),
14243
+ warnings: z18.array(z18.string()),
14202
14244
  /** True when the op amended an already-staged op in place instead of appending a new one. */
14203
- amended: z17.boolean().optional()
14204
- });
14205
- var metaDraftDuplicateRequestSchema = z17.object({
14206
- chatId: z17.string(),
14207
- accountId: z17.string(),
14208
- entity: z17.enum(["campaign", "adSet", "ad"]),
14209
- sourceId: z17.string(),
14210
- overrides: z17.record(z17.string(), z17.unknown()).optional(),
14245
+ amended: z18.boolean().optional()
14246
+ });
14247
+ var metaDraftDuplicateRequestSchema = z18.object({
14248
+ chatId: z18.string(),
14249
+ accountId: z18.string(),
14250
+ entity: z18.enum(["campaign", "adSet", "ad"]),
14251
+ sourceId: z18.string(),
14252
+ overrides: z18.record(z18.string(), z18.unknown()).optional(),
14211
14253
  /** Pause the original after the copy publishes. */
14212
- replace: z17.boolean().optional()
14254
+ replace: z18.boolean().optional()
14213
14255
  });
14214
- var metaDraftOpViewSchema = z17.object({
14215
- ref: z17.string(),
14256
+ var metaDraftOpViewSchema = z18.object({
14257
+ ref: z18.string(),
14216
14258
  kind: metaDraftOpKindSchema,
14217
- accountId: z17.string(),
14218
- target: z17.string().optional(),
14219
- dependsOn: z17.array(z17.string()),
14220
- summary: z17.string(),
14221
- stagedAt: z17.number(),
14259
+ accountId: z18.string(),
14260
+ target: z18.string().optional(),
14261
+ dependsOn: z18.array(z18.string()),
14262
+ summary: z18.string(),
14263
+ stagedAt: z18.number(),
14222
14264
  result: metaDraftOpResultSchema.optional()
14223
14265
  });
14224
- var metaDraftListRequestSchema = z17.object({
14225
- chatId: z17.string()
14266
+ var metaDraftListRequestSchema = z18.object({
14267
+ chatId: z18.string()
14226
14268
  });
14227
- var metaDraftAdvisorySchema = z17.object({
14228
- ref: z17.string(),
14229
- message: z17.string()
14269
+ var metaDraftAdvisorySchema = z18.object({
14270
+ ref: z18.string(),
14271
+ message: z18.string()
14230
14272
  });
14231
- var metaDraftListResponseSchema = z17.object({
14232
- status: z17.enum(["active", "publishing", "applied", "discarded", "none"]),
14273
+ var metaDraftListResponseSchema = z18.object({
14274
+ status: z18.enum(["active", "publishing", "applied", "discarded", "none"]),
14233
14275
  mode: metaWriteModeSchema,
14234
- count: z17.number(),
14235
- ops: z17.array(metaDraftOpViewSchema),
14276
+ count: z18.number(),
14277
+ ops: z18.array(metaDraftOpViewSchema),
14236
14278
  /** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
14237
- advisories: z17.array(metaDraftAdvisorySchema)
14279
+ advisories: z18.array(metaDraftAdvisorySchema)
14238
14280
  });
14239
- var metaDraftRemoveRequestSchema = z17.object({
14240
- chatId: z17.string(),
14241
- ref: z17.string()
14281
+ var metaDraftRemoveRequestSchema = z18.object({
14282
+ chatId: z18.string(),
14283
+ ref: z18.string()
14242
14284
  });
14243
- var metaDraftRemoveResponseSchema = z17.object({
14285
+ var metaDraftRemoveResponseSchema = z18.object({
14244
14286
  /** The requested ref plus any dependents removed by cascade. */
14245
- removed: z17.array(z17.string())
14287
+ removed: z18.array(z18.string())
14246
14288
  });
14247
- var metaDraftClearRequestSchema = z17.object({
14248
- chatId: z17.string()
14289
+ var metaDraftClearRequestSchema = z18.object({
14290
+ chatId: z18.string()
14249
14291
  });
14250
- var metaDraftClearResponseSchema = z17.object({
14251
- cleared: z17.number()
14292
+ var metaDraftClearResponseSchema = z18.object({
14293
+ cleared: z18.number()
14252
14294
  });
14253
- var metaFieldErrorSchema = z17.object({
14254
- path: z17.string(),
14255
- message: z17.string()
14295
+ var metaFieldErrorSchema = z18.object({
14296
+ path: z18.string(),
14297
+ message: z18.string()
14256
14298
  });
14257
- var metaDraftErrorResponseSchema = z17.object({
14258
- code: z17.string(),
14259
- error: z17.string(),
14260
- fields: z17.array(metaFieldErrorSchema).optional()
14299
+ var metaDraftErrorResponseSchema = z18.object({
14300
+ code: z18.string(),
14301
+ error: z18.string(),
14302
+ fields: z18.array(metaFieldErrorSchema).optional()
14261
14303
  });
14262
14304
 
14263
14305
  // src/commands/ads/meta/write-shared.ts
@@ -18137,7 +18179,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
18137
18179
  import { toCardinal as nwNl } from "n2words/nl-NL";
18138
18180
  import { toCardinal as nwPl } from "n2words/pl-PL";
18139
18181
  import { toCardinal as nwPt } from "n2words/pt-PT";
18140
- import { z as z18 } from "zod";
18182
+ import { z as z19 } from "zod";
18141
18183
 
18142
18184
  // src/engine/scaffold/lib/shoot-modes.ts
18143
18185
  var SHOOT_MODES = [
@@ -18473,71 +18515,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
18473
18515
  "{{out.video}}"
18474
18516
  ];
18475
18517
  }
18476
- var FrameAsset = z18.object({ url: z18.string().optional() }).loose().optional();
18477
- var DialogueLine = z18.object({
18478
- speaker: z18.string().optional(),
18479
- line: z18.string().optional(),
18518
+ var FrameAsset = z19.object({ url: z19.string().optional() }).loose().optional();
18519
+ var DialogueLine = z19.object({
18520
+ speaker: z19.string().optional(),
18521
+ line: z19.string().optional(),
18480
18522
  // Absolute seconds on the source timeline (the deconstruct emits both).
18481
- start_s: z18.number().optional(),
18482
- end_s: z18.number().optional(),
18483
- delivery: z18.string().optional(),
18484
- voice_description: z18.string().optional(),
18523
+ start_s: z19.number().optional(),
18524
+ end_s: z19.number().optional(),
18525
+ delivery: z19.string().optional(),
18526
+ voice_description: z19.string().optional(),
18485
18527
  // DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
18486
18528
  // presence alone can't answer that — a founder pictured in a polaroid close-up is
18487
18529
  // "present" yet the line is voiceover, and treating it as on-camera produced a
18488
18530
  // native Seedance lip-sync clip of a still photograph. `false` pins the line to
18489
18531
  // the VO path; absent keeps the presence-based decision (old blueprints).
18490
- on_camera: z18.boolean().optional()
18532
+ on_camera: z19.boolean().optional()
18491
18533
  }).loose();
18492
- var Sfx = z18.object({
18493
- at_s: z18.number().optional(),
18494
- duration_s: z18.number().optional(),
18495
- sound_effect_prompt: z18.string().optional(),
18496
- description: z18.string().optional()
18534
+ var Sfx = z19.object({
18535
+ at_s: z19.number().optional(),
18536
+ duration_s: z19.number().optional(),
18537
+ sound_effect_prompt: z19.string().optional(),
18538
+ description: z19.string().optional()
18497
18539
  }).loose();
18498
- var CompositionRegion = z18.object({
18540
+ var CompositionRegion = z19.object({
18499
18541
  // full | top | bottom | left | right | inset
18500
- panel: z18.string().optional(),
18542
+ panel: z19.string().optional(),
18501
18543
  // 9-grid anchor for an `inset` presenter box.
18502
- position: z18.string().optional(),
18503
- is_presenter: z18.boolean().optional(),
18544
+ position: z19.string().optional(),
18545
+ is_presenter: z19.boolean().optional(),
18504
18546
  // The cast id shown/speaking in this region (routes lip-sync + element refs).
18505
- cast_ref: z18.string().optional(),
18547
+ cast_ref: z19.string().optional(),
18506
18548
  // What the region's content IS: camera | screen_capture | static_graphic |
18507
18549
  // generated. Authoritative for routing when present (regex-over-prose fallback
18508
18550
  // otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
18509
18551
  // overlay layer, never AI-generated.
18510
- kind: z18.string().optional(),
18552
+ kind: z19.string().optional(),
18511
18553
  // Opaque id naming the SPECIFIC on-screen document/note/app-state this
18512
18554
  // screen_capture region shows. Two scenes share it only when they show the SAME
18513
18555
  // recording continuing (scrolling/typing/waiting within it) — a genuinely
18514
18556
  // DIFFERENT document/note/recording (a source video splicing two screen captures)
18515
18557
  // gets a different id. Breaks a persistent-layout run into separate surface stubs
18516
18558
  // instead of asking the operator for one screenshot that can't cover both.
18517
- surface_id: z18.string().optional(),
18559
+ surface_id: z19.string().optional(),
18518
18560
  // Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
18519
18561
  // presenter bubble inside a screen recording) — video-in-video the reproduction
18520
18562
  // must re-composite, not paint into the surface.
18521
- nested: z18.array(z18.object({}).loose()).optional(),
18522
- summary: z18.string().optional(),
18523
- frame_prompt: z18.string().optional(),
18524
- motion_prompt: z18.string().optional()
18563
+ nested: z19.array(z19.object({}).loose()).optional(),
18564
+ summary: z19.string().optional(),
18565
+ frame_prompt: z19.string().optional(),
18566
+ motion_prompt: z19.string().optional()
18525
18567
  }).loose();
18526
- var SceneComposition = z18.object({
18568
+ var SceneComposition = z19.object({
18527
18569
  // full_frame (default) | split_screen | pip | keyed_overlay
18528
- layout: z18.string().optional(),
18570
+ layout: z19.string().optional(),
18529
18571
  // split_screen only: vertical (top/bottom) | horizontal (left/right).
18530
- split_axis: z18.string().optional(),
18531
- regions: z18.array(CompositionRegion).optional()
18572
+ split_axis: z19.string().optional(),
18573
+ regions: z19.array(CompositionRegion).optional()
18532
18574
  }).loose();
18533
- var CameraMotion = z18.object({ movement: z18.string().optional(), detail: z18.string().optional() }).loose();
18534
- var TranscriptWord = z18.object({ text: z18.string().optional() }).loose();
18535
- var Scene = z18.object({
18536
- start_s: z18.number().optional(),
18537
- end_s: z18.number().optional(),
18538
- duration_s: z18.number().optional(),
18539
- summary: z18.string().optional(),
18540
- action_detail: z18.string().optional(),
18575
+ var CameraMotion = z19.object({ movement: z19.string().optional(), detail: z19.string().optional() }).loose();
18576
+ var TranscriptWord = z19.object({ text: z19.string().optional() }).loose();
18577
+ var Scene = z19.object({
18578
+ start_s: z19.number().optional(),
18579
+ end_s: z19.number().optional(),
18580
+ duration_s: z19.number().optional(),
18581
+ summary: z19.string().optional(),
18582
+ action_detail: z19.string().optional(),
18541
18583
  // The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
18542
18584
  // A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
18543
18585
  // builds one clip per region and stacks/overlays them into the scene picture.
@@ -18545,82 +18587,82 @@ var Scene = z18.object({
18545
18587
  // The capture "look" for this scene — selected from the ad-native shoot-mode
18546
18588
  // grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
18547
18589
  // UGC/product mode; a human can override per scene by setting this.
18548
- shoot_mode: z18.string().optional(),
18590
+ shoot_mode: z19.string().optional(),
18549
18591
  // Diegetic ambient the clip's native audio should carry (no music). When
18550
18592
  // absent the scene falls back to its shoot mode's default ambience.
18551
- ambient: z18.string().optional(),
18593
+ ambient: z19.string().optional(),
18552
18594
  camera_motion: CameraMotion.optional(),
18553
- start_frame_prompt: z18.string().optional(),
18554
- end_frame_prompt: z18.string().optional(),
18555
- motion_prompt: z18.string().optional(),
18595
+ start_frame_prompt: z19.string().optional(),
18596
+ end_frame_prompt: z19.string().optional(),
18597
+ motion_prompt: z19.string().optional(),
18556
18598
  // The scene's role in the ad's persuasion arc (DECON-supplied); drives the
18557
18599
  // script re-craft checklist. Inferred from position when absent.
18558
- narrative_role: z18.string().optional(),
18600
+ narrative_role: z19.string().optional(),
18559
18601
  // DECON-supplied on the HOOK scene: the engineered physical/emotional state that
18560
18602
  // makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
18561
18603
  // into the hook's start-frame description so the generator renders that state,
18562
18604
  // not a calm influencer (CCA-11).
18563
- hook_mechanic: z18.object({ mechanic: z18.string().optional(), why_it_stops_scroll: z18.string().optional() }).loose().optional(),
18605
+ hook_mechanic: z19.object({ mechanic: z19.string().optional(), why_it_stops_scroll: z19.string().optional() }).loose().optional(),
18564
18606
  // DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
18565
- scene_setting: z18.string().optional(),
18607
+ scene_setting: z19.string().optional(),
18566
18608
  // How this scene cuts to the next (DECON-supplied). A recognized non-cut type
18567
18609
  // (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
18568
18610
  // boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
18569
18611
  // ignored (nothing follows it).
18570
- transition_out: z18.object({ type: z18.string().optional(), description: z18.string().optional() }).loose().optional(),
18571
- dialogue: z18.array(DialogueLine).optional(),
18572
- sfx: z18.array(Sfx).optional(),
18573
- overlays: z18.array(z18.unknown()).optional(),
18574
- floating_elements: z18.array(z18.unknown()).optional(),
18612
+ transition_out: z19.object({ type: z19.string().optional(), description: z19.string().optional() }).loose().optional(),
18613
+ dialogue: z19.array(DialogueLine).optional(),
18614
+ sfx: z19.array(Sfx).optional(),
18615
+ overlays: z19.array(z19.unknown()).optional(),
18616
+ floating_elements: z19.array(z19.unknown()).optional(),
18575
18617
  // DECON-supplied: how much the picture itself moves within the shot. Gates the
18576
18618
  // flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
18577
18619
  // (pouring, spreading, hands working) must stay a real clip; freezing it turns
18578
18620
  // a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
18579
- motion_level: z18.enum(["static", "subtle", "dynamic"]).optional(),
18580
- transcript_slice: z18.array(TranscriptWord).optional(),
18621
+ motion_level: z19.enum(["static", "subtle", "dynamic"]).optional(),
18622
+ transcript_slice: z19.array(TranscriptWord).optional(),
18581
18623
  start_frame_asset: FrameAsset,
18582
18624
  end_frame_asset: FrameAsset,
18583
18625
  // DECON-supplied: true when this scene is a length-split CONTINUATION of the
18584
18626
  // previous one (the SAME physical shot, broken up only because it exceeded the
18585
18627
  // clip ceiling). The scaffold then shares the splice keyframe — this scene's
18586
18628
  // start frame IS the previous scene's end frame — so the join is seamless.
18587
- continues_previous: z18.boolean().optional()
18629
+ continues_previous: z19.boolean().optional()
18588
18630
  }).loose();
18589
- var VideoBlueprint = z18.object({
18590
- source: z18.object({ aspect_ratio: z18.string().optional(), duration_s: z18.number().optional() }).loose().optional(),
18591
- global: z18.object({
18592
- music: z18.object({
18593
- present: z18.boolean().optional(),
18594
- music_prompt: z18.string().optional(),
18631
+ var VideoBlueprint = z19.object({
18632
+ source: z19.object({ aspect_ratio: z19.string().optional(), duration_s: z19.number().optional() }).loose().optional(),
18633
+ global: z19.object({
18634
+ music: z19.object({
18635
+ present: z19.boolean().optional(),
18636
+ music_prompt: z19.string().optional(),
18595
18637
  // Absolute second the music enters in the reference (the bed often
18596
18638
  // kicks in mid-ad, after the hook). We start the regenerated track here
18597
18639
  // instead of at 0 so the timing matches.
18598
- starts_at_s: z18.number().optional(),
18640
+ starts_at_s: z19.number().optional(),
18599
18641
  // Populated by the deconstruct when AudD (Shazam-style) recognizes the
18600
18642
  // reference track. We never reuse it — only style the regenerated bed.
18601
- identified_track: z18.object({ title: z18.string().optional(), artist: z18.string().optional() }).loose().nullish()
18643
+ identified_track: z19.object({ title: z19.string().optional(), artist: z19.string().optional() }).loose().nullish()
18602
18644
  }).loose().optional(),
18603
- cast: z18.array(
18604
- z18.object({
18605
- id: z18.string().optional(),
18606
- description: z18.string().optional(),
18645
+ cast: z19.array(
18646
+ z19.object({
18647
+ id: z19.string().optional(),
18648
+ description: z19.string().optional(),
18607
18649
  // The deconstruct's note on the target-market localization (e.g. "native
18608
18650
  // French speaker") — read to derive the spoken-track language code.
18609
- market_localization_note: z18.string().optional()
18651
+ market_localization_note: z19.string().optional()
18610
18652
  }).loose()
18611
18653
  ).optional(),
18612
- voiceover: z18.object({
18654
+ voiceover: z19.object({
18613
18655
  // on_camera | mixed → mouths are on screen (lip-sync candidates);
18614
18656
  // voiceover | none → narration over the picture (no lip-sync).
18615
- mode: z18.string().optional(),
18616
- voice_description: z18.string().optional(),
18617
- persona: z18.string().optional()
18657
+ mode: z19.string().optional(),
18658
+ voice_description: z19.string().optional(),
18659
+ persona: z19.string().optional()
18618
18660
  }).loose().optional(),
18619
18661
  // Visual palette — read only to colour a clean brand-card/CTA plate (the
18620
18662
  // first hex is the dominant brand colour); never to drive frame generation.
18621
- style: z18.object({ palette: z18.array(z18.object({ hex: z18.string().optional() }).loose()).optional() }).loose().optional()
18663
+ style: z19.object({ palette: z19.array(z19.object({ hex: z19.string().optional() }).loose()).optional() }).loose().optional()
18622
18664
  }).loose().optional(),
18623
- scenes: z18.array(Scene).min(1)
18665
+ scenes: z19.array(Scene).min(1)
18624
18666
  }).loose();
18625
18667
  function injectHookPhysicality(blueprint) {
18626
18668
  for (const scene of blueprint.scenes) {
@@ -18637,26 +18679,26 @@ function clipIntentOf(scene, sceneIndex) {
18637
18679
  if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
18638
18680
  return "body";
18639
18681
  }
18640
- var AppearsItem = z18.union([z18.number(), z18.object({ scene: z18.number(), edge: z18.string().optional() }).loose()]);
18641
- var RecurringElement = z18.object({
18682
+ var AppearsItem = z19.union([z19.number(), z19.object({ scene: z19.number(), edge: z19.string().optional() }).loose()]);
18683
+ var RecurringElement = z19.object({
18642
18684
  // person | animal | product | logo | badge | other
18643
- type: z18.string(),
18644
- label: z18.string().optional(),
18645
- description: z18.string().optional(),
18646
- expression: z18.string().nullable().optional(),
18685
+ type: z19.string(),
18686
+ label: z19.string().optional(),
18687
+ description: z19.string().optional(),
18688
+ expression: z19.string().nullable().optional(),
18647
18689
  // When the element maps to a global cast entry, its stable id (for annotation).
18648
- cast_id: z18.string().nullable().optional(),
18690
+ cast_id: z19.string().nullable().optional(),
18649
18691
  // The label of another element that is the SAME individual as this one, shown
18650
18692
  // in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
18651
18693
  // pink shirt and believer in a white shirt). Each look gets its own reference
18652
18694
  // slot, but the face/identity must stay identical across them.
18653
- same_as: z18.string().nullable().optional(),
18695
+ same_as: z19.string().nullable().optional(),
18654
18696
  // Scenes the element appears in. Either a bare list of scene indices (both
18655
18697
  // edges) or per-{scene,edge} entries. Both forms are accepted and merged.
18656
- scenes: z18.array(z18.number()).optional(),
18657
- appears_in: z18.array(AppearsItem).optional()
18698
+ scenes: z19.array(z19.number()).optional(),
18699
+ appears_in: z19.array(AppearsItem).optional()
18658
18700
  }).loose();
18659
- var RecurringElements = z18.array(RecurringElement);
18701
+ var RecurringElements = z19.array(RecurringElement);
18660
18702
  function sanitizeId(raw, fallback) {
18661
18703
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
18662
18704
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -19131,7 +19173,7 @@ function scrubFloatSentences(text, floatDescs) {
19131
19173
  return kept;
19132
19174
  }
19133
19175
  function sceneFloatDescs(scene) {
19134
- const floats = z18.array(FloatingElement).safeParse(scene.floating_elements ?? []);
19176
+ const floats = z19.array(FloatingElement).safeParse(scene.floating_elements ?? []);
19135
19177
  if (!floats.success) return [];
19136
19178
  return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
19137
19179
  }
@@ -20555,25 +20597,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
20555
20597
  }
20556
20598
  return tracks;
20557
20599
  }
20558
- var OverlayStyle = z18.object({ color_hex: z18.string().optional(), background: z18.string().optional(), size: z18.string().optional() }).loose();
20559
- var Overlay = z18.object({
20560
- text: z18.string().optional(),
20561
- appears_at_s: z18.number().optional(),
20562
- duration_s: z18.number().optional(),
20563
- position: z18.string().optional(),
20564
- role: z18.string().optional(),
20565
- animation: z18.string().optional(),
20566
- animation_detail: z18.string().optional(),
20600
+ var OverlayStyle = z19.object({ color_hex: z19.string().optional(), background: z19.string().optional(), size: z19.string().optional() }).loose();
20601
+ var Overlay = z19.object({
20602
+ text: z19.string().optional(),
20603
+ appears_at_s: z19.number().optional(),
20604
+ duration_s: z19.number().optional(),
20605
+ position: z19.string().optional(),
20606
+ role: z19.string().optional(),
20607
+ animation: z19.string().optional(),
20608
+ animation_detail: z19.string().optional(),
20567
20609
  style: OverlayStyle.optional()
20568
20610
  }).loose();
20569
- var FloatingElement = z18.object({
20570
- kind: z18.string().optional(),
20571
- description: z18.string().optional(),
20572
- brand_name: z18.string().nullish(),
20573
- what_it_represents: z18.string().optional(),
20574
- appears_at_s: z18.number().optional(),
20575
- duration_s: z18.number().optional(),
20576
- position: z18.string().optional()
20611
+ var FloatingElement = z19.object({
20612
+ kind: z19.string().optional(),
20613
+ description: z19.string().optional(),
20614
+ brand_name: z19.string().nullish(),
20615
+ what_it_represents: z19.string().optional(),
20616
+ appears_at_s: z19.number().optional(),
20617
+ duration_s: z19.number().optional(),
20618
+ position: z19.string().optional()
20577
20619
  }).loose();
20578
20620
  function escapeHtml(s) {
20579
20621
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
@@ -20605,7 +20647,7 @@ function positionClass(position) {
20605
20647
  function collectCaptions(blueprint, clock) {
20606
20648
  return blueprint.scenes.flatMap((scene, i) => {
20607
20649
  const sceneStart = scene.start_s ?? 0;
20608
- const overlays = z18.array(Overlay).safeParse(scene.overlays ?? []);
20650
+ const overlays = z19.array(Overlay).safeParse(scene.overlays ?? []);
20609
20651
  return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
20610
20652
  const at = clock.map(i, ov.appears_at_s ?? sceneStart);
20611
20653
  return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
@@ -20685,7 +20727,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
20685
20727
  const windows = /* @__PURE__ */ new Map();
20686
20728
  blueprint.scenes.forEach((scene, i) => {
20687
20729
  const sceneStart = scene.start_s ?? 0;
20688
- const floats = z18.array(FloatingElement).safeParse(scene.floating_elements ?? []);
20730
+ const floats = z19.array(FloatingElement).safeParse(scene.floating_elements ?? []);
20689
20731
  if (!floats.success) return;
20690
20732
  for (const fe of floats.data) {
20691
20733
  const at = clock.map(i, fe.appears_at_s ?? sceneStart);
@@ -21133,8 +21175,8 @@ function buildMotionBoard(blueprint) {
21133
21175
  const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
21134
21176
  cursor = end_s;
21135
21177
  const spoken = sceneSpokenText(scene);
21136
- const overlays = z18.array(Overlay).safeParse(scene.overlays ?? []);
21137
- const floats = z18.array(FloatingElement).safeParse(scene.floating_elements ?? []);
21178
+ const overlays = z19.array(Overlay).safeParse(scene.overlays ?? []);
21179
+ const floats = z19.array(FloatingElement).safeParse(scene.floating_elements ?? []);
21138
21180
  const graphics = [
21139
21181
  ...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
21140
21182
  kind: "text",
@@ -22573,7 +22615,7 @@ import path18 from "path";
22573
22615
  import { defineCommand as defineCommand95 } from "citty";
22574
22616
 
22575
22617
  // src/engine/scaffold/staticAd.ts
22576
- import { z as z19 } from "zod";
22618
+ import { z as z20 } from "zod";
22577
22619
  var GEN_ASPECT_RATIOS = /* @__PURE__ */ new Set(["1:1", "4:5", "9:16", "16:9", "4:3", "3:4", "2:3", "3:2", "21:9"]);
22578
22620
  var DEFAULT_ASPECT_RATIO = "9:16";
22579
22621
  var SHEET_SUBJECT_TYPE2 = {
@@ -22585,24 +22627,24 @@ var ACTOR_SHEET_IMAGE_SIZE = "4K";
22585
22627
  var ADAPT_MODEL = "google/gemini-3-pro-image-preview";
22586
22628
  var ADAPT_IMAGE_SIZE = "2K";
22587
22629
  var ADAPT_GUIDANCE = "Keep the headline, logo, CTA, and hero subject fully visible in every ratio. Reproduce every text string verbatim \u2014 no dropped, added, or altered characters \u2014 and preserve the exact brand-color treatment (e.g. a black\u2192red word pivot), never flattening it.";
22588
- var Blueprint = z19.object({
22589
- meta: z19.object({ estimated_aspect_ratio: z19.string().optional() }).loose().optional(),
22590
- text_content: z19.array(z19.object({ text: z19.string().optional() }).loose()).optional()
22630
+ var Blueprint = z20.object({
22631
+ meta: z20.object({ estimated_aspect_ratio: z20.string().optional() }).loose().optional(),
22632
+ text_content: z20.array(z20.object({ text: z20.string().optional() }).loose()).optional()
22591
22633
  }).loose();
22592
- var ElementLocator = z19.object({
22593
- collection: z19.enum(["subjects", "people", "brands_logos"]),
22594
- index: z19.number().int().nonnegative()
22634
+ var ElementLocator = z20.object({
22635
+ collection: z20.enum(["subjects", "people", "brands_logos"]),
22636
+ index: z20.number().int().nonnegative()
22595
22637
  }).loose();
22596
- var MainElement = z19.object({
22638
+ var MainElement = z20.object({
22597
22639
  // logo | product | person | animal | badge | other
22598
- type: z19.string(),
22599
- label: z19.string().optional(),
22600
- description: z19.string().optional(),
22601
- expression: z19.string().nullable().optional(),
22602
- reason: z19.string().optional(),
22640
+ type: z20.string(),
22641
+ label: z20.string().optional(),
22642
+ description: z20.string().optional(),
22643
+ expression: z20.string().nullable().optional(),
22644
+ reason: z20.string().optional(),
22603
22645
  locator: ElementLocator.optional()
22604
22646
  }).loose();
22605
- var MainElements = z19.array(MainElement);
22647
+ var MainElements = z20.array(MainElement);
22606
22648
  function sanitizeId2(raw, fallback) {
22607
22649
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
22608
22650
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -29162,7 +29204,24 @@ function parseBrandMd(brandMd, fonts, colors) {
29162
29204
  if (named) for (const n of named) fonts.add(n.slice(1, -1).trim().toLowerCase());
29163
29205
  }
29164
29206
  }
29207
+ function brandTokensFromCanonical(tokens) {
29208
+ const fonts = new Set(tokens.fonts.map((f) => f.family.toLowerCase()));
29209
+ const colors = [];
29210
+ for (const color of tokens.colors) {
29211
+ const parsed = parseColor2(color.value);
29212
+ if (parsed) colors.push(parsed);
29213
+ }
29214
+ return { fonts, colors, hasTokens: fonts.size > 0 || colors.length > 0 };
29215
+ }
29165
29216
  async function loadBrandTokens(projectRoot) {
29217
+ const tokensRaw = await safeRead(path24.join(projectRoot, "src", "brand", "tokens.json"));
29218
+ if (tokensRaw) {
29219
+ try {
29220
+ const canonical2 = brandTokensSchema.safeParse(JSON.parse(tokensRaw));
29221
+ if (canonical2.success) return brandTokensFromCanonical(canonical2.data);
29222
+ } catch {
29223
+ }
29224
+ }
29166
29225
  const globalCss = await safeRead(path24.join(projectRoot, "src", "styles", "global.css"));
29167
29226
  const brandMd = await safeRead(path24.join(projectRoot, "src", "brand", "BRAND.md"));
29168
29227
  if (!globalCss && !brandMd) return EMPTY;