@koda-sl/baker-cli 0.192.4 → 0.194.0-dev.5dba041c4

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
@@ -47,7 +47,7 @@ import {
47
47
  toModelSafeImage,
48
48
  ulid,
49
49
  validateCanvasDeep
50
- } from "./chunk-ISZWNERZ.js";
50
+ } from "./chunk-5YX3QOT3.js";
51
51
  import {
52
52
  csvOrJson,
53
53
  daysAgoIso,
@@ -90,7 +90,7 @@ import {
90
90
  } from "./chunk-YL3HDEIJ.js";
91
91
 
92
92
  // src/cli.ts
93
- import { defineCommand as defineCommand209, runMain } from "citty";
93
+ import { defineCommand as defineCommand213, runMain } from "citty";
94
94
 
95
95
  // src/commands/actions/index.ts
96
96
  import { defineCommand as defineCommand18 } from "citty";
@@ -172,9 +172,9 @@ function compactImage(image) {
172
172
  };
173
173
  }
174
174
  function fullImage(image) {
175
- const compact = compactImage(image);
175
+ const compact2 = compactImage(image);
176
176
  return {
177
- ...compact,
177
+ ...compact2,
178
178
  width: image.width ?? null,
179
179
  height: image.height ?? null,
180
180
  aspectRatio: formatAspectRatio(image.aspectRatio),
@@ -248,9 +248,9 @@ function sceneLines(value) {
248
248
  });
249
249
  }
