@koda-sl/baker-cli 0.382.0-dev.a410b0488 → 0.382.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
@@ -70,7 +70,7 @@ import {
70
70
  validateCanvasDeep,
71
71
  withoutCastName,
72
72
  ytDlpBlockSignal
73
- } from "./chunk-CHJOTJTZ.js";
73
+ } from "./chunk-FGHMWBUD.js";
74
74
  import {
75
75
  NAME_CONTAINS_ARG,
76
76
  csvOrJson,
@@ -40790,10 +40790,18 @@ function dropUncastVoices(nodes) {
40790
40790
  if (node && node.type === "voice_select" && !referenced.has(node.id)) nodes.splice(i, 1);
40791
40791
  }
40792
40792
  }
40793
- function scaffoldVideoCanvas(input, elementsInput, opts) {
40793
+ function framesReuseRefusal(blueprint, elements, requested) {
40794
+ if (requested !== "reuse") return void 0;
40795
+ const showsPeople = (blueprint.global?.cast ?? []).length > 0 || elements.some((e) => e.type.toLowerCase() === "person");
40796
+ if (!showsPeople) return void 0;
40797
+ return "--frames reuse was not applied: this video shows people, and reusing its frames would put the source's actors into our ad. Every frame is generated instead, recast to the el_* references. Reuse applies only to a video with nobody in it.";
40798
+ }
40799
+ function scaffoldVideoCanvas(input, elementsInput, requested) {
40794
40800
  const blueprint = VideoBlueprint.parse(input);
40795
40801
  injectHookPhysicality(blueprint);
40796
40802
  const elements = RecurringElements.parse(elementsInput);
40803
+ const reuseRefused = framesReuseRefusal(blueprint, elements, requested.frames);
40804
+ const opts = reuseRefused ? { ...requested, frames: "generate" } : requested;
40797
40805
  const clock = spineClockFor(blueprint);
40798
40806
  const nodes = [];
40799
40807
  emitBlueprintIngests(opts, nodes);
@@ -40896,6 +40904,7 @@ function scaffoldVideoCanvas(input, elementsInput, opts) {
40896
40904
  }
40897
40905
  const todo = {
40898
40906
  ...buildVideoTodo(videoReport(input, elementsInput), overlays.length, floating.length, opts, blueprint),
40907
+ ...reuseRefused ? { frames_reuse_refused: reuseRefused } : {},
40899
40908
  ...aspectRemapTodo(resolveAspect(blueprint.source?.aspect_ratio, opts.aspect, genAspectsFor(opts.videoModel))),
40900
40909
  model_constraints: buildModelConstraints()
40901
40910
  };
@@ -42021,12 +42030,6 @@ async function restoreRunSnapshot(manifest, targetDir, opts = {}) {
42021
42030
  return { canvasPath: path14.resolve(resolvedTarget, manifest.canvas.path), restored, upToDate };
42022
42031
  }
42023
42032
 
42024
- // src/commands/canvas/unchanged-run.ts
42025
- function unchangedRunHint(runId, stats) {
42026
- if (stats.total_nodes === 0 || stats.cached_nodes < stats.total_nodes) return null;
42027
- return `Nothing changed since the last render: every step came from the cache, so this run is no new version. To read what a render produced, use \`baker canvas inspect ${runId}\` instead of re-running; re-run a canvas only after editing it or the files it reads.`;
42028
- }
42029
-
42030
42033
  // src/engine/nodes/local/lib/render-review.ts
42031
42034
  import { execFile as execFile2 } from "child_process";
42032
42035
  import { mkdtemp, readdir as readdir6, readFile as readFile11, rm as rm5 } from "fs/promises";
@@ -42910,8 +42913,6 @@ ${describeRewrites(healed.rewrites)}
42910
42913
  `Anything about the mark or the closing card is a composition fix, not a re-render: both are drawn as HTML by the caption composition, so editing it and re-running re-renders only that pass \u2014 the clips are cached and no generation is paid for again. Fix them, then re-run: edit the \`show\` of the scene files named above \u2014 a shot with a person handling equipment is where limbs and objects go wrong, so widen it, move the hands out of frame, or drop the person from that beat. Re-running re-renders only the scenes you edited; everything else comes from the cache (this run: ${result.stats?.cached_nodes ?? 0} of ${result.stats?.total_nodes ?? 0} nodes were cached).`
42911
42914
  ] : []
42912
42915
  ] : [];
42913
- const unchanged = result.stats ? unchangedRunHint(result.run_id, result.stats) : null;
42914
- if (unchanged) hints2.push(unchanged);
42915
42916
  if (poster) {
42916
42917
  await poster.flush(
42917
42918
  // `review` is null only when nobody looked (no key, no ffmpeg, unreadable video);
@@ -45830,6 +45831,12 @@ function videoDefinitionDescription(blueprint) {
45830
45831
  const product = g.branding?.product;
45831
45832
  return typeof product === "string" && product.trim() ? product.trim() : void 0;
45832
45833
  }
45834
+ function framesModeReport(canvas, requested) {
45835
+ const todo = canvas.metadata?.todo;
45836
+ const mode = typeof todo?.frames_mode === "string" ? todo.frames_mode : requested;
45837
+ const refused = typeof todo?.frames_reuse_refused === "string" ? todo.frames_reuse_refused : void 0;
45838
+ return { frames_mode: mode, ...refused ? { frames_reuse_refused: refused } : {} };
45839
+ }
45833
45840
  async function materializeReferenceVideo(fileArg2) {
45834
45841
  if (!/^https?:\/\//i.test(fileArg2)) return path26.resolve(fileArg2);
45835
45842
  let bytes;
@@ -45987,7 +45994,10 @@ var scaffoldVideoCommand = defineCommand116({
45987
45994
  type: "string",
45988
45995
  description: "Creative slug \u2014 writes the canvas to src/creatives/<slug>/<slug>.canvas.json (repo convention)"
45989
45996
  },
45990
- frames: { type: "string", description: '"generate" (default, anchored regen) or "reuse" (wire real frames in)' },
45997
+ frames: {
45998
+ type: "string",
45999
+ description: `"generate" (default, every frame regenerated for our ad) or "reuse" (wire the source's real frames in). Reuse applies only to a video with nobody in it \u2014 on a video showing people it is refused and every frame is generated, so the source's actors never reach our ad.`
46000
+ },
45991
46001
  ambient: {
45992
46002
  type: "boolean",
45993
46003
  description: "Give silent b-roll scenes native diegetic ambient mixed deep under the music bed (off by default)"
@@ -46190,6 +46200,7 @@ var scaffoldVideoCommand = defineCommand116({
46190
46200
  error: { code: "validation", issues: validation.issues },
46191
46201
  canvas_path: outPath,
46192
46202
  prompt_path: blueprintPath,
46203
+ ...framesModeReport(canvas, frames),
46193
46204
  note: "The canvas WAS written despite the blocking issue(s) \u2014 fix them in place, then `baker canvas validate` before running.",
46194
46205
  ...uncastHint
46195
46206
  },
@@ -46241,7 +46252,7 @@ var scaffoldVideoCommand = defineCommand116({
46241
46252
  composition_dir: compositionDest,
46242
46253
  output: canvas.output,
46243
46254
  ...uncastHint,
46244
- frames_mode: frames,
46255
+ ...framesModeReport(canvas, frames),
46245
46256
  models: {
46246
46257
  deconstruct: deconstructModel,
46247
46258
  select: selectModel,