@koda-sl/baker-cli 0.96.0 → 0.98.0-dev.62be5b016

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
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ AssetRef,
3
4
  ELEVENLABS_MAX_MUSIC_LENGTH_MS,
4
5
  IMAGE_GENERATE_MODELS,
5
6
  MODEL_REGISTRY,
@@ -7,12 +8,13 @@ import {
7
8
  ValidationError,
8
9
  createEngineFromEnv,
9
10
  defaultRegistry,
11
+ extForMime,
10
12
  generateCatalog,
11
13
  validateCanvasDeep
12
- } from "./chunk-RCPMJKI7.js";
14
+ } from "./chunk-IKMDQQ4M.js";
13
15
 
14
16
  // src/cli.ts
15
- import { defineCommand as defineCommand148, runMain } from "citty";
17
+ import { defineCommand as defineCommand149, runMain } from "citty";
16
18
 
17
19
  // src/commands/actions/index.ts
18
20
  import { defineCommand as defineCommand17 } from "citty";
@@ -147,9 +149,9 @@ async function handleResponse(response) {
147
149
  throw new ApiError("INTERNAL_ERROR", "Failed to parse API response as JSON");
148
150
  }
149
151
  }
150
- async function apiGet(path7, params) {
152
+ async function apiGet(path8, params) {
151
153
  const env = getEnv();
152
- const url = new URL(path7, env.BAKER_API_URL);
154
+ const url = new URL(path8, env.BAKER_API_URL);
153
155
  if (params) {
154
156
  const clean = sanitizeParams(params);
155
157
  for (const [key, value] of Object.entries(clean)) {
@@ -174,12 +176,12 @@ async function apiGet(path7, params) {
174
176
  }
175
177
  return handleResponse(response);
176
178
  }
177
- async function apiPost(path7, body, opts) {
179
+ async function apiPost(path8, body, opts) {
178
180
  const env = getEnv();
179
181
  const timeoutMs = opts?.timeoutMs ?? 6e4;
180
182
  let response;
181
183
  try {
182
- response = await fetchWithRateLimitRetry(new URL(path7, env.BAKER_API_URL).toString(), {
184
+ response = await fetchWithRateLimitRetry(new URL(path8, env.BAKER_API_URL).toString(), {
183
185
  method: "POST",
184
186
  headers: {
185
187
  Authorization: `Bearer ${env.BAKER_API_KEY}`,
@@ -483,6 +485,33 @@ var SCHEDULE_SIGNALS = [
483
485
  /\bremind(?:er|s)?\b/i,
484
486
  /\brun\s+at\b/i
485
487
  ];
488
+ var ACTION_PRIORITIES = ["urgent", "high", "medium", "low"];
489
+ function parsePriority(value, { allowClear }) {
490
+ if (value === void 0) {
491
+ return void 0;
492
+ }
493
+ if (typeof value !== "string") {
494
+ failValidation(
495
+ `--priority must be one of: ${ACTION_PRIORITIES.join(", ")}${allowClear ? ", or 'none' to clear" : ""}.`
496
+ );
497
+ }
498
+ const trimmed = value.trim().toLowerCase();
499
+ if (trimmed === "") {
500
+ if (allowClear) {
501
+ return null;
502
+ }
503
+ return void 0;
504
+ }
505
+ if (allowClear && (trimmed === "none" || trimmed === "clear")) {
506
+ return null;
507
+ }
508
+ if (ACTION_PRIORITIES.includes(trimmed)) {
509
+ return trimmed;
510
+ }
511
+ failValidation(
512
+ `Unknown --priority "${value}". Expected one of: ${ACTION_PRIORITIES.join(", ")}${allowClear ? ", or 'none' to clear" : ""}.`
513
+ );
514
+ }
486
515
  function looksScheduled(name, description) {
487
516
  const haystack = `${name}
488
517
  ${description}`;
@@ -570,7 +599,7 @@ var completeCommand = defineCommand2({
570
599
  import { defineCommand as defineCommand3 } from "citty";
571
600
  registerSchema({
572
601
  command: "actions.create",
573
- description: "Stage creation of a new action (applies when the chat is published). Returns a tempId you can use to link in the same draft. Tag the action with --tags (strongly encouraged \u2014 run `baker actions tags list` for the taxonomy). After creating, check if this action blocks or is blocked by other actions and wire dependencies with `baker actions link`.",
602
+ description: "Stage creation of a new action (applies when the chat is published). Returns a tempId you can use to link in the same draft. Pass --tags (REQUIRED \u2014 run `baker actions tags list` for the taxonomy) and --priority (one of urgent|high|medium|low \u2014 drives the dependency-aware 'Do first' ordering). After creating, check if this action blocks or is blocked by other actions and wire dependencies with `baker actions link`.",
574
603
  args: {
575
604
  name: { type: "string", description: "Action name (short, action-verb, \u22646 words)", required: true },
576
605
  description: {
@@ -583,6 +612,11 @@ registerSchema({
583
612
  description: "Comma-separated tag slugs (e.g. google-ads,audit-finding). Must be known \u2014 see `baker actions tags list`.",
584
613
  required: false
585
614
  },
615
+ priority: {
616
+ type: "string",
617
+ description: `User priority for the do-first ordering. One of: ${ACTION_PRIORITIES.join(", ")}.`,
618
+ required: false
619
+ },
586
620
  "temp-id": { type: "string", description: "Custom tempId (auto-generated if omitted)", required: false }
587
621
  }
588
622
  });
@@ -595,6 +629,7 @@ var createCommand = defineCommand3({
595
629
  name: { type: "string", description: "Action name", required: false },
596
630
  description: { type: "string", description: "Description", required: false, default: "" },
597
631
  tags: { type: "string", description: "Comma-separated tag slugs (see `baker actions tags list`)", required: false },
632
+ priority: { type: "string", description: `User priority: ${ACTION_PRIORITIES.join("|")}`, required: false },
598
633
  "temp-id": { type: "string", description: "Optional custom tempId", required: false }
599
634
  },
600
635
  run: async ({ args }) => {
@@ -606,12 +641,14 @@ var createCommand = defineCommand3({
606
641
  const chatId = requireChatId();
607
642
  const tempId = args["temp-id"] || generateTempId();
608
643
  const tags = parseTagList(args.tags);
644
+ const priority = parsePriority(args.priority, { allowClear: false });
609
645
  const response = await apiPost("/api/actions/create", {
610
646
  chatId,
611
647
  tempId,
612
648
  name,
613
649
  description: args.description ?? "",
614
- ...tags ? { tags } : {}
650
+ ...tags ? { tags } : {},
651
+ ...priority !== void 0 && priority !== null ? { priority } : {}
615
652
  });
616
653
  const hints = [];
617
654
  if (looksScheduled(name, args.description ?? "")) {
@@ -625,7 +662,12 @@ var createCommand = defineCommand3({
625
662
  }
626
663
  if (!tags || tags.length === 0) {
627
664
  hints.push(
628
- "Tag this action so it's filterable in the backlog: re-run with --tags <slug,...> (run `baker actions tags list` for the taxonomy, or `baker actions update <tempId> --tags <slug,...>`)."
665
+ "MISSING --tags. This action is invisible to the backlog's tag filter. Re-run with --tags <slug,...> (`baker actions tags list` for the taxonomy, `baker actions tags create --slug <slug>` to mint) \u2014 or `baker actions update <tempId> --tags <slug,...>`."
666
+ );
667
+ }
668
+ if (priority === void 0) {
669
+ hints.push(
670
+ `MISSING --priority. Without it this action ranks as 'normal' (medium) in the do-first ordering, so urgent/high client work won't surface first. Re-run with --priority ${ACTION_PRIORITIES.join("|")} \u2014 or \`baker actions update <tempId> --priority <level>\`.`
629
671
  );
630
672
  }
631
673
  writeJson({ ...response, hints });
@@ -1161,7 +1203,7 @@ var unlinkCommand = defineCommand15({
1161
1203
  import { defineCommand as defineCommand16 } from "citty";
1162
1204
  registerSchema({
1163
1205
  command: "actions.update",
1164
- description: "Stage an update on a claimed action (name, description, and/or tags). Applies on publish. --tags REPLACES the tag set; pass --tags '' to clear all tags. Tags must be known \u2014 see `baker actions tags list`.",
1206
+ description: "Stage an update on a claimed action (name, description, tags, and/or priority). Applies on publish. --tags REPLACES the tag set; pass --tags '' to clear. --priority accepts urgent|high|medium|low or 'none' to clear back to unset (== normal).",
1165
1207
  args: {
1166
1208
  id: { type: "string", description: "Action ID (must be claimed by current chat)", required: true },
1167
1209
  name: { type: "string", description: "New name", required: false },
@@ -1170,6 +1212,11 @@ registerSchema({
1170
1212
  type: "string",
1171
1213
  description: "Comma-separated tag slugs \u2014 REPLACES existing tags ('' clears)",
1172
1214
  required: false
1215
+ },
1216
+ priority: {
1217
+ type: "string",
1218
+ description: `User priority: ${ACTION_PRIORITIES.join("|")}, or 'none' to clear.`,
1219
+ required: false
1173
1220
  }
1174
1221
  }
1175
1222
  });
@@ -1183,7 +1230,8 @@ var updateCommand = defineCommand16({
1183
1230
  "action-id": { type: "string", description: "Action ID", required: false },
1184
1231
  name: { type: "string", description: "New name", required: false },
1185
1232
  description: { type: "string", description: "New description", required: false },
1186
- tags: { type: "string", description: "Comma-separated tag slugs \u2014 REPLACES existing ('' clears)", required: false }
1233
+ tags: { type: "string", description: "Comma-separated tag slugs \u2014 REPLACES existing ('' clears)", required: false },
1234
+ priority: { type: "string", description: `Priority: ${ACTION_PRIORITIES.join("|")}|none`, required: false }
1187
1235
  },
1188
1236
  run: async ({ args }) => {
1189
1237
  try {
@@ -1193,8 +1241,9 @@ var updateCommand = defineCommand16({
1193
1241
  }
1194
1242
  validateConvexId(id);
1195
1243
  const tags = parseTagList(args.tags);
1196
- if (args.name === void 0 && args.description === void 0 && tags === void 0) {
1197
- failValidation("Provide at least one of --name, --description, --tags.");
1244
+ const priority = parsePriority(args.priority, { allowClear: true });
1245
+ if (args.name === void 0 && args.description === void 0 && tags === void 0 && priority === void 0) {
1246
+ failValidation("Provide at least one of --name, --description, --tags, --priority.");
1198
1247
  }
1199
1248
  const chatId = requireChatId();
1200
1249
  await apiPost("/api/actions/update", {
@@ -1202,7 +1251,8 @@ var updateCommand = defineCommand16({
1202
1251
  actionId: id,
1203
1252
  name: args.name,
1204
1253
  description: args.description,
1205
- ...tags !== void 0 ? { tags } : {}
1254
+ ...tags !== void 0 ? { tags } : {},
1255
+ ...priority !== void 0 ? { priority } : {}
1206
1256
  });
1207
1257
  writeOk();
1208
1258
  } catch (err) {
@@ -1279,31 +1329,31 @@ function cachePath(category, key) {
1279
1329
  return join(dir, `${hashKey(key)}.json`);
1280
1330
  }
1281
1331
  function cacheGet(category, key) {
1282
- const path7 = cachePath(category, key);
1283
- if (!existsSync(path7)) {
1332
+ const path8 = cachePath(category, key);
1333
+ if (!existsSync(path8)) {
1284
1334
  return null;
1285
1335
  }
1286
1336
  try {
1287
- const raw = readFileSync(path7, "utf-8");
1337
+ const raw = readFileSync(path8, "utf-8");
1288
1338
  const entry = JSON.parse(raw);
1289
1339
  if (entry.expiresAt < Date.now()) {
1290
- rmSync(path7, { force: true });
1340
+ rmSync(path8, { force: true });
1291
1341
  return null;
1292
1342
  }
1293
1343
  return entry;
1294
1344
  } catch {
1295
- rmSync(path7, { force: true });
1345
+ rmSync(path8, { force: true });
1296
1346
  return null;
1297
1347
  }
1298
1348
  }
1299
1349
  function cacheSet(category, key, data, ttlMs, fields) {
1300
- const path7 = cachePath(category, key);
1350
+ const path8 = cachePath(category, key);
1301
1351
  const entry = {
1302
1352
  expiresAt: Date.now() + ttlMs,
1303
1353
  data,
1304
1354
  fields
1305
1355
  };
1306
- writeFileSync(path7, JSON.stringify(entry), "utf-8");
1356
+ writeFileSync(path8, JSON.stringify(entry), "utf-8");
1307
1357
  }
1308
1358
  var HOUR = 60 * 60 * 1e3;
1309
1359
  var MINUTE = 60 * 1e3;
@@ -7997,7 +8047,7 @@ Examples:
7997
8047
  });
7998
8048
 
7999
8049
  // src/commands/canvas/index.ts
8000
- import { defineCommand as defineCommand84 } from "citty";
8050
+ import { defineCommand as defineCommand85 } from "citty";
8001
8051
 
8002
8052
  // src/commands/canvas/catalog.ts
8003
8053
  import { defineCommand as defineCommand78 } from "citty";
@@ -8013,14 +8063,232 @@ var catalogCommand = defineCommand78({
8013
8063
  }
8014
8064
  });
8015
8065
 
8066
+ // src/commands/canvas/gallery.ts
8067
+ import { readdir, readFile } from "fs/promises";
8068
+ import path from "path";
8069
+ import { defineCommand as defineCommand79 } from "citty";
8070
+
8071
+ // src/engine/gallery/descriptor.ts
8072
+ var KNOWN_RATIOS = [
8073
+ ["9:16", 9 / 16],
8074
+ ["4:5", 4 / 5],
8075
+ ["1:1", 1],
8076
+ ["1.91:1", 1.91],
8077
+ ["16:9", 16 / 9],
8078
+ ["4:1", 4]
8079
+ ];
8080
+ var RATIO_TOLERANCE = 0.06;
8081
+ function aspectLabel(width, height) {
8082
+ if (!width || !height) {
8083
+ return "other";
8084
+ }
8085
+ const ratio = width / height;
8086
+ let best = "other";
8087
+ let bestErr = Number.POSITIVE_INFINITY;
8088
+ for (const [label, value] of KNOWN_RATIOS) {
8089
+ const err = Math.abs(ratio - value) / value;
8090
+ if (err < bestErr) {
8091
+ bestErr = err;
8092
+ best = label;
8093
+ }
8094
+ }
8095
+ return bestErr <= RATIO_TOLERANCE ? best : `${width}x${height}`;
8096
+ }
8097
+ function visualRef(value) {
8098
+ const parsed = AssetRef.safeParse(value);
8099
+ if (!parsed.success) {
8100
+ return null;
8101
+ }
8102
+ if (parsed.data.kind !== "image" && parsed.data.kind !== "video") {
8103
+ return null;
8104
+ }
8105
+ return parsed.data;
8106
+ }
8107
+ function deliverableFor(ref, stem, resolveLocal) {
8108
+ const width = "width" in ref ? ref.width : void 0;
8109
+ const height = "height" in ref ? ref.height : void 0;
8110
+ return {
8111
+ kind: ref.kind,
8112
+ format: aspectLabel(width, height),
8113
+ // Remote-node outputs already carry a public R2 url; local composites are
8114
+ // resolved against the mounted run dir's public base.
8115
+ url: ref.url ?? resolveLocal(`${stem}.${extForMime(ref.mime)}`),
8116
+ width,
8117
+ height,
8118
+ label: stem
8119
+ };
8120
+ }
8121
+ function deliverablesFromOutput(output, resolveLocal) {
8122
+ if (Array.isArray(output)) {
8123
+ const out = [];
8124
+ output.forEach((entry, i) => {
8125
+ const ref2 = visualRef(entry);
8126
+ if (ref2) {
8127
+ out.push(deliverableFor(ref2, `_final__${i}`, resolveLocal));
8128
+ }
8129
+ });
8130
+ return out;
8131
+ }
8132
+ const ref = visualRef(output);
8133
+ return ref ? [deliverableFor(ref, "_final", resolveLocal)] : [];
8134
+ }
8135
+ function buildGeneration(runId, manifest, resolveLocal) {
8136
+ const m = manifest ?? {};
8137
+ const credits = typeof m.stats?.total_credits === "number" ? m.stats.total_credits : 0;
8138
+ return {
8139
+ runId,
8140
+ createdAt: typeof m.completed_at === "number" ? m.completed_at : 0,
8141
+ credits,
8142
+ deliverables: deliverablesFromOutput(m.output, resolveLocal)
8143
+ };
8144
+ }
8145
+ function buildGalleryDescriptor(input) {
8146
+ const generations = [...input.generations].sort((a, b) => b.createdAt - a.createdAt);
8147
+ return {
8148
+ slug: input.slug,
8149
+ title: input.definition.title,
8150
+ platform: input.definition.platform,
8151
+ status: input.definition.status,
8152
+ reference: input.definition.reference,
8153
+ selectedRun: input.definition.selectedRun,
8154
+ generations
8155
+ };
8156
+ }
8157
+ function titleFromSlug(slug) {
8158
+ return slug.split(/[-_/]+/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
8159
+ }
8160
+ function stripQuotes(raw) {
8161
+ const trimmed = raw.trim();
8162
+ if (trimmed.startsWith('"') && trimmed.endsWith('"') || trimmed.startsWith("'") && trimmed.endsWith("'")) {
8163
+ return trimmed.slice(1, -1);
8164
+ }
8165
+ return trimmed;
8166
+ }
8167
+ function parseInlineList(raw) {
8168
+ return raw.slice(1, -1).split(",").map((item) => stripQuotes(item)).filter(Boolean);
8169
+ }
8170
+ function parseFrontmatter(markdown) {
8171
+ const match = markdown.match(/^---\r?\n([\s\S]*?)\r?\n---/);
8172
+ const block = match?.[1];
8173
+ if (!block) {
8174
+ return {};
8175
+ }
8176
+ const out = {};
8177
+ let listKey = null;
8178
+ for (const line of block.split(/\r?\n/)) {
8179
+ const item = line.match(/^\s+-\s+(.*)$/)?.[1];
8180
+ if (listKey && item !== void 0) {
8181
+ out[listKey].push(stripQuotes(item));
8182
+ continue;
8183
+ }
8184
+ const kv = line.match(/^([A-Za-z0-9_]+):\s*(.*)$/);
8185
+ if (!kv?.[1]) {
8186
+ continue;
8187
+ }
8188
+ listKey = null;
8189
+ const key = kv[1];
8190
+ const value = (kv[2] ?? "").trim();
8191
+ if (value === "") {
8192
+ out[key] = [];
8193
+ listKey = key;
8194
+ } else if (value.startsWith("[") && value.endsWith("]")) {
8195
+ out[key] = parseInlineList(value);
8196
+ } else {
8197
+ out[key] = stripQuotes(value);
8198
+ }
8199
+ }
8200
+ return out;
8201
+ }
8202
+ function asString(value) {
8203
+ if (typeof value === "string" && value.length > 0) {
8204
+ return value;
8205
+ }
8206
+ return void 0;
8207
+ }
8208
+ function asList(value) {
8209
+ if (Array.isArray(value)) {
8210
+ return value;
8211
+ }
8212
+ return typeof value === "string" && value.length > 0 ? [value] : [];
8213
+ }
8214
+ function parseCreativeDefinition(markdown, slug) {
8215
+ const fm = parseFrontmatter(markdown);
8216
+ return {
8217
+ title: asString(fm.title) ?? titleFromSlug(slug),
8218
+ platform: asList(fm.platform),
8219
+ formats: asList(fm.formats),
8220
+ status: asString(fm.status) ?? "draft",
8221
+ reference: asString(fm.reference),
8222
+ selectedRun: asString(fm.selected_run)
8223
+ };
8224
+ }
8225
+
8226
+ // src/commands/canvas/gallery.ts
8227
+ async function readJson(file) {
8228
+ try {
8229
+ return JSON.parse(await readFile(file, "utf8"));
8230
+ } catch {
8231
+ return null;
8232
+ }
8233
+ }
8234
+ async function listRunDirs(runsDir) {
8235
+ try {
8236
+ const entries = await readdir(runsDir, { withFileTypes: true });
8237
+ return entries.filter((e) => e.isDirectory()).map((e) => e.name);
8238
+ } catch {
8239
+ return [];
8240
+ }
8241
+ }
8242
+ var galleryCommand = defineCommand79({
8243
+ meta: {
8244
+ name: "gallery",
8245
+ description: "Read a creative's _definition.md + every persisted run manifest and emit the gallery descriptor (JSON) the dashboard renders."
8246
+ },
8247
+ args: {
8248
+ dir: { type: "positional", required: true, description: "Creative folder, e.g. src/creatives/<slug>" },
8249
+ "workspace-dir": { type: "string", description: "R2-mounted workspace root (default ./.creatives-workspace)" },
8250
+ "public-url": { type: "string", description: "R2 public base (default $R2_PUBLIC_URL)" },
8251
+ "company-id": { type: "string", description: "Company id for the R2 prefix (default $BAKER_COMPANY_ID)" }
8252
+ },
8253
+ async run({ args }) {
8254
+ const creativeDir = path.resolve(String(args.dir));
8255
+ const slug = path.basename(creativeDir);
8256
+ const workspaceDir = path.resolve(String(args["workspace-dir"] ?? ".creatives-workspace"));
8257
+ const runsDir = path.join(workspaceDir, slug, "runs");
8258
+ const runtimeEnv = process.env;
8259
+ const publicUrl = (args["public-url"] ?? runtimeEnv.R2_PUBLIC_URL ?? "").replace(/\/+$/, "");
8260
+ const companyId = String(args["company-id"] ?? runtimeEnv.BAKER_COMPANY_ID ?? "");
8261
+ const definitionPath = path.join(creativeDir, "_definition.md");
8262
+ let definitionMd = "";
8263
+ try {
8264
+ definitionMd = await readFile(definitionPath, "utf8");
8265
+ } catch {
8266
+ }
8267
+ const definition = parseCreativeDefinition(definitionMd, slug);
8268
+ const generations = [];
8269
+ for (const runId of await listRunDirs(runsDir)) {
8270
+ const manifest = await readJson(path.join(runsDir, runId, "manifest.json"));
8271
+ if (!manifest) {
8272
+ continue;
8273
+ }
8274
+ const runDir = path.join(runsDir, runId);
8275
+ const resolveLocal = (filename) => publicUrl && companyId ? `${publicUrl}/creatives/${companyId}/${slug}/runs/${runId}/${filename}` : path.join(runDir, filename);
8276
+ generations.push(buildGeneration(runId, manifest, resolveLocal));
8277
+ }
8278
+ const descriptor = buildGalleryDescriptor({ slug, definition, generations });
8279
+ process.stdout.write(`${JSON.stringify({ ok: true, descriptor }, null, 2)}
8280
+ `);
8281
+ }
8282
+ });
8283
+
8016
8284
  // src/commands/canvas/inspect.ts
8017
8285
  import { execFile } from "child_process";
8018
- import { readdir, readFile, stat } from "fs/promises";
8019
- import path from "path";
8286
+ import { readdir as readdir2, readFile as readFile2, stat } from "fs/promises";
8287
+ import path2 from "path";
8020
8288
  import { promisify } from "util";
8021
- import { defineCommand as defineCommand79 } from "citty";
8289
+ import { defineCommand as defineCommand80 } from "citty";
8022
8290
  var execFileAsync = promisify(execFile);
8023
- var inspectCommand = defineCommand79({
8291
+ var inspectCommand = defineCommand80({
8024
8292
  meta: {
8025
8293
  name: "inspect",
8026
8294
  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."
@@ -8034,7 +8302,7 @@ var inspectCommand = defineCommand79({
8034
8302
  }
8035
8303
  },
8036
8304
  async run({ args }) {
8037
- const outputsDir = path.resolve(String(args["outputs-dir"] ?? "canvas"));
8305
+ const outputsDir = path2.resolve(String(args["outputs-dir"] ?? "canvas"));
8038
8306
  const runArg = String(args.run);
8039
8307
  const runDir = await resolveRunDir(runArg, outputsDir);
8040
8308
  const manifest = await loadManifest(runDir);
@@ -8046,7 +8314,7 @@ var inspectCommand = defineCommand79({
8046
8314
  }
8047
8315
  const summary = {
8048
8316
  ok: true,
8049
- run_id: manifest.run_id ?? path.basename(runDir),
8317
+ run_id: manifest.run_id ?? path2.basename(runDir),
8050
8318
  run_dir: runDir,
8051
8319
  stats: manifest.stats ?? null,
8052
8320
  output: manifest.output ?? null,
@@ -8059,20 +8327,20 @@ var inspectCommand = defineCommand79({
8059
8327
  }
8060
8328
  });
8061
8329
  async function resolveRunDir(run, outputsDir) {
8062
- if (path.isAbsolute(run)) {
8330
+ if (path2.isAbsolute(run)) {
8063
8331
  const s2 = await stat(run).catch(() => null);
8064
8332
  if (s2?.isDirectory()) return run;
8065
8333
  throw new Error(`inspect: ${run} is not a directory`);
8066
8334
  }
8067
- const candidate = path.join(outputsDir, run);
8335
+ const candidate = path2.join(outputsDir, run);
8068
8336
  const s = await stat(candidate).catch(() => null);
8069
8337
  if (s?.isDirectory()) return candidate;
8070
8338
  throw new Error(`inspect: no run directory at ${candidate}`);
8071
8339
  }
8072
8340
  async function loadManifest(runDir) {
8073
- const manifestPath = path.join(runDir, "manifest.json");
8341
+ const manifestPath = path2.join(runDir, "manifest.json");
8074
8342
  try {
8075
- const raw = await readFile(manifestPath, "utf-8");
8343
+ const raw = await readFile2(manifestPath, "utf-8");
8076
8344
  return JSON.parse(raw);
8077
8345
  } catch {
8078
8346
  return {};
@@ -8080,9 +8348,9 @@ async function loadManifest(runDir) {
8080
8348
  }
8081
8349
  async function listRunFiles(runDir) {
8082
8350
  const out = [];
8083
- const names = await readdir(runDir);
8351
+ const names = await readdir2(runDir);
8084
8352
  for (const name of names) {
8085
- const abs = path.join(runDir, name);
8353
+ const abs = path2.join(runDir, name);
8086
8354
  const s = await stat(abs).catch(() => null);
8087
8355
  if (!s?.isFile()) continue;
8088
8356
  out.push({ name, path: abs, size: s.size });
@@ -8127,9 +8395,9 @@ async function probeDuration(filePath) {
8127
8395
  }
8128
8396
 
8129
8397
  // src/commands/canvas/run.ts
8130
- import { readFile as readFile2 } from "fs/promises";
8131
- import path2 from "path";
8132
- import { defineCommand as defineCommand80 } from "citty";
8398
+ import { readFile as readFile3 } from "fs/promises";
8399
+ import path3 from "path";
8400
+ import { defineCommand as defineCommand81 } from "citty";
8133
8401
 
8134
8402
  // src/commands/canvas/placeholders.ts
8135
8403
  function unsuppliedPlaceholderAssets(canvas) {
@@ -8148,7 +8416,7 @@ function unsuppliedPlaceholderAssets(canvas) {
8148
8416
  }
8149
8417
 
8150
8418
  // src/commands/canvas/run.ts
8151
- var runCommand = defineCommand80({
8419
+ var runCommand = defineCommand81({
8152
8420
  meta: { name: "run", description: "Validate and execute a canvas JSON file." },
8153
8421
  args: {
8154
8422
  file: { type: "positional", required: true, description: "Path to canvas JSON" },
@@ -8158,8 +8426,8 @@ var runCommand = defineCommand80({
8158
8426
  "cache-policy": { type: "string", description: "read_write | bypass | read_only" }
8159
8427
  },
8160
8428
  async run({ args }) {
8161
- const filePath = path2.resolve(String(args.file));
8162
- const raw = await readFile2(filePath, "utf8");
8429
+ const filePath = path3.resolve(String(args.file));
8430
+ const raw = await readFile3(filePath, "utf8");
8163
8431
  let parsed;
8164
8432
  try {
8165
8433
  parsed = JSON.parse(raw);
@@ -8231,9 +8499,9 @@ var runCommand = defineCommand80({
8231
8499
  });
8232
8500
 
8233
8501
  // src/commands/canvas/scaffold-static-ad.ts
8234
- import { readFile as readFile3, writeFile } from "fs/promises";
8235
- import path3 from "path";
8236
- import { defineCommand as defineCommand81 } from "citty";
8502
+ import { readFile as readFile4, writeFile } from "fs/promises";
8503
+ import path4 from "path";
8504
+ import { defineCommand as defineCommand82 } from "citty";
8237
8505
 
8238
8506
  // src/engine/scaffold/staticAd.ts
8239
8507
  import { z as z2 } from "zod";
@@ -8446,7 +8714,7 @@ var SELECT_SYSTEM = 'You identify the MAIN, identity-critical visual elements of
8446
8714
  var SELECT_PROMPT = 'AD BLUEPRINT (from image_describe):\n{{blueprint}}\n\nFrom this blueprint, list ONLY the elements that are prominent, important, and identity-bearing \u2014 the ones a reproduction must ground in a real asset:\n- the brand logo/wordmark (from brands_logos with function_in_image = advertiser_brand) -> type "logo"\n- trust/rating/certification/app-store/review badges (brands_logos with function_in_image = trust_badge | review_platform | certification_or_seal | app_store_badge | payment_method) -> type "badge"\n- a showcased/hero product or package (a foreground entry in subjects that the ad is selling) -> type "product"\n- a foreground person whose identity matters (from people) -> type "person"\n- a foreground animal/character with a specific expression (from subjects) -> type "animal"\n\nDROP background extras, decorative props, generic scenery, and anything small or incidental. Keep at most ~6. If there are none, return an empty list.\n\nFor each kept element return: { "type": one of logo|product|person|animal|badge, "label": a short UPPER_SNAKE_CASE name (e.g. LOGO, PRODUCT, HERO_DOG, TRUSTPILOT), "description": a concrete reusable description to source/shoot the real asset (include the exact expression for a living subject), "expression": the facial expression for a living subject or null, "reason": why it is identity-critical, "locator": the blueprint entry this element came from as { "collection": one of "subjects" | "people" | "brands_logos", "index": its 0-based position in that array } (people -> people; logos/badges -> brands_logos; products/animals/objects -> subjects). Output ONLY the JSON object.';
8447
8715
  async function loadAssetText(ref, label) {
8448
8716
  const r = ref;
8449
- if (typeof r?.path === "string") return readFile3(r.path, "utf8");
8717
+ if (typeof r?.path === "string") return readFile4(r.path, "utf8");
8450
8718
  if (typeof r?.url === "string") {
8451
8719
  const res = await fetch(r.url);
8452
8720
  if (!res.ok) throw new Error(`failed to fetch ${label} (${res.status})`);
@@ -8552,7 +8820,7 @@ async function runVisionPasses(canvas) {
8552
8820
  return fail("read_outputs", e instanceof Error ? e.message : String(e));
8553
8821
  }
8554
8822
  }
8555
- var scaffoldStaticAdCommand = defineCommand81({
8823
+ var scaffoldStaticAdCommand = defineCommand82({
8556
8824
  meta: {
8557
8825
  name: "scaffold-static-ad",
8558
8826
  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. Edit prompt.json and drop the real assets, then `baker canvas run` it."
@@ -8569,10 +8837,10 @@ var scaffoldStaticAdCommand = defineCommand81({
8569
8837
  "skip-font": { type: "boolean", description: "Skip the brand-font \u2192 type-specimen slot" }
8570
8838
  },
8571
8839
  async run({ args }) {
8572
- const imagePath = path3.resolve(String(args.file));
8573
- const outPath = args.out ? path3.resolve(String(args.out)) : path3.join(path3.dirname(imagePath), "static-ad.canvas.json");
8574
- const outDir = path3.dirname(outPath);
8575
- const blueprintPath = path3.join(outDir, "prompt.json");
8840
+ const imagePath = path4.resolve(String(args.file));
8841
+ const outPath = args.out ? path4.resolve(String(args.out)) : path4.join(path4.dirname(imagePath), "static-ad.canvas.json");
8842
+ const outDir = path4.dirname(outPath);
8843
+ const blueprintPath = path4.join(outDir, "prompt.json");
8576
8844
  const { describeModel, selectModel, layoutModel, genModel } = resolveModels(args);
8577
8845
  const describeCanvas = buildDescribeCanvas(
8578
8846
  imagePath,
@@ -8629,7 +8897,7 @@ var scaffoldStaticAdCommand = defineCommand81({
8629
8897
  run_estimated_credits: validation.estimatedCredits
8630
8898
  },
8631
8899
  checklist: {
8632
- edit_prompt: `Edit ${path3.basename(blueprintPath)} \u2014 it is the blueprint generated from your image; rewrite it into the ad you want (palette, copy, claims, subjects). It feeds the generator directly.`,
8900
+ edit_prompt: `Edit ${path4.basename(blueprintPath)} \u2014 it is the blueprint generated from your image; rewrite it into the ad you want (palette, copy, claims, subjects). It feeds the generator directly.`,
8633
8901
  assets_to_supply: report.elements,
8634
8902
  font_slot: report.includes_font ? "Drop a brand font at the [TODO] brandfont path, or delete the brandfont + type_ref nodes to skip it." : "skipped (--skip-font)",
8635
8903
  note: "Replace every [TODO] ingest path with a real file, then `baker canvas validate` and `baker canvas run`. Running generates a billed image \u2014 it is not free."
@@ -8644,13 +8912,13 @@ var scaffoldStaticAdCommand = defineCommand81({
8644
8912
  });
8645
8913
 
8646
8914
  // src/commands/canvas/scaffold-video.ts
8647
- import { cp, mkdir, readFile as readFile5, writeFile as writeFile2 } from "fs/promises";
8648
- import path5 from "path";
8649
- import { defineCommand as defineCommand82 } from "citty";
8915
+ import { cp, mkdir, readFile as readFile6, writeFile as writeFile2 } from "fs/promises";
8916
+ import path6 from "path";
8917
+ import { defineCommand as defineCommand83 } from "citty";
8650
8918
 
8651
8919
  // src/engine/nodes/local/lib/sceneDetect.ts
8652
8920
  import { execFile as execFile2 } from "child_process";
8653
- import { mkdtemp, readdir as readdir2, readFile as readFile4, rm } from "fs/promises";
8921
+ import { mkdtemp, readdir as readdir3, readFile as readFile5, rm } from "fs/promises";
8654
8922
  import { tmpdir } from "os";
8655
8923
  import { join as join2 } from "path";
8656
8924
  import { promisify as promisify2 } from "util";
@@ -8714,9 +8982,9 @@ async function runSceneDetectOnce(filePath, threshold, minSceneLenS, timeoutMs)
8714
8982
  ],
8715
8983
  { encoding: "utf-8", maxBuffer: 32 * 1024 * 1024, timeout: timeoutMs }
8716
8984
  );
8717
- const csvName = (await readdir2(outDir)).find((f) => f.toLowerCase().endsWith(".csv"));
8985
+ const csvName = (await readdir3(outDir)).find((f) => f.toLowerCase().endsWith(".csv"));
8718
8986
  if (!csvName) return [];
8719
- return parsePySceneDetectCsvCuts(await readFile4(join2(outDir, csvName), "utf-8"));
8987
+ return parsePySceneDetectCsvCuts(await readFile5(join2(outDir, csvName), "utf-8"));
8720
8988
  } finally {
8721
8989
  await rm(outDir, { recursive: true, force: true });
8722
8990
  }
@@ -11106,18 +11374,18 @@ function videoReport(input, elementsInput) {
11106
11374
 
11107
11375
  // src/commands/canvas/composition-path.ts
11108
11376
  import { existsSync as existsSync3 } from "fs";
11109
- import path4 from "path";
11377
+ import path5 from "path";
11110
11378
  function resolveShippedCanvasDir(name, startDir, exists = existsSync3, maxDepth = 8) {
11111
- const rel = path4.join("canvas", name);
11379
+ const rel = path5.join("canvas", name);
11112
11380
  let dir = startDir;
11113
11381
  for (let i = 0; i < maxDepth; i++) {
11114
- const candidate = path4.join(dir, rel);
11115
- if (exists(path4.join(candidate, "meta.json"))) return candidate;
11116
- const parent = path4.dirname(dir);
11382
+ const candidate = path5.join(dir, rel);
11383
+ if (exists(path5.join(candidate, "meta.json"))) return candidate;
11384
+ const parent = path5.dirname(dir);
11117
11385
  if (parent === dir) break;
11118
11386
  dir = parent;
11119
11387
  }
11120
- return path4.resolve(startDir, "../../../", rel);
11388
+ return path5.resolve(startDir, "../../../", rel);
11121
11389
  }
11122
11390
 
11123
11391
  // src/commands/canvas/scaffold-video.ts
@@ -11146,7 +11414,7 @@ ONE PERSON, MULTIPLE LOOKS: if a single individual plays MULTIPLE personas or wa
11146
11414
  For each kept element return: { "type": one of person|animal|product|logo|badge|location, "label": a short UPPER_SNAKE_CASE name (e.g. HERO, CREATOR_SKEPTIC, INSURANCE_CARD, LOGO), "description": a concrete reusable description to source/shoot the real asset \u2014 for a person/animal give a NEUTRAL castable role (e.g. "hero pet-owner, woman in her 30s" or "a small beagle"), NOT the original individual's literal face/identity: we RECAST with a FRESH person/animal, so never tell the agent to reuse the original. "expression": a living subject's typical expression or null, "cast_id": the global.cast id if it maps to one else null, "same_as": the label of another element this is the SAME individual as (different wardrobe/persona) else null, "scenes": the 0-based indices of ONLY the scenes where the element is ACTUALLY VISIBLE ON SCREEN \u2014 judged from that scene's start_frame_prompt / end_frame_prompt subjects and its action_detail, NOT from who is merely speaking. A narrator heard over b-roll is NOT present in that b-roll scene; a dog-running cutaway does NOT contain the couch creator just because she talks across it. Do NOT pad the list \u2014 an element wrongly listed in a scene makes the reproduction render the wrong subject there (e.g. the creator appearing in a pure-dog b-roll). When in doubt, leave a scene OUT. Output ONLY the JSON object.`;
11147
11415
  async function loadAssetText2(ref, label) {
11148
11416
  const r = ref;
11149
- if (typeof r?.path === "string") return readFile5(r.path, "utf8");
11417
+ if (typeof r?.path === "string") return readFile6(r.path, "utf8");
11150
11418
  if (typeof r?.url === "string") {
11151
11419
  const res = await fetch(r.url);
11152
11420
  if (!res.ok) throw new Error(`failed to fetch ${label} (${res.status})`);
@@ -11165,7 +11433,7 @@ async function loadTranscriptBestEffort(ref) {
11165
11433
  async function stageCaptions(outDir, transcript) {
11166
11434
  const text = transcript?.trim();
11167
11435
  if (!text || text === "[]") return {};
11168
- const compositionPath = path5.join(outDir, "tiktok-captions-composition");
11436
+ const compositionPath = path6.join(outDir, "tiktok-captions-composition");
11169
11437
  await cp(SHIPPED_CAPTIONS_DIR, compositionPath, { recursive: true });
11170
11438
  return { compositionPath };
11171
11439
  }
@@ -11297,7 +11565,7 @@ async function runAnalysisPasses(deconstructCanvas, selectModel) {
11297
11565
  return fail2("deconstruct", e instanceof Error ? e.message : String(e));
11298
11566
  }
11299
11567
  }
11300
- var scaffoldVideoCommand = defineCommand82({
11568
+ var scaffoldVideoCommand = defineCommand83({
11301
11569
  meta: {
11302
11570
  name: "scaffold-video",
11303
11571
  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 prompt.json as the editable 'prompt') 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 prompt.json, drop the real source images, then `baker canvas run`."
@@ -11327,11 +11595,11 @@ var scaffoldVideoCommand = defineCommand82({
11327
11595
  }
11328
11596
  },
11329
11597
  async run({ args }) {
11330
- const videoPath = path5.resolve(String(args.file));
11331
- const base = path5.basename(videoPath, path5.extname(videoPath));
11332
- const outPath = args.out ? path5.resolve(String(args.out)) : path5.join(path5.dirname(videoPath), `${base}.video.canvas.json`);
11333
- const outDir = path5.dirname(outPath);
11334
- const blueprintPath = path5.join(outDir, "prompt.json");
11598
+ const videoPath = path6.resolve(String(args.file));
11599
+ const base = path6.basename(videoPath, path6.extname(videoPath));
11600
+ const outPath = args.out ? path6.resolve(String(args.out)) : path6.join(path6.dirname(videoPath), `${base}.video.canvas.json`);
11601
+ const outDir = path6.dirname(outPath);
11602
+ const blueprintPath = path6.join(outDir, "prompt.json");
11335
11603
  const frames = args.frames === "reuse" ? "reuse" : "generate";
11336
11604
  const maxScenes = args["max-scenes"] ? Number(args["max-scenes"]) : void 0;
11337
11605
  if (Number.isFinite(maxScenes)) {
@@ -11354,11 +11622,11 @@ var scaffoldVideoCommand = defineCommand82({
11354
11622
  const annotated = annotateBlueprintWithElements(blueprint, elements);
11355
11623
  await writeFile2(blueprintPath, `${JSON.stringify(annotated, null, 2)}
11356
11624
  `, "utf8");
11357
- const compositionDest = path5.join(outDir, "video-overlay-composition");
11625
+ const compositionDest = path6.join(outDir, "video-overlay-composition");
11358
11626
  await cp(SHIPPED_COMPOSITION_DIR, compositionDest, { recursive: true });
11359
- const indexPath = path5.join(compositionDest, "index.html");
11627
+ const indexPath = path6.join(compositionDest, "index.html");
11360
11628
  const overlayHtml = buildOverlayHtml(blueprint);
11361
- const indexHtml = await readFile5(indexPath, "utf8");
11629
+ const indexHtml = await readFile6(indexPath, "utf8");
11362
11630
  const injected = indexHtml.replace("<!--OVERLAYS-->", () => overlayHtml);
11363
11631
  if (injected === indexHtml && overlayHtml.trim()) {
11364
11632
  fail2(
@@ -11413,7 +11681,7 @@ var scaffoldVideoCommand = defineCommand82({
11413
11681
  run_estimated_credits: validation.estimatedCredits
11414
11682
  },
11415
11683
  checklist: {
11416
- edit_prompt: `Edit ${path5.basename(blueprintPath)} \u2014 the blueprint deconstructed from your video; rewrite it into the ad you want (cast, palette, copy, claims). Every scene frame reads it via target_blueprint.`,
11684
+ edit_prompt: `Edit ${path6.basename(blueprintPath)} \u2014 the blueprint deconstructed from your video; rewrite it into the ad you want (cast, palette, copy, claims). Every scene frame reads it via target_blueprint.`,
11417
11685
  recurring_elements_to_supply: report.elements,
11418
11686
  voices_to_confirm: report.dialogue.map((d) => ({
11419
11687
  scene: d.scene,
@@ -11439,18 +11707,18 @@ var scaffoldVideoCommand = defineCommand82({
11439
11707
  });
11440
11708
 
11441
11709
  // src/commands/canvas/validate.ts
11442
- import { readFile as readFile6 } from "fs/promises";
11443
- import path6 from "path";
11444
- import { defineCommand as defineCommand83 } from "citty";
11445
- var validateCommand = defineCommand83({
11710
+ import { readFile as readFile7 } from "fs/promises";
11711
+ import path7 from "path";
11712
+ import { defineCommand as defineCommand84 } from "citty";
11713
+ var validateCommand = defineCommand84({
11446
11714
  meta: {
11447
11715
  name: "validate",
11448
11716
  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)."
11449
11717
  },
11450
11718
  args: { file: { type: "positional", required: true, description: "Path to canvas JSON" } },
11451
11719
  async run({ args }) {
11452
- const filePath = path6.resolve(String(args.file));
11453
- const raw = await readFile6(filePath, "utf8");
11720
+ const filePath = path7.resolve(String(args.file));
11721
+ const raw = await readFile7(filePath, "utf8");
11454
11722
  let parsed;
11455
11723
  try {
11456
11724
  parsed = JSON.parse(raw);
@@ -11484,7 +11752,7 @@ var validateCommand = defineCommand83({
11484
11752
  });
11485
11753
 
11486
11754
  // src/commands/canvas/index.ts
11487
- var canvasCommand = defineCommand84({
11755
+ var canvasCommand = defineCommand85({
11488
11756
  meta: {
11489
11757
  name: "canvas",
11490
11758
  description: `Run Baker creative canvas JSON files locally. Local nodes execute in-process; remote nodes POST to the Convex backend gateway.
@@ -11496,6 +11764,7 @@ Subcommands:
11496
11764
  baker canvas run <file.json> \u2014 execute the canvas, write outputs to ./canvas/<run_id>/
11497
11765
  baker canvas catalog \u2014 print the agent-facing node + composition catalog (JSON Schema)
11498
11766
  baker canvas inspect <run_id> \u2014 one-page summary of a completed run
11767
+ baker canvas gallery <dir> \u2014 read a creative folder's _definition.md + run manifests into the dashboard gallery descriptor (JSON)
11499
11768
  baker canvas scaffold-video <video> \u2014 turn a reference video into a runnable reproduction canvas (deconstruct + recurring-element detection)
11500
11769
  baker canvas scaffold-static-ad <image> \u2014 turn a source image into a runnable static-ad canvas (describe + element detection)`
11501
11770
  },
@@ -11504,16 +11773,17 @@ Subcommands:
11504
11773
  validate: validateCommand,
11505
11774
  catalog: catalogCommand,
11506
11775
  inspect: inspectCommand,
11776
+ gallery: galleryCommand,
11507
11777
  "scaffold-video": scaffoldVideoCommand,
11508
11778
  "scaffold-static-ad": scaffoldStaticAdCommand
11509
11779
  }
11510
11780
  });
11511
11781
 
11512
11782
  // src/commands/ga4/index.ts
11513
- import { defineCommand as defineCommand88 } from "citty";
11783
+ import { defineCommand as defineCommand89 } from "citty";
11514
11784
 
11515
11785
  // src/commands/ga4/audit.ts
11516
- import { defineCommand as defineCommand85 } from "citty";
11786
+ import { defineCommand as defineCommand86 } from "citty";
11517
11787
 
11518
11788
  // src/commands/ga4/resolve.ts
11519
11789
  async function fetchProperties(useCache = true) {
@@ -11576,7 +11846,7 @@ registerSchema({
11576
11846
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
11577
11847
  }
11578
11848
  });
11579
- var auditCommand2 = defineCommand85({
11849
+ var auditCommand2 = defineCommand86({
11580
11850
  meta: {
11581
11851
  name: "audit",
11582
11852
  description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
@@ -11628,7 +11898,7 @@ Examples:
11628
11898
  });
11629
11899
 
11630
11900
  // src/commands/ga4/properties.ts
11631
- import { defineCommand as defineCommand86 } from "citty";
11901
+ import { defineCommand as defineCommand87 } from "citty";
11632
11902
  registerSchema({
11633
11903
  command: "ga4.properties",
11634
11904
  description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
@@ -11636,7 +11906,7 @@ registerSchema({
11636
11906
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
11637
11907
  }
11638
11908
  });
11639
- var propertiesCommand = defineCommand86({
11909
+ var propertiesCommand = defineCommand87({
11640
11910
  meta: {
11641
11911
  name: "properties",
11642
11912
  description: `List accessible GA4 properties.
@@ -11686,7 +11956,7 @@ Examples:
11686
11956
  // src/commands/ga4/query.ts
11687
11957
  import { appendFileSync as appendFileSync2, existsSync as existsSync4, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "fs";
11688
11958
  import { resolve as resolve2 } from "path";
11689
- import { defineCommand as defineCommand87 } from "citty";
11959
+ import { defineCommand as defineCommand88 } from "citty";
11690
11960
 
11691
11961
  // src/commands/ga4/presets.ts
11692
11962
  var GA4_PRESETS = [
@@ -11818,7 +12088,7 @@ function handleError(err) {
11818
12088
  });
11819
12089
  process.exit(1);
11820
12090
  }
11821
- var queryCommand2 = defineCommand87({
12091
+ var queryCommand2 = defineCommand88({
11822
12092
  meta: {
11823
12093
  name: "query",
11824
12094
  description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
@@ -11889,7 +12159,7 @@ Free-form (escape hatch):
11889
12159
  });
11890
12160
 
11891
12161
  // src/commands/ga4/index.ts
11892
- var ga4Command = defineCommand88({
12162
+ var ga4Command = defineCommand89({
11893
12163
  meta: {
11894
12164
  name: "ga4",
11895
12165
  description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
@@ -11912,12 +12182,12 @@ Examples:
11912
12182
  });
11913
12183
 
11914
12184
  // src/commands/gsc/index.ts
11915
- import { defineCommand as defineCommand92 } from "citty";
12185
+ import { defineCommand as defineCommand93 } from "citty";
11916
12186
 
11917
12187
  // src/commands/gsc/query.ts
11918
12188
  import { appendFileSync as appendFileSync3, existsSync as existsSync5, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
11919
12189
  import { resolve as resolve3 } from "path";
11920
- import { defineCommand as defineCommand89 } from "citty";
12190
+ import { defineCommand as defineCommand90 } from "citty";
11921
12191
 
11922
12192
  // src/commands/gsc/presets.ts
11923
12193
  var GSC_PRESETS = [
@@ -12105,7 +12375,7 @@ function handleError2(err) {
12105
12375
  });
12106
12376
  process.exit(1);
12107
12377
  }
12108
- var queryCommand3 = defineCommand89({
12378
+ var queryCommand3 = defineCommand90({
12109
12379
  meta: {
12110
12380
  name: "query",
12111
12381
  description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
@@ -12183,7 +12453,7 @@ Free-form (escape hatch):
12183
12453
  });
12184
12454
 
12185
12455
  // src/commands/gsc/sitemaps.ts
12186
- import { defineCommand as defineCommand90 } from "citty";
12456
+ import { defineCommand as defineCommand91 } from "citty";
12187
12457
  registerSchema({
12188
12458
  command: "gsc.sitemaps",
12189
12459
  description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
@@ -12192,7 +12462,7 @@ registerSchema({
12192
12462
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
12193
12463
  }
12194
12464
  });
12195
- var sitemapsCommand = defineCommand90({
12465
+ var sitemapsCommand = defineCommand91({
12196
12466
  meta: {
12197
12467
  name: "sitemaps",
12198
12468
  description: `List sitemaps for a site. Check health and errors.
@@ -12242,7 +12512,7 @@ Examples:
12242
12512
  });
12243
12513
 
12244
12514
  // src/commands/gsc/sites.ts
12245
- import { defineCommand as defineCommand91 } from "citty";
12515
+ import { defineCommand as defineCommand92 } from "citty";
12246
12516
  registerSchema({
12247
12517
  command: "gsc.sites",
12248
12518
  description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
@@ -12250,7 +12520,7 @@ registerSchema({
12250
12520
  "no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
12251
12521
  }
12252
12522
  });
12253
- var sitesCommand = defineCommand91({
12523
+ var sitesCommand = defineCommand92({
12254
12524
  meta: {
12255
12525
  name: "sites",
12256
12526
  description: `List verified Search Console sites.
@@ -12298,7 +12568,7 @@ Examples:
12298
12568
  });
12299
12569
 
12300
12570
  // src/commands/gsc/index.ts
12301
- var gscCommand = defineCommand92({
12571
+ var gscCommand = defineCommand93({
12302
12572
  meta: {
12303
12573
  name: "gsc",
12304
12574
  description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
@@ -12321,10 +12591,10 @@ Examples:
12321
12591
  });
12322
12592
 
12323
12593
  // src/commands/images/index.ts
12324
- import { defineCommand as defineCommand116 } from "citty";
12594
+ import { defineCommand as defineCommand117 } from "citty";
12325
12595
 
12326
12596
  // src/commands/images/crop.ts
12327
- import { defineCommand as defineCommand93 } from "citty";
12597
+ import { defineCommand as defineCommand94 } from "citty";
12328
12598
 
12329
12599
  // src/lib/image/crop-sprite.ts
12330
12600
  import sharp from "sharp";
@@ -12339,7 +12609,7 @@ function cropSprite(input, region) {
12339
12609
 
12340
12610
  // src/lib/image/io.ts
12341
12611
  import { randomBytes } from "crypto";
12342
- import { glob as fsGlob, readFile as readFile7, rename, stat as stat2, writeFile as writeFile3 } from "fs/promises";
12612
+ import { glob as fsGlob, readFile as readFile8, rename, stat as stat2, writeFile as writeFile3 } from "fs/promises";
12343
12613
  import { dirname, extname, join as join3, resolve as resolve4 } from "path";
12344
12614
  var REMOTE_RE = /^https?:\/\//i;
12345
12615
  var GLOB_RE = /[*?[\]{}]/;
@@ -12375,11 +12645,11 @@ async function readImageBuffer(pathOrUrl) {
12375
12645
  }
12376
12646
  return Buffer.from(await response.arrayBuffer());
12377
12647
  }
12378
- return readFile7(pathOrUrl);
12648
+ return readFile8(pathOrUrl);
12379
12649
  }
12380
- async function isDirectory(path7) {
12650
+ async function isDirectory(path8) {
12381
12651
  try {
12382
- const s = await stat2(path7);
12652
+ const s = await stat2(path8);
12383
12653
  return s.isDirectory();
12384
12654
  } catch {
12385
12655
  return false;
@@ -12449,7 +12719,7 @@ function emitError2(err) {
12449
12719
  }
12450
12720
  process.exit(1);
12451
12721
  }
12452
- var cropCommand = defineCommand93({
12722
+ var cropCommand = defineCommand94({
12453
12723
  meta: {
12454
12724
  name: "crop",
12455
12725
  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"
@@ -12485,7 +12755,7 @@ var cropCommand = defineCommand93({
12485
12755
  });
12486
12756
 
12487
12757
  // src/commands/images/delete.ts
12488
- import { defineCommand as defineCommand94 } from "citty";
12758
+ import { defineCommand as defineCommand95 } from "citty";
12489
12759
  registerSchema({
12490
12760
  command: "images.delete",
12491
12761
  description: "Delete an image by ID",
@@ -12499,7 +12769,7 @@ registerSchema({
12499
12769
  }
12500
12770
  }
12501
12771
  });
12502
- var deleteCommand = defineCommand94({
12772
+ var deleteCommand = defineCommand95({
12503
12773
  meta: {
12504
12774
  name: "delete",
12505
12775
  description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
@@ -12540,7 +12810,7 @@ var deleteCommand = defineCommand94({
12540
12810
  });
12541
12811
 
12542
12812
  // src/commands/images/dimensions.ts
12543
- import { defineCommand as defineCommand95 } from "citty";
12813
+ import { defineCommand as defineCommand96 } from "citty";
12544
12814
 
12545
12815
  // src/lib/image/dimensions.ts
12546
12816
  import { imageSize } from "image-size";
@@ -12563,7 +12833,7 @@ registerSchema({
12563
12833
  target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
12564
12834
  }
12565
12835
  });
12566
- var dimensionsCommand = defineCommand95({
12836
+ var dimensionsCommand = defineCommand96({
12567
12837
  meta: {
12568
12838
  name: "dimensions",
12569
12839
  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"
@@ -12607,7 +12877,7 @@ var dimensionsCommand = defineCommand95({
12607
12877
  });
12608
12878
 
12609
12879
  // src/commands/images/extract.ts
12610
- import { defineCommand as defineCommand96 } from "citty";
12880
+ import { defineCommand as defineCommand97 } from "citty";
12611
12881
  registerSchema({
12612
12882
  command: "images.extract",
12613
12883
  description: "Extract images from a URL via Firecrawl (formats: images).",
@@ -12623,7 +12893,7 @@ registerSchema({
12623
12893
  }
12624
12894
  }
12625
12895
  });
12626
- var extractCommand = defineCommand96({
12896
+ var extractCommand = defineCommand97({
12627
12897
  meta: {
12628
12898
  name: "extract",
12629
12899
  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"
@@ -12661,7 +12931,7 @@ var extractCommand = defineCommand96({
12661
12931
  });
12662
12932
 
12663
12933
  // src/commands/images/find.ts
12664
- import { defineCommand as defineCommand97 } from "citty";
12934
+ import { defineCommand as defineCommand98 } from "citty";
12665
12935
  registerSchema({
12666
12936
  command: "images.find",
12667
12937
  description: "Fanout image search: library first, then opted-in external providers.",
@@ -12693,7 +12963,7 @@ registerSchema({
12693
12963
  }
12694
12964
  }
12695
12965
  });
12696
- var findCommand = defineCommand97({
12966
+ var findCommand = defineCommand98({
12697
12967
  meta: {
12698
12968
  name: "find",
12699
12969
  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"
@@ -12739,8 +13009,8 @@ var findCommand = defineCommand97({
12739
13009
  });
12740
13010
 
12741
13011
  // src/commands/images/generate.ts
12742
- import { readFile as readFile8 } from "fs/promises";
12743
- import { defineCommand as defineCommand98 } from "citty";
13012
+ import { readFile as readFile9 } from "fs/promises";
13013
+ import { defineCommand as defineCommand99 } from "citty";
12744
13014
  import sharp2 from "sharp";
12745
13015
  var GENERATE_TIMEOUT_MS = 18e4;
12746
13016
  var REFERENCE_MAX_EDGE = 1536;
@@ -12822,7 +13092,7 @@ async function resolveReferences(spec) {
12822
13092
  }
12823
13093
  let raw;
12824
13094
  try {
12825
- raw = await readFile8(entry);
13095
+ raw = await readFile9(entry);
12826
13096
  } catch {
12827
13097
  throw new ApiError("VALIDATION_ERROR", `Reference file not found: ${entry}`);
12828
13098
  }
@@ -12836,7 +13106,7 @@ async function resolveReferences(spec) {
12836
13106
  }
12837
13107
  return out;
12838
13108
  }
12839
- var generateCommand = defineCommand98({
13109
+ var generateCommand = defineCommand99({
12840
13110
  meta: {
12841
13111
  name: "generate",
12842
13112
  description: "Generate an image with AI and store it in the library (cost-tracked per request via OpenRouter usage). Models mirror the canvas: openai/gpt-5.4-image-2 (default \u2014 photoreal, cleanest text, best for ad/landing reproduction), google/gemini-3-pro-image-preview (Nano Banana Pro), google/gemini-3.5-flash & google/gemini-3.1-flash-image-preview (fast, extreme aspect ratios), recraft/recraft-v4.1-pro-vector (vector/SVG-style with palette control). The result is auto-ingested (describe + embed), so the next `baker images library` query finds it. Pass --reference with image URLs and/or local file paths (Pinterest, stock, brand assets, sandbox files) to ground generation in reality.\n\nExamples:\n baker images generate 'a friendly golden retriever sitting in a bright modern living room' --aspect-ratio 16:9\n baker images generate 'hero shot of a matte black water bottle on marble' --model google/gemini-3-pro-image-preview --image-size 2K\n baker images generate 'lifestyle photo matching this mood' --reference 'https://\u2026/ref1.jpg,https://\u2026/ref2.jpg'\n baker images generate 'put this product on a marble countertop, soft daylight' --reference './src/brand/logos/product.png,./refs/kitchen-mood.jpg'\n baker images generate 'flat geometric mascot, brand palette' --model recraft/recraft-v4.1-pro-vector --rgb-colors '[[10,10,10],[255,80,0]]'"
@@ -12888,7 +13158,7 @@ var generateCommand = defineCommand98({
12888
13158
  });
12889
13159
 
12890
13160
  // src/commands/images/get.ts
12891
- import { defineCommand as defineCommand99 } from "citty";
13161
+ import { defineCommand as defineCommand100 } from "citty";
12892
13162
  registerSchema({
12893
13163
  command: "images.get",
12894
13164
  description: "Get a single image by ID",
@@ -12896,7 +13166,7 @@ registerSchema({
12896
13166
  id: { type: "string", description: "Image ID", required: true }
12897
13167
  }
12898
13168
  });
12899
- var getCommand2 = defineCommand99({
13169
+ var getCommand2 = defineCommand100({
12900
13170
  meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
12901
13171
  args: {
12902
13172
  id: { type: "positional", description: "Image ID", required: false },
@@ -12932,7 +13202,7 @@ var getCommand2 = defineCommand99({
12932
13202
  });
12933
13203
 
12934
13204
  // src/commands/images/gif.ts
12935
- import { defineCommand as defineCommand100 } from "citty";
13205
+ import { defineCommand as defineCommand101 } from "citty";
12936
13206
  registerSchema({
12937
13207
  command: "images.gif",
12938
13208
  description: "Search Giphy for GIFs / reaction memes (paid social creative).",
@@ -12964,7 +13234,7 @@ registerSchema({
12964
13234
  }
12965
13235
  }
12966
13236
  });
12967
- var gifCommand = defineCommand100({
13237
+ var gifCommand = defineCommand101({
12968
13238
  meta: {
12969
13239
  name: "gif",
12970
13240
  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"
@@ -13011,7 +13281,7 @@ var gifCommand = defineCommand100({
13011
13281
  });
13012
13282
 
13013
13283
  // src/commands/images/google.ts
13014
- import { defineCommand as defineCommand101 } from "citty";
13284
+ import { defineCommand as defineCommand102 } from "citty";
13015
13285
  registerSchema({
13016
13286
  command: "images.google",
13017
13287
  description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
@@ -13047,7 +13317,7 @@ registerSchema({
13047
13317
  }
13048
13318
  }
13049
13319
  });
13050
- var googleCommand2 = defineCommand101({
13320
+ var googleCommand2 = defineCommand102({
13051
13321
  meta: {
13052
13322
  name: "google",
13053
13323
  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"
@@ -13095,7 +13365,7 @@ var googleCommand2 = defineCommand101({
13095
13365
  });
13096
13366
 
13097
13367
  // src/commands/images/icon.ts
13098
- import { defineCommand as defineCommand102 } from "citty";
13368
+ import { defineCommand as defineCommand103 } from "citty";
13099
13369
  registerSchema({
13100
13370
  command: "images.icon",
13101
13371
  description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
@@ -13121,7 +13391,7 @@ registerSchema({
13121
13391
  }
13122
13392
  }
13123
13393
  });
13124
- var iconCommand = defineCommand102({
13394
+ var iconCommand = defineCommand103({
13125
13395
  meta: {
13126
13396
  name: "icon",
13127
13397
  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'"
@@ -13161,7 +13431,7 @@ var iconCommand = defineCommand102({
13161
13431
  });
13162
13432
 
13163
13433
  // src/commands/images/ingest.ts
13164
- import { defineCommand as defineCommand103 } from "citty";
13434
+ import { defineCommand as defineCommand104 } from "citty";
13165
13435
  registerSchema({
13166
13436
  command: "images.ingest",
13167
13437
  description: "Ingest a remote image URL into the library (full describe + embed).",
@@ -13173,7 +13443,7 @@ registerSchema({
13173
13443
  context: { type: "string", description: "Description context hint", required: false }
13174
13444
  }
13175
13445
  });
13176
- var ingestCommand = defineCommand103({
13446
+ var ingestCommand = defineCommand104({
13177
13447
  meta: {
13178
13448
  name: "ingest",
13179
13449
  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"
@@ -13215,7 +13485,7 @@ var ingestCommand = defineCommand103({
13215
13485
  });
13216
13486
 
13217
13487
  // src/commands/images/library.ts
13218
- import { defineCommand as defineCommand104 } from "citty";
13488
+ import { defineCommand as defineCommand105 } from "citty";
13219
13489
  registerSchema({
13220
13490
  command: "images.library",
13221
13491
  description: "Search the company image library. Returns only ready images.",
@@ -13241,7 +13511,7 @@ registerSchema({
13241
13511
  }
13242
13512
  }
13243
13513
  });
13244
- var libraryCommand = defineCommand104({
13514
+ var libraryCommand = defineCommand105({
13245
13515
  meta: {
13246
13516
  name: "library",
13247
13517
  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"
@@ -13298,7 +13568,7 @@ var libraryCommand = defineCommand104({
13298
13568
  });
13299
13569
 
13300
13570
  // src/commands/images/logo.ts
13301
- import { defineCommand as defineCommand105 } from "citty";
13571
+ import { defineCommand as defineCommand106 } from "citty";
13302
13572
  registerSchema({
13303
13573
  command: "images.logo",
13304
13574
  description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
@@ -13323,7 +13593,7 @@ registerSchema({
13323
13593
  }
13324
13594
  }
13325
13595
  });
13326
- var logoCommand = defineCommand105({
13596
+ var logoCommand = defineCommand106({
13327
13597
  meta: {
13328
13598
  name: "logo",
13329
13599
  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"
@@ -13361,7 +13631,7 @@ var logoCommand = defineCommand105({
13361
13631
  });
13362
13632
 
13363
13633
  // src/commands/images/normalize.ts
13364
- import { defineCommand as defineCommand106 } from "citty";
13634
+ import { defineCommand as defineCommand107 } from "citty";
13365
13635
 
13366
13636
  // src/lib/image/color-changer.ts
13367
13637
  import quantize from "quantize";
@@ -14093,7 +14363,7 @@ function coerceRawArgs(args) {
14093
14363
  "dry-run": bool(args["dry-run"])
14094
14364
  };
14095
14365
  }
14096
- var normalizeCommand = defineCommand106({
14366
+ var normalizeCommand = defineCommand107({
14097
14367
  meta: {
14098
14368
  name: "normalize",
14099
14369
  description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
@@ -14148,7 +14418,7 @@ Examples:
14148
14418
  });
14149
14419
 
14150
14420
  // src/commands/images/pinterest.ts
14151
- import { defineCommand as defineCommand107 } from "citty";
14421
+ import { defineCommand as defineCommand108 } from "citty";
14152
14422
  registerSchema({
14153
14423
  command: "images.pinterest",
14154
14424
  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.",
@@ -14168,7 +14438,7 @@ registerSchema({
14168
14438
  }
14169
14439
  }
14170
14440
  });
14171
- var pinterestCommand = defineCommand107({
14441
+ var pinterestCommand = defineCommand108({
14172
14442
  meta: {
14173
14443
  name: "pinterest",
14174
14444
  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'"
@@ -14208,7 +14478,7 @@ var pinterestCommand = defineCommand107({
14208
14478
  });
14209
14479
 
14210
14480
  // src/commands/images/screenshot.ts
14211
- import { defineCommand as defineCommand108 } from "citty";
14481
+ import { defineCommand as defineCommand109 } from "citty";
14212
14482
  registerSchema({
14213
14483
  command: "images.screenshot",
14214
14484
  description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
@@ -14224,7 +14494,7 @@ registerSchema({
14224
14494
  }
14225
14495
  }
14226
14496
  });
14227
- var screenshotCommand = defineCommand108({
14497
+ var screenshotCommand = defineCommand109({
14228
14498
  meta: {
14229
14499
  name: "screenshot",
14230
14500
  description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
@@ -14274,7 +14544,7 @@ var screenshotCommand = defineCommand108({
14274
14544
  });
14275
14545
 
14276
14546
  // src/commands/images/search.ts
14277
- import { defineCommand as defineCommand109 } from "citty";
14547
+ import { defineCommand as defineCommand110 } from "citty";
14278
14548
  registerSchema({
14279
14549
  command: "images.search",
14280
14550
  description: "Search images by text query. Only returns ready images.",
@@ -14290,7 +14560,7 @@ registerSchema({
14290
14560
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
14291
14561
  }
14292
14562
  });
14293
- var searchCommand = defineCommand109({
14563
+ var searchCommand = defineCommand110({
14294
14564
  meta: {
14295
14565
  name: "search",
14296
14566
  description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
@@ -14350,7 +14620,7 @@ var searchCommand = defineCommand109({
14350
14620
  });
14351
14621
 
14352
14622
  // src/commands/images/sticker.ts
14353
- import { defineCommand as defineCommand110 } from "citty";
14623
+ import { defineCommand as defineCommand111 } from "citty";
14354
14624
  registerSchema({
14355
14625
  command: "images.sticker",
14356
14626
  description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
@@ -14382,7 +14652,7 @@ registerSchema({
14382
14652
  }
14383
14653
  }
14384
14654
  });
14385
- var stickerCommand = defineCommand110({
14655
+ var stickerCommand = defineCommand111({
14386
14656
  meta: {
14387
14657
  name: "sticker",
14388
14658
  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"
@@ -14429,7 +14699,7 @@ var stickerCommand = defineCommand110({
14429
14699
  });
14430
14700
 
14431
14701
  // src/commands/images/stock.ts
14432
- import { defineCommand as defineCommand111 } from "citty";
14702
+ import { defineCommand as defineCommand112 } from "citty";
14433
14703
  registerSchema({
14434
14704
  command: "images.stock",
14435
14705
  description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
@@ -14487,7 +14757,7 @@ registerSchema({
14487
14757
  }
14488
14758
  }
14489
14759
  });
14490
- var stockCommand = defineCommand111({
14760
+ var stockCommand = defineCommand112({
14491
14761
  meta: {
14492
14762
  name: "stock",
14493
14763
  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"
@@ -14543,7 +14813,7 @@ var stockCommand = defineCommand111({
14543
14813
  });
14544
14814
 
14545
14815
  // src/lib/tags-command.ts
14546
- import { defineCommand as defineCommand112 } from "citty";
14816
+ import { defineCommand as defineCommand113 } from "citty";
14547
14817
  function makeTagsCommand(command, label, endpoint) {
14548
14818
  registerSchema({
14549
14819
  command: `${command}.tags`,
@@ -14552,7 +14822,7 @@ function makeTagsCommand(command, label, endpoint) {
14552
14822
  output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
14553
14823
  }
14554
14824
  });
14555
- return defineCommand112({
14825
+ return defineCommand113({
14556
14826
  meta: {
14557
14827
  name: "tags",
14558
14828
  description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
@@ -14588,9 +14858,9 @@ function makeTagsCommand(command, label, endpoint) {
14588
14858
  var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
14589
14859
 
14590
14860
  // src/commands/images/upload.ts
14591
- import { readFile as readFile9 } from "fs/promises";
14861
+ import { readFile as readFile10 } from "fs/promises";
14592
14862
  import { extname as extname2 } from "path";
14593
- import { defineCommand as defineCommand113 } from "citty";
14863
+ import { defineCommand as defineCommand114 } from "citty";
14594
14864
  var MIME_MAP = {
14595
14865
  ".png": "image/png",
14596
14866
  ".jpg": "image/jpeg",
@@ -14645,7 +14915,7 @@ function detectContentType(filePath) {
14645
14915
  }
14646
14916
  return mime;
14647
14917
  }
14648
- var uploadCommand = defineCommand113({
14918
+ var uploadCommand = defineCommand114({
14649
14919
  meta: {
14650
14920
  name: "upload",
14651
14921
  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'"
@@ -14728,7 +14998,7 @@ async function uploadLocal(target, args) {
14728
14998
  });
14729
14999
  return;
14730
15000
  }
14731
- const fileBuffer = await readFile9(target);
15001
+ const fileBuffer = await readFile10(target);
14732
15002
  const base64 = fileBuffer.toString("base64");
14733
15003
  const body = { base64, contentType };
14734
15004
  if (args.source) body.source = args.source;
@@ -14738,7 +15008,7 @@ async function uploadLocal(target, args) {
14738
15008
  }
14739
15009
 
14740
15010
  // src/commands/images/upscale.ts
14741
- import { defineCommand as defineCommand114 } from "citty";
15011
+ import { defineCommand as defineCommand115 } from "citty";
14742
15012
  registerSchema({
14743
15013
  command: "images.upscale",
14744
15014
  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).",
@@ -14753,7 +15023,7 @@ registerSchema({
14753
15023
  }
14754
15024
  });
14755
15025
  var POLL_INTERVAL_MS3 = 1500;
14756
- var upscaleCommand = defineCommand114({
15026
+ var upscaleCommand = defineCommand115({
14757
15027
  meta: {
14758
15028
  name: "upscale",
14759
15029
  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"
@@ -14808,7 +15078,7 @@ var upscaleCommand = defineCommand114({
14808
15078
  });
14809
15079
 
14810
15080
  // src/commands/images/use.ts
14811
- import { defineCommand as defineCommand115 } from "citty";
15081
+ import { defineCommand as defineCommand116 } from "citty";
14812
15082
  registerSchema({
14813
15083
  command: "images.use",
14814
15084
  description: "Ingest a URL and wait for the library record to be ready.",
@@ -14824,7 +15094,7 @@ registerSchema({
14824
15094
  }
14825
15095
  });
14826
15096
  var POLL_INTERVAL_MS4 = 1500;
14827
- var useCommand = defineCommand115({
15097
+ var useCommand = defineCommand116({
14828
15098
  meta: {
14829
15099
  name: "use",
14830
15100
  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"
@@ -14870,7 +15140,7 @@ var useCommand = defineCommand115({
14870
15140
  });
14871
15141
 
14872
15142
  // src/commands/images/index.ts
14873
- var imagesCommand = defineCommand116({
15143
+ var imagesCommand = defineCommand117({
14874
15144
  meta: {
14875
15145
  name: "images",
14876
15146
  description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
@@ -14940,10 +15210,10 @@ Paid transforms (run on the Convex backend, cost-tracked):
14940
15210
  });
14941
15211
 
14942
15212
  // src/commands/research/index.ts
14943
- import { defineCommand as defineCommand127 } from "citty";
15213
+ import { defineCommand as defineCommand128 } from "citty";
14944
15214
 
14945
15215
  // src/commands/research/advertisers.ts
14946
- import { defineCommand as defineCommand117 } from "citty";
15216
+ import { defineCommand as defineCommand118 } from "citty";
14947
15217
 
14948
15218
  // src/commands/research/output.ts
14949
15219
  var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
@@ -15056,7 +15326,7 @@ var FIELDS3 = {
15056
15326
  etv: "Estimated traffic value (USD)",
15057
15327
  visibility: "SERP visibility score (0-1)"
15058
15328
  };
15059
- var advertisersCommand = defineCommand117({
15329
+ var advertisersCommand = defineCommand118({
15060
15330
  meta: {
15061
15331
  name: "advertisers",
15062
15332
  description: `Find domains competing for a keyword in Google SERPs.
@@ -15103,7 +15373,7 @@ Examples:
15103
15373
  });
15104
15374
 
15105
15375
  // src/commands/research/autocomplete.ts
15106
- import { defineCommand as defineCommand118 } from "citty";
15376
+ import { defineCommand as defineCommand119 } from "citty";
15107
15377
  registerSchema({
15108
15378
  command: "research.autocomplete",
15109
15379
  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).",
@@ -15126,7 +15396,7 @@ registerSchema({
15126
15396
  var FIELDS4 = {
15127
15397
  suggestion: "Autocomplete suggestion from Google"
15128
15398
  };
15129
- var autocompleteCommand = defineCommand118({
15399
+ var autocompleteCommand = defineCommand119({
15130
15400
  meta: {
15131
15401
  name: "autocomplete",
15132
15402
  description: `Get Google Autocomplete suggestions for keyword expansion.
@@ -15172,7 +15442,7 @@ Examples:
15172
15442
  });
15173
15443
 
15174
15444
  // src/commands/research/countries.ts
15175
- import { defineCommand as defineCommand119 } from "citty";
15445
+ import { defineCommand as defineCommand120 } from "citty";
15176
15446
  registerSchema({
15177
15447
  command: "research.countries",
15178
15448
  description: "List all supported country codes for --location flag in research commands.",
@@ -15229,7 +15499,7 @@ var FIELDS5 = {
15229
15499
  code: "Country code to pass as --location",
15230
15500
  name: "Country name"
15231
15501
  };
15232
- var countriesCommand = defineCommand119({
15502
+ var countriesCommand = defineCommand120({
15233
15503
  meta: {
15234
15504
  name: "countries",
15235
15505
  description: "List all supported country codes for --location flag."
@@ -15240,7 +15510,7 @@ var countriesCommand = defineCommand119({
15240
15510
  });
15241
15511
 
15242
15512
  // src/commands/research/intent.ts
15243
- import { defineCommand as defineCommand120 } from "citty";
15513
+ import { defineCommand as defineCommand121 } from "citty";
15244
15514
  registerSchema({
15245
15515
  command: "research.intent",
15246
15516
  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.",
@@ -15263,7 +15533,7 @@ var FIELDS6 = {
15263
15533
  intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
15264
15534
  probability: "Confidence score 0.0-1.0"
15265
15535
  };
15266
- var intentCommand = defineCommand120({
15536
+ var intentCommand = defineCommand121({
15267
15537
  meta: {
15268
15538
  name: "intent",
15269
15539
  description: `Classify Google Search intent for keywords. Returns intent type and confidence.
@@ -15311,7 +15581,7 @@ Examples:
15311
15581
  });
15312
15582
 
15313
15583
  // src/commands/research/keyword-gap.ts
15314
- import { defineCommand as defineCommand121 } from "citty";
15584
+ import { defineCommand as defineCommand122 } from "citty";
15315
15585
  registerSchema({
15316
15586
  command: "research.keyword-gap",
15317
15587
  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.",
@@ -15340,7 +15610,7 @@ var FIELDS7 = {
15340
15610
  cpc: "Cost per click USD",
15341
15611
  their_position: "Competitor's ranking position"
15342
15612
  };
15343
- var keywordGapCommand = defineCommand121({
15613
+ var keywordGapCommand = defineCommand122({
15344
15614
  meta: {
15345
15615
  name: "keyword-gap",
15346
15616
  description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
@@ -15414,7 +15684,7 @@ Examples:
15414
15684
  });
15415
15685
 
15416
15686
  // src/commands/research/keywords-for-site.ts
15417
- import { defineCommand as defineCommand122 } from "citty";
15687
+ import { defineCommand as defineCommand123 } from "citty";
15418
15688
  registerSchema({
15419
15689
  command: "research.keywords-for-site",
15420
15690
  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.",
@@ -15447,7 +15717,7 @@ var FIELDS8 = {
15447
15717
  competition: "LOW, MEDIUM, or HIGH",
15448
15718
  competition_index: "Competition score 0-100"
15449
15719
  };
15450
- var keywordsForSiteCommand = defineCommand122({
15720
+ var keywordsForSiteCommand = defineCommand123({
15451
15721
  meta: {
15452
15722
  name: "keywords-for-site",
15453
15723
  description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
@@ -15500,7 +15770,7 @@ Examples:
15500
15770
  });
15501
15771
 
15502
15772
  // src/commands/research/languages.ts
15503
- import { defineCommand as defineCommand123 } from "citty";
15773
+ import { defineCommand as defineCommand124 } from "citty";
15504
15774
  registerSchema({
15505
15775
  command: "research.languages",
15506
15776
  description: "List all supported language codes for --language flag in research commands.",
@@ -15530,7 +15800,7 @@ var FIELDS9 = {
15530
15800
  code: "Language code to pass as --language",
15531
15801
  name: "Language name (also accepted by --language)"
15532
15802
  };
15533
- var languagesCommand2 = defineCommand123({
15803
+ var languagesCommand2 = defineCommand124({
15534
15804
  meta: {
15535
15805
  name: "languages",
15536
15806
  description: "List all supported language codes for --language flag."
@@ -15541,7 +15811,7 @@ var languagesCommand2 = defineCommand123({
15541
15811
  });
15542
15812
 
15543
15813
  // src/commands/research/lighthouse.ts
15544
- import { defineCommand as defineCommand124 } from "citty";
15814
+ import { defineCommand as defineCommand125 } from "citty";
15545
15815
  registerSchema({
15546
15816
  command: "research.lighthouse",
15547
15817
  description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
@@ -15560,7 +15830,7 @@ var FIELDS10 = {
15560
15830
  speed_index_ms: "Speed Index in ms (good: < 3400)",
15561
15831
  interactive_ms: "Time to Interactive in ms (good: < 3800)"
15562
15832
  };
15563
- var lighthouseCommand = defineCommand124({
15833
+ var lighthouseCommand = defineCommand125({
15564
15834
  meta: {
15565
15835
  name: "lighthouse",
15566
15836
  description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
@@ -15598,7 +15868,7 @@ Examples:
15598
15868
  });
15599
15869
 
15600
15870
  // src/commands/research/relevant-pages.ts
15601
- import { defineCommand as defineCommand125 } from "citty";
15871
+ import { defineCommand as defineCommand126 } from "citty";
15602
15872
  registerSchema({
15603
15873
  command: "research.relevant-pages",
15604
15874
  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).",
@@ -15624,7 +15894,7 @@ var FIELDS11 = {
15624
15894
  keywords: "Total organic keywords the page ranks for",
15625
15895
  top_10: "Keywords in positions 1-10"
15626
15896
  };
15627
- var relevantPagesCommand = defineCommand125({
15897
+ var relevantPagesCommand = defineCommand126({
15628
15898
  meta: {
15629
15899
  name: "relevant-pages",
15630
15900
  description: `Get the top pages of a competitor domain with traffic data.
@@ -15670,7 +15940,7 @@ Examples:
15670
15940
  });
15671
15941
 
15672
15942
  // src/commands/research/web.ts
15673
- import { defineCommand as defineCommand126 } from "citty";
15943
+ import { defineCommand as defineCommand127 } from "citty";
15674
15944
  registerSchema({
15675
15945
  command: "research.web",
15676
15946
  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).",
@@ -15721,7 +15991,7 @@ async function runDeepResearch(question) {
15721
15991
  }
15722
15992
  throw new Error("Deep research timed out");
15723
15993
  }
15724
- var webCommand = defineCommand126({
15994
+ var webCommand = defineCommand127({
15725
15995
  meta: {
15726
15996
  name: "web",
15727
15997
  description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
@@ -15781,7 +16051,7 @@ Examples:
15781
16051
  });
15782
16052
 
15783
16053
  // src/commands/research/index.ts
15784
- var researchCommand = defineCommand127({
16054
+ var researchCommand = defineCommand128({
15785
16055
  meta: {
15786
16056
  name: "research",
15787
16057
  description: `Competitive intelligence and AI-powered research commands.
@@ -15821,10 +16091,10 @@ Examples:
15821
16091
  });
15822
16092
 
15823
16093
  // src/commands/scheduled-actions/index.ts
15824
- import { defineCommand as defineCommand134 } from "citty";
16094
+ import { defineCommand as defineCommand135 } from "citty";
15825
16095
 
15826
16096
  // src/commands/scheduled-actions/create.ts
15827
- import { defineCommand as defineCommand128 } from "citty";
16097
+ import { defineCommand as defineCommand129 } from "citty";
15828
16098
 
15829
16099
  // src/commands/scheduled-actions/shared.ts
15830
16100
  var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
@@ -15929,7 +16199,7 @@ registerSchema({
15929
16199
  prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
15930
16200
  }
15931
16201
  });
15932
- var createCommand2 = defineCommand128({
16202
+ var createCommand2 = defineCommand129({
15933
16203
  meta: {
15934
16204
  name: "create",
15935
16205
  description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
@@ -15977,7 +16247,7 @@ var createCommand2 = defineCommand128({
15977
16247
  });
15978
16248
 
15979
16249
  // src/commands/scheduled-actions/delete.ts
15980
- import { defineCommand as defineCommand129 } from "citty";
16250
+ import { defineCommand as defineCommand130 } from "citty";
15981
16251
  registerSchema({
15982
16252
  command: "scheduled-actions.delete",
15983
16253
  description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
@@ -15985,7 +16255,7 @@ registerSchema({
15985
16255
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
15986
16256
  }
15987
16257
  });
15988
- var deleteCommand2 = defineCommand129({
16258
+ var deleteCommand2 = defineCommand130({
15989
16259
  meta: {
15990
16260
  name: "delete",
15991
16261
  description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
@@ -16014,7 +16284,7 @@ var deleteCommand2 = defineCommand129({
16014
16284
  });
16015
16285
 
16016
16286
  // src/commands/scheduled-actions/get.ts
16017
- import { defineCommand as defineCommand130 } from "citty";
16287
+ import { defineCommand as defineCommand131 } from "citty";
16018
16288
  registerSchema({
16019
16289
  command: "scheduled-actions.get",
16020
16290
  description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
@@ -16022,7 +16292,7 @@ registerSchema({
16022
16292
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
16023
16293
  }
16024
16294
  });
16025
- var getCommand3 = defineCommand130({
16295
+ var getCommand3 = defineCommand131({
16026
16296
  meta: {
16027
16297
  name: "get",
16028
16298
  description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
@@ -16059,13 +16329,13 @@ var getCommand3 = defineCommand130({
16059
16329
  });
16060
16330
 
16061
16331
  // src/commands/scheduled-actions/list.ts
16062
- import { defineCommand as defineCommand131 } from "citty";
16332
+ import { defineCommand as defineCommand132 } from "citty";
16063
16333
  registerSchema({
16064
16334
  command: "scheduled-actions.list",
16065
16335
  description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
16066
16336
  args: {}
16067
16337
  });
16068
- var listCommand3 = defineCommand131({
16338
+ var listCommand3 = defineCommand132({
16069
16339
  meta: {
16070
16340
  name: "list",
16071
16341
  description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
@@ -16086,7 +16356,7 @@ var listCommand3 = defineCommand131({
16086
16356
  });
16087
16357
 
16088
16358
  // src/commands/scheduled-actions/trigger.ts
16089
- import { defineCommand as defineCommand132 } from "citty";
16359
+ import { defineCommand as defineCommand133 } from "citty";
16090
16360
  registerSchema({
16091
16361
  command: "scheduled-actions.trigger",
16092
16362
  description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
@@ -16094,7 +16364,7 @@ registerSchema({
16094
16364
  id: { type: "string", description: "Published scheduled action ID", required: true }
16095
16365
  }
16096
16366
  });
16097
- var triggerCommand = defineCommand132({
16367
+ var triggerCommand = defineCommand133({
16098
16368
  meta: {
16099
16369
  name: "trigger",
16100
16370
  description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
@@ -16131,7 +16401,7 @@ var triggerCommand = defineCommand132({
16131
16401
  });
16132
16402
 
16133
16403
  // src/commands/scheduled-actions/update.ts
16134
- import { defineCommand as defineCommand133 } from "citty";
16404
+ import { defineCommand as defineCommand134 } from "citty";
16135
16405
  registerSchema({
16136
16406
  command: "scheduled-actions.update",
16137
16407
  description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
@@ -16156,7 +16426,7 @@ registerSchema({
16156
16426
  prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
16157
16427
  }
16158
16428
  });
16159
- var updateCommand2 = defineCommand133({
16429
+ var updateCommand2 = defineCommand134({
16160
16430
  meta: {
16161
16431
  name: "update",
16162
16432
  description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
@@ -16226,7 +16496,7 @@ var updateCommand2 = defineCommand133({
16226
16496
  });
16227
16497
 
16228
16498
  // src/commands/scheduled-actions/index.ts
16229
- var scheduledActionsCommand = defineCommand134({
16499
+ var scheduledActionsCommand = defineCommand135({
16230
16500
  meta: {
16231
16501
  name: "scheduled-actions",
16232
16502
  description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
@@ -16252,8 +16522,8 @@ Examples:
16252
16522
  });
16253
16523
 
16254
16524
  // src/commands/schema.ts
16255
- import { defineCommand as defineCommand135 } from "citty";
16256
- var schemaCommand = defineCommand135({
16525
+ import { defineCommand as defineCommand136 } from "citty";
16526
+ var schemaCommand = defineCommand136({
16257
16527
  meta: {
16258
16528
  name: "schema",
16259
16529
  description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
@@ -16289,10 +16559,10 @@ var schemaCommand = defineCommand135({
16289
16559
  });
16290
16560
 
16291
16561
  // src/commands/testimonials/index.ts
16292
- import { defineCommand as defineCommand139 } from "citty";
16562
+ import { defineCommand as defineCommand140 } from "citty";
16293
16563
 
16294
16564
  // src/commands/testimonials/get.ts
16295
- import { defineCommand as defineCommand136 } from "citty";
16565
+ import { defineCommand as defineCommand137 } from "citty";
16296
16566
  registerSchema({
16297
16567
  command: "testimonials.get",
16298
16568
  description: "Get a single testimonial by ID",
@@ -16300,7 +16570,7 @@ registerSchema({
16300
16570
  id: { type: "string", description: "Testimonial ID", required: true }
16301
16571
  }
16302
16572
  });
16303
- var getCommand4 = defineCommand136({
16573
+ var getCommand4 = defineCommand137({
16304
16574
  meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
16305
16575
  args: {
16306
16576
  id: { type: "positional", description: "Testimonial ID", required: false },
@@ -16337,7 +16607,7 @@ var getCommand4 = defineCommand136({
16337
16607
  });
16338
16608
 
16339
16609
  // src/commands/testimonials/list.ts
16340
- import { defineCommand as defineCommand137 } from "citty";
16610
+ import { defineCommand as defineCommand138 } from "citty";
16341
16611
  registerSchema({
16342
16612
  command: "testimonials.list",
16343
16613
  description: "List testimonials with optional filters.",
@@ -16367,7 +16637,7 @@ registerSchema({
16367
16637
  limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
16368
16638
  }
16369
16639
  });
16370
- var listCommand4 = defineCommand137({
16640
+ var listCommand4 = defineCommand138({
16371
16641
  meta: {
16372
16642
  name: "list",
16373
16643
  description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
@@ -16416,7 +16686,7 @@ var listCommand4 = defineCommand137({
16416
16686
  });
16417
16687
 
16418
16688
  // src/commands/testimonials/search.ts
16419
- import { defineCommand as defineCommand138 } from "citty";
16689
+ import { defineCommand as defineCommand139 } from "citty";
16420
16690
  registerSchema({
16421
16691
  command: "testimonials.search",
16422
16692
  description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
@@ -16447,7 +16717,7 @@ registerSchema({
16447
16717
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
16448
16718
  }
16449
16719
  });
16450
- var searchCommand2 = defineCommand138({
16720
+ var searchCommand2 = defineCommand139({
16451
16721
  meta: {
16452
16722
  name: "search",
16453
16723
  description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
@@ -16521,7 +16791,7 @@ var searchCommand2 = defineCommand138({
16521
16791
  var tagsCommand3 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
16522
16792
 
16523
16793
  // src/commands/testimonials/index.ts
16524
- var testimonialsCommand = defineCommand139({
16794
+ var testimonialsCommand = defineCommand140({
16525
16795
  meta: {
16526
16796
  name: "testimonials",
16527
16797
  description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
@@ -16542,10 +16812,10 @@ Examples:
16542
16812
  });
16543
16813
 
16544
16814
  // src/commands/videos/index.ts
16545
- import { defineCommand as defineCommand144 } from "citty";
16815
+ import { defineCommand as defineCommand145 } from "citty";
16546
16816
 
16547
16817
  // src/commands/videos/delete.ts
16548
- import { defineCommand as defineCommand140 } from "citty";
16818
+ import { defineCommand as defineCommand141 } from "citty";
16549
16819
  registerSchema({
16550
16820
  command: "videos.delete",
16551
16821
  description: "Delete a video by ID",
@@ -16559,7 +16829,7 @@ registerSchema({
16559
16829
  }
16560
16830
  }
16561
16831
  });
16562
- var deleteCommand3 = defineCommand140({
16832
+ var deleteCommand3 = defineCommand141({
16563
16833
  meta: {
16564
16834
  name: "delete",
16565
16835
  description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
@@ -16600,7 +16870,7 @@ var deleteCommand3 = defineCommand140({
16600
16870
  });
16601
16871
 
16602
16872
  // src/commands/videos/get.ts
16603
- import { defineCommand as defineCommand141 } from "citty";
16873
+ import { defineCommand as defineCommand142 } from "citty";
16604
16874
  registerSchema({
16605
16875
  command: "videos.get",
16606
16876
  description: "Get a single video by ID",
@@ -16608,7 +16878,7 @@ registerSchema({
16608
16878
  id: { type: "string", description: "Video ID", required: true }
16609
16879
  }
16610
16880
  });
16611
- var getCommand5 = defineCommand141({
16881
+ var getCommand5 = defineCommand142({
16612
16882
  meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
16613
16883
  args: {
16614
16884
  id: { type: "positional", description: "Video ID", required: false },
@@ -16645,7 +16915,7 @@ var getCommand5 = defineCommand141({
16645
16915
  });
16646
16916
 
16647
16917
  // src/commands/videos/search.ts
16648
- import { defineCommand as defineCommand142 } from "citty";
16918
+ import { defineCommand as defineCommand143 } from "citty";
16649
16919
  registerSchema({
16650
16920
  command: "videos.search",
16651
16921
  description: "Search videos by text query. Only returns ready videos.",
@@ -16655,7 +16925,7 @@ registerSchema({
16655
16925
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
16656
16926
  }
16657
16927
  });
16658
- var searchCommand3 = defineCommand142({
16928
+ var searchCommand3 = defineCommand143({
16659
16929
  meta: {
16660
16930
  name: "search",
16661
16931
  description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
@@ -16705,9 +16975,9 @@ var searchCommand3 = defineCommand142({
16705
16975
  var tagsCommand4 = makeTagsCommand("videos", "video", "/api/videos/tags");
16706
16976
 
16707
16977
  // src/commands/videos/upload.ts
16708
- import { readFile as readFile10, stat as stat3 } from "fs/promises";
16978
+ import { readFile as readFile11, stat as stat3 } from "fs/promises";
16709
16979
  import { extname as extname3 } from "path";
16710
- import { defineCommand as defineCommand143 } from "citty";
16980
+ import { defineCommand as defineCommand144 } from "citty";
16711
16981
  var MIME_MAP2 = {
16712
16982
  ".mp4": "video/mp4",
16713
16983
  ".mov": "video/quicktime",
@@ -16741,7 +17011,7 @@ function detectContentType2(filePath) {
16741
17011
  }
16742
17012
  return mime;
16743
17013
  }
16744
- var uploadCommand2 = defineCommand143({
17014
+ var uploadCommand2 = defineCommand144({
16745
17015
  meta: {
16746
17016
  name: "upload",
16747
17017
  description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
@@ -16770,7 +17040,7 @@ var uploadCommand2 = defineCommand143({
16770
17040
  return;
16771
17041
  }
16772
17042
  const { uploadUrl, videoId } = await apiPost("/api/videos/upload", {});
16773
- const fileBuffer = await readFile10(filePath);
17043
+ const fileBuffer = await readFile11(filePath);
16774
17044
  const uploadResponse = await fetch(uploadUrl, {
16775
17045
  method: "PUT",
16776
17046
  headers: { "Content-Type": contentType },
@@ -16795,7 +17065,7 @@ var uploadCommand2 = defineCommand143({
16795
17065
  });
16796
17066
 
16797
17067
  // src/commands/videos/index.ts
16798
- var videosCommand = defineCommand144({
17068
+ var videosCommand = defineCommand145({
16799
17069
  meta: {
16800
17070
  name: "videos",
16801
17071
  description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
@@ -16818,10 +17088,10 @@ Examples:
16818
17088
  });
16819
17089
 
16820
17090
  // src/commands/winning-ads/index.ts
16821
- import { defineCommand as defineCommand147 } from "citty";
17091
+ import { defineCommand as defineCommand148 } from "citty";
16822
17092
 
16823
17093
  // src/commands/winning-ads/advertisers.ts
16824
- import { defineCommand as defineCommand145 } from "citty";
17094
+ import { defineCommand as defineCommand146 } from "citty";
16825
17095
  registerSchema({
16826
17096
  command: "winning-ads.advertisers",
16827
17097
  description: "Resolve a brand name to advertiser_id(s) in the ad-dna corpus \u2014 to find your OWN advertiser (to --exclude-advertiser) or a competitor (to --advertiser-id).",
@@ -16834,7 +17104,7 @@ registerSchema({
16834
17104
  function identity(record) {
16835
17105
  return record;
16836
17106
  }
16837
- var advertisersCommand2 = defineCommand145({
17107
+ var advertisersCommand2 = defineCommand146({
16838
17108
  meta: {
16839
17109
  name: "advertisers",
16840
17110
  description: 'Resolve a brand name to advertiser_id(s). Use it to find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id. Example: baker winning-ads advertisers "Deel" --output md'
@@ -16885,7 +17155,7 @@ var advertisersCommand2 = defineCommand145({
16885
17155
  });
16886
17156
 
16887
17157
  // src/commands/winning-ads/search.ts
16888
- import { defineCommand as defineCommand146 } from "citty";
17158
+ import { defineCommand as defineCommand147 } from "citty";
16889
17159
  registerSchema({
16890
17160
  command: "winning-ads.search",
16891
17161
  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.",
@@ -16993,7 +17263,7 @@ function buildSearchBody(args) {
16993
17263
  }
16994
17264
  return body;
16995
17265
  }
16996
- var searchCommand4 = defineCommand146({
17266
+ var searchCommand4 = defineCommand147({
16997
17267
  meta: {
16998
17268
  name: "search",
16999
17269
  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"
@@ -17105,7 +17375,7 @@ var searchCommand4 = defineCommand146({
17105
17375
  });
17106
17376
 
17107
17377
  // src/commands/winning-ads/index.ts
17108
- var winningAdsCommand = defineCommand147({
17378
+ var winningAdsCommand = defineCommand148({
17109
17379
  meta: {
17110
17380
  name: "winning-ads",
17111
17381
  description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
@@ -17145,7 +17415,7 @@ function getCliVersion() {
17145
17415
  }
17146
17416
 
17147
17417
  // src/cli.ts
17148
- var main = defineCommand148({
17418
+ var main = defineCommand149({
17149
17419
  meta: {
17150
17420
  name: "baker",
17151
17421
  version: getCliVersion(),