250
250
  function fullVideo(video) {
251
- const compact = compactVideo(video);
251
+ const compact2 = compactVideo(video);
252
252
  return {
253
- ...compact,
253
+ ...compact2,
254
254
  duration: video.duration ?? null,
255
255
  muxPlaybackId: String(video.muxPlaybackId ?? ""),
256
256
  source: String(video.source ?? ""),
@@ -291,9 +291,9 @@ function compactTestimonial(record) {
291
291
  };
292
292
  }
293
293
  function fullTestimonial(record) {
294
- const compact = compactTestimonial(record);
294
+ const compact2 = compactTestimonial(record);
295
295
  return {
296
- ...compact,
296
+ ...compact2,
297
297
  reviewText: String(record.reviewText ?? ""),
298
298
  highlight: record.highlight ?? null,
299
299
  summary: record.summary ?? null,
@@ -335,10 +335,10 @@ function compactWinningAd(record) {
335
335
  };
336
336
  }
337
337
  function fullWinningAd(record) {
338
- const compact = compactWinningAd(record);
338
+ const compact2 = compactWinningAd(record);
339
339
  const dna = asRecord(record.dna);
340
340
  return {
341
- ...compact,
341
+ ...compact2,
342
342
  winner_category: String(record.winner_category ?? ""),
343
343
  media_kind: record.media_kind ?? null,
344
344
  days_active: record.days_active ?? null,
@@ -4853,7 +4853,8 @@ var imageSourceSchema = z14.enum([
4853
4853
  "iconify",
4854
4854
  "giphy",
4855
4855
  "pinterest",
4856
- "ai_generated"
4856
+ "ai_generated",
4857
+ "layer_edit"
4857
4858
  ]);
4858
4859
  var imageStatusSchema = z14.enum(["uploading", "processing", "ready", "error"]);
4859
4860
  var upscaleConfigSchema = z14.object({
@@ -5152,6 +5153,51 @@ var imagesIngestResponseSchema = z14.object({
5152
5153
  deduped: z14.boolean(),
5153
5154
  contentHash: z14.string()
5154
5155
  });
5156
+ var imagesLayerizeRequestSchema = z14.object({
5157
+ imageId: z14.string().min(1, "Missing image ID"),
5158
+ /** Optional steer for what to separate; the model reads it as extraction instructions. */
5159
+ instructions: z14.string().max(600).optional()
5160
+ });
5161
+ var imageLayerTextSchema = z14.object({
5162
+ content: z14.string(),
5163
+ fontFamily: z14.string(),
5164
+ fontSize: z14.number(),
5165
+ fontWeight: z14.number(),
5166
+ color: z14.string(),
5167
+ align: z14.enum(["left", "center", "right"]),
5168
+ lineHeight: z14.number(),
5169
+ letterSpacing: z14.number()
5170
+ });
5171
+ var imageLayerSchema = z14.object({
5172
+ id: z14.string(),
5173
+ /** `art` is a transparent cutout; `text` is live copy with its typography. */
5174
+ kind: z14.enum(["art", "text"]),
5175
+ name: z14.string(),
5176
+ /** Art layers only: a permanent URL for the cutout, usable as a canvas input. */
5177
+ url: z14.string().optional(),
5178
+ x: z14.number(),
5179
+ y: z14.number(),
5180
+ width: z14.number(),
5181
+ height: z14.number(),
5182
+ visible: z14.boolean(),
5183
+ opacity: z14.number(),
5184
+ text: imageLayerTextSchema.optional()
5185
+ });
5186
+ var imagesLayersResponseSchema = z14.object({
5187
+ layeredImageId: z14.string(),
5188
+ imageId: z14.string(),
5189
+ status: z14.enum(["splitting", "ready", "failed"]),
5190
+ /** Product-language reason when `failed`; never a raw provider payload. */
5191
+ error: z14.string().optional(),
5192
+ /** The canvas the layers are measured in. The model may resize the source. */
5193
+ width: z14.number(),
5194
+ height: z14.number(),
5195
+ /** Bottom to top. Empty until the split settles. */
5196
+ layers: z14.array(imageLayerSchema),
5197
+ /** Set once a flattened composition has been saved back to the library. */
5198
+ savedImageId: z14.string().optional()
5199
+ });
5200
+ var imagesLayersRequestSchema = z14.object({ imageId: z14.string().min(1, "Missing image ID") });
5155
5201
 
5156
5202
  // ../api/src/studio.ts
5157
5203
  import { z as z15 } from "zod";
@@ -15687,6 +15733,74 @@ var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
15687
15733
 
15688
15734
  // ../api/src/ads-meta/ops.ts
15689
15735
  import { z as z20 } from "zod";
15736
+
15737
+ // ../api/src/ads-meta/placements.ts
15738
+ var FACEBOOK_POSITIONS_REQUIRING_FEED = ["marketplace", "search", "profile_feed", "notification"];
15739
+ var PLACEMENT_TARGETING_DOC = "https://developers.facebook.com/docs/marketing-api/audiences/reference/placement-targeting/";
15740
+ var CONSTRAINED_PLACEMENTS = [
15741
+ {
15742
+ position: "facebook_reels_overlay",
15743
+ platform: "facebook",
15744
+ kind: "constraint",
15745
+ note: "Ads on Facebook Reels take two shapes and a stock 9:16 video fits neither: overlay ads are 'a single, static image ad' (JPG/PNG, 1:1, 0% ratio tolerance, headline capped at 10 characters), and post-loop ads are 1:1 video of 4-15 seconds. Expect a long-headline 9:16 creative to look wrong here.",
15746
+ contested: false,
15747
+ source: "https://www.facebook.com/business/ads-guide/update/image/facebook-facebook-reels-overlay"
15748
+ },
15749
+ {
15750
+ position: "explore_home",
15751
+ platform: "instagram",
15752
+ kind: "constraint",
15753
+ note: "Marketing API placement asset customization states 'The explore_home placement only supports the SINGLE_IMAGE format', but Meta's own Ads Guide lists Instagram Explore home under video specs. Check the account's play rate for this position before treating it as image-only.",
15754
+ contested: true,
15755
+ source: "https://developers.facebook.com/docs/marketing-api/dynamic-creative/placement-asset-customization/"
15756
+ },
15757
+ {
15758
+ position: "right_hand_column",
15759
+ platform: "facebook",
15760
+ kind: "correction",
15761
+ note: "Facebook right column publishes full video specs (MP4/MOV/GIF, 1:1 at 1440x1440 or mobile-only 4:5 at 1440x1800, 1 second to 241 minutes) \u2014 it is NOT image-only. Its real constraint is that it cannot be the only placement for a video, collection, or canvas ad.",
15762
+ contested: false,
15763
+ source: "https://www.facebook.com/business/ads-guide/update/video/facebook-right-hand-column"
15764
+ }
15765
+ ];
15766
+ var FACEBOOK_PREVIEW_FORMATS = {
15767
+ feed: "MOBILE_FEED_STANDARD",
15768
+ right_hand_column: "RIGHT_COLUMN_STANDARD",
15769
+ marketplace: "MARKETPLACE_MOBILE",
15770
+ story: "FACEBOOK_STORY_MOBILE",
15771
+ facebook_reels: "FACEBOOK_REELS_MOBILE",
15772
+ facebook_reels_overlay: "FACEBOOK_REELS_BANNER",
15773
+ instream_video: "INSTREAM_VIDEO_MOBILE",
15774
+ video_feeds: "INSTREAM_VIDEO_MOBILE"
15775
+ };
15776
+ var INSTAGRAM_PREVIEW_FORMATS = {
15777
+ stream: "INSTAGRAM_STANDARD",
15778
+ story: "INSTAGRAM_STORY",
15779
+ reels: "INSTAGRAM_REELS",
15780
+ explore: "INSTAGRAM_EXPLORE_CONTEXTUAL",
15781
+ explore_home: "INSTAGRAM_EXPLORE_GRID_HOME",
15782
+ ig_search: "INSTAGRAM_SEARCH_CHAIN",
15783
+ profile_feed: "INSTAGRAM_PROFILE_FEED"
15784
+ };
15785
+ var PLATFORM_SCOPED_POSITIONS = /* @__PURE__ */ new Set(["story", "profile_feed"]);
15786
+ function previewFormatForPosition(position, platform) {
15787
+ if (platform === "facebook") return FACEBOOK_PREVIEW_FORMATS[position];
15788
+ if (platform === "instagram") return INSTAGRAM_PREVIEW_FORMATS[position];
15789
+ if (PLATFORM_SCOPED_POSITIONS.has(position)) return void 0;
15790
+ return FACEBOOK_PREVIEW_FORMATS[position] ?? INSTAGRAM_PREVIEW_FORMATS[position];
15791
+ }
15792
+ function placementFormatNote(position) {
15793
+ return CONSTRAINED_PLACEMENTS.find((p) => p.position === position);
15794
+ }
15795
+ function positionsMissingRequiredFeed(targeting) {
15796
+ const positions = targeting?.facebook_positions;
15797
+ if (!positions?.length || positions.includes("feed")) {
15798
+ return [];
15799
+ }
15800
+ return FACEBOOK_POSITIONS_REQUIRING_FEED.filter((required) => positions.includes(required));
15801
+ }
15802
+
15803
+ // ../api/src/ads-meta/ops.ts
15690
15804
  var tempRefSchema3 = z20.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
15691
15805
  var parentRefSchema2 = z20.union([z20.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
15692
15806
  var moneySchema2 = z20.object({
@@ -15957,10 +16071,21 @@ function validateAdvantageAudience(p, ctx) {
15957
16071
  });
15958
16072
  }
15959
16073
  }
16074
+ function validateAdSetPlacements(p, ctx) {
16075
+ const missingFeed = positionsMissingRequiredFeed(p.targeting);
16076
+ if (missingFeed.length > 0) {
16077
+ ctx.addIssue({
16078
+ code: "custom",
16079
+ path: ["targeting", "facebook_positions"],
16080
+ message: `Meta requires "feed" alongside ${missingFeed.join(", ")} \u2014 add "feed" to facebook_positions or drop those positions (${PLACEMENT_TARGETING_DOC})`
16081
+ });
16082
+ }
16083
+ }
15960
16084
  var adSetCreateSchema = z20.object(adSetFields).superRefine((p, ctx) => {
15961
16085
  validateAdSetBudgetAndBid(p, ctx);
15962
16086
  validateAdSetPromotedObject(p, ctx);
15963
16087
  validateAdvantageAudience(p, ctx);
16088
+ validateAdSetPlacements(p, ctx);
15964
16089
  if (!targetingHasGeoOrAudience(p.targeting)) {
15965
16090
  ctx.addIssue({
15966
16091
  code: "custom",
@@ -15994,6 +16119,7 @@ var adSetUpdateSchema = z20.object({
15994
16119
  validateAdSetPromotedObject(p, ctx);
15995
16120
  }
15996
16121
  validateAdvantageAudience(p, ctx);
16122
+ validateAdSetPlacements(p, ctx);
15997
16123
  });
15998
16124
  var messageSchema = z20.string().min(1).max(META_LIMITS.creative.messageHardMax);
15999
16125
  var headlineSchema2 = z20.string().min(1).max(META_LIMITS.creative.headlineMax);
@@ -17398,6 +17524,74 @@ var metaDraftCommand = defineCommand62({
17398
17524
  // src/commands/ads/meta/insights.ts
17399
17525
  import { defineCommand as defineCommand63 } from "citty";
17400
17526
 
17527
+ // src/commands/ads/meta/placement-delivery.ts
17528
+ var MIN_IMPRESSIONS = 100;
17529
+ var SILENT_PLAY_RATE = 0.02;
17530
+ var PLAYING_REFERENCE_RATE = 0.5;
17531
+ function toNumber(value) {
17532
+ const n = Number(value);
17533
+ return Number.isFinite(n) ? n : 0;
17534
+ }
17535
+ function sumActionValues(value) {
17536
+ if (!Array.isArray(value)) return 0;
17537
+ return value.reduce((total, entry) => {
17538
+ const item = entry;
17539
+ return total + toNumber(item?.value);
17540
+ }, 0);
17541
+ }
17542
+ function aggregate(rows) {
17543
+ const byPlacement = /* @__PURE__ */ new Map();
17544
+ let totalImpressions = 0;
17545
+ for (const row of rows) {
17546
+ const position = row.platform_position;
17547
+ if (typeof position !== "string" || position.length === 0) continue;
17548
+ const platform = typeof row.publisher_platform === "string" ? row.publisher_platform : "";
17549
+ const impressions = toNumber(row.impressions);
17550
+ totalImpressions += impressions;
17551
+ const key = `${platform}/${position}`;
17552
+ const current = byPlacement.get(key) ?? { platform, position, impressions: 0, plays: 0, playRate: 0, share: 0 };
17553
+ current.impressions += impressions;
17554
+ current.plays += sumActionValues(row.video_play_actions);
17555
+ byPlacement.set(key, current);
17556
+ }
17557
+ return [...byPlacement.values()].map((placement) => ({
17558
+ ...placement,
17559
+ playRate: placement.impressions > 0 ? placement.plays / placement.impressions : 0,
17560
+ share: totalImpressions > 0 ? placement.impressions / totalImpressions : 0
17561
+ }));
17562
+ }
17563
+ function previewCommand(placement) {
17564
+ const format = previewFormatForPosition(placement.position, placement.platform);
17565
+ return format ? `\`baker ads meta preview --creative-id <id> --placement ${placement.position} --platform ${placement.platform}\`` : `no preview format is known for ${placement.position}, so Meta's renderer cannot confirm it \u2014 say the placement is unverified rather than filling the gap`;
17566
+ }
17567
+ function isSingleAdQuery(rows) {
17568
+ const adIds = /* @__PURE__ */ new Set();
17569
+ for (const row of rows) {
17570
+ if (typeof row.ad_id !== "string" || row.ad_id.length === 0) return false;
17571
+ adIds.add(row.ad_id);
17572
+ }
17573
+ return adIds.size === 1;
17574
+ }
17575
+ function placementDeliveryHints(rows) {
17576
+ const carriesVideoMetrics = rows.some((row) => Array.isArray(row.video_play_actions));
17577
+ if (!carriesVideoMetrics || !isSingleAdQuery(rows)) return [];
17578
+ const placements = aggregate(rows);
17579
+ const plays = placements.some((p) => p.impressions >= MIN_IMPRESSIONS && p.playRate >= PLAYING_REFERENCE_RATE);
17580
+ if (!plays) return [];
17581
+ const silent = placements.filter((p) => p.impressions >= MIN_IMPRESSIONS && p.playRate < SILENT_PLAY_RATE).sort((a, b) => b.impressions - a.impressions);
17582
+ if (silent.length === 0) return [];
17583
+ const hints = silent.map((placement) => {
17584
+ const note = placementFormatNote(placement.position);
17585
+ const documented = note ? ` Meta documents this placement: ${note.note}` : "";
17586
+ return `${placement.platform}/${placement.position} delivered ${placement.impressions.toLocaleString("en-US")} impressions (${(placement.share * 100).toFixed(1)}% of the total) and ${placement.plays.toLocaleString("en-US")} video plays \u2014 it may not be rendering the video. This is account evidence, not a rule: confirm what Meta renders there with ${previewCommand(placement)} before you say anything about it.${documented}`;
17587
+ });
17588
+ const combinedShare = silent.reduce((total, placement) => total + placement.share, 0) * 100;
17589
+ hints.push(
17590
+ `Those placements are ${combinedShare.toFixed(1)}% of delivery in this query. State that share before proposing to remove them \u2014 and note that removing placements from a live ad set is a targeting change, which Meta counts as a significant edit that re-enters the learning phase.`
17591
+ );
17592
+ return hints;
17593
+ }
17594
+
17401
17595
  // src/commands/ads/meta/presets.ts
17402
17596
  var INSIGHTS_INTENTS = {
17403
17597
  baseline: {
@@ -17694,6 +17888,11 @@ Async is automatic for heavy queries; pass --async to force it, or --no-async to
17694
17888
  writeAdsOutput(sorted, fmt, body.fields);
17695
17889
  return;
17696
17890
  }
17891
+ const hints = placementDeliveryHints(sorted);
17892
+ if (hints.length > 0) {
17893
+ writeJsonEnvelope({ ok: true, data: sorted, hints });
17894
+ return;
17895
+ }
17697
17896
  writeAdsJson({ ok: true, data: sorted });
17698
17897
  } catch (err) {
17699
17898
  handleMetaError(err);
@@ -17863,6 +18062,7 @@ var VALID_AD_FORMATS = [
17863
18062
  "INSTAGRAM_STANDARD",
17864
18063
  "INSTAGRAM_EXPLORE_CONTEXTUAL",
17865
18064
  "INSTAGRAM_EXPLORE_GRID_HOME",
18065
+ "INSTAGRAM_SEARCH_CHAIN",
17866
18066
  "INSTAGRAM_SHOP",
17867
18067
  "INSTAGRAM_PROFILE_FEED",
17868
18068
  "INSTREAM_VIDEO_DESKTOP",
@@ -17878,14 +18078,47 @@ var VALID_AD_FORMATS = [
17878
18078
  "MARKETPLACE_MOBILE",
17879
18079
  "BIZ_DISCO_FEED_MOBILE"
17880
18080
  ];
17881
- var previewCommand = defineCommand67({
18081
+ function failPreviewValidation(message) {
18082
+ writeAdsJson({ ok: false, error: { code: "VALIDATION_ERROR", message } });
18083
+ process.exit(1);
18084
+ }
18085
+ function resolvePlacement(position, platform) {
18086
+ const platformArg = typeof platform === "string" ? platform.toLowerCase() : void 0;
18087
+ if (platformArg && platformArg !== "facebook" && platformArg !== "instagram") {
18088
+ failPreviewValidation("--platform must be facebook or instagram");
18089
+ }
18090
+ const format = previewFormatForPosition(position, platformArg);
18091
+ if (format) {
18092
+ return format;
18093
+ }
18094
+ if (PLATFORM_SCOPED_POSITIONS.has(position) && !platformArg) {
18095
+ failPreviewValidation(
18096
+ `--placement ${position} names a different surface on Facebook and on Instagram \u2014 add --platform facebook or --platform instagram`
18097
+ );
18098
+ }
18099
+ failPreviewValidation(
18100
+ `No Meta preview format is published for placement "${position}". Meta does not document one for every placement (Facebook notifications and profile feed, Instagram search among them), so this placement cannot be previewed \u2014 report it as unverified rather than inferring what it renders. Previewable placements: ${listPlacements()}`
18101
+ );
18102
+ }
18103
+ function listPlacements() {
18104
+ const facebook = Object.keys(FACEBOOK_PREVIEW_FORMATS).join(", ");
18105
+ const instagram = Object.keys(INSTAGRAM_PREVIEW_FORMATS).join(", ");
18106
+ return `facebook \u2014 ${facebook}; instagram \u2014 ${instagram}`;
18107
+ }
18108
+ var previewCommand2 = defineCommand67({
17882
18109
  meta: {
17883
18110
  name: "preview",
17884
18111
  description: `Generate a Meta-hosted preview iframe for a creative or ad. Returns iframe HTML which you
17885
18112
  can embed or save to a file. The iframe URL contains a short-lived access token \u2014 treat as secret.
17886
18113
 
18114
+ Start here when you need to know what a creative looks like in one specific placement \u2014 this is
18115
+ Meta's own renderer, so it settles "does my video show as a still image there?" without guessing.
18116
+ Pass the placement straight from an insights breakdown with --placement (a platform_position value),
18117
+ or a Meta ad_format with --ad-format. Run --list-formats to see both sets.
18118
+
17887
18119
  Examples:
17888
18120
  baker ads meta preview --creative-id 6123 --ad-format MOBILE_FEED_STANDARD
18121
+ baker ads meta preview --creative-id 6123 --placement facebook_reels_overlay --platform facebook
17889
18122
  baker ads meta preview --ad-id 9988 --ad-format INSTAGRAM_REELS --out-file /tmp/preview.html
17890
18123
  baker ads meta preview --account-id act_123 --creative '{"object_story_spec":{...}}' --ad-format MOBILE_FEED_STANDARD`
17891
18124
  },
@@ -17894,14 +18127,36 @@ Examples:
17894
18127
  "ad-id": { type: "string", description: "Existing ad ID" },
17895
18128
  "account-id": { type: "string", description: "Required when previewing an unpublished --creative spec" },
17896
18129
  creative: { type: "string", description: "JSON spec of an unpublished creative (e.g. object_story_spec)" },
17897
- "ad-format": { type: "string", description: "Meta ad_format enum value", required: true },
18130
+ "ad-format": { type: "string", description: "Meta ad_format enum value (--list-formats to see them)" },
18131
+ placement: {
18132
+ type: "string",
18133
+ description: "platform_position from an insights breakdown (e.g. facebook_reels_overlay) \u2014 resolved to an ad_format"
18134
+ },
18135
+ platform: { type: "string", description: "facebook|instagram \u2014 disambiguates --placement story / profile_feed" },
18136
+ "list-formats": { type: "boolean", description: "Print the ad_format values and placement mappings, then exit" },
17898
18137
  "out-file": { type: "string", description: "Save iframe HTML to this path" },
17899
18138
  "skip-cache": { type: "boolean", description: "Bypass server-side cache" }
17900
18139
  },
17901
18140
  run: async ({ args }) => {
17902
- const adFormat = args["ad-format"];
18141
+ if (args["list-formats"]) {
18142
+ writeAdsJson({
18143
+ ok: true,
18144
+ data: {
18145
+ adFormats: VALID_AD_FORMATS,
18146
+ placements: { facebook: FACEBOOK_PREVIEW_FORMATS, instagram: INSTAGRAM_PREVIEW_FORMATS }
18147
+ }
18148
+ });
18149
+ return;
18150
+ }
18151
+ const placement = args.placement;
18152
+ const adFormat = placement ? resolvePlacement(placement, args.platform) : args["ad-format"];
18153
+ if (!adFormat) {
18154
+ failPreviewValidation("pass --ad-format or --placement (see --list-formats)");
18155
+ }
17903
18156
  if (!VALID_AD_FORMATS.includes(adFormat)) {
17904
- handleMetaError(new Error(`Invalid --ad-format "${adFormat}". Run with --help to see supported values.`));
18157
+ failPreviewValidation(
18158
+ `Invalid --ad-format "${adFormat}". Meta publishes no complete ad_format enum, so this is the set we know: ${VALID_AD_FORMATS.join(", ")}. To preview a placement you saw in an insights breakdown, pass --placement <platform_position> instead of guessing a format name.`
18159
+ );
17905
18160
  }
17906
18161
  const body = { adFormat };
17907
18162
  if (args["creative-id"]) body.creativeId = args["creative-id"];
@@ -17912,12 +18167,16 @@ Examples:
17912
18167
  try {
17913
18168
  const data = await apiPost("/api/ads/meta/preview", body);
17914
18169
  const html = data.map((d) => d.body).join("\n");
18170
+ const hints = placement ? [
18171
+ `Rendered ${placement} as ad_format ${adFormat}. Open the iframe to SEE it \u2014 Meta does not document what it renders for a creative a placement cannot take, so a preview you looked at is the evidence, and anything you did not look at stays unverified.`
18172
+ ] : [];
17915
18173
  if (args["out-file"]) {
18174
+ const summary = { ok: true, data: { file: args["out-file"], rows: data.length, adFormat } };
17916
18175
  writeFileSync2(args["out-file"], html, "utf-8");
17917
- writeAdsJson({ ok: true, data: { file: args["out-file"], rows: data.length } });
18176
+ writeJsonEnvelope(hints.length > 0 ? { ...summary, hints } : summary);
17918
18177
  return;
17919
18178
  }
17920
- writeAdsJson({ ok: true, data });
18179
+ writeJsonEnvelope(hints.length > 0 ? { ok: true, data, hints } : { ok: true, data });
17921
18180
  } catch (err) {
17922
18181
  handleMetaError(err);
17923
18182
  }
@@ -17975,7 +18234,7 @@ Full guide: __tooling__/docs/tools/baker/ads-meta.md`
17975
18234
  pixels: pixelsCommand,
17976
18235
  activities: activitiesCommand,
17977
18236
  insights: insightsCommand,
17978
- preview: previewCommand,
18237
+ preview: previewCommand2,
17979
18238
  media: metaMediaCommand,
17980
18239
  draft: metaDraftCommand
17981
18240
  }
@@ -19489,13 +19748,127 @@ Full guides: __tooling__/docs/tools/baker/ads-<platform>.md (google|meta|linkedi
19489
19748
  }
19490
19749
  });
19491
19750
 
19492
- // src/commands/brand/index.ts
19751
+ // src/commands/agents/index.ts
19752
+ import { defineCommand as defineCommand89 } from "citty";
19753
+
19754
+ // src/commands/agents/list.ts
19755
+ import { defineCommand as defineCommand87 } from "citty";
19756
+
19757
+ // src/commands/agents/shared.ts
19758
+ function failValidation2(message) {
19759
+ writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message } });
19760
+ process.exit(1);
19761
+ }
19762
+ function failApi2(err) {
19763
+ if (err instanceof ApiError) {
19764
+ writeJson({ ok: false, error: { code: err.code, message: err.message } });
19765
+ process.exit(1);
19766
+ }
19767
+ const message = err instanceof Error ? err.message : "Unexpected error";
19768
+ writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message } });
19769
+ process.exit(1);
19770
+ }
19771
+
19772
+ // src/commands/agents/list.ts
19773
+ registerSchema({
19774
+ command: "agents.list",
19775
+ description: "The Baker agents that exist, with what each one does. Start here before recommending one, so you name a real teammate rather than inventing one.",
19776
+ args: {}
19777
+ });
19778
+ var listCommand10 = defineCommand87({
19779
+ meta: {
19780
+ name: "list",
19781
+ description: "List the Baker agents and what each does. Example: baker agents list"
19782
+ },
19783
+ run: async () => {
19784
+ try {
19785
+ const response = await apiPost(
19786
+ "/api/official-agents/list",
19787
+ {}
19788
+ );
19789
+ writeJson(response);
19790
+ } catch (err) {
19791
+ failApi2(err);
19792
+ }
19793
+ }
19794
+ });
19795
+
19796
+ // src/commands/agents/recommend.ts
19493
19797
  import { defineCommand as defineCommand88 } from "citty";
19798
+ registerSchema({
19799
+ command: "agents.recommend",
19800
+ description: "Suggest the company switch on another Baker agent, because the work you just found belongs to it. Does not block or wait \u2014 it records the suggestion on that agent's card in Tasks and your run carries on. Calling it again refreshes the same suggestion instead of stacking another, and a suggestion the company dismissed stays dismissed. Start here: baker agents list.",
19801
+ args: {
19802
+ agent: { type: "string", description: "Agent id to recommend, from `baker agents list`", required: true },
19803
+ from: { type: "string", description: "Your own agent id \u2014 who is making the suggestion", required: true },
19804
+ reason: {
19805
+ type: "string",
19806
+ description: "Why, in the company's own terms, naming what you found. Shown verbatim next to the switch, so write it for a marketer, not for us.",
19807
+ required: true
19808
+ }
19809
+ }
19810
+ });
19811
+ var recommendCommand = defineCommand88({
19812
+ meta: {
19813
+ name: "recommend",
19814
+ description: 'Suggest switching on another Baker agent. Example: baker agents recommend --agent baker-cro --from baker-analytics-reporter --reason "Your quote page gets the most traffic and converts the worst; Baker CRO is the one that fixes that."'
19815
+ },
19816
+ args: {
19817
+ agent: { type: "string", description: "Agent id to recommend", required: false },
19818
+ from: { type: "string", description: "Your own agent id", required: false },
19819
+ reason: { type: "string", description: "Why, in the company's terms", required: false }
19820
+ },
19821
+ run: async ({ args }) => {
19822
+ try {
19823
+ const agent = args.agent;
19824
+ const from = args.from;
19825
+ const reason = args.reason;
19826
+ if (!agent || !from || !reason) {
19827
+ failValidation2("--agent, --from and --reason are all required.");
19828
+ }
19829
+ if (agent === from) {
19830
+ failValidation2("An agent cannot recommend itself.");
19831
+ }
19832
+ const env = getEnv();
19833
+ const response = await apiPost("/api/official-agents/recommend", {
19834
+ agentId: agent,
19835
+ fromAgentId: from,
19836
+ reason,
19837
+ ...env.BAKER_CHAT_ID ? { chatId: env.BAKER_CHAT_ID } : {}
19838
+ });
19839
+ writeJson(response);
19840
+ } catch (err) {
19841
+ failApi2(err);
19842
+ }
19843
+ }
19844
+ });
19845
+
19846
+ // src/commands/agents/index.ts
19847
+ var agentsCommand = defineCommand89({
19848
+ meta: {
19849
+ name: "agents",
19850
+ description: `The other Baker agents, and how to ask for one. Subcommands: list, recommend.
19851
+
19852
+ Use this when the work in front of you belongs to a different agent than the one you are. Recommending does not block your run \u2014 it leaves the suggestion on that agent's card in Tasks, next to the switch that turns it on.
19853
+
19854
+ Examples:
19855
+ baker agents list
19856
+ baker agents recommend --agent baker-cro --from baker-analytics-reporter --reason "Your quote page gets the most traffic and converts the worst."
19857
+ Full guide: __tooling__/docs/tools/baker/agents.md`
19858
+ },
19859
+ subCommands: {
19860
+ list: listCommand10,
19861
+ recommend: recommendCommand
19862
+ }
19863
+ });
19864
+
19865
+ // src/commands/brand/index.ts
19866
+ import { defineCommand as defineCommand91 } from "citty";
19494
19867
 
19495
19868
  // src/commands/brand/fonts.ts
19496
19869
  import { mkdir, readFile, writeFile } from "fs/promises";
19497
19870
  import path from "path";
19498
- import { defineCommand as defineCommand87 } from "citty";
19871
+ import { defineCommand as defineCommand90 } from "citty";
19499
19872
 
19500
19873
  // src/engine/brand/fonts.ts
19501
19874
  var GOOGLE_CSS2 = "https://fonts.googleapis.com/css2";
@@ -19667,7 +20040,7 @@ async function readGlobalCss() {
19667
20040
  return "";
19668
20041
  }
19669
20042
  }
19670
- var fontsCheckCommand = defineCommand87({
20043
+ var fontsCheckCommand = defineCommand90({
19671
20044
  meta: {
19672
20045
  name: "check",
19673
20046
  description: "Verify the brand's fonts really exist. For every family/weight src/styles/global.css requests from Google Fonts, ask Google what it actually serves and report anything missing \u2014 a weight nobody serves renders as a synthesized fallback and looks off-brand everywhere."
@@ -19711,7 +20084,7 @@ var fontsCheckCommand = defineCommand87({
19711
20084
  });
19712
20085
  }
19713
20086
  });
19714
- var fontsFetchCommand = defineCommand87({
20087
+ var fontsFetchCommand = defineCommand90({
19715
20088
  meta: {
19716
20089
  name: "fetch",
19717
20090
  description: "Download a Google font into src/brand/fonts/ and print the @font-face block to paste above @theme in src/styles/global.css. Use when a brand font should be self-hosted rather than requested from Google on every page load."
@@ -19793,7 +20166,7 @@ var fontsFetchCommand = defineCommand87({
19793
20166
  });
19794
20167
  }
19795
20168
  });
19796
- var fontsCommand = defineCommand87({
20169
+ var fontsCommand = defineCommand90({
19797
20170
  meta: {
19798
20171
  name: "fonts",
19799
20172
  description: `Verify and self-host the brand's typefaces.
@@ -19811,7 +20184,7 @@ Subcommands:
19811
20184
  });
19812
20185
 
19813
20186
  // src/commands/brand/index.ts
19814
- var brandCommand = defineCommand88({
20187
+ var brandCommand = defineCommand91({
19815
20188
  meta: {
19816
20189
  name: "brand",
19817
20190
  description: `Brand asset verification for src/brand/.
@@ -19827,11 +20200,11 @@ Subcommands:
19827
20200
  });
19828
20201
 
19829
20202
  // src/commands/canvas/index.ts
19830
- import { defineCommand as defineCommand99 } from "citty";
20203
+ import { defineCommand as defineCommand102 } from "citty";
19831
20204
 
19832
20205
  // src/commands/canvas/catalog.ts
19833
- import { defineCommand as defineCommand89 } from "citty";
19834
- var catalogCommand = defineCommand89({
20206
+ import { defineCommand as defineCommand92 } from "citty";
20207
+ var catalogCommand = defineCommand92({
19835
20208
  meta: {
19836
20209
  name: "catalog",
19837
20210
  description: "Print the agent-facing node catalog (JSON Schema). Includes every registered node grouped by category."
@@ -19846,7 +20219,7 @@ var catalogCommand = defineCommand89({
19846
20219
  // src/commands/canvas/critique.ts
19847
20220
  import { readFile as readFile2 } from "fs/promises";
19848
20221
  import path2 from "path";
19849
- import { defineCommand as defineCommand90 } from "citty";
20222
+ import { defineCommand as defineCommand93 } from "citty";
19850
20223
 
19851
20224
  // src/engine/scaffold/lib/critique.ts
19852
20225
  var VIBE_CUE = /\b(light|lighting|golden|moody|warm|cool|tone|grade|contrast|shadow|glow|rim|backlit|neon|soft)\b/i;
@@ -19966,7 +20339,7 @@ function critiqueCanvas(canvas) {
19966
20339
  }
19967
20340
 
19968
20341
  // src/commands/canvas/critique.ts
19969
- var critiqueCommand = defineCommand90({
20342
+ var critiqueCommand = defineCommand93({
19970
20343
  meta: {
19971
20344
  name: "critique",
19972
20345
  description: "Pre-spend creative critic (ADVISORY \u2014 never blocks). Scores a scaffolded creative BEFORE the billed render, so weak spots get fixed for free. A VIDEO creative is scored on hook strength, sound-off first-frame legibility, retention risk, and mechanism clarity; a STATIC ad on baked-text legibility risk, identity grounding, brand-type fidelity, and mechanism clarity. Ground a video hook against `baker winning-ads hooks` for a proven pattern."
@@ -20008,9 +20381,9 @@ import { execFile } from "child_process";
20008
20381
  import { readdir, readFile as readFile3, stat } from "fs/promises";
20009
20382
  import path3 from "path";
20010
20383
  import { promisify } from "util";
20011
- import { defineCommand as defineCommand91 } from "citty";
20384
+ import { defineCommand as defineCommand94 } from "citty";
20012
20385
  var execFileAsync = promisify(execFile);
20013
- var inspectCommand = defineCommand91({
20386
+ var inspectCommand = defineCommand94({
20014
20387
  meta: {
20015
20388
  name: "inspect",
20016
20389
  description: "Dump a one-page summary of a canvas run: per-node duration + cache status, list of output files in the run dir, and optionally three thumbnail frames per video output. Pass either a run_id (resolved against --outputs-dir) or an absolute run directory."
@@ -20118,12 +20491,12 @@ async function probeDuration(filePath) {
20118
20491
 
20119
20492
  // src/commands/canvas/rerun.ts
20120
20493
  import path14 from "path";
20121
- import { defineCommand as defineCommand93 } from "citty";
20494
+ import { defineCommand as defineCommand96 } from "citty";
20122
20495
 
20123
20496
  // src/commands/canvas/run.ts
20124
20497
  import { readFile as readFile10 } from "fs/promises";
20125
20498
  import path13 from "path";
20126
- import { defineCommand as defineCommand92 } from "citty";
20499
+ import { defineCommand as defineCommand95 } from "citty";
20127
20500
 
20128
20501
  // src/commands/canvas/placeholders.ts
20129
20502
  function unsuppliedPlaceholderAssets(canvas) {
@@ -24289,7 +24662,7 @@ async function restoreRunSnapshot(manifest, targetDir, opts = {}) {
24289
24662
  }
24290
24663
 
24291
24664
  // src/commands/canvas/run.ts
24292
- var runCommand = defineCommand92({
24665
+ var runCommand = defineCommand95({
24293
24666
  meta: { name: "run", description: "Validate and execute a canvas JSON file." },
24294
24667
  args: {
24295
24668
  file: { type: "positional", required: true, description: "Path to canvas JSON" },
@@ -24659,7 +25032,7 @@ async function postInitialRunRecord(client, payload) {
24659
25032
 
24660
25033
  // src/commands/canvas/rerun.ts
24661
25034
  var SLUG_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
24662
- var rerunCommand = defineCommand93({
25035
+ var rerunCommand = defineCommand96({
24663
25036
  meta: {
24664
25037
  name: "rerun",
24665
25038
  description: "Re-run a creative's latest recorded canvas. Restores its definition files from run history first, so it works in a fresh workspace that never had the source chat's files \u2014 an interrupted run resumes (in-flight jobs re-attach), a completed one re-renders from the cache."
@@ -24756,7 +25129,7 @@ async function fetchManifest(url) {
24756
25129
  // src/commands/canvas/scaffold-static-ad.ts
24757
25130
  import { access, mkdir as mkdir6, readFile as readFile12, writeFile as writeFile7 } from "fs/promises";
24758
25131
  import path18 from "path";
24759
- import { defineCommand as defineCommand95 } from "citty";
25132
+ import { defineCommand as defineCommand98 } from "citty";
24760
25133
 
24761
25134
  // src/engine/scaffold/staticAd.ts
24762
25135
  import { z as z23 } from "zod";
@@ -25106,7 +25479,7 @@ function isValidScaffoldSlug(slug) {
25106
25479
  // src/commands/canvas/sync-definition.ts
25107
25480
  import { readdir as readdir5, readFile as readFile11, stat as stat3 } from "fs/promises";
25108
25481
  import path17 from "path";
25109
- import { defineCommand as defineCommand94 } from "citty";
25482
+ import { defineCommand as defineCommand97 } from "citty";
25110
25483
 
25111
25484
  // src/commands/canvas/definition-graph.ts
25112
25485
  var MAX_NODES = 300;
@@ -25219,7 +25592,7 @@ async function resolveCanvasPath(inputPath) {
25219
25592
  const chosen = (slug ? canvases.find((name) => name === `${slug}.canvas.json`) : void 0) ?? canvases[0];
25220
25593
  return chosen ? path17.join(dir, chosen) : null;
25221
25594
  }
25222
- var syncDefinitionCommand = defineCommand94({
25595
+ var syncDefinitionCommand = defineCommand97({
25223
25596
  meta: {
25224
25597
  name: "sync-definition",
25225
25598
  description: "Push a creative's current node-graph + input thumbnails to the dashboard without rendering. Runs automatically when you edit a creative's canvas.json or prompt.json."
@@ -25447,7 +25820,7 @@ async function runVisionPasses(canvas) {
25447
25820
  return fail3("read_outputs", e instanceof Error ? e.message : String(e));
25448
25821
  }
25449
25822
  }
25450
- var scaffoldStaticAdCommand = defineCommand95({
25823
+ var scaffoldStaticAdCommand = defineCommand98({
25451
25824
  meta: {
25452
25825
  name: "scaffold-static-ad",
25453
25826
  description: "Turn a source/inspiration image into a runnable static-ad canvas. Runs billed passes \u2014 image_describe (the blueprint, baked to prompt.json as the editable 'prompt'), an AI selection of the image's MAIN identity elements, and a structured global-layout pass (the column/row grid with per-region bounds and text sizes) \u2014 then scaffolds a canvas that wires one [TODO] ingest slot per element (logo/product/subject/badge + brand font) into image_generate. By default it also fans the hero out to the platform's placement ratios (via image_aspect_adapt \u2014 the hero ratio is free, the rest are billed AI recompositions); pass --placements none for a single base ad, or a preset to pick the set. Edit prompt.json and drop the real assets, then `baker canvas run` it."
@@ -25636,7 +26009,7 @@ var scaffoldStaticAdCommand = defineCommand95({
25636
26009
  import { access as access2, cp, mkdir as mkdir7, readFile as readFile15, rm as rm6, writeFile as writeFile8 } from "fs/promises";
25637
26010
  import { tmpdir as tmpdir2 } from "os";
25638
26011
  import path21 from "path";
25639
- import { defineCommand as defineCommand96 } from "citty";
26012
+ import { defineCommand as defineCommand99 } from "citty";
25640
26013
 
25641
26014
  // src/engine/scaffold/lib/model-router.ts
25642
26015
  var SEEDANCE = "bytedance/seedance-2.0";
@@ -26095,7 +26468,7 @@ async function runAnalysisPasses(deconstructCanvas, selectModel) {
26095
26468
  return fail4("deconstruct", e instanceof Error ? e.message : String(e));
26096
26469
  }
26097
26470
  }
26098
- var scaffoldVideoCommand = defineCommand96({
26471
+ var scaffoldVideoCommand = defineCommand99({
26099
26472
  meta: {
26100
26473
  name: "scaffold-video",
26101
26474
  description: "Turn a reference video into a runnable reproduction canvas in one command. Runs billed passes \u2014 video_deconstruct (the full scene-by-scene blueprint + transcript, baked to a split, editable blueprint: a global prompt.json plus one small scenes/sNN.json per scene) and an AI selection of the video's RECURRING identity elements (person/animal/product/logo) \u2014 then scaffolds a pipeline where every scene boundary is a static-ad-grade frame (the blueprint as target_blueprint, a reference legend, the real frame as anchor) and each recurring element gets ONE shared [TODO] ingest slot wired into every frame it appears in. The clips feed Seedance an ultra-detailed motion brief (action, camera, dialogue, transcript). Edit a scene's scenes/sNN.json (or prompt.json for global cast/palette/brand), drop the real source images, then `baker canvas run`."
@@ -26405,7 +26778,7 @@ var scaffoldVideoCommand = defineCommand96({
26405
26778
  // src/commands/canvas/set-prompt.ts
26406
26779
  import { readFile as readFile16, writeFile as writeFile9 } from "fs/promises";
26407
26780
  import path22 from "path";
26408
- import { defineCommand as defineCommand97 } from "citty";
26781
+ import { defineCommand as defineCommand100 } from "citty";
26409
26782
  function setNodePrompt(canvas, nodeId, text) {
26410
26783
  const nodes = canvas?.nodes;
26411
26784
  if (!Array.isArray(nodes)) throw new Error("canvas has no nodes array");
@@ -26420,7 +26793,7 @@ function setNodePrompt(canvas, nodeId, text) {
26420
26793
  newNodes[idx] = newNode;
26421
26794
  return { ...canvas, nodes: newNodes };
26422
26795
  }
26423
- var setPromptCommand = defineCommand97({
26796
+ var setPromptCommand = defineCommand100({
26424
26797
  meta: {
26425
26798
  name: "set-prompt",
26426
26799
  description: "Safely set a node's params.prompt (a frame description, motion prompt, etc.) without hand-editing the JSON. Prefer --text-file for multi-line/accented copy \u2014 it preserves UTF-8 exactly, unlike shell-quoted jq."
@@ -26480,8 +26853,8 @@ var setPromptCommand = defineCommand97({
26480
26853
  // src/commands/canvas/validate.ts
26481
26854
  import { readFile as readFile17 } from "fs/promises";
26482
26855
  import path23 from "path";
26483
- import { defineCommand as defineCommand98 } from "citty";
26484
- var validateCommand = defineCommand98({
26856
+ import { defineCommand as defineCommand101 } from "citty";
26857
+ var validateCommand = defineCommand101({
26485
26858
  meta: {
26486
26859
  name: "validate",
26487
26860
  description: "Validate a canvas JSON file (no execution). Includes a per-node cost preview and runs each node's deep validators (composition meta checks for hyperframe_render/_snapshot)."
@@ -26551,7 +26924,7 @@ var validateCommand = defineCommand98({
26551
26924
  });
26552
26925
 
26553
26926
  // src/commands/canvas/index.ts
26554
- var canvasCommand = defineCommand99({
26927
+ var canvasCommand = defineCommand102({
26555
26928
  meta: {
26556
26929
  name: "canvas",
26557
26930
  description: `Run Baker creative canvas JSON files locally. Local nodes execute in-process; remote nodes POST to the Convex backend gateway.
@@ -26585,7 +26958,7 @@ Full guide: __tooling__/docs/tools/baker/canvas.md`
26585
26958
  });
26586
26959
 
26587
26960
  // src/commands/capabilities/index.ts
26588
- import { defineCommand as defineCommand100 } from "citty";
26961
+ import { defineCommand as defineCommand103 } from "citty";
26589
26962
  registerSchema({
26590
26963
  command: "capabilities",
26591
26964
  description: "Start here, before promising the user anything on an ad platform, in Analytics, or in Tag Manager. Answers three questions in one call: what is connected and with what access, what a write on each surface actually does when it lands, and what CANNOT be done here and why. Run it with no arguments for every surface; name one surface to also get the exact fields every change on it accepts.",
@@ -26628,7 +27001,7 @@ function capabilityHints(surfaces) {
26628
27001
  }
26629
27002
  return hints;
26630
27003
  }
26631
- var runCapabilities = defineCommand100({
27004
+ var runCapabilities = defineCommand103({
26632
27005
  meta: {
26633
27006
  name: "capabilities",
26634
27007
  description: `What Baker can and cannot do for this company, before any work starts.
@@ -26684,7 +27057,7 @@ Full guide: __tooling__/docs/tools/baker/capabilities.md`
26684
27057
  var capabilitiesCommand = runCapabilities;
26685
27058
 
26686
27059
  // src/commands/chats/index.ts
26687
- import { defineCommand as defineCommand101 } from "citty";
27060
+ import { defineCommand as defineCommand104 } from "citty";
26688
27061
  var STATUS_GROUPS = ["active", "archived", "all"];
26689
27062
  var REPO_SURFACES = ["knowledge", "company", "brand", "landings", "flows", "creatives"];
26690
27063
  function parseBoundedInt(raw, name, min, max) {
@@ -26706,7 +27079,7 @@ registerSchema({
26706
27079
  full: { type: "boolean", description: "Include each Session's full change list", required: false, default: false }
26707
27080
  }
26708
27081
  });
26709
- var listCommand10 = defineCommand101({
27082
+ var listCommand11 = defineCommand104({
26710
27083
  meta: { name: "list", description: "List other Sessions on this account, newest first." },
26711
27084
  args: {
26712
27085
  status: { type: "string", description: "Filter: active|archived|all (default: all)", required: false },
@@ -26761,7 +27134,7 @@ registerSchema({
26761
27134
  }
26762
27135
  }
26763
27136
  });
26764
- var viewCommand = defineCommand101({
27137
+ var viewCommand = defineCommand104({
26765
27138
  meta: {
26766
27139
  name: "view",
26767
27140
  description: "Inspect one Session's full effects \u2014 git content + actions/tags/ads, kickoff, commits."
@@ -26805,7 +27178,7 @@ registerSchema({
26805
27178
  }
26806
27179
  }
26807
27180
  });
26808
- var transcriptCommand = defineCommand101({
27181
+ var transcriptCommand = defineCommand104({
26809
27182
  meta: { name: "transcript", description: "Read another Session's conversation." },
26810
27183
  args: {
26811
27184
  id: { type: "positional", description: "The Session id", required: true },
@@ -26857,7 +27230,7 @@ registerSchema({
26857
27230
  }
26858
27231
  }
26859
27232
  });
26860
- var diffCommand = defineCommand101({
27233
+ var diffCommand = defineCommand104({
26861
27234
  meta: { name: "diff", description: "See a published Session's real file-level changes." },
26862
27235
  args: {
26863
27236
  id: { type: "positional", description: "The Session id", required: true },
@@ -26901,14 +27274,14 @@ var diffCommand = defineCommand101({
26901
27274
  }
26902
27275
  }
26903
27276
  });
26904
- var chatsCommand = defineCommand101({
27277
+ var chatsCommand = defineCommand104({
26905
27278
  meta: {
26906
27279
  name: "chats",
26907
27280
  description: `Inspect other Sessions on this account (read-only): list them, view what they produced, read their conversation, and see their real file changes \u2014 so you can reuse past work for a new goal.
26908
27281
  Full guide: __tooling__/docs/tools/baker/chats.md`
26909
27282
  },
26910
27283
  subCommands: {
26911
- list: listCommand10,
27284
+ list: listCommand11,
26912
27285
  view: viewCommand,
26913
27286
  transcript: transcriptCommand,
26914
27287
  diff: diffCommand
@@ -26916,10 +27289,10 @@ Full guide: __tooling__/docs/tools/baker/chats.md`
26916
27289
  });
26917
27290
 
26918
27291
  // src/commands/creatives/index.ts
26919
- import { defineCommand as defineCommand103 } from "citty";
27292
+ import { defineCommand as defineCommand106 } from "citty";
26920
27293
 
26921
27294
  // src/commands/creatives/publish.ts
26922
- import { defineCommand as defineCommand102 } from "citty";
27295
+ import { defineCommand as defineCommand105 } from "citty";
26923
27296
 
26924
27297
  // src/commands/images/api.ts
26925
27298
  import { readFile as readFile18 } from "fs/promises";
@@ -27066,7 +27439,7 @@ async function publishCreative(args, deps = defaultImageApiDeps) {
27066
27439
  chatId: chatIdFromEnv()
27067
27440
  });
27068
27441
  }
27069
- var publishCommand = defineCommand102({
27442
+ var publishCommand = defineCommand105({
27070
27443
  meta: {
27071
27444
  name: "publish",
27072
27445
  description: "Publish a final static creative image to Baker Creatives and print the creative reference JSON."
@@ -27124,7 +27497,7 @@ var publishCommand = defineCommand102({
27124
27497
  });
27125
27498
 
27126
27499
  // src/commands/creatives/index.ts
27127
- var creativesCommand3 = defineCommand103({
27500
+ var creativesCommand3 = defineCommand106({
27128
27501
  meta: {
27129
27502
  name: "creatives",
27130
27503
  description: `Publish static ad creatives as first-class Baker outputs.
@@ -27141,7 +27514,7 @@ Full guide: __tooling__/docs/tools/baker/creatives.md`
27141
27514
  });
27142
27515
 
27143
27516
  // src/commands/flows/index.ts
27144
- import { defineCommand as defineCommand104 } from "citty";
27517
+ import { defineCommand as defineCommand107 } from "citty";
27145
27518
 
27146
27519
  // src/commands/flows/shared.ts
27147
27520
  import { existsSync as existsSync4, readdirSync as readdirSync2, readFileSync as readFileSync9 } from "fs";
@@ -27296,7 +27669,7 @@ function displayName(slug) {
27296
27669
  const name = tree.displayName;
27297
27670
  return typeof name === "string" && name.trim() ? name.trim() : slug;
27298
27671
  }
27299
- var listCommand11 = defineCommand104({
27672
+ var listCommand12 = defineCommand107({
27300
27673
  meta: {
27301
27674
  name: "list",
27302
27675
  description: "List Forms in this workspace with the count of confidential fields still needing setup. Example: baker flows list"
@@ -27310,7 +27683,7 @@ var listCommand11 = defineCommand104({
27310
27683
  writeJson({ ok: true, data: { flows } });
27311
27684
  }
27312
27685
  });
27313
- var showCommand3 = defineCommand104({
27686
+ var showCommand3 = defineCommand107({
27314
27687
  meta: {
27315
27688
  name: "show",
27316
27689
  description: "Show a Form's confidential fields and their configuration status (never secret values). Example: baker flows show contact"
@@ -27331,7 +27704,7 @@ var showCommand3 = defineCommand104({
27331
27704
  writeJson({ ok: true, data: response });
27332
27705
  }
27333
27706
  });
27334
- var flowsCommand = defineCommand104({
27707
+ var flowsCommand = defineCommand107({
27335
27708
  meta: {
27336
27709
  name: "flows",
27337
27710
  description: `Read this workspace's Forms (flows) and the configuration status of their confidential fields \u2014 connection secrets, OAuth connections, and third-party field definitions (HubSpot, Calendly, HighLevel, SavvyCal).
@@ -27345,7 +27718,7 @@ Examples:
27345
27718
  Full guide: __tooling__/docs/tools/baker/flows.md`
27346
27719
  },
27347
27720
  subCommands: {
27348
- list: listCommand11,
27721
+ list: listCommand12,
27349
27722
  show: showCommand3
27350
27723
  },
27351
27724
  // Bare `baker flows` lists the Forms. This must be `default`, not `run`: citty falls
@@ -27355,10 +27728,10 @@ Full guide: __tooling__/docs/tools/baker/flows.md`
27355
27728
  });
27356
27729
 
27357
27730
  // src/commands/ga4/index.ts
27358
- import { defineCommand as defineCommand111 } from "citty";
27731
+ import { defineCommand as defineCommand114 } from "citty";
27359
27732
 
27360
27733
  // src/commands/ga4/audit.ts
27361
- import { defineCommand as defineCommand105 } from "citty";
27734
+ import { defineCommand as defineCommand108 } from "citty";
27362
27735
 
27363
27736
  // src/commands/ga4/resolve.ts
27364
27737
  async function fetchProperties(useCache = true) {
@@ -27424,7 +27797,7 @@ registerSchema({
27424
27797
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
27425
27798
  }
27426
27799
  });
27427
- var auditCommand2 = defineCommand105({
27800
+ var auditCommand2 = defineCommand108({
27428
27801
  meta: {
27429
27802
  name: "audit",
27430
27803
  description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
@@ -27479,11 +27852,11 @@ Examples:
27479
27852
  });
27480
27853
 
27481
27854
  // src/commands/ga4/config.ts
27482
- import { defineCommand as defineCommand106 } from "citty";
27855
+ import { defineCommand as defineCommand109 } from "citty";
27483
27856
 
27484
27857
  // src/commands/ga4/shared.ts
27485
27858
  import { readFileSync as readFileSync10 } from "fs";
27486
- function failValidation2(message) {
27859
+ function failValidation3(message) {
27487
27860
  writeJsonEnvelope({ ok: false, error: { code: "VALIDATION_ERROR", message } });
27488
27861
  process.exit(1);
27489
27862
  }
@@ -27491,7 +27864,7 @@ function requireTarget4(args, entity) {
27491
27864
  const positional = Array.isArray(args._) ? args._[0] : void 0;
27492
27865
  const target = args.id ?? args.target ?? positional;
27493
27866
  if (typeof target !== "string" || target.length === 0) {
27494
- failValidation2(`pass the ${entity} id as the positional argument`);
27867
+ failValidation3(`pass the ${entity} id as the positional argument`);
27495
27868
  }
27496
27869
  return target;
27497
27870
  }
@@ -27500,17 +27873,17 @@ function readJsonSource(args, flag) {
27500
27873
  const file = args.file;
27501
27874
  const raw = typeof file === "string" && file.length > 0 ? readFileSync10(file, "utf8") : typeof inline === "string" && inline.length > 0 ? inline : void 0;
27502
27875
  if (raw === void 0) {
27503
- failValidation2(`pass --${flag} with inline JSON or --file with a path to a JSON file`);
27876
+ failValidation3(`pass --${flag} with inline JSON or --file with a path to a JSON file`);
27504
27877
  }
27505
27878
  try {
27506
27879
  return JSON.parse(raw);
27507
27880
  } catch {
27508
- return failValidation2(`--${flag} is not valid JSON`);
27881
+ return failValidation3(`--${flag} is not valid JSON`);
27509
27882
  }
27510
27883
  }
27511
27884
  function asObject(value, flag, index) {
27512
27885
  if (!value || typeof value !== "object" || Array.isArray(value)) {
27513
- failValidation2(
27886
+ failValidation3(
27514
27887
  index === void 0 ? `--${flag} must be a JSON object` : `--${flag}[${index}] must be a JSON object`
27515
27888
  );
27516
27889
  }
@@ -27525,7 +27898,7 @@ function loadJsonPayloads(args) {
27525
27898
  return [asObject(parsed, "json")];
27526
27899
  }
27527
27900
  if (parsed.length === 0) {
27528
- failValidation2("--json is an empty list \u2014 pass at least one definition");
27901
+ failValidation3("--json is an empty list \u2014 pass at least one definition");
27529
27902
  }
27530
27903
  return parsed.map((entry, index) => asObject(entry, "json", index));
27531
27904
  }
@@ -27671,7 +28044,7 @@ function configHints(config) {
27671
28044
  }
27672
28045
  return hints;
27673
28046
  }
27674
- var configCommand = defineCommand106({
28047
+ var configCommand = defineCommand109({
27675
28048
  meta: {
27676
28049
  name: "config",
27677
28050
  description: `Read how the property is configured to measure \u2014 key events, custom definitions, custom events, retention
@@ -27699,7 +28072,7 @@ Examples:
27699
28072
  });
27700
28073
 
27701
28074
  // src/commands/ga4/draft.ts
27702
- import { defineCommand as defineCommand107 } from "citty";
28075
+ import { defineCommand as defineCommand110 } from "citty";
27703
28076
  registerSchema({
27704
28077
  command: "ga4.draft",
27705
28078
  description: "Review and undo the Google Analytics changes staged on this chat. Use `list` to see everything staged, `show` to inspect one change in full before the chat completes, `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.",
@@ -27708,13 +28081,13 @@ registerSchema({
27708
28081
  chat: { type: "string", description: CHAT_READ_ARG.description, required: false }
27709
28082
  }
27710
28083
  });
27711
- var draftCommand3 = defineCommand107({
28084
+ var draftCommand3 = defineCommand110({
27712
28085
  meta: {
27713
28086
  name: "draft",
27714
28087
  description: "List, show, amend, remove or clear the Google Analytics changes staged on this chat. `list` and `show` take --chat <id> to read an earlier chat's changes instead."
27715
28088
  },
27716
28089
  subCommands: {
27717
- list: defineCommand107({
28090
+ list: defineCommand110({
27718
28091
  meta: { name: "list", description: "Review everything staged on this chat (--json for the raw envelope)" },
27719
28092
  args: {
27720
28093
  json: { type: "boolean", description: "Print the raw JSON envelope", required: false },
@@ -27724,7 +28097,7 @@ var draftCommand3 = defineCommand107({
27724
28097
  await draftList(args.json === true, args.chat);
27725
28098
  }
27726
28099
  }),
27727
- show: defineCommand107({
28100
+ show: defineCommand110({
27728
28101
  meta: {
27729
28102
  name: "show",
27730
28103
  description: "Print the full staged payload for one change, alongside how the property looks today \u2014 the receipt to verify it before the chat completes (never truncated)."
@@ -27741,7 +28114,7 @@ var draftCommand3 = defineCommand107({
27741
28114
  );
27742
28115
  }
27743
28116
  }),
27744
- amend: defineCommand107({
28117
+ amend: defineCommand110({
27745
28118
  meta: {
27746
28119
  name: "amend",
27747
28120
  description: "Update a staged change in place \u2014 merges a JSON patch into its payload (objects deep-merge, null deletes a key, arrays/scalars replace) and re-runs every check. Use this instead of remove + re-create."
@@ -27758,7 +28131,7 @@ var draftCommand3 = defineCommand107({
27758
28131
  });
27759
28132
  }
27760
28133
  }),
27761
- remove: defineCommand107({
28134
+ remove: defineCommand110({
27762
28135
  meta: { name: "remove", description: "Remove one staged change" },
27763
28136
  args: { ref: { type: "positional", description: "Staged ref or target id", required: false } },
27764
28137
  run: async ({ args }) => {
@@ -27767,7 +28140,7 @@ var draftCommand3 = defineCommand107({
27767
28140
  });
27768
28141
  }
27769
28142
  }),
27770
- clear: defineCommand107({
28143
+ clear: defineCommand110({
27771
28144
  meta: { name: "clear", description: "Discard all Google Analytics changes staged on this chat" },
27772
28145
  run: async () => {
27773
28146
  await draftAction2("/api/ga4/draft/clear", {});
@@ -27777,7 +28150,7 @@ var draftCommand3 = defineCommand107({
27777
28150
  });
27778
28151
 
27779
28152
  // src/commands/ga4/properties.ts
27780
- import { defineCommand as defineCommand108 } from "citty";
28153
+ import { defineCommand as defineCommand111 } from "citty";
27781
28154
  registerSchema({
27782
28155
  command: "ga4.properties",
27783
28156
  description: "List the GA4 properties this company connected \u2014 there can be several, and every one of them is yours to query. Returns the property IDs the query and audit commands take. Run this first to find property IDs.",
@@ -27793,7 +28166,7 @@ function propertyHints(properties) {
27793
28166
  resources: properties.map((property) => ({ id: property.externalId, label: property.name }))
27794
28167
  });
27795
28168
  }
27796
- var propertiesCommand = defineCommand108({
28169
+ var propertiesCommand = defineCommand111({
27797
28170
  meta: {
27798
28171
  name: "properties",
27799
28172
  description: `List accessible GA4 properties.
@@ -27843,7 +28216,7 @@ Examples:
27843
28216
  // src/commands/ga4/query.ts
27844
28217
  import { appendFileSync as appendFileSync2, existsSync as existsSync5, readFileSync as readFileSync11, writeFileSync as writeFileSync3 } from "fs";
27845
28218
  import { resolve as resolve2 } from "path";
27846
- import { defineCommand as defineCommand109 } from "citty";
28219
+ import { defineCommand as defineCommand112 } from "citty";
27847
28220
 
27848
28221
  // src/commands/ga4/presets.ts
27849
28222
  var GA4_PRESETS = [
@@ -27978,7 +28351,7 @@ function handleError2(err) {
27978
28351
  });
27979
28352
  process.exit(1);
27980
28353
  }
27981
- var queryCommand2 = defineCommand109({
28354
+ var queryCommand2 = defineCommand112({
27982
28355
  meta: {
27983
28356
  name: "query",
27984
28357
  description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
@@ -28049,7 +28422,7 @@ Free-form (escape hatch):
28049
28422
  });
28050
28423
 
28051
28424
  // src/commands/ga4/write-commands.ts
28052
- import { defineCommand as defineCommand110 } from "citty";
28425
+ import { defineCommand as defineCommand113 } from "citty";
28053
28426
  var PROPERTY_ARG_DESCRIPTION = "GA4 property id (optional only when one property is connected \u2014 run `baker ga4 properties`)";
28054
28427
  var propertyArg = { type: "string", description: PROPERTY_ARG_DESCRIPTION, required: false };
28055
28428
  function createJsonDescription(noun) {
@@ -28067,7 +28440,7 @@ registerSchema({
28067
28440
  "property-id": { type: "string", description: PROPERTY_ARG_DESCRIPTION, required: false }
28068
28441
  }
28069
28442
  });
28070
- var keyEventCommand = defineCommand110({
28443
+ var keyEventCommand = defineCommand113({
28071
28444
  meta: {
28072
28445
  name: "key-event",
28073
28446
  description: `Stage key-event (conversion) changes
@@ -28080,7 +28453,7 @@ Examples:
28080
28453
  baker ga4 key-event delete 4185`
28081
28454
  },
28082
28455
  subCommands: {
28083
- create: defineCommand110({
28456
+ create: defineCommand113({
28084
28457
  meta: {
28085
28458
  name: "create",
28086
28459
  description: "Stage a new key event. Needs eventName and countingMethod (ONCE_PER_EVENT or ONCE_PER_SESSION); defaultValue sets a monetary value when the event does not send one."
@@ -28101,7 +28474,7 @@ Examples:
28101
28474
  );
28102
28475
  }
28103
28476
  }),
28104
- update: defineCommand110({
28477
+ update: defineCommand113({
28105
28478
  meta: {
28106
28479
  name: "update",
28107
28480
  description: "Stage a change to an existing key event (pass its id). Only countingMethod and defaultValue can change \u2014 Google will not rename a key event."
@@ -28121,7 +28494,7 @@ Examples:
28121
28494
  });
28122
28495
  }
28123
28496
  }),
28124
- delete: defineCommand110({
28497
+ delete: defineCommand113({
28125
28498
  meta: {
28126
28499
  name: "delete",
28127
28500
  description: "Stage removing a key event, so the event stops counting as a conversion. The event itself keeps being collected. Irreversible once the chat completes \u2014 confirm with the user first."
@@ -28169,7 +28542,7 @@ for (const { kind, noun, createHint } of DEFINITIONS) {
28169
28542
  }
28170
28543
  function definitionCommand(definition) {
28171
28544
  const { command, kind, noun, example } = definition;
28172
- return defineCommand110({
28545
+ return defineCommand113({
28173
28546
  meta: {
28174
28547
  name: command,
28175
28548
  description: `Stage ${noun} changes
@@ -28181,7 +28554,7 @@ Examples:
28181
28554
  baker ga4 ${command} archive 12`
28182
28555
  },
28183
28556
  subCommands: {
28184
- create: defineCommand110({
28557
+ create: defineCommand113({
28185
28558
  meta: { name: "create", description: `Stage a new ${noun} (or a JSON array of them, staged together)` },
28186
28559
  args: {
28187
28560
  json: { type: "string", description: createJsonDescription(noun), required: false },
@@ -28199,7 +28572,7 @@ Examples:
28199
28572
  );
28200
28573
  }
28201
28574
  }),
28202
- update: defineCommand110({
28575
+ update: defineCommand113({
28203
28576
  meta: {
28204
28577
  name: "update",
28205
28578
  description: `Stage a change to an existing ${noun} (pass its id). The parameter name and scope cannot change \u2014 archive and recreate for that.`
@@ -28219,7 +28592,7 @@ Examples:
28219
28592
  });
28220
28593
  }
28221
28594
  }),
28222
- archive: defineCommand110({
28595
+ archive: defineCommand113({
28223
28596
  meta: {
28224
28597
  name: "archive",
28225
28598
  description: `Stage archiving a ${noun} (pass its id). It stops collecting and leaves reporting; past data stays. Irreversible once the chat completes \u2014 confirm with the user first.`
@@ -28264,7 +28637,7 @@ var dataStreamArg = {
28264
28637
  function withStream(args) {
28265
28638
  return typeof args["data-stream"] === "string" ? { dataStream: args["data-stream"] } : {};
28266
28639
  }
28267
- var customEventCommand = defineCommand110({
28640
+ var customEventCommand = defineCommand113({
28268
28641
  meta: {
28269
28642
  name: "custom-event",
28270
28643
  description: `Stage custom events \u2014 new events built from events the site already sends
@@ -28275,7 +28648,7 @@ Examples:
28275
28648
  baker ga4 custom-event delete 7`
28276
28649
  },
28277
28650
  subCommands: {
28278
- create: defineCommand110({
28651
+ create: defineCommand113({
28279
28652
  meta: {
28280
28653
  name: "create",
28281
28654
  description: "Stage a new custom event. Conditions match the source event: use field `event_name` to match the event itself, or any parameter name to match its value."
@@ -28298,7 +28671,7 @@ Examples:
28298
28671
  );
28299
28672
  }
28300
28673
  }),
28301
- update: defineCommand110({
28674
+ update: defineCommand113({
28302
28675
  meta: { name: "update", description: "Stage a change to an existing custom event (pass its id)" },
28303
28676
  args: {
28304
28677
  id: { type: "positional", description: "Custom event rule id", required: false },
@@ -28317,7 +28690,7 @@ Examples:
28317
28690
  });
28318
28691
  }
28319
28692
  }),
28320
- delete: defineCommand110({
28693
+ delete: defineCommand113({
28321
28694
  meta: {
28322
28695
  name: "delete",
28323
28696
  description: "Stage removing a custom event (pass its id). The event stops being created from then on; data already collected under it stays. Confirm with the user first."
@@ -28363,16 +28736,16 @@ function retentionValue(input, flag) {
28363
28736
  const normalized = input.trim();
28364
28737
  const mapped = RETENTION_BY_MONTHS[normalized] ?? (Object.values(RETENTION_BY_MONTHS).includes(normalized.toUpperCase()) ? normalized.toUpperCase() : void 0);
28365
28738
  if (!mapped) {
28366
- failValidation2(`--${flag} must be one of 2, 14, 26, 38 or 50 (months)`);
28739
+ failValidation3(`--${flag} must be one of 2, 14, 26, 38 or 50 (months)`);
28367
28740
  }
28368
28741
  return mapped;
28369
28742
  }
28370
28743
  function booleanArg(input, flag) {
28371
28744
  if (input === "true") return true;
28372
28745
  if (input === "false") return false;
28373
- return failValidation2(`--${flag} must be true or false`);
28746
+ return failValidation3(`--${flag} must be true or false`);
28374
28747
  }
28375
- var dataRetentionCommand = defineCommand110({
28748
+ var dataRetentionCommand = defineCommand113({
28376
28749
  meta: {
28377
28750
  name: "data-retention",
28378
28751
  description: `Stage a change to how long Google Analytics keeps data
@@ -28382,7 +28755,7 @@ Examples:
28382
28755
  baker ga4 data-retention set --event-data 14 --user-data 14 --reset-on-activity true`
28383
28756
  },
28384
28757
  subCommands: {
28385
- set: defineCommand110({
28758
+ set: defineCommand113({
28386
28759
  meta: { name: "set", description: "Stage the retention window (months)" },
28387
28760
  args: {
28388
28761
  "event-data": { type: "string", description: "2, 14, 26, 38 or 50", required: false },
@@ -28402,7 +28775,7 @@ Examples:
28402
28775
  payload.resetUserDataOnNewActivity = booleanArg(args["reset-on-activity"], "reset-on-activity");
28403
28776
  }
28404
28777
  if (Object.keys(payload).length === 0) {
28405
- failValidation2("pass at least one of --event-data, --user-data or --reset-on-activity");
28778
+ failValidation3("pass at least one of --event-data, --user-data or --reset-on-activity");
28406
28779
  }
28407
28780
  await stageOp3({ kind: "ga4.dataRetention.update", payload, ...withProperty(args) });
28408
28781
  }
@@ -28411,7 +28784,7 @@ Examples:
28411
28784
  });
28412
28785
 
28413
28786
  // src/commands/ga4/index.ts
28414
- var ga4Command = defineCommand111({
28787
+ var ga4Command = defineCommand114({
28415
28788
  meta: {
28416
28789
  name: "ga4",
28417
28790
  description: `Google Analytics 4. Report on a property, audit its config, and change what it measures.
@@ -28452,12 +28825,12 @@ Full guide: __tooling__/docs/tools/baker/ga4.md`
28452
28825
  });
28453
28826
 
28454
28827
  // src/commands/gsc/index.ts
28455
- import { defineCommand as defineCommand115 } from "citty";
28828
+ import { defineCommand as defineCommand118 } from "citty";
28456
28829
 
28457
28830
  // src/commands/gsc/query.ts
28458
28831
  import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync12, writeFileSync as writeFileSync4 } from "fs";
28459
28832
  import { resolve as resolve3 } from "path";
28460
- import { defineCommand as defineCommand112 } from "citty";
28833
+ import { defineCommand as defineCommand115 } from "citty";
28461
28834
 
28462
28835
  // src/commands/gsc/presets.ts
28463
28836
  var GSC_PRESETS = [
@@ -28651,7 +29024,7 @@ function handleError3(err) {
28651
29024
  });
28652
29025
  process.exit(1);
28653
29026
  }
28654
- var queryCommand3 = defineCommand112({
29027
+ var queryCommand3 = defineCommand115({
28655
29028
  meta: {
28656
29029
  name: "query",
28657
29030
  description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
@@ -28729,7 +29102,7 @@ Free-form (escape hatch):
28729
29102
  });
28730
29103
 
28731
29104
  // src/commands/gsc/sitemaps.ts
28732
- import { defineCommand as defineCommand113 } from "citty";
29105
+ import { defineCommand as defineCommand116 } from "citty";
28733
29106
  registerSchema({
28734
29107
  command: "gsc.sitemaps",
28735
29108
  description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
@@ -28738,7 +29111,7 @@ registerSchema({
28738
29111
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
28739
29112
  }
28740
29113
  });
28741
- var sitemapsCommand = defineCommand113({
29114
+ var sitemapsCommand = defineCommand116({
28742
29115
  meta: {
28743
29116
  name: "sitemaps",
28744
29117
  description: `List sitemaps for a site. Check health and errors.
@@ -28791,7 +29164,7 @@ Examples:
28791
29164
  });
28792
29165
 
28793
29166
  // src/commands/gsc/sites.ts
28794
- import { defineCommand as defineCommand114 } from "citty";
29167
+ import { defineCommand as defineCommand117 } from "citty";
28795
29168
  registerSchema({
28796
29169
  command: "gsc.sites",
28797
29170
  description: "List the Search Console sites this company connected \u2014 there can be several, and every one of them is yours to query. Returns the site URLs the query and sitemaps commands take.",
@@ -28807,7 +29180,7 @@ function siteHints(sites) {
28807
29180
  resources: sites.map((site) => ({ id: site.siteUrl, label: site.permissionLevel }))
28808
29181
  });
28809
29182
  }
28810
- var sitesCommand = defineCommand114({
29183
+ var sitesCommand = defineCommand117({
28811
29184
  meta: {
28812
29185
  name: "sites",
28813
29186
  description: `List verified Search Console sites.
@@ -28855,7 +29228,7 @@ Examples:
28855
29228
  });
28856
29229
 
28857
29230
  // src/commands/gsc/index.ts
28858
- var gscCommand = defineCommand115({
29231
+ var gscCommand = defineCommand118({
28859
29232
  meta: {
28860
29233
  name: "gsc",
28861
29234
  description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
@@ -28879,7 +29252,7 @@ Full guide: __tooling__/docs/tools/baker/gsc.md`
28879
29252
  });
28880
29253
 
28881
29254
  // src/commands/history/index.ts
28882
- import { defineCommand as defineCommand116 } from "citty";
29255
+ import { defineCommand as defineCommand119 } from "citty";
28883
29256
  registerSchema({
28884
29257
  command: "history.list",
28885
29258
  description: "Start here: unified account history (audit log) \u2014 everything that changed on this account, newest first: publishes, chat lifecycle, backlog actions, team changes, setup links, tags, schedules, ad-platform writes, followed advertisers, media, creatives, reports, domains, and integrations. Use it to see what happened recently before planning work. Compact by default; add --full for raw metadata per entry.",
@@ -28934,7 +29307,7 @@ function parseBoundedInt2(raw, name, min, max) {
28934
29307
  }
28935
29308
  return value;
28936
29309
  }
28937
- var listCommand12 = defineCommand116({
29310
+ var listCommand13 = defineCommand119({
28938
29311
  meta: {
28939
29312
  name: "list",
28940
29313
  description: "List recent account changes (unified audit log), newest first."
@@ -28980,17 +29353,17 @@ var listCommand12 = defineCommand116({
28980
29353
  }
28981
29354
  }
28982
29355
  });
28983
- var historyCommand = defineCommand116({
29356
+ var historyCommand = defineCommand119({
28984
29357
  meta: {
28985
29358
  name: "history",
28986
29359
  description: `Unified account history (audit log): what changed, who did it, and when.
28987
29360
  Full guide: __tooling__/docs/tools/baker/history.md`
28988
29361
  },
28989
- subCommands: { list: listCommand12 }
29362
+ subCommands: { list: listCommand13 }
28990
29363
  });
28991
29364
 
28992
29365
  // src/commands/hubspot/index.ts
28993
- import { defineCommand as defineCommand117 } from "citty";
29366
+ import { defineCommand as defineCommand120 } from "citty";
28994
29367
  var EMBED_TYPES = ["legacy", "v4", "unknown"];
28995
29368
  function failNotConnected(err) {
28996
29369
  if (err instanceof ApiError && err.code === "FORBIDDEN" && err.message.includes(HUBSPOT_MISSING_GRANT_MARKER)) {
@@ -29127,7 +29500,7 @@ registerSchema({
29127
29500
  }
29128
29501
  }
29129
29502
  });
29130
- var formsListCommand = defineCommand117({
29503
+ var formsListCommand = defineCommand120({
29131
29504
  meta: {
29132
29505
  name: "list",
29133
29506
  description: "List HubSpot forms with embed type and post-submit action. Example: baker hubspot forms list --redirecting-only"
@@ -29172,7 +29545,7 @@ var formsListCommand = defineCommand117({
29172
29545
  }
29173
29546
  }
29174
29547
  });
29175
- var formsViewCommand = defineCommand117({
29548
+ var formsViewCommand = defineCommand120({
29176
29549
  meta: {
29177
29550
  name: "view",
29178
29551
  description: "Show one HubSpot form's fields and configuration. Example: baker hubspot forms view 1a2b3c"
@@ -29224,7 +29597,7 @@ var formsViewCommand = defineCommand117({
29224
29597
  }
29225
29598
  }
29226
29599
  });
29227
- var meetingsListCommand = defineCommand117({
29600
+ var meetingsListCommand = defineCommand120({
29228
29601
  meta: {
29229
29602
  name: "list",
29230
29603
  description: "List HubSpot meeting links (calendars). Example: baker hubspot meetings list"
@@ -29266,7 +29639,7 @@ var meetingsListCommand = defineCommand117({
29266
29639
  }
29267
29640
  }
29268
29641
  });
29269
- var meetingsViewCommand = defineCommand117({
29642
+ var meetingsViewCommand = defineCommand120({
29270
29643
  meta: {
29271
29644
  name: "view",
29272
29645
  description: "Show one HubSpot meeting link's booking fields. Example: baker hubspot meetings view discovery-call"
@@ -29310,7 +29683,7 @@ var meetingsViewCommand = defineCommand117({
29310
29683
  }
29311
29684
  }
29312
29685
  });
29313
- var formsSubmissionsCommand = defineCommand117({
29686
+ var formsSubmissionsCommand = defineCommand120({
29314
29687
  meta: {
29315
29688
  name: "submissions",
29316
29689
  description: "How many leads a form received, and when. Example: baker hubspot forms submissions <formId> --days 30"
@@ -29359,7 +29732,7 @@ var formsSubmissionsCommand = defineCommand117({
29359
29732
  }
29360
29733
  }
29361
29734
  });
29362
- var workflowsListCommand = defineCommand117({
29735
+ var workflowsListCommand = defineCommand120({
29363
29736
  meta: {
29364
29737
  name: "list",
29365
29738
  description: "List HubSpot workflows. Example: baker hubspot workflows list --enabled-only"
@@ -29395,7 +29768,7 @@ var workflowsListCommand = defineCommand117({
29395
29768
  }
29396
29769
  }
29397
29770
  });
29398
- var pipelinesListCommand = defineCommand117({
29771
+ var pipelinesListCommand = defineCommand120({
29399
29772
  meta: {
29400
29773
  name: "list",
29401
29774
  description: "List HubSpot deal pipelines and their stages. Example: baker hubspot pipelines list"
@@ -29412,7 +29785,7 @@ var pipelinesListCommand = defineCommand117({
29412
29785
  }
29413
29786
  }
29414
29787
  });
29415
- var contactsSummaryCommand = defineCommand117({
29788
+ var contactsSummaryCommand = defineCommand120({
29416
29789
  meta: {
29417
29790
  name: "summary",
29418
29791
  description: "Whether recent leads are being worked, as counts. Example: baker hubspot contacts summary --days 30"
@@ -29482,7 +29855,7 @@ function contactLookupHints(data) {
29482
29855
  }
29483
29856
  return hints;
29484
29857
  }
29485
- var contactsLookupCommand = defineCommand117({
29858
+ var contactsLookupCommand = defineCommand120({
29486
29859
  meta: {
29487
29860
  name: "lookup",
29488
29861
  description: "Find one contact by email and see whether it was worked. Example: baker hubspot contacts lookup a@b.com"
@@ -29506,27 +29879,27 @@ var contactsLookupCommand = defineCommand117({
29506
29879
  }
29507
29880
  }
29508
29881
  });
29509
- var contactsCommand = defineCommand117({
29882
+ var contactsCommand = defineCommand120({
29510
29883
  meta: { name: "contacts", description: "Contacts on the connected HubSpot account." },
29511
29884
  subCommands: { summary: contactsSummaryCommand, lookup: contactsLookupCommand }
29512
29885
  });
29513
- var formsCommand = defineCommand117({
29886
+ var formsCommand = defineCommand120({
29514
29887
  meta: { name: "forms", description: "HubSpot forms on the connected account." },
29515
29888
  subCommands: { list: formsListCommand, view: formsViewCommand, submissions: formsSubmissionsCommand }
29516
29889
  });
29517
- var workflowsCommand = defineCommand117({
29890
+ var workflowsCommand = defineCommand120({
29518
29891
  meta: { name: "workflows", description: "HubSpot workflows on the connected account." },
29519
29892
  subCommands: { list: workflowsListCommand }
29520
29893
  });
29521
- var pipelinesCommand = defineCommand117({
29894
+ var pipelinesCommand = defineCommand120({
29522
29895
  meta: { name: "pipelines", description: "HubSpot deal pipelines on the connected account." },
29523
29896
  subCommands: { list: pipelinesListCommand }
29524
29897
  });
29525
- var meetingsCommand = defineCommand117({
29898
+ var meetingsCommand = defineCommand120({
29526
29899
  meta: { name: "meetings", description: "HubSpot meeting links (calendars) on the connected account." },
29527
29900
  subCommands: { list: meetingsListCommand, view: meetingsViewCommand }
29528
29901
  });
29529
- var hubspotCommand = defineCommand117({
29902
+ var hubspotCommand = defineCommand120({
29530
29903
  meta: {
29531
29904
  name: "hubspot",
29532
29905
  description: `Read the connected HubSpot account \u2014 forms, the leads they received, workflows, deal pipelines and
@@ -29563,10 +29936,10 @@ Full guide: __tooling__/docs/tools/baker/hubspot.md`
29563
29936
  });
29564
29937
 
29565
29938
  // src/commands/images/index.ts
29566
- import { defineCommand as defineCommand141 } from "citty";
29939
+ import { defineCommand as defineCommand145 } from "citty";
29567
29940
 
29568
29941
  // src/commands/images/crop.ts
29569
- import { defineCommand as defineCommand118 } from "citty";
29942
+ import { defineCommand as defineCommand121 } from "citty";
29570
29943
 
29571
29944
  // src/lib/image/crop-sprite.ts
29572
29945
  import sharp from "sharp";
@@ -29691,7 +30064,7 @@ function emitError2(err) {
29691
30064
  }
29692
30065
  process.exit(1);
29693
30066
  }
29694
- var cropCommand = defineCommand118({
30067
+ var cropCommand = defineCommand121({
29695
30068
  meta: {
29696
30069
  name: "crop",
29697
30070
  description: "Crop a rectangular region from an image.\n\nExample: baker images crop sprite.png --x 0 --y 0 --width 64 --height 64 --output icon.png"
@@ -29727,7 +30100,7 @@ var cropCommand = defineCommand118({
29727
30100
  });
29728
30101
 
29729
30102
  // src/commands/images/delete.ts
29730
- import { defineCommand as defineCommand119 } from "citty";
30103
+ import { defineCommand as defineCommand122 } from "citty";
29731
30104
  registerSchema({
29732
30105
  command: "images.delete",
29733
30106
  description: "Delete an image by ID",
@@ -29741,7 +30114,7 @@ registerSchema({
29741
30114
  }
29742
30115
  }
29743
30116
  });
29744
- var deleteCommand = defineCommand119({
30117
+ var deleteCommand = defineCommand122({
29745
30118
  meta: {
29746
30119
  name: "delete",
29747
30120
  description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
@@ -29782,7 +30155,7 @@ var deleteCommand = defineCommand119({
29782
30155
  });
29783
30156
 
29784
30157
  // src/commands/images/dimensions.ts
29785
- import { defineCommand as defineCommand120 } from "citty";
30158
+ import { defineCommand as defineCommand123 } from "citty";
29786
30159
 
29787
30160
  // src/lib/image/dimensions.ts
29788
30161
  import { imageSize } from "image-size";
@@ -29805,7 +30178,7 @@ registerSchema({
29805
30178
  target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
29806
30179
  }
29807
30180
  });
29808
- var dimensionsCommand = defineCommand120({
30181
+ var dimensionsCommand = defineCommand123({
29809
30182
  meta: {
29810
30183
  name: "dimensions",
29811
30184
  description: "Read image dimensions without decoding the full file.\n\nExample: baker images dimensions ./logo.png\nExample: baker images dimensions https://acme.com/hero.png"
@@ -29849,7 +30222,7 @@ var dimensionsCommand = defineCommand120({
29849
30222
  });
29850
30223
 
29851
30224
  // src/commands/images/extract.ts
29852
- import { defineCommand as defineCommand121 } from "citty";
30225
+ import { defineCommand as defineCommand124 } from "citty";
29853
30226
  registerSchema({
29854
30227
  command: "images.extract",
29855
30228
  description: "Extract images from a URL via Firecrawl (formats: images).",
@@ -29865,7 +30238,7 @@ registerSchema({
29865
30238
  }
29866
30239
  }
29867
30240
  });
29868
- var extractCommand = defineCommand121({
30241
+ var extractCommand = defineCommand124({
29869
30242
  meta: {
29870
30243
  name: "extract",
29871
30244
  description: "Pull every image from a single URL via Firecrawl. ~$0.001/scrape. Cap auto-ingest at 20.\n\nExample: baker images extract https://stripe.com --auto-ingest 5"
@@ -29903,7 +30276,7 @@ var extractCommand = defineCommand121({
29903
30276
  });
29904
30277
 
29905
30278
  // src/commands/images/find.ts
29906
- import { defineCommand as defineCommand122 } from "citty";
30279
+ import { defineCommand as defineCommand125 } from "citty";
29907
30280
  registerSchema({
29908
30281
  command: "images.find",
29909
30282
  description: "Fanout image search: library first, then opted-in external providers.",
@@ -29935,7 +30308,7 @@ registerSchema({
29935
30308
  }
29936
30309
  }
29937
30310
  });
29938
- var findCommand = defineCommand122({
30311
+ var findCommand = defineCommand125({
29939
30312
  meta: {
29940
30313
  name: "find",
29941
30314
  description: "Library-first fanout image search. Opt in to providers with --sources. `--fallback` short-circuits to externals only when library is thin. With --auto-ingest, ingested external hits return Baker-owned URLs.\n\nExample: baker images find 'office' --sources library,magnific --limit 20"
@@ -29983,7 +30356,7 @@ var findCommand = defineCommand122({
29983
30356
  });
29984
30357
 
29985
30358
  // src/commands/images/get.ts
29986
- import { defineCommand as defineCommand123 } from "citty";
30359
+ import { defineCommand as defineCommand126 } from "citty";
29987
30360
  registerSchema({
29988
30361
  command: "images.get",
29989
30362
  description: "Get a single image by ID",
@@ -29991,7 +30364,7 @@ registerSchema({
29991
30364
  id: { type: "string", description: "Image ID", required: true }
29992
30365
  }
29993
30366
  });
29994
- var getCommand2 = defineCommand123({
30367
+ var getCommand2 = defineCommand126({
29995
30368
  meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
29996
30369
  args: {
29997
30370
  id: { type: "positional", description: "Image ID", required: false },
@@ -30027,7 +30400,7 @@ var getCommand2 = defineCommand123({
30027
30400
  });
30028
30401
 
30029
30402
  // src/commands/images/gif.ts
30030
- import { defineCommand as defineCommand124 } from "citty";
30403
+ import { defineCommand as defineCommand127 } from "citty";
30031
30404
  registerSchema({
30032
30405
  command: "images.gif",
30033
30406
  description: "Search Giphy for GIFs / reaction memes (paid social creative).",
@@ -30059,7 +30432,7 @@ registerSchema({
30059
30432
  }
30060
30433
  }
30061
30434
  });
30062
- var gifCommand = defineCommand124({
30435
+ var gifCommand = defineCommand127({
30063
30436
  meta: {
30064
30437
  name: "gif",
30065
30438
  description: "Search Giphy for GIFs / reaction memes \u2014 built for paid-social creative (Meta, TikTok, LinkedIn, X). Free API. Each hit carries WebP + GIF + MP4 URLs in providerMeta so you can pick the right format per platform.\n\nExample: baker images gif 'this is fine' --limit 10\nExample: baker images gif 'office reaction' --rating pg --auto-ingest 2\nExample: baker images gif --trending --limit 25"
@@ -30106,7 +30479,7 @@ var gifCommand = defineCommand124({
30106
30479
  });
30107
30480
 
30108
30481
  // src/commands/images/google.ts
30109
- import { defineCommand as defineCommand125 } from "citty";
30482
+ import { defineCommand as defineCommand128 } from "citty";
30110
30483
 
30111
30484
  // src/commands/images/searchHints.ts
30112
30485
  var FALLBACK = {
@@ -30170,7 +30543,7 @@ registerSchema({
30170
30543
  }
30171
30544
  }
30172
30545
  });
30173
- var googleCommand2 = defineCommand125({
30546
+ var googleCommand2 = defineCommand128({
30174
30547
  meta: {
30175
30548
  name: "google",
30176
30549
  description: "Google Images via the official Custom Search JSON API ($0.005/query, free 100/day). \u26A0 Source unverified \u2014 watermarks, low-res, mislabeled results are common. Use as last resort. With --auto-ingest, ingested hits return Baker-owned URLs.\n\nExample: baker images google 'industrial workshop' --type photo --size large --limit 20"
@@ -30226,7 +30599,7 @@ var googleCommand2 = defineCommand125({
30226
30599
  });
30227
30600
 
30228
30601
  // src/commands/images/group.ts
30229
- import { defineCommand as defineCommand126 } from "citty";
30602
+ import { defineCommand as defineCommand129 } from "citty";
30230
30603
 
30231
30604
  // src/commands/mediaGroup.ts
30232
30605
  async function runMediaGroupLookup(input) {
@@ -30279,7 +30652,7 @@ registerSchema({
30279
30652
  "group-key": { type: "string", description: "The set key directly, when you already have it", required: false }
30280
30653
  }
30281
30654
  });
30282
- var groupCommand = defineCommand126({
30655
+ var groupCommand = defineCommand129({
30283
30656
  meta: {
30284
30657
  name: "group",
30285
30658
  description: "List every asset that arrived in the same set \u2014 the slides of one Instagram carousel, the images off one scraped page. Start here whenever a hit looks like part of a sequence: carousel slides are authored to be read in order and usually only make sense together. Takes an image or a video id, since one carousel can contain both. Example: baker images group <imageId>"
@@ -30299,7 +30672,7 @@ var groupCommand = defineCommand126({
30299
30672
  });
30300
30673
 
30301
30674
  // src/commands/images/icon.ts
30302
- import { defineCommand as defineCommand127 } from "citty";
30675
+ import { defineCommand as defineCommand130 } from "citty";
30303
30676
  registerSchema({
30304
30677
  command: "images.icon",
30305
30678
  description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
@@ -30325,7 +30698,7 @@ registerSchema({
30325
30698
  }
30326
30699
  }
30327
30700
  });
30328
- var iconCommand = defineCommand127({
30701
+ var iconCommand = defineCommand130({
30329
30702
  meta: {
30330
30703
  name: "icon",
30331
30704
  description: "Icon via Iconify (simple-icons, logos, lucide, devicon, heroicons, tabler, phosphor, material-symbols, \u2026). Free CDN, no API key.\n\nExample: baker images icon react --set devicon\nExample: baker images icon lucide:check --color '#0a0a0a'"
@@ -30365,7 +30738,7 @@ var iconCommand = defineCommand127({
30365
30738
  });
30366
30739
 
30367
30740
  // src/commands/images/ingest.ts
30368
- import { defineCommand as defineCommand128 } from "citty";
30741
+ import { defineCommand as defineCommand131 } from "citty";
30369
30742
  registerSchema({
30370
30743
  command: "images.ingest",
30371
30744
  description: "Ingest a remote image URL into the library (full describe + embed).",
@@ -30377,7 +30750,7 @@ registerSchema({
30377
30750
  context: { type: "string", description: "Description context hint", required: false }
30378
30751
  }
30379
30752
  });
30380
- var ingestCommand = defineCommand128({
30753
+ var ingestCommand = defineCommand131({
30381
30754
  meta: {
30382
30755
  name: "ingest",
30383
30756
  description: "Download a remote URL and store it in the library. Hash-deduped on bytes + externalId.\n\nExample: baker images ingest https://img.freepik.com/free-photo/xyz.jpg --source magnific --external-id 12345"
@@ -30418,8 +30791,181 @@ var ingestCommand = defineCommand128({
30418
30791
  }
30419
30792
  });
30420
30793
 
30794
+ // src/commands/images/layerize.ts
30795
+ import { defineCommand as defineCommand132 } from "citty";
30796
+ registerSchema({
30797
+ command: "images.layerize",
30798
+ description: "Split a library image into editable layers: transparent PNG cutouts for each element, plus any headline recovered as EDITABLE TEXT with its font, size, colour and position. Waits for completion by default. Costs credits.",
30799
+ args: {
30800
+ "image-id": { type: "string", description: "Library image ID to split", required: true },
30801
+ instructions: {
30802
+ type: "string",
30803
+ description: "Optional steer for what to separate, e.g. 'keep the bottle and its shadow as one layer'",
30804
+ required: false
30805
+ },
30806
+ full: { type: "boolean", description: "Include geometry and typography for every layer", required: false },
30807
+ "max-wait": {
30808
+ type: "number",
30809
+ description: "Max wait ms (default 240000 = 4 min). Set 0 to fire-and-forget.",
30810
+ required: false,
30811
+ default: 24e4
30812
+ }
30813
+ }
30814
+ });
30815
+ var POLL_INTERVAL_MS3 = 4e3;
30816
+ function compact(doc) {
30817
+ return {
30818
+ layeredImageId: doc.layeredImageId,
30819
+ imageId: doc.imageId,
30820
+ status: doc.status,
30821
+ canvas: { width: doc.width, height: doc.height },
30822
+ layers: doc.layers.map((layer) => ({
30823
+ id: layer.id,
30824
+ kind: layer.kind,
30825
+ name: layer.name,
30826
+ ...layer.url ? { url: layer.url } : {},
30827
+ ...layer.text ? { text: layer.text.content } : {}
30828
+ }))
30829
+ };
30830
+ }
30831
+ function hintsFor2(doc) {
30832
+ const hints = [];
30833
+ const text = doc.layers.filter((layer) => layer.kind === "text");
30834
+ const art = doc.layers.filter((layer) => layer.kind === "art" && layer.id !== "layer-base");
30835
+ if (text.length > 0) {
30836
+ hints.push(
30837
+ `${text.length} text layer(s) recovered as editable copy \u2014 run with --full for the font, size and colour to reuse when rewriting it.`
30838
+ );
30839
+ }
30840
+ if (art.length > 0) {
30841
+ hints.push(
30842
+ `Each art layer's url is a transparent PNG on the media host: wire one straight into a canvas composition to reuse that element on its own.`
30843
+ );
30844
+ }
30845
+ hints.push(
30846
+ '"Original image" is the flat picture kept underneath. The model separates what was VISIBLE and does not repaint what sat behind a subject, so moving one can leave a gap.'
30847
+ );
30848
+ return hints;
30849
+ }
30850
+ async function pollUntilSettled(imageId, maxWait) {
30851
+ const start = Date.now();
30852
+ while (Date.now() - start < maxWait) {
30853
+ await new Promise((resolve5) => setTimeout(resolve5, POLL_INTERVAL_MS3));
30854
+ const doc = await apiGet("/api/images/layers", { imageId });
30855
+ if (doc.status !== "splitting") return doc;
30856
+ }
30857
+ return null;
30858
+ }
30859
+ var layerizeCommand = defineCommand132({
30860
+ meta: {
30861
+ name: "layerize",
30862
+ description: "Split a library image into editable layers \u2014 transparent cutouts per element, plus any baked-in headline recovered as editable text with its typography.\n\nStart here: baker images layerize j571abc123def\nExample: baker images layerize j571abc123def --full\nExample: baker images layerize j571abc123def --instructions 'keep the product and its shadow together'"
30863
+ },
30864
+ args: {
30865
+ "image-id": { type: "positional", description: "Library image ID", required: false },
30866
+ instructions: { type: "string", description: "Optional steer for what to separate", required: false },
30867
+ full: { type: "boolean", description: "Include geometry and typography", required: false },
30868
+ "max-wait": { type: "string", description: "Max wait ms (default 240000, 0 = no wait)", required: false }
30869
+ },
30870
+ run: async ({ args }) => {
30871
+ try {
30872
+ const imageId = args["image-id"];
30873
+ if (!imageId) {
30874
+ writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "image-id is required" } });
30875
+ process.exit(1);
30876
+ }
30877
+ const maxWait = args["max-wait"] ? Number(args["max-wait"]) : 24e4;
30878
+ const full = Boolean(args.full);
30879
+ const started = await apiPost("/api/images/layerize", {
30880
+ imageId,
30881
+ instructions: args.instructions
30882
+ });
30883
+ const settled = maxWait === 0 || started.status !== "splitting" ? started : await pollUntilSettled(imageId, maxWait);
30884
+ if (!settled) {
30885
+ writeJson({
30886
+ ok: false,
30887
+ error: {
30888
+ code: "TIMEOUT",
30889
+ message: `Layers not ready within ${maxWait}ms`,
30890
+ fix: `The split is still running. Read it later with: baker images layers ${imageId}`
30891
+ }
30892
+ });
30893
+ process.exit(1);
30894
+ }
30895
+ if (settled.status === "failed") {
30896
+ writeJson({
30897
+ ok: false,
30898
+ error: {
30899
+ code: "IMAGE_PROCESSING_ERROR",
30900
+ message: settled.error ?? "That image couldn't be split into layers",
30901
+ fix: "Run the same command again \u2014 this provider rejects a valid request intermittently. If it fails twice more, carry on without layers."
30902
+ }
30903
+ });
30904
+ process.exit(1);
30905
+ }
30906
+ writeJson({ ok: true, data: full ? settled : compact(settled), hints: hintsFor2(settled) });
30907
+ } catch (err) {
30908
+ if (err instanceof ApiError) {
30909
+ writeJson({ ok: false, error: { code: err.code, message: err.message } });
30910
+ process.exit(1);
30911
+ }
30912
+ writeJson({
30913
+ ok: false,
30914
+ error: { code: "INTERNAL_ERROR", message: err instanceof Error ? err.message : "Unexpected error" }
30915
+ });
30916
+ process.exit(1);
30917
+ }
30918
+ }
30919
+ });
30920
+ registerSchema({
30921
+ command: "images.layers",
30922
+ description: "Read the layers of an image already split with `images layerize` \u2014 free, no provider call. Use it to see what an ad says and what its pieces are.",
30923
+ args: {
30924
+ "image-id": { type: "string", description: "Library image ID", required: true },
30925
+ full: { type: "boolean", description: "Include geometry and typography for every layer", required: false }
30926
+ }
30927
+ });
30928
+ var layersCommand = defineCommand132({
30929
+ meta: {
30930
+ name: "layers",
30931
+ description: "Read the layers of an image that has already been split. Free \u2014 no provider call.\n\nStart here: baker images layers j571abc123def\nExample: baker images layers j571abc123def --full"
30932
+ },
30933
+ args: {
30934
+ "image-id": { type: "positional", description: "Library image ID", required: false },
30935
+ full: { type: "boolean", description: "Include geometry and typography", required: false }
30936
+ },
30937
+ run: async ({ args }) => {
30938
+ try {
30939
+ const imageId = args["image-id"];
30940
+ if (!imageId) {
30941
+ writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "image-id is required" } });
30942
+ process.exit(1);
30943
+ }
30944
+ const doc = await apiGet("/api/images/layers", { imageId });
30945
+ writeJson({ ok: true, data: args.full ? doc : compact(doc), hints: hintsFor2(doc) });
30946
+ } catch (err) {
30947
+ if (err instanceof ApiError) {
30948
+ writeJson({
30949
+ ok: false,
30950
+ error: {
30951
+ code: err.code,
30952
+ message: err.message,
30953
+ ...err.code === "NOT_FOUND" ? { fix: `Split it first: baker images layerize ${args["image-id"]}` } : {}
30954
+ }
30955
+ });
30956
+ process.exit(1);
30957
+ }
30958
+ writeJson({
30959
+ ok: false,
30960
+ error: { code: "INTERNAL_ERROR", message: err instanceof Error ? err.message : "Unexpected error" }
30961
+ });
30962
+ process.exit(1);
30963
+ }
30964
+ }
30965
+ });
30966
+
30421
30967
  // src/commands/images/library.ts
30422
- import { defineCommand as defineCommand129 } from "citty";
30968
+ import { defineCommand as defineCommand133 } from "citty";
30423
30969
  registerSchema({
30424
30970
  command: "images.library",
30425
30971
  description: "Search the company image library. Returns only ready images.",
@@ -30445,7 +30991,7 @@ registerSchema({
30445
30991
  }
30446
30992
  }
30447
30993
  });
30448
- var libraryCommand = defineCommand129({
30994
+ var libraryCommand = defineCommand133({
30449
30995
  meta: {
30450
30996
  name: "library",
30451
30997
  description: "Search the company image library (hybrid BM25 + vector + Cohere rerank). Use this BEFORE any external provider.\n\nExample: baker images library 'hero banner' --aspect-ratio 16:9 --source magnific"
@@ -30502,7 +31048,7 @@ var libraryCommand = defineCommand129({
30502
31048
  });
30503
31049
 
30504
31050
  // src/commands/images/logo.ts
30505
- import { defineCommand as defineCommand130 } from "citty";
31051
+ import { defineCommand as defineCommand134 } from "citty";
30506
31052
  registerSchema({
30507
31053
  command: "images.logo",
30508
31054
  description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
@@ -30527,7 +31073,7 @@ registerSchema({
30527
31073
  }
30528
31074
  }
30529
31075
  });
30530
- var logoCommand = defineCommand130({
31076
+ var logoCommand = defineCommand134({
30531
31077
  meta: {
30532
31078
  name: "logo",
30533
31079
  description: "Brand logo via Brandfetch CDN. Returns up to 5 variants (icon, light/dark logo, light/dark symbol). Auto-ingests the first variant.\n\nExample: baker images logo stripe.com --variant logo"
@@ -30565,7 +31111,7 @@ var logoCommand = defineCommand130({
30565
31111
  });
30566
31112
 
30567
31113
  // src/commands/images/normalize.ts
30568
- import { defineCommand as defineCommand131 } from "citty";
31114
+ import { defineCommand as defineCommand135 } from "citty";
30569
31115
 
30570
31116
  // src/lib/image/color-changer.ts
30571
31117
  import quantize from "quantize";
@@ -31297,7 +31843,7 @@ function coerceRawArgs(args) {
31297
31843
  "dry-run": bool(args["dry-run"])
31298
31844
  };
31299
31845
  }
31300
- var normalizeCommand = defineCommand131({
31846
+ var normalizeCommand = defineCommand135({
31301
31847
  meta: {
31302
31848
  name: "normalize",
31303
31849
  description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
@@ -31352,7 +31898,7 @@ Examples:
31352
31898
  });
31353
31899
 
31354
31900
  // src/commands/images/pinterest.ts
31355
- import { defineCommand as defineCommand132 } from "citty";
31901
+ import { defineCommand as defineCommand136 } from "citty";
31356
31902
  registerSchema({
31357
31903
  command: "images.pinterest",
31358
31904
  description: "Pinterest image search via ScrapeCreators. Reference-grade real-world photography, product styling, interiors, fashion, food, and aesthetic mood boards. Inspect before placing \u2014 Pinterest is unverified, trademark-bearing web content.",
@@ -31372,7 +31918,7 @@ registerSchema({
31372
31918
  }
31373
31919
  }
31374
31920
  });
31375
- var pinterestCommand = defineCommand132({
31921
+ var pinterestCommand = defineCommand136({
31376
31922
  meta: {
31377
31923
  name: "pinterest",
31378
31924
  description: "Pinterest image search via ScrapeCreators ($0.00188/request). Best for photo-realistic reference imagery \u2014 lifestyle, interiors, fashion, food, product styling, and mood boards to brief AI generation against. \u26A0 Unverified, trademark-bearing web content \u2014 inspect and respect rights before placing on a customer page. Browse first; auto-ingest only the pins you commit to.\n\nExamples:\n baker images pinterest 'scandinavian living room'\n baker images pinterest 'minimalist skincare product photography' --limit 20\n baker images pinterest 'cozy coffee shop interior' --auto-ingest 2 --context 'Mood reference for hero photography'"
@@ -31412,7 +31958,7 @@ var pinterestCommand = defineCommand132({
31412
31958
  });
31413
31959
 
31414
31960
  // src/commands/images/screenshot.ts
31415
- import { defineCommand as defineCommand133 } from "citty";
31961
+ import { defineCommand as defineCommand137 } from "citty";
31416
31962
  registerSchema({
31417
31963
  command: "images.screenshot",
31418
31964
  description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
@@ -31428,7 +31974,7 @@ registerSchema({
31428
31974
  }
31429
31975
  }
31430
31976
  });
31431
- var screenshotCommand = defineCommand133({
31977
+ var screenshotCommand = defineCommand137({
31432
31978
  meta: {
31433
31979
  name: "screenshot",
31434
31980
  description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
@@ -31491,7 +32037,7 @@ var screenshotCommand = defineCommand133({
31491
32037
  });
31492
32038
 
31493
32039
  // src/commands/images/search.ts
31494
- import { defineCommand as defineCommand134 } from "citty";
32040
+ import { defineCommand as defineCommand138 } from "citty";
31495
32041
  registerSchema({
31496
32042
  command: "images.search",
31497
32043
  description: "Search images by text query. Only returns ready images.",
@@ -31507,7 +32053,7 @@ registerSchema({
31507
32053
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
31508
32054
  }
31509
32055
  });
31510
- var searchCommand = defineCommand134({
32056
+ var searchCommand = defineCommand138({
31511
32057
  meta: {
31512
32058
  name: "search",
31513
32059
  description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
@@ -31567,7 +32113,7 @@ var searchCommand = defineCommand134({
31567
32113
  });
31568
32114
 
31569
32115
  // src/commands/images/sticker.ts
31570
- import { defineCommand as defineCommand135 } from "citty";
32116
+ import { defineCommand as defineCommand139 } from "citty";
31571
32117
  registerSchema({
31572
32118
  command: "images.sticker",
31573
32119
  description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
@@ -31599,7 +32145,7 @@ registerSchema({
31599
32145
  }
31600
32146
  }
31601
32147
  });
31602
- var stickerCommand = defineCommand135({
32148
+ var stickerCommand = defineCommand139({
31603
32149
  meta: {
31604
32150
  name: "sticker",
31605
32151
  description: "Search Giphy's sticker corpus \u2014 transparent-background WebPs / GIFs ideal for overlaying on ad creative (Meta, TikTok, Stories). Same Giphy free API as `baker images gif`; results carry WebP + GIF + MP4 URLs in providerMeta.\n\nExample: baker images sticker 'thumbs up' --limit 10\nExample: baker images sticker celebration --rating g --auto-ingest 3\nExample: baker images sticker --trending --limit 25"
@@ -31646,7 +32192,7 @@ var stickerCommand = defineCommand135({
31646
32192
  });
31647
32193
 
31648
32194
  // src/commands/images/stock.ts
31649
- import { defineCommand as defineCommand136 } from "citty";
32195
+ import { defineCommand as defineCommand140 } from "citty";
31650
32196
  var STOCK_ERROR_FIX = {
31651
32197
  action: "use_different_resource",
31652
32198
  explanation: "Switch provider instead of retrying stock search. Stock search is one of several image sources. Run `baker images find <query> --sources library,pinterest,google` (`--sources` is required \u2014 `find` alone searches the library only) or `baker studio generate` to make the asset. Never sleep-and-retry this command \u2014 the CLI already backs off on rate limits. If no image can be sourced, continue the rest of the task with a placeholder rather than aborting it."
@@ -31723,7 +32269,7 @@ function buildStockRequest(query, args) {
31723
32269
  if (args.context) body.descriptionContext = args.context;
31724
32270
  return body;
31725
32271
  }
31726
- var stockCommand = defineCommand136({
32272
+ var stockCommand = defineCommand140({
31727
32273
  meta: {
31728
32274
  name: "stock",
31729
32275
  description: "Stock search via Magnific \u2014 Freepik's developer API (~250M assets: photos, vectors, illustrations, icons, PSDs). $0.002/req. With --auto-ingest, ingested hits return Baker-owned URLs.\n\nExamples:\n baker images stock 'minimalist office'\n baker images stock 'flat office workers' --type vector\n baker images stock 'hero photo of a kitchen' --type photo --orientation landscape --ai exclude\n baker images stock 'brand pattern' --color '#0a0a0a' --license freemium --auto-ingest 2"
@@ -31779,7 +32325,7 @@ var stockCommand = defineCommand136({
31779
32325
  });
31780
32326
 
31781
32327
  // src/lib/tags-command.ts
31782
- import { defineCommand as defineCommand137 } from "citty";
32328
+ import { defineCommand as defineCommand141 } from "citty";
31783
32329
  function makeTagsCommand(command, label, endpoint) {
31784
32330
  registerSchema({
31785
32331
  command: `${command}.tags`,
@@ -31788,7 +32334,7 @@ function makeTagsCommand(command, label, endpoint) {
31788
32334
  output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
31789
32335
  }
31790
32336
  });
31791
- return defineCommand137({
32337
+ return defineCommand141({
31792
32338
  meta: {
31793
32339
  name: "tags",
31794
32340
  description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
@@ -31824,7 +32370,7 @@ function makeTagsCommand(command, label, endpoint) {
31824
32370
  var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
31825
32371
 
31826
32372
  // src/commands/images/upload.ts
31827
- import { defineCommand as defineCommand138 } from "citty";
32373
+ import { defineCommand as defineCommand142 } from "citty";
31828
32374
  registerSchema({
31829
32375
  command: "images.upload",
31830
32376
  description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
@@ -31862,7 +32408,7 @@ registerSchema({
31862
32408
  function isRemoteUrl2(value) {
31863
32409
  return /^https?:\/\//i.test(value);
31864
32410
  }
31865
- var uploadCommand = defineCommand138({
32411
+ var uploadCommand = defineCommand142({
31866
32412
  meta: {
31867
32413
  name: "upload",
31868
32414
  description: "Upload an image to the library \u2014 accepts a local file path OR a remote http(s) URL.\n\nLocal: reads bytes, sends to /api/images/upload, content-type auto-detected from extension.\nRemote: dispatches to /api/images/ingest with hash-dedup on bytes + externalId.\n\nExamples:\n baker images upload ./logo.png --source uploaded\n baker images upload ./cert.png --context 'ISO 27001 badge \u2014 enterprise tier'\n baker images upload https://acme.com/hero.png --source firecrawl --context 'Acme competitor pricing hero'"
@@ -31955,7 +32501,7 @@ async function uploadLocal(target, args) {
31955
32501
  }
31956
32502
 
31957
32503
  // src/commands/images/upscale.ts
31958
- import { defineCommand as defineCommand139 } from "citty";
32504
+ import { defineCommand as defineCommand143 } from "citty";
31959
32505
  registerSchema({
31960
32506
  command: "images.upscale",
31961
32507
  description: "Upscale a library image via the backend (Replicate, cost-tracked). Waits for completion by default. The image must be status 'ready' and raster (not SVG/AVIF).",
@@ -31969,8 +32515,8 @@ registerSchema({
31969
32515
  }
31970
32516
  }
31971
32517
  });
31972
- var POLL_INTERVAL_MS3 = 1500;
31973
- var upscaleCommand = defineCommand139({
32518
+ var POLL_INTERVAL_MS4 = 1500;
32519
+ var upscaleCommand = defineCommand143({
31974
32520
  meta: {
31975
32521
  name: "upscale",
31976
32522
  description: "Upscale a library image via the Convex backend (Replicate, cost-tracked at $0.05/image). Waits for completion by default.\n\nExample: baker images upscale j571abc123def\nExample: baker images upscale j571abc123def --max-wait 0 # fire-and-forget"
@@ -32006,7 +32552,7 @@ var upscaleCommand = defineCommand139({
32006
32552
  });
32007
32553
  process.exit(1);
32008
32554
  }
32009
- await new Promise((resolve5) => setTimeout(resolve5, POLL_INTERVAL_MS3));
32555
+ await new Promise((resolve5) => setTimeout(resolve5, POLL_INTERVAL_MS4));
32010
32556
  }
32011
32557
  writeJson({ ok: false, error: { code: "TIMEOUT", message: `Image not ready within ${maxWait}ms` } });
32012
32558
  process.exit(1);
@@ -32025,7 +32571,7 @@ var upscaleCommand = defineCommand139({
32025
32571
  });
32026
32572
 
32027
32573
  // src/commands/images/use.ts
32028
- import { defineCommand as defineCommand140 } from "citty";
32574
+ import { defineCommand as defineCommand144 } from "citty";
32029
32575
  registerSchema({
32030
32576
  command: "images.use",
32031
32577
  description: "Ingest a URL and wait for the library record to be ready.",
@@ -32040,8 +32586,8 @@ registerSchema({
32040
32586
  }
32041
32587
  }
32042
32588
  });
32043
- var POLL_INTERVAL_MS4 = 1500;
32044
- var useCommand = defineCommand140({
32589
+ var POLL_INTERVAL_MS5 = 1500;
32590
+ var useCommand = defineCommand144({
32045
32591
  meta: {
32046
32592
  name: "use",
32047
32593
  description: "Sugar over `ingest`: download \u2192 store \u2192 wait until describe + embed complete \u2192 return ready library record.\n\nExample: baker images use https://cdn.example.com/hero.png --source uploaded"
@@ -32071,7 +32617,7 @@ var useCommand = defineCommand140({
32071
32617
  writeJson({ ok: true, data: { ...ingestResult, image: doc } });
32072
32618
  return;
32073
32619
  }
32074
- await new Promise((resolve5) => setTimeout(resolve5, POLL_INTERVAL_MS4));
32620
+ await new Promise((resolve5) => setTimeout(resolve5, POLL_INTERVAL_MS5));
32075
32621
  }
32076
32622
  writeJson({ ok: false, error: { code: "TIMEOUT", message: `Image not ready within ${maxWait}ms` } });
32077
32623
  process.exit(1);
@@ -32087,7 +32633,7 @@ var useCommand = defineCommand140({
32087
32633
  });
32088
32634
 
32089
32635
  // src/commands/images/index.ts
32090
- var imagesCommand = defineCommand141({
32636
+ var imagesCommand = defineCommand145({
32091
32637
  meta: {
32092
32638
  name: "images",
32093
32639
  description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
@@ -32129,6 +32675,8 @@ Taxonomy:
32129
32675
 
32130
32676
  Paid transforms (run on the Convex backend, cost-tracked):
32131
32677
  baker images upscale <imageId> Real-ESRGAN super-resolution ($0.05/image, waits for completion)
32678
+ baker images layerize <imageId> Split into editable layers; recovers baked-in copy as editable text (costs credits)
32679
+ baker images layers <imageId> Read the layers of an already-split image (free)
32132
32680
  Full guide: __tooling__/docs/tools/baker/images.md`
32133
32681
  },
32134
32682
  subCommands: {
@@ -32153,18 +32701,20 @@ Full guide: __tooling__/docs/tools/baker/images.md`
32153
32701
  normalize: normalizeCommand,
32154
32702
  crop: cropCommand,
32155
32703
  dimensions: dimensionsCommand,
32704
+ layerize: layerizeCommand,
32705
+ layers: layersCommand,
32156
32706
  upscale: upscaleCommand,
32157
32707
  tags: tagsCommand2
32158
32708
  }
32159
32709
  });
32160
32710
 
32161
32711
  // src/commands/landing/index.ts
32162
- import { defineCommand as defineCommand151 } from "citty";
32712
+ import { defineCommand as defineCommand155 } from "citty";
32163
32713
 
32164
32714
  // src/commands/landing/critique.ts
32165
32715
  import { readdir as readdir8, stat as stat6 } from "fs/promises";
32166
32716
  import path28 from "path";
32167
- import { defineCommand as defineCommand142 } from "citty";
32717
+ import { defineCommand as defineCommand146 } from "citty";
32168
32718
 
32169
32719
  // src/engine/landing/lib/brand-tokens.ts
32170
32720
  import { readFile as readFile20 } from "fs/promises";
@@ -33559,7 +34109,7 @@ function fail5(code, message, fix) {
33559
34109
  );
33560
34110
  process.exit(2);
33561
34111
  }
33562
- var critiqueCommand2 = defineCommand142({
34112
+ var critiqueCommand2 = defineCommand146({
33563
34113
  meta: {
33564
34114
  name: "critique",
33565
34115
  description: "Start here: `baker landing critique <slug>` after building or editing a landing. Deterministic design-quality critic (ADVISORY \u2014 findings never fail it). Flags the known AI design tells (gradient text, overused fonts, side-tab borders, cream palettes, buzzword copy, broken images) tiered block/warn/advisory, respecting the client's BRAND.md as the allowlist. Also records the critique that publishing requires \u2014 run it before finishing a landing."
@@ -33668,10 +34218,10 @@ async function isDir(p) {
33668
34218
  }
33669
34219
 
33670
34220
  // src/commands/landing/inspiration/index.ts
33671
- import { defineCommand as defineCommand150 } from "citty";
34221
+ import { defineCommand as defineCommand154 } from "citty";
33672
34222
 
33673
34223
  // src/commands/landing/inspiration/add.ts
33674
- import { defineCommand as defineCommand143 } from "citty";
34224
+ import { defineCommand as defineCommand147 } from "citty";
33675
34225
 
33676
34226
  // src/commands/landing/inspiration/shared.ts
33677
34227
  var INSPIRATION_HINTS = {
@@ -33717,7 +34267,7 @@ registerSchema({
33717
34267
  note: { type: "string", description: "Why this page is worth keeping", required: false }
33718
34268
  }
33719
34269
  });
33720
- var addCommand = defineCommand143({
34270
+ var addCommand = defineCommand147({
33721
34271
  meta: {
33722
34272
  name: "add",
33723
34273
  description: "Add someone else's landing page to the reference library. Example: baker landing inspiration add https://linear.app --note 'the client likes this density'"
@@ -33755,7 +34305,7 @@ var addCommand = defineCommand143({
33755
34305
  // src/commands/landing/inspiration/code.ts
33756
34306
  import { mkdir as mkdir10, writeFile as writeFile13 } from "fs/promises";
33757
34307
  import path29 from "path";
33758
- import { defineCommand as defineCommand144 } from "citty";
34308
+ import { defineCommand as defineCommand148 } from "citty";
33759
34309
  registerSchema({
33760
34310
  command: "landing.inspiration.code",
33761
34311
  description: "Write a reference section's standalone HTML+CSS to .baker/inspiration/<id>/ so you can read how it is built. Reference only \u2014 the structure is the lesson, the words are not yours to reuse. Consulting a section records it, and `baker landing critique` blocks a publish that ships its copy verbatim.",
@@ -33764,7 +34314,7 @@ registerSchema({
33764
34314
  full: { type: "boolean", description: "Print the markup inline as well as writing it", required: false }
33765
34315
  }
33766
34316
  });
33767
- var codeCommand = defineCommand144({
34317
+ var codeCommand = defineCommand148({
33768
34318
  meta: {
33769
34319
  name: "code",
33770
34320
  description: "Write one reference section's standalone markup to disk. Example: baker landing inspiration code k57abc\u2026 \u2014 read it for structure, then build your own."
@@ -33821,7 +34371,7 @@ var codeCommand = defineCommand144({
33821
34371
  });
33822
34372
 
33823
34373
  // src/commands/landing/inspiration/favorites.ts
33824
- import { defineCommand as defineCommand145 } from "citty";
34374
+ import { defineCommand as defineCommand149 } from "citty";
33825
34375
  registerSchema({
33826
34376
  command: "landing.inspiration.favorites",
33827
34377
  description: "List the reference sections this company has saved. This is what `search` looks at by default, so it is the client's own taste profile \u2014 read it before proposing a direction.",
@@ -33835,7 +34385,7 @@ registerSchema({
33835
34385
  }
33836
34386
  }
33837
34387
  });
33838
- var favoritesCommand = defineCommand145({
34388
+ var favoritesCommand = defineCommand149({
33839
34389
  meta: {
33840
34390
  name: "favorites",
33841
34391
  description: "List this company's saved reference sections. Example: baker landing inspiration favorites --type hero,pricing"
@@ -33895,7 +34445,7 @@ registerSchema({
33895
34445
  note: { type: "string", description: "Why this is worth keeping", required: false }
33896
34446
  }
33897
34447
  });
33898
- var favoriteCommand = defineCommand145({
34448
+ var favoriteCommand = defineCommand149({
33899
34449
  meta: {
33900
34450
  name: "favorite",
33901
34451
  description: "Save a reference section to this company. Example: baker landing inspiration favorite k57abc\u2026"
@@ -33933,7 +34483,7 @@ registerSchema({
33933
34483
  page: { type: "boolean", description: "Treat the id as a page rather than a section", required: false }
33934
34484
  }
33935
34485
  });
33936
- var unfavoriteCommand = defineCommand145({
34486
+ var unfavoriteCommand = defineCommand149({
33937
34487
  meta: {
33938
34488
  name: "unfavorite",
33939
34489
  description: "Remove a reference section from this company's saved set. Example: baker landing inspiration unfavorite k57abc\u2026"
@@ -33955,7 +34505,7 @@ var unfavoriteCommand = defineCommand145({
33955
34505
  });
33956
34506
 
33957
34507
  // src/commands/landing/inspiration/page.ts
33958
- import { defineCommand as defineCommand146 } from "citty";
34508
+ import { defineCommand as defineCommand150 } from "citty";
33959
34509
  registerSchema({
33960
34510
  command: "landing.inspiration.page",
33961
34511
  description: "Show a whole reference page as a sequence: every section top to bottom with its type and the idea behind it. This is the view to use when the question is how a good page is ORDERED rather than what one section looks like.",
@@ -33972,7 +34522,7 @@ registerSchema({
33972
34522
  }
33973
34523
  }
33974
34524
  });
33975
- var pageCommand = defineCommand146({
34525
+ var pageCommand = defineCommand150({
33976
34526
  meta: {
33977
34527
  name: "page",
33978
34528
  description: "Show how a reference page sequences its sections. Example: baker landing inspiration page j91xyz\u2026 \u2014 the blueprint, not the pixels."
@@ -34037,7 +34587,7 @@ var pageCommand = defineCommand146({
34037
34587
  // src/commands/landing/inspiration/scrape.ts
34038
34588
  import { readFile as readFile23 } from "fs/promises";
34039
34589
  import path32 from "path";
34040
- import { defineCommand as defineCommand147 } from "citty";
34590
+ import { defineCommand as defineCommand151 } from "citty";
34041
34591
 
34042
34592
  // src/engine/landing/lib/capturedReferences.ts
34043
34593
  var MAX_STRINGS_PER_SECTION = 40;
@@ -35832,7 +36382,7 @@ registerSchema({
35832
36382
  report: { type: "boolean", description: "Write report.html. `--no-report` to skip", required: false }
35833
36383
  }
35834
36384
  });
35835
- var scrapeCommand = defineCommand147({
36385
+ var scrapeCommand = defineCommand151({
35836
36386
  meta: {
35837
36387
  name: "scrape",
35838
36388
  description: "Capture a landing page to a directory, now. Example: baker landing inspiration scrape https://linear.app --out .baker/inspiration/linear.app"
@@ -35911,7 +36461,7 @@ var scrapeCommand = defineCommand147({
35911
36461
  // src/commands/landing/inspiration/search.ts
35912
36462
  import { mkdir as mkdir12, writeFile as writeFile16 } from "fs/promises";
35913
36463
  import path33 from "path";
35914
- import { defineCommand as defineCommand148 } from "citty";
36464
+ import { defineCommand as defineCommand152 } from "citty";
35915
36465
  registerSchema({
35916
36466
  command: "landing.inspiration.search",
35917
36467
  description: "Search the shared library of real landing-page sections for reference before you design. Start here: baker landing inspiration search 'pricing with a monthly/annual toggle'. Returns the idea behind each section plus a downloaded screenshot you can Read. Defaults to this company's saved sections; pass --scope all for the whole library.",
@@ -36015,7 +36565,7 @@ async function downloadShots(results) {
36015
36565
  );
36016
36566
  return saved;
36017
36567
  }
36018
- var searchCommand2 = defineCommand148({
36568
+ var searchCommand2 = defineCommand152({
36019
36569
  meta: {
36020
36570
  name: "search",
36021
36571
  description: "Search real landing-page sections for reference. Example: baker landing inspiration search 'dark developer hero with a terminal' --register dev-tool-minimal --scope all"
@@ -36103,7 +36653,7 @@ var searchCommand2 = defineCommand148({
36103
36653
  // src/commands/landing/inspiration/view.ts
36104
36654
  import { mkdir as mkdir13, writeFile as writeFile17 } from "fs/promises";
36105
36655
  import path34 from "path";
36106
- import { defineCommand as defineCommand149 } from "citty";
36656
+ import { defineCommand as defineCommand153 } from "citty";
36107
36657
  registerSchema({
36108
36658
  command: "landing.inspiration.view",
36109
36659
  description: "Everything known about one section: composition, motion, design tokens, the copy it uses, why it works, and what must change to make it yours. Downloads the desktop and mobile screenshots plus the motion filmstrip so you can look at them.",
@@ -36128,7 +36678,7 @@ async function download(url, file) {
36128
36678
  return null;
36129
36679
  }
36130
36680
  }
36131
- var viewCommand2 = defineCommand149({
36681
+ var viewCommand2 = defineCommand153({
36132
36682
  meta: {
36133
36683
  name: "view",
36134
36684
  description: "Full detail for one reference section. Example: baker landing inspiration view k57abc\u2026 \u2014 read the screenshots it saves before you build."
@@ -36211,7 +36761,7 @@ var viewCommand2 = defineCommand149({
36211
36761
  });
36212
36762
 
36213
36763
  // src/commands/landing/inspiration/index.ts
36214
- var inspirationCommand = defineCommand150({
36764
+ var inspirationCommand = defineCommand154({
36215
36765
  meta: {
36216
36766
  name: "inspiration",
36217
36767
  description: `Reference library of real landing-page sections \u2014 look at how good pages actually solve a problem before you design one.
@@ -36253,7 +36803,7 @@ Full guide: __tooling__/docs/tools/baker/landing.md`
36253
36803
  });
36254
36804
 
36255
36805
  // src/commands/landing/index.ts
36256
- var landingCommand = defineCommand151({
36806
+ var landingCommand = defineCommand155({
36257
36807
  meta: {
36258
36808
  name: "landing",
36259
36809
  description: `Design-quality tools for landing pages (src/pages/<slug>/).
@@ -36271,7 +36821,7 @@ Subcommands:
36271
36821
  });
36272
36822
 
36273
36823
  // src/commands/mcp/index.ts
36274
- import { defineCommand as defineCommand152 } from "citty";
36824
+ import { defineCommand as defineCommand156 } from "citty";
36275
36825
 
36276
36826
  // src/commands/mcp/platforms.ts
36277
36827
  function readsKey(label) {
@@ -36340,7 +36890,7 @@ registerSchema({
36340
36890
  description: "List everything this chat can reach: managed integrations (Attio, Slack, Gmail, Google Sheets, \u2026), custom MCP servers, and the platforms the company signed in to (HubSpot, Google Ads, GA4, Search Console, Tag Manager) which you read through their own `baker` commands. Start here when the user mentions an external tool or platform.",
36341
36891
  args: {}
36342
36892
  });
36343
- var connectedCommand = defineCommand152({
36893
+ var connectedCommand = defineCommand156({
36344
36894
  meta: {
36345
36895
  name: "connected",
36346
36896
  description: `Everything this chat can reach \u2014 managed integrations, custom MCP servers, and connected platforms.
@@ -36399,7 +36949,7 @@ registerSchema({
36399
36949
  description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
36400
36950
  args: {}
36401
36951
  });
36402
- var listCommand13 = defineCommand152({
36952
+ var listCommand14 = defineCommand156({
36403
36953
  meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
36404
36954
  run: async () => {
36405
36955
  try {
@@ -36436,7 +36986,7 @@ registerSchema({
36436
36986
  header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
36437
36987
  }
36438
36988
  });
36439
- var addCommand2 = defineCommand152({
36989
+ var addCommand2 = defineCommand156({
36440
36990
  meta: {
36441
36991
  name: "add",
36442
36992
  description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
@@ -36488,7 +37038,7 @@ registerSchema({
36488
37038
  description: "Remove a company custom MCP server by name.",
36489
37039
  args: { name: { type: "string", description: "Server name to remove", required: true } }
36490
37040
  });
36491
- var removeCommand4 = defineCommand152({
37041
+ var removeCommand4 = defineCommand156({
36492
37042
  meta: {
36493
37043
  name: "remove",
36494
37044
  description: `Remove a company custom MCP server by name.
@@ -36510,7 +37060,7 @@ Example:
36510
37060
  }
36511
37061
  }
36512
37062
  });
36513
- var mcpCommand = defineCommand152({
37063
+ var mcpCommand = defineCommand156({
36514
37064
  meta: {
36515
37065
  name: "mcp",
36516
37066
  description: `Third-party tools for this company \u2014 see what's connected, register custom HTTPS MCP endpoints.
@@ -36529,17 +37079,17 @@ Full guide: __tooling__/docs/tools/baker/mcp.md`
36529
37079
  },
36530
37080
  subCommands: {
36531
37081
  connected: connectedCommand,
36532
- list: listCommand13,
37082
+ list: listCommand14,
36533
37083
  add: addCommand2,
36534
37084
  remove: removeCommand4
36535
37085
  }
36536
37086
  });
36537
37087
 
36538
37088
  // src/commands/research/index.ts
36539
- import { defineCommand as defineCommand163 } from "citty";
37089
+ import { defineCommand as defineCommand167 } from "citty";
36540
37090
 
36541
37091
  // src/commands/research/advertisers.ts
36542
- import { defineCommand as defineCommand153 } from "citty";
37092
+ import { defineCommand as defineCommand157 } from "citty";
36543
37093
 
36544
37094
  // src/commands/research/output.ts
36545
37095
  var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
@@ -36652,7 +37202,7 @@ var FIELDS3 = {
36652
37202
  etv: "Estimated traffic value (USD)",
36653
37203
  visibility: "SERP visibility score (0-1)"
36654
37204
  };
36655
- var advertisersCommand = defineCommand153({
37205
+ var advertisersCommand = defineCommand157({
36656
37206
  meta: {
36657
37207
  name: "advertisers",
36658
37208
  description: `Find domains competing for a keyword in Google SERPs.
@@ -36699,7 +37249,7 @@ Examples:
36699
37249
  });
36700
37250
 
36701
37251
  // src/commands/research/autocomplete.ts
36702
- import { defineCommand as defineCommand154 } from "citty";
37252
+ import { defineCommand as defineCommand158 } from "citty";
36703
37253
  registerSchema({
36704
37254
  command: "research.autocomplete",
36705
37255
  description: "Get Google Autocomplete suggestions for a seed keyword. Useful for keyword expansion and discovering what people actually search for. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
@@ -36722,7 +37272,7 @@ registerSchema({
36722
37272
  var FIELDS4 = {
36723
37273
  suggestion: "Autocomplete suggestion from Google"
36724
37274
  };
36725
- var autocompleteCommand = defineCommand154({
37275
+ var autocompleteCommand = defineCommand158({
36726
37276
  meta: {
36727
37277
  name: "autocomplete",
36728
37278
  description: `Get Google Autocomplete suggestions for keyword expansion.
@@ -36768,7 +37318,7 @@ Examples:
36768
37318
  });
36769
37319
 
36770
37320
  // src/commands/research/countries.ts
36771
- import { defineCommand as defineCommand155 } from "citty";
37321
+ import { defineCommand as defineCommand159 } from "citty";
36772
37322
  registerSchema({
36773
37323
  command: "research.countries",
36774
37324
  description: "List all supported country codes for --location flag in research commands.",
@@ -36825,7 +37375,7 @@ var FIELDS5 = {
36825
37375
  code: "Country code to pass as --location",
36826
37376
  name: "Country name"
36827
37377
  };
36828
- var countriesCommand = defineCommand155({
37378
+ var countriesCommand = defineCommand159({
36829
37379
  meta: {
36830
37380
  name: "countries",
36831
37381
  description: "List all supported country codes for --location flag."
@@ -36836,7 +37386,7 @@ var countriesCommand = defineCommand155({
36836
37386
  });
36837
37387
 
36838
37388
  // src/commands/research/intent.ts
36839
- import { defineCommand as defineCommand156 } from "citty";
37389
+ import { defineCommand as defineCommand160 } from "citty";
36840
37390
  registerSchema({
36841
37391
  command: "research.intent",
36842
37392
  description: "Classify Google Search intent for keywords. Determines if someone searching is looking to buy, research, or navigate. IMPORTANT: If --language is omitted, defaults to English (en). The response includes a query_context object showing which language was used.",
@@ -36859,7 +37409,7 @@ var FIELDS6 = {
36859
37409
  intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
36860
37410
  probability: "Confidence score 0.0-1.0"
36861
37411
  };
36862
- var intentCommand = defineCommand156({
37412
+ var intentCommand = defineCommand160({
36863
37413
  meta: {
36864
37414
  name: "intent",
36865
37415
  description: `Classify Google Search intent for keywords. Returns intent type and confidence.
@@ -36907,7 +37457,7 @@ Examples:
36907
37457
  });
36908
37458
 
36909
37459
  // src/commands/research/keyword-gap.ts
36910
- import { defineCommand as defineCommand157 } from "citty";
37460
+ import { defineCommand as defineCommand161 } from "citty";
36911
37461
  registerSchema({
36912
37462
  command: "research.keyword-gap",
36913
37463
  description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
@@ -36936,7 +37486,7 @@ var FIELDS7 = {
36936
37486
  cpc: "Cost per click USD",
36937
37487
  their_position: "Competitor's ranking position"
36938
37488
  };
36939
- var keywordGapCommand = defineCommand157({
37489
+ var keywordGapCommand = defineCommand161({
36940
37490
  meta: {
36941
37491
  name: "keyword-gap",
36942
37492
  description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
@@ -37010,7 +37560,7 @@ Examples:
37010
37560
  });
37011
37561
 
37012
37562
  // src/commands/research/keywords-for-site.ts
37013
- import { defineCommand as defineCommand158 } from "citty";
37563
+ import { defineCommand as defineCommand162 } from "citty";
37014
37564
  registerSchema({
37015
37565
  command: "research.keywords-for-site",
37016
37566
  description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
@@ -37043,7 +37593,7 @@ var FIELDS8 = {
37043
37593
  competition: "LOW, MEDIUM, or HIGH",
37044
37594
  competition_index: "Competition score 0-100"
37045
37595
  };
37046
- var keywordsForSiteCommand = defineCommand158({
37596
+ var keywordsForSiteCommand = defineCommand162({
37047
37597
  meta: {
37048
37598
  name: "keywords-for-site",
37049
37599
  description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
@@ -37096,7 +37646,7 @@ Examples:
37096
37646
  });
37097
37647
 
37098
37648
  // src/commands/research/languages.ts
37099
- import { defineCommand as defineCommand159 } from "citty";
37649
+ import { defineCommand as defineCommand163 } from "citty";
37100
37650
  registerSchema({
37101
37651
  command: "research.languages",
37102
37652
  description: "List all supported language codes for --language flag in research commands.",
@@ -37126,7 +37676,7 @@ var FIELDS9 = {
37126
37676
  code: "Language code to pass as --language",
37127
37677
  name: "Language name (also accepted by --language)"
37128
37678
  };
37129
- var languagesCommand2 = defineCommand159({
37679
+ var languagesCommand2 = defineCommand163({
37130
37680
  meta: {
37131
37681
  name: "languages",
37132
37682
  description: "List all supported language codes for --language flag."
@@ -37137,7 +37687,7 @@ var languagesCommand2 = defineCommand159({
37137
37687
  });
37138
37688
 
37139
37689
  // src/commands/research/lighthouse.ts
37140
- import { defineCommand as defineCommand160 } from "citty";
37690
+ import { defineCommand as defineCommand164 } from "citty";
37141
37691
  registerSchema({
37142
37692
  command: "research.lighthouse",
37143
37693
  description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
@@ -37156,7 +37706,7 @@ var FIELDS10 = {
37156
37706
  speed_index_ms: "Speed Index in ms (good: < 3400)",
37157
37707
  interactive_ms: "Time to Interactive in ms (good: < 3800)"
37158
37708
  };
37159
- var lighthouseCommand = defineCommand160({
37709
+ var lighthouseCommand = defineCommand164({
37160
37710
  meta: {
37161
37711
  name: "lighthouse",
37162
37712
  description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
@@ -37194,7 +37744,7 @@ Examples:
37194
37744
  });
37195
37745
 
37196
37746
  // src/commands/research/relevant-pages.ts
37197
- import { defineCommand as defineCommand161 } from "citty";
37747
+ import { defineCommand as defineCommand165 } from "citty";
37198
37748
  registerSchema({
37199
37749
  command: "research.relevant-pages",
37200
37750
  description: "Get the top pages of a competitor domain with organic traffic and ranking data. Shows which pages drive the most traffic. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
@@ -37220,7 +37770,7 @@ var FIELDS11 = {
37220
37770
  keywords: "Total organic keywords the page ranks for",
37221
37771
  top_10: "Keywords in positions 1-10"
37222
37772
  };
37223
- var relevantPagesCommand = defineCommand161({
37773
+ var relevantPagesCommand = defineCommand165({
37224
37774
  meta: {
37225
37775
  name: "relevant-pages",
37226
37776
  description: `Get the top pages of a competitor domain with traffic data.
@@ -37266,7 +37816,7 @@ Examples:
37266
37816
  });
37267
37817
 
37268
37818
  // src/commands/research/web.ts
37269
- import { defineCommand as defineCommand162 } from "citty";
37819
+ import { defineCommand as defineCommand166 } from "citty";
37270
37820
  registerSchema({
37271
37821
  command: "research.web",
37272
37822
  description: "Search the web with AI to answer marketing questions \u2014 competitors, ICP, pricing, pain points, market trends. Three depth levels: medium (quick, default), high (thorough), xhigh (exhaustive deep research).",
@@ -37317,7 +37867,7 @@ async function runDeepResearch(question) {
37317
37867
  }
37318
37868
  throw new Error("Deep research timed out");
37319
37869
  }
37320
- var webCommand = defineCommand162({
37870
+ var webCommand = defineCommand166({
37321
37871
  meta: {
37322
37872
  name: "web",
37323
37873
  description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
@@ -37377,7 +37927,7 @@ Examples:
37377
37927
  });
37378
37928
 
37379
37929
  // src/commands/research/index.ts
37380
- var researchCommand = defineCommand163({
37930
+ var researchCommand = defineCommand167({
37381
37931
  meta: {
37382
37932
  name: "research",
37383
37933
  description: `Competitive intelligence and AI-powered research commands.
@@ -37418,10 +37968,10 @@ Full guide: __tooling__/docs/tools/baker/research.md`
37418
37968
  });
37419
37969
 
37420
37970
  // src/commands/scheduled-actions/index.ts
37421
- import { defineCommand as defineCommand170 } from "citty";
37971
+ import { defineCommand as defineCommand174 } from "citty";
37422
37972
 
37423
37973
  // src/commands/scheduled-actions/create.ts
37424
- import { defineCommand as defineCommand164 } from "citty";
37974
+ import { defineCommand as defineCommand168 } from "citty";
37425
37975
 
37426
37976
  // src/commands/scheduled-actions/shared.ts
37427
37977
  var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
@@ -37429,11 +37979,11 @@ var TEMP_ID_PREFIX = "temp_";
37429
37979
  function writeOk2(data) {
37430
37980
  writeJson({ ok: true, data: data ?? null });
37431
37981
  }
37432
- function failValidation3(message) {
37982
+ function failValidation4(message) {
37433
37983
  writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message } });
37434
37984
  process.exit(1);
37435
37985
  }
37436
- function failApi2(err) {
37986
+ function failApi3(err) {
37437
37987
  if (err instanceof ApiError) {
37438
37988
  writeJson({ ok: false, error: { code: err.code, message: err.message } });
37439
37989
  process.exit(1);
@@ -37453,7 +38003,7 @@ function isOtherTempId(id) {
37453
38003
  }
37454
38004
  function validateScheduledActionRef(ref) {
37455
38005
  if (isOtherTempId(ref)) {
37456
- failValidation3(`Scheduled action temp IDs must start with ${TEMP_SCHEDULED_ACTION_PREFIX}.`);
38006
+ failValidation4(`Scheduled action temp IDs must start with ${TEMP_SCHEDULED_ACTION_PREFIX}.`);
37457
38007
  }
37458
38008
  if (!isTempScheduledActionId(ref)) {
37459
38009
  validateConvexId(ref);
@@ -37467,7 +38017,7 @@ function isPromptWithoutAgent(args, agentDisabled) {
37467
38017
  }
37468
38018
  function failIfPromptWithoutAgent(args, agentDisabled) {
37469
38019
  if (isPromptWithoutAgent(args, agentDisabled)) {
37470
- failValidation3(
38020
+ failValidation4(
37471
38021
  "--prompt only applies when an agent is spawned; it has no effect with --no-spawn-agent or --spawn-agent false."
37472
38022
  );
37473
38023
  }
@@ -37482,21 +38032,21 @@ function parseBooleanFlag(raw, flagName) {
37482
38032
  if (raw === false || raw === "false") {
37483
38033
  return false;
37484
38034
  }
37485
- failValidation3(`${flagName} must be true or false.`);
38035
+ failValidation4(`${flagName} must be true or false.`);
37486
38036
  }
37487
38037
  function buildScheduleBody(args, options) {
37488
38038
  const cron = args.cron;
37489
38039
  const runAt = args["run-at"];
37490
38040
  const timezone = args.timezone;
37491
38041
  if (cron && runAt) {
37492
- failValidation3("--cron and --run-at are mutually exclusive.");
38042
+ failValidation4("--cron and --run-at are mutually exclusive.");
37493
38043
  }
37494
38044
  if (runAt) {
37495
38045
  if (!runAt.endsWith("Z")) {
37496
- failValidation3("--run-at must be an ISO UTC timestamp ending in Z.");
38046
+ failValidation4("--run-at must be an ISO UTC timestamp ending in Z.");
37497
38047
  }
37498
38048
  if (!Number.isFinite(Date.parse(runAt))) {
37499
- failValidation3("--run-at must be a valid ISO timestamp.");
38049
+ failValidation4("--run-at must be a valid ISO timestamp.");
37500
38050
  }
37501
38051
  return { runAt, ...timezone ? { timezone } : {} };
37502
38052
  }
@@ -37507,7 +38057,7 @@ function buildScheduleBody(args, options) {
37507
38057
  return { timezone };
37508
38058
  }
37509
38059
  if (options.required) {
37510
- failValidation3("Provide exactly one of --cron or --run-at.");
38060
+ failValidation4("Provide exactly one of --cron or --run-at.");
37511
38061
  }
37512
38062
  return void 0;
37513
38063
  }
@@ -37536,7 +38086,7 @@ registerSchema({
37536
38086
  prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
37537
38087
  }
37538
38088
  });
37539
- var createCommand2 = defineCommand164({
38089
+ var createCommand2 = defineCommand168({
37540
38090
  meta: {
37541
38091
  name: "create",
37542
38092
  description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
@@ -37556,10 +38106,10 @@ var createCommand2 = defineCommand164({
37556
38106
  const name = args.name;
37557
38107
  const description = args.description;
37558
38108
  if (!name || name.trim().length === 0) {
37559
- failValidation3("--name is required.");
38109
+ failValidation4("--name is required.");
37560
38110
  }
37561
38111
  if (!description || description.trim().length === 0) {
37562
- failValidation3("--description is required.");
38112
+ failValidation4("--description is required.");
37563
38113
  }
37564
38114
  const schedule = buildScheduleBody(args, { required: true });
37565
38115
  const chatId = requireChatId();
@@ -37579,13 +38129,13 @@ var createCommand2 = defineCommand164({
37579
38129
  const response = await apiPost("/api/scheduled-actions/create", body);
37580
38130
  writeJson(response);
37581
38131
  } catch (err) {
37582
- failApi2(err);
38132
+ failApi3(err);
37583
38133
  }
37584
38134
  }
37585
38135
  });
37586
38136
 
37587
38137
  // src/commands/scheduled-actions/delete.ts
37588
- import { defineCommand as defineCommand165 } from "citty";
38138
+ import { defineCommand as defineCommand169 } from "citty";
37589
38139
  registerSchema({
37590
38140
  command: "scheduled-actions.delete",
37591
38141
  description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
@@ -37593,7 +38143,7 @@ registerSchema({
37593
38143
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
37594
38144
  }
37595
38145
  });
37596
- var deleteCommand2 = defineCommand165({
38146
+ var deleteCommand2 = defineCommand169({
37597
38147
  meta: {
37598
38148
  name: "delete",
37599
38149
  description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
@@ -37610,19 +38160,19 @@ var deleteCommand2 = defineCommand165({
37610
38160
  try {
37611
38161
  const id = args.id || args["scheduled-action-id"];
37612
38162
  if (!id) {
37613
- failValidation3("Scheduled action ID is required.");
38163
+ failValidation4("Scheduled action ID is required.");
37614
38164
  }
37615
38165
  validateScheduledActionRef(id);
37616
38166
  await apiPost("/api/scheduled-actions/delete", { chatId: requireChatId(), id });
37617
38167
  writeOk2();
37618
38168
  } catch (err) {
37619
- failApi2(err);
38169
+ failApi3(err);
37620
38170
  }
37621
38171
  }
37622
38172
  });
37623
38173
 
37624
38174
  // src/commands/scheduled-actions/get.ts
37625
- import { defineCommand as defineCommand166 } from "citty";
38175
+ import { defineCommand as defineCommand170 } from "citty";
37626
38176
  registerSchema({
37627
38177
  command: "scheduled-actions.get",
37628
38178
  description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
@@ -37631,7 +38181,7 @@ registerSchema({
37631
38181
  chat: { type: "string", description: CHAT_READ_ARG.description, required: false }
37632
38182
  }
37633
38183
  });
37634
- var getCommand3 = defineCommand166({
38184
+ var getCommand3 = defineCommand170({
37635
38185
  meta: {
37636
38186
  name: "get",
37637
38187
  description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
@@ -37649,13 +38199,13 @@ var getCommand3 = defineCommand166({
37649
38199
  try {
37650
38200
  const id = args.id || args["scheduled-action-id"];
37651
38201
  if (!id) {
37652
- failValidation3("Scheduled action ID is required.");
38202
+ failValidation4("Scheduled action ID is required.");
37653
38203
  }
37654
38204
  validateScheduledActionRef(id);
37655
38205
  const env = getEnv();
37656
38206
  const chatId = typeof args.chat === "string" && args.chat.length > 0 ? args.chat : env.BAKER_CHAT_ID;
37657
38207
  if (isTempScheduledActionId(id) && !chatId) {
37658
- failValidation3("BAKER_CHAT_ID or --chat is required to get a temp scheduled action ID.");
38208
+ failValidation4("BAKER_CHAT_ID or --chat is required to get a temp scheduled action ID.");
37659
38209
  }
37660
38210
  const body = { id };
37661
38211
  if (chatId) {
@@ -37664,13 +38214,13 @@ var getCommand3 = defineCommand166({
37664
38214
  const response = await apiPost("/api/scheduled-actions/get", body);
37665
38215
  writeJson(response);
37666
38216
  } catch (err) {
37667
- failApi2(err);
38217
+ failApi3(err);
37668
38218
  }
37669
38219
  }
37670
38220
  });
37671
38221
 
37672
38222
  // src/commands/scheduled-actions/list.ts
37673
- import { defineCommand as defineCommand167 } from "citty";
38223
+ import { defineCommand as defineCommand171 } from "citty";
37674
38224
  registerSchema({
37675
38225
  command: "scheduled-actions.list",
37676
38226
  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.",
@@ -37678,7 +38228,7 @@ registerSchema({
37678
38228
  chat: { type: "string", description: CHAT_READ_ARG.description, required: false }
37679
38229
  }
37680
38230
  });
37681
- var listCommand14 = defineCommand167({
38231
+ var listCommand15 = defineCommand171({
37682
38232
  meta: {
37683
38233
  name: "list",
37684
38234
  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."
@@ -37695,13 +38245,13 @@ var listCommand14 = defineCommand167({
37695
38245
  const response = await apiPost("/api/scheduled-actions/list", body);
37696
38246
  writeJson(response);
37697
38247
  } catch (err) {
37698
- failApi2(err);
38248
+ failApi3(err);
37699
38249
  }
37700
38250
  }
37701
38251
  });
37702
38252
 
37703
38253
  // src/commands/scheduled-actions/trigger.ts
37704
- import { defineCommand as defineCommand168 } from "citty";
38254
+ import { defineCommand as defineCommand172 } from "citty";
37705
38255
  registerSchema({
37706
38256
  command: "scheduled-actions.trigger",
37707
38257
  description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
@@ -37709,7 +38259,7 @@ registerSchema({
37709
38259
  id: { type: "string", description: "Published scheduled action ID", required: true }
37710
38260
  }
37711
38261
  });
37712
- var triggerCommand = defineCommand168({
38262
+ var triggerCommand = defineCommand172({
37713
38263
  meta: {
37714
38264
  name: "trigger",
37715
38265
  description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
@@ -37726,10 +38276,10 @@ var triggerCommand = defineCommand168({
37726
38276
  try {
37727
38277
  const id = args.id || args["scheduled-action-id"];
37728
38278
  if (!id) {
37729
- failValidation3("Scheduled action ID is required.");
38279
+ failValidation4("Scheduled action ID is required.");
37730
38280
  }
37731
38281
  if (isTempScheduledActionId(id)) {
37732
- failValidation3("trigger requires a published scheduled action ID, not temp_sched_*.");
38282
+ failValidation4("trigger requires a published scheduled action ID, not temp_sched_*.");
37733
38283
  }
37734
38284
  validateConvexId(id);
37735
38285
  const env = getEnv();
@@ -37740,13 +38290,13 @@ var triggerCommand = defineCommand168({
37740
38290
  const response = await apiPost("/api/scheduled-actions/trigger", body);
37741
38291
  writeJson(response);
37742
38292
  } catch (err) {
37743
- failApi2(err);
38293
+ failApi3(err);
37744
38294
  }
37745
38295
  }
37746
38296
  });
37747
38297
 
37748
38298
  // src/commands/scheduled-actions/update.ts
37749
- import { defineCommand as defineCommand169 } from "citty";
38299
+ import { defineCommand as defineCommand173 } from "citty";
37750
38300
  registerSchema({
37751
38301
  command: "scheduled-actions.update",
37752
38302
  description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
@@ -37771,7 +38321,7 @@ registerSchema({
37771
38321
  prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
37772
38322
  }
37773
38323
  });
37774
- var updateCommand2 = defineCommand169({
38324
+ var updateCommand2 = defineCommand173({
37775
38325
  meta: {
37776
38326
  name: "update",
37777
38327
  description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
@@ -37796,7 +38346,7 @@ var updateCommand2 = defineCommand169({
37796
38346
  try {
37797
38347
  const id = args.id || args["scheduled-action-id"];
37798
38348
  if (!id) {
37799
- failValidation3("Scheduled action ID is required.");
38349
+ failValidation4("Scheduled action ID is required.");
37800
38350
  }
37801
38351
  validateScheduledActionRef(id);
37802
38352
  const body = { id };
@@ -37828,7 +38378,7 @@ var updateCommand2 = defineCommand169({
37828
38378
  hasPatch = true;
37829
38379
  }
37830
38380
  if (!hasPatch) {
37831
- failValidation3(
38381
+ failValidation4(
37832
38382
  "Provide at least one of --name, --description, --cron, --run-at, --timezone, --enabled, --spawn-agent, --prompt."
37833
38383
  );
37834
38384
  }
@@ -37836,13 +38386,13 @@ var updateCommand2 = defineCommand169({
37836
38386
  await apiPost("/api/scheduled-actions/update", body);
37837
38387
  writeOk2();
37838
38388
  } catch (err) {
37839
- failApi2(err);
38389
+ failApi3(err);
37840
38390
  }
37841
38391
  }
37842
38392
  });
37843
38393
 
37844
38394
  // src/commands/scheduled-actions/index.ts
37845
- var scheduledActionsCommand = defineCommand170({
38395
+ var scheduledActionsCommand = defineCommand174({
37846
38396
  meta: {
37847
38397
  name: "scheduled-actions",
37848
38398
  description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
@@ -37859,7 +38409,7 @@ Examples:
37859
38409
  Full guide: __tooling__/docs/tools/baker/scheduled-actions.md`
37860
38410
  },
37861
38411
  subCommands: {
37862
- list: listCommand14,
38412
+ list: listCommand15,
37863
38413
  get: getCommand3,
37864
38414
  create: createCommand2,
37865
38415
  update: updateCommand2,
@@ -37869,14 +38419,14 @@ Full guide: __tooling__/docs/tools/baker/scheduled-actions.md`
37869
38419
  });
37870
38420
 
37871
38421
  // src/commands/schema.ts
37872
- import { defineCommand as defineCommand171 } from "citty";
38422
+ import { defineCommand as defineCommand175 } from "citty";
37873
38423
  function narrowToFamily(commandName, available) {
37874
38424
  const segments = commandName.split(".");
37875
38425
  const prefix = segments[0] === "ads" && segments[1] ? `ads.${segments[1]}.` : `${segments[0]}.`;
37876
38426
  const siblings = available.filter((name) => name.startsWith(prefix));
37877
38427
  return siblings.length > 0 ? siblings : available;
37878
38428
  }
37879
- var schemaCommand = defineCommand171({
38429
+ var schemaCommand = defineCommand175({
37880
38430
  meta: {
37881
38431
  name: "schema",
37882
38432
  description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
@@ -37920,14 +38470,14 @@ var schemaCommand = defineCommand171({
37920
38470
  });
37921
38471
 
37922
38472
  // src/commands/studio/index.ts
37923
- import { defineCommand as defineCommand180 } from "citty";
38473
+ import { defineCommand as defineCommand184 } from "citty";
37924
38474
 
37925
38475
  // src/commands/studio/animate.ts
37926
- import { defineCommand as defineCommand172 } from "citty";
38476
+ import { defineCommand as defineCommand176 } from "citty";
37927
38477
 
37928
38478
  // src/commands/studio/batch.ts
37929
38479
  function projectBatch(generation, full) {
37930
- const compact = {
38480
+ const compact2 = {
37931
38481
  generationId: generation.generationId,
37932
38482
  kind: generation.kind,
37933
38483
  status: generation.status,
@@ -37944,9 +38494,9 @@ function projectBatch(generation, full) {
37944
38494
  ...variant.error ? { error: variant.error } : {}
37945
38495
  }))
37946
38496
  };
37947
- if (!full) return compact;
38497
+ if (!full) return compact2;
37948
38498
  return {
37949
- ...compact,
38499
+ ...compact2,
37950
38500
  ...generation.skillId ? { skillId: generation.skillId } : {},
37951
38501
  ...generation.imageSettings ? { imageSettings: generation.imageSettings } : {},
37952
38502
  ...generation.clipSettings ? { clipSettings: generation.clipSettings } : {},
@@ -38012,7 +38562,7 @@ function resolveMaxWaitMs(wait, maxWait, defaultMs) {
38012
38562
  const parsed = Number(maxWait);
38013
38563
  return Number.isFinite(parsed) && parsed >= 0 ? parsed : defaultMs;
38014
38564
  }
38015
- var POLL_INTERVAL_MS5 = 3e3;
38565
+ var POLL_INTERVAL_MS6 = 3e3;
38016
38566
  var defaultPollDeps = {
38017
38567
  get: async (generationId) => {
38018
38568
  const response = await apiGet(`/api/studio/generations/${generationId}`);
@@ -38025,7 +38575,7 @@ async function pollBatch(generationId, maxWaitMs, deps = defaultPollDeps) {
38025
38575
  while (Date.now() < deadline) {
38026
38576
  const generation = await deps.get(generationId);
38027
38577
  if (generation.status !== "running") return generation;
38028
- await deps.sleep(POLL_INTERVAL_MS5);
38578
+ await deps.sleep(POLL_INTERVAL_MS6);
38029
38579
  }
38030
38580
  return null;
38031
38581
  }
@@ -38368,7 +38918,7 @@ function costHintsFor(body) {
38368
38918
  }
38369
38919
  return hints;
38370
38920
  }
38371
- var animateCommand = defineCommand172({
38921
+ var animateCommand = defineCommand176({
38372
38922
  meta: {
38373
38923
  name: "animate",
38374
38924
  description: "Render a clip. With an image the look is already fixed, so the prompt describes MOVEMENT \u2014 what the camera does, what the subject does, in what order. With --from text there is no image and the prompt is the whole shot.\n\nA rendered clip is NOT usable anywhere until you keep it: `baker studio keep <id> --slot N` is what puts it in the video library. Takes nobody keeps are never ingested, which is what makes a rejected batch cheap.\n\nFor anything longer than 15 seconds, or to build on footage that already exists, use --model bytedance/seedance-2.5: it renders 4-30s and is the only model that reads an existing clip or an existing soundtrack.\n\nExamples:\n baker studio animate 'slow push in, model turns to camera and smiles' --image j57abc123def456ghi789\n baker studio animate 'handheld drift right, steam rising from the cup' --image './out/hero.png' --duration 6 --quality 1080p\n baker studio animate 'product rotates once on a turntable' --image j57abc\u2026,j57def\u2026 --from references\n baker studio animate 'she keeps walking, camera stays with her, then she stops and looks up' --image j57abc\u2026 --from references --from-clip j57batch\u2026:0 --model bytedance/seedance-2.5 --duration 20\n baker studio animate 'hold on the product, then a slow push-in' --from references --from-video j57vid\u2026 --model bytedance/seedance-2.5\n baker studio animate 'slow drone pull-back over a solar farm at golden hour, no people' --from text --model bytedance/seedance-2.5 --duration 12"
@@ -38487,7 +39037,7 @@ var animateCommand = defineCommand172({
38487
39037
  });
38488
39038
 
38489
39039
  // src/commands/studio/generate.ts
38490
- import { defineCommand as defineCommand173 } from "citty";
39040
+ import { defineCommand as defineCommand177 } from "citty";
38491
39041
  var MODEL_LIST2 = IMAGE_MODEL_IDS;
38492
39042
  var DEFAULT_MAX_WAIT_MS2 = 24e4;
38493
39043
  registerSchema({
@@ -38617,7 +39167,7 @@ function buildGenerateBody(args, prompt) {
38617
39167
  }
38618
39168
  return body;
38619
39169
  }
38620
- var generateCommand = defineCommand173({
39170
+ var generateCommand = defineCommand177({
38621
39171
  meta: {
38622
39172
  name: "generate",
38623
39173
  description: "Start here to make an image. Renders 1-8 takes of one brief, ingests each into the media library as it lands, and shows the batch in the dashboard Studio next to the ones the client ran.\n\nModel choice: google/gemini-3.1-flash-image-preview (default \u2014 fast, best at editing a reference and at extreme ratios), google/gemini-3-pro-image-preview (highest fidelity, slower), openai/gpt-image-2 (photoreal and the cleanest in-image text \u2014 no --image-size, no 4:5 / 5:4), recraft/recraft-v4.1-pro-vector (vector/flat marks with palette control).\n\n--reference is the biggest quality lever there is: a real logo, product shot, Pinterest pin or sandbox screenshot beats any amount of adjectives.\n\nExamples:\n baker studio generate 'matte black bottle on wet marble, hard studio light, 35mm' --aspect-ratio 3:2 --count 3\n baker studio generate 'this bottle on a sunlit kitchen counter' --reference './src/brand/product.png,https://\u2026/kitchen.jpg'\n baker studio generate 'founder-style selfie, kitchen background, natural light' --skill ugc-selfie-hook\n baker studio generate 'flat geometric mascot, brand palette' --model recraft/recraft-v4.1-pro-vector --rgb-colors '[[10,10,10],[255,80,0]]'"
@@ -38695,7 +39245,7 @@ var generateCommand = defineCommand173({
38695
39245
  });
38696
39246
 
38697
39247
  // src/commands/studio/get.ts
38698
- import { defineCommand as defineCommand174 } from "citty";
39248
+ import { defineCommand as defineCommand178 } from "citty";
38699
39249
  registerSchema({
38700
39250
  command: "studio.get",
38701
39251
  description: "Read one Studio batch: every take, where it lives, and why a take is missing. This is how you pick up a batch that was still rendering when the start command returned.",
@@ -38704,7 +39254,7 @@ registerSchema({
38704
39254
  full: { type: "boolean", description: "Include settings, references and attribution", required: false }
38705
39255
  }
38706
39256
  });
38707
- var getCommand4 = defineCommand174({
39257
+ var getCommand4 = defineCommand178({
38708
39258
  meta: {
38709
39259
  name: "get",
38710
39260
  description: "Read one Studio batch \u2014 the takes, their urls, whether each is in the library, and the reason for any that failed.\n\nExample: baker studio get j57abc123def456ghi789\nExample: baker studio get j57abc123def456ghi789 --full"
@@ -38733,7 +39283,7 @@ var getCommand4 = defineCommand174({
38733
39283
  });
38734
39284
 
38735
39285
  // src/commands/studio/improve.ts
38736
- import { defineCommand as defineCommand175 } from "citty";
39286
+ import { defineCommand as defineCommand179 } from "citty";
38737
39287
  var DESCRIPTION = "Sharpen a rough brief into directed art direction \u2014 the same rewrite the client gets from the wand in the Studio prompt bar. Reach for it when you are relaying the CLIENT's own words and want them shaped without substituting your voice; when you are writing the art direction yourself, just write it, because you will do a better job than this does.";
38738
39288
  registerSchema({
38739
39289
  command: "studio.improve",
@@ -38758,7 +39308,7 @@ registerSchema({
38758
39308
  }
38759
39309
  }
38760
39310
  });
38761
- var improveCommand = defineCommand175({
39311
+ var improveCommand = defineCommand179({
38762
39312
  meta: {
38763
39313
  name: "improve",
38764
39314
  description: `${DESCRIPTION}
@@ -38802,7 +39352,7 @@ Examples:
38802
39352
  });
38803
39353
 
38804
39354
  // src/commands/studio/keep.ts
38805
- import { defineCommand as defineCommand176 } from "citty";
39355
+ import { defineCommand as defineCommand180 } from "citty";
38806
39356
  registerSchema({
38807
39357
  command: "studio.keep",
38808
39358
  description: "Mark one take as the keeper. For an image this stars it, so the client reviewing the batch sees which one you used. For a CLIP it is the step that puts it in the video library \u2014 until then the clip cannot be used in a canvas, a landing, or an ad.",
@@ -38812,7 +39362,7 @@ registerSchema({
38812
39362
  undo: { type: "boolean", description: "Un-star an image, or take a kept clip back out", required: false }
38813
39363
  }
38814
39364
  });
38815
- var keepCommand = defineCommand176({
39365
+ var keepCommand = defineCommand180({
38816
39366
  meta: {
38817
39367
  name: "keep",
38818
39368
  description: "Mark one take as the keeper. An image gets starred (it was already in the library); a clip gets INGESTED into the video library, which is what makes it usable anywhere else.\n\nExample: baker studio keep j57abc123def456ghi789 --slot 2\nExample: baker studio keep j57abc123def456ghi789 --slot 2 --undo"
@@ -38863,7 +39413,7 @@ var keepCommand = defineCommand176({
38863
39413
  });
38864
39414
 
38865
39415
  // src/commands/studio/list.ts
38866
- import { defineCommand as defineCommand177 } from "citty";
39416
+ import { defineCommand as defineCommand181 } from "citty";
38867
39417
  registerSchema({
38868
39418
  command: "studio.list",
38869
39419
  description: "Recent Studio batches for THIS conversation, newest first \u2014 what you have already generated, so you re-use a take instead of paying for it twice. `--all` widens it to everything the company generated, including what people ran themselves in the dashboard.",
@@ -38874,7 +39424,7 @@ registerSchema({
38874
39424
  full: { type: "boolean", description: "Include settings, references and attribution", required: false }
38875
39425
  }
38876
39426
  });
38877
- var listCommand15 = defineCommand177({
39427
+ var listCommand16 = defineCommand181({
38878
39428
  meta: {
38879
39429
  name: "list",
38880
39430
  description: "Recent Studio batches, newest first. Scoped to this conversation unless you pass --all.\n\nExample: baker studio list\nExample: baker studio list --kind video --limit 5\nExample: baker studio list --all # includes batches the client ran in the dashboard"
@@ -38908,7 +39458,7 @@ var listCommand15 = defineCommand177({
38908
39458
  });
38909
39459
 
38910
39460
  // src/commands/studio/models.ts
38911
- import { defineCommand as defineCommand178 } from "citty";
39461
+ import { defineCommand as defineCommand182 } from "citty";
38912
39462
  var DESCRIPTION2 = "What each Studio model actually accepts: its shapes, resolutions, clip lengths, prompt character cap, how many reference images it takes, and which knobs it has. Read this before a batch you care about \u2014 the models disagree far more than they look like they do, and a setting the chosen model does not have is REFUSED, not ignored.";
38913
39463
  registerSchema({
38914
39464
  command: "studio.models",
@@ -38995,7 +39545,7 @@ function buildModelCards(kind, model) {
38995
39545
  const selected = model ? ids.filter((id) => id === model) : ids;
38996
39546
  return selected.map((id) => build(id));
38997
39547
  }
38998
- var modelsCommand = defineCommand178({
39548
+ var modelsCommand = defineCommand182({
38999
39549
  meta: {
39000
39550
  name: "models",
39001
39551
  description: `${DESCRIPTION2}
@@ -39042,13 +39592,13 @@ Examples:
39042
39592
  });
39043
39593
 
39044
39594
  // src/commands/studio/skills.ts
39045
- import { defineCommand as defineCommand179 } from "citty";
39595
+ import { defineCommand as defineCommand183 } from "citty";
39046
39596
  registerSchema({
39047
39597
  command: "studio.skills",
39048
39598
  description: "The craft directions `studio generate --skill <id>` accepts. Each one carries directed art direction plus the model, shape and take count it wants, so you pick a look by name instead of writing the boilerplate yourself.",
39049
39599
  args: {}
39050
39600
  });
39051
- var skillsCommand = defineCommand179({
39601
+ var skillsCommand = defineCommand183({
39052
39602
  meta: {
39053
39603
  name: "skills",
39054
39604
  description: "List the craft directions available to `baker studio generate --skill <id>` \u2014 what each one is for, whether it wants a reference image, and the model/shape/count it defaults to.\n\nExample: baker studio skills"
@@ -39072,7 +39622,7 @@ var skillsCommand = defineCommand179({
39072
39622
  });
39073
39623
 
39074
39624
  // src/commands/studio/index.ts
39075
- var studioCommand = defineCommand180({
39625
+ var studioCommand = defineCommand184({
39076
39626
  meta: {
39077
39627
  name: "studio",
39078
39628
  description: `Make new imagery and clips. Every batch is recorded and shows up in the dashboard Studio for the client to review, labelled with this conversation.
@@ -39106,7 +39656,7 @@ Full guide: __tooling__/docs/tools/baker/studio.md`
39106
39656
  generate: generateCommand,
39107
39657
  animate: animateCommand,
39108
39658
  get: getCommand4,
39109
- list: listCommand15,
39659
+ list: listCommand16,
39110
39660
  keep: keepCommand,
39111
39661
  models: modelsCommand,
39112
39662
  skills: skillsCommand,
@@ -39115,14 +39665,14 @@ Full guide: __tooling__/docs/tools/baker/studio.md`
39115
39665
  });
39116
39666
 
39117
39667
  // src/commands/tag-manager/index.ts
39118
- import { defineCommand as defineCommand184 } from "citty";
39668
+ import { defineCommand as defineCommand188 } from "citty";
39119
39669
 
39120
39670
  // src/commands/tag-manager/draft.ts
39121
- import { defineCommand as defineCommand181 } from "citty";
39671
+ import { defineCommand as defineCommand185 } from "citty";
39122
39672
 
39123
39673
  // src/commands/tag-manager/shared.ts
39124
39674
  import { readFileSync as readFileSync13 } from "fs";
39125
- function failValidation4(message) {
39675
+ function failValidation5(message) {
39126
39676
  writeJsonEnvelope({ ok: false, error: { code: "VALIDATION_ERROR", message } });
39127
39677
  process.exit(1);
39128
39678
  }
@@ -39130,7 +39680,7 @@ function requireTarget5(args, entity) {
39130
39680
  const positional = Array.isArray(args._) ? args._[0] : void 0;
39131
39681
  const target = args.id ?? args.target ?? positional;
39132
39682
  if (typeof target !== "string" || target.length === 0) {
39133
- failValidation4(`pass the ${entity} id or path as the positional argument`);
39683
+ failValidation5(`pass the ${entity} id or path as the positional argument`);
39134
39684
  }
39135
39685
  return target;
39136
39686
  }
@@ -39139,16 +39689,16 @@ function loadJsonArg2(args, flag = "json") {
39139
39689
  const file = args.file;
39140
39690
  const raw = typeof file === "string" && file.length > 0 ? readFileSync13(file, "utf8") : typeof inline === "string" && inline.length > 0 ? inline : void 0;
39141
39691
  if (raw === void 0) {
39142
- failValidation4(`pass --${flag} with inline JSON or --file with a path to a JSON file`);
39692
+ failValidation5(`pass --${flag} with inline JSON or --file with a path to a JSON file`);
39143
39693
  }
39144
39694
  try {
39145
39695
  const parsed = JSON.parse(raw);
39146
39696
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
39147
- failValidation4(`--${flag} must be a JSON object`);
39697
+ failValidation5(`--${flag} must be a JSON object`);
39148
39698
  }
39149
39699
  return parsed;
39150
39700
  } catch {
39151
- return failValidation4(`--${flag} is not valid JSON`);
39701
+ return failValidation5(`--${flag} is not valid JSON`);
39152
39702
  }
39153
39703
  }
39154
39704
  var RETRYABLE_CODES2 = /* @__PURE__ */ new Set(["RATE_LIMITED", "INTERNAL_ERROR", "NETWORK_ERROR", "TIMEOUT"]);
@@ -39241,13 +39791,13 @@ registerSchema({
39241
39791
  chat: { type: "string", description: CHAT_READ_ARG.description, required: false }
39242
39792
  }
39243
39793
  });
39244
- var draftCommand4 = defineCommand181({
39794
+ var draftCommand4 = defineCommand185({
39245
39795
  meta: {
39246
39796
  name: "draft",
39247
39797
  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."
39248
39798
  },
39249
39799
  subCommands: {
39250
- list: defineCommand181({
39800
+ list: defineCommand185({
39251
39801
  meta: {
39252
39802
  name: "list",
39253
39803
  description: "Review everything staged on this chat (--json for the raw envelope)"
@@ -39260,7 +39810,7 @@ var draftCommand4 = defineCommand181({
39260
39810
  await draftList2(args.json === true, args.chat);
39261
39811
  }
39262
39812
  }),
39263
- show: defineCommand181({
39813
+ show: defineCommand185({
39264
39814
  meta: {
39265
39815
  name: "show",
39266
39816
  description: "Print the full staged payload for one change \u2014 the receipt to verify it looks right before publish (never truncated)."
@@ -39277,7 +39827,7 @@ var draftCommand4 = defineCommand181({
39277
39827
  );
39278
39828
  }
39279
39829
  }),
39280
- amend: defineCommand181({
39830
+ amend: defineCommand185({
39281
39831
  meta: {
39282
39832
  name: "amend",
39283
39833
  description: "Update a staged change in place \u2014 merges a JSON patch into its payload (objects deep-merge, null deletes a key, arrays/scalars replace) and re-validates. Use this instead of remove + re-create."
@@ -39294,7 +39844,7 @@ var draftCommand4 = defineCommand181({
39294
39844
  });
39295
39845
  }
39296
39846
  }),
39297
- remove: defineCommand181({
39847
+ remove: defineCommand185({
39298
39848
  meta: { name: "remove", description: "Remove one staged change (cascades to anything depending on it)" },
39299
39849
  args: { ref: { type: "positional", description: "Staged ref (gtm_temp_*) or target", required: false } },
39300
39850
  run: async ({ args }) => {
@@ -39303,7 +39853,7 @@ var draftCommand4 = defineCommand181({
39303
39853
  });
39304
39854
  }
39305
39855
  }),
39306
- clear: defineCommand181({
39856
+ clear: defineCommand185({
39307
39857
  meta: { name: "clear", description: "Discard all Tag Manager changes staged on this chat" },
39308
39858
  run: async () => {
39309
39859
  await draftAction3("/api/tag-manager/draft/clear", {});
@@ -39313,7 +39863,7 @@ var draftCommand4 = defineCommand181({
39313
39863
  });
39314
39864
 
39315
39865
  // src/commands/tag-manager/read.ts
39316
- import { defineCommand as defineCommand182 } from "citty";
39866
+ import { defineCommand as defineCommand186 } from "citty";
39317
39867
  registerSchema({
39318
39868
  command: "tagManager.containers",
39319
39869
  description: "List the Google Tag Manager containers this company's connection can reach. Every container the company connected is flagged `connected: true` \u2014 there can be several, and Baker may read and change all of them. Start here to confirm which containers you are managing.",
@@ -39354,7 +39904,7 @@ function containersHints(containers) {
39354
39904
  }))
39355
39905
  });
39356
39906
  }
39357
- var containersCommand = defineCommand182({
39907
+ var containersCommand = defineCommand186({
39358
39908
  meta: {
39359
39909
  name: "containers",
39360
39910
  description: `List Tag Manager containers reachable by this company's connection.
@@ -39371,7 +39921,7 @@ Start here:
39371
39921
  }
39372
39922
  }
39373
39923
  });
39374
- var readCommand = defineCommand182({
39924
+ var readCommand = defineCommand186({
39375
39925
  meta: {
39376
39926
  name: "read",
39377
39927
  description: `Read the current contents of the Tag Manager container \u2014 always do this before staging changes.
@@ -39413,7 +39963,7 @@ Examples:
39413
39963
  });
39414
39964
 
39415
39965
  // src/commands/tag-manager/write-commands.ts
39416
- import { defineCommand as defineCommand183 } from "citty";
39966
+ import { defineCommand as defineCommand187 } from "citty";
39417
39967
  var CONTAINER_ARG_DESCRIPTION = "Numeric container id (optional only when one container is connected \u2014 run `baker tag-manager containers`)";
39418
39968
  var ENTITIES = [
39419
39969
  {
@@ -39469,10 +40019,10 @@ for (const { entity, noun, createHint } of ENTITIES) {
39469
40019
  });
39470
40020
  }
39471
40021
  function entityCommand(entity, noun, example) {
39472
- return defineCommand183({
40022
+ return defineCommand187({
39473
40023
  meta: { name: entity, description: `Stage ${noun} changes on this chat's Tag Manager draft` },
39474
40024
  subCommands: {
39475
- create: defineCommand183({
40025
+ create: defineCommand187({
39476
40026
  meta: {
39477
40027
  name: "create",
39478
40028
  description: `Stage a new ${noun}
@@ -39494,7 +40044,7 @@ Examples:
39494
40044
  });
39495
40045
  }
39496
40046
  }),
39497
- update: defineCommand183({
40047
+ update: defineCommand187({
39498
40048
  meta: {
39499
40049
  name: "update",
39500
40050
  description: `Stage an update to an existing ${noun} (pass its id or path)`
@@ -39514,7 +40064,7 @@ Examples:
39514
40064
  });
39515
40065
  }
39516
40066
  }),
39517
- delete: defineCommand183({
40067
+ delete: defineCommand187({
39518
40068
  meta: { name: "delete", description: `Stage the deletion of a ${noun} (pass its id or path)` },
39519
40069
  args: {
39520
40070
  id: { type: "positional", description: `${noun} id or path`, required: false },
@@ -39555,7 +40105,7 @@ function builtinTypes(args) {
39555
40105
  }
39556
40106
  return raw.split(",").map((entry) => entry.trim());
39557
40107
  }
39558
- var builtinCommand = defineCommand183({
40108
+ var builtinCommand = defineCommand187({
39559
40109
  meta: {
39560
40110
  name: "builtin",
39561
40111
  description: `Enable or disable built-in variables
@@ -39565,7 +40115,7 @@ Examples:
39565
40115
  baker tag-manager builtin disable --types formId`
39566
40116
  },
39567
40117
  subCommands: {
39568
- enable: defineCommand183({
40118
+ enable: defineCommand187({
39569
40119
  meta: { name: "enable", description: "Stage enabling built-in variables" },
39570
40120
  args: {
39571
40121
  types: { type: "string", description: "Comma-separated types", required: false },
@@ -39579,7 +40129,7 @@ Examples:
39579
40129
  });
39580
40130
  }
39581
40131
  }),
39582
- disable: defineCommand183({
40132
+ disable: defineCommand187({
39583
40133
  meta: { name: "disable", description: "Stage disabling built-in variables" },
39584
40134
  args: {
39585
40135
  types: { type: "string", description: "Comma-separated types", required: false },
@@ -39597,7 +40147,7 @@ Examples:
39597
40147
  });
39598
40148
 
39599
40149
  // src/commands/tag-manager/index.ts
39600
- var tagManagerCommand = defineCommand184({
40150
+ var tagManagerCommand = defineCommand188({
39601
40151
  meta: {
39602
40152
  name: "tag-manager",
39603
40153
  description: `Read and change what lives inside the client's Google Tag Manager container \u2014 tags, triggers, variables, folders and built-in variables.
@@ -39634,10 +40184,10 @@ Full guide: __tooling__/docs/tools/baker/tag-manager.md`
39634
40184
  });
39635
40185
 
39636
40186
  // src/commands/tags/index.ts
39637
- import { defineCommand as defineCommand185 } from "citty";
40187
+ import { defineCommand as defineCommand189 } from "citty";
39638
40188
 
39639
40189
  // src/commands/tags/shared.ts
39640
- function failApi3(err) {
40190
+ function failApi4(err) {
39641
40191
  if (err instanceof ApiError) {
39642
40192
  writeJson({ ok: false, error: { code: err.code, message: err.message } });
39643
40193
  process.exit(1);
@@ -39697,13 +40247,13 @@ async function listTags(json) {
39697
40247
  process.stdout.write(`${response.tags.map(renderEffectiveEntry).join("\n")}
39698
40248
  `);
39699
40249
  } catch (err) {
39700
- failApi3(err);
40250
+ failApi4(err);
39701
40251
  }
39702
40252
  }
39703
40253
  var listArgs9 = {
39704
40254
  json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list" }
39705
40255
  };
39706
- var listCommand16 = defineCommand185({
40256
+ var listCommand17 = defineCommand189({
39707
40257
  meta: {
39708
40258
  name: "list",
39709
40259
  description: "Effective tags for this chat (production + staged), with each tag's full readable config (secrets excluded) \u2014 reuse a stored value to pre-fill a change rather than asking the user. Refs printed here are what flow side-effect tagIds should use. Example: baker tags list"
@@ -39719,10 +40269,10 @@ async function listDraft3(chat) {
39719
40269
  const response = await apiPost("/api/tags/draft", { chatId });
39720
40270
  writeJson({ ok: true, data: response });
39721
40271
  } catch (err) {
39722
- failApi3(err);
40272
+ failApi4(err);
39723
40273
  }
39724
40274
  }
39725
- var draftCommand5 = defineCommand185({
40275
+ var draftCommand5 = defineCommand189({
39726
40276
  meta: {
39727
40277
  name: "draft",
39728
40278
  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."
@@ -39732,7 +40282,7 @@ var draftCommand5 = defineCommand185({
39732
40282
  await listDraft3(args.chat);
39733
40283
  }
39734
40284
  });
39735
- var tagsCommand3 = defineCommand185({
40285
+ var tagsCommand3 = defineCommand189({
39736
40286
  meta: {
39737
40287
  name: "tags",
39738
40288
  description: `Read the client's marketing/analytics tags (Meta pixel, GA4, Google Ads, GTM, Clarity, Hotjar, \u2026) \u2014 production tags plus the changes staged in this chat.
@@ -39749,7 +40299,7 @@ Examples:
39749
40299
  Full guide: __tooling__/docs/tools/baker/tags.md`
39750
40300
  },
39751
40301
  subCommands: {
39752
- list: listCommand16,
40302
+ list: listCommand17,
39753
40303
  draft: draftCommand5
39754
40304
  },
39755
40305
  // Bare `baker tags` lists the effective tags. `args` stays so citty knows this
@@ -39761,10 +40311,10 @@ Full guide: __tooling__/docs/tools/baker/tags.md`
39761
40311
  });
39762
40312
 
39763
40313
  // src/commands/testimonials/index.ts
39764
- import { defineCommand as defineCommand189 } from "citty";
40314
+ import { defineCommand as defineCommand193 } from "citty";
39765
40315
 
39766
40316
  // src/commands/testimonials/get.ts
39767
- import { defineCommand as defineCommand186 } from "citty";
40317
+ import { defineCommand as defineCommand190 } from "citty";
39768
40318
  registerSchema({
39769
40319
  command: "testimonials.get",
39770
40320
  description: "Get a single testimonial by ID",
@@ -39772,7 +40322,7 @@ registerSchema({
39772
40322
  id: { type: "string", description: "Testimonial ID", required: true }
39773
40323
  }
39774
40324
  });
39775
- var getCommand5 = defineCommand186({
40325
+ var getCommand5 = defineCommand190({
39776
40326
  meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
39777
40327
  args: {
39778
40328
  id: { type: "positional", description: "Testimonial ID", required: false },
@@ -39809,7 +40359,7 @@ var getCommand5 = defineCommand186({
39809
40359
  });
39810
40360
 
39811
40361
  // src/commands/testimonials/list.ts
39812
- import { defineCommand as defineCommand187 } from "citty";
40362
+ import { defineCommand as defineCommand191 } from "citty";
39813
40363
  registerSchema({
39814
40364
  command: "testimonials.list",
39815
40365
  description: "List testimonials with optional filters.",
@@ -39839,7 +40389,7 @@ registerSchema({
39839
40389
  limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
39840
40390
  }
39841
40391
  });
39842
- var listCommand17 = defineCommand187({
40392
+ var listCommand18 = defineCommand191({
39843
40393
  meta: {
39844
40394
  name: "list",
39845
40395
  description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
@@ -39888,7 +40438,7 @@ var listCommand17 = defineCommand187({
39888
40438
  });
39889
40439
 
39890
40440
  // src/commands/testimonials/search.ts
39891
- import { defineCommand as defineCommand188 } from "citty";
40441
+ import { defineCommand as defineCommand192 } from "citty";
39892
40442
  function languageBiasHint(results, requestedLanguage) {
39893
40443
  if (requestedLanguage) {
39894
40444
  return null;
@@ -39966,7 +40516,7 @@ function buildSearchRequest(query, args) {
39966
40516
  }
39967
40517
  return body;
39968
40518
  }
39969
- var searchCommand3 = defineCommand188({
40519
+ var searchCommand3 = defineCommand192({
39970
40520
  meta: {
39971
40521
  name: "search",
39972
40522
  description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
@@ -40022,7 +40572,7 @@ var searchCommand3 = defineCommand188({
40022
40572
  var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
40023
40573
 
40024
40574
  // src/commands/testimonials/index.ts
40025
- var testimonialsCommand = defineCommand189({
40575
+ var testimonialsCommand = defineCommand193({
40026
40576
  meta: {
40027
40577
  name: "testimonials",
40028
40578
  description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
@@ -40038,16 +40588,16 @@ Full guide: __tooling__/docs/tools/baker/testimonials.md`
40038
40588
  subCommands: {
40039
40589
  get: getCommand5,
40040
40590
  search: searchCommand3,
40041
- list: listCommand17,
40591
+ list: listCommand18,
40042
40592
  tags: tagsCommand4
40043
40593
  }
40044
40594
  });
40045
40595
 
40046
40596
  // src/commands/videos/index.ts
40047
- import { defineCommand as defineCommand195 } from "citty";
40597
+ import { defineCommand as defineCommand199 } from "citty";
40048
40598
 
40049
40599
  // src/commands/videos/delete.ts
40050
- import { defineCommand as defineCommand190 } from "citty";
40600
+ import { defineCommand as defineCommand194 } from "citty";
40051
40601
  registerSchema({
40052
40602
  command: "videos.delete",
40053
40603
  description: "Delete a video by ID",
@@ -40061,7 +40611,7 @@ registerSchema({
40061
40611
  }
40062
40612
  }
40063
40613
  });
40064
- var deleteCommand3 = defineCommand190({
40614
+ var deleteCommand3 = defineCommand194({
40065
40615
  meta: {
40066
40616
  name: "delete",
40067
40617
  description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
@@ -40102,7 +40652,7 @@ var deleteCommand3 = defineCommand190({
40102
40652
  });
40103
40653
 
40104
40654
  // src/commands/videos/get.ts
40105
- import { defineCommand as defineCommand191 } from "citty";
40655
+ import { defineCommand as defineCommand195 } from "citty";
40106
40656
  registerSchema({
40107
40657
  command: "videos.get",
40108
40658
  description: "Get a single video by ID",
@@ -40110,7 +40660,7 @@ registerSchema({
40110
40660
  id: { type: "string", description: "Video ID", required: true }
40111
40661
  }
40112
40662
  });
40113
- var getCommand6 = defineCommand191({
40663
+ var getCommand6 = defineCommand195({
40114
40664
  meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
40115
40665
  args: {
40116
40666
  id: { type: "positional", description: "Video ID", required: false },
@@ -40147,7 +40697,7 @@ var getCommand6 = defineCommand191({
40147
40697
  });
40148
40698
 
40149
40699
  // src/commands/videos/group.ts
40150
- import { defineCommand as defineCommand192 } from "citty";
40700
+ import { defineCommand as defineCommand196 } from "citty";
40151
40701
  registerSchema({
40152
40702
  command: "videos.group",
40153
40703
  description: "List every clip and image that arrived in the same set as this video (carousel slides, one page)",
@@ -40156,7 +40706,7 @@ registerSchema({
40156
40706
  "group-key": { type: "string", description: "The set key directly, when you already have it", required: false }
40157
40707
  }
40158
40708
  });
40159
- var groupCommand2 = defineCommand192({
40709
+ var groupCommand2 = defineCommand196({
40160
40710
  meta: {
40161
40711
  name: "group",
40162
40712
  description: "List every asset that arrived in the same set as this clip \u2014 the other slides of the Instagram post it came from, stills included. A carousel is authored to be read in order, so a clip pulled out of one is usually missing half its meaning. Example: baker videos group <videoId>"
@@ -40176,7 +40726,7 @@ var groupCommand2 = defineCommand192({
40176
40726
  });
40177
40727
 
40178
40728
  // src/commands/videos/search.ts
40179
- import { defineCommand as defineCommand193 } from "citty";
40729
+ import { defineCommand as defineCommand197 } from "citty";
40180
40730
  registerSchema({
40181
40731
  command: "videos.search",
40182
40732
  description: "Search videos by text query. Only returns ready videos.",
@@ -40186,7 +40736,7 @@ registerSchema({
40186
40736
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
40187
40737
  }
40188
40738
  });
40189
- var searchCommand4 = defineCommand193({
40739
+ var searchCommand4 = defineCommand197({
40190
40740
  meta: {
40191
40741
  name: "search",
40192
40742
  description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
@@ -40238,7 +40788,7 @@ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
40238
40788
  // src/commands/videos/upload.ts
40239
40789
  import { readFile as readFile24, stat as stat7 } from "fs/promises";
40240
40790
  import { basename as basename2, extname as extname3 } from "path";
40241
- import { defineCommand as defineCommand194 } from "citty";
40791
+ import { defineCommand as defineCommand198 } from "citty";
40242
40792
  var MIME_MAP = {
40243
40793
  ".mp4": "video/mp4",
40244
40794
  ".mov": "video/quicktime",
@@ -40277,7 +40827,7 @@ function detectContentType(filePath) {
40277
40827
  }
40278
40828
  return mime;
40279
40829
  }
40280
- var uploadCommand2 = defineCommand194({
40830
+ var uploadCommand2 = defineCommand198({
40281
40831
  meta: {
40282
40832
  name: "upload",
40283
40833
  description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
@@ -40347,7 +40897,7 @@ var uploadCommand2 = defineCommand194({
40347
40897
  });
40348
40898
 
40349
40899
  // src/commands/videos/index.ts
40350
- var videosCommand = defineCommand195({
40900
+ var videosCommand = defineCommand199({
40351
40901
  meta: {
40352
40902
  name: "videos",
40353
40903
  description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
@@ -40372,10 +40922,10 @@ Full guide: __tooling__/docs/tools/baker/videos.md`
40372
40922
  });
40373
40923
 
40374
40924
  // src/commands/winning-ads/index.ts
40375
- import { defineCommand as defineCommand208 } from "citty";
40925
+ import { defineCommand as defineCommand212 } from "citty";
40376
40926
 
40377
40927
  // src/commands/winning-ads/advertisers.ts
40378
- import { defineCommand as defineCommand196 } from "citty";
40928
+ import { defineCommand as defineCommand200 } from "citty";
40379
40929
 
40380
40930
  // src/commands/winning-ads/shared.ts
40381
40931
  function splitList2(value) {
@@ -40415,12 +40965,12 @@ function compactAdvertiser(record) {
40415
40965
  };
40416
40966
  }
40417
40967
  function advertiserNormalizer(record, full) {
40418
- const compact = compactAdvertiser(record);
40968
+ const compact2 = compactAdvertiser(record);
40419
40969
  if (!full) {
40420
- return compact;
40970
+ return compact2;
40421
40971
  }
40422
40972
  return {
40423
- ...compact,
40973
+ ...compact2,
40424
40974
  scraped_name: record.scraped_name ?? null,
40425
40975
  image_url: record.image_url ?? null,
40426
40976
  platforms: Array.isArray(record.platforms) ? record.platforms : [],
@@ -40428,7 +40978,7 @@ function advertiserNormalizer(record, full) {
40428
40978
  last_synced_at: record.last_synced_at ?? null
40429
40979
  };
40430
40980
  }
40431
- var advertisersCommand2 = defineCommand196({
40981
+ var advertisersCommand2 = defineCommand200({
40432
40982
  meta: {
40433
40983
  name: "advertisers",
40434
40984
  description: 'List corpus advertisers by name or domain. Find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id / winners. Example: baker winning-ads advertisers "Deel" --output md'
@@ -40486,7 +41036,7 @@ var advertisersCommand2 = defineCommand196({
40486
41036
  });
40487
41037
 
40488
41038
  // src/commands/winning-ads/brief.ts
40489
- import { defineCommand as defineCommand197 } from "citty";
41039
+ import { defineCommand as defineCommand201 } from "citty";
40490
41040
  registerSchema({
40491
41041
  command: "winning-ads.brief",
40492
41042
  description: "Generate a creative brief grounded in strategically-similar winning ads. Optionally describe the target creative with --dna (JSON) and steer with --notes.",
@@ -40532,7 +41082,7 @@ function parseDna(raw) {
40532
41082
  }
40533
41083
  return parsed;
40534
41084
  }
40535
- var briefCommand = defineCommand197({
41085
+ var briefCommand = defineCommand201({
40536
41086
  meta: {
40537
41087
  name: "brief",
40538
41088
  description: `Generate a creative brief from winning references. Example: baker winning-ads brief --dna '{"angle":"cost savings"}' --notes "B2B, LinkedIn video" --k 8`
@@ -40568,7 +41118,7 @@ var briefCommand = defineCommand197({
40568
41118
  });
40569
41119
 
40570
41120
  // src/commands/winning-ads/content.ts
40571
- import { defineCommand as defineCommand198 } from "citty";
41121
+ import { defineCommand as defineCommand202 } from "citty";
40572
41122
  registerSchema({
40573
41123
  command: "winning-ads.content",
40574
41124
  description: "Read what's INSIDE one winning ad: the spoken transcript, the on-screen text, and the ad copy. Use this after `search`/`winners`/`feed` return a shortlist \u2014 pass an ad_id to understand a reference before reproducing it. Add --full for speech, pacing, and soundtrack detail. Video ads carry the transcript/on-screen text; static ads carry only the copy.",
@@ -40581,7 +41131,7 @@ registerSchema({
40581
41131
  }
40582
41132
  }
40583
41133
  });
40584
- var contentCommand = defineCommand198({
41134
+ var contentCommand = defineCommand202({
40585
41135
  meta: {
40586
41136
  name: "content",
40587
41137
  description: "Read the transcript + on-screen text + copy of one winning ad. Example: baker winning-ads content adg_123 --platform meta --full --output md"
@@ -40630,7 +41180,7 @@ var contentCommand = defineCommand198({
40630
41180
  });
40631
41181
 
40632
41182
  // src/commands/winning-ads/feed.ts
40633
- import { defineCommand as defineCommand199 } from "citty";
41183
+ import { defineCommand as defineCommand203 } from "citty";
40634
41184
  function buildFeedParams(input) {
40635
41185
  const params = {};
40636
41186
  const advertiser = splitList2(input.advertiser);
@@ -40682,7 +41232,7 @@ registerSchema({
40682
41232
  format: { type: "string", description: "Comma-separated formats to include (e.g. static,video)", required: false }
40683
41233
  }
40684
41234
  });
40685
- var feedCommand = defineCommand199({
41235
+ var feedCommand = defineCommand203({
40686
41236
  meta: {
40687
41237
  name: "feed",
40688
41238
  description: "Winners across every brand you follow (browse, then trim per advertiser). Example: baker winning-ads feed --per-advertiser 5 --output md"
@@ -40767,7 +41317,7 @@ var feedCommand = defineCommand199({
40767
41317
  });
40768
41318
 
40769
41319
  // src/commands/winning-ads/follow.ts
40770
- import { defineCommand as defineCommand200 } from "citty";
41320
+ import { defineCommand as defineCommand204 } from "citty";
40771
41321
  var PLATFORMS = ["meta", "linkedin"];
40772
41322
  registerSchema({
40773
41323
  command: "winning-ads.follow",
@@ -40782,7 +41332,7 @@ registerSchema({
40782
41332
  label: { type: "string", description: "Optional display label (defaults to the resolved name)", required: false }
40783
41333
  }
40784
41334
  });
40785
- var followCommand = defineCommand200({
41335
+ var followCommand = defineCommand204({
40786
41336
  meta: {
40787
41337
  name: "follow",
40788
41338
  description: 'Follow a brand to track ALL its ads \u2014 every platform and country. --platform is how we read your input, not a limit. A domain tracks both Meta + LinkedIn. Example: baker winning-ads follow "deel.com" --platform meta'
@@ -40829,7 +41379,7 @@ var followCommand = defineCommand200({
40829
41379
  });
40830
41380
 
40831
41381
  // src/commands/winning-ads/follow-competitors.ts
40832
- import { defineCommand as defineCommand201 } from "citty";
41382
+ import { defineCommand as defineCommand205 } from "citty";
40833
41383
  var PLATFORMS2 = ["meta", "linkedin"];
40834
41384
  var BATCH_TIMEOUT_MS = 3e5;
40835
41385
  function buildFollowBatchBody(input) {
@@ -40862,7 +41412,7 @@ registerSchema({
40862
41412
  }
40863
41413
  }
40864
41414
  });
40865
- var followCompetitorsCommand = defineCommand201({
41415
+ var followCompetitorsCommand = defineCommand205({
40866
41416
  meta: {
40867
41417
  name: "follow-competitors",
40868
41418
  description: 'Follow many brands at once by domain \u2014 add every competitor in one call. Example: baker winning-ads follow-competitors "deel.com,notion.so,hubspot.com"'
@@ -40937,7 +41487,7 @@ var followCompetitorsCommand = defineCommand201({
40937
41487
  });
40938
41488
 
40939
41489
  // src/commands/winning-ads/following.ts
40940
- import { defineCommand as defineCommand202 } from "citty";
41490
+ import { defineCommand as defineCommand206 } from "citty";
40941
41491
  registerSchema({
40942
41492
  command: "winning-ads.following",
40943
41493
  description: "List the brands you follow in your ad-dna library, with each one's status (ready vs still adding) and cached ad counts.",
@@ -40960,17 +41510,17 @@ function compactFollowed(record) {
40960
41510
  };
40961
41511
  }
40962
41512
  function followingNormalizer(record, full) {
40963
- const compact = compactFollowed(record);
41513
+ const compact2 = compactFollowed(record);
40964
41514
  if (!full) {
40965
- return compact;
41515
+ return compact2;
40966
41516
  }
40967
41517
  return {
40968
- ...compact,
41518
+ ...compact2,
40969
41519
  image_url: record.image_url ?? null,
40970
41520
  platforms: Array.isArray(record.platforms) ? record.platforms : []
40971
41521
  };
40972
41522
  }
40973
- var followingCommand = defineCommand202({
41523
+ var followingCommand = defineCommand206({
40974
41524
  meta: {
40975
41525
  name: "following",
40976
41526
  description: "List brands you follow, with status (ready / adding\u2026) and cached counts. Example: baker winning-ads following --output md"
@@ -41005,7 +41555,7 @@ var followingCommand = defineCommand202({
41005
41555
  });
41006
41556
 
41007
41557
  // src/commands/winning-ads/patterns.ts
41008
- import { defineCommand as defineCommand203 } from "citty";
41558
+ import { defineCommand as defineCommand207 } from "citty";
41009
41559
  registerSchema({
41010
41560
  command: "winning-ads.patterns",
41011
41561
  description: "Mine what separates two cohorts of ads: pass a comma-list of winning ad ids (--winners) and a comma-list of weaker ad ids (--duds). Returns the discriminating DNA fields.",
@@ -41044,7 +41594,7 @@ function discriminatorRow(record) {
41044
41594
  top_values_duds: Array.isArray(record.top_values_b) ? record.top_values_b.join(", ") : ""
41045
41595
  };
41046
41596
  }
41047
- var patternsCommand = defineCommand203({
41597
+ var patternsCommand = defineCommand207({
41048
41598
  meta: {
41049
41599
  name: "patterns",
41050
41600
  description: "Discover what separates winning ads from weak ones. Example: baker winning-ads patterns --winners a_1,a_2,a_3 --duds a_9,a_8 --output md"
@@ -41100,7 +41650,7 @@ var patternsCommand = defineCommand203({
41100
41650
  });
41101
41651
 
41102
41652
  // src/commands/winning-ads/search.ts
41103
- import { defineCommand as defineCommand204 } from "citty";
41653
+ import { defineCommand as defineCommand208 } from "citty";
41104
41654
  registerSchema({
41105
41655
  command: "winning-ads.search",
41106
41656
  description: "Search the ad-dna corpus of scored winning ads. Returns a lean shortlist (advertiser, summary, scores, media_url) to pick a reference to reproduce.",
@@ -41208,7 +41758,7 @@ function buildSearchBody2(args) {
41208
41758
  }
41209
41759
  return body;
41210
41760
  }
41211
- var searchCommand5 = defineCommand204({
41761
+ var searchCommand5 = defineCommand208({
41212
41762
  meta: {
41213
41763
  name: "search",
41214
41764
  description: "Search winning reference ads. Example: baker winning-ads search 'B2B SaaS before/after AI automation' --platform meta --format static --winner-category winner --exclude-advertiser adv_123 --output md"
@@ -41323,7 +41873,7 @@ var searchCommand5 = defineCommand204({
41323
41873
  });
41324
41874
 
41325
41875
  // src/commands/winning-ads/seeds.ts
41326
- import { defineCommand as defineCommand205 } from "citty";
41876
+ import { defineCommand as defineCommand209 } from "citty";
41327
41877
  function leanRow(r) {
41328
41878
  return {
41329
41879
  key: r.key,
@@ -41351,7 +41901,7 @@ function makeSeedCommand(opts) {
41351
41901
  limit: { type: "number", description: "Max keys 1-100 (default 20)", required: false, default: 20 }
41352
41902
  }
41353
41903
  });
41354
- return defineCommand205({
41904
+ return defineCommand209({
41355
41905
  meta: { name: opts.name, description: opts.description },
41356
41906
  args: {
41357
41907
  platform: { type: "string", description: "Single platform to segment on", required: false },
@@ -41400,7 +41950,7 @@ var formatsCommand = makeSeedCommand({
41400
41950
  });
41401
41951
 
41402
41952
  // src/commands/winning-ads/unfollow.ts
41403
- import { defineCommand as defineCommand206 } from "citty";
41953
+ import { defineCommand as defineCommand210 } from "citty";
41404
41954
  registerSchema({
41405
41955
  command: "winning-ads.unfollow",
41406
41956
  description: "Stop following a brand \u2014 removes it from your ad-dna library by advertiser id.",
@@ -41408,7 +41958,7 @@ registerSchema({
41408
41958
  advertiser: { type: "string", description: "Advertiser id to unfollow", required: true }
41409
41959
  }
41410
41960
  });
41411
- var unfollowCommand = defineCommand206({
41961
+ var unfollowCommand = defineCommand210({
41412
41962
  meta: {
41413
41963
  name: "unfollow",
41414
41964
  description: "Stop following a brand by advertiser id. Example: baker winning-ads unfollow adv_123"
@@ -41429,7 +41979,7 @@ var unfollowCommand = defineCommand206({
41429
41979
  });
41430
41980
 
41431
41981
  // src/commands/winning-ads/winners.ts
41432
- import { defineCommand as defineCommand207 } from "citty";
41982
+ import { defineCommand as defineCommand211 } from "citty";
41433
41983
  registerSchema({
41434
41984
  command: "winning-ads.winners",
41435
41985
  description: "Top winning ads for one advertiser id (from `advertisers` or `following`). Returns lean winner cards; add --full for DNA + longevity.",
@@ -41439,7 +41989,7 @@ registerSchema({
41439
41989
  platform: { type: "string", description: "Filter to a single platform: meta|linkedin", required: false }
41440
41990
  }
41441
41991
  });
41442
- var winnersCommand = defineCommand207({
41992
+ var winnersCommand = defineCommand211({
41443
41993
  meta: {
41444
41994
  name: "winners",
41445
41995
  description: "Top winning ads for a specific advertiser id. Example: baker winning-ads winners adv_123 --top 15 --output md"
@@ -41489,7 +42039,7 @@ var winnersCommand = defineCommand207({
41489
42039
  });
41490
42040
 
41491
42041
  // src/commands/winning-ads/index.ts
41492
- var winningAdsCommand = defineCommand208({
42042
+ var winningAdsCommand = defineCommand212({
41493
42043
  meta: {
41494
42044
  name: "winning-ads",
41495
42045
  description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce, and manage the brands your library tracks. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
@@ -41561,7 +42111,7 @@ function getCliVersion() {
41561
42111
  }
41562
42112
 
41563
42113
  // src/cli.ts
41564
- var main = defineCommand209({
42114
+ var main = defineCommand213({
41565
42115
  meta: {
41566
42116
  name: "baker",
41567
42117
  version: getCliVersion(),
@@ -41576,6 +42126,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
41576
42126
  subCommands: {
41577
42127
  capabilities: capabilitiesCommand,
41578
42128
  actions: actionsCommand,
42129
+ agents: agentsCommand,
41579
42130
  "scheduled-actions": scheduledActionsCommand,
41580
42131
  ads: adsCommand2,
41581
42132
  brand: brandCommand,