@koda-sl/baker-cli 0.163.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";
@@ -4489,7 +4531,13 @@ var GOOGLE_ADS_LIMITS = {
4489
4531
  campaign: {
4490
4532
  nameMax: 255,
4491
4533
  /** `campaign.final_url_suffix` — the query string appended to every final URL under the campaign. */
4492
- finalUrlSuffixMax: 2048
4534
+ finalUrlSuffixMax: 2048,
4535
+ /** `campaign.tracking_url_template` — the click-measurement URL every ad routes through. */
4536
+ trackingUrlTemplateMax: 2048,
4537
+ /** `campaign.url_custom_parameters` — Google caps a single entity at 8 `{_name}` parameters. */
4538
+ urlCustomParametersMax: 8,
4539
+ urlCustomParameterKeyMax: 16,
4540
+ urlCustomParameterValueMax: 250
4493
4541
  },
4494
4542
  adGroup: {
4495
4543
  nameMax: 255
@@ -4609,6 +4657,8 @@ var BIDDING_STRATEGY_TYPES = [
4609
4657
  "MANUAL_CPV",
4610
4658
  "PERCENT_CPC"
4611
4659
  ];
4660
+ var POSITIVE_GEO_TARGET_TYPES = ["PRESENCE_OR_INTEREST", "PRESENCE"];
4661
+ var NEGATIVE_GEO_TARGET_TYPES = ["PRESENCE_OR_INTEREST", "PRESENCE"];
4612
4662
  var BUDGET_DELIVERY_METHODS = ["STANDARD", "ACCELERATED"];
4613
4663
  var AD_GROUP_TYPES = [
4614
4664
  "SEARCH_STANDARD",
@@ -4690,38 +4740,55 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
4690
4740
  var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
4691
4741
 
4692
4742
  // ../api/src/ads-google/ops.ts
4693
- import { z as z13 } from "zod";
4694
- var tempRefSchema2 = z13.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
4695
- var refSchema = z13.union([
4696
- z13.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
4697
- 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"),
4698
4748
  tempRefSchema2
4699
4749
  ]);
4700
4750
  var targetRefSchema = refSchema;
4701
- var microsSchema = z13.number().int().positive("expected a positive micros amount");
4702
- var httpsUrlSchema2 = z13.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
4703
- var customerIdSchema = z13.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
4704
- var stageableStatusSchema2 = z13.enum(STAGEABLE_CREATE_STATUSES2);
4705
- var matchTypeSchema = z13.enum(KEYWORD_MATCH_TYPES);
4706
- 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"');
4707
- 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");
4708
- var budgetCreateSchema = z13.object({
4709
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
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"');
4757
+ var LANDING_PAGE_TAGS = ["{lpurl}", "{unescapedlpurl}", "{escapedlpurl}", "{lpurl+2}", "{lpurl+3}"];
4758
+ var trackingUrlTemplateSchema = z14.string().max(GOOGLE_ADS_LIMITS.campaign.trackingUrlTemplateMax).refine((t) => !/\s/.test(t), "a tracking template cannot contain whitespace").refine(
4759
+ (t) => t === "" || LANDING_PAGE_TAGS.some((tag) => t.includes(tag)),
4760
+ `a tracking template must carry the landing page through one of ${LANDING_PAGE_TAGS.join(", ")}, e.g. "https://tracker.example/?url={lpurl}"`
4761
+ ).refine(
4762
+ (t) => t === "" || /^(https?:\/\/|\{)/.test(t),
4763
+ "a tracking template must start with http://, https:// or a {lpurl} tag"
4764
+ );
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)
4769
+ })
4770
+ ).max(GOOGLE_ADS_LIMITS.campaign.urlCustomParametersMax).refine(
4771
+ (params) => new Set(params.map((p) => p.key)).size === params.length,
4772
+ "each custom parameter key can appear only once"
4773
+ );
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),
4710
4777
  amountMicros: microsSchema,
4711
- deliveryMethod: z13.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4712
- explicitlyShared: z13.boolean().default(false)
4778
+ deliveryMethod: z14.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
4779
+ explicitlyShared: z14.boolean().default(false)
4713
4780
  });
