@koda-sl/baker-cli 0.357.0 → 0.359.0-dev.5dbf6338c

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
@@ -5082,8 +5082,11 @@ Cast an ElevenLabs voice from a natural-language description (e.g. a blueprint's
5082
5082
  |---|---|---|---|
5083
5083
  | `description` | string | yes | the casting brief |
5084
5084
  | `gender` / `age` / `accent` / `language` | string | no | structured hints that sharpen the ranking |
5085
+ | `voice_id` | string | no | a voice already chosen — skips the ranking and emits it as-is |
5085
5086
  | `limit` | number | no | how many `candidates` to return (default 5) |
5086
5087
 
5088
+ `language` is strict: when no voice on the account speaks it, the node fails (`voice_language_unavailable`) before anything downstream is voiced. `gender` is strict within that language unless nobody there has it — then it is dropped and `baker canvas run` prints a `[warn]` naming the voice cast instead.
5089
+
5087
5090
  **Outputs** — `voice_id` (text, bare id) + `candidates` (json, ranked shortlist). Wire `voice_id` into a `tts` node: set `inputs.voice_ref: $ref:<this>.voice_id` and `params.voice: "{{voice_ref}}"` — the engine splices the id in at run time.
5088
5091
 
5089
5092
  **Cost** — free (voice listing). Generation is billed under `tts`/`dialogue`.
@@ -5289,7 +5292,7 @@ Every run gets its own directory:
5289
5292
  - Naming: `<node_id>__<slot>[__<index>].<ext>`.
5290
5293
  - `_final.<ext>` is a copy of whichever node the top-level `output` points at.
5291
5294
  - `manifest.json` is what `baker canvas inspect` reads — duration, cache hit/miss, asset refs, errors.
5292
- - Default root is `./canvas/`. Override with `--outputs-dir`.
5295
+ - Default root is `canvas/` at the workspace root (the nearest folder with a `package.json` above the canvas file), whichever directory you run from. Override with `--outputs-dir`.
5293
5296
 
5294
5297
  ---
5295
5298
 
@@ -5301,7 +5304,7 @@ Cache key:
5301
5304
  sha256(canonical({ node_id, node_version, params, input_hashes, cache_salt, extras }))
5302
5305
  ```
5303
5306
 
5304
- - Entries live in `./canvas/.cache/` (index + content-addressed blobs).
5307
+ - Entries live in `canvas/.cache/` at the workspace root (index + content-addressed blobs).
5305
5308
  - Cache hits re-materialize asset files into the new run dir instantly; misses execute the node and write a new entry atomically.
5306
5309
  - `hyperframe_*` folds a recursive sha256 of the composition directory into `extras` — edit any file in `my-composition/` and the cache busts automatically. No version bump needed.
5307
5310
  - If computing `extras` fails (e.g. the composition directory is unreadable), the node fails with that error — it never falls back to a partial cache key, so stale results can't be served silently.
@@ -5396,8 +5399,8 @@ Validate, then execute the graph. Blocks until done. Logs one line per node. Ret
5396
5399
 
5397
5400
  | Flag | Default | Effect |
5398
5401
  |---|---|---|
5399
- | `--cache-dir <path>` | `./canvas/.cache` | Where content-addressed bytes + cache index live. |
5400
- | `--outputs-dir <path>` | `./canvas` | Root for per-run output directories. |
5402
+ | `--cache-dir <path>` | `<workspace root>/canvas/.cache` | Where content-addressed bytes + cache index live. |
5403
+ | `--outputs-dir <path>` | `<workspace root>/canvas` | Root for per-run output directories. |
5401
5404
  | `--run-id <id>` | auto ULID | Override the generated run id. |
5402
5405
  | `--cache-policy <policy>` | `read_write` | `read_write`, `bypass`, or `read_only`. |
5403
5406
  | `--concurrency <n>` | `5` (or `BAKER_CANVAS_CONCURRENCY`) | Max nodes executing at once within a layer. |
@@ -74,7 +74,7 @@
74
74
  "transcript": "$ref:transcribe.transcript"
75
75
  },
76
76
  "params": {
77
- "composition": "./packages/cli/canvas/tiktok-captions-composition",
77
+ "composition": "./tiktok-captions-composition",
78
78
  "words_per_group": 3,
79
79
  "font_size": 72,
80
80
  "text_color": "#ffffff",
@@ -22,7 +22,7 @@
22
22
  "background": "$ref:person_image.images#0"
23
23
  },
24
24
  "params": {
25
- "composition": "./packages/cli/canvas/hello-world-composition",
25
+ "composition": "./hello-world-composition",
26
26
  "text": "HELLO WORLD!!",
27
27
  "font_size": 128,
28
28
  "text_color": "#ffffff",
@@ -20,9 +20,9 @@ import {
20
20
  shouldEscalate
21
21
  } from "./chunk-2OKSJNLA.js";
22
22
 
23
- // ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js
23
+ // ../../.pnpm-store/v10/links/@/safe-stable-stringify/2.5.0/766ad107c42df28eeadaf0ac2f9089c8a9e200f6ba0b2b1a817b8d536cbdcc49/node_modules/safe-stable-stringify/index.js
24
24
  var require_safe_stable_stringify = __commonJS({
25
- "../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(exports, module) {
25
+ "../../.pnpm-store/v10/links/@/safe-stable-stringify/2.5.0/766ad107c42df28eeadaf0ac2f9089c8a9e200f6ba0b2b1a817b8d536cbdcc49/node_modules/safe-stable-stringify/index.js"(exports, module) {
26
26
  "use strict";
27
27
  var { hasOwnProperty } = Object.prototype;
28
28
  var stringify = configure2();
@@ -1114,7 +1114,7 @@ function resolveAdaptFormats(params) {
1114
1114
  return params.formats ?? [];
1115
1115
  }
1116
1116
 
1117
- // ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/esm/wrapper.js
1117
+ // ../../.pnpm-store/v10/links/@/safe-stable-stringify/2.5.0/766ad107c42df28eeadaf0ac2f9089c8a9e200f6ba0b2b1a817b8d536cbdcc49/node_modules/safe-stable-stringify/esm/wrapper.js
1118
1118
  var import__ = __toESM(require_safe_stable_stringify(), 1);
1119
1119
  var configure = import__.default.configure;
1120
1120
  var wrapper_default = import__.default;
@@ -5191,6 +5191,7 @@ var Engine = class {
5191
5191
  outputs[node.id] = hit.outputs;
5192
5192
  await this.materializeNodeOutputs(node.id, hit.outputs, writer);
5193
5193
  this.log(`[exec ] ${node.id.padEnd(20)} ${node.type.padEnd(20)} cached`);
5194
+ this.logOutputWarnings(node.id, hit.outputs);
5194
5195
  return { cached: true, credits: 0, durationMs: Date.now() - cacheT0 };
5195
5196
  }
5196
5197
  }
@@ -5233,8 +5234,18 @@ var Engine = class {
5233
5234
  }
5234
5235
  await this.materializeNodeOutputs(node.id, outputsObj, writer);
5235
5236
  this.log(`[exec ] ${node.id.padEnd(20)} ${node.type.padEnd(20)} fresh (${(elapsed / 1e3).toFixed(1)}s)`);
5237
+ this.logOutputWarnings(node.id, outputsObj);
5236
5238
  return { cached: false, credits, durationMs: elapsed };
5237
5239
  }
5240
+ /**
5241
+ * Print the warnings a node left on its outputs' metadata — a `voice_select` that
5242
+ * could not honor the requested gender, say. Left in the metadata alone they were
5243
+ * read only after the render was paid for and somebody listened. Printed on a
5244
+ * cached replay too: the output still carries the compromise.
5245
+ */
5246
+ logOutputWarnings(nodeId, outputs) {
5247
+ for (const warning of outputWarnings(outputs)) this.log(`[warn ] ${nodeId}: ${warning}`);
5248
+ }
5238
5249
  async materializeNodeOutputs(nodeId, outputs, writer) {
5239
5250
  for (const [name, value] of Object.entries(outputs)) {
5240
5251
  if (isAssetRef(value)) {
@@ -5279,6 +5290,16 @@ var Engine = class {
5279
5290
  return await fix(inputs);
5280
5291
  }
5281
5292
  };
5293
+ function refWarnings(ref) {
5294
+ if (!isAssetRef(ref)) return [];
5295
+ const warnings = ref.metadata?.warnings;
5296
+ if (!Array.isArray(warnings)) return [];
5297
+ return warnings.filter((w) => typeof w === "string" && w.length > 0);
5298
+ }
5299
+ function outputWarnings(outputs) {
5300
+ const refs = Object.values(outputs).flatMap((value) => Array.isArray(value) ? value : [value]);
5301
+ return [...new Set(refs.flatMap(refWarnings))];
5302
+ }
5282
5303
  function resolveRegenerateToken(node, forced, runId) {
5283
5304
  if (forced?.has(node.id)) return `run:${runId}`;
5284
5305
  if (node.regenerate !== void 0) return `node:${String(node.regenerate)}`;
@@ -9563,10 +9584,14 @@ var voiceSelectNode = delegated({
9563
9584
  // to move with it: the cache key is built from this string, so entries written under
9564
9585
  // 1.0.0 kept replaying the broken shape long after the fix was deployed. A node whose
9565
9586
  // OUTPUT shape changes has to bump, not only one whose behaviour does.
9566
- version: "1.1.0",
9587
+ // 1.2.0: `language` is a hard constraint — a language no voice on the account speaks
9588
+ // fails the node instead of casting a voice of another language, and a gender nobody
9589
+ // in the language has is relaxed with a printed warning. Bumped so a 1.1.0 cache entry
9590
+ // holding a wrong-language cast stops replaying.
9591
+ version: "1.2.0",
9567
9592
  category: "audio",
9568
9593
  summary: 'Cast an ElevenLabs voice from a natural-language description (e.g. "warm, authoritative female narrator, American accent"). Lists the account\'s voices and ranks them against the brief, emitting the best `voice_id` as a bare-string text asset plus a ranked `candidates` JSON.',
9569
- when_to_use: 'Use to turn a voice description (e.g. from a `video_deconstruct` blueprint\'s `voice_description`) into a usable ElevenLabs voice id, then feed it into a `tts` node by wiring `inputs.voice_ref: $ref:<this>.voice_id` and setting `params.voice: "{{voice_ref}}"` \u2014 the engine splices the id in at run time. Review `candidates` (json) to pick a different voice. Optional `gender`/`age`/`accent`/`language` hints sharpen the ranking.',
9594
+ when_to_use: 'Use to turn a voice description (e.g. from a `video_deconstruct` blueprint\'s `voice_description`) into a usable ElevenLabs voice id, then feed it into a `tts` node by wiring `inputs.voice_ref: $ref:<this>.voice_id` and setting `params.voice: "{{voice_ref}}"` \u2014 the engine splices the id in at run time. Review `candidates` (json) to pick a different voice. Optional `gender`/`age`/`accent`/`language` hints sharpen the ranking. `language` is strict: when no voice on the account speaks it the node fails before anything is voiced (add a voice in that language, or pass its `voice_id`). A `gender` nobody in that language has is dropped and `baker canvas run` prints a `[warn]` naming the voice cast instead.',
9570
9595
  inputs: z34.object({}).loose(),
9571
9596
  params: z34.object({
9572
9597
  description: z34.string().min(1),
@@ -9879,4 +9904,4 @@ export {
9879
9904
  defaultRegistry,
9880
9905
  createEngineFromEnv
9881
9906
  };
9882
- //# sourceMappingURL=chunk-H3SAAHZA.js.map
9907
+ //# sourceMappingURL=chunk-K2IKLMCM.js.map