@koda-sl/baker-cli 0.113.2 → 0.114.1
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 +22 -0
- package/dist/{chunk-7K2YAWUT.js → chunk-ZWMMCLJ4.js} +165 -17
- package/dist/chunk-ZWMMCLJ4.js.map +1 -0
- package/dist/cli.js +51 -7
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.d.ts +14 -0
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-7K2YAWUT.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
generateCatalog,
|
|
13
13
|
resolveConcurrency,
|
|
14
14
|
validateCanvasDeep
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ZWMMCLJ4.js";
|
|
16
16
|
|
|
17
17
|
// src/cli.ts
|
|
18
18
|
import { defineCommand as defineCommand155, runMain } from "citty";
|
|
@@ -11133,6 +11133,10 @@ var runCommand = defineCommand83({
|
|
|
11133
11133
|
type: "string",
|
|
11134
11134
|
description: "Max nodes per layer in flight at once (default 5; env BAKER_CANVAS_CONCURRENCY)"
|
|
11135
11135
|
},
|
|
11136
|
+
parallel: {
|
|
11137
|
+
type: "string",
|
|
11138
|
+
description: "Alias for --concurrency: independent clips (and every other same-layer node) already fan out in parallel up to this bound"
|
|
11139
|
+
},
|
|
11136
11140
|
"keep-runs": {
|
|
11137
11141
|
type: "string",
|
|
11138
11142
|
description: "After the run, prune old r_* run dirs, keeping the N newest (off by default)"
|
|
@@ -11182,7 +11186,8 @@ var runCommand = defineCommand83({
|
|
|
11182
11186
|
run_id: args["run-id"] ? String(args["run-id"]) : void 0,
|
|
11183
11187
|
cache_policy: policy,
|
|
11184
11188
|
concurrency: resolveConcurrency(
|
|
11185
|
-
|
|
11189
|
+
// --concurrency wins; --parallel is the discoverable alias for the same bound.
|
|
11190
|
+
(args.concurrency ?? args.parallel) !== void 0 ? String(args.concurrency ?? args.parallel) : void 0,
|
|
11186
11191
|
process.env.BAKER_CANVAS_CONCURRENCY
|
|
11187
11192
|
)
|
|
11188
11193
|
});
|
|
@@ -14142,7 +14147,8 @@ function scaffoldVideoCanvas(input, elementsInput, opts) {
|
|
|
14142
14147
|
}
|
|
14143
14148
|
const todo = {
|
|
14144
14149
|
...buildVideoTodo(videoReport(input, elementsInput), overlays.length, floating.length, opts, blueprint),
|
|
14145
|
-
...aspectRemapTodo(resolveAspect(blueprint.source?.aspect_ratio, opts.aspect, genAspectsFor(opts.videoModel)))
|
|
14150
|
+
...aspectRemapTodo(resolveAspect(blueprint.source?.aspect_ratio, opts.aspect, genAspectsFor(opts.videoModel))),
|
|
14151
|
+
model_constraints: buildModelConstraints()
|
|
14146
14152
|
};
|
|
14147
14153
|
return {
|
|
14148
14154
|
schema: "baker-canvas/1",
|
|
@@ -14153,21 +14159,58 @@ function scaffoldVideoCanvas(input, elementsInput, opts) {
|
|
|
14153
14159
|
// The timing plan `baker canvas validate` checks before any billed render:
|
|
14154
14160
|
// sequenced voiceover turns (no overlap), audio ≈ video length, and which
|
|
14155
14161
|
// scenes must be lip-synced.
|
|
14156
|
-
video: buildVideoMeta(blueprint, { vo_segments, talking_scenes })
|
|
14162
|
+
video: buildVideoMeta(blueprint, { vo_segments, talking_scenes }, slots, nodes)
|
|
14157
14163
|
},
|
|
14158
14164
|
nodes,
|
|
14159
14165
|
output: { node: videoNode, output: "video" }
|
|
14160
14166
|
};
|
|
14161
14167
|
}
|
|
14162
|
-
function buildVideoMeta(blueprint, meta) {
|
|
14168
|
+
function buildVideoMeta(blueprint, meta, slots, nodes) {
|
|
14163
14169
|
return {
|
|
14164
14170
|
duration_s: blueprint.source?.duration_s ?? lastSceneEnd(blueprint),
|
|
14165
14171
|
vo_segments: [...meta.vo_segments].sort((a, b) => a.start_s - b.start_s),
|
|
14166
14172
|
talking_scenes: meta.talking_scenes,
|
|
14167
14173
|
lip_sync_caution: buildLipSyncCaution(meta.vo_segments),
|
|
14168
|
-
motion_board: buildMotionBoard(blueprint)
|
|
14174
|
+
motion_board: buildMotionBoard(blueprint),
|
|
14175
|
+
// The wired recurring-element registry (the reference-completeness check reads
|
|
14176
|
+
// `ref`/`label`/`type` to warn when a frame describes an element it doesn't wire).
|
|
14177
|
+
elements: slots.map((s) => ({
|
|
14178
|
+
ref: s.ref,
|
|
14179
|
+
label: s.label,
|
|
14180
|
+
type: s.type,
|
|
14181
|
+
...s.description ? { description: s.description } : {}
|
|
14182
|
+
})),
|
|
14183
|
+
clip_spans: buildClipSpans(blueprint, nodes)
|
|
14169
14184
|
};
|
|
14170
14185
|
}
|
|
14186
|
+
function buildModelConstraints() {
|
|
14187
|
+
const models = {};
|
|
14188
|
+
for (const [id, spec] of Object.entries(MODEL_REGISTRY.video_generate)) {
|
|
14189
|
+
const p = spec.params;
|
|
14190
|
+
models[id] = {
|
|
14191
|
+
label: spec.label,
|
|
14192
|
+
aspect_ratios: p.aspect_ratio?.enum ?? null,
|
|
14193
|
+
durations_s: p.duration?.enum ?? null,
|
|
14194
|
+
person_generation: p.person_generation?.enum ?? null
|
|
14195
|
+
};
|
|
14196
|
+
}
|
|
14197
|
+
return {
|
|
14198
|
+
note: "Switching a clip's video model has cross-node constraints. ALL video_generate nodes in one canvas MUST share ONE aspect_ratio (the composite silently crops otherwise). Each model's `duration` is a hard enum and differs per model \u2014 a scene longer than the model's max must be split. `person_generation` differs (Veo requires \"allow_all\"). `baker canvas validate` gates duration, aspect agreement, per-model params, AND a scene-span-vs-model-max advisory before any billed run \u2014 run it after every model edit.",
|
|
14199
|
+
models
|
|
14200
|
+
};
|
|
14201
|
+
}
|
|
14202
|
+
function buildClipSpans(blueprint, nodes) {
|
|
14203
|
+
const spans = [];
|
|
14204
|
+
for (const n of nodes) {
|
|
14205
|
+
if (n.type !== "video_generate") continue;
|
|
14206
|
+
const m = n.id.match(/^s(\d+)/);
|
|
14207
|
+
const idx = m ? Number(m[1]) : Number.NaN;
|
|
14208
|
+
const scene = Number.isInteger(idx) ? blueprint.scenes[idx] : void 0;
|
|
14209
|
+
if (!scene) continue;
|
|
14210
|
+
spans.push({ node: n.id, span_s: Math.round(sceneDurationS(scene) * 100) / 100 });
|
|
14211
|
+
}
|
|
14212
|
+
return spans;
|
|
14213
|
+
}
|
|
14171
14214
|
function buildLipSyncCaution(segments) {
|
|
14172
14215
|
const out = [];
|
|
14173
14216
|
const byScene = /* @__PURE__ */ new Map();
|
|
@@ -14936,7 +14979,8 @@ var validateCommand = defineCommand87({
|
|
|
14936
14979
|
ok: true,
|
|
14937
14980
|
total_nodes: result.canvas.nodes.length,
|
|
14938
14981
|
estimated_credits: result.estimatedCredits,
|
|
14939
|
-
cost_preview: result.perNodeCredits ?? []
|
|
14982
|
+
cost_preview: result.perNodeCredits ?? [],
|
|
14983
|
+
warnings: result.warnings ?? []
|
|
14940
14984
|
},
|
|
14941
14985
|
null,
|
|
14942
14986
|
2
|