@koda-sl/baker-cli 0.353.0-dev.8bdd8f915 → 0.353.0-dev.afbf521d7
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 +5 -5
- package/dist/{chunk-YBLNCFK4.js → chunk-RZWMHH4X.js} +190 -110
- package/dist/chunk-RZWMHH4X.js.map +1 -0
- package/dist/cli.js +11 -15
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-YBLNCFK4.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
clipDurationsFor,
|
|
29
29
|
clipParamRecipe,
|
|
30
30
|
clipProfileFor,
|
|
31
|
-
coercePathUrlToUrl,
|
|
32
31
|
collectAssetRefLikes,
|
|
33
32
|
createEngineFromEnv,
|
|
34
33
|
defaultRegistry,
|
|
@@ -55,6 +54,7 @@ import {
|
|
|
55
54
|
promptMaxLength,
|
|
56
55
|
requireCredentialsFromEnv,
|
|
57
56
|
resolveConcurrency,
|
|
57
|
+
runFailureCode,
|
|
58
58
|
runYtDlp,
|
|
59
59
|
sha256Hex,
|
|
60
60
|
spineInputFlags,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
validateCanvasDeep,
|
|
70
70
|
withoutCastName,
|
|
71
71
|
ytDlpBlockSignal
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-RZWMHH4X.js";
|
|
73
73
|
import {
|
|
74
74
|
csvOrJson,
|
|
75
75
|
daysAgoIso,
|
|
@@ -35896,7 +35896,7 @@ function rewriteTarget(value, workspaceRoot) {
|
|
|
35896
35896
|
}
|
|
35897
35897
|
return null;
|
|
35898
35898
|
}
|
|
35899
|
-
function
|
|
35899
|
+
function normalizeAbsoluteCanvasPaths(canvas, canvasDir, workspaceRoot) {
|
|
35900
35900
|
if (!canvas || typeof canvas !== "object") return { canvas, rewrites: [] };
|
|
35901
35901
|
const c = canvas;
|
|
35902
35902
|
if (!Array.isArray(c.nodes)) return { canvas, rewrites: [] };
|
|
@@ -35909,10 +35909,6 @@ function normalizeCanvasPaths(canvas, canvasDir, workspaceRoot) {
|
|
|
35909
35909
|
const params = n.params;
|
|
35910
35910
|
if (!params || typeof params !== "object") return node;
|
|
35911
35911
|
const nodeId = typeof n.id === "string" ? n.id : "?";
|
|
35912
|
-
if (n.type === "ingest" && params.source === "path" && looksLikeHttpUrl(params.path)) {
|
|
35913
|
-
rewrites.push({ nodeId, param: "source", from: "path", to: "url" });
|
|
35914
|
-
return { ...node, params: coercePathUrlToUrl(params) };
|
|
35915
|
-
}
|
|
35916
35912
|
const key = n.type === "ingest" && params.source === "path" ? "path" : n.type === "hyperframe_render" ? "composition" : null;
|
|
35917
35913
|
if (!key) return node;
|
|
35918
35914
|
const target = rewriteTarget(params[key], root);
|
|
@@ -35923,11 +35919,11 @@ function normalizeCanvasPaths(canvas, canvasDir, workspaceRoot) {
|
|
|
35923
35919
|
});
|
|
35924
35920
|
return rewrites.length === 0 ? { canvas, rewrites } : { canvas: { ...canvas, nodes }, rewrites };
|
|
35925
35921
|
}
|
|
35926
|
-
async function
|
|
35922
|
+
async function healAbsoluteCanvasPaths(filePath, canvas) {
|
|
35927
35923
|
const canvasDir = path5.dirname(filePath);
|
|
35928
35924
|
const workspaceRoot = findWorkspaceRoot(canvasDir);
|
|
35929
35925
|
if (!workspaceRoot) return { canvas, rewrites: [], text: null };
|
|
35930
|
-
const normalized =
|
|
35926
|
+
const normalized = normalizeAbsoluteCanvasPaths(canvas, canvasDir, workspaceRoot);
|
|
35931
35927
|
if (normalized.rewrites.length === 0) return { ...normalized, text: null };
|
|
35932
35928
|
const text2 = `${JSON.stringify(normalized.canvas, null, 2)}
|
|
35933
35929
|
`;
|
|
@@ -40869,12 +40865,12 @@ async function executeCanvasRun(opts) {
|
|
|
40869
40865
|
}
|
|
40870
40866
|
const attemptedSlug = creativeSlugFromCanvasPath(filePath);
|
|
40871
40867
|
if (attemptedSlug) await clearCreativeDirty(attemptedSlug);
|
|
40872
|
-
const healed = await
|
|
40868
|
+
const healed = await healAbsoluteCanvasPaths(filePath, parsed);
|
|
40873
40869
|
parsed = healed.canvas;
|
|
40874
40870
|
const canvasText = healed.text ?? raw;
|
|
40875
40871
|
if (healed.rewrites.length > 0) {
|
|
40876
40872
|
process.stderr.write(
|
|
40877
|
-
`[canvas] rewrote ${healed.rewrites.length} asset
|
|
40873
|
+
`[canvas] rewrote ${healed.rewrites.length} absolute asset path(s) to canvas-relative \u2014 they resolve only in this workspace:
|
|
40878
40874
|
${describeRewrites(healed.rewrites)}
|
|
40879
40875
|
`
|
|
40880
40876
|
);
|
|
@@ -41177,14 +41173,14 @@ ${describeRewrites(healed.rewrites)}
|
|
|
41177
41173
|
const failures = e.failures.map((f) => ({ node_id: f.nodeId, message: describeFailureReason(f.reason) }));
|
|
41178
41174
|
if (poster) await poster.flush(failedPayload(e.message));
|
|
41179
41175
|
process.stderr.write(
|
|
41180
|
-
`${JSON.stringify({ ok: false, error: { code:
|
|
41176
|
+
`${JSON.stringify({ ok: false, error: { code: runFailureCode(e), message: e.message, failures } }, null, 2)}
|
|
41181
41177
|
`
|
|
41182
41178
|
);
|
|
41183
41179
|
process.exit(1);
|
|
41184
41180
|
}
|
|
41185
41181
|
const msg = e instanceof Error ? e.message : String(e);
|
|
41186
41182
|
if (poster) await poster.flush(failedPayload(msg));
|
|
41187
|
-
process.stderr.write(`${JSON.stringify({ ok: false, error: { code:
|
|
41183
|
+
process.stderr.write(`${JSON.stringify({ ok: false, error: { code: runFailureCode(e), message: msg } }, null, 2)}
|
|
41188
41184
|
`);
|
|
41189
41185
|
process.exit(1);
|
|
41190
41186
|
}
|
|
@@ -44452,7 +44448,7 @@ import { defineCommand as defineCommand118 } from "citty";
|
|
|
44452
44448
|
var validateCommand = defineCommand118({
|
|
44453
44449
|
meta: {
|
|
44454
44450
|
name: "validate",
|
|
44455
|
-
description: "Validate a canvas JSON file (no execution). Includes a per-node cost preview and runs each node's deep validators (composition meta checks for hyperframe_render/_snapshot)."
|
|
44451
|
+
description: "Validate a canvas JSON file (no execution). Includes a per-node cost preview and runs each node's deep validators (composition meta checks for hyperframe_render/_snapshot), and measures each generator prompt with its {{slots}} filled against the model's character cap (PROMPT_OVER_MODEL_LIMIT)."
|
|
44456
44452
|
},
|
|
44457
44453
|
args: { file: { type: "positional", required: true, description: "Path to canvas JSON" } },
|
|
44458
44454
|
async run({ args: args5 }) {
|
|
@@ -44467,7 +44463,7 @@ var validateCommand = defineCommand118({
|
|
|
44467
44463
|
`);
|
|
44468
44464
|
process.exit(2);
|
|
44469
44465
|
}
|
|
44470
|
-
const healed = await
|
|
44466
|
+
const healed = await healAbsoluteCanvasPaths(filePath, parsed);
|
|
44471
44467
|
parsed = healed.canvas;
|
|
44472
44468
|
parsed = resolveRelativeCanvasPaths(parsed, path28.dirname(filePath));
|
|
44473
44469
|
let styleProjection = "not_applicable";
|