@nodetool-ai/execution 0.8.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 +129 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/app-debug/app-spec.d.ts +94 -0
- package/dist/app-debug/app-spec.d.ts.map +1 -0
- package/dist/app-debug/app-spec.js +710 -0
- package/dist/app-debug/app-spec.js.map +1 -0
- package/dist/app-debug/application-target.d.ts +53 -0
- package/dist/app-debug/application-target.d.ts.map +1 -0
- package/dist/app-debug/application-target.js +126 -0
- package/dist/app-debug/application-target.js.map +1 -0
- package/dist/app-debug/bundle-target.d.ts +21 -0
- package/dist/app-debug/bundle-target.d.ts.map +1 -0
- package/dist/app-debug/bundle-target.js +51 -0
- package/dist/app-debug/bundle-target.js.map +1 -0
- package/dist/app-debug/graph-shape.d.ts +14 -0
- package/dist/app-debug/graph-shape.d.ts.map +1 -0
- package/dist/app-debug/graph-shape.js +23 -0
- package/dist/app-debug/graph-shape.js.map +1 -0
- package/dist/app-debug/index.d.ts +26 -0
- package/dist/app-debug/index.d.ts.map +1 -0
- package/dist/app-debug/index.js +19 -0
- package/dist/app-debug/index.js.map +1 -0
- package/dist/app-debug/markdown.d.ts +6 -0
- package/dist/app-debug/markdown.d.ts.map +1 -0
- package/dist/app-debug/markdown.js +133 -0
- package/dist/app-debug/markdown.js.map +1 -0
- package/dist/app-debug/runtime.d.ts +267 -0
- package/dist/app-debug/runtime.d.ts.map +1 -0
- package/dist/app-debug/runtime.js +633 -0
- package/dist/app-debug/runtime.js.map +1 -0
- package/dist/app-debug/script-operation.d.ts +58 -0
- package/dist/app-debug/script-operation.d.ts.map +1 -0
- package/dist/app-debug/script-operation.js +44 -0
- package/dist/app-debug/script-operation.js.map +1 -0
- package/dist/app-debug/simulate.d.ts +85 -0
- package/dist/app-debug/simulate.d.ts.map +1 -0
- package/dist/app-debug/simulate.js +991 -0
- package/dist/app-debug/simulate.js.map +1 -0
- package/dist/app-debug/summarize.d.ts +64 -0
- package/dist/app-debug/summarize.d.ts.map +1 -0
- package/dist/app-debug/summarize.js +65 -0
- package/dist/app-debug/summarize.js.map +1 -0
- package/dist/app-debug/types.d.ts +343 -0
- package/dist/app-debug/types.d.ts.map +1 -0
- package/dist/app-debug/types.js +2 -0
- package/dist/app-debug/types.js.map +1 -0
- package/dist/cost-ledger.d.ts +147 -0
- package/dist/cost-ledger.d.ts.map +1 -0
- package/dist/cost-ledger.js +288 -0
- package/dist/cost-ledger.js.map +1 -0
- package/dist/debug/collector.d.ts +28 -0
- package/dist/debug/collector.d.ts.map +1 -0
- package/dist/debug/collector.js +284 -0
- package/dist/debug/collector.js.map +1 -0
- package/dist/debug/index.d.ts +15 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js +16 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/debug/types.d.ts +179 -0
- package/dist/debug/types.d.ts.map +1 -0
- package/dist/debug/types.js +11 -0
- package/dist/debug/types.js.map +1 -0
- package/dist/debug/verdict.d.ts +27 -0
- package/dist/debug/verdict.d.ts.map +1 -0
- package/dist/debug/verdict.js +51 -0
- package/dist/debug/verdict.js.map +1 -0
- package/dist/executor-resolver.d.ts +13 -0
- package/dist/executor-resolver.d.ts.map +1 -0
- package/dist/executor-resolver.js +13 -0
- package/dist/executor-resolver.js.map +1 -0
- package/dist/fal-output-decoder.d.ts +36 -0
- package/dist/fal-output-decoder.d.ts.map +1 -0
- package/dist/fal-output-decoder.js +129 -0
- package/dist/fal-output-decoder.js.map +1 -0
- package/dist/generation-lifecycle.d.ts +54 -0
- package/dist/generation-lifecycle.d.ts.map +1 -0
- package/dist/generation-lifecycle.js +431 -0
- package/dist/generation-lifecycle.js.map +1 -0
- package/dist/generation-recovery-worker.d.ts +100 -0
- package/dist/generation-recovery-worker.d.ts.map +1 -0
- package/dist/generation-recovery-worker.js +995 -0
- package/dist/generation-recovery-worker.js.map +1 -0
- package/dist/generation-tracker.d.ts +83 -0
- package/dist/generation-tracker.d.ts.map +1 -0
- package/dist/generation-tracker.js +436 -0
- package/dist/generation-tracker.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/js-script-debug/index.d.ts +13 -0
- package/dist/js-script-debug/index.d.ts.map +1 -0
- package/dist/js-script-debug/index.js +12 -0
- package/dist/js-script-debug/index.js.map +1 -0
- package/dist/js-script-debug/markdown.d.ts +6 -0
- package/dist/js-script-debug/markdown.d.ts.map +1 -0
- package/dist/js-script-debug/markdown.js +62 -0
- package/dist/js-script-debug/markdown.js.map +1 -0
- package/dist/js-script-debug/outputs.d.ts +20 -0
- package/dist/js-script-debug/outputs.d.ts.map +1 -0
- package/dist/js-script-debug/outputs.js +30 -0
- package/dist/js-script-debug/outputs.js.map +1 -0
- package/dist/js-script-debug/report.d.ts +15 -0
- package/dist/js-script-debug/report.d.ts.map +1 -0
- package/dist/js-script-debug/report.js +90 -0
- package/dist/js-script-debug/report.js.map +1 -0
- package/dist/js-script-debug/types.d.ts +63 -0
- package/dist/js-script-debug/types.d.ts.map +1 -0
- package/dist/js-script-debug/types.js +10 -0
- package/dist/js-script-debug/types.js.map +1 -0
- package/dist/js-script-debug/validate.d.ts +38 -0
- package/dist/js-script-debug/validate.d.ts.map +1 -0
- package/dist/js-script-debug/validate.js +137 -0
- package/dist/js-script-debug/validate.js.map +1 -0
- package/dist/message-stream.d.ts +33 -0
- package/dist/message-stream.d.ts.map +1 -0
- package/dist/message-stream.js +58 -0
- package/dist/message-stream.js.map +1 -0
- package/dist/normalize-graph.d.ts +13 -0
- package/dist/normalize-graph.d.ts.map +1 -0
- package/dist/normalize-graph.js +63 -0
- package/dist/normalize-graph.js.map +1 -0
- package/dist/output-names.d.ts +13 -0
- package/dist/output-names.d.ts.map +1 -0
- package/dist/output-names.js +13 -0
- package/dist/output-names.js.map +1 -0
- package/dist/predicates.d.ts +6 -0
- package/dist/predicates.d.ts.map +1 -0
- package/dist/predicates.js +6 -0
- package/dist/predicates.js.map +1 -0
- package/dist/preflight.d.ts +87 -0
- package/dist/preflight.d.ts.map +1 -0
- package/dist/preflight.js +139 -0
- package/dist/preflight.js.map +1 -0
- package/dist/provider-secret-key.d.ts +3 -0
- package/dist/provider-secret-key.d.ts.map +1 -0
- package/dist/provider-secret-key.js +7 -0
- package/dist/provider-secret-key.js.map +1 -0
- package/dist/service/app-debug-service.d.ts +78 -0
- package/dist/service/app-debug-service.d.ts.map +1 -0
- package/dist/service/app-debug-service.js +201 -0
- package/dist/service/app-debug-service.js.map +1 -0
- package/dist/service/app-run-server.d.ts +28 -0
- package/dist/service/app-run-server.d.ts.map +1 -0
- package/dist/service/app-run-server.js +104 -0
- package/dist/service/app-run-server.js.map +1 -0
- package/dist/service/debug-sessions.d.ts +158 -0
- package/dist/service/debug-sessions.d.ts.map +1 -0
- package/dist/service/debug-sessions.js +358 -0
- package/dist/service/debug-sessions.js.map +1 -0
- package/dist/service/index.d.ts +22 -0
- package/dist/service/index.d.ts.map +1 -0
- package/dist/service/index.js +17 -0
- package/dist/service/index.js.map +1 -0
- package/dist/service/job-progress.d.ts +40 -0
- package/dist/service/job-progress.d.ts.map +1 -0
- package/dist/service/job-progress.js +53 -0
- package/dist/service/job-progress.js.map +1 -0
- package/dist/service/workflow-run.d.ts +279 -0
- package/dist/service/workflow-run.d.ts.map +1 -0
- package/dist/service/workflow-run.js +598 -0
- package/dist/service/workflow-run.js.map +1 -0
- package/dist/service/workflow-workspace.d.ts +89 -0
- package/dist/service/workflow-workspace.d.ts.map +1 -0
- package/dist/service/workflow-workspace.js +160 -0
- package/dist/service/workflow-workspace.js.map +1 -0
- package/dist/session.d.ts +62 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +353 -0
- package/dist/session.js.map +1 -0
- package/dist/sketch-debug/index.d.ts +11 -0
- package/dist/sketch-debug/index.d.ts.map +1 -0
- package/dist/sketch-debug/index.js +10 -0
- package/dist/sketch-debug/index.js.map +1 -0
- package/dist/sketch-debug/markdown.d.ts +6 -0
- package/dist/sketch-debug/markdown.d.ts.map +1 -0
- package/dist/sketch-debug/markdown.js +93 -0
- package/dist/sketch-debug/markdown.js.map +1 -0
- package/dist/sketch-debug/report.d.ts +15 -0
- package/dist/sketch-debug/report.d.ts.map +1 -0
- package/dist/sketch-debug/report.js +98 -0
- package/dist/sketch-debug/report.js.map +1 -0
- package/dist/sketch-debug/types.d.ts +62 -0
- package/dist/sketch-debug/types.d.ts.map +1 -0
- package/dist/sketch-debug/types.js +10 -0
- package/dist/sketch-debug/types.js.map +1 -0
- package/dist/sketch-debug/validate.d.ts +14 -0
- package/dist/sketch-debug/validate.d.ts.map +1 -0
- package/dist/sketch-debug/validate.js +478 -0
- package/dist/sketch-debug/validate.js.map +1 -0
- package/dist/supervisor.d.ts +45 -0
- package/dist/supervisor.d.ts.map +1 -0
- package/dist/supervisor.js +97 -0
- package/dist/supervisor.js.map +1 -0
- package/dist/timeline-debug/index.d.ts +11 -0
- package/dist/timeline-debug/index.d.ts.map +1 -0
- package/dist/timeline-debug/index.js +10 -0
- package/dist/timeline-debug/index.js.map +1 -0
- package/dist/timeline-debug/legibility.d.ts +23 -0
- package/dist/timeline-debug/legibility.d.ts.map +1 -0
- package/dist/timeline-debug/legibility.js +240 -0
- package/dist/timeline-debug/legibility.js.map +1 -0
- package/dist/timeline-debug/markdown.d.ts +6 -0
- package/dist/timeline-debug/markdown.d.ts.map +1 -0
- package/dist/timeline-debug/markdown.js +103 -0
- package/dist/timeline-debug/markdown.js.map +1 -0
- package/dist/timeline-debug/motion.d.ts +20 -0
- package/dist/timeline-debug/motion.d.ts.map +1 -0
- package/dist/timeline-debug/motion.js +362 -0
- package/dist/timeline-debug/motion.js.map +1 -0
- package/dist/timeline-debug/report.d.ts +16 -0
- package/dist/timeline-debug/report.d.ts.map +1 -0
- package/dist/timeline-debug/report.js +100 -0
- package/dist/timeline-debug/report.js.map +1 -0
- package/dist/timeline-debug/showcase.d.ts +7 -0
- package/dist/timeline-debug/showcase.d.ts.map +1 -0
- package/dist/timeline-debug/showcase.js +347 -0
- package/dist/timeline-debug/showcase.js.map +1 -0
- package/dist/timeline-debug/types.d.ts +64 -0
- package/dist/timeline-debug/types.d.ts.map +1 -0
- package/dist/timeline-debug/types.js +10 -0
- package/dist/timeline-debug/types.js.map +1 -0
- package/dist/timeline-debug/validate.d.ts +24 -0
- package/dist/timeline-debug/validate.d.ts.map +1 -0
- package/dist/timeline-debug/validate.js +1432 -0
- package/dist/timeline-debug/validate.js.map +1 -0
- package/dist/types.d.ts +211 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +103 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** The shield that marks a supervised line. */
|
|
2
|
+
export const INTERVENTION_MARK = "⛨";
|
|
3
|
+
const ZERO_ACTIONS = {
|
|
4
|
+
retry: 0,
|
|
5
|
+
substitute: 0,
|
|
6
|
+
skip: 0,
|
|
7
|
+
end_stream: 0,
|
|
8
|
+
fail: 0
|
|
9
|
+
};
|
|
10
|
+
const ZERO_DECIDERS = {
|
|
11
|
+
agent: 0,
|
|
12
|
+
sticky: 0,
|
|
13
|
+
bounds: 0,
|
|
14
|
+
default: 0,
|
|
15
|
+
kernel: 0
|
|
16
|
+
};
|
|
17
|
+
export function summarizeInterventions(interventions) {
|
|
18
|
+
const byAction = { ...ZERO_ACTIONS };
|
|
19
|
+
const byDecider = { ...ZERO_DECIDERS };
|
|
20
|
+
let costUsd = 0;
|
|
21
|
+
for (const item of interventions) {
|
|
22
|
+
byAction[item.verdict.action] += 1;
|
|
23
|
+
byDecider[item.decidedBy] += 1;
|
|
24
|
+
costUsd += item.costUsd ?? 0;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
decisions: interventions.length,
|
|
28
|
+
agentDecisions: byDecider.agent,
|
|
29
|
+
byAction,
|
|
30
|
+
byDecider,
|
|
31
|
+
costUsd
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** Human-readable phrase for a verdict, in the product's four verbs. */
|
|
35
|
+
function describeVerdict(intervention) {
|
|
36
|
+
const { verdict } = intervention;
|
|
37
|
+
switch (verdict.action) {
|
|
38
|
+
case "retry":
|
|
39
|
+
return "retried";
|
|
40
|
+
case "substitute":
|
|
41
|
+
return "repaired output";
|
|
42
|
+
case "skip":
|
|
43
|
+
return verdict.applyTo === "signature"
|
|
44
|
+
? "skipped (and every matching failure)"
|
|
45
|
+
: "skipped";
|
|
46
|
+
case "end_stream":
|
|
47
|
+
// Presented under skip per design §4: the kernel action stays distinct,
|
|
48
|
+
// the record keeps it, the reader sees one verb family.
|
|
49
|
+
return "skipped the rest, kept what was produced";
|
|
50
|
+
case "fail":
|
|
51
|
+
return verdict.reason ? `failed — ${verdict.reason}` : "failed";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* One inline line per intervention, e.g.
|
|
56
|
+
* `⛨ fetch-item [3] skipped — HTTP 404 (agent, $0.0041)`.
|
|
57
|
+
*/
|
|
58
|
+
export function formatInterventionLine(intervention) {
|
|
59
|
+
const { escalation } = intervention;
|
|
60
|
+
const item = escalation.invocationKey ? ` [${escalation.invocationKey}]` : "";
|
|
61
|
+
const cost = intervention.costUsd && intervention.costUsd > 0
|
|
62
|
+
? `, $${intervention.costUsd.toFixed(4)}`
|
|
63
|
+
: "";
|
|
64
|
+
return (`${INTERVENTION_MARK} ${escalation.nodeId}${item} ` +
|
|
65
|
+
`${describeVerdict(intervention)} — ${escalation.detail} ` +
|
|
66
|
+
`(${intervention.decidedBy}${cost})`);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The run's closing supervised line, e.g.
|
|
70
|
+
* `⛨ supervised: 3 decisions, 2 skipped, 1 retried, +$0.0200`.
|
|
71
|
+
*
|
|
72
|
+
* Item counts (`198/200 items`) are a fan-out property no run-level record
|
|
73
|
+
* carries — the kernel counts invocations, not the batch a user thinks in —
|
|
74
|
+
* so a caller that knows its item total passes it in; otherwise the line
|
|
75
|
+
* reports decisions.
|
|
76
|
+
*/
|
|
77
|
+
export function formatSupervisedSummary(summary, items) {
|
|
78
|
+
const parts = [];
|
|
79
|
+
if (items)
|
|
80
|
+
parts.push(`${items.produced}/${items.total} items`);
|
|
81
|
+
const verbs = [
|
|
82
|
+
["skip", "skipped"],
|
|
83
|
+
["end_stream", "stream(s) ended early"],
|
|
84
|
+
["retry", "retried"],
|
|
85
|
+
["substitute", "repaired"],
|
|
86
|
+
["fail", "failed"]
|
|
87
|
+
];
|
|
88
|
+
for (const [action, label] of verbs) {
|
|
89
|
+
const n = summary.byAction[action];
|
|
90
|
+
if (n > 0)
|
|
91
|
+
parts.push(`${n} ${label}`);
|
|
92
|
+
}
|
|
93
|
+
parts.push(`${summary.decisions} decision${summary.decisions === 1 ? "" : "s"}`);
|
|
94
|
+
parts.push(`+$${summary.costUsd.toFixed(4)}`);
|
|
95
|
+
return `${INTERVENTION_MARK} supervised: ${parts.join(", ")}`;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=supervisor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supervisor.js","sourceRoot":"","sources":["../src/supervisor.ts"],"names":[],"mappings":"AAaA,+CAA+C;AAC/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAcrC,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE,CAAC;IACR,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,CAAC;IACP,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,CAAC;CACgC,CAAC;AAE1C,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;CAC0B,CAAC;AAEtC,MAAM,UAAU,sBAAsB,CACpC,aAAs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O,CAAC,SAAS,YAAY,OAAO,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CACrE,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC9C,OAAO,GAAG,iBAAiB,gBAAgB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@nodetool-ai/execution/timeline-debug` — timeline validation + debug report.
|
|
3
|
+
*
|
|
4
|
+
* Pure, dependency-injected core: no DB, no ffmpeg, no browser. Hosts (the
|
|
5
|
+
* CLI `timeline` command today) resolve the target and write the bundle.
|
|
6
|
+
*/
|
|
7
|
+
export type { TimelineDebugIssue, TimelineValidation, TimelineInteractionRecord, TimelineDebugTarget, TimelineSequenceMeta, TimelineDebugReport } from "./types.js";
|
|
8
|
+
export { validateTimelineSequence, collectStrippedPaths } from "./validate.js";
|
|
9
|
+
export { buildTimelineDebugReport } from "./report.js";
|
|
10
|
+
export { renderTimelineReportMarkdown } from "./markdown.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/timeline-debug/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@nodetool-ai/execution/timeline-debug` — timeline validation + debug report.
|
|
3
|
+
*
|
|
4
|
+
* Pure, dependency-injected core: no DB, no ffmpeg, no browser. Hosts (the
|
|
5
|
+
* CLI `timeline` command today) resolve the target and write the bundle.
|
|
6
|
+
*/
|
|
7
|
+
export { validateTimelineSequence, collectStrippedPaths } from "./validate.js";
|
|
8
|
+
export { buildTimelineDebugReport } from "./report.js";
|
|
9
|
+
export { renderTimelineReportMarkdown } from "./markdown.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/timeline-debug/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text legibility: the two failures a document decides on its own.
|
|
3
|
+
*
|
|
4
|
+
* A title too small to read at delivery size, and a title whose colour is too
|
|
5
|
+
* close to what sits behind it, are the motion mistakes a frame preview catches
|
|
6
|
+
* and a structural check used to leave to the agent (F24). Both are warnings
|
|
7
|
+
* (R5): the heuristic is a floor, not a judgement, and the picture still
|
|
8
|
+
* renders.
|
|
9
|
+
*
|
|
10
|
+
* The check refuses to guess. A colour it cannot parse, a gradient fill, a
|
|
11
|
+
* translucent plate, a backdrop it cannot prove is behind the text — each ends
|
|
12
|
+
* the contrast check rather than producing a finding, because a legibility
|
|
13
|
+
* warning nobody can act on is worse than none.
|
|
14
|
+
*/
|
|
15
|
+
import type { TimelineDocument } from "@nodetool-ai/protocol/api-schemas/timeline.js";
|
|
16
|
+
import type { TimelineDebugIssue } from "./types.js";
|
|
17
|
+
/**
|
|
18
|
+
* Legibility findings for every text clip in the document. `frameHeight` is the
|
|
19
|
+
* sequence's pixel height — a font size is authored in sequence pixels, so the
|
|
20
|
+
* floor is a fraction of that and not of anything on the author's screen.
|
|
21
|
+
*/
|
|
22
|
+
export declare function checkLegibility(doc: TimelineDocument, frameHeight: number): TimelineDebugIssue[];
|
|
23
|
+
//# sourceMappingURL=legibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legibility.d.ts","sourceRoot":"","sources":["../../src/timeline-debug/legibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,+CAA+C,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAoMrD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,gBAAgB,EACrB,WAAW,EAAE,MAAM,GAClB,kBAAkB,EAAE,CAuDtB"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cap height a viewer can read on a phone. 2.5% of frame height is 27px at
|
|
3
|
+
* 1080p — the floor broadcast lower-third practice lands on, and the one the
|
|
4
|
+
* task list names.
|
|
5
|
+
*/
|
|
6
|
+
const MIN_TEXT_HEIGHT_FRAC = 0.025;
|
|
7
|
+
/** WCAG 2.2 AA for large text. Titles are large text; body copy is not here. */
|
|
8
|
+
const MIN_CONTRAST_RATIO = 3;
|
|
9
|
+
/** The basic CSS colour names and their aliases, which authored styles use. */
|
|
10
|
+
const NAMED_COLORS = new Map(Object.entries({
|
|
11
|
+
black: "#000000",
|
|
12
|
+
silver: "#c0c0c0",
|
|
13
|
+
gray: "#808080",
|
|
14
|
+
grey: "#808080",
|
|
15
|
+
white: "#ffffff",
|
|
16
|
+
maroon: "#800000",
|
|
17
|
+
red: "#ff0000",
|
|
18
|
+
purple: "#800080",
|
|
19
|
+
fuchsia: "#ff00ff",
|
|
20
|
+
magenta: "#ff00ff",
|
|
21
|
+
green: "#008000",
|
|
22
|
+
lime: "#00ff00",
|
|
23
|
+
olive: "#808000",
|
|
24
|
+
yellow: "#ffff00",
|
|
25
|
+
navy: "#000080",
|
|
26
|
+
blue: "#0000ff",
|
|
27
|
+
teal: "#008080",
|
|
28
|
+
aqua: "#00ffff",
|
|
29
|
+
cyan: "#00ffff"
|
|
30
|
+
}));
|
|
31
|
+
/**
|
|
32
|
+
* An opaque sRGB colour, or `null` for anything this check will not reason
|
|
33
|
+
* about — an unknown notation, and any colour carrying alpha, since what shows
|
|
34
|
+
* through a translucent fill is a compositing question and not a document one.
|
|
35
|
+
*/
|
|
36
|
+
function parseOpaqueColor(input) {
|
|
37
|
+
if (input === undefined)
|
|
38
|
+
return null;
|
|
39
|
+
const trimmed = input.trim();
|
|
40
|
+
const value = NAMED_COLORS.get(trimmed.toLowerCase()) ?? trimmed;
|
|
41
|
+
const hex = /^#([0-9a-f]{3,8})$/i.exec(value);
|
|
42
|
+
if (hex) {
|
|
43
|
+
const digits = hex[1];
|
|
44
|
+
if (digits.length === 3 || digits.length === 4) {
|
|
45
|
+
if (digits.length === 4 && digits[3] !== "f" && digits[3] !== "F") {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const [r, g, b] = [digits[0], digits[1], digits[2]].map((d) => parseInt(`${d}${d}`, 16));
|
|
49
|
+
return { r: r, g: g, b: b };
|
|
50
|
+
}
|
|
51
|
+
if (digits.length === 6 || digits.length === 8) {
|
|
52
|
+
if (digits.length === 8 && parseInt(digits.slice(6), 16) !== 255) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
r: parseInt(digits.slice(0, 2), 16),
|
|
57
|
+
g: parseInt(digits.slice(2, 4), 16),
|
|
58
|
+
b: parseInt(digits.slice(4, 6), 16)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const rgb = /^rgba?\(\s*([0-9.]+)\s*[, ]\s*([0-9.]+)\s*[, ]\s*([0-9.]+)\s*(?:[,/]\s*([0-9.]+)\s*)?\)$/i.exec(value);
|
|
64
|
+
if (!rgb)
|
|
65
|
+
return null;
|
|
66
|
+
if (rgb[4] !== undefined && Number(rgb[4]) < 1)
|
|
67
|
+
return null;
|
|
68
|
+
const channels = [rgb[1], rgb[2], rgb[3]].map(Number);
|
|
69
|
+
if (channels.some((c) => !Number.isFinite(c) || c < 0 || c > 255))
|
|
70
|
+
return null;
|
|
71
|
+
return { r: channels[0], g: channels[1], b: channels[2] };
|
|
72
|
+
}
|
|
73
|
+
/** WCAG relative luminance of an sRGB triple. */
|
|
74
|
+
function relativeLuminance({ r, g, b }) {
|
|
75
|
+
const linear = [r, g, b].map((channel) => {
|
|
76
|
+
const c = channel / 255;
|
|
77
|
+
return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
78
|
+
});
|
|
79
|
+
return 0.2126 * linear[0] + 0.7152 * linear[1] + 0.0722 * linear[2];
|
|
80
|
+
}
|
|
81
|
+
/** WCAG contrast ratio, 1 (identical) to 21 (black on white). */
|
|
82
|
+
function contrastRatio(a, b) {
|
|
83
|
+
const [light, dark] = [relativeLuminance(a), relativeLuminance(b)].sort((x, y) => y - x);
|
|
84
|
+
return (light + 0.05) / (dark + 0.05);
|
|
85
|
+
}
|
|
86
|
+
/** The colour a text clip's glyphs are filled with, or `null` for a gradient. */
|
|
87
|
+
function textColor(clip) {
|
|
88
|
+
const style = clip.textStyle;
|
|
89
|
+
if (!style)
|
|
90
|
+
return undefined;
|
|
91
|
+
const fill = style.fill;
|
|
92
|
+
if (fill)
|
|
93
|
+
return fill.type === "solid" ? fill.color : undefined;
|
|
94
|
+
return style.color;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* A shape clip that is provably behind the text at every instant the text is
|
|
98
|
+
* on screen, and provably covers it.
|
|
99
|
+
*
|
|
100
|
+
* "Provably" is doing the work. Track z is `1000 - index` (I9), so a higher
|
|
101
|
+
* index draws underneath; the shape must cover the whole frame, because the
|
|
102
|
+
* text's own block box needs a font measurement this check does not have; it
|
|
103
|
+
* must be opaque and solid-filled; and its window must contain the text's. A
|
|
104
|
+
* shape that only mostly qualifies is not reported — the check would then be
|
|
105
|
+
* naming a plate the title may not actually sit on.
|
|
106
|
+
*/
|
|
107
|
+
function backdropShapeColor(doc, text) {
|
|
108
|
+
const trackIndex = new Map(doc.tracks
|
|
109
|
+
.filter((track) => track.type !== "audio" && track.visible)
|
|
110
|
+
.map((track) => [track.id, track.index]));
|
|
111
|
+
const textIndex = trackIndex.get(text.trackId);
|
|
112
|
+
if (textIndex === undefined)
|
|
113
|
+
return undefined;
|
|
114
|
+
const textEndMs = text.startMs + text.durationMs;
|
|
115
|
+
let bestIndex = Number.POSITIVE_INFINITY;
|
|
116
|
+
let bestColor;
|
|
117
|
+
for (const clip of doc.clips) {
|
|
118
|
+
if (clip.mediaType !== "shape" || clip.hidden === true)
|
|
119
|
+
continue;
|
|
120
|
+
const index = trackIndex.get(clip.trackId);
|
|
121
|
+
if (index === undefined || index <= textIndex || index >= bestIndex) {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if ((clip.opacity ?? 1) < 1 || clip.mask || clip.matte)
|
|
125
|
+
continue;
|
|
126
|
+
if (clip.startMs > text.startMs)
|
|
127
|
+
continue;
|
|
128
|
+
if (clip.startMs + clip.durationMs < textEndMs)
|
|
129
|
+
continue;
|
|
130
|
+
const style = clip.shapeStyle;
|
|
131
|
+
if (!style || style.kind !== "rect")
|
|
132
|
+
continue;
|
|
133
|
+
// `shapeBox` defaults: a rect with no geometry covers the middle half of
|
|
134
|
+
// the frame, so an absent field is not "full frame".
|
|
135
|
+
if ((style.x ?? 0.25) > 0 || (style.y ?? 0.25) > 0)
|
|
136
|
+
continue;
|
|
137
|
+
if ((style.width ?? 0.5) < 1 || (style.height ?? 0.5) < 1)
|
|
138
|
+
continue;
|
|
139
|
+
const authoredFill = style.fillStyle ?? style.fill;
|
|
140
|
+
const fill = typeof authoredFill === "string"
|
|
141
|
+
? authoredFill
|
|
142
|
+
: authoredFill?.type === "solid"
|
|
143
|
+
? authoredFill.color
|
|
144
|
+
: undefined;
|
|
145
|
+
if (fill === undefined)
|
|
146
|
+
continue;
|
|
147
|
+
bestIndex = index;
|
|
148
|
+
bestColor = fill;
|
|
149
|
+
}
|
|
150
|
+
return bestColor;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Whether a picture clip is drawn under this text for any of its window.
|
|
154
|
+
*
|
|
155
|
+
* "Under" is the same z rule the backdrop check uses — a higher track index
|
|
156
|
+
* composites below — and any video or image clip counts, since a frame of it
|
|
157
|
+
* can be any colour. What it is *not* is a judgement about contrast: nothing
|
|
158
|
+
* in the document says what the picture looks like at that instant.
|
|
159
|
+
*/
|
|
160
|
+
function pictureUnder(doc, text) {
|
|
161
|
+
const trackIndex = new Map(doc.tracks
|
|
162
|
+
.filter((track) => track.type !== "audio" && track.visible)
|
|
163
|
+
.map((track) => [track.id, track.index]));
|
|
164
|
+
const textIndex = trackIndex.get(text.trackId);
|
|
165
|
+
if (textIndex === undefined)
|
|
166
|
+
return false;
|
|
167
|
+
const textEndMs = text.startMs + text.durationMs;
|
|
168
|
+
return doc.clips.some((clip) => {
|
|
169
|
+
if (clip.mediaType !== "video" && clip.mediaType !== "image")
|
|
170
|
+
return false;
|
|
171
|
+
if (clip.hidden === true)
|
|
172
|
+
return false;
|
|
173
|
+
const index = trackIndex.get(clip.trackId);
|
|
174
|
+
if (index === undefined || index <= textIndex)
|
|
175
|
+
return false;
|
|
176
|
+
return clip.startMs < textEndMs && clip.startMs + clip.durationMs > text.startMs;
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Legibility findings for every text clip in the document. `frameHeight` is the
|
|
181
|
+
* sequence's pixel height — a font size is authored in sequence pixels, so the
|
|
182
|
+
* floor is a fraction of that and not of anything on the author's screen.
|
|
183
|
+
*/
|
|
184
|
+
export function checkLegibility(doc, frameHeight) {
|
|
185
|
+
const issues = [];
|
|
186
|
+
for (const clip of doc.clips) {
|
|
187
|
+
const style = clip.textStyle;
|
|
188
|
+
if (clip.mediaType !== "text" || !style || clip.hidden === true)
|
|
189
|
+
continue;
|
|
190
|
+
const label = clip.name || clip.id;
|
|
191
|
+
const at = { clipId: clip.id, trackId: clip.trackId };
|
|
192
|
+
const minPx = frameHeight * MIN_TEXT_HEIGHT_FRAC;
|
|
193
|
+
if (style.fontSizePx < minPx) {
|
|
194
|
+
issues.push({
|
|
195
|
+
severity: "warning",
|
|
196
|
+
code: "text_illegible",
|
|
197
|
+
message: `Clip "${label}" sets ${Math.round(style.fontSizePx)}px type in a ${frameHeight}px frame — under ${(MIN_TEXT_HEIGHT_FRAC * 100).toFixed(1)}% of frame height (${Math.round(minPx)}px), which is unreadable on a phone.`,
|
|
198
|
+
path: "textStyle.fontSizePx",
|
|
199
|
+
...at
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
// Type drawn straight onto moving picture with nothing behind it is the
|
|
203
|
+
// case the contrast check gives up on — the frame decides it, not the
|
|
204
|
+
// document. Saying nothing made a clean validation read as approval, so
|
|
205
|
+
// the check reports that it could not judge and names the two fixes and
|
|
206
|
+
// the tool that answers it.
|
|
207
|
+
const backed = style.background !== undefined ||
|
|
208
|
+
style.stroke !== undefined ||
|
|
209
|
+
backdropShapeColor(doc, clip) !== undefined;
|
|
210
|
+
if (!backed && pictureUnder(doc, clip)) {
|
|
211
|
+
issues.push({
|
|
212
|
+
severity: "warning",
|
|
213
|
+
code: "text_backing_unproven",
|
|
214
|
+
message: `Clip "${label}" draws over picture with no scrim, plate or outline, so nothing here decides whether it is readable — render the frame with preview_timeline_frame and look, or give it textStyle.background or textStyle.stroke.`,
|
|
215
|
+
path: "textStyle",
|
|
216
|
+
...at
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
const foreground = parseOpaqueColor(textColor(clip));
|
|
220
|
+
if (!foreground)
|
|
221
|
+
continue;
|
|
222
|
+
const plate = style.background?.color;
|
|
223
|
+
const behind = plate ?? backdropShapeColor(doc, clip);
|
|
224
|
+
const background = parseOpaqueColor(behind);
|
|
225
|
+
if (!background)
|
|
226
|
+
continue;
|
|
227
|
+
const ratio = contrastRatio(foreground, background);
|
|
228
|
+
if (ratio >= MIN_CONTRAST_RATIO)
|
|
229
|
+
continue;
|
|
230
|
+
issues.push({
|
|
231
|
+
severity: "warning",
|
|
232
|
+
code: "text_illegible",
|
|
233
|
+
message: `Clip "${label}" draws ${textColor(clip)} on ${behind}${plate ? " (its own background plate)" : " (the shape clip behind it)"} — a contrast ratio of ${ratio.toFixed(2)}:1, under the ${MIN_CONTRAST_RATIO}:1 large-text floor.`,
|
|
234
|
+
path: plate ? "textStyle.background.color" : "textStyle.color",
|
|
235
|
+
...at
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
return issues;
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=legibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legibility.js","sourceRoot":"","sources":["../../src/timeline-debug/legibility.ts"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAEnC,gFAAgF;AAChF,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,+EAA+E;AAC/E,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC;IAC1C,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,GAAG,EAAE,SAAS;IACd,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IA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,GAAG,EAAE;aACN,CAAC,CAAC;QACL,CAAC;QAED,MAAM,UAAU,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,UAAU;YAAE,SAAS;QAC1B,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC;QACtC,MAAM,MAAM,GAAG,KAAK,IAAI,kBAAkB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtD,MAAM,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,UAAU;YAAE,SAAS;QAC1B,MAAM,KAAK,GAAG,aAAa,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACpD,IAAI,KAAK,IAAI,kBAAkB;YAAE,SAAS;QAC1C,MAAM,CAAC,IAAI,CAAC;YACV,QAAQ,EAAE,SAAS;YACnB,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,SAAS,KAAK,WAAW,SAAS,CAAC,IAAI,CAAC,OAAO,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,6BAA6B,0BAA0B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,kBAAkB,sBAAsB;YACzO,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,iBAAiB;YAC9D,GAAG,EAAE;SACN,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a `TimelineDebugReport` as human-readable Markdown for the bundle.
|
|
3
|
+
*/
|
|
4
|
+
import type { TimelineDebugReport } from "./types.js";
|
|
5
|
+
export declare function renderTimelineReportMarkdown(report: TimelineDebugReport): string;
|
|
6
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/timeline-debug/markdown.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAsB,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAiG1E,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAsDhF"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { isString } from "../predicates.js";
|
|
2
|
+
import { isObjectLike } from "../predicates.js";
|
|
3
|
+
const short = (value, max = 120) => {
|
|
4
|
+
if (value === undefined)
|
|
5
|
+
return "—";
|
|
6
|
+
let s;
|
|
7
|
+
try {
|
|
8
|
+
s = isString(value) ? value : JSON.stringify(value);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
s = String(value);
|
|
12
|
+
}
|
|
13
|
+
s = (s ?? "null").replace(/\s+/g, " ");
|
|
14
|
+
return s.length > max ? `${s.slice(0, max)}…` : s;
|
|
15
|
+
};
|
|
16
|
+
const where = (issue) => {
|
|
17
|
+
const parts = [
|
|
18
|
+
issue.clipId ? `clip \`${issue.clipId}\`` : null,
|
|
19
|
+
issue.trackId ? `track \`${issue.trackId}\`` : null,
|
|
20
|
+
issue.path ? `\`${issue.path}\`` : null
|
|
21
|
+
].filter((part) => part !== null);
|
|
22
|
+
return parts.length > 0 ? parts.join(" · ") : "—";
|
|
23
|
+
};
|
|
24
|
+
function issueTable(title, issues, lines) {
|
|
25
|
+
if (issues.length === 0)
|
|
26
|
+
return;
|
|
27
|
+
lines.push("", `## ${title}`, "");
|
|
28
|
+
lines.push("| Severity | Code | Where | Message |");
|
|
29
|
+
lines.push("| --- | --- | --- | --- |");
|
|
30
|
+
for (const issue of issues) {
|
|
31
|
+
lines.push(`| ${issue.severity} | \`${issue.code}\` | ${where(issue)} | ${short(issue.message, 300)} |`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const asRecord = (value) => isObjectLike(value) ? value : null;
|
|
35
|
+
/**
|
|
36
|
+
* The bridge snapshot carries full `documentTracks`/`documentClips` for the
|
|
37
|
+
* report's `finalDocument`; the markdown only needs the reduced view, so
|
|
38
|
+
* render per-track/per-clip lines instead of one giant JSON dump.
|
|
39
|
+
*/
|
|
40
|
+
function finalStateLines(state) {
|
|
41
|
+
const record = asRecord(state);
|
|
42
|
+
const tracks = Array.isArray(record?.tracks) ? record.tracks : null;
|
|
43
|
+
const clips = Array.isArray(record?.clips) ? record.clips : null;
|
|
44
|
+
if (!tracks || !clips)
|
|
45
|
+
return [`- ${short(state, 600)}`];
|
|
46
|
+
const lines = [];
|
|
47
|
+
for (const track of tracks) {
|
|
48
|
+
const onTrack = clips.filter((clip) => clip.trackId === track.id);
|
|
49
|
+
lines.push(`- track \`${track.id ?? "?"}\` (${track.type ?? "?"}, index ${track.index ?? "?"})` +
|
|
50
|
+
`${track.name ? ` "${track.name}"` : ""} — ${onTrack.length} clip(s)`);
|
|
51
|
+
for (const clip of onTrack) {
|
|
52
|
+
const end = (clip.startMs ?? 0) + (clip.durationMs ?? 0);
|
|
53
|
+
lines.push(` - \`${clip.id ?? "?"}\`${clip.name ? ` "${clip.name}"` : ""} ` +
|
|
54
|
+
`${clip.mediaType ?? "?"} ${clip.startMs ?? 0}–${end}ms`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const orphaned = clips.filter((clip) => !tracks.some((track) => track.id === clip.trackId));
|
|
58
|
+
for (const clip of orphaned) {
|
|
59
|
+
lines.push(`- orphaned clip \`${clip.id ?? "?"}\` on missing track \`${clip.trackId ?? "?"}\``);
|
|
60
|
+
}
|
|
61
|
+
return lines;
|
|
62
|
+
}
|
|
63
|
+
export function renderTimelineReportMarkdown(report) {
|
|
64
|
+
const lines = [];
|
|
65
|
+
const title = report.target.name ?? report.target.ref;
|
|
66
|
+
lines.push(`# Timeline debug: ${title}`);
|
|
67
|
+
lines.push("");
|
|
68
|
+
lines.push(`${report.verdict.ok ? "✅" : "❌"} ${report.verdict.headline}`);
|
|
69
|
+
lines.push("");
|
|
70
|
+
lines.push(`Target: \`${report.target.ref}\` (${report.target.kind})`);
|
|
71
|
+
lines.push(`Sequence: ${report.meta.width}×${report.meta.height} @ ${report.meta.fps}fps · ` +
|
|
72
|
+
`${report.meta.durationMs}ms · ${report.meta.trackCount} track(s), ` +
|
|
73
|
+
`${report.meta.clipCount} clip(s)`);
|
|
74
|
+
if (report.verdict.issues.length > 0) {
|
|
75
|
+
lines.push("", "## Issues", "");
|
|
76
|
+
for (const issue of report.verdict.issues)
|
|
77
|
+
lines.push(`- ${issue}`);
|
|
78
|
+
}
|
|
79
|
+
issueTable("Validation", [...report.validation.errors, ...report.validation.warnings], lines);
|
|
80
|
+
if (report.interactions.length > 0) {
|
|
81
|
+
lines.push("", "## Interactions", "");
|
|
82
|
+
lines.push("| Tool | OK | Input | Error |");
|
|
83
|
+
lines.push("| --- | --- | --- | --- |");
|
|
84
|
+
for (const step of report.interactions) {
|
|
85
|
+
lines.push(`| \`${step.tool}\` | ${step.ok ? "✅" : "❌"} | ${short(step.input)} | ${step.error ? short(step.error, 200) : "—"} |`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (report.finalValidation) {
|
|
89
|
+
issueTable("Validation after edits", [...report.finalValidation.errors, ...report.finalValidation.warnings], lines);
|
|
90
|
+
}
|
|
91
|
+
if (report.finalState !== undefined) {
|
|
92
|
+
lines.push("", "## Final state", "");
|
|
93
|
+
lines.push(...finalStateLines(report.finalState));
|
|
94
|
+
}
|
|
95
|
+
if (report.notSimulated.length > 0) {
|
|
96
|
+
lines.push("", "## Not simulated", "");
|
|
97
|
+
for (const entry of report.notSimulated)
|
|
98
|
+
lines.push(`- ${entry}`);
|
|
99
|
+
}
|
|
100
|
+
lines.push("");
|
|
101
|
+
return lines.join("\n");
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src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AAS,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;QACrC,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;QACvC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,YAAY;YAAE,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motion checks: what the animation compiler quietly does to a clip whose
|
|
3
|
+
* authored motion does not fit it, and what the sampler quietly discards when
|
|
4
|
+
* two animations drive the same absolute channel.
|
|
5
|
+
*
|
|
6
|
+
* Everything here reads the compiler's own output (`compileClipAnimations`)
|
|
7
|
+
* rather than restating its window math, so a rule change in
|
|
8
|
+
* `packages/timeline/src/animation/compile.ts` moves these findings with it. A
|
|
9
|
+
* document whose animations all fit produces nothing.
|
|
10
|
+
*/
|
|
11
|
+
import type { TimelineClip } from "@nodetool-ai/protocol/api-schemas/timeline.js";
|
|
12
|
+
import { type Canvas } from "@nodetool-ai/timeline";
|
|
13
|
+
import type { TimelineDebugIssue } from "./types.js";
|
|
14
|
+
/**
|
|
15
|
+
* Every motion finding for one clip. `canvas` is the sequence's pixel size,
|
|
16
|
+
* which the compiler needs to resolve a preset's normalized distances and to
|
|
17
|
+
* count the wrapped lines of a `"line"` stagger.
|
|
18
|
+
*/
|
|
19
|
+
export declare function checkClipMotion(clip: TimelineClip, canvas: Canvas): TimelineDebugIssue[];
|
|
20
|
+
//# sourceMappingURL=motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/timeline-debug/motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAQL,KAAK,MAAM,EAIZ,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAwYrD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,GACb,kBAAkB,EAAE,CAyBtB"}
|