@koda-sl/baker-cli 0.348.0-dev.78a35388f → 0.348.0-dev.b9f092160

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/README.md CHANGED
@@ -3926,9 +3926,8 @@ baker canvas sync-definition src/creatives/<slug>/
3926
3926
  # 3. Inspect a finished run (per-node timing, file list, optional video thumbs)
3927
3927
  baker canvas inspect <run_id>
3928
3928
 
3929
- # 4. Discover what's available: a one-line index of every node, then one node's full schema
3930
- baker canvas catalog
3931
- baker canvas catalog --node video_generate
3929
+ # 4. Discover what's available (all node types, all models, all compositions)
3930
+ baker canvas catalog | jq
3932
3931
 
3933
3932
  # 5. Safely edit a node's prompt without hand-jq (UTF-8 safe — use --text-file for
3934
3933
  # multi-line / accented copy; the edit is re-validated before it is written back)
@@ -5231,8 +5230,8 @@ The tables above mirror `packages/canvas-contract/src/registry.ts` at the time o
5231
5230
 
5232
5231
  ```bash
5233
5232
  baker canvas catalog | jq '.categories | keys'
5234
- baker canvas catalog --node image_generate | jq '.entries[0].params'
5235
- baker canvas catalog --node video_generate | jq '.entries[0].params'
5233
+ baker canvas catalog | jq '.categories.image_generate[].id'
5234
+ baker canvas catalog | jq '.categories.video_generate[]'
5236
5235
  ```
5237
5236
 
5238
5237
  The validator surfaces unknown models / illegal aspect ratios / out-of-range params / missing required inputs with `did_you_mean` hints **before** the run starts.
@@ -5552,18 +5551,11 @@ Resolves the run dir against `--outputs-dir` (default `./canvas`) or accepts an
5552
5551
 
5553
5552
  #### `baker canvas catalog`
5554
5553
 
5555
- Prints the agent-facing node catalog. By default it is a compact index (a few KB): `categories` (category → node ids) and `nodes` (node id → one line), plus `hints`. Ask for full JSON Schemas by name:
5556
-
5557
- - `--node <id>[,<id>…]` — those nodes' full entries: `id`, `version`, `location`, `category`, `summary`, `when_to_use`, `inputs`/`params`/`outputs` schemas, `cost_estimate_credits`, `runtime_estimate_seconds`.
5558
- - `--category <name>` — narrow the index to one category; add `--full` for that category's full entries.
5559
- - `--full` — every node's full entry (~160 KB).
5560
-
5561
- An unknown node or category exits 1 with `{ ok: false, error: { code: "NOT_FOUND", fix } }` naming the valid ones.
5554
+ Prints the agent-facing node + composition catalog as JSON Schema. Every node has `id`, `version`, `location`, `category`, `summary`, `inputs`/`params`/`outputs` schemas, `cost_estimate_credits`, `runtime_estimate_seconds`, and (when present) `when_to_use`. Grouped by `category`. The `compositions` array enumerates every `@baker/*` composition with its full `meta.json`.
5562
5555
 
5563
5556
  ```bash
5564
- baker canvas catalog
5565
- baker canvas catalog --node video_generate
5566
- baker canvas catalog --category audio --full
5557
+ baker canvas catalog | jq '.categories | keys'
5558
+ baker canvas catalog | jq '.compositions[].id'
5567
5559
  ```
5568
5560
 
5569
5561
  ---
@@ -9605,83 +9605,6 @@ function generateCatalog(registry, opts = {}) {
9605
9605
  runtime_estimate_seconds: cost?.seconds_estimate
9606
9606
  };
9607
9607
  }).sort((a, b) => a.id.localeCompare(b.id));
