@koda-sl/baker-cli 0.263.0-dev.1f1c09c80 → 0.263.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/README.md +52 -16
- package/canvas/tiktok-captions-composition/index.html +2 -19
- package/dist/{chunk-GXRUZ4LP.js → chunk-2IB3IL4K.js} +2 -2
- package/dist/{chunk-TBEVU7XF.js → chunk-6F52WYB7.js} +3 -3
- package/dist/{chunk-POYXIDOD.js → chunk-DZUVUGEP.js} +1 -5
- package/dist/{chunk-POYXIDOD.js.map → chunk-DZUVUGEP.js.map} +1 -1
- package/dist/{chunk-ECPNYXOA.js → chunk-GU7IWEBC.js} +12 -5
- package/dist/chunk-GU7IWEBC.js.map +1 -0
- package/dist/{chunk-2VM2J6MB.js → chunk-KSOGK7SJ.js} +4 -4
- package/dist/{chunk-ZK5S7JV2.js → chunk-SJPRTSGY.js} +37 -155
- package/dist/chunk-SJPRTSGY.js.map +1 -0
- package/dist/cli.js +6663 -5561
- package/dist/cli.js.map +1 -1
- package/dist/client-VDCCDEHE.js +17 -0
- package/dist/engine/index.js +3 -3
- package/dist/{env-HZNFGXAR.js → env-FWMZXMQK.js} +2 -4
- package/dist/{output-MWMAXN4M.js → output-JBYI5IVX.js} +5 -5
- package/dist/{shared-NFLXWGHK.js → shared-GWFXJXKJ.js} +6 -6
- package/package.json +1 -1
- package/dist/chunk-ECPNYXOA.js.map +0 -1
- package/dist/chunk-ZK5S7JV2.js.map +0 -1
- package/dist/client-7QIDRQXG.js +0 -15
- /package/dist/{chunk-GXRUZ4LP.js.map → chunk-2IB3IL4K.js.map} +0 -0
- /package/dist/{chunk-TBEVU7XF.js.map → chunk-6F52WYB7.js.map} +0 -0
- /package/dist/{chunk-2VM2J6MB.js.map → chunk-KSOGK7SJ.js.map} +0 -0
- /package/dist/{client-7QIDRQXG.js.map → client-VDCCDEHE.js.map} +0 -0
- /package/dist/{env-HZNFGXAR.js.map → env-FWMZXMQK.js.map} +0 -0
- /package/dist/{output-MWMAXN4M.js.map → output-JBYI5IVX.js.map} +0 -0
- /package/dist/{shared-NFLXWGHK.js.map → shared-GWFXJXKJ.js.map} +0 -0
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
debugLogHttp,
|
|
3
3
|
readBodyForLog
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2IB3IL4K.js";
|
|
5
5
|
import {
|
|
6
6
|
DIRECT_ROUTE,
|
|
7
7
|
__commonJS,
|
|
8
8
|
__toESM,
|
|
9
9
|
captureProxyCredentials,
|
|
10
10
|
childEnvWith,
|
|
11
|
-
hasFrameVisionKey,
|
|
12
11
|
isChallengeBody,
|
|
13
12
|
isPrivateAddress,
|
|
14
13
|
isProxyFailure,
|
|
15
14
|
plannedRoutes,
|
|
16
15
|
refuseNonPublicUrl,
|
|
17
16
|
shouldEscalate
|
|
18
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DZUVUGEP.js";
|
|
19
18
|
|
|
20
|
-
//
|
|
19
|
+
// ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js
|
|
21
20
|
var require_safe_stable_stringify = __commonJS({
|
|
22
|
-
"
|
|
21
|
+
"../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(exports, module) {
|
|
23
22
|
"use strict";
|
|
24
23
|
var { hasOwnProperty } = Object.prototype;
|
|
25
24
|
var stringify = configure2();
|
|
@@ -1034,17 +1033,12 @@ function failureDetail(reason) {
|
|
|
1034
1033
|
}
|
|
1035
1034
|
return { message: describeFailureReason(reason) };
|
|
1036
1035
|
}
|
|
1037
|
-
function retryVerdict(retryable) {
|
|
1038
|
-
if (retryable === true) return "transient \u2014 retry the run";
|
|
1039
|
-
if (retryable === false) return "not retryable \u2014 retrying will not help, fix the input";
|
|
1040
|
-
return "retryability unknown";
|
|
1041
|
-
}
|
|
1042
1036
|
function describeCause(c) {
|
|
1043
1037
|
switch (c.kind) {
|
|
1044
1038
|
case "local":
|
|
1045
1039
|
return c.cause instanceof Error ? c.cause.message : String(c.cause);
|
|
1046
1040
|
case "remote":
|
|
1047
|
-
return `[${c.code}] ${c.message}${c.provider ? ` (${c.provider})` : ""}
|
|
1041
|
+
return `[${c.code}] ${c.message}${c.provider ? ` (${c.provider})` : ""}`;
|
|
1048
1042
|
case "timeout":
|
|
1049
1043
|
return `timeout${c.provider ? ` (${c.provider})` : ""}`;
|
|
1050
1044
|
case "network":
|
|
@@ -1098,7 +1092,7 @@ function resolveAdaptFormats(params) {
|
|
|
1098
1092
|
return params.formats ?? [];
|
|
1099
1093
|
}
|
|
1100
1094
|
|
|
1101
|
-
//
|
|
1095
|
+
// ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/esm/wrapper.js
|
|
1102
1096
|
var import__ = __toESM(require_safe_stable_stringify(), 1);
|
|
1103
1097
|
var configure = import__.default.configure;
|
|
1104
1098
|
var wrapper_default = import__.default;
|
|
@@ -7259,24 +7253,6 @@ import { execFile as execFile3 } from "child_process";
|
|
|
7259
7253
|
import { readFile as readFile9 } from "fs/promises";
|
|
7260
7254
|
import path12 from "path";
|
|
7261
7255
|
import { promisify as promisify3 } from "util";
|
|
7262
|
-
|
|
7263
|
-
// src/engine/nodes/local/lib/caption-style.ts
|
|
7264
|
-
var TERMINAL = /[.,;:!?…]$/;
|
|
7265
|
-
function captionTextsFrom(html) {
|
|
7266
|
-
const cards = html.match(/<div[^>]*class="[^"]*\bcaption\b[^"]*"[\s\S]*?<\/div>/g) ?? [];
|
|
7267
|
-
return cards.map(
|
|
7268
|
-
(card) => card.replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim()
|
|
7269
|
-
).filter((text) => text.length > 0);
|
|
7270
|
-
}
|
|
7271
|
-
function fragmentedCaptions(texts) {
|
|
7272
|
-
if (texts.length < 2) return null;
|
|
7273
|
-
const fragments = texts.slice(0, -1).filter((t) => !TERMINAL.test(t));
|
|
7274
|
-
if (fragments.length === 0) return null;
|
|
7275
|
-
const example = fragments[0];
|
|
7276
|
-
return `${fragments.length} of ${texts.length} caption cards end mid-clause, e.g. "${example}". Split captions where the script punctuates, not on a word count \u2014 a card that ends bare is a sentence cut in half by a timing decision, and it reads as one.`;
|
|
7277
|
-
}
|
|
7278
|
-
|
|
7279
|
-
// src/engine/nodes/local/lib/hyperframe-check.ts
|
|
7280
7256
|
var execFileAsync = promisify3(execFile3);
|
|
7281
7257
|
var NEVER_BLOCK = [
|
|
7282
7258
|
/contrast/i,
|
|
@@ -7345,73 +7321,6 @@ function classifyCheckOutput(lintRaw, inspectRaw) {
|
|
|
7345
7321
|
warnings: findings.filter((f) => f.severity === "warning")
|
|
7346
7322
|
};
|
|
7347
7323
|
}
|
|
7348
|
-
var GATE_SECTIONS = ["lint", "runtime", "layout", "motion", "contrast"];
|
|
7349
|
-
function buildCheckArgs(dir, samples) {
|
|
7350
|
-
return ["hyperframes", "check", dir, "--json", "--samples", String(samples), "--at-transitions"];
|
|
7351
|
-
}
|
|
7352
|
-
var PROMOTE_TO_BLOCKING = /GSAP target [^ ]+ not found/i;
|
|
7353
|
-
function toGateFinding(section, entry) {
|
|
7354
|
-
const f = entry;
|
|
7355
|
-
const code = typeof f.code === "string" ? f.code : "unknown";
|
|
7356
|
-
const message2 = typeof f.message === "string" ? f.message : "";
|
|
7357
|
-
const isError = f.severity === "error" || PROMOTE_TO_BLOCKING.test(message2);
|
|
7358
|
-
return {
|
|
7359
|
-
source: section,
|
|
7360
|
-
code,
|
|
7361
|
-
message: message2,
|
|
7362
|
-
severity: isError && !isAdvisory(code, message2) ? "blocking" : "warning"
|
|
7363
|
-
};
|
|
7364
|
-
}
|
|
7365
|
-
function classifyGateOutput(raw) {
|
|
7366
|
-
const parsed = parseCheckJson(raw);
|
|
7367
|
-
const findings = GATE_SECTIONS.flatMap((section) => {
|
|
7368
|
-
const block = parsed?.[section];
|
|
7369
|
-
const entries = Array.isArray(block?.findings) ? block.findings : [];
|
|
7370
|
-
return entries.map((entry) => toGateFinding(section, entry));
|
|
7371
|
-
});
|
|
7372
|
-
return {
|
|
7373
|
-
blocking: findings.filter((f) => f.severity === "blocking"),
|
|
7374
|
-
warnings: findings.filter((f) => f.severity === "warning")
|
|
7375
|
-
};
|
|
7376
|
-
}
|
|
7377
|
-
function summariseWarnings(warnings) {
|
|
7378
|
-
const groups = /* @__PURE__ */ new Map();
|
|
7379
|
-
for (const w of warnings) {
|
|
7380
|
-
const key = `${w.source}/${w.code}`;
|
|
7381
|
-
const seen = groups.get(key);
|
|
7382
|
-
if (seen) seen.count += 1;
|
|
7383
|
-
else groups.set(key, { count: 1, message: w.message });
|
|
7384
|
-
}
|
|
7385
|
-
return [...groups.entries()].sort((a, b) => b[1].count - a[1].count).map(([key, g]) => `${g.count}\xD7 [${key}] ${g.message}`);
|
|
7386
|
-
}
|
|
7387
|
-
var FINDING_ADVICE = {
|
|
7388
|
-
sweep_static: "the timeline never advanced, so this renders as a STILL IMAGE while billing like a video \u2014 and every other green verdict in this run is unreliable. Check the composition registers a paused timeline on `window.__timelines[<composition-id>]` and that the tweens target elements that exist.",
|
|
7389
|
-
console_error: "the composition threw in the browser, so whatever that script was driving did not happen.",
|
|
7390
|
-
page_error: "a script failed to evaluate \u2014 animations and any JS-driven layout in this composition did not run.",
|
|
7391
|
-
http_error: "an asset 404ed at render time; it will be missing from the frame, not substituted.",
|
|
7392
|
-
console_warning: "if this names a GSAP target, the element it animates does not exist, so that tween is a no-op and whatever it was meant to reveal never appears. Fix the selector or add the element before rendering."
|
|
7393
|
-
};
|
|
7394
|
-
function explainGateFinding(finding) {
|
|
7395
|
-
const advice = FINDING_ADVICE[finding.code];
|
|
7396
|
-
return advice ? `${finding.message} \u2014 ${advice}` : finding.message;
|
|
7397
|
-
}
|
|
7398
|
-
function condenseFrameDescriptions(markdown) {
|
|
7399
|
-
const lines = [];
|
|
7400
|
-
let frame = null;
|
|
7401
|
-
for (const line of markdown.split("\n")) {
|
|
7402
|
-
const heading = line.match(/^## (.+)$/);
|
|
7403
|
-
if (heading) {
|
|
7404
|
-
frame = heading[1] ?? null;
|
|
7405
|
-
continue;
|
|
7406
|
-
}
|
|
7407
|
-
const text = line.trim();
|
|
7408
|
-
if (frame && text) {
|
|
7409
|
-
lines.push(`${frame}: ${text}`);
|
|
7410
|
-
frame = null;
|
|
7411
|
-
}
|
|
7412
|
-
}
|
|
7413
|
-
return lines;
|
|
7414
|
-
}
|
|
7415
7324
|
function buildLintArgs(dir) {
|
|
7416
7325
|
return ["hyperframes", "lint", dir, "--json"];
|
|
7417
7326
|
}
|
|
@@ -7443,13 +7352,8 @@ async function lintStructuralIssues(dir, timeoutMs) {
|
|
|
7443
7352
|
function buildInspectArgs(dir, samples) {
|
|
7444
7353
|
return ["hyperframes", "inspect", dir, "--json", "--samples", String(samples)];
|
|
7445
7354
|
}
|
|
7446
|
-
function buildSnapshotArgs(dir, frames
|
|
7447
|
-
|
|
7448
|
-
return vision ? [
|
|
7449
|
-
...base,
|
|
7450
|
-
"--describe",
|
|
7451
|
-
"Answer four things about this frame. (1) Is it empty or near-empty? Name every element actually visible. (2) Could what is shown physically happen \u2014 object sizes, human scale, and whether every object has its real-world form (a phone has ONE screen, on its front). Say so plainly if something is impossible. (3) Read out every number, currency symbol and word visible INSIDE the picture \u2014 phone screens, documents, signage \u2014 and say whether any of it contradicts the caption on this frame. (4) Is the caption legible against what is behind it?"
|
|
7452
|
-
] : [...base, "--describe", "false"];
|
|
7355
|
+
function buildSnapshotArgs(dir, frames) {
|
|
7356
|
+
return ["hyperframes", "snapshot", dir, "--frames", String(frames), "--describe", "false"];
|
|
7453
7357
|
}
|
|
7454
7358
|
function usesNestedCompositions(indexHtml) {
|
|
7455
7359
|
const withoutComments = indexHtml.replace(/<!--[\s\S]*?-->/g, "");
|
|
@@ -7478,66 +7382,44 @@ async function runSnapshotSmoke(args, timeoutMs) {
|
|
|
7478
7382
|
return { ok: false, unavailable: false, message: (err.stderr || err.message || "snapshot failed").slice(0, 800) };
|
|
7479
7383
|
}
|
|
7480
7384
|
}
|
|
7481
|
-
async function
|
|
7482
|
-
const { dir, nodeId, ctx, timeoutMs, samples } = opts;
|
|
7483
|
-
const indexHtml = await readFile9(path12.join(dir, "index.html"), "utf-8").catch(() => "");
|
|
7484
|
-
if (!indexHtml || !usesNestedCompositions(indexHtml)) return;
|
|
7485
|
-
const snap = await runSnapshotSmoke(
|
|
7486
|
-
buildSnapshotArgs(dir, Math.min(samples, 3), hasFrameVisionKey()),
|
|
7487
|
-
Math.max(timeoutMs, 12e4)
|
|
7488
|
-
);
|
|
7489
|
-
if (snap.unavailable) {
|
|
7490
|
-
ctx.log(`${nodeId}: hyperframes snapshot unavailable \u2014 skipping nested-composition smoke test`);
|
|
7491
|
-
return;
|
|
7492
|
-
}
|
|
7493
|
-
if (!snap.ok) {
|
|
7494
|
-
throw new Error(
|
|
7495
|
-
`${nodeId}: nested-composition smoke test failed \u2014 an embedded block did not render. Check the host\u2194block id match, that the block's <style>/<script> live inside its <template>, and that it styles #root (not a class).
|
|
7496
|
-
${snap.message}`
|
|
7497
|
-
);
|
|
7498
|
-
}
|
|
7499
|
-
const described = await readFile9(path12.join(dir, "snapshots", "descriptions.md"), "utf-8").catch(() => "");
|
|
7500
|
-
for (const line of condenseFrameDescriptions(described)) {
|
|
7501
|
-
ctx.log(`${nodeId}: frame check \u2014 ${line}`);
|
|
7502
|
-
}
|
|
7503
|
-
ctx.log(`${nodeId}: nested-composition smoke test passed`);
|
|
7504
|
-
}
|
|
7505
|
-
async function runGate(dir, timeoutMs, samples) {
|
|
7506
|
-
const checkRaw = await runOne(buildCheckArgs(dir, samples), timeoutMs);
|
|
7507
|
-
if (checkRaw !== null) return classifyGateOutput(checkRaw);
|
|
7385
|
+
async function runHyperframesCheck(opts) {
|
|
7386
|
+
const { dir, nodeId, ctx, timeoutMs, samples = 5 } = opts;
|
|
7508
7387
|
const [lintRaw, inspectRaw] = await Promise.all([
|
|
7509
7388
|
runOne(buildLintArgs(dir), timeoutMs),
|
|
7510
7389
|
runOne(buildInspectArgs(dir, samples), timeoutMs)
|
|
7511
7390
|
]);
|
|
7512
|
-
if (lintRaw === null && inspectRaw === null)
|
|
7513
|
-
|
|
7514
|
-
}
|
|
7515
|
-
async function runHyperframesCheck(opts) {
|
|
7516
|
-
const { dir, nodeId, ctx, timeoutMs, samples = 5 } = opts;
|
|
7517
|
-
const gate = await runGate(dir, timeoutMs, samples);
|
|
7518
|
-
if (gate === null) {
|
|
7519
|
-
ctx.log(`${nodeId}: hyperframes check/lint/inspect unavailable \u2014 skipping pre-render check`);
|
|
7391
|
+
if (lintRaw === null && inspectRaw === null) {
|
|
7392
|
+
ctx.log(`${nodeId}: hyperframes lint/inspect unavailable \u2014 skipping pre-render check`);
|
|
7520
7393
|
return;
|
|
7521
7394
|
}
|
|
7522
|
-
const { blocking, warnings } =
|
|
7523
|
-
for (const
|
|
7524
|
-
ctx.log(`${nodeId}: hyperframe check warning ${
|
|
7395
|
+
const { blocking, warnings } = classifyCheckOutput(lintRaw ?? "", inspectRaw ?? "");
|
|
7396
|
+
for (const w of warnings) {
|
|
7397
|
+
ctx.log(`${nodeId}: hyperframe check warning [${w.source}/${w.code}] ${w.message}`);
|
|
7525
7398
|
}
|
|
7526
7399
|
if (blocking.length > 0) {
|
|
7527
|
-
const
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
);
|
|
7400
|
+
const detail = blocking.map((b) => `\u2022 [${b.source}/${b.code}] ${b.message}`).join("\n");
|
|
7401
|
+
throw new Error(`${nodeId}: pre-render check failed (${blocking.length} blocking)
|
|
7402
|
+
${detail}`);
|
|
7403
|
+
}
|
|
7404
|
+
let indexHtml = "";
|
|
7405
|
+
try {
|
|
7406
|
+
indexHtml = await readFile9(path12.join(dir, "index.html"), "utf-8");
|
|
7407
|
+
} catch {
|
|
7408
|
+
indexHtml = "";
|
|
7534
7409
|
}
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7410
|
+
if (indexHtml && usesNestedCompositions(indexHtml)) {
|
|
7411
|
+
const snap = await runSnapshotSmoke(buildSnapshotArgs(dir, Math.min(samples, 3)), Math.max(timeoutMs, 12e4));
|
|
7412
|
+
if (snap.unavailable) {
|
|
7413
|
+
ctx.log(`${nodeId}: hyperframes snapshot unavailable \u2014 skipping nested-composition smoke test`);
|
|
7414
|
+
} else if (!snap.ok) {
|
|
7415
|
+
throw new Error(
|
|
7416
|
+
`${nodeId}: nested-composition smoke test failed \u2014 an embedded block did not render. Check the host\u2194block id match, that the block's <style>/<script> live inside its <template>, and that it styles #root (not a class).
|
|
7417
|
+
${snap.message}`
|
|
7418
|
+
);
|
|
7419
|
+
} else {
|
|
7420
|
+
ctx.log(`${nodeId}: nested-composition smoke test passed`);
|
|
7421
|
+
}
|
|
7539
7422
|
}
|
|
7540
|
-
await runNestedCompositionSmoke({ dir, nodeId, ctx, timeoutMs, samples });
|
|
7541
7423
|
ctx.log(`${nodeId}: pre-render check passed (${warnings.length} warning${warnings.length === 1 ? "" : "s"})`);
|
|
7542
7424
|
}
|
|
7543
7425
|
|
|
@@ -9272,4 +9154,4 @@ export {
|
|
|
9272
9154
|
defaultRegistry,
|
|
9273
9155
|
createEngineFromEnv
|
|
9274
9156
|
};
|
|
9275
|
-
//# sourceMappingURL=chunk-
|
|
9157
|
+
//# sourceMappingURL=chunk-SJPRTSGY.js.map
|