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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -23,7 +23,6 @@ import {
23
23
  YtDlpError,
24
24
  bestSupportedQuality,
25
25
  canonicalUrl,
26
- catalogView,
27
26
  clipAudioMode,
28
27
  clipDurationsFor,
29
28
  clipParamRecipe,
@@ -68,7 +67,7 @@ import {
68
67
  validateCanvasDeep,
69
68
  withoutCastName,
70
69
  ytDlpBlockSignal
71
- } from "./chunk-4QG7SF4U.js";
70
+ } from "./chunk-YBD3W4M7.js";
72
71
  import {
73
72
  csvOrJson,
74
73
  daysAgoIso,
@@ -7881,7 +7880,7 @@ function buildListHints({ returned, limit }) {
7881
7880
  return [];
7882
7881
  }
7883
7882
  return [
7884
- `This list is capped at ${limit} Tasks and came back full, so older Tasks exist that are NOT shown. Do not treat it as the whole backlog \u2014 re-run with --limit ${limit * 2} (or narrow with --status / --q).`
7883
+ `This list is capped at ${limit} Tasks and came back full, so older Tasks exist that are NOT shown. Do not treat it as the whole backlog \u2014 re-run with --limit ${limit * 2} (or narrow with --status / --search).`
7885
7884
  ];
7886
7885
  }
7887
7886
 