9608
- return {
9609
- schema: "baker-canvas-catalog/2",
9610
- generated_at: opts.generatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
9611
- categories: groupIds(entries),
9612
- entries
9613
- };
9614
- }
9615
- var INDEX_SUMMARY_MAX = 160;
9616
- var sentences = new Intl.Segmenter("en", { granularity: "sentence" });
9617
- function oneLine(summary) {
9618
- const first = sentences.segment(summary)[Symbol.iterator]().next().value?.segment.trim() ?? summary;
9619
- if (first.length <= INDEX_SUMMARY_MAX) return first;
9620
- const cut = first.slice(0, INDEX_SUMMARY_MAX);
9621
- const lastSpace = cut.lastIndexOf(" ");
9622
- return `${(lastSpace > 0 ? cut.slice(0, lastSpace) : cut).replace(/[\s,;:—-]+$/u, "")}\u2026`;
9623
- }
9624
- function listIds(value) {
9625
- return (value ?? "").split(",").map((id) => id.trim()).filter((id) => id.length > 0);
9626
- }
9627
- function catalogView(catalog, opts) {
9628
- const knownIds = catalog.entries.map((e) => e.id);
9629
- const knownCategories = Object.keys(catalog.categories);
9630
- if (opts.category !== void 0 && !catalog.categories[opts.category]) {
9631
- return {
9632
- ok: false,
9633
- error: {
9634
- code: "NOT_FOUND",
9635
- message: `No node category "${opts.category}".`,
9636
- fix: `Pass one of: ${knownCategories.join(", ")}.`
9637
- }
9638
- };
9639
- }
9640
- const requestedIds = listIds(opts.node);
9641
- if (opts.node !== void 0 && requestedIds.length === 0) {
9642
- return {
9643
- ok: false,
9644
- error: {
9645
- code: "VALIDATION_ERROR",
9646
- message: "--node needs a node id.",
9647
- fix: "Run `baker canvas catalog` for the ids, then pass one (or several, comma-separated)."
9648
- }
9649
- };
9650
- }
9651
- const unknownIds = requestedIds.filter((id) => !knownIds.includes(id));
9652
- if (unknownIds.length > 0) {
9653
- return {
9654
- ok: false,
9655
- error: {
9656
- code: "NOT_FOUND",
9657
- message: `No node named ${unknownIds.map((id) => `"${id}"`).join(", ")}.`,
9658
- fix: `Pass one of: ${knownIds.join(", ")}.`
9659
- }
9660
- };
9661
- }
9662
- const inCategory = (e) => opts.category === void 0 || e.category === opts.category;
9663
- const categories = opts.category === void 0 ? catalog.categories : { [opts.category]: catalog.categories[opts.category] ?? [] };
9664
- if (requestedIds.length > 0) {
9665
- const entries = catalog.entries.filter((e) => requestedIds.includes(e.id));
9666
- return { ok: true, schema: catalog.schema, categories: groupIds(entries), entries };
9667
- }
9668
- if (opts.full) {
9669
- return { ok: true, schema: catalog.schema, categories, entries: catalog.entries.filter(inCategory) };
9670
- }
9671
- const nodes = {};
9672
- for (const e of catalog.entries.filter(inCategory)) nodes[e.id] = oneLine(e.summary);
9673
- return {
9674
- ok: true,
9675
- schema: catalog.schema,
9676
- categories,
9677
- nodes,
9678
- hints: [
9679
- "One node's params, inputs, outputs, models and when to use it: baker canvas catalog --node <id> (comma-separate several).",
9680
- "Every schema in a category: --category <name> --full. Every node: --full (large; prefer --node)."
9681
- ]
9682
- };
9683
- }
9684
- function groupIds(entries) {
9685
9608
  const categories = {};
9686
9609
  for (const e of entries) {
9687
9610
  let bucket = categories[e.category];
@@ -9691,7 +9614,12 @@ function groupIds(entries) {
9691
9614
  }
9692
9615
  bucket.push(e.id);
9693
9616
  }
9694
- return categories;
9617
+ return {
9618
+ schema: "baker-canvas-catalog/2",
9619
+ generated_at: opts.generatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
9620
+ categories,
9621
+ entries
9622
+ };
9695
9623
  }
9696
9624
  function safeCost(def) {
9697
9625
  if (!def.cost) return null;
@@ -9867,7 +9795,6 @@ export {
9867
9795
  durationSeconds,
9868
9796
  canonicalUrl,
9869
9797
  toModelSafeImage,
9870
- catalogView,
9871
9798
  BackendClient2,
9872
9799
  Engine2 as Engine,
9873
9800
  LocalAssetStore2 as LocalAssetStore,
@@ -9878,4 +9805,4 @@ export {
9878
9805
  defaultRegistry,
9879
9806
  createEngineFromEnv
9880
9807
  };
9881
- //# sourceMappingURL=chunk-4QG7SF4U.js.map
9808
+ //# sourceMappingURL=chunk-CEFJ5YSG.js.map