@koda-sl/baker-cli 0.349.0-dev.c05788ee3 → 0.349.0-dev.dd7bb23c3

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
@@ -23,6 +23,7 @@ import {
23
23
  YtDlpError,
24
24
  bestSupportedQuality,
25
25
  canonicalUrl,
26
+ catalogView,
26
27
  clipAudioMode,
27
28
  clipDurationsFor,
28
29
  clipParamRecipe,
@@ -67,7 +68,7 @@ import {
67
68
  validateCanvasDeep,
68
69
  withoutCastName,
69
70
  ytDlpBlockSignal
70
- } from "./chunk-CEFJ5YSG.js";
71
+ } from "./chunk-4QG7SF4U.js";
71
72
  import {
72
73
  csvOrJson,
73
74
  daysAgoIso,
@@ -9848,27 +9849,6 @@ var CORRECTION_RULES = [
9848
9849
  };
9849
9850
  }
9850
9851
  },
9851
- // 0b. OPERATOR_FIELD_MISMATCH — the field refuses this operator, and Google names the
9852
- // ones it takes. Kept ahead of the field-specific rules for the same reason as rule 0.
9853
- // A repeated field (final_urls, labels, …) takes only CONTAINS ALL/ANY/NONE, so it has
9854
- // no null test at all: read it unfiltered and filter the rows instead.
9855
- {
9856
- matchApiError: /OPERATOR_FIELD_MISMATCH|is not a valid operator to use with/i,
9857
- fix: (ctx) => {
9858
- const message = ctx.apiErrorMessage ?? "";
9859
- const field = message.match(/valid operator to use with '([\w.]+)'/i)?.[1] ?? "this field";
9860
- const operator = message.match(/([A-Z][A-Z_ =!<>]*?) is not a valid operator/)?.[1]?.trim();
9861
- const valid = message.match(/Valid operators: (.+?)\.?(?:"|$)/i)?.[1]?.trim();
9862
- const refused = operator ? `${operator} cannot be used on ${field}` : `${field} does not take that operator`;
9863
- const allowed = valid ? `; its valid operators are ${valid}` : "";
9864
- const repeated = valid?.split(",").every((op) => /^CONTAINS (ALL|ANY|NONE)$/i.test(op.trim())) ?? false;
9865
- const guidance = repeated ? `. ${field} is a list field, so it cannot be tested for null or compared with =: to find rows that have it, drop that condition, keep ${field} in SELECT and filter the rows (rows without it omit the key); to match values, use ${field} CONTAINS ANY ('value')` : ". Rewrite that condition with one of them, or drop it and filter the rows";
9866
- return {
9867
- action: "change_operator",
9868
- explanation: `${refused}${allowed}${guidance}`
9869
- };
9870
- }
9871
- },
9872
9852
  // 1. bare keyword.text → ad_group_criterion.keyword.text (leaves <resource>.keyword.text untouched)
9873
9853
  {
9874
9854
  matchQuery: /(?<![\w.])keyword\.text\b/,
@@ -9911,11 +9891,10 @@ var CORRECTION_RULES = [
9911
9891
  };
9912
9892
  }
9913
9893
  },
9914
- // 4. CONTAINS → LIKE. Keyed on the query alone: Google's error envelope ("Request contains an
9915
- // invalid argument … Valid operators: CONTAINS ANY") matches any loose error pattern, and this
9916
- // advice only makes sense when the query actually wrote CONTAINS(…).
9894
+ // 4. CONTAINS → LIKE
9917
9895
  {
9918
9896
  matchQuery: /CONTAINS\s*\(/i,
9897
+ matchApiError: /CONTAINS.*not.*supported|invalid.*operator.*CONTAINS/i,
9919
9898
  fix: (ctx) => {
9920
9899
  const match = ctx.originalQuery.match(/CONTAINS\s*\(\s*([^,]+),\s*'([^']+)'\s*\)/i);
9921
9900
  if (match) {
@@ -35539,15 +35518,38 @@ import { defineCommand as defineCommand119 } from "citty";
35539
35518
 
35540
35519
  // src/commands/canvas/catalog.ts
35541
35520
  import { defineCommand as defineCommand108 } from "citty";
35542
- var catalogCommand = defineCommand108({
35543
- meta: {
35544
- name: "catalog",
35545
- description: "Print the agent-facing node catalog (JSON Schema). Includes every registered node grouped by category."
35521
+ var DESCRIPTION = "The canvas node catalog. Start here: `baker canvas catalog` lists every node by category with one line each (a few KB). Then `--node video_generate` prints that node's full JSON Schema \u2014 params, inputs, outputs, models, when to use it. `--category image` narrows the list; add `--full` for that category's schemas. `--full` alone prints every schema (~160 KB) \u2014 prefer `--node`.";
35522
+ var ARGS = {
35523
+ node: {
35524
+ type: "string",
35525
+ required: false,
35526
+ description: "Node id(s) whose full schema to print, comma-separated. Example: --node video_generate,tts"
35546
35527
  },
35547
- async run() {
35548
- const cat = await generateCatalog(defaultRegistry());
35549
- process.stdout.write(`${JSON.stringify(cat, null, 2)}
35528
+ category: {
35529
+ type: "string",
35530
+ required: false,
35531
+ description: "Only this category (audio, video, image, \u2026). Listed with one line per node unless --full."
35532
+ },
35533
+ full: {
35534
+ type: "boolean",
35535
+ required: false,
35536
+ default: false,
35537
+ description: "Print full JSON Schemas instead of the one-line index (every node, or the --category)."
35538
+ }
35539
+ };
35540
+ registerSchema({ command: "canvas.catalog", description: DESCRIPTION, args: ARGS });
35541
+ var catalogCommand = defineCommand108({
35542
+ meta: { name: "catalog", description: DESCRIPTION },
35543
+ args: ARGS,
35544
+ async run({ args: args5 }) {
35545
+ const view = catalogView(generateCatalog(defaultRegistry()), {
35546
+ node: typeof args5.node === "string" ? args5.node : void 0,
35547
+ category: typeof args5.category === "string" ? args5.category : void 0,
35548
+ full: args5.full === true
35549
+ });
35550
+ process.stdout.write(`${JSON.stringify(view, null, 2)}
35550
35551
  `);
35552
+ if (!view.ok) process.exit(1);
35551
35553
  }
35552
35554
  });
35553
35555
 
@@ -43149,7 +43151,7 @@ var scaffoldAdCommand = defineCommand115({
43149
43151
  "video-model": {
43150
43152
  type: "string",
43151
43153
  required: false,
43152
- description: "Which curated video model renders the shots. Defaults to the one the lane picks; pass this only to compare models on the same brief, because mixing models across a campaign changes how the same face reads. `baker canvas catalog` lists what each one takes."
43154
+ description: "Which curated video model renders the shots. Defaults to the one the lane picks; pass this only to compare models on the same brief, because mixing models across a campaign changes how the same face reads. `baker canvas catalog --node video_generate` lists what each one takes."
43153
43155
  },
43154
43156
  "no-brand": {
43155
43157
  type: "boolean",
@@ -44515,7 +44517,7 @@ Subcommands:
44515
44517
  baker canvas run <file.json> \u2014 execute the canvas, write outputs to ./canvas/<run_id>/
44516
44518
  baker canvas rerun <slug> \u2014 restore a creative's latest recorded canvas from run history and run it (works in a fresh workspace)
44517
44519
  baker canvas sync-definition <path> \u2014 push a creative's current node-graph + input thumbnails to the dashboard without rendering (runs automatically on canvas/prompt edits)
44518
- baker canvas catalog \u2014 print the agent-facing node + composition catalog (JSON Schema)
44520
+ baker canvas catalog \u2014 one line per node; --node <id> for its full schema
44519
44521
  baker canvas inspect <run_id> \u2014 one-page summary of a completed run
44520
44522
  baker canvas scaffold-ad --spec <spec.json> \u2014 DEFAULT for a new ad: write beats (one spoken line + one shot each), get the whole runnable canvas
44521
44523
  baker canvas scaffold-video <video> \u2014 reproduce a video the USER gave you (an ad you found is inspiration, not a copy target)
@@ -63851,10 +63853,10 @@ var getCommand5 = defineCommand208({
63851
63853
 
63852
63854
  // src/commands/studio/improve.ts
63853
63855
  import { defineCommand as defineCommand209 } from "citty";
63854
- var DESCRIPTION = "Sharpen a rough brief into directed art direction \u2014 the same rewrite the client gets from the wand in the Studio prompt bar. Reach for it when you are relaying the CLIENT's own words and want them shaped without substituting your voice; when you are writing the art direction yourself, just write it, because you will do a better job than this does.";
63856
+ var DESCRIPTION2 = "Sharpen a rough brief into directed art direction \u2014 the same rewrite the client gets from the wand in the Studio prompt bar. Reach for it when you are relaying the CLIENT's own words and want them shaped without substituting your voice; when you are writing the art direction yourself, just write it, because you will do a better job than this does.";
63855
63857
  registerSchema({
63856
63858
  command: "studio.improve",
63857
- description: DESCRIPTION,
63859
+ description: DESCRIPTION2,
63858
63860
  args: {
63859
63861
  prompt: { type: "string", description: "The rough brief to sharpen", required: true },
63860
63862
  kind: {
@@ -63878,7 +63880,7 @@ registerSchema({
63878
63880
  var improveCommand = defineCommand209({
63879
63881
  meta: {
63880
63882
  name: "improve",
63881
- description: `${DESCRIPTION}
63883
+ description: `${DESCRIPTION2}
63882
63884
 
63883
63885
  Both the rewrite and the original come back, so you can show the client what changed rather than silently replacing their words. Nothing is generated \u2014 feed the result to \`baker studio generate\` yourself.
63884
63886
 
@@ -64026,10 +64028,10 @@ var listCommand18 = defineCommand211({
64026
64028
 
64027
64029
  // src/commands/studio/models.ts
64028
64030
  import { defineCommand as defineCommand212 } from "citty";
64029
- var DESCRIPTION2 = "What each Studio model actually accepts: its shapes, resolutions, clip lengths, prompt character cap, how many reference images it takes, and which knobs it has. Read this before a batch you care about \u2014 the models disagree far more than they look like they do, and a setting the chosen model does not have is REFUSED, not ignored.";
64031
+ var DESCRIPTION3 = "What each Studio model actually accepts: its shapes, resolutions, clip lengths, prompt character cap, how many reference images it takes, and which knobs it has. Read this before a batch you care about \u2014 the models disagree far more than they look like they do, and a setting the chosen model does not have is REFUSED, not ignored.";
64030
64032
  registerSchema({
64031
64033
  command: "studio.models",
64032
- description: DESCRIPTION2,
64034
+ description: DESCRIPTION3,
64033
64035
  args: {
64034
64036
  kind: {
64035
64037
  type: "string",
@@ -64115,7 +64117,7 @@ function buildModelCards(kind, model) {
64115
64117
  var modelsCommand = defineCommand212({
64116
64118
  meta: {
64117
64119
  name: "models",
64118
- description: `${DESCRIPTION2}
64120
+ description: `${DESCRIPTION3}
64119
64121
 
64120
64122
  Everything here is read from the same table the backend validates against, so it cannot drift from what a request will actually be allowed to do.
64121
64123