@@ -8491,8 +8490,13 @@ var linkCommand = defineCommand7({
8491
8490
  import { defineCommand as defineCommand8 } from "citty";
8492
8491
  registerSchema({
8493
8492
  command: "actions.list",
8494
- description: "List actions for the current company. Default: pre-bucketed (claimable/myClaims/blocked/claimedByOthers/completed/discarded), each bucket ordered do-first (blockers before blocked, then highest-leverage). The bucketed view reads the whole open backlog, so nothing pending is ever hidden from it. Set --bucketed=false for a flat list filterable by --status, orderable by --sort, and windowed by --limit.",
8493
+ description: 'List actions for the current company. Default: pre-bucketed (claimable/myClaims/blocked/claimedByOthers/completed/discarded), each bucket ordered do-first (blockers before blocked, then highest-leverage). The bucketed view reads the whole open backlog, so nothing pending is ever hidden from it. Set --bucketed=false for a flat list filterable by --status, orderable by --sort, and windowed by --limit. Looking for one Task by name? --search "conversion goal" --output md returns only the matching Tasks instead of the whole backlog.',
8495
8494
  args: {
8495
+ search: {
8496
+ type: "string",
8497
+ description: 'Find Tasks by words in their name, description or tags, searched on the server (e.g. --search "conversion goal"). Returns a flat list, best match first; by default it covers pending, in-progress and completed Tasks. Add --status to search one status instead, including discarded Tasks (--status discarded). Implies --bucketed=false.',
8498
+ required: false
8499
+ },
8496
8500
  bucketed: {
8497
8501
  type: "boolean",
8498
8502
  description: "Pre-bucket the results based on the current chat (default: true)",
@@ -8520,9 +8524,10 @@ registerSchema({
8520
8524
  var listCommand2 = defineCommand8({
8521
8525
  meta: {
8522
8526
  name: "list",
8523
- description: "List actions. Default: bucketed view (claimable, myClaims, blocked, claimedByOthers). Use --bucketed=false for raw filter by --status."
8527
+ description: "List actions. Default: bucketed view (claimable, myClaims, blocked, claimedByOthers). Use --bucketed=false for raw filter by --status, or --search <text> to find Tasks by name."
8524
8528
  },
8525
8529
  args: {
8530
+ search: { type: "string", description: "Find Tasks by words in name/description/tags", required: false },
8526
8531
  bucketed: { type: "boolean", description: "Pre-bucket by chat", required: false, default: true },
8527
8532
  status: { type: "string", description: "Status filter (raw mode)", required: false },
8528
8533
  sort: { type: "string", description: "Order (raw mode): priority|recent", required: false },
@@ -8531,12 +8536,9 @@ var listCommand2 = defineCommand8({
8531
8536
  },
8532
8537
  run: async ({ args: args5 }) => {
8533
8538
  try {
8534
- const bucketed = args5.bucketed !== false;
8535
- const parsedLimit = args5.limit === void 0 ? Number.NaN : Number.parseInt(String(args5.limit), 10);
8536
- const limit = Number.isFinite(parsedLimit) && parsedLimit > 0 ? parsedLimit : ACTIONS_LIST_DEFAULT_LIMIT;
8537
- const body = buildRequestBody(args5, bucketed, limit);
8539
+ const body = buildListRequest(args5, getEnv().BAKER_CHAT_ID);
8538
8540
  const response = await apiPost("/api/actions/list", body);
8539
- const hints2 = !bucketed && response.ok && Array.isArray(response.data) ? buildListHints({ returned: response.data.length, limit }) : [];
8541
+ const hints2 = body.bucketed === false && body.limit !== void 0 && response.ok && Array.isArray(response.data) ? buildListHints({ returned: response.data.length, limit: body.limit }) : [];
8540
8542
  const envelope = hints2.length > 0 ? { ...response, hints: hints2 } : response;
8541
8543
  if (args5.output === "md" && envelope.ok) {
8542
8544
  process.stdout.write(renderMarkdown(envelope.data, hints2));
@@ -8548,20 +8550,25 @@ var listCommand2 = defineCommand8({
8548
8550
  }
8549
8551
  }
8550
8552
  });
8551
- function buildRequestBody(args5, bucketed, limit) {
8552
- const env = getEnv();
8553
- const body = { bucketed };
8554
- if (bucketed) {
8555
- if (env.BAKER_CHAT_ID) {
8556
- body.chatId = env.BAKER_CHAT_ID;
8557
- }
8558
- return body;
8553
+ function buildListRequest(args5, chatId) {
8554
+ const q = args5.search?.trim();
8555
+ if (args5.bucketed !== false && !q) {
8556
+ return chatId ? { bucketed: true, chatId } : { bucketed: true };
8557
+ }
8558
+ const parsedLimit = args5.limit === void 0 ? Number.NaN : Number.parseInt(String(args5.limit), 10);
8559
+ const body = {
8560
+ bucketed: false,
8561
+ // Default to do-first ordering so the flat list matches its documented
8562
+ // contract; only "recent" opts out. A search keeps relevance order.
8563
+ sort: args5.sort === "recent" ? "recent" : "priority",
8564
+ limit: Number.isFinite(parsedLimit) && parsedLimit > 0 ? parsedLimit : ACTIONS_LIST_DEFAULT_LIMIT
8565
+ };
8566
+ if (q) {
8567
+ body.q = q;
8559
8568
  }
8560
8569
  if (args5.status) {
8561
8570
  body.status = args5.status;
8562
8571
  }
8563
- body.sort = args5.sort === "recent" ? "recent" : "priority";
8564
- body.limit = limit;
8565
8572
  return body;
8566
8573
  }
8567
8574
  function toRow(entry) {
@@ -35518,38 +35525,15 @@ import { defineCommand as defineCommand119 } from "citty";
35518
35525
 
35519
35526
  // src/commands/canvas/catalog.ts
35520
35527
  import { defineCommand as defineCommand108 } from "citty";
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"
35527
- },
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
35528
  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)}
35529
+ meta: {
35530
+ name: "catalog",
35531
+ description: "Print the agent-facing node catalog (JSON Schema). Includes every registered node grouped by category."
35532
+ },
35533
+ async run() {
35534
+ const cat = await generateCatalog(defaultRegistry());
35535
+ process.stdout.write(`${JSON.stringify(cat, null, 2)}
35551
35536
  `);
35552
- if (!view.ok) process.exit(1);
35553
35537
  }
35554
35538
  });
35555
35539
 
@@ -43151,7 +43135,7 @@ var scaffoldAdCommand = defineCommand115({
43151
43135
  "video-model": {
43152
43136
  type: "string",
43153
43137
  required: false,
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."
43138
+ 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."
43155
43139
  },
43156
43140
  "no-brand": {
43157
43141
  type: "boolean",
@@ -44517,7 +44501,7 @@ Subcommands:
44517
44501
  baker canvas run <file.json> \u2014 execute the canvas, write outputs to ./canvas/<run_id>/
44518
44502
  baker canvas rerun <slug> \u2014 restore a creative's latest recorded canvas from run history and run it (works in a fresh workspace)
44519
44503
  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)
44520
- baker canvas catalog \u2014 one line per node; --node <id> for its full schema
44504
+ baker canvas catalog \u2014 print the agent-facing node + composition catalog (JSON Schema)
44521
44505
  baker canvas inspect <run_id> \u2014 one-page summary of a completed run
44522
44506
  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
44523
44507
  baker canvas scaffold-video <video> \u2014 reproduce a video the USER gave you (an ad you found is inspiration, not a copy target)
@@ -50015,7 +49999,7 @@ function outputRows(rows, args5, response, cached) {
50015
49999
  }
50016
50000
  writeJsonEnvelope({ ...response, ...cached && { cached: true } });
50017
50001
  }
50018
- function buildRequestBody2(args5, propertyId, useCache) {
50002
+ function buildRequestBody(args5, propertyId, useCache) {
50019
50003
  const body = { propertyId };
50020
50004
  if (args5.preset) body.preset = args5.preset;
50021
50005
  if (args5.dimensions) body.dimensions = args5.dimensions.split(",").map((d) => d.trim());
@@ -50090,7 +50074,7 @@ Free-form (escape hatch):
50090
50074
  }
50091
50075
  const propertyId = await resolvePropertyId(args5);
50092
50076
  const useCache = !args5["no-cache"];
50093
- const body = buildRequestBody2(args5, propertyId, useCache);
50077
+ const body = buildRequestBody(args5, propertyId, useCache);
50094
50078
  const cacheKey = buildQueryCacheKey(propertyId, JSON.stringify(body));
50095
50079
  if (useCache) {
50096
50080
  const cached = cacheGet("ga4-queries", cacheKey);
@@ -51015,7 +50999,7 @@ function outputRows2(rows, args5, response, cached) {
51015
50999
  }
51016
51000
  writeJsonEnvelope({ ...response, ...cached && { cached: true } });
51017
51001
  }
51018
- function buildRequestBody3(args5, siteUrl, useCache) {
51002
+ function buildRequestBody2(args5, siteUrl, useCache) {
51019
51003
  const body = { siteUrl };
51020
51004
  if (args5.preset) body.preset = args5.preset;
51021
51005
  if (args5.brand) body.brand = args5.brand;
@@ -51099,7 +51083,7 @@ Free-form (escape hatch):
51099
51083
  }
51100
51084
  const siteUrl = await resolveSiteUrl(args5);
51101
51085
  const useCache = !args5["no-cache"];
51102
- const body = buildRequestBody3(args5, siteUrl, useCache);
51086
+ const body = buildRequestBody2(args5, siteUrl, useCache);
51103
51087
  const cacheKey = buildQueryCacheKey(siteUrl, JSON.stringify(body));
51104
51088
  if (useCache) {
51105
51089
  const cached = cacheGet("gsc-queries", cacheKey);
@@ -63853,10 +63837,10 @@ var getCommand5 = defineCommand208({
63853
63837
 
63854
63838
  // src/commands/studio/improve.ts
63855
63839
  import { defineCommand as defineCommand209 } from "citty";
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.";
63840
+ 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.";
63857
63841
  registerSchema({
63858
63842
  command: "studio.improve",
63859
- description: DESCRIPTION2,
63843
+ description: DESCRIPTION,
63860
63844
  args: {
63861
63845
  prompt: { type: "string", description: "The rough brief to sharpen", required: true },
63862
63846
  kind: {
@@ -63880,7 +63864,7 @@ registerSchema({
63880
63864
  var improveCommand = defineCommand209({
63881
63865
  meta: {
63882
63866
  name: "improve",
63883
- description: `${DESCRIPTION2}
63867
+ description: `${DESCRIPTION}
63884
63868
 
63885
63869
  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.
63886
63870
 
@@ -64028,10 +64012,10 @@ var listCommand18 = defineCommand211({
64028
64012
 
64029
64013
  // src/commands/studio/models.ts
64030
64014
  import { defineCommand as defineCommand212 } from "citty";
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.";
64015
+ 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.";
64032
64016
  registerSchema({
64033
64017
  command: "studio.models",
64034
- description: DESCRIPTION3,
64018
+ description: DESCRIPTION2,
64035
64019
  args: {
64036
64020
  kind: {
64037
64021
  type: "string",
@@ -64117,7 +64101,7 @@ function buildModelCards(kind, model) {
64117
64101
  var modelsCommand = defineCommand212({
64118
64102
  meta: {
64119
64103
  name: "models",
64120
- description: `${DESCRIPTION3}
64104
+ description: `${DESCRIPTION2}
64121
64105
 
64122
64106
  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.
64123
64107