4714
- var budgetUpdateSchema = z13.object({
4715
- 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(),
4716
4783
  amountMicros: microsSchema.optional(),
4717
- deliveryMethod: z13.enum(BUDGET_DELIVERY_METHODS).optional()
4784
+ deliveryMethod: z14.enum(BUDGET_DELIVERY_METHODS).optional()
4718
4785
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4719
- var biddingConfigSchema = z13.object({
4720
- type: z13.enum(BIDDING_STRATEGY_TYPES),
4786
+ var biddingConfigSchema = z14.object({
4787
+ type: z14.enum(BIDDING_STRATEGY_TYPES),
4721
4788
  targetCpaMicros: microsSchema.optional(),
4722
- targetRoas: z13.number().positive().optional(),
4789
+ targetRoas: z14.number().positive().optional(),
4723
4790
  cpcBidCeilingMicros: microsSchema.optional(),
4724
- enhancedCpcEnabled: z13.boolean().optional()
4791
+ enhancedCpcEnabled: z14.boolean().optional()
4725
4792
  }).superRefine((p, ctx) => {
4726
4793
  if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
4727
4794
  ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
@@ -4730,33 +4797,49 @@ var biddingConfigSchema = z13.object({
4730
4797
  ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
4731
4798
  }
4732
4799
  });
4733
- var networkSettingsSchema = z13.object({
4734
- targetGoogleSearch: z13.boolean().optional(),
4735
- targetSearchNetwork: z13.boolean().optional(),
4736
- targetContentNetwork: z13.boolean().optional(),
4737
- 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()
4738
4805
  });
4739
- var dateSchema = z13.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
4740
- var campaignCreateSchema2 = z13.object({
4741
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
4742
- channelType: z13.enum(ADVERTISING_CHANNEL_TYPES),
4743
- channelSubType: z13.enum(ADVERTISING_CHANNEL_SUB_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()
4810
+ }).refine(
4811
+ (p) => p.positiveGeoTargetType !== void 0 || p.negativeGeoTargetType !== void 0,
4812
+ "geoTargetTypeSetting needs positiveGeoTargetType and/or negativeGeoTargetType"
4813
+ );
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(),
4744
4818
  budget: refSchema,
4745
4819
  /** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
4746
4820
  bidding: biddingConfigSchema.optional(),
4747
4821
  biddingStrategy: refSchema.optional(),
4748
4822
  networkSettings: networkSettingsSchema.optional(),
4823
+ /**
4824
+ * "Location options". Omitted stages Google's own default — reach people *in or interested in*
4825
+ * the targeted locations — so pass `PRESENCE` explicitly when only people physically there count.
4826
+ */
4827
+ geoTargetTypeSetting: geoTargetTypeSettingSchema.optional(),
4749
4828
  startDate: dateSchema.optional(),
4750
4829
  endDate: dateSchema.optional(),
4751
4830
  /** Campaign-level override of the account's final URL suffix — REPLACES it, never merges. */
4752
4831
  finalUrlSuffix: finalUrlSuffixSchema.optional(),
4832
+ /** Campaign-level override of the account's tracking template — REPLACES it, never merges. */
4833
+ trackingUrlTemplate: trackingUrlTemplateSchema.optional(),
4834
+ /** The `{_name}` parameters this campaign's tracking template and final URLs can reference. */
4835
+ urlCustomParameters: urlCustomParametersSchema.optional(),
4753
4836
  /** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
4754
- objective: z13.enum(CAMPAIGN_OBJECTIVES).optional(),
4837
+ objective: z14.enum(CAMPAIGN_OBJECTIVES).optional(),
4755
4838
  /**
4756
4839
  * Whether the campaign contains EU political advertising. Google requires the declaration on
4757
4840
  * every campaign create (FieldError.REQUIRED without it); omitted means it does not.
4758
4841
  */
4759
- euPoliticalAds: z13.boolean().optional(),
4842
+ euPoliticalAds: z14.boolean().optional(),
4760
4843
  status: stageableStatusSchema2.default("PAUSED")
4761
4844
  }).superRefine((p, ctx) => {
4762
4845
  if (!p.bidding && !p.biddingStrategy) {
@@ -4780,140 +4863,146 @@ var campaignCreateSchema2 = z13.object({
4780
4863
  ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
4781
4864
  }
4782
4865
  });
4783
- var campaignUpdateSchema2 = z13.object({
4784
- 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(),
4785
4868
  budget: refSchema.optional(),
4786
4869
  bidding: biddingConfigSchema.optional(),
4787
4870
  networkSettings: networkSettingsSchema.optional(),
4871
+ /** Switches an existing campaign between "Presence or interest" and "Presence". */
4872
+ geoTargetTypeSetting: geoTargetTypeSettingSchema.optional(),
4788
4873
  startDate: dateSchema.optional(),
4789
4874
  endDate: dateSchema.optional(),
4790
4875
  /** Campaign-level override of the account's final URL suffix. `""` clears it back to the account value. */
4791
4876
  finalUrlSuffix: finalUrlSuffixSchema.optional(),
4877
+ /** Campaign-level tracking template. `""` clears it back to the account value. */
4878
+ trackingUrlTemplate: trackingUrlTemplateSchema.optional(),
4879
+ /** Replaces the campaign's custom parameters wholesale; `[]` removes them all. */
4880
+ urlCustomParameters: urlCustomParametersSchema.optional(),
4792
4881
  /** Corrects the campaign's EU political advertising declaration (true = contains, false = does not). */
4793
- euPoliticalAds: z13.boolean().optional(),
4794
- status: z13.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4882
+ euPoliticalAds: z14.boolean().optional(),
4883
+ status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4795
4884
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4796
- var adGroupCreateSchema = z13.object({
4797
- 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),
4798
4887
  campaign: refSchema,
4799
- type: z13.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4888
+ type: z14.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
4800
4889
  cpcBidMicros: microsSchema.optional(),
4801
4890
  status: stageableStatusSchema2.default("PAUSED")
4802
4891
  });
4803
- var adGroupUpdateSchema = z13.object({
4804
- 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(),
4805
4894
  cpcBidMicros: microsSchema.optional(),
4806
- status: z13.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4895
+ status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4807
4896
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4808
- var keywordAddSchema = z13.object({
4897
+ var keywordAddSchema = z14.object({
4809
4898
  adGroup: refSchema,
4810
4899
  text: keywordTextSchema,
4811
4900
  matchType: matchTypeSchema,
4812
4901
  cpcBidMicros: microsSchema.optional(),
4813
- finalUrls: z13.array(httpsUrlSchema2).optional(),
4902
+ finalUrls: z14.array(httpsUrlSchema2).optional(),
4814
4903
  status: stageableStatusSchema2.default("ENABLED")
4815
4904
  });
4816
- var keywordUpdateSchema = z13.object({
4905
+ var keywordUpdateSchema = z14.object({
4817
4906
  cpcBidMicros: microsSchema.optional(),
4818
- finalUrls: z13.array(httpsUrlSchema2).optional(),
4819
- status: z13.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4907
+ finalUrls: z14.array(httpsUrlSchema2).optional(),
4908
+ status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
4820
4909
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4821
- var negativeKeywordAddSchema = z13.object({
4822
- level: z13.enum(["adGroup", "campaign"]),
4910
+ var negativeKeywordAddSchema = z14.object({
4911
+ level: z14.enum(["adGroup", "campaign"]),
4823
4912
  parent: refSchema,
4824
4913
  text: keywordTextSchema,
4825
4914
  matchType: matchTypeSchema
4826
4915
  });
4827
- var sharedSetCreateSchema = z13.object({
4828
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
4829
- 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")
4830
4919
  });
4831
- var sharedSetMemberAddSchema = z13.object({
4920
+ var sharedSetMemberAddSchema = z14.object({
4832
4921
  sharedSet: refSchema,
4833
4922
  text: keywordTextSchema,
4834
4923
  matchType: matchTypeSchema
4835
4924
  });
4836
- var campaignSharedSetAttachSchema = z13.object({
4925
+ var campaignSharedSetAttachSchema = z14.object({
4837
4926
  campaign: refSchema,
4838
4927
  sharedSet: refSchema
4839
4928
  });
4840
- var adTextAssetSchema = z13.object({
4841
- text: z13.string().min(1),
4842
- pinnedField: z13.enum(PINNED_FIELDS).optional()
4929
+ var adTextAssetSchema = z14.object({
4930
+ text: z14.string().min(1),
4931
+ pinnedField: z14.enum(PINNED_FIELDS).optional()
4843
4932
  });
4844
- var responsiveSearchAdSchema = z13.strictObject({
4845
- format: z13.literal("responsiveSearch"),
4846
- headlines: z13.array(
4933
+ var responsiveSearchAdSchema = z14.strictObject({
4934
+ format: z14.literal("responsiveSearch"),
4935
+ headlines: z14.array(
4847
4936
  adTextAssetSchema.refine(
4848
4937
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
4849
4938
  "headline exceeds 30 chars"
4850
4939
  )
4851
4940
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
4852
- descriptions: z13.array(
4941
+ descriptions: z14.array(
4853
4942
  adTextAssetSchema.refine(
4854
4943
  (a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
4855
4944
  "description exceeds 90 chars"
4856
4945
  )
4857
4946
  ).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
4858
- path1: z13.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4859
- path2: z13.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
4860
- finalUrls: z13.array(httpsUrlSchema2).min(1)
4861
- });
4862
- var responsiveDisplayAdSchema = z13.strictObject({
4863
- format: z13.literal("responsiveDisplay"),
4864
- headlines: z13.array(z13.object({ text: z13.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
4865
- longHeadline: z13.object({ text: z13.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
4866
- descriptions: z13.array(z13.object({ text: z13.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
4867
- 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),
4868
4957
  // A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
4869
4958
  // asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
4870
4959
  // image (1:1) to serve; the logo images are optional.
4871
- marketingImageAssets: z13.array(refSchema).optional(),
4872
- squareMarketingImageAssets: z13.array(refSchema).optional(),
4873
- logoImageAssets: z13.array(refSchema).optional(),
4874
- finalUrls: z13.array(httpsUrlSchema2).min(1)
4875
- });
4876
- var callAdSchema = z13.strictObject({
4877
- format: z13.literal("call"),
4878
- countryCode: z13.string().length(2),
4879
- phoneNumber: z13.string().min(3),
4880
- headline1: z13.string().min(1).max(30),
4881
- headline2: z13.string().min(1).max(30),
4882
- description1: z13.string().min(1).max(90),
4883
- description2: z13.string().min(1).max(90),
4884
- businessName: z13.string().min(1).max(25),
4885
- finalUrls: z13.array(httpsUrlSchema2).min(1)
4886
- });
4887
- var appAdSchema = z13.strictObject({
4888
- format: z13.literal("app"),
4889
- 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),
4890
- 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),
4891
4980
  // An App campaign ad carries its images on its own content (`AppAdInfo.images`), not as
4892
4981
  // campaign-level asset links — same shape as a responsive display ad's marketing images.
4893
- images: z13.array(refSchema).max(GOOGLE_ADS_LIMITS.appAd.imagesMax).optional(),
4982
+ images: z14.array(refSchema).max(GOOGLE_ADS_LIMITS.appAd.imagesMax).optional(),
4894
4983
  // `AppAdInfo.youtube_videos` — an App ad's videos live on its content too. Without this field
4895
4984
  // there is no way to express "keep these videos on the ad", so a content update that only
4896
4985
  // restated headlines silently left the ad's videos to whatever the mask happened to omit.
4897
- youtubeVideos: z13.array(refSchema).max(GOOGLE_ADS_LIMITS.appAd.youtubeVideosMax).optional()
4986
+ youtubeVideos: z14.array(refSchema).max(GOOGLE_ADS_LIMITS.appAd.youtubeVideosMax).optional()
4898
4987
  });
4899
- var videoAdSchema = z13.strictObject({
4900
- format: z13.literal("video"),
4988
+ var videoAdSchema = z14.strictObject({
4989
+ format: z14.literal("video"),
4901
4990
  // A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
4902
4991
  // its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
4903
- videoAssets: z13.array(refSchema).min(1),
4904
- finalUrls: z13.array(httpsUrlSchema2).min(1)
4905
- });
4906
- var demandGenAdSchema = z13.strictObject({
4907
- format: z13.literal("demandGen"),
4908
- headlines: z13.array(z13.object({ text: z13.string().min(1).max(40) })).min(1).max(5),
4909
- descriptions: z13.array(z13.object({ text: z13.string().min(1).max(90) })).min(1).max(5),
4910
- businessName: z13.string().min(1).max(25),
4911
- finalUrls: z13.array(httpsUrlSchema2).min(1),
4912
- imageAssets: z13.array(refSchema).optional(),
4913
- squareImageAssets: z13.array(refSchema).optional(),
4914
- logoImageAssets: z13.array(refSchema).optional()
4915
- });
4916
- 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", [
4917
5006
  responsiveSearchAdSchema,
4918
5007
  responsiveDisplayAdSchema,
4919
5008
  callAdSchema,
@@ -4921,45 +5010,45 @@ var adContentSchema2 = z13.discriminatedUnion("format", [
4921
5010
  videoAdSchema,
4922
5011
  demandGenAdSchema
4923
5012
  ]);
4924
- var adCreateSchema = z13.object({
5013
+ var adCreateSchema = z14.object({
4925
5014
  adGroup: refSchema,
4926
5015
  status: stageableStatusSchema2.default("PAUSED"),
4927
5016
  content: adContentSchema2
4928
5017
  });
4929
- var adUpdateSchema = z13.object({
4930
- status: z13.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
5018
+ var adUpdateSchema = z14.object({
5019
+ status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
4931
5020
  /** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
4932
- content: z13.record(z13.string(), z13.unknown()).optional()
5021
+ content: z14.record(z14.string(), z14.unknown()).optional()
4933
5022
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4934
- var textAssetSchema = z13.object({ type: z13.literal("text"), text: z13.string().min(1) });
4935
- var imageAssetSchema = z13.object({
4936
- type: z13.literal("image"),
4937
- imageId: z13.string().min(1),
4938
- name: z13.string().optional()
4939
- });
4940
- var youtubeVideoAssetSchema = z13.object({
4941
- type: z13.literal("youtubeVideo"),
4942
- youtubeVideoId: z13.string().min(1),
4943
- name: z13.string().optional()
4944
- });
4945
- var sitelinkAssetSchema = z13.object({
4946
- type: z13.literal("sitelink"),
4947
- linkText: z13.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
4948
- description1: z13.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4949
- description2: z13.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4950
- finalUrls: z13.array(httpsUrlSchema2).min(1)
4951
- });
4952
- var calloutAssetSchema = z13.object({
4953
- type: z13.literal("callout"),
4954
- calloutText: z13.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
4955
- });
4956
- var structuredSnippetAssetSchema = z13.object({
4957
- type: z13.literal("structuredSnippet"),
4958
- header: z13.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
4959
- values: z13.array(z13.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
4960
- });
4961
- var callToActionAssetSchema = z13.object({ type: z13.literal("callToAction"), callToAction: z13.string().min(1) });
4962
- 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", [
4963
5052
  textAssetSchema,
4964
5053
  imageAssetSchema,
4965
5054
  youtubeVideoAssetSchema,
@@ -4968,136 +5057,136 @@ var assetCreateSchema = z13.discriminatedUnion("type", [
4968
5057
  structuredSnippetAssetSchema,
4969
5058
  callToActionAssetSchema
4970
5059
  ]);
4971
- var assetUpdateSchema = z13.object({
4972
- name: z13.string().min(1).optional(),
4973
- linkText: z13.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
4974
- description1: z13.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4975
- description2: z13.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
4976
- finalUrls: z13.array(httpsUrlSchema2).min(1).optional(),
4977
- calloutText: z13.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
4978
- header: z13.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
4979
- values: z13.array(z13.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
4980
- callToAction: z13.string().min(1).optional(),
4981
- 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()
4982
5071
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
4983
- var assetLinkAttachSchema = z13.object({
4984
- level: z13.enum(["campaign", "adGroup", "customer"]),
5072
+ var assetLinkAttachSchema = z14.object({
5073
+ level: z14.enum(["campaign", "adGroup", "customer"]),
4985
5074
  parent: refSchema.optional(),
4986
5075
  asset: refSchema,
4987
- fieldType: z13.enum(ASSET_FIELD_TYPES)
5076
+ fieldType: z14.enum(ASSET_FIELD_TYPES)
4988
5077
  }).superRefine((value, ctx) => {
4989
5078
  if (value.level !== "customer" && !value.parent) {
4990
5079
  ctx.addIssue({
4991
- code: z13.ZodIssueCode.custom,
5080
+ code: z14.ZodIssueCode.custom,
4992
5081
  path: ["parent"],
4993
5082
  message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
4994
5083
  });
4995
5084
  }
4996
5085
  });
4997
- var assetGroupCreateSchema = z13.object({
5086
+ var assetGroupCreateSchema = z14.object({
4998
5087
  campaign: refSchema,
4999
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
5000
- finalUrls: z13.array(httpsUrlSchema2).min(1),
5001
- 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),
5002
- 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),
5003
- 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),
5004
- businessName: z13.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
5005
- imageAssets: z13.array(refSchema).optional(),
5006
- squareImageAssets: z13.array(refSchema).optional(),
5007
- logoAssets: z13.array(refSchema).optional(),
5008
- status: z13.enum(["ENABLED", "PAUSED"]).default("PAUSED")
5009
- });
5010
- var assetGroupUpdateSchema = z13.object({
5011
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
5012
- finalUrls: z13.array(httpsUrlSchema2).min(1).optional(),
5013
- 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()
5014
5103
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
5015
- var audienceCreateSchema2 = z13.object({
5016
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
5017
- type: z13.enum(USER_LIST_TYPES).default("BASIC"),
5018
- 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(),
5019
5108
  /** Customer-match members (crm-based) — file-first for large lists. */
5020
- members: z13.array(z13.record(z13.string(), z13.string())).optional(),
5021
- sourceFileRef: z13.string().optional()
5109
+ members: z14.array(z14.record(z14.string(), z14.string())).optional(),
5110
+ sourceFileRef: z14.string().optional()
5022
5111
  });
5023
- var audienceCriterionAttachSchema = z13.object({
5024
- level: z13.enum(["campaign", "adGroup"]),
5112
+ var audienceCriterionAttachSchema = z14.object({
5113
+ level: z14.enum(["campaign", "adGroup"]),
5025
5114
  parent: refSchema,
5026
5115
  userList: refSchema,
5027
- negative: z13.boolean().default(false)
5116
+ negative: z14.boolean().default(false)
5028
5117
  });
5029
- var conversionActionCreateSchema = z13.object({
5030
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
5031
- type: z13.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
5032
- category: z13.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
5033
- 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"),
5034
5123
  defaultValueMicros: microsSchema.optional(),
5035
- defaultCurrencyCode: z13.string().length(3).optional(),
5036
- clickThroughLookbackWindowDays: z13.number().int().positive().optional(),
5037
- viewThroughLookbackWindowDays: z13.number().int().positive().optional(),
5038
- status: z13.enum(["ENABLED", "PAUSED"]).default("ENABLED")
5039
- });
5040
- var conversionActionUpdateSchema = z13.object({
5041
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
5042
- category: z13.enum(CONVERSION_ACTION_CATEGORIES).optional(),
5043
- 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(),
5044
5133
  defaultValueMicros: microsSchema.optional(),
5045
- defaultCurrencyCode: z13.string().length(3).optional(),
5046
- clickThroughLookbackWindowDays: z13.number().int().positive().optional(),
5047
- viewThroughLookbackWindowDays: z13.number().int().positive().optional(),
5048
- 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()
5049
5138
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
5050
- var biddingStrategyCreateSchema = z13.object({
5051
- 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),
5052
5141
  config: biddingConfigSchema
5053
5142
  }).superRefine((p, ctx) => {
5054
5143
  if (p.config.type === "MANUAL_CPC") {
5055
5144
  ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
5056
5145
  }
5057
5146
  });
5058
- var biddingStrategyUpdateSchema = z13.object({
5059
- 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(),
5060
5149
  config: biddingConfigSchema.optional()
5061
5150
  }).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
5062
- var labelCreateSchema = z13.object({
5063
- name: z13.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
5064
- backgroundColor: z13.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
5065
- 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()
5066
5155
  });
5067
- var labelAttachSchema = z13.object({
5068
- level: z13.enum(["campaign", "adGroup", "ad"]),
5156
+ var labelAttachSchema = z14.object({
5157
+ level: z14.enum(["campaign", "adGroup", "ad"]),
5069
5158
  parent: refSchema,
5070
5159
  label: refSchema
5071
5160
  });
5072
- var locationCriterionSchema = z13.object({
5073
- criterionType: z13.literal("location"),
5074
- geoTargetConstant: z13.union([z13.string().regex(GEO_TARGET_CONSTANT_REGEX), z13.string().regex(NUMERIC_ID_REGEX2)])
5075
- });
5076
- var languageCriterionSchema = z13.object({
5077
- criterionType: z13.literal("language"),
5078
- languageConstant: z13.union([z13.string().regex(LANGUAGE_CONSTANT_REGEX), z13.string().regex(NUMERIC_ID_REGEX2)])
5079
- });
5080
- var adScheduleCriterionSchema = z13.object({
5081
- criterionType: z13.literal("adSchedule"),
5082
- dayOfWeek: z13.enum(DAYS_OF_WEEK),
5083
- startHour: z13.number().int().min(0).max(23),
5084
- startMinute: z13.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
5085
- endHour: z13.number().int().min(0).max(24),
5086
- endMinute: z13.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
5087
- });
5088
- var deviceCriterionSchema = z13.object({
5089
- criterionType: z13.literal("device"),
5090
- 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),
5091
5180
  // Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
5092
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.
5093
- 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, {
5094
5183
  message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
5095
5184
  })
5096
5185
  });
5097
- var campaignCriterionAddSchema = z13.object({
5186
+ var campaignCriterionAddSchema = z14.object({
5098
5187
  campaign: refSchema,
5099
- negative: z13.boolean().default(false),
5100
- criterion: z13.discriminatedUnion("criterionType", [
5188
+ negative: z14.boolean().default(false),
5189
+ criterion: z14.discriminatedUnion("criterionType", [
5101
5190
  locationCriterionSchema,
5102
5191
  languageCriterionSchema,
5103
5192
  adScheduleCriterionSchema,
@@ -5107,7 +5196,7 @@ var campaignCriterionAddSchema = z13.object({
5107
5196
  const c = val.criterion;
5108
5197
  if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
5109
5198
  ctx.addIssue({
5110
- code: z13.ZodIssueCode.custom,
5199
+ code: z14.ZodIssueCode.custom,
5111
5200
  message: "endHour 24 (midnight) cannot have a non-zero endMinute",
5112
5201
  path: ["criterion", "endMinute"]
5113
5202
  });
@@ -5159,17 +5248,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
5159
5248
  "google.campaignCriterion.add",
5160
5249
  "google.campaignCriterion.remove"
5161
5250
  ];
5162
- var googleDraftOpKindSchema = z13.enum(GOOGLE_DRAFT_OP_KINDS);
5251
+ var googleDraftOpKindSchema = z14.enum(GOOGLE_DRAFT_OP_KINDS);
5163
5252
  function createOp2(kind, payload) {
5164
- return z13.object({ kind: z13.literal(kind), customerId: customerIdSchema, payload });
5253
+ return z14.object({ kind: z14.literal(kind), customerId: customerIdSchema, payload });
5165
5254
  }
5166
5255
  function updateOp2(kind, payload) {
5167
- 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 });
5168
5257
  }
5169
5258
  function targetOp(kind) {
5170
- return z13.object({ kind: z13.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
5259
+ return z14.object({ kind: z14.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
5171
5260
  }
5172
- var googleDraftOpInputSchema = z13.discriminatedUnion("kind", [
5261
+ var googleDraftOpInputSchema = z14.discriminatedUnion("kind", [
5173
5262
  createOp2("google.budget.create", budgetCreateSchema),
5174
5263
  updateOp2("google.budget.update", budgetUpdateSchema),
5175
5264
  createOp2("google.campaign.create", campaignCreateSchema2),
@@ -5217,48 +5306,48 @@ var googleDraftOpInputSchema = z13.discriminatedUnion("kind", [
5217
5306
  ]);
5218
5307
 
5219
5308
  // ../api/src/ads-google/url-options.ts
5220
- import { z as z14 } from "zod";
5309
+ import { z as z15 } from "zod";
5221
5310
  var URL_OPTION_LEVELS = ["account", "campaign", "ad_group", "ad"];
5222
- var googleUrlOptionValueSchema = z14.discriminatedUnion("state", [
5223
- z14.object({ state: z14.literal("set"), value: z14.string() }),
5224
- z14.object({ state: z14.literal("not_set") }),
5225
- 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() })
5226
5315
  ]);
5227
- var googleUrlOptionsRequestSchema = z14.object({
5228
- customerId: z14.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id"),
5229
- 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(),
5230
5319
  /** Compact by default: only campaigns that actually override the account. `full` lists every campaign. */
5231
- full: z14.boolean().optional(),
5232
- skipCache: z14.boolean().optional()
5320
+ full: z15.boolean().optional(),
5321
+ skipCache: z15.boolean().optional()
5233
5322
  });
5234
- var googleUrlOptionsCampaignSchema = z14.object({
5235
- id: z14.string(),
5236
- name: z14.string(),
5237
- status: z14.string(),
5323
+ var googleUrlOptionsCampaignSchema = z15.object({
5324
+ id: z15.string(),
5325
+ name: z15.string(),
5326
+ status: z15.string(),
5238
5327
  final_url_suffix: googleUrlOptionValueSchema,
5239
5328
  tracking_url_template: googleUrlOptionValueSchema
5240
5329
  });
5241
- var googleUrlOptionsResponseSchema = z14.object({
5242
- customer_id: z14.string(),
5243
- account: z14.object({
5244
- level: z14.literal("account"),
5245
- 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(),
5246
5335
  final_url_suffix: googleUrlOptionValueSchema,
5247
5336
  tracking_url_template: googleUrlOptionValueSchema
5248
5337
  }),
5249
- campaigns: z14.object({
5250
- level: z14.literal("campaign"),
5251
- read: z14.boolean(),
5338
+ campaigns: z15.object({
5339
+ level: z15.literal("campaign"),
5340
+ read: z15.boolean(),
5252
5341
  /** Campaigns actually observed. 0 with `read: true` means the account has no non-removed campaigns. */
5253
- campaigns_read: z14.number().int().nonnegative(),
5342
+ campaigns_read: z15.number().int().nonnegative(),
5254
5343
  /** Campaigns observed to carry no override of their own — an explicit finding, not an omission. */
5255
- campaigns_without_override: z14.number().int().nonnegative(),
5256
- overrides: z14.array(googleUrlOptionsCampaignSchema),
5344
+ campaigns_without_override: z15.number().int().nonnegative(),
5345
+ overrides: z15.array(googleUrlOptionsCampaignSchema),
5257
5346
  /** Compact mode only: campaigns read but not listed because they carry no override. */
5258
- omitted: z14.number().int().nonnegative()
5347
+ omitted: z15.number().int().nonnegative()
5259
5348
  }),
5260
5349
  /** Levels this command never queried. Nothing here may be reported as "not configured". */
5261
- 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() }))
5262
5351
  });
5263
5352
  var ACCOUNT_URL_OPTIONS_LOCATION = "Google Ads UI \u2192 Admin \u2192 Account settings \u2192 Tracking (account-level tracking template and final URL suffix)";
5264
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.";
@@ -5303,143 +5392,143 @@ function urlOptionsHints(report) {
5303
5392
  }
5304
5393
 
5305
5394
  // ../api/src/ads-google/wire.ts
5306
- import { z as z15 } from "zod";
5307
- var googleWriteModeSchema = z15.enum(["live", "simulated"]);
5308
- var googleDraftOpResultSchema = z15.object({
5309
- status: z15.enum(["applied", "simulated", "failed", "skipped"]),
5310
- resourceName: z15.string().optional(),
5311
- error: z15.string().optional(),
5312
- skippedBecause: z15.string().optional(),
5313
- executedAt: z15.number().optional()
5314
- });
5315
- var googleDraftStageRequestSchema = z15.object({
5316
- 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(),
5317
5406
  op: googleDraftOpInputSchema
5318
5407
  });
5319
- var googleDraftStageResponseSchema = z15.discriminatedUnion("staged", [
5320
- z15.object({
5321
- staged: z15.literal(true),
5322
- ref: z15.string(),
5408
+ var googleDraftStageResponseSchema = z16.discriminatedUnion("staged", [
5409
+ z16.object({
5410
+ staged: z16.literal(true),
5411
+ ref: z16.string(),
5323
5412
  kind: googleDraftOpKindSchema,
5324
5413
  mode: googleWriteModeSchema,
5325
- dependsOn: z15.array(z15.string()),
5326
- summary: z15.string(),
5327
- warnings: z15.array(z15.string()),
5414
+ dependsOn: z16.array(z16.string()),
5415
+ summary: z16.string(),
5416
+ warnings: z16.array(z16.string()),
5328
5417
  /** True when the op amended an already-staged op in place instead of appending a new one. */
5329
- amended: z15.boolean().optional()
5418
+ amended: z16.boolean().optional()
5330
5419
  }),
5331
- z15.object({
5332
- staged: z15.literal(false),
5333
- noop: z15.literal(true),
5420
+ z16.object({
5421
+ staged: z16.literal(false),
5422
+ noop: z16.literal(true),
5334
5423
  kind: googleDraftOpKindSchema,
5335
5424
  mode: googleWriteModeSchema,
5336
- summary: z15.string(),
5337
- reason: z15.string()
5425
+ summary: z16.string(),
5426
+ reason: z16.string()
5338
5427
  })
5339
5428
  ]);
5340
- var googleDraftAmendRequestSchema = z15.object({
5341
- chatId: z15.string(),
5342
- ref: z15.string(),
5343
- 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())
5344
5433
  });
5345
- var googleDraftShowRequestSchema = z15.object({
5346
- chatId: z15.string(),
5347
- ref: z15.string()
5434
+ var googleDraftShowRequestSchema = z16.object({
5435
+ chatId: z16.string(),
5436
+ ref: z16.string()
5348
5437
  });
5349
5438
  var GOOGLE_DRAFT_BATCH_MAX = 500;
5350
- var googleDraftStageBatchRequestSchema = z15.object({
5351
- chatId: z15.string(),
5352
- 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)
5353
5442
  });
5354
- var googleDraftStageBatchResponseSchema = z15.object({
5355
- staged: z15.literal(true),
5443
+ var googleDraftStageBatchResponseSchema = z16.object({
5444
+ staged: z16.literal(true),
5356
5445
  mode: googleWriteModeSchema,
5357
- count: z15.number(),
5358
- ops: z15.array(
5359
- z15.object({
5360
- ref: z15.string(),
5446
+ count: z16.number(),
5447
+ ops: z16.array(
5448
+ z16.object({
5449
+ ref: z16.string(),
5361
5450
  kind: googleDraftOpKindSchema,
5362
- dependsOn: z15.array(z15.string()),
5363
- summary: z15.string(),
5364
- warnings: z15.array(z15.string())
5451
+ dependsOn: z16.array(z16.string()),
5452
+ summary: z16.string(),
5453
+ warnings: z16.array(z16.string())
5365
5454
  })
5366
5455
  ),
5367
- 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()
5368
5457
  });
5369
- var googleDraftOpViewSchema = z15.object({
5370
- ref: z15.string(),
5458
+ var googleDraftOpViewSchema = z16.object({
5459
+ ref: z16.string(),
5371
5460
  kind: googleDraftOpKindSchema,
5372
- customerId: z15.string(),
5373
- target: z15.string().optional(),
5374
- dependsOn: z15.array(z15.string()),
5375
- summary: z15.string(),
5376
- 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(),
5377
5466
  result: googleDraftOpResultSchema.optional()
5378
5467
  });
5379
- var googleDraftShowResponseSchema = z15.object({
5468
+ var googleDraftShowResponseSchema = z16.object({
5380
5469
  op: googleDraftOpViewSchema.extend({
5381
- payload: z15.unknown().optional(),
5382
- warnings: z15.array(z15.string()).optional(),
5383
- annotations: z15.unknown().optional()
5470
+ payload: z16.unknown().optional(),
5471
+ warnings: z16.array(z16.string()).optional(),
5472
+ annotations: z16.unknown().optional()
5384
5473
  })
5385
5474
  });
5386
- var googleDraftListRequestSchema = z15.object({
5387
- chatId: z15.string()
5475
+ var googleDraftListRequestSchema = z16.object({
5476
+ chatId: z16.string()
5388
5477
  });
5389
- var googleDraftAdvisorySchema = z15.object({
5390
- scope: z15.enum(["campaign", "adGroup"]),
5391
- message: z15.string()
5478
+ var googleDraftAdvisorySchema = z16.object({
5479
+ scope: z16.enum(["campaign", "adGroup"]),
5480
+ message: z16.string()
5392
5481
  });
5393
- var googleDraftStatusCollectionSchema = z15.object({
5394
- label: z15.string(),
5395
- added: z15.number(),
5396
- removed: z15.number(),
5397
- existing: z15.number()
5482
+ var googleDraftStatusCollectionSchema = z16.object({
5483
+ label: z16.string(),
5484
+ added: z16.number(),
5485
+ removed: z16.number(),
5486
+ existing: z16.number()
5398
5487
  });
5399
- var googleDraftChangeOperationSchema = z15.enum(["create", "update", "pause", "resume", "remove"]);
5400
- var googleDraftStatusNodeSchema = z15.lazy(
5401
- () => z15.object({
5402
- entity: z15.string(),
5403
- 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(),
5404
5493
  operation: googleDraftChangeOperationSchema.optional(),
5405
- existing: z15.boolean(),
5406
- collections: z15.array(googleDraftStatusCollectionSchema),
5407
- children: z15.array(googleDraftStatusNodeSchema),
5408
- 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()
5409
5498
  })
5410
5499
  );
5411
- var googleDraftListResponseSchema = z15.object({
5412
- status: z15.enum(["active", "publishing", "applied", "discarded", "none"]),
5500
+ var googleDraftListResponseSchema = z16.object({
5501
+ status: z16.enum(["active", "publishing", "applied", "discarded", "none"]),
5413
5502
  mode: googleWriteModeSchema,
5414
- count: z15.number(),
5415
- ops: z15.array(googleDraftOpViewSchema),
5503
+ count: z16.number(),
5504
+ ops: z16.array(googleDraftOpViewSchema),
5416
5505
  /** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
5417
- tree: z15.array(googleDraftStatusNodeSchema).optional(),
5506
+ tree: z16.array(googleDraftStatusNodeSchema).optional(),
5418
5507
  /** Non-blocking completeness advisories for the whole draft. */
5419
- advisories: z15.array(googleDraftAdvisorySchema).optional()
5508
+ advisories: z16.array(googleDraftAdvisorySchema).optional()
5420
5509
  });
5421
- var googleDraftRemoveRequestSchema = z15.object({
5422
- chatId: z15.string(),
5423
- ref: z15.string()
5510
+ var googleDraftRemoveRequestSchema = z16.object({
5511
+ chatId: z16.string(),
5512
+ ref: z16.string()
5424
5513
  });
5425
- var googleDraftRemoveResponseSchema = z15.object({
5514
+ var googleDraftRemoveResponseSchema = z16.object({
5426
5515
  /** The requested ref plus any dependents removed by cascade. */
5427
- removed: z15.array(z15.string())
5516
+ removed: z16.array(z16.string())
5428
5517
  });
5429
- var googleDraftClearRequestSchema = z15.object({
5430
- chatId: z15.string()
5518
+ var googleDraftClearRequestSchema = z16.object({
5519
+ chatId: z16.string()
5431
5520
  });
5432
- var googleDraftClearResponseSchema = z15.object({
5433
- cleared: z15.number()
5521
+ var googleDraftClearResponseSchema = z16.object({
5522
+ cleared: z16.number()
5434
5523
  });
5435
- var googleFieldErrorSchema = z15.object({
5436
- path: z15.string(),
5437
- message: z15.string()
5524
+ var googleFieldErrorSchema = z16.object({
5525
+ path: z16.string(),
5526
+ message: z16.string()
5438
5527
  });
5439
- var googleDraftErrorResponseSchema = z15.object({
5440
- code: z15.string(),
5441
- error: z15.string(),
5442
- fields: z15.array(googleFieldErrorSchema).optional()
5528
+ var googleDraftErrorResponseSchema = z16.object({
5529
+ code: z16.string(),
5530
+ error: z16.string(),
5531
+ fields: z16.array(googleFieldErrorSchema).optional()
5443
5532
  });
5444
5533
 
5445
5534
  // src/commands/ads/google/changes-window.ts
@@ -6947,8 +7036,8 @@ async function stageGoogleOp(raw, hints) {
6947
7036
  handleGoogleError(err);
6948
7037
  }
6949
7038
  }
6950
- async function stageCreate(kind, customerId, payload) {
6951
- await stageGoogleOp({ kind, customerId, payload });
7039
+ async function stageCreate(kind, customerId, payload, hints) {
7040
+ await stageGoogleOp({ kind, customerId, payload }, hints);
6952
7041
  }
6953
7042
  async function stageGoogleOps(rawOps, hints) {
6954
7043
  if (rawOps.length === 1 && rawOps[0]) {
@@ -8451,6 +8540,81 @@ var finalUrlSuffixArg = {
8451
8540
  description: 'Final URL suffix for this campaign \u2014 bare query params, no leading "?" (e.g. "utm_source=google&utm_agency=baker"). REPLACES the account-level suffix for this campaign; pass "" to clear it back to the account value. Account-wide tagging belongs at the account level: --level account tells you where.'
8452
8541
  }
8453
8542
  };
8543
+ var urlOptionsArgs = {
8544
+ "tracking-template": {
8545
+ type: "string",
8546
+ description: 'Campaign tracking template \u2014 the click-measurement URL every ad routes through. Must carry the landing page through {lpurl}, e.g. "https://tracker.example/?url={lpurl}". REPLACES the account-level template for this campaign; pass "" to clear it back to the account value.'
8547
+ },
8548
+ "custom-param": {
8549
+ type: "string",
8550
+ description: "Custom parameter as key=value, referenced in a template or final URL as {_key} (e.g. --custom-param season=summer). Repeat for several; Google allows 8. REPLACES the campaign's whole set."
8551
+ },
8552
+ "clear-custom-params": {
8553
+ type: "boolean",
8554
+ description: "Remove every custom parameter from this campaign (Google replaces the set wholesale)."
8555
+ }
8556
+ };
8557
+ function urlCustomParametersFromFlags(args) {
8558
+ const raw = args["custom-param"];
8559
+ const entries = (Array.isArray(raw) ? raw : typeof raw === "string" ? [raw] : []).filter(
8560
+ (v) => typeof v === "string" && v.length > 0
8561
+ );
8562
+ if (entries.length === 0) {
8563
+ return args["clear-custom-params"] === true ? [] : void 0;
8564
+ }
8565
+ if (args["clear-custom-params"] === true) {
8566
+ failWriteValidation("--clear-custom-params removes every parameter \u2014 pass it OR --custom-param, not both");
8567
+ }
8568
+ return entries.map((entry) => {
8569
+ const split = entry.indexOf("=");
8570
+ if (split <= 0) {
8571
+ failWriteValidation(`--custom-param "${entry}" must be key=value (e.g. --custom-param season=summer)`);
8572
+ }
8573
+ return { key: entry.slice(0, split), value: entry.slice(split + 1) };
8574
+ });
8575
+ }
8576
+ var geoTargetTypeArgs = {
8577
+ "geo-target-type": {
8578
+ type: "string",
8579
+ description: 'Location option \u2014 PRESENCE (only people in your targeted locations) or PRESENCE_OR_INTEREST (also people interested in them). Google applies PRESENCE_OR_INTEREST when this is left out, so pass PRESENCE explicitly for local-service, delivery-radius or in-store campaigns. Sets the same "Location options" as the Google Ads UI.'
8580
+ },
8581
+ "negative-geo-target-type": {
8582
+ type: "string",
8583
+ description: "How EXCLUDED locations are matched \u2014 PRESENCE (default: excludes people in the location) or PRESENCE_OR_INTEREST (also excludes people interested in it)."
8584
+ }
8585
+ };
8586
+ function enumFlag(value, flag, allowed) {
8587
+ if (typeof value !== "string" || value.length === 0) {
8588
+ return void 0;
8589
+ }
8590
+ const upper2 = value.toUpperCase();
8591
+ if (!allowed.includes(upper2)) {
8592
+ failWriteValidation(`${flag} must be one of ${allowed.join(" | ")}`);
8593
+ }
8594
+ return upper2;
8595
+ }
8596
+ function geoTargetTypeFromFlags(args) {
8597
+ const positiveGeoTargetType = enumFlag(args["geo-target-type"], "--geo-target-type", POSITIVE_GEO_TARGET_TYPES);
8598
+ const negativeGeoTargetType = enumFlag(
8599
+ args["negative-geo-target-type"],
8600
+ "--negative-geo-target-type",
8601
+ NEGATIVE_GEO_TARGET_TYPES
8602
+ );
8603
+ if (positiveGeoTargetType === void 0 && negativeGeoTargetType === void 0) {
8604
+ return void 0;
8605
+ }
8606
+ return Object.fromEntries(
8607
+ Object.entries({ positiveGeoTargetType, negativeGeoTargetType }).filter(([, v]) => v !== void 0)
8608
+ );
8609
+ }
8610
+ function geoTargetTypeHints(payload) {
8611
+ if (payload.geoTargetTypeSetting !== void 0) {
8612
+ return [];
8613
+ }
8614
+ return [
8615
+ `No --geo-target-type set, so this campaign will use Google's default location option "Presence or interest" \u2014 it reaches people interested in your locations, not only people in them. Re-stage with --geo-target-type PRESENCE if the offer is local (in-store, delivery radius, service area), and tell the user which of the two this campaign uses.`
8616
+ ];
8617
+ }
8454
8618
  function accountLevelNotStageable(customerId, suffix) {
8455
8619
  writeJsonEnvelope({
8456
8620
  ok: false,
@@ -8494,6 +8658,8 @@ var campaignsCommand = defineCommand30({
8494
8658
  "target-roas": { type: "string", description: "Target ROAS (e.g. 4.0) for TARGET_ROAS" },
8495
8659
  ...maxCpcArg,
8496
8660
  ...finalUrlSuffixArg,
8661
+ ...urlOptionsArgs,
8662
+ ...geoTargetTypeArgs,
8497
8663
  objective: { type: "string", description: "Advisory UI objective (SALES, LEADS, \u2026)" },
8498
8664
  "start-date": { type: "string", description: "YYYY-MM-DD" },
8499
8665
  "end-date": { type: "string", description: "YYYY-MM-DD" },
@@ -8511,14 +8677,17 @@ var campaignsCommand = defineCommand30({
8511
8677
  channelSubType: args["sub-type"],
8512
8678
  budget: args["budget-ref"],
8513
8679
  bidding: biddingFromFlags(args),
8680
+ geoTargetTypeSetting: geoTargetTypeFromFlags(args),
8514
8681
  finalUrlSuffix: args["final-url-suffix"],
8682
+ trackingUrlTemplate: args["tracking-template"],
8683
+ urlCustomParameters: urlCustomParametersFromFlags(args),
8515
8684
  objective: args.objective,
8516
8685
  startDate: args["start-date"],
8517
8686
  endDate: args["end-date"],
8518
8687
  euPoliticalAds: args["eu-political-ads"],
8519
8688
  status: args.status
8520
8689
  });
8521
- await stageCreate("google.campaign.create", customerId, payload);
8690
+ await stageCreate("google.campaign.create", customerId, payload, geoTargetTypeHints(payload));
8522
8691
  }
8523
8692
  }),
8524
8693
  update: defineCommand30({
@@ -8533,6 +8702,8 @@ var campaignsCommand = defineCommand30({
8533
8702
  "target-roas": { type: "string" },
8534
8703
  ...maxCpcArg,
8535
8704
  ...finalUrlSuffixArg,
8705
+ ...urlOptionsArgs,
8706
+ ...geoTargetTypeArgs,
8536
8707
  "eu-political-ads": {
8537
8708
  type: "boolean",
8538
8709
  description: "Corrects the campaign's EU political advertising declaration: --eu-political-ads if it contains EU political ads, --eu-political-ads=false if it does not. Existing campaigns without a declaration block location-targeting changes until one is set."
@@ -8557,7 +8728,10 @@ var campaignsCommand = defineCommand30({
8557
8728
  name: args.name,
8558
8729
  budget: args["budget-ref"],
8559
8730
  bidding: biddingFromFlags(args),
8731
+ geoTargetTypeSetting: geoTargetTypeFromFlags(args),
8560
8732
  finalUrlSuffix: args["final-url-suffix"],
8733
+ trackingUrlTemplate: args["tracking-template"],
8734
+ urlCustomParameters: urlCustomParametersFromFlags(args),
8561
8735
  euPoliticalAds: args["eu-political-ads"],
8562
8736
  status: args.status
8563
8737
  });
@@ -13486,17 +13660,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
13486
13660
  var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
13487
13661
 
13488
13662
  // ../api/src/ads-meta/ops.ts
13489
- import { z as z16 } from "zod";
13490
- var tempRefSchema3 = z16.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
13491
- var parentRefSchema2 = z16.union([z16.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
13492
- var moneySchema2 = z16.object({
13493
- 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"),
13494
- currencyCode: z16.string().length(3).optional()
13495
- });
13496
- var httpsUrlSchema3 = z16.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
13497
- var bakerMediaIdSchema2 = z16.string().min(1);
13498
- var stageableStatusSchema3 = z16.enum(STAGEABLE_CREATE_STATUSES3);
13499
- 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);
13500
13674
  function currencyMinimums2(currencyCode) {
13501
13675
  return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
13502
13676
  }
@@ -13508,35 +13682,35 @@ function validateDailyBudgetFloor(money, ctx, path28) {
13508
13682
  }
13509
13683
  }
13510
13684
  }
13511
- var geoLocationsSchema = z16.object({
13512
- countries: z16.array(z16.string().length(2)).optional(),
13513
- regions: z16.array(z16.object({ key: z16.string() })).optional(),
13514
- cities: z16.array(z16.object({ key: z16.string(), radius: z16.number().optional(), distance_unit: z16.string().optional() })).optional(),
13515
- zips: z16.array(z16.object({ key: z16.string() })).optional(),
13516
- location_types: z16.array(z16.string()).optional()
13517
- }).catchall(z16.unknown());
13518
- var idNameSchema = z16.object({ id: z16.string(), name: z16.string().optional() });
13519
- 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({
13520
13694
  geo_locations: geoLocationsSchema.optional(),
13521
13695
  excluded_geo_locations: geoLocationsSchema.optional(),
13522
- age_min: z16.number().int().min(13).max(65).optional(),
13523
- age_max: z16.number().int().min(13).max(65).optional(),
13524
- genders: z16.array(z16.union([z16.literal(1), z16.literal(2)])).optional(),
13525
- locales: z16.array(z16.number().int()).optional(),
13526
- interests: z16.array(idNameSchema).optional(),
13527
- behaviors: z16.array(idNameSchema).optional(),
13528
- custom_audiences: z16.array(z16.object({ id: parentRefSchema2 })).optional(),
13529
- excluded_custom_audiences: z16.array(z16.object({ id: parentRefSchema2 })).optional(),
13530
- flexible_spec: z16.array(z16.record(z16.string(), z16.unknown())).optional(),
13531
- exclusions: z16.record(z16.string(), z16.unknown()).optional(),
13532
- publisher_platforms: z16.array(z16.string()).optional(),
13533
- facebook_positions: z16.array(z16.string()).optional(),
13534
- instagram_positions: z16.array(z16.string()).optional(),
13535
- audience_network_positions: z16.array(z16.string()).optional(),
13536
- messenger_positions: z16.array(z16.string()).optional(),
13537
- device_platforms: z16.array(z16.string()).optional(),
13538
- targeting_automation: z16.object({ advantage_audience: z16.union([z16.literal(0), z16.literal(1)]) }).partial().optional()
13539
- }).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());
13540
13714
  var GEO_INCLUSION_KEYS = [
13541
13715
  "countries",
13542
13716
  "country_groups",
@@ -13575,21 +13749,21 @@ function targetingHardLimitsDemographics(t) {
13575
13749
  const narrowsGender = Array.isArray(t.genders) && t.genders.length === 1;
13576
13750
  return narrowsAgeMax || narrowsAgeMin || narrowsGender;
13577
13751
  }
13578
- var specialAdCategoriesSchema = z16.array(z16.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
13579
- var campaignCreateSchema3 = z16.object({
13580
- name: z16.string().min(1).max(META_LIMITS.campaign.nameMax),
13581
- 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),
13582
13756
  status: stageableStatusSchema3.default("PAUSED"),
13583
13757
  special_ad_categories: specialAdCategoriesSchema,
13584
- special_ad_category_country: z16.array(z16.string().length(2)).optional(),
13585
- buying_type: z16.enum(BUYING_TYPES).default("AUCTION"),
13586
- 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(),
13587
13761
  /** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
13588
13762
  dailyBudget: moneySchema2.optional(),
13589
13763
  lifetimeBudget: moneySchema2.optional(),
13590
13764
  spendCap: moneySchema2.optional(),
13591
- start_time: z16.number().int().positive().optional(),
13592
- stop_time: z16.number().int().positive().optional()
13765
+ start_time: z17.number().int().positive().optional(),
13766
+ stop_time: z17.number().int().positive().optional()
13593
13767
  }).superRefine((p, ctx) => {
13594
13768
  if (p.dailyBudget && p.lifetimeBudget) {
13595
13769
  ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
@@ -13607,15 +13781,15 @@ var campaignCreateSchema3 = z16.object({
13607
13781
  });
13608
13782
  }
13609
13783
  });
13610
- var campaignUpdateSchema3 = z16.object({
13611
- 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(),
13612
13786
  status: updateStatusSchema.optional(),
13613
- bid_strategy: z16.enum(BID_STRATEGIES).optional(),
13787
+ bid_strategy: z17.enum(BID_STRATEGIES).optional(),
13614
13788
  dailyBudget: moneySchema2.optional(),
13615
13789
  lifetimeBudget: moneySchema2.optional(),
13616
13790
  spendCap: moneySchema2.optional(),
13617
- start_time: z16.number().int().positive().optional(),
13618
- stop_time: z16.number().int().positive().optional()
13791
+ start_time: z17.number().int().positive().optional(),
13792
+ stop_time: z17.number().int().positive().optional()
13619
13793
  }).superRefine((p, ctx) => {
13620
13794
  if (!Object.values(p).some((val) => val !== void 0)) {
13621
13795
  ctx.addIssue({ code: "custom", message: "update needs at least one field" });
@@ -13625,42 +13799,42 @@ var campaignUpdateSchema3 = z16.object({
13625
13799
  }
13626
13800
  validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
13627
13801
  });
13628
- var promotedObjectSchema = z16.object({
13802
+ var promotedObjectSchema = z17.object({
13629
13803
  page_id: parentRefSchema2.optional(),
13630
- pixel_id: z16.string().regex(NUMERIC_ID_REGEX3).optional(),
13631
- custom_event_type: z16.enum(CUSTOM_EVENT_TYPES).optional(),
13632
- application_id: z16.string().regex(NUMERIC_ID_REGEX3).optional(),
13633
- object_store_url: z16.string().url().optional(),
13634
- product_catalog_id: z16.string().regex(NUMERIC_ID_REGEX3).optional(),
13635
- product_set_id: z16.string().regex(NUMERIC_ID_REGEX3).optional(),
13636
- whatsapp_phone_number: z16.string().optional(),
13637
- 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()
13638
13812
  }).partial();
13639
- var attributionSpecSchema = z16.array(
13640
- z16.object({
13641
- event_type: z16.enum(ATTRIBUTION_EVENT_TYPES),
13642
- 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)])
13643
13817
  })
13644
13818
  );
13645
13819
  var adSetFields = {
13646
- name: z16.string().min(1).max(META_LIMITS.adSet.nameMax),
13820
+ name: z17.string().min(1).max(META_LIMITS.adSet.nameMax),
13647
13821
  campaign_id: parentRefSchema2,
13648
13822
  status: stageableStatusSchema3.default("PAUSED"),
13649
13823
  dailyBudget: moneySchema2.optional(),
13650
13824
  lifetimeBudget: moneySchema2.optional(),
13651
13825
  bidAmount: moneySchema2.optional(),
13652
- bid_strategy: z16.enum(BID_STRATEGIES).optional(),
13653
- billing_event: z16.enum(BILLING_EVENTS),
13654
- optimization_goal: z16.enum(OPTIMIZATION_GOALS),
13655
- 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(),
13656
13830
  promoted_object: promotedObjectSchema.optional(),
13657
13831
  attribution_spec: attributionSpecSchema.optional(),
13658
- start_time: z16.number().int().positive().optional(),
13659
- end_time: z16.number().int().positive().optional(),
13832
+ start_time: z17.number().int().positive().optional(),
13833
+ end_time: z17.number().int().positive().optional(),
13660
13834
  targeting: metaTargetingSchema,
13661
13835
  /** EU Digital Services Act: who benefits from / pays for the ad. Auto-filled from the account for EU geo when omitted. */
13662
- dsa_beneficiary: z16.string().min(1).max(100).optional(),
13663
- 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()
13664
13838
  };
13665
13839
  function validateBidStrategy(p, ctx) {
13666
13840
  const strategy = p.bid_strategy;
@@ -13757,7 +13931,7 @@ function validateAdvantageAudience(p, ctx) {
13757
13931
  });
13758
13932
  }
13759
13933
  }
13760
- var adSetCreateSchema = z16.object(adSetFields).superRefine((p, ctx) => {
13934
+ var adSetCreateSchema = z17.object(adSetFields).superRefine((p, ctx) => {
13761
13935
  validateAdSetBudgetAndBid(p, ctx);
13762
13936
  validateAdSetPromotedObject(p, ctx);
13763
13937
  validateAdvantageAudience(p, ctx);
@@ -13769,22 +13943,22 @@ var adSetCreateSchema = z16.object(adSetFields).superRefine((p, ctx) => {
13769
13943
  });
13770
13944
  }
13771
13945
  });
13772
- var adSetUpdateSchema = z16.object({
13946
+ var adSetUpdateSchema = z17.object({
13773
13947
  name: adSetFields.name.optional(),
13774
13948
  status: updateStatusSchema.optional(),
13775
13949
  dailyBudget: moneySchema2.optional(),
13776
13950
  lifetimeBudget: moneySchema2.optional(),
13777
13951
  bidAmount: moneySchema2.optional(),
13778
- bid_strategy: z16.enum(BID_STRATEGIES).optional(),
13779
- optimization_goal: z16.enum(OPTIMIZATION_GOALS).optional(),
13780
- 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(),
13781
13955
  promoted_object: promotedObjectSchema.optional(),
13782
13956
  attribution_spec: attributionSpecSchema.optional(),
13783
- start_time: z16.number().int().positive().optional(),
13784
- end_time: z16.number().int().positive().optional(),
13957
+ start_time: z17.number().int().positive().optional(),
13958
+ end_time: z17.number().int().positive().optional(),
13785
13959
  targeting: metaTargetingSchema.optional(),
13786
- dsa_beneficiary: z16.string().min(1).max(100).optional(),
13787
- 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()
13788
13962
  }).superRefine((p, ctx) => {
13789
13963
  if (!Object.values(p).some((val) => val !== void 0)) {
13790
13964
  ctx.addIssue({ code: "custom", message: "update needs at least one field" });
@@ -13795,38 +13969,38 @@ var adSetUpdateSchema = z16.object({
13795
13969
  }
13796
13970
  validateAdvantageAudience(p, ctx);
13797
13971
  });
13798
- var messageSchema = z16.string().min(1).max(META_LIMITS.creative.messageHardMax);
13799
- var headlineSchema2 = z16.string().min(1).max(META_LIMITS.creative.headlineMax);
13800
- var descriptionSchema = z16.string().min(1).max(META_LIMITS.creative.descriptionMax);
13801
- var callToActionSchema = z16.object({
13802
- 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),
13803
13977
  /** Overrides the base link for the CTA button; defaults to the ad's link. */
13804
13978
  link: httpsUrlSchema3.optional()
13805
13979
  });
13806
- var creativeEnhancementsSchema = z16.object({
13807
- standardEnhancements: z16.enum(ENROLL_STATUSES).optional(),
13808
- 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()
13809
13983
  });
13810
13984
  var creativeSharedFields = {
13811
- name: z16.string().max(META_LIMITS.creative.nameMax).optional(),
13985
+ name: z17.string().max(META_LIMITS.creative.nameMax).optional(),
13812
13986
  /** Facebook Page id backing the ad's identity. */
13813
13987
  page_id: parentRefSchema2,
13814
13988
  /** Instagram account id for IG placements (aka instagram_actor_id on read). */
13815
- instagram_user_id: z16.string().regex(NUMERIC_ID_REGEX3).optional(),
13989
+ instagram_user_id: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
13816
13990
  /** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
13817
- url_tags: z16.string().max(1e3).optional(),
13991
+ url_tags: z17.string().max(1e3).optional(),
13818
13992
  enhancements: creativeEnhancementsSchema.optional()
13819
13993
  };
13820
13994
  var imageMediaFields = {
13821
- imageHash: z16.string().regex(IMAGE_HASH_REGEX).optional(),
13995
+ imageHash: z17.string().regex(IMAGE_HASH_REGEX).optional(),
13822
13996
  imageRef: tempRefSchema3.optional()
13823
13997
  };
13824
13998
  var videoMediaFields = {
13825
- videoId: z16.string().regex(NUMERIC_ID_REGEX3).optional(),
13999
+ videoId: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
13826
14000
  videoRef: tempRefSchema3.optional(),
13827
14001
  /** Thumbnail for a video creative — image hash, ref, or public url. */
13828
- thumbnailHash: z16.string().regex(IMAGE_HASH_REGEX).optional(),
13829
- imageUrl: z16.string().url().optional()
14002
+ thumbnailHash: z17.string().regex(IMAGE_HASH_REGEX).optional(),
14003
+ imageUrl: z17.string().url().optional()
13830
14004
  };
13831
14005
  function countImageRefs(p) {
13832
14006
  return [p.imageHash, p.imageRef].filter(Boolean).length;
@@ -13834,8 +14008,8 @@ function countImageRefs(p) {
13834
14008
  function countVideoRefs(p) {
13835
14009
  return [p.videoId, p.videoRef].filter(Boolean).length;
13836
14010
  }
13837
- var singleCreativeSchema = z16.object({
13838
- creativeType: z16.literal("single"),
14011
+ var singleCreativeSchema = z17.object({
14012
+ creativeType: z17.literal("single"),
13839
14013
  ...creativeSharedFields,
13840
14014
  /** Primary text. */
13841
14015
  message: messageSchema,
@@ -13844,7 +14018,7 @@ var singleCreativeSchema = z16.object({
13844
14018
  headline: headlineSchema2.optional(),
13845
14019
  description: descriptionSchema.optional(),
13846
14020
  /** Display URL / caption shown under the headline. */
13847
- caption: z16.string().max(255).optional(),
14021
+ caption: z17.string().max(255).optional(),
13848
14022
  call_to_action: callToActionSchema.optional(),
13849
14023
  ...imageMediaFields,
13850
14024
  ...videoMediaFields
@@ -13868,10 +14042,10 @@ var singleCreativeSchema = z16.object({
13868
14042
  });
13869
14043
  }
13870
14044
  });
13871
- var carouselCardSchema = z16.object({
14045
+ var carouselCardSchema = z17.object({
13872
14046
  link: httpsUrlSchema3,
13873
- headline: z16.string().max(META_LIMITS.creative.headlineMax).optional(),
13874
- 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(),
13875
14049
  call_to_action: callToActionSchema.optional(),
13876
14050
  ...imageMediaFields,
13877
14051
  ...videoMediaFields
@@ -13891,35 +14065,35 @@ var carouselCardSchema = z16.object({
13891
14065
  ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
13892
14066
  }
13893
14067
  });
13894
- var carouselCreativeSchema2 = z16.object({
13895
- creativeType: z16.literal("carousel"),
14068
+ var carouselCreativeSchema2 = z17.object({
14069
+ creativeType: z17.literal("carousel"),
13896
14070
  ...creativeSharedFields,
13897
14071
  message: messageSchema,
13898
14072
  /** Optional "see more" card destination applied when a card has no own link. */
13899
14073
  link: httpsUrlSchema3.optional(),
13900
14074
  call_to_action: callToActionSchema.optional(),
13901
- 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)
13902
14076
  });
13903
- var dynamicImageSchema = z16.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
13904
- 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({
13905
14079
  videoId: videoMediaFields.videoId,
13906
14080
  videoRef: videoMediaFields.videoRef,
13907
14081
  thumbnailHash: videoMediaFields.thumbnailHash
13908
14082
  }).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
13909
14083
  var DYN = META_LIMITS.creative;
13910
- var dynamicCreativeSchema = z16.object({
13911
- creativeType: z16.literal("dynamic"),
14084
+ var dynamicCreativeSchema = z17.object({
14085
+ creativeType: z17.literal("dynamic"),
13912
14086
  ...creativeSharedFields,
13913
- bodies: z16.array(z16.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
13914
- titles: z16.array(z16.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
13915
- descriptions: z16.array(z16.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
13916
- images: z16.array(dynamicImageSchema).optional(),
13917
- videos: z16.array(dynamicVideoSchema).optional(),
13918
- ad_formats: z16.array(z16.enum(AD_FORMATS2)).min(1),
13919
- call_to_action_types: z16.array(z16.enum(CTA_TYPES2)).optional(),
13920
- 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),
13921
14095
  /** Multi-language / placement customization — structural passthrough for v1. */
13922
- 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()
13923
14097
  }).superRefine((p, ctx) => {
13924
14098
  if (!(p.images?.length || p.videos?.length)) {
13925
14099
  ctx.addIssue({
@@ -13929,57 +14103,57 @@ var dynamicCreativeSchema = z16.object({
13929
14103
  });
13930
14104
  }
13931
14105
  });
13932
- var existingPostCreativeSchema = z16.object({
13933
- creativeType: z16.literal("existing_post"),
14106
+ var existingPostCreativeSchema = z17.object({
14107
+ creativeType: z17.literal("existing_post"),
13934
14108
  name: creativeSharedFields.name,
13935
14109
  /** "<page_id>_<post_id>" object story id of the post to promote. */
13936
- 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>"'),
13937
14111
  instagram_user_id: creativeSharedFields.instagram_user_id,
13938
14112
  url_tags: creativeSharedFields.url_tags,
13939
14113
  enhancements: creativeSharedFields.enhancements
13940
14114
  });
13941
- var creativeContentSchema2 = z16.discriminatedUnion("creativeType", [
14115
+ var creativeContentSchema2 = z17.discriminatedUnion("creativeType", [
13942
14116
  singleCreativeSchema,
13943
14117
  carouselCreativeSchema2,
13944
14118
  dynamicCreativeSchema,
13945
14119
  existingPostCreativeSchema
13946
14120
  ]);
13947
14121
  var adCreativeCreateSchema = creativeContentSchema2;
13948
- var adCreativeUpdateSchema = z16.object({
13949
- name: z16.string().max(META_LIMITS.creative.nameMax).optional(),
14122
+ var adCreativeUpdateSchema = z17.object({
14123
+ name: z17.string().max(META_LIMITS.creative.nameMax).optional(),
13950
14124
  status: updateStatusSchema.optional(),
13951
14125
  /** Content patch — only honored when the target is a staged meta_temp_* creative. */
13952
- content: z16.record(z16.string(), z16.unknown()).optional()
14126
+ content: z17.record(z17.string(), z17.unknown()).optional()
13953
14127
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
13954
- var adCreateSchema2 = z16.object({
13955
- 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),
13956
14130
  adset_id: parentRefSchema2,
13957
14131
  status: stageableStatusSchema3.default("PAUSED"),
13958
- creative: z16.object({ creative_id: parentRefSchema2 }),
14132
+ creative: z17.object({ creative_id: parentRefSchema2 }),
13959
14133
  /** Conversion pixel / offline event set / view tags — structural passthrough. */
13960
- tracking_specs: z16.array(z16.record(z16.string(), z16.unknown())).optional()
14134
+ tracking_specs: z17.array(z17.record(z17.string(), z17.unknown())).optional()
13961
14135
  });
13962
- var adUpdateSchema2 = z16.object({
13963
- 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(),
13964
14138
  status: updateStatusSchema.optional(),
13965
14139
  /** Swapping the creative is the Meta way to "edit" an ad's creative. */
13966
- creative: z16.object({ creative_id: parentRefSchema2 }).optional(),
13967
- 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()
13968
14142
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
13969
- var lookalikeSpecSchema = z16.object({
13970
- origin: z16.array(z16.object({ id: parentRefSchema2 })).min(1),
13971
- ratio: z16.number().min(0.01).max(0.2).optional(),
13972
- country: z16.string().length(2).optional()
13973
- });
13974
- var customAudienceCreateSchema = z16.object({
13975
- name: z16.string().min(1).max(META_LIMITS.audience.nameMax),
13976
- subtype: z16.enum(CUSTOM_AUDIENCE_SUBTYPES),
13977
- description: z16.string().max(500).optional(),
13978
- customer_file_source: z16.string().optional(),
13979
- 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(),
13980
14154
  lookalike_spec: lookalikeSpecSchema.optional(),
13981
14155
  /** Website/engagement rule — structural passthrough validated by Meta. */
13982
- rule: z16.record(z16.string(), z16.unknown()).optional()
14156
+ rule: z17.record(z17.string(), z17.unknown()).optional()
13983
14157
  }).superRefine((p, ctx) => {
13984
14158
  if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
13985
14159
  ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
@@ -13988,16 +14162,16 @@ var customAudienceCreateSchema = z16.object({
13988
14162
  ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
13989
14163
  }
13990
14164
  });
13991
- var customAudienceUpdateSchema = z16.object({
13992
- name: z16.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
13993
- 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()
13994
14168
  }).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
13995
- var mediaUploadSchema = z16.object({
13996
- kind: z16.enum(MEDIA_KINDS),
14169
+ var mediaUploadSchema = z17.object({
14170
+ kind: z17.enum(MEDIA_KINDS),
13997
14171
  bakerImageId: bakerMediaIdSchema2.optional(),
13998
14172
  bakerVideoId: bakerMediaIdSchema2.optional(),
13999
14173
  /** Optional display name / filename hint. */
14000
- name: z16.string().max(255).optional()
14174
+ name: z17.string().max(255).optional()
14001
14175
  }).superRefine((p, ctx) => {
14002
14176
  if (p.kind === "image" && !p.bakerImageId) {
14003
14177
  ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
@@ -14019,16 +14193,16 @@ var META_DRAFT_OP_KINDS = [
14019
14193
  "customAudience.update",
14020
14194
  "media.upload"
14021
14195
  ];
14022
- var metaDraftOpKindSchema = z16.enum(META_DRAFT_OP_KINDS);
14023
- var accountIdSchema2 = z16.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
14024
- 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]);
14025
14199
  function createOp3(kind, payload) {
14026
- return z16.object({ kind: z16.literal(kind), accountId: accountIdSchema2, payload });
14200
+ return z17.object({ kind: z17.literal(kind), accountId: accountIdSchema2, payload });
14027
14201
  }
14028
14202
  function updateOp3(kind, payload) {
14029
- 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 });
14030
14204
  }
14031
- var metaDraftOpInputSchema = z16.discriminatedUnion("kind", [
14205
+ var metaDraftOpInputSchema = z17.discriminatedUnion("kind", [
14032
14206
  createOp3("campaign.create", campaignCreateSchema3),
14033
14207
  updateOp3("campaign.update", campaignUpdateSchema3),
14034
14208
  createOp3("adSet.create", adSetCreateSchema),
@@ -14043,89 +14217,89 @@ var metaDraftOpInputSchema = z16.discriminatedUnion("kind", [
14043
14217
  ]);
14044
14218
 
14045
14219
  // ../api/src/ads-meta/wire.ts
14046
- import { z as z17 } from "zod";
14047
- var metaWriteModeSchema = z17.enum(["live", "simulated"]);
14048
- var metaDraftOpResultSchema = z17.object({
14049
- 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"]),
14050
14224
  /** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
14051
- id: z17.string().optional(),
14225
+ id: z18.string().optional(),
14052
14226
  /** For media.upload ops: the resulting image hash. */
14053
- hash: z17.string().optional(),
14054
- error: z17.string().optional(),
14055
- skippedBecause: z17.string().optional(),
14056
- executedAt: z17.number().optional()
14227
+ hash: z18.string().optional(),
14228
+ error: z18.string().optional(),
14229
+ skippedBecause: z18.string().optional(),
14230
+ executedAt: z18.number().optional()
14057
14231
  });
14058
- var metaDraftStageRequestSchema = z17.object({
14059
- chatId: z17.string(),
14232
+ var metaDraftStageRequestSchema = z18.object({
14233
+ chatId: z18.string(),
14060
14234
  op: metaDraftOpInputSchema
14061
14235
  });
14062
- var metaDraftStageResponseSchema = z17.object({
14063
- staged: z17.literal(true),
14064
- ref: z17.string(),
14236
+ var metaDraftStageResponseSchema = z18.object({
14237
+ staged: z18.literal(true),
14238
+ ref: z18.string(),
14065
14239
  kind: metaDraftOpKindSchema,
14066
14240
  mode: metaWriteModeSchema,
14067
- dependsOn: z17.array(z17.string()),
14068
- summary: z17.string(),
14069
- warnings: z17.array(z17.string()),
14241
+ dependsOn: z18.array(z18.string()),
14242
+ summary: z18.string(),
14243
+ warnings: z18.array(z18.string()),
14070
14244
  /** True when the op amended an already-staged op in place instead of appending a new one. */
14071
- amended: z17.boolean().optional()
14072
- });
14073
- var metaDraftDuplicateRequestSchema = z17.object({
14074
- chatId: z17.string(),
14075
- accountId: z17.string(),
14076
- entity: z17.enum(["campaign", "adSet", "ad"]),
14077
- sourceId: z17.string(),
14078
- 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(),
14079
14253
  /** Pause the original after the copy publishes. */
14080
- replace: z17.boolean().optional()
14254
+ replace: z18.boolean().optional()
14081
14255
  });
14082
- var metaDraftOpViewSchema = z17.object({
14083
- ref: z17.string(),
14256
+ var metaDraftOpViewSchema = z18.object({
14257
+ ref: z18.string(),
14084
14258
  kind: metaDraftOpKindSchema,
14085
- accountId: z17.string(),
14086
- target: z17.string().optional(),
14087
- dependsOn: z17.array(z17.string()),
14088
- summary: z17.string(),
14089
- 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(),
14090
14264
  result: metaDraftOpResultSchema.optional()
14091
14265
  });
14092
- var metaDraftListRequestSchema = z17.object({
14093
- chatId: z17.string()
14266
+ var metaDraftListRequestSchema = z18.object({
14267
+ chatId: z18.string()
14094
14268
  });
14095
- var metaDraftAdvisorySchema = z17.object({
14096
- ref: z17.string(),
14097
- message: z17.string()
14269
+ var metaDraftAdvisorySchema = z18.object({
14270
+ ref: z18.string(),
14271
+ message: z18.string()
14098
14272
  });
14099
- var metaDraftListResponseSchema = z17.object({
14100
- status: z17.enum(["active", "publishing", "applied", "discarded", "none"]),
14273
+ var metaDraftListResponseSchema = z18.object({
14274
+ status: z18.enum(["active", "publishing", "applied", "discarded", "none"]),
14101
14275
  mode: metaWriteModeSchema,
14102
- count: z17.number(),
14103
- ops: z17.array(metaDraftOpViewSchema),
14276
+ count: z18.number(),
14277
+ ops: z18.array(metaDraftOpViewSchema),
14104
14278
  /** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
14105
- advisories: z17.array(metaDraftAdvisorySchema)
14279
+ advisories: z18.array(metaDraftAdvisorySchema)
14106
14280
  });
14107
- var metaDraftRemoveRequestSchema = z17.object({
14108
- chatId: z17.string(),
14109
- ref: z17.string()
14281
+ var metaDraftRemoveRequestSchema = z18.object({
14282
+ chatId: z18.string(),
14283
+ ref: z18.string()
14110
14284
  });
14111
- var metaDraftRemoveResponseSchema = z17.object({
14285
+ var metaDraftRemoveResponseSchema = z18.object({
14112
14286
  /** The requested ref plus any dependents removed by cascade. */
14113
- removed: z17.array(z17.string())
14287
+ removed: z18.array(z18.string())
14114
14288
  });
14115
- var metaDraftClearRequestSchema = z17.object({
14116
- chatId: z17.string()
14289
+ var metaDraftClearRequestSchema = z18.object({
14290
+ chatId: z18.string()
14117
14291
  });
14118
- var metaDraftClearResponseSchema = z17.object({
14119
- cleared: z17.number()
14292
+ var metaDraftClearResponseSchema = z18.object({
14293
+ cleared: z18.number()
14120
14294
  });
14121
- var metaFieldErrorSchema = z17.object({
14122
- path: z17.string(),
14123
- message: z17.string()
14295
+ var metaFieldErrorSchema = z18.object({
14296
+ path: z18.string(),
14297
+ message: z18.string()
14124
14298
  });
14125
- var metaDraftErrorResponseSchema = z17.object({
14126
- code: z17.string(),
14127
- error: z17.string(),
14128
- fields: z17.array(metaFieldErrorSchema).optional()
14299
+ var metaDraftErrorResponseSchema = z18.object({
14300
+ code: z18.string(),
14301
+ error: z18.string(),
14302
+ fields: z18.array(metaFieldErrorSchema).optional()
14129
14303
  });
14130
14304
 
14131
14305
  // src/commands/ads/meta/write-shared.ts
@@ -18005,7 +18179,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
18005
18179
  import { toCardinal as nwNl } from "n2words/nl-NL";
18006
18180
  import { toCardinal as nwPl } from "n2words/pl-PL";
18007
18181
  import { toCardinal as nwPt } from "n2words/pt-PT";
18008
- import { z as z18 } from "zod";
18182
+ import { z as z19 } from "zod";
18009
18183
 
18010
18184
  // src/engine/scaffold/lib/shoot-modes.ts
18011
18185
  var SHOOT_MODES = [
@@ -18341,71 +18515,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
18341
18515
  "{{out.video}}"
18342
18516
  ];
18343
18517
  }
18344
- var FrameAsset = z18.object({ url: z18.string().optional() }).loose().optional();
18345
- var DialogueLine = z18.object({
18346
- speaker: z18.string().optional(),
18347
- 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(),
18348
18522
  // Absolute seconds on the source timeline (the deconstruct emits both).
18349
- start_s: z18.number().optional(),
18350
- end_s: z18.number().optional(),
18351
- delivery: z18.string().optional(),
18352
- 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(),
18353
18527
  // DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
18354
18528
  // presence alone can't answer that — a founder pictured in a polaroid close-up is
18355
18529
  // "present" yet the line is voiceover, and treating it as on-camera produced a
18356
18530
  // native Seedance lip-sync clip of a still photograph. `false` pins the line to
18357
18531
  // the VO path; absent keeps the presence-based decision (old blueprints).
18358
- on_camera: z18.boolean().optional()
18532
+ on_camera: z19.boolean().optional()
18359
18533
  }).loose();
18360
- var Sfx = z18.object({
18361
- at_s: z18.number().optional(),
18362
- duration_s: z18.number().optional(),
18363
- sound_effect_prompt: z18.string().optional(),
18364
- 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()
18365
18539
  }).loose();
18366
- var CompositionRegion = z18.object({
18540
+ var CompositionRegion = z19.object({
18367
18541
  // full | top | bottom | left | right | inset
18368
- panel: z18.string().optional(),
18542
+ panel: z19.string().optional(),
18369
18543
  // 9-grid anchor for an `inset` presenter box.
18370
- position: z18.string().optional(),
18371
- is_presenter: z18.boolean().optional(),
18544
+ position: z19.string().optional(),
18545
+ is_presenter: z19.boolean().optional(),
18372
18546
  // The cast id shown/speaking in this region (routes lip-sync + element refs).
18373
- cast_ref: z18.string().optional(),
18547
+ cast_ref: z19.string().optional(),
18374
18548
  // What the region's content IS: camera | screen_capture | static_graphic |
18375
18549
  // generated. Authoritative for routing when present (regex-over-prose fallback
18376
18550
  // otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
18377
18551
  // overlay layer, never AI-generated.
18378
- kind: z18.string().optional(),
18552
+ kind: z19.string().optional(),
18379
18553
  // Opaque id naming the SPECIFIC on-screen document/note/app-state this
18380
18554
  // screen_capture region shows. Two scenes share it only when they show the SAME
18381
18555
  // recording continuing (scrolling/typing/waiting within it) — a genuinely
18382
18556
  // DIFFERENT document/note/recording (a source video splicing two screen captures)
18383
18557
  // gets a different id. Breaks a persistent-layout run into separate surface stubs
18384
18558
  // instead of asking the operator for one screenshot that can't cover both.
18385
- surface_id: z18.string().optional(),
18559
+ surface_id: z19.string().optional(),
18386
18560
  // Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
18387
18561
  // presenter bubble inside a screen recording) — video-in-video the reproduction
18388
18562
  // must re-composite, not paint into the surface.
18389
- nested: z18.array(z18.object({}).loose()).optional(),
18390
- summary: z18.string().optional(),
18391
- frame_prompt: z18.string().optional(),
18392
- 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()
18393
18567
  }).loose();
18394
- var SceneComposition = z18.object({
18568
+ var SceneComposition = z19.object({
18395
18569
  // full_frame (default) | split_screen | pip | keyed_overlay
18396
- layout: z18.string().optional(),
18570
+ layout: z19.string().optional(),
18397
18571
  // split_screen only: vertical (top/bottom) | horizontal (left/right).
18398
- split_axis: z18.string().optional(),
18399
- regions: z18.array(CompositionRegion).optional()
18572
+ split_axis: z19.string().optional(),
18573
+ regions: z19.array(CompositionRegion).optional()
18400
18574
  }).loose();
18401
- var CameraMotion = z18.object({ movement: z18.string().optional(), detail: z18.string().optional() }).loose();
18402
- var TranscriptWord = z18.object({ text: z18.string().optional() }).loose();
18403
- var Scene = z18.object({
18404
- start_s: z18.number().optional(),
18405
- end_s: z18.number().optional(),
18406
- duration_s: z18.number().optional(),
18407
- summary: z18.string().optional(),
18408
- 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(),
18409
18583
  // The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
18410
18584
  // A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
18411
18585
  // builds one clip per region and stacks/overlays them into the scene picture.
@@ -18413,82 +18587,82 @@ var Scene = z18.object({
18413
18587
  // The capture "look" for this scene — selected from the ad-native shoot-mode
18414
18588
  // grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
18415
18589
  // UGC/product mode; a human can override per scene by setting this.
18416
- shoot_mode: z18.string().optional(),
18590
+ shoot_mode: z19.string().optional(),
18417
18591
  // Diegetic ambient the clip's native audio should carry (no music). When
18418
18592
  // absent the scene falls back to its shoot mode's default ambience.
18419
- ambient: z18.string().optional(),
18593
+ ambient: z19.string().optional(),
18420
18594
  camera_motion: CameraMotion.optional(),
18421
- start_frame_prompt: z18.string().optional(),
18422
- end_frame_prompt: z18.string().optional(),
18423
- 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(),
18424
18598
  // The scene's role in the ad's persuasion arc (DECON-supplied); drives the
18425
18599
  // script re-craft checklist. Inferred from position when absent.
18426
- narrative_role: z18.string().optional(),
18600
+ narrative_role: z19.string().optional(),
18427
18601
  // DECON-supplied on the HOOK scene: the engineered physical/emotional state that
18428
18602
  // makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
18429
18603
  // into the hook's start-frame description so the generator renders that state,
18430
18604
  // not a calm influencer (CCA-11).
18431
- 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(),
18432
18606
  // DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
18433
- scene_setting: z18.string().optional(),
18607
+ scene_setting: z19.string().optional(),
18434
18608
  // How this scene cuts to the next (DECON-supplied). A recognized non-cut type
18435
18609
  // (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
18436
18610
  // boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
18437
18611
  // ignored (nothing follows it).
18438
- transition_out: z18.object({ type: z18.string().optional(), description: z18.string().optional() }).loose().optional(),
18439
- dialogue: z18.array(DialogueLine).optional(),
18440
- sfx: z18.array(Sfx).optional(),
18441
- overlays: z18.array(z18.unknown()).optional(),
18442
- 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(),
18443
18617
  // DECON-supplied: how much the picture itself moves within the shot. Gates the
18444
18618
  // flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
18445
18619
  // (pouring, spreading, hands working) must stay a real clip; freezing it turns
18446
18620
  // a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
18447
- motion_level: z18.enum(["static", "subtle", "dynamic"]).optional(),
18448
- transcript_slice: z18.array(TranscriptWord).optional(),
18621
+ motion_level: z19.enum(["static", "subtle", "dynamic"]).optional(),
18622
+ transcript_slice: z19.array(TranscriptWord).optional(),
18449
18623
  start_frame_asset: FrameAsset,
18450
18624
  end_frame_asset: FrameAsset,
18451
18625
  // DECON-supplied: true when this scene is a length-split CONTINUATION of the
18452
18626
  // previous one (the SAME physical shot, broken up only because it exceeded the
18453
18627
  // clip ceiling). The scaffold then shares the splice keyframe — this scene's
18454
18628
  // start frame IS the previous scene's end frame — so the join is seamless.
18455
- continues_previous: z18.boolean().optional()
18629
+ continues_previous: z19.boolean().optional()
18456
18630
  }).loose();
18457
- var VideoBlueprint = z18.object({
18458
- source: z18.object({ aspect_ratio: z18.string().optional(), duration_s: z18.number().optional() }).loose().optional(),
18459
- global: z18.object({
18460
- music: z18.object({
18461
- present: z18.boolean().optional(),
18462
- 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(),
18463
18637
  // Absolute second the music enters in the reference (the bed often
18464
18638
  // kicks in mid-ad, after the hook). We start the regenerated track here
18465
18639
  // instead of at 0 so the timing matches.
18466
- starts_at_s: z18.number().optional(),
18640
+ starts_at_s: z19.number().optional(),
18467
18641
  // Populated by the deconstruct when AudD (Shazam-style) recognizes the
18468
18642
  // reference track. We never reuse it — only style the regenerated bed.
18469
- 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()
18470
18644
  }).loose().optional(),
18471
- cast: z18.array(
18472
- z18.object({
18473
- id: z18.string().optional(),
18474
- description: z18.string().optional(),
18645
+ cast: z19.array(
18646
+ z19.object({
18647
+ id: z19.string().optional(),
18648
+ description: z19.string().optional(),
18475
18649
  // The deconstruct's note on the target-market localization (e.g. "native
18476
18650
  // French speaker") — read to derive the spoken-track language code.
18477
- market_localization_note: z18.string().optional()
18651
+ market_localization_note: z19.string().optional()
18478
18652
  }).loose()
18479
18653
  ).optional(),
18480
- voiceover: z18.object({
18654
+ voiceover: z19.object({
18481
18655
  // on_camera | mixed → mouths are on screen (lip-sync candidates);
18482
18656
  // voiceover | none → narration over the picture (no lip-sync).
18483
- mode: z18.string().optional(),
18484
- voice_description: z18.string().optional(),
18485
- persona: z18.string().optional()
18657
+ mode: z19.string().optional(),
18658
+ voice_description: z19.string().optional(),
18659
+ persona: z19.string().optional()
18486
18660
  }).loose().optional(),
18487
18661
  // Visual palette — read only to colour a clean brand-card/CTA plate (the
18488
18662
  // first hex is the dominant brand colour); never to drive frame generation.
18489
- 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()
18490
18664
  }).loose().optional(),
18491
- scenes: z18.array(Scene).min(1)
18665
+ scenes: z19.array(Scene).min(1)
18492
18666
  }).loose();
18493
18667
  function injectHookPhysicality(blueprint) {
18494
18668
  for (const scene of blueprint.scenes) {
@@ -18505,26 +18679,26 @@ function clipIntentOf(scene, sceneIndex) {
18505
18679
  if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
18506
18680
  return "body";
18507
18681
  }
18508
- var AppearsItem = z18.union([z18.number(), z18.object({ scene: z18.number(), edge: z18.string().optional() }).loose()]);
18509
- 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({
18510
18684
  // person | animal | product | logo | badge | other
18511
- type: z18.string(),
18512
- label: z18.string().optional(),
18513
- description: z18.string().optional(),
18514
- 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(),
18515
18689
  // When the element maps to a global cast entry, its stable id (for annotation).
18516
- cast_id: z18.string().nullable().optional(),
18690
+ cast_id: z19.string().nullable().optional(),
18517
18691
  // The label of another element that is the SAME individual as this one, shown
18518
18692
  // in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
18519
18693
  // pink shirt and believer in a white shirt). Each look gets its own reference
18520
18694
  // slot, but the face/identity must stay identical across them.
18521
- same_as: z18.string().nullable().optional(),
18695
+ same_as: z19.string().nullable().optional(),
18522
18696
  // Scenes the element appears in. Either a bare list of scene indices (both
18523
18697
  // edges) or per-{scene,edge} entries. Both forms are accepted and merged.
18524
- scenes: z18.array(z18.number()).optional(),
18525
- appears_in: z18.array(AppearsItem).optional()
18698
+ scenes: z19.array(z19.number()).optional(),
18699
+ appears_in: z19.array(AppearsItem).optional()
18526
18700
  }).loose();
18527
- var RecurringElements = z18.array(RecurringElement);
18701
+ var RecurringElements = z19.array(RecurringElement);
18528
18702
  function sanitizeId(raw, fallback) {
18529
18703
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
18530
18704
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -18999,7 +19173,7 @@ function scrubFloatSentences(text, floatDescs) {
18999
19173
  return kept;
19000
19174
  }
19001
19175
  function sceneFloatDescs(scene) {
19002
- const floats = z18.array(FloatingElement).safeParse(scene.floating_elements ?? []);
19176
+ const floats = z19.array(FloatingElement).safeParse(scene.floating_elements ?? []);
19003
19177
  if (!floats.success) return [];
19004
19178
  return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
19005
19179
  }
@@ -20423,25 +20597,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
20423
20597
  }
20424
20598
  return tracks;
20425
20599
  }
20426
- var OverlayStyle = z18.object({ color_hex: z18.string().optional(), background: z18.string().optional(), size: z18.string().optional() }).loose();
20427
- var Overlay = z18.object({
20428
- text: z18.string().optional(),
20429
- appears_at_s: z18.number().optional(),
20430
- duration_s: z18.number().optional(),
20431
- position: z18.string().optional(),
20432
- role: z18.string().optional(),
20433
- animation: z18.string().optional(),
20434
- 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(),
20435
20609
  style: OverlayStyle.optional()
20436
20610
  }).loose();
20437
- var FloatingElement = z18.object({
20438
- kind: z18.string().optional(),
20439
- description: z18.string().optional(),
20440
- brand_name: z18.string().nullish(),
20441
- what_it_represents: z18.string().optional(),
20442
- appears_at_s: z18.number().optional(),
20443
- duration_s: z18.number().optional(),
20444
- 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()
20445
20619
  }).loose();
20446
20620
  function escapeHtml(s) {
20447
20621
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
@@ -20473,7 +20647,7 @@ function positionClass(position) {
20473
20647
  function collectCaptions(blueprint, clock) {
20474
20648
  return blueprint.scenes.flatMap((scene, i) => {
20475
20649
  const sceneStart = scene.start_s ?? 0;
20476
- const overlays = z18.array(Overlay).safeParse(scene.overlays ?? []);
20650
+ const overlays = z19.array(Overlay).safeParse(scene.overlays ?? []);
20477
20651
  return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
20478
20652
  const at = clock.map(i, ov.appears_at_s ?? sceneStart);
20479
20653
  return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
@@ -20553,7 +20727,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
20553
20727
  const windows = /* @__PURE__ */ new Map();
20554
20728
  blueprint.scenes.forEach((scene, i) => {
20555
20729
  const sceneStart = scene.start_s ?? 0;
20556
- const floats = z18.array(FloatingElement).safeParse(scene.floating_elements ?? []);
20730
+ const floats = z19.array(FloatingElement).safeParse(scene.floating_elements ?? []);
20557
20731
  if (!floats.success) return;
20558
20732
  for (const fe of floats.data) {
20559
20733
  const at = clock.map(i, fe.appears_at_s ?? sceneStart);
@@ -21001,8 +21175,8 @@ function buildMotionBoard(blueprint) {
21001
21175
  const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
21002
21176
  cursor = end_s;
21003
21177
  const spoken = sceneSpokenText(scene);
21004
- const overlays = z18.array(Overlay).safeParse(scene.overlays ?? []);
21005
- 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 ?? []);
21006
21180
  const graphics = [
21007
21181
  ...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
21008
21182
  kind: "text",
@@ -22441,7 +22615,7 @@ import path18 from "path";
22441
22615
  import { defineCommand as defineCommand95 } from "citty";
22442
22616
 
22443
22617
  // src/engine/scaffold/staticAd.ts
22444
- import { z as z19 } from "zod";
22618
+ import { z as z20 } from "zod";
22445
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"]);
22446
22620
  var DEFAULT_ASPECT_RATIO = "9:16";
22447
22621
  var SHEET_SUBJECT_TYPE2 = {
@@ -22453,24 +22627,24 @@ var ACTOR_SHEET_IMAGE_SIZE = "4K";
22453
22627
  var ADAPT_MODEL = "google/gemini-3-pro-image-preview";
22454
22628
  var ADAPT_IMAGE_SIZE = "2K";
22455
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.";
22456
- var Blueprint = z19.object({
22457
- meta: z19.object({ estimated_aspect_ratio: z19.string().optional() }).loose().optional(),
22458
- 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()
22459
22633
  }).loose();
22460
- var ElementLocator = z19.object({
22461
- collection: z19.enum(["subjects", "people", "brands_logos"]),
22462
- index: z19.number().int().nonnegative()
22634
+ var ElementLocator = z20.object({
22635
+ collection: z20.enum(["subjects", "people", "brands_logos"]),
22636
+ index: z20.number().int().nonnegative()
22463
22637
  }).loose();
22464
- var MainElement = z19.object({
22638
+ var MainElement = z20.object({
22465
22639
  // logo | product | person | animal | badge | other
22466
- type: z19.string(),
22467
- label: z19.string().optional(),
22468
- description: z19.string().optional(),
22469
- expression: z19.string().nullable().optional(),
22470
- 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(),
22471
22645
  locator: ElementLocator.optional()
22472
22646
  }).loose();
22473
- var MainElements = z19.array(MainElement);
22647
+ var MainElements = z20.array(MainElement);
22474
22648
  function sanitizeId2(raw, fallback) {
22475
22649
  const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
22476
22650
  return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
@@ -29030,7 +29204,24 @@ function parseBrandMd(brandMd, fonts, colors) {
29030
29204
  if (named) for (const n of named) fonts.add(n.slice(1, -1).trim().toLowerCase());
29031
29205
  }
29032
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
+ }
29033
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
+ }
29034
29225
  const globalCss = await safeRead(path24.join(projectRoot, "src", "styles", "global.css"));
29035
29226
  const brandMd = await safeRead(path24.join(projectRoot, "src", "brand", "BRAND.md"));
29036
29227
  if (!globalCss && !brandMd) return EMPTY;