@koda-sl/baker-cli 0.173.1 → 0.176.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.
Files changed (30) hide show
  1. package/README.md +18 -1
  2. package/dist/{chunk-7I2POXSJ.js → chunk-K3PWXVF7.js} +2 -2
  3. package/dist/{chunk-CG6OTNUU.js → chunk-P2T3IZRE.js} +3 -3
  4. package/dist/{chunk-JOPBGFXC.js → chunk-PXXJ3HJW.js} +20 -6
  5. package/dist/chunk-PXXJ3HJW.js.map +1 -0
  6. package/dist/{chunk-R4PG6VCS.js → chunk-X5C6HE24.js} +11 -4
  7. package/dist/chunk-X5C6HE24.js.map +1 -0
  8. package/dist/{chunk-RK67WL4O.js → chunk-YL3HDEIJ.js} +6 -2
  9. package/dist/{chunk-RK67WL4O.js.map → chunk-YL3HDEIJ.js.map} +1 -1
  10. package/dist/{chunk-LVCBCJWF.js → chunk-ZWYQIEBI.js} +7 -4
  11. package/dist/chunk-ZWYQIEBI.js.map +1 -0
  12. package/dist/cli.js +716 -91
  13. package/dist/cli.js.map +1 -1
  14. package/dist/client-PJ7ID35L.js +15 -0
  15. package/dist/engine/index.js +3 -3
  16. package/dist/env-6QJCMTRK.js +13 -0
  17. package/dist/{output-KLK2GZXR.js → output-NWX3YW64.js} +5 -5
  18. package/dist/{shared-AXAXNKGE.js → shared-5ZEOG664.js} +8 -6
  19. package/package.json +1 -1
  20. package/dist/chunk-JOPBGFXC.js.map +0 -1
  21. package/dist/chunk-LVCBCJWF.js.map +0 -1
  22. package/dist/chunk-R4PG6VCS.js.map +0 -1
  23. package/dist/client-R5ZSVIK3.js +0 -15
  24. package/dist/env-3JMYIH25.js +0 -11
  25. /package/dist/{chunk-7I2POXSJ.js.map → chunk-K3PWXVF7.js.map} +0 -0
  26. /package/dist/{chunk-CG6OTNUU.js.map → chunk-P2T3IZRE.js.map} +0 -0
  27. /package/dist/{client-R5ZSVIK3.js.map → client-PJ7ID35L.js.map} +0 -0
  28. /package/dist/{env-3JMYIH25.js.map → env-6QJCMTRK.js.map} +0 -0
  29. /package/dist/{output-KLK2GZXR.js.map → output-NWX3YW64.js.map} +0 -0
  30. /package/dist/{shared-AXAXNKGE.js.map → shared-5ZEOG664.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  toModelSafeImage,
37
37
  ulid,
38
38
  validateCanvasDeep
39
- } from "./chunk-CG6OTNUU.js";
39
+ } from "./chunk-P2T3IZRE.js";
40
40
  import {
41
41
  csvOrJson,
42
42
  daysAgoIso,
@@ -45,7 +45,7 @@ import {
45
45
  resolveAccountIdArg,
46
46
  resolveEffectiveStatus,
47
47
  todayIso
48
- } from "./chunk-JOPBGFXC.js";
48
+ } from "./chunk-PXXJ3HJW.js";
49
49
  import {
50
50
  buildQueryCacheKey,
51
51
  cacheGet,
@@ -55,26 +55,28 @@ import {
55
55
  getQueryTtl,
56
56
  handleConnectionError,
57
57
  isNotConnectedError,
58
+ needsConnectionFix,
58
59
  resolveCustomerId,
59
60
  toCsvRow,
60
61
  writeAdsJson,
61
62
  writeAdsOutput,
62
63
  writeJsonEnvelope
63
- } from "./chunk-R4PG6VCS.js";
64
+ } from "./chunk-X5C6HE24.js";
64
65
  import {
65
66
  ApiError,
66
67
  apiGet,
67
68
  apiPost,
68
69
  validateConvexId
69
- } from "./chunk-LVCBCJWF.js";
70
+ } from "./chunk-ZWYQIEBI.js";
70
71
  import {
71
72
  installStreamTaps,
72
73
  logInvocation
73
- } from "./chunk-7I2POXSJ.js";
74
+ } from "./chunk-K3PWXVF7.js";
74
75
  import {
75
76
  getEnv,
76
- requireChatId
77
- } from "./chunk-RK67WL4O.js";
77
+ requireChatId,
78
+ resolveChatId
79
+ } from "./chunk-YL3HDEIJ.js";
78
80
 
79
81
  // src/cli.ts
80
82
  import { defineCommand as defineCommand188, runMain } from "citty";
@@ -2631,7 +2633,17 @@ var adEffectSchema = z7.object({
2631
2633
  staged: z7.boolean(),
2632
2634
  entity: z7.string().nullable(),
2633
2635
  operation: z7.string().nullable(),
2634
- summary: z7.string().nullable()
2636
+ summary: z7.string().nullable(),
2637
+ /** Addresses the op for `draft show --chat <thisChat> <ref>`, which returns the full payload. */
2638
+ ref: z7.string(),
2639
+ /**
2640
+ * What the publish did with this op, or null while it is still staged. Without it a reader cannot
2641
+ * tell a change that reached the platform from one that was rejected — a whole failed publish
2642
+ * reads exactly like a successful one.
2643
+ */
2644
+ outcome: z7.enum(["applied", "simulated", "failed", "skipped"]).nullable(),
2645
+ /** Why it failed, verbatim from the platform. Null unless the op failed. */
2646
+ error: z7.string().nullable()
2635
2647
  });
2636
2648
  var creativeEffectSchema = z7.object({
2637
2649
  op: effectOpSchema,
@@ -3906,11 +3918,21 @@ var discardCommand = defineCommand4({
3906
3918
 
3907
3919
  // src/commands/actions/draft.ts
3908
3920
  import { defineCommand as defineCommand5 } from "citty";
3921
+
3922
+ // src/commands/chat-arg.ts
3923
+ var CHAT_READ_ARG = {
3924
+ type: "string",
3925
+ description: "Read another chat's staged changes instead of this one's. Start here when asked to redo, reapply or explain what an earlier chat did \u2014 its changes are kept verbatim, including what happened to each one on publish. Never retype an earlier chat's work from a summary."
3926
+ };
3927
+
3928
+ // src/commands/actions/draft.ts
3909
3929
  var REMOVE_OP_KINDS = ["update", "complete", "discard"];
3910
3930
  registerSchema({
3911
3931
  command: "actions.draft.list",
3912
- description: "Review the action ops staged in THIS chat's draft before publish (creates/updates/completes/discards/links). Staged ops are invisible to `actions list`/`status` until the chat publishes \u2014 use this to verify what will apply and catch duplicates.",
3913
- args: {}
3932
+ description: "Review the action ops staged in THIS chat's draft before publish (creates/updates/completes/discards/links). Staged ops are invisible to `actions list`/`status` until the chat publishes \u2014 use this to verify what will apply and catch duplicates. Takes --chat <id> to read an earlier chat's staged ops instead.",
3933
+ args: {
3934
+ chat: { type: "string", description: CHAT_READ_ARG.description, required: false }
3935
+ }
3914
3936
  });
3915
3937
  registerSchema({
3916
3938
  command: "actions.draft.remove",
@@ -3934,9 +3956,10 @@ var listCommand = defineCommand5({
3934
3956
  name: "list",
3935
3957
  description: "Show every action op staged in this chat's draft, with footgun warnings. Example: baker actions draft"
3936
3958
  },
3937
- run: async () => {
3959
+ args: { chat: CHAT_READ_ARG },
3960
+ run: async ({ args }) => {
3938
3961
  try {
3939
- const chatId = requireChatId();
3962
+ const chatId = resolveChatId(args.chat);
3940
3963
  const response = await apiPost("/api/actions/draft", { chatId });
3941
3964
  writeJson(response);
3942
3965
  } catch (err) {
@@ -4007,8 +4030,11 @@ var clearCommand = defineCommand5({
4007
4030
  var draftCommand = defineCommand5({
4008
4031
  meta: {
4009
4032
  name: "draft",
4010
- description: "Review and edit the action ops staged in this chat BEFORE publish. Subcommands: list (default), remove, clear. Staged ops are invisible to `actions list`/`status` until publish, so check here before finishing."
4033
+ description: "Review and edit the action ops staged in this chat BEFORE publish. Subcommands: list (default), remove, clear. Staged ops are invisible to `actions list`/`status` until publish, so check here before finishing. `list` takes --chat <id> to read an earlier chat's staged ops instead."
4011
4034
  },
4035
+ // Declared on the parent too: `default: "list"` dispatches the bare `draft --chat <id>` form, and
4036
+ // citty prints help for a flag the parent does not know instead of forwarding it.
4037
+ args: { chat: CHAT_READ_ARG },
4012
4038
  subCommands: {
4013
4039
  list: listCommand,
4014
4040
  remove: removeCommand,
@@ -4601,7 +4627,7 @@ function accountHints(accounts) {
4601
4627
  }
4602
4628
  function handleAccountsError(err) {
4603
4629
  if (err instanceof ApiError) {
4604
- if (err.code === "UNAUTHORIZED" || err.code === "NOT_FOUND") {
4630
+ if (needsConnectionFix(err.code, err.message)) {
4605
4631
  handleConnectionError("google_ads", err.message);
4606
4632
  }
4607
4633
  const envelope = {
@@ -5144,7 +5170,9 @@ var GOOGLE_ADS_LIMITS = {
5144
5170
  sitelinkLinkTextMax: 25,
5145
5171
  sitelinkDescriptionMax: 35,
5146
5172
  calloutTextMax: 25,
5147
- structuredSnippetHeaderMax: 25,
5173
+ // A snippet's HEADER has no length limit of its own — it has to be one of
5174
+ // Google's published headers (`structured-snippet-headers.ts`), the longest
5175
+ // of which is 29 characters. Only the values are capped.
5148
5176
  structuredSnippetValuesMin: 3,
5149
5177
  structuredSnippetValuesMax: 10
5150
5178
  },
@@ -5324,6 +5352,500 @@ var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
5324
5352
 
5325
5353
  // ../api/src/ads-google/ops.ts
5326
5354
  import { z as z15 } from "zod";
5355
+
5356
+ // ../api/src/ads-google/structured-snippet-headers.ts
5357
+ var STRUCTURED_SNIPPET_HEADERS_EN = [
5358
+ "Brands",
5359
+ "Amenities",
5360
+ "Styles",
5361
+ "Types",
5362
+ "Destinations",
5363
+ "Services",
5364
+ "Courses",
5365
+ "Neighborhoods",
5366
+ "Shows",
5367
+ "Insurance coverage",
5368
+ "Degree programs",
5369
+ "Featured hotels",
5370
+ "Models"
5371
+ ];
5372
+ var STRUCTURED_SNIPPET_HEADERS_LOCALIZED = [
5373
+ "Aanbevolen hotels",
5374
+ "Acara",
5375
+ "Apdro\u0161in\u0101\u0161ana",
5376
+ "Apkaimes",
5377
+ "Arredores",
5378
+ "Asigurare",
5379
+ "Asseguran\xE7a",
5380
+ "Ausstattung",
5381
+ "Automerkit",
5382
+ "Bairros",
5383
+ "Barrios",
5384
+ "Barris",
5385
+ "Bestemmingen",
5386
+ "Biztos\xEDt\xE1si m\xF3dozat",
5387
+ "Blagovne znamke",
5388
+ "Brand",
5389
+ "Br\xE4ndid",
5390
+ "Br\xE4ndit",
5391
+ "Buurten",
5392
+ "Cakupan asuransi",
5393
+ "Carreras universitarias",
5394
+ "Cartiere",
5395
+ "Ch\u01B0\u01A1ng tr\xECnh",
5396
+ "Cilji",
5397
+ "Cobertura de seguro",
5398
+ "Cobertura do seguro",
5399
+ "Comodidades",
5400
+ "Coperture assicurativa",
5401
+ "Corsi",
5402
+ "Corsi di laurea",
5403
+ "Cours",
5404
+ "Couverture d'assurance",
5405
+ "Cursos",
5406
+ "Cursuri",
5407
+ "Cursussen",
5408
+ "C\xEDle",
5409
+ "C\u1EA5p b\u1EB1ng",
5410
+ "Degree programmes",
5411
+ "Dekking",
5412
+ "Design",
5413
+ "Destinacions",
5414
+ "Destinasi",
5415
+ "Destinasjoner",
5416
+ "Destinationer",
5417
+ "Destinazioni",
5418
+ "Destina\u021Bii",
5419
+ "Destinos",
5420
+ "Destin\xE1cie",
5421
+ "Dienstleistungen",
5422
+ "Diplomaprogramok",
5423
+ "Dot\u0103ri",
5424
+ "Draudimo apr\u0117ptis",
5425
+ "Dzielnice",
5426
+ "D\u1ECBch v\u1EE5",
5427
+ "Emisije",
5428
+ "Emisiuni",
5429
+ "Espect\xE1culos",
5430
+ "Estilos",
5431
+ "Estils",
5432
+ "Faciliteter",
5433
+ "Fasilitas",
5434
+ "Fasiliteter",
5435
+ "Forsikringsdekning",
5436
+ "Forsikringsd\xE6kning",
5437
+ "F\xF6rs\xE4kringstyper",
5438
+ "Galam\u0113r\u0137i",
5439
+ "Gaya",
5440
+ "Hizmetler",
5441
+ "Hotel consigliati",
5442
+ "Hotel ditampilkan",
5443
+ "Hotel pilihan",
5444
+ "Hoteles destacados",
5445
+ "Hotels destacats",
5446
+ "Hoteluri prezentate",
5447
+ "Hot\xE9is em destaque",
5448
+ "Istaknuti hoteli",
5449
+ "Itinatampok na hotel",
5450
+ "Jenama",
5451
+ "Jenis",
5452
+ "Kaupunginosat",
5453
+ "Kawasan",
5454
+ "Kejiranan",
5455
+ "Kemudahan",
5456
+ "Kh\xE1ch s\u1EA1n n\u1ED5i b\u1EADt",
5457
+ "Kh\xF3a h\u1ECDc",
5458
+ "Kiemelt sz\xE1llod\xE1k",
5459
+ "Kierunki studi\xF3w",
5460
+ "Kindlustuskaitse",
5461
+ "Ki\u1EC3u",
5462
+ "Kohteet",
5463
+ "Kraadi\xF5ppeprogrammid",
5464
+ "Kritje zavarovanj",
5465
+ "Kurs",
5466
+ "Kursai",
5467
+ "Kurse",
5468
+ "Kurser",
5469
+ "Kursi",
5470
+ "Kurslar",
5471
+ "Kurssit",
5472
+ "Kursus",
5473
+ "Kursused",
5474
+ "Kursy",
5475
+ "Kurzy",
5476
+ "Laidos",
5477
+ "Layanan",
5478
+ "Licenciaturas",
5479
+ "Liputan insurans",
5480
+ "Lisans programlar\u0131",
5481
+ "Lis\xE4palvelut",
5482
+ "Lokalomr\xE5der",
5483
+ "Lo\u1EA1i",
5484
+ "Mahalleler",
5485
+ "Marcas",
5486
+ "Markalar",
5487
+ "Marken",
5488
+ "Marki",
5489
+ "Marques",
5490
+ "Mata pelajaran",
5491
+ "Merek",
5492
+ "Merken",
5493
+ "Merkevarer",
5494
+ "Mga Amenity",
5495
+ "Mga Brand",
5496
+ "Mga Destinasyon",
5497
+ "Mga Istilo",
5498
+ "Mga Komunidad",
5499
+ "Mga Kurso",
5500
+ "Mga Modelo",
5501
+ "Mga Palabas",
5502
+ "Mga Serbisyo",
5503
+ "Mga Uri",
5504
+ "Mga degree program",
5505
+ "Miejsca",
5506
+ "Model",
5507
+ "Modele",
5508
+ "Modeli",
5509
+ "Modeliai",
5510
+ "Modelle",
5511
+ "Modellek",
5512
+ "Modellen",
5513
+ "Modeller",
5514
+ "Modelli",
5515
+ "Modelos",
5516
+ "Modely",
5517
+ "Mode\u013Ci",
5518
+ "Mod\xE8les",
5519
+ "Moksliniai laipsniai",
5520
+ "Mudelid",
5521
+ "Mugavusteenused",
5522
+ "M\xE1rk\xE1k",
5523
+ "M\u0103rci",
5524
+ "M\u0171sorok",
5525
+ "Nabolag",
5526
+ "Nam\u0173 apylink\u0117s",
5527
+ "Neighbourhoods",
5528
+ "Oddaje",
5529
+ "Odpor\xFA\u010Dan\xE9 hotely",
5530
+ "Odredi\u0161ta",
5531
+ "Oppiaineet",
5532
+ "Osiguranje",
5533
+ "Pakalpojumi",
5534
+ "Palvelut",
5535
+ "Paskirties vietos",
5536
+ "Paslaugos",
5537
+ "Patogumai",
5538
+ "Perkhidmatan",
5539
+ "Ph\u1EA1m vi b\u1EA3o hi\u1EC3m",
5540
+ "Pied\u0101v\u0101t\u0101s viesn\u012Bcas",
5541
+ "Poistenie",
5542
+ "Poji\u0161t\u011Bn\xED",
5543
+ "Polecane hotele",
5544
+ "Ponudba",
5545
+ "Po\u0159ady",
5546
+ "Predstavljeni hoteli",
5547
+ "Preki\u0173 \u017Eenklai",
5548
+ "Program",
5549
+ "Program ijazah",
5550
+ "Program sarjana",
5551
+ "Programas",
5552
+ "Programas de gradua\xE7\xE3o",
5553
+ "Programe de studiu",
5554
+ "Programes",
5555
+ "Programlar",
5556
+ "Programmer",
5557
+ "Programmes d'\xE9tudes",
5558
+ "Programmi",
5559
+ "Programy",
5560
+ "P\u0101rraides",
5561
+ "Quartieri",
5562
+ "Quartiers",
5563
+ "Rancangan",
5564
+ "Rel\xE1cie",
5565
+ "Resm\xE5l",
5566
+ "Robne marke",
5567
+ "Saated ja etendused",
5568
+ "Sadr\u017Eaji",
5569
+ "Sakop ng insurance",
5570
+ "Serien",
5571
+ "Serier",
5572
+ "Serveis",
5573
+ "Serveis addicionals",
5574
+ "Servicii",
5575
+ "Servicios",
5576
+ "Servicios adicionales",
5577
+ "Servizi",
5578
+ "Servi\xE7os",
5579
+ "Show't",
5580
+ "Sigorta kapsam\u0131",
5581
+ "Sihtkohad",
5582
+ "Si\u016Blomi vie\u0161bu\u010Diai",
5583
+ "Slogi",
5584
+ "Slu\u017Eby",
5585
+ "Soovitatud hotellid",
5586
+ "Soseske",
5587
+ "Stiilid",
5588
+ "Stijlen",
5589
+ "Stilar",
5590
+ "Stile",
5591
+ "Stiler",
5592
+ "Stili",
5593
+ "Stiliai",
5594
+ "Stiller",
5595
+ "Stilovi",
5596
+ "Stiluri",
5597
+ "Storitve",
5598
+ "Studieng\xE4nge",
5599
+ "Studieprogramma's",
5600
+ "Studijn\xED programy",
5601
+ "Studijski programi",
5602
+ "Studiju programmas",
5603
+ "Style",
5604
+ "Styly",
5605
+ "St\xEDlusok",
5606
+ "Sunulan olanaklar",
5607
+ "Suositellut hotellit",
5608
+ "Szolg\xE1ltat\xE1sok",
5609
+ "S\xE9lection d'h\xF4tels",
5610
+ "Tanfolyamok",
5611
+ "Teenused",
5612
+ "Te\u010Dajevi",
5613
+ "Te\u010Daji",
5614
+ "Th\u01B0\u01A1ng hi\u1EC7u",
5615
+ "Tipai",
5616
+ "Tipi",
5617
+ "Tipos",
5618
+ "Tipuri",
5619
+ "Tipus",
5620
+ "Titulacions",
5621
+ "Ti\u1EC7n nghi",
5622
+ "Tjenester",
5623
+ "Tj\xE4nster",
5624
+ "Typen",
5625
+ "Typer",
5626
+ "Typy",
5627
+ "Tyylit",
5628
+ "Tyypit",
5629
+ "T\xEDpusok",
5630
+ "T\xFCrler",
5631
+ "T\xFC\xFCbid",
5632
+ "Ubezpieczenia",
5633
+ "Uddannelser",
5634
+ "Udogodnienia",
5635
+ "Udvalgte hoteller",
5636
+ "Usluge",
5637
+ "Us\u0142ugi",
5638
+ "Utbildningsprogram",
5639
+ "Utdanningsprogrammer",
5640
+ "Utvalda hotell",
5641
+ "Utvalgte hoteller",
5642
+ "Vakuutukset",
5643
+ "Varum\xE4rken",
5644
+ "Veidi",
5645
+ "Versicherungsleistung",
5646
+ "Viertel",
5647
+ "Voorzieningen",
5648
+ "Vorgestellte Hotels",
5649
+ "Vrste",
5650
+ "Vybavenie",
5651
+ "Vybaven\xED",
5652
+ "Vybran\xE9 hotely",
5653
+ "Vzdel\xE1vacie programy",
5654
+ "V\xE1rosr\xE9szek",
5655
+ "V\xF9ng l\xE2n c\u1EADn",
5656
+ "Ziele",
5657
+ "Zna\u010Dky",
5658
+ "Zn\xE1m\xE9 oblasti",
5659
+ "Z\u012Bmoli",
5660
+ "destinasyonlar",
5661
+ "\xC9missions",
5662
+ "\xC9quipements",
5663
+ "\xD6ne \xE7\u0131kan oteller",
5664
+ "\xDAti c\xE9lok",
5665
+ "\xDCmbruskonnad",
5666
+ "\u010Cetvrti",
5667
+ "\u0110i\u1EC3m \u0111\u1EBFn",
5668
+ "\u0112rt\u012Bbas",
5669
+ "\u0160tudijski programi",
5670
+ "\u0160tvrte",
5671
+ "\u0160t\xFDly",
5672
+ "\u0391\u03C3\u03C6\u03B1\u03BB\u03B9\u03C3\u03C4\u03B9\u03BA\u03AE \u03BA\u03AC\u03BB\u03C5\u03C8\u03B7",
5673
+ "\u0393\u03B5\u03B9\u03C4\u03BF\u03BD\u03B9\u03AD\u03C2",
5674
+ "\u0395\u03BA\u03C0\u03BF\u03BC\u03C0\u03AD\u03C2",
5675
+ "\u0395\u03C0\u03C9\u03BD\u03C5\u03BC\u03AF\u03B5\u03C2",
5676
+ "\u039C\u03B1\u03B8\u03AE\u03BC\u03B1\u03C4\u03B1",
5677
+ "\u039C\u03BF\u03BD\u03C4\u03AD\u03BB\u03B1",
5678
+ "\u039E\u03B5\u03BD\u03BF\u03B4\u03BF\u03C7\u03B5\u03AF\u03B1",
5679
+ "\u03A0\u03B1\u03C1\u03BF\u03C7\u03AD\u03C2",
5680
+ "\u03A0\u03C1\u03BF\u03B3\u03C1\u03AC\u03BC\u03BC\u03B1\u03C4\u03B1 \u03C0\u03C4\u03C5\u03C7\u03AF\u03C9\u03BD",
5681
+ "\u03A0\u03C1\u03BF\u03BF\u03C1\u03B9\u03C3\u03BC\u03BF\u03AF",
5682
+ "\u03A3\u03C4\u03C5\u03BB",
5683
+ "\u03A4\u03CD\u03C0\u03BF\u03B9",
5684
+ "\u03A5\u03C0\u03B7\u03C1\u03B5\u03C3\u03AF\u03B5\u03C2",
5685
+ "\u0411\u0440\u0435\u043D\u0434\u0438",
5686
+ "\u0411\u0440\u0435\u043D\u0434\u044B",
5687
+ "\u0414\u0435\u0441\u0442\u0438\u043D\u0430\u0446\u0438\u0438",
5688
+ "\u0417\u0430\u0441\u0442\u0440\u0430\u0445\u043E\u0432\u043A\u0430",
5689
+ "\u0417\u0440\u0443\u0447\u043D\u043E\u0441\u0442\u0456",
5690
+ "\u041A\u0432\u0430\u0440\u0442\u0430\u043B\u0438",
5691
+ "\u041A\u0443\u0440\u0441\u0438",
5692
+ "\u041A\u0443\u0440\u0441\u043E\u0432\u0435",
5693
+ "\u041A\u0443\u0440\u0441\u044B",
5694
+ "\u041C\u0430\u0440\u043A\u0438",
5695
+ "\u041C\u0435\u0441\u0442\u0430",
5696
+ "\u041C\u043E\u0434\u0435\u043B\u0438",
5697
+ "\u041C\u043E\u0434\u0435\u043B\u0456",
5698
+ "\u041C\u0456\u0441\u0446\u044F",
5699
+ "\u041E\u0441\u0432\u0456\u0442\u043D\u0456 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u0438",
5700
+ "\u041F\u043E\u0441\u043B\u0443\u0433\u0438",
5701
+ "\u041F\u0440\u0435\u0434\u0430\u0432\u0430\u043D\u0438\u044F",
5702
+ "\u041F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0435\u043D\u0438 \u0445\u043E\u0442\u0435\u043B\u0438",
5703
+ "\u041F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u0432\u044B\u0441\u0448\u0435\u0433\u043E \u043E\u0431\u0440\u0430\u0437\u043E\u0432\u0430\u043D\u0438\u044F",
5704
+ "\u0420\u0430\u0439\u043E\u043D\u044B",
5705
+ "\u0420\u0435\u043A\u043E\u043C\u0435\u043D\u0434\u043E\u0432\u0430\u043D\u0456 \u0433\u043E\u0442\u0435\u043B\u0456",
5706
+ "\u0420\u0435\u043A\u043E\u043C\u0435\u043D\u0434\u0443\u0435\u043C\u044B\u0435 \u043E\u0442\u0435\u043B\u0438",
5707
+ "\u0421\u043F\u0435\u0446\u0438\u0430\u043B\u043D\u043E\u0441\u0442\u0438",
5708
+ "\u0421\u0442\u0438\u043B\u0438",
5709
+ "\u0421\u0442\u0438\u043B\u043E\u0432\u0435",
5710
+ "\u0421\u0442\u0438\u043B\u0456",
5711
+ "\u0421\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430",
5712
+ "\u0421\u0442\u0440\u0430\u0445\u043E\u0432\u0438\u0439 \u0437\u0430\u0445\u0438\u0441\u0442",
5713
+ "\u0422\u0438\u043F\u0438",
5714
+ "\u0422\u0438\u043F\u043E\u0432\u0435",
5715
+ "\u0422\u0438\u043F\u044B",
5716
+ "\u0423\u0434\u043E\u0431\u0441\u0442\u0432\u0430",
5717
+ "\u0423\u0441\u043B\u0443\u0433\u0438",
5718
+ "\u0428\u043E\u0443",
5719
+ "\u0431\u0440\u0435\u043D\u0434\u043E\u0432\u0438",
5720
+ "\u0434\u0435\u043B\u043E\u0432\u0438 \u0433\u0440\u0430\u0434\u0430",
5721
+ "\u0434\u0435\u0441\u0442\u0438\u043D\u0430\u0446\u0438\u0458\u0435",
5722
+ "\u0434\u0438\u043F\u043B\u043E\u043C\u0435",
5723
+ "\u0435\u043C\u0438\u0441\u0438\u0458\u0435",
5724
+ "\u0438\u0441\u0442\u0430\u043A\u043D\u0443\u0442\u0438 \u0445\u043E\u0442\u0435\u043B\u0438",
5725
+ "\u043A\u0443\u0440\u0441\u0435\u0432\u0438",
5726
+ "\u043C\u043E\u0434\u0435\u043B\u0438",
5727
+ "\u043E\u0441\u0438\u0433\u0443\u0440\u0430\u045A\u0435",
5728
+ "\u0441\u0430\u0434\u0440\u0436\u0430\u0458\u0438",
5729
+ "\u0441\u0442\u0438\u043B\u043E\u0432\u0438",
5730
+ "\u0442\u0438\u043F\u043E\u0432\u0438",
5731
+ "\u0443\u0441\u043B\u0443\u0433\u0435",
5732
+ "\u05D3\u05D2\u05DE\u05D9\u05DD",
5733
+ "\u05D4\u05D5\u05E4\u05E2\u05D5\u05EA \u05D5\u05EA\u05D5\u05DB\u05E0\u05D9\u05D5\u05EA",
5734
+ "\u05D9\u05E2\u05D3\u05D9\u05DD \u05D2\u05D9\u05D0\u05D5\u05D2\u05E8\u05E4\u05D9\u05D9\u05DD",
5735
+ "\u05DB\u05D9\u05E1\u05D5\u05D9 \u05D1\u05D9\u05D8\u05D5\u05D7\u05D9",
5736
+ "\u05DE\u05D5\u05EA\u05D2\u05D9\u05DD",
5737
+ "\u05DE\u05DC\u05D5\u05E0\u05D5\u05EA \u05DE\u05D5\u05DE\u05DC\u05E6\u05D9\u05DD",
5738
+ "\u05E1\u05D2\u05E0\u05D5\u05E0\u05D5\u05EA",
5739
+ "\u05E1\u05D5\u05D2\u05D9\u05DD",
5740
+ "\u05E7\u05D5\u05E8\u05E1\u05D9\u05DD",
5741
+ "\u05E9\u05D9\u05E8\u05D5\u05EA\u05D9 \u05D4\u05DE\u05E7\u05D5\u05DD",
5742
+ "\u05E9\u05D9\u05E8\u05D5\u05EA\u05D9\u05DD",
5743
+ "\u05E9\u05DB\u05D5\u05E0\u05D5\u05EA",
5744
+ "\u05EA\u05D5\u05DB\u05E0\u05D9\u05D5\u05EA \u05DC\u05DC\u05D9\u05DE\u05D5\u05D3\u05D9 \u05EA\u05D5\u05D0\u05E8",
5745
+ "\u0627\u0644\u0623\u062D\u064A\u0627\u0621",
5746
+ "\u0627\u0644\u0623\u0646\u0645\u0627\u0637",
5747
+ "\u0627\u0644\u0623\u0646\u0648\u0627\u0639",
5748
+ "\u0627\u0644\u062A\u063A\u0637\u064A\u0629 \u0627\u0644\u062A\u0623\u0645\u064A\u0646\u064A\u0629",
5749
+ "\u0627\u0644\u062E\u062F\u0645\u0627\u062A",
5750
+ "\u0627\u0644\u062F\u0648\u0631\u0627\u062A \u0627\u0644\u062A\u062F\u0631\u064A\u0628\u064A\u0629",
5751
+ "\u0627\u0644\u0639\u0631\u0648\u0636",
5752
+ "\u0627\u0644\u0639\u0644\u0627\u0645\u0627\u062A \u0627\u0644\u062A\u062C\u0627\u0631\u064A\u0629",
5753
+ "\u0627\u0644\u0641\u0646\u0627\u062F\u0642 \u0627\u0644\u0645\u0645\u064A\u0651\u0632\u0629",
5754
+ "\u0627\u0644\u0646\u0645\u0627\u0630\u062C",
5755
+ "\u0627\u0644\u0648\u062C\u0647\u0627\u062A",
5756
+ "\u0628\u0631\u0627\u0645\u062C \u0627\u0644\u0634\u0647\u0627\u062F\u0627\u062A",
5757
+ "\u0648\u0633\u0627\u0626\u0644 \u0627\u0644\u0631\u0627\u062D\u0629",
5758
+ "\u0906\u0938-\u092A\u0921\u093C\u094B\u0938",
5759
+ "\u0917\u0902\u0924\u0935\u094D\u092F",
5760
+ "\u0921\u093F\u0917\u094D\u0930\u0940 \u0915\u093E\u0930\u094D\u092F\u0915\u094D\u0930\u092E",
5761
+ "\u092A\u093E\u0920\u094D\u200D\u092F\u0915\u094D\u0930\u092E",
5762
+ "\u092A\u094D\u0930\u0915\u093E\u0930",
5763
+ "\u092A\u094D\u0930\u0926\u0930\u094D\u0936\u093F\u0924 \u0939\u094B\u091F\u0932",
5764
+ "\u092C\u0940\u092E\u093E \u0915\u0935\u0930\u0947\u091C",
5765
+ "\u092C\u094D\u0930\u093E\u0902\u0921",
5766
+ "\u092E\u0949\u0921\u0932",
5767
+ "\u0936\u0948\u0932\u093F\u092F\u093E\u0902",
5768
+ "\u0936\u094B",
5769
+ "\u0938\u0941\u0935\u093F\u0927\u093E\u090F\u0902",
5770
+ "\u0938\u0947\u0935\u093E\u090F\u0902",
5771
+ "\u0E04\u0E27\u0E32\u0E21\u0E04\u0E38\u0E49\u0E21\u0E04\u0E23\u0E2D\u0E07\u0E43\u0E19\u0E1B\u0E23\u0E30\u0E01\u0E31\u0E19",
5772
+ "\u0E1A\u0E23\u0E34\u0E01\u0E32\u0E23",
5773
+ "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17",
5774
+ "\u0E1B\u0E25\u0E32\u0E22\u0E17\u0E32\u0E07",
5775
+ "\u0E22\u0E48\u0E32\u0E19\u0E43\u0E01\u0E25\u0E49\u0E40\u0E04\u0E35\u0E22\u0E07",
5776
+ "\u0E23\u0E38\u0E48\u0E19",
5777
+ "\u0E2A\u0E34\u0E48\u0E07\u0E2D\u0E33\u0E19\u0E27\u0E22\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E30\u0E14\u0E27\u0E01",
5778
+ "\u0E2A\u0E44\u0E15\u0E25\u0E4C",
5779
+ "\u0E2B\u0E25\u0E31\u0E01\u0E2A\u0E39\u0E15\u0E23",
5780
+ "\u0E2B\u0E25\u0E31\u0E01\u0E2A\u0E39\u0E15\u0E23\u0E1B\u0E23\u0E34\u0E0D\u0E0D\u0E32",
5781
+ "\u0E41\u0E1A\u0E23\u0E19\u0E14\u0E4C",
5782
+ "\u0E42\u0E0A\u0E27\u0E4C",
5783
+ "\u0E42\u0E23\u0E07\u0E41\u0E23\u0E21\u0E40\u0E14\u0E48\u0E19",
5784
+ "\u304A\u3059\u3059\u3081\u306E\u30DB\u30C6\u30EB",
5785
+ "\u30B3\u30FC\u30B9",
5786
+ "\u30B5\u30FC\u30D3\u30B9",
5787
+ "\u30B9\u30BF\u30A4\u30EB",
5788
+ "\u30BF\u30A4\u30D7",
5789
+ "\u30D6\u30E9\u30F3\u30C9",
5790
+ "\u30E2\u30C7\u30EB",
5791
+ "\u4FDD\u967A\u306E\u4FDD\u969C",
5792
+ "\u4FDD\u969C\u7BC4\u570D",
5793
+ "\u5230\u7740\u5730",
5794
+ "\u5468\u8FBA\u5730\u57DF",
5795
+ "\u54C1\u724C",
5796
+ "\u578B\u53F7",
5797
+ "\u578B\u865F",
5798
+ "\u5B66\u4F4D\u30D7\u30ED\u30B0\u30E9\u30E0",
5799
+ "\u5B66\u4F4D\u8BFE\u7A0B",
5800
+ "\u5B78\u4F4D\u8AB2\u7A0B",
5801
+ "\u627F\u4FDD\u7BC4\u570D",
5802
+ "\u670D\u52A1",
5803
+ "\u670D\u52D9",
5804
+ "\u6B3E\u5F0F",
5805
+ "\u7279\u8272\u9152\u5E97",
5806
+ "\u756A\u7D44",
5807
+ "\u76EE\u7684\u5730",
5808
+ "\u793E\u533A",
5809
+ "\u793E\u5340",
5810
+ "\u7BC0\u76EE",
5811
+ "\u7C7B\u578B",
5812
+ "\u7CBE\u9009\u9152\u5E97",
5813
+ "\u7CBE\u9078\u98EF\u5E97",
5814
+ "\u8282\u76EE",
5815
+ "\u8A2D\u5099",
5816
+ "\u8A2D\u65BD",
5817
+ "\u8AB2\u7A0B",
5818
+ "\u8BBE\u65BD",
5819
+ "\u8BFE\u7A0B",
5820
+ "\u9669\u79CD",
5821
+ "\u985E\u578B",
5822
+ "\uACFC\uC815",
5823
+ "\uBAA8\uB378",
5824
+ "\uBAA9\uC801\uC9C0",
5825
+ "\uBCF4\uD5D8 \uBCF4\uC0C1 \uBC94\uC704",
5826
+ "\uBE0C\uB79C\uB4DC",
5827
+ "\uC11C\uBE44\uC2A4",
5828
+ "\uC2A4\uD0C0\uC77C",
5829
+ "\uC720\uD615",
5830
+ "\uC778\uADFC \uC9C0\uC5ED",
5831
+ "\uCD94\uCC9C \uD638\uD154",
5832
+ "\uD3B8\uC758 \uC2DC\uC124",
5833
+ "\uD504\uB85C\uADF8\uB7A8",
5834
+ "\uD559\uC704 \uCDE8\uB4DD \uD504\uB85C\uADF8\uB7A8"
5835
+ ];
5836
+ var HEADER_ALIASES = /* @__PURE__ */ new Map([["service catalog", "Services"]]);
5837
+ var ACCEPTED = /* @__PURE__ */ new Set([...STRUCTURED_SNIPPET_HEADERS_EN, ...STRUCTURED_SNIPPET_HEADERS_LOCALIZED]);
5838
+ var BY_FOLDED_CASE = new Map([...ACCEPTED].map((header) => [header.toLowerCase(), header]));
5839
+ function canonicalStructuredSnippetHeader(header) {
5840
+ const trimmed = header.trim();
5841
+ if (ACCEPTED.has(trimmed)) {
5842
+ return trimmed;
5843
+ }
5844
+ const folded = trimmed.toLowerCase();
5845
+ return HEADER_ALIASES.get(folded) ?? BY_FOLDED_CASE.get(folded);
5846
+ }
5847
+
5848
+ // ../api/src/ads-google/ops.ts
5327
5849
  var tempRefSchema2 = z15.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
5328
5850
  var refSchema = z15.union([
5329
5851
  z15.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
@@ -5625,9 +6147,20 @@ var calloutAssetSchema = z15.object({
5625
6147
  type: z15.literal("callout"),
5626
6148
  calloutText: z15.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
5627
6149
  });
6150
+ var structuredSnippetHeaderSchema = z15.string().min(1).transform((header, ctx) => {
6151
+ const canonical2 = canonicalStructuredSnippetHeader(header);
6152
+ if (!canonical2) {
6153
+ ctx.addIssue({
6154
+ code: "custom",
6155
+ message: `Google Ads does not accept "${header}" as a structured snippet header. Use one of: ${STRUCTURED_SNIPPET_HEADERS_EN.join(", ")} \u2014 or that header in the campaign's language.`
6156
+ });
6157
+ return z15.NEVER;
6158
+ }
6159
+ return canonical2;
6160
+ });
5628
6161
  var structuredSnippetAssetSchema = z15.object({
5629
6162
  type: z15.literal("structuredSnippet"),
5630
- header: z15.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
6163
+ header: structuredSnippetHeaderSchema,
5631
6164
  values: z15.array(z15.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
5632
6165
  });
5633
6166
  var callToActionAssetSchema = z15.object({ type: z15.literal("callToAction"), callToAction: z15.string().min(1) });
@@ -5647,7 +6180,7 @@ var assetUpdateSchema = z15.object({
5647
6180
  description2: z15.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
5648
6181
  finalUrls: z15.array(httpsUrlSchema2).min(1).optional(),
5649
6182
  calloutText: z15.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
5650
- header: z15.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
6183
+ header: structuredSnippetHeaderSchema.optional(),
5651
6184
  values: z15.array(z15.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
5652
6185
  callToAction: z15.string().min(1).optional(),
5653
6186
  text: z15.string().min(1).optional()
@@ -7750,18 +8283,18 @@ async function stageUpdate(kind, customerId, target, payload, hints) {
7750
8283
  async function stageTarget(kind, customerId, target, hints) {
7751
8284
  await stageGoogleOp({ kind, customerId, target }, hints);
7752
8285
  }
7753
- async function draftAction(path28, body) {
8286
+ async function draftAction(path28, body, chat) {
7754
8287
  try {
7755
- const chatId = requireChatId();
8288
+ const chatId = resolveChatId(chat);
7756
8289
  const response = await apiPost(path28, { chatId, ...body });
7757
8290
  writeJsonEnvelope(response);
7758
8291
  } catch (err) {
7759
8292
  handleGoogleError(err);
7760
8293
  }
7761
8294
  }
7762
- async function draftListAction(json) {
8295
+ async function draftListAction(json, chat) {
7763
8296
  try {
7764
- const chatId = requireChatId();
8297
+ const chatId = resolveChatId(chat);
7765
8298
  const response = await apiPost("/api/ads/google/draft", { chatId });
7766
8299
  if (json || !response.ok || !response.data) {
7767
8300
  writeJsonEnvelope(response);
@@ -7776,16 +8309,22 @@ async function draftListAction(json) {
7776
8309
 
7777
8310
  // src/commands/ads/google/draft.ts
7778
8311
  var draftCommand2 = defineCommand22({
7779
- meta: { name: "draft", description: "List, remove, clear, amend, or show staged Google Ads write ops for this chat" },
8312
+ meta: {
8313
+ name: "draft",
8314
+ description: "List, remove, clear, amend, or show staged Google Ads write ops for this chat. `list` and `show` take --chat <id> to read an earlier chat's changes instead."
8315
+ },
7780
8316
  subCommands: {
7781
8317
  list: defineCommand22({
7782
8318
  meta: {
7783
8319
  name: "list",
7784
8320
  description: "Review everything staged as a campaign \u25B8 ad group \u25B8 ad tree (--json for the raw envelope)"
7785
8321
  },
7786
- args: { json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable tree" } },
8322
+ args: {
8323
+ json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable tree" },
8324
+ chat: CHAT_READ_ARG
8325
+ },
7787
8326
  run: async ({ args }) => {
7788
- await draftListAction(args.json === true);
8327
+ await draftListAction(args.json === true, args.chat);
7789
8328
  }
7790
8329
  }),
7791
8330
  remove: defineCommand22({
@@ -7831,10 +8370,11 @@ var draftCommand2 = defineCommand22({
7831
8370
  type: "positional",
7832
8371
  description: "Staged op ref (g_temp_*) or target id/resource name",
7833
8372
  required: false
7834
- }
8373
+ },
8374
+ chat: CHAT_READ_ARG
7835
8375
  },
7836
8376
  run: async ({ args }) => {
7837
- await draftAction("/api/ads/google/draft/show", { ref: requireTarget(args, "op") });
8377
+ await draftAction("/api/ads/google/draft/show", { ref: requireTarget(args, "op") }, args.chat);
7838
8378
  }
7839
8379
  })
7840
8380
  }
@@ -10207,10 +10747,7 @@ import { readFileSync as readFileSync4 } from "fs";
10207
10747
  var DAY_MS2 = 864e5;
10208
10748
  function handleLinkedinError(err) {
10209
10749
  if (err instanceof ApiError) {
10210
- if (err.code === "UNAUTHORIZED") {
10211
- handleConnectionError("linkedin_ads", err.message);
10212
- }
10213
- if (err.code === "NOT_FOUND") {
10750
+ if (needsConnectionFix(err.code, err.message)) {
10214
10751
  handleConnectionError("linkedin_ads", err.message);
10215
10752
  }
10216
10753
  if (isNoAccountsSelectedError(err.code, err.message)) {
@@ -10608,6 +11145,7 @@ function requireTargets(args, entity) {
10608
11145
  }
10609
11146
 
10610
11147
  // src/commands/ads/linkedin/schemas.ts
11148
+ var CHAT_READ_ARG_DESCRIPTION = CHAT_READ_ARG.description;
10611
11149
  registerSchema({
10612
11150
  command: "ads.linkedin.accounts",
10613
11151
  description: "List LinkedIn ad accounts in the company's connected scope. Pass --include-all to list every account the OAuth token can see.",
@@ -11306,7 +11844,8 @@ registerSchema({
11306
11844
  type: "boolean",
11307
11845
  description: "Print the raw JSON envelope instead of the readable tree",
11308
11846
  required: false
11309
- }
11847
+ },
11848
+ chat: { type: "string", description: CHAT_READ_ARG_DESCRIPTION, required: false }
11310
11849
  }
11311
11850
  });
11312
11851
  registerSchema({
@@ -11320,6 +11859,18 @@ registerSchema({
11320
11859
  }
11321
11860
  }
11322
11861
  });
11862
+ registerSchema({
11863
+ command: "ads.linkedin.draft.show",
11864
+ description: "Print the full staged payload for one LinkedIn op \u2014 the receipt to verify a change looks right before publish (never truncated), and the only way to read back verbatim what an earlier chat wrote.",
11865
+ args: {
11866
+ ref: {
11867
+ type: "positional",
11868
+ description: "Op ref (li_temp_* for creates, target id/URN for updates)",
11869
+ required: true
11870
+ },
11871
+ chat: { type: "string", description: CHAT_READ_ARG_DESCRIPTION, required: false }
11872
+ }
11873
+ });
11323
11874
  registerSchema({
11324
11875
  command: "ads.linkedin.draft.clear",
11325
11876
  description: "Discard ALL staged LinkedIn ops in this chat's draft. Nothing applies on publish.",
@@ -13510,9 +14061,9 @@ function renderDraftStatus2(data) {
13510
14061
  }
13511
14062
 
13512
14063
  // src/commands/ads/linkedin/draft.ts
13513
- async function listDraft(json) {
14064
+ async function listDraft(json, chat) {
13514
14065
  try {
13515
- const chatId = requireChatId();
14066
+ const chatId = resolveChatId(chat);
13516
14067
  const response = await apiPost("/api/ads/linkedin/draft", {
13517
14068
  chatId
13518
14069
  });
@@ -13531,9 +14082,12 @@ var listCommand3 = defineCommand45({
13531
14082
  name: "list",
13532
14083
  description: "Review everything staged as a Campaign group \u25B8 Campaign \u25B8 Creative tree (--json for the raw envelope). Example: baker ads linkedin draft"
13533
14084
  },
13534
- args: { json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable tree" } },
14085
+ args: {
14086
+ json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable tree" },
14087
+ chat: CHAT_READ_ARG
14088
+ },
13535
14089
  run: async ({ args }) => {
13536
- await listDraft(args.json === true);
14090
+ await listDraft(args.json === true, args.chat);
13537
14091
  }
13538
14092
  });
13539
14093
  var removeCommand2 = defineCommand45({
@@ -13610,12 +14164,13 @@ var showCommand = defineCommand45({
13610
14164
  description: "Print the full staged payload for one op \u2014 the receipt to verify a change looks right before publish (never truncated)."
13611
14165
  },
13612
14166
  args: {
13613
- ref: { type: "positional", description: "Staged op ref (li_temp_*) or target id/URN", required: true }
14167
+ ref: { type: "positional", description: "Staged op ref (li_temp_*) or target id/URN", required: true },
14168
+ chat: CHAT_READ_ARG
13614
14169
  },
13615
14170
  run: async ({ args }) => {
13616
14171
  const ref = requireTarget2(args, "op");
13617
14172
  try {
13618
- const chatId = requireChatId();
14173
+ const chatId = resolveChatId(args.chat);
13619
14174
  const body = { chatId, ref };
13620
14175
  const response = await apiPost(
13621
14176
  "/api/ads/linkedin/draft/show",
@@ -13630,8 +14185,11 @@ var showCommand = defineCommand45({
13630
14185
  var linkedinDraftCommand = defineCommand45({
13631
14186
  meta: {
13632
14187
  name: "draft",
13633
- description: "Review and edit the LinkedIn write ops staged in this chat BEFORE publish. Subcommands: list (default), remove, clear, amend, show. Ops never hit LinkedIn until the chat is published."
14188
+ description: "Review and edit the LinkedIn write ops staged in this chat BEFORE publish. Subcommands: list (default), remove, clear, amend, show. Ops never hit LinkedIn until the chat is published. `list` and `show` take --chat <id> to read an earlier chat's changes instead."
13634
14189
  },
14190
+ // Declared on the parent too: `default: "list"` dispatches the bare `draft --chat <id>` form, and
14191
+ // citty prints help for a flag the parent does not know instead of forwarding it.
14192
+ args: { chat: CHAT_READ_ARG },
13635
14193
  subCommands: {
13636
14194
  list: listCommand3,
13637
14195
  remove: removeCommand2,
@@ -15013,6 +15571,17 @@ var metaDraftListResponseSchema = z19.object({
15013
15571
  /** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
15014
15572
  advisories: z19.array(metaDraftAdvisorySchema)
15015
15573
  });
15574
+ var metaDraftShowRequestSchema = z19.object({
15575
+ chatId: z19.string(),
15576
+ ref: z19.string()
15577
+ });
15578
+ var metaDraftShowResponseSchema = z19.object({
15579
+ op: metaDraftOpViewSchema.extend({
15580
+ payload: z19.unknown().optional(),
15581
+ warnings: z19.array(z19.string()).optional(),
15582
+ annotations: z19.unknown().optional()
15583
+ })
15584
+ });
15016
15585
  var metaDraftRemoveRequestSchema = z19.object({
15017
15586
  chatId: z19.string(),
15018
15587
  ref: z19.string()
@@ -15600,10 +16169,10 @@ function duplicateCommand2(entity, label) {
15600
16169
  replace: { type: "boolean", description: "Pause the original once the copy publishes" }
15601
16170
  },
15602
16171
  run: async ({ args }) => {
15603
- const { apiPost: apiPost2 } = await import("./client-R5ZSVIK3.js");
15604
- const { requireChatId: requireChatId2 } = await import("./env-3JMYIH25.js");
15605
- const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-KLK2GZXR.js");
15606
- const { handleMetaError: handleMetaError2 } = await import("./shared-AXAXNKGE.js");
16172
+ const { apiPost: apiPost2 } = await import("./client-PJ7ID35L.js");
16173
+ const { requireChatId: requireChatId2 } = await import("./env-6QJCMTRK.js");
16174
+ const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-NWX3YW64.js");
16175
+ const { handleMetaError: handleMetaError2 } = await import("./shared-5ZEOG664.js");
15607
16176
  try {
15608
16177
  const accountId = bareAccountId2(args);
15609
16178
  const chatId = requireChatId2();
@@ -15992,9 +16561,9 @@ Examples:
15992
16561
 
15993
16562
  // src/commands/ads/meta/draft.ts
15994
16563
  import { defineCommand as defineCommand62 } from "citty";
15995
- async function listDraft2() {
16564
+ async function listDraft2(chat) {
15996
16565
  try {
15997
- const chatId = requireChatId();
16566
+ const chatId = resolveChatId(chat);
15998
16567
  const response = await apiPost("/api/ads/meta/draft", { chatId });
15999
16568
  writeJsonEnvelope(response);
16000
16569
  } catch (err) {
@@ -16006,7 +16575,32 @@ var listCommand9 = defineCommand62({
16006
16575
  name: "list",
16007
16576
  description: "Show every Meta write op staged in this chat, its mode (simulated = publish will NOT hit Meta), dependencies, and post-publish results. Example: baker ads meta draft"
16008
16577
  },
16009
- run: listDraft2
16578
+ args: { chat: CHAT_READ_ARG },
16579
+ run: async ({ args }) => {
16580
+ await listDraft2(args.chat);
16581
+ }
16582
+ });
16583
+ var showCommand2 = defineCommand62({
16584
+ meta: {
16585
+ name: "show",
16586
+ description: "Print the full staged payload for one op \u2014 the receipt to verify a change looks right before publish (never truncated). Example: baker ads meta draft show meta_temp_abc123"
16587
+ },
16588
+ args: {
16589
+ ref: { type: "positional", description: "Op ref (meta_temp_* for creates, target id for updates)", required: true },
16590
+ chat: CHAT_READ_ARG
16591
+ },
16592
+ run: async ({ args }) => {
16593
+ try {
16594
+ const chatId = resolveChatId(args.chat);
16595
+ const response = await apiPost("/api/ads/meta/draft/show", {
16596
+ chatId,
16597
+ ref: args.ref
16598
+ });
16599
+ writeJsonEnvelope(response);
16600
+ } catch (err) {
16601
+ handleMetaError(err);
16602
+ }
16603
+ }
16010
16604
  });
16011
16605
  var removeCommand3 = defineCommand62({
16012
16606
  meta: {
@@ -16049,9 +16643,12 @@ var clearCommand3 = defineCommand62({
16049
16643
  var metaDraftCommand = defineCommand62({
16050
16644
  meta: {
16051
16645
  name: "draft",
16052
- description: "Review and edit the Meta write ops staged in this chat BEFORE publish. Subcommands: list (default), remove, clear. Ops never hit Meta until the chat is published."
16646
+ description: "Review and edit the Meta write ops staged in this chat BEFORE publish. Subcommands: list (default), show, remove, clear. Ops never hit Meta until the chat is published. `list` and `show` take --chat <id> to read an earlier chat's changes instead."
16053
16647
  },
16054
- subCommands: { list: listCommand9, remove: removeCommand3, clear: clearCommand3 },
16648
+ // Declared on the parent too: `default: "list"` dispatches the bare `draft --chat <id>` form, and
16649
+ // citty prints help for a flag the parent does not know instead of forwarding it.
16650
+ args: { chat: CHAT_READ_ARG },
16651
+ subCommands: { list: listCommand9, show: showCommand2, remove: removeCommand3, clear: clearCommand3 },
16055
16652
  // `default` (not `run`) dispatches the bare invocation: citty falls through to `run`
16056
16653
  // after dispatching a subcommand, so a `run` here would list the draft a second time
16057
16654
  // on every `draft list` / `draft remove` / `draft clear`.
@@ -16482,16 +17079,27 @@ async function runList(args) {
16482
17079
  const accountId = resolveAccountIdArg(args);
16483
17080
  const params = { "account-id": accountId };
16484
17081
  if (args["skip-cache"]) params["skip-cache"] = "true";
16485
- const data = await apiGet("/api/ads/meta/pixels", params);
16486
- emit(data, args);
17082
+ const { pixels, restrictedFields } = await apiGet("/api/ads/meta/pixels", params);
17083
+ emit(pixels, args, pixelWarnings(restrictedFields));
17084
+ }
17085
+ function pixelWarnings(restrictedFields) {
17086
+ if (restrictedFields.length === 0) {
17087
+ return [];
17088
+ }
17089
+ return [
17090
+ {
17091
+ code: "PIXEL_FIELDS_RESTRICTED",
17092
+ message: `Meta withheld ${restrictedFields.join(", ")} for these pixels \u2014 the connected user holds no role in the Business that owns them. IDs, names, creation and last-fired times are complete; install code and setup details are not. To get them, the client assigns the pixel to the connected user in Meta Business settings \u2192 Data sources \u2192 Datasets.`
17093
+ }
17094
+ ];
16487
17095
  }
16488
- function emit(data, args) {
17096
+ function emit(data, args, warnings = []) {
16489
17097
  const fmt = csvOrJson(args);
16490
17098
  if (fmt !== "json") {
16491
17099
  writeAdsOutput(data, fmt);
16492
17100
  return;
16493
17101
  }
16494
- writeAdsJson({ ok: true, data });
17102
+ writeAdsJson({ ok: true, data, ...warnings.length > 0 ? { warnings } : {} });
16495
17103
  }
16496
17104
 
16497
17105
  // src/commands/ads/meta/preview.ts
@@ -16656,7 +17264,7 @@ function accountHints4(accounts) {
16656
17264
  }
16657
17265
  function handleAccountsError2(err) {
16658
17266
  if (err instanceof ApiError) {
16659
- if (err.code === "UNAUTHORIZED" || err.code === "NOT_FOUND") {
17267
+ if (needsConnectionFix(err.code, err.message)) {
16660
17268
  handleConnectionError("x_ads", err.message);
16661
17269
  }
16662
17270
  const envelope = {
@@ -16831,7 +17439,7 @@ ${list}`
16831
17439
  });
16832
17440
  process.exit(1);
16833
17441
  } catch (err) {
16834
- if (err instanceof ApiError && (err.code === "UNAUTHORIZED" || err.code === "NOT_FOUND")) {
17442
+ if (err instanceof ApiError && needsConnectionFix(err.code, err.message)) {
16835
17443
  handleConnectionError("x_ads", err.message);
16836
17444
  }
16837
17445
  writeAdsJson({
@@ -25922,7 +26530,7 @@ var listCommand11 = defineCommand104({
25922
26530
  writeJson({ ok: true, data: { flows } });
25923
26531
  }
25924
26532
  });
25925
- var showCommand2 = defineCommand104({
26533
+ var showCommand3 = defineCommand104({
25926
26534
  meta: {
25927
26535
  name: "show",
25928
26536
  description: "Show a Form's confidential fields and their configuration status (never secret values). Example: baker flows show contact"
@@ -25958,7 +26566,7 @@ Full guide: __tooling__/docs/tools/baker/flows.md`
25958
26566
  },
25959
26567
  subCommands: {
25960
26568
  list: listCommand11,
25961
- show: showCommand2
26569
+ show: showCommand3
25962
26570
  },
25963
26571
  // Bare `baker flows` lists the Forms. This must be `default`, not `run`: citty falls
25964
26572
  // through to `run` after dispatching a subcommand, so a `run` here would also print
@@ -26013,7 +26621,7 @@ ${list}`
26013
26621
  });
26014
26622
  process.exit(1);
26015
26623
  } catch (err) {
26016
- if (err instanceof ApiError && (err.code === "UNAUTHORIZED" || err.code === "NOT_FOUND")) {
26624
+ if (err instanceof ApiError && needsConnectionFix(err.code, err.message)) {
26017
26625
  handleConnectionError("ga4", err.message);
26018
26626
  }
26019
26627
  writeJsonEnvelope({
@@ -26142,7 +26750,7 @@ Examples:
26142
26750
  writeJsonEnvelope({ ok: true, data, hints: propertyHints(data) });
26143
26751
  } catch (err) {
26144
26752
  if (err instanceof ApiError) {
26145
- if (err.code === "UNAUTHORIZED" || err.code === "NOT_FOUND") {
26753
+ if (needsConnectionFix(err.code, err.message)) {
26146
26754
  handleConnectionError("ga4", err.message);
26147
26755
  }
26148
26756
  writeJsonEnvelope({ ok: false, error: { code: err.code, message: err.message } });
@@ -26470,7 +27078,7 @@ ${list}`
26470
27078
  });
26471
27079
  process.exit(1);
26472
27080
  } catch (err) {
26473
- if (err instanceof ApiError && (err.code === "UNAUTHORIZED" || err.code === "NOT_FOUND")) {
27081
+ if (err instanceof ApiError && needsConnectionFix(err.code, err.message)) {
26474
27082
  handleConnectionError("gsc", err.message);
26475
27083
  }
26476
27084
  writeJsonEnvelope({
@@ -26777,7 +27385,7 @@ Examples:
26777
27385
  writeJsonEnvelope({ ok: true, data, hints: siteHints(data) });
26778
27386
  } catch (err) {
26779
27387
  if (err instanceof ApiError) {
26780
- if (err.code === "UNAUTHORIZED" || err.code === "NOT_FOUND") {
27388
+ if (needsConnectionFix(err.code, err.message)) {
26781
27389
  handleConnectionError("gsc", err.message);
26782
27390
  }
26783
27391
  writeJsonEnvelope({ ok: false, error: { code: err.code, message: err.message } });
@@ -26928,7 +27536,7 @@ Full guide: __tooling__/docs/tools/baker/history.md`
26928
27536
  import { defineCommand as defineCommand114 } from "citty";
26929
27537
  var EMBED_TYPES = ["legacy", "v4", "unknown"];
26930
27538
  function failNotConnected(err) {
26931
- if (err instanceof ApiError && err.code === "UNAUTHORIZED" && err.message.includes(HUBSPOT_MISSING_GRANT_MARKER)) {
27539
+ if (err instanceof ApiError && err.code === "FORBIDDEN" && err.message.includes(HUBSPOT_MISSING_GRANT_MARKER)) {
26932
27540
  writeJson({
26933
27541
  ok: false,
26934
27542
  error: {
@@ -32937,7 +33545,8 @@ registerSchema({
32937
33545
  command: "scheduled-actions.get",
32938
33546
  description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
32939
33547
  args: {
32940
- id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
33548
+ id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true },
33549
+ chat: { type: "string", description: CHAT_READ_ARG.description, required: false }
32941
33550
  }
32942
33551
  });
32943
33552
  var getCommand3 = defineCommand155({
@@ -32951,7 +33560,8 @@ var getCommand3 = defineCommand155({
32951
33560
  type: "string",
32952
33561
  description: "Scheduled action ID (alternative to positional)",
32953
33562
  required: false
32954
- }
33563
+ },
33564
+ chat: CHAT_READ_ARG
32955
33565
  },
32956
33566
  run: async ({ args }) => {
32957
33567
  try {
@@ -32961,12 +33571,13 @@ var getCommand3 = defineCommand155({
32961
33571
  }
32962
33572
  validateScheduledActionRef(id);
32963
33573
  const env = getEnv();
32964
- if (isTempScheduledActionId(id) && !env.BAKER_CHAT_ID) {
32965
- failValidation2("BAKER_CHAT_ID is required to get a temp scheduled action ID.");
33574
+ const chatId = typeof args.chat === "string" && args.chat.length > 0 ? args.chat : env.BAKER_CHAT_ID;
33575
+ if (isTempScheduledActionId(id) && !chatId) {
33576
+ failValidation2("BAKER_CHAT_ID or --chat is required to get a temp scheduled action ID.");
32966
33577
  }
32967
33578
  const body = { id };
32968
- if (env.BAKER_CHAT_ID) {
32969
- body.chatId = env.BAKER_CHAT_ID;
33579
+ if (chatId) {
33580
+ body.chatId = chatId;
32970
33581
  }
32971
33582
  const response = await apiPost("/api/scheduled-actions/get", body);
32972
33583
  writeJson(response);
@@ -32980,20 +33591,24 @@ var getCommand3 = defineCommand155({
32980
33591
  import { defineCommand as defineCommand156 } from "citty";
32981
33592
  registerSchema({
32982
33593
  command: "scheduled-actions.list",
32983
- description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
32984
- args: {}
33594
+ description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set, or --chat <id> to read an earlier chat's staged schedules instead.",
33595
+ args: {
33596
+ chat: { type: "string", description: CHAT_READ_ARG.description, required: false }
33597
+ }
32985
33598
  });
32986
33599
  var listCommand14 = defineCommand156({
32987
33600
  meta: {
32988
33601
  name: "list",
32989
- description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
33602
+ description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set, or --chat <id> to read an earlier chat's staged schedules instead."
32990
33603
  },
32991
- run: async () => {
33604
+ args: { chat: CHAT_READ_ARG },
33605
+ run: async ({ args }) => {
32992
33606
  try {
32993
33607
  const env = getEnv();
32994
33608
  const body = {};
32995
- if (env.BAKER_CHAT_ID) {
32996
- body.chatId = env.BAKER_CHAT_ID;
33609
+ const chatId = typeof args.chat === "string" && args.chat.length > 0 ? args.chat : env.BAKER_CHAT_ID;
33610
+ if (chatId) {
33611
+ body.chatId = chatId;
32997
33612
  }
32998
33613
  const response = await apiPost("/api/scheduled-actions/list", body);
32999
33614
  writeJson(response);
@@ -33267,7 +33882,7 @@ function handleError3(err) {
33267
33882
  error: {
33268
33883
  code: err.code,
33269
33884
  message: err.message,
33270
- ...err.code === "UNAUTHORIZED" ? {
33885
+ ...err.code === "UNAUTHORIZED" || err.code === "FORBIDDEN" && isNotConnectedError(err.code, err.message) ? {
33271
33886
  fix: {
33272
33887
  action: "request_connection",
33273
33888
  explanation: 'Tag Manager is not connected for this company yet, or no container has been picked. Do NOT send the user to Settings \u2014 call the `request_connection` tool with { platform: "google-tag-manager", reason } and they connect and pick their containers (they can pick more than one) from inside the chat. `request_tag_input` is NOT the route: that form manages the container snippet on the site, not what runs inside the container, and it cannot pick a container. If `request_connection` is not available to you, say so plainly and point them at dashboard \u2192 Brain \u2192 Integrations \u2192 Tools \u2192 Google Tag Manager, where they also pick the container. Carry on with the rest of the task meanwhile.'
@@ -33293,8 +33908,8 @@ async function stageOp3(op) {
33293
33908
  handleError3(err);
33294
33909
  }
33295
33910
  }
33296
- async function draftAction2(path28, body) {
33297
- const chatId = requireChatId();
33911
+ async function draftAction2(path28, body, chat) {
33912
+ const chatId = resolveChatId(chat);
33298
33913
  try {
33299
33914
  const data = await apiPost(path28, { chatId, ...body });
33300
33915
  writeJsonEnvelope({ ok: true, data });
@@ -33325,8 +33940,8 @@ function renderDraft(response) {
33325
33940
  }
33326
33941
  return lines.join("\n");
33327
33942
  }
33328
- async function draftList(json) {
33329
- const chatId = requireChatId();
33943
+ async function draftList(json, chat) {
33944
+ const chatId = resolveChatId(chat);
33330
33945
  try {
33331
33946
  const data = await apiPost("/api/tag-manager/draft", { chatId });
33332
33947
  if (json) {
@@ -33343,15 +33958,16 @@ async function draftList(json) {
33343
33958
  // src/commands/tag-manager/draft.ts
33344
33959
  registerSchema({
33345
33960
  command: "tagManager.draft",
33346
- description: "Review and undo the Tag Manager changes staged on this chat. Use `list` to see everything staged, `show` to inspect one change in full before publish, `amend` to correct one in place, and `remove`/`clear` to drop them.",
33961
+ description: "Review and undo the Tag Manager changes staged on this chat. Use `list` to see everything staged, `show` to inspect one change in full before publish, `amend` to correct one in place, and `remove`/`clear` to drop them. `list` and `show` take --chat <id> to read an earlier chat's changes instead.",
33347
33962
  args: {
33348
- json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list", required: false }
33963
+ json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list", required: false },
33964
+ chat: { type: "string", description: CHAT_READ_ARG.description, required: false }
33349
33965
  }
33350
33966
  });
33351
33967
  var draftCommand3 = defineCommand161({
33352
33968
  meta: {
33353
33969
  name: "draft",
33354
- description: "List, show, amend, remove, or clear staged Tag Manager changes for this chat"
33970
+ description: "List, show, amend, remove, or clear staged Tag Manager changes for this chat. `list` and `show` take --chat <id> to read an earlier chat's changes instead."
33355
33971
  },
33356
33972
  subCommands: {
33357
33973
  list: defineCommand161({
@@ -33359,9 +33975,12 @@ var draftCommand3 = defineCommand161({
33359
33975
  name: "list",
33360
33976
  description: "Review everything staged on this chat (--json for the raw envelope)"
33361
33977
  },
33362
- args: { json: { type: "boolean", description: "Print the raw JSON envelope", required: false } },
33978
+ args: {
33979
+ json: { type: "boolean", description: "Print the raw JSON envelope", required: false },
33980
+ chat: CHAT_READ_ARG
33981
+ },
33363
33982
  run: async ({ args }) => {
33364
- await draftList(args.json === true);
33983
+ await draftList(args.json === true, args.chat);
33365
33984
  }
33366
33985
  }),
33367
33986
  show: defineCommand161({
@@ -33369,11 +33988,16 @@ var draftCommand3 = defineCommand161({
33369
33988
  name: "show",
33370
33989
  description: "Print the full staged payload for one change \u2014 the receipt to verify it looks right before publish (never truncated)."
33371
33990
  },
33372
- args: { ref: { type: "positional", description: "Staged ref (gtm_temp_*) or target", required: false } },
33991
+ args: {
33992
+ ref: { type: "positional", description: "Staged ref (gtm_temp_*) or target", required: false },
33993
+ chat: CHAT_READ_ARG
33994
+ },
33373
33995
  run: async ({ args }) => {
33374
- await draftAction2("/api/tag-manager/draft/show", {
33375
- ref: requireTarget4(args, "change")
33376
- });
33996
+ await draftAction2(
33997
+ "/api/tag-manager/draft/show",
33998
+ { ref: requireTarget4(args, "change") },
33999
+ args.chat
34000
+ );
33377
34001
  }
33378
34002
  }),
33379
34003
  amend: defineCommand161({
@@ -33809,9 +34433,9 @@ var listCommand15 = defineCommand165({
33809
34433
  await listTags(args.json === true);
33810
34434
  }
33811
34435
  });
33812
- async function listDraft3() {
34436
+ async function listDraft3(chat) {
33813
34437
  try {
33814
- const chatId = requireChatId();
34438
+ const chatId = resolveChatId(chat);
33815
34439
  const response = await apiPost("/api/tags/draft", { chatId });
33816
34440
  writeJson({ ok: true, data: response });
33817
34441
  } catch (err) {
@@ -33821,10 +34445,11 @@ async function listDraft3() {
33821
34445
  var draftCommand4 = defineCommand165({
33822
34446
  meta: {
33823
34447
  name: "draft",
33824
- description: "Review the tag changes staged in this chat (read-only). Staged changes were approved via request_tag_input and apply when the chat is published; to amend or drop one, propose a follow-up change through the same tool (a delete on a tag_temp_* ref drops the staged create)."
34448
+ description: "Review the tag changes staged in this chat (read-only). Staged changes were approved via request_tag_input and apply when the chat is published; to amend or drop one, propose a follow-up change through the same tool (a delete on a tag_temp_* ref drops the staged create). Takes --chat <id> to read an earlier chat's staged changes instead."
33825
34449
  },
33826
- run: async () => {
33827
- await listDraft3();
34450
+ args: { chat: CHAT_READ_ARG },
34451
+ run: async ({ args }) => {
34452
+ await listDraft3(args.chat);
33828
34453
  }
33829
34454
  });
33830
34455
  var tagsCommand3 = defineCommand165({