@aicopycoders/exodus 2026.11.1100-beta.4 → 2026.11.1100-beta.6
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 +56 -3
- package/assets/skills/exodus-video/SKILL.md +226 -22
- package/assets/skills/exodus-video/scripts/first-cut-speech.d.mts +100 -0
- package/assets/skills/exodus-video/scripts/first-cut-speech.mjs +361 -0
- package/assets/skills/exodus-video/scripts/first-cut-text-render.mjs +15 -0
- package/assets/skills/exodus-video/scripts/first-cut-text.d.mts +12 -0
- package/assets/skills/exodus-video/scripts/first-cut-text.mjs +18 -4
- package/assets/skills/exodus-video/scripts/first-cut.d.mts +76 -1
- package/assets/skills/exodus-video/scripts/first-cut.mjs +1276 -153
- package/assets/skills/swipe/SKILL.md +1 -1
- package/dist/commands/video-customer.d.ts +31 -0
- package/dist/commands/video-customer.js +21 -0
- package/dist/commands/video-swipe.d.ts +170 -0
- package/dist/commands/video-swipe.js +1648 -44
- package/dist/commands/video.d.ts +20 -1
- package/dist/commands/video.js +110 -6
- package/dist/lib/script-approval.d.ts +3 -0
- package/dist/lib/script-approval.js +17 -0
- package/dist/lib/speechIssueText.d.ts +2 -0
- package/dist/lib/speechIssueText.js +8 -0
- package/dist/lib/template-audition.d.ts +12 -0
- package/dist/lib/template-audition.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template talking-clip edit from measured word times.
|
|
3
|
+
* Standalone so first-cut.mjs and scout scribe.ts share one policy.
|
|
4
|
+
* Door 1/3/4 never call this.
|
|
5
|
+
*
|
|
6
|
+
* A word-to-word silence strictly over 0.8 s is jump-cut, leaving 0.18 s
|
|
7
|
+
* after the earlier word and 0.12 s before the later one. The kept picture
|
|
8
|
+
* starts 0.10 s before the first word and ends 0.28 s after the last.
|
|
9
|
+
* An opening/closing action handle widens those edges. A protected window
|
|
10
|
+
* (reveal pause, resolved action hold) is never removed. A pause the script
|
|
11
|
+
* asks for — ellipsis, dash, a direction, or the laugh beat after a cued
|
|
12
|
+
* line — is not jump-cut when the lines align with the words.
|
|
13
|
+
*
|
|
14
|
+
* Words may be {word, startSec, endSec} or {w, s, e}. Windows may be
|
|
15
|
+
* {startSec, endSec} or {s, e}. Pass fps to land on whole frames: kept
|
|
16
|
+
* silence only grows. Null when there is no measured word to trim to.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
export const TEMPLATE_INTERNAL_PAUSE_SEC = 0.8;
|
|
20
|
+
export const TEMPLATE_PAUSE_KEEP_AFTER_SEC = 0.18;
|
|
21
|
+
export const TEMPLATE_PAUSE_KEEP_BEFORE_SEC = 0.12;
|
|
22
|
+
export const TEMPLATE_SPEECH_LEAD_SEC = 0.1;
|
|
23
|
+
export const TEMPLATE_SPEECH_TAIL_SEC = 0.28;
|
|
24
|
+
export const DIALOGUE_BREATH_LEAD_SEC = 0.5;
|
|
25
|
+
export const DIALOGUE_BREATH_TAIL_SEC = 0.9;
|
|
26
|
+
|
|
27
|
+
const PAUSE_MARK = /…|\.{3,}|[—–]|-{2,}/g;
|
|
28
|
+
const WRITTEN_PAUSE = /…|\.{3}|[—–-]/;
|
|
29
|
+
|
|
30
|
+
const ms = (sec) => Math.round(sec * 1000) / 1000;
|
|
31
|
+
const spoken = (text) => String(text ?? "").toLowerCase().replace(/[^a-z0-9']+/g, "");
|
|
32
|
+
const wordText = (word) => word?.word ?? word?.w ?? "";
|
|
33
|
+
const wordStart = (word) => (Number.isFinite(word?.startSec) ? word.startSec : word?.s);
|
|
34
|
+
const wordEnd = (word) => (Number.isFinite(word?.endSec) ? word.endSec : word?.e);
|
|
35
|
+
const windowStart = (window) => (Number.isFinite(window?.startSec) ? window.startSec : window?.s);
|
|
36
|
+
const windowEnd = (window) => (Number.isFinite(window?.endSec) ? window.endSec : window?.e);
|
|
37
|
+
|
|
38
|
+
/** Heard-word pairs whose silence the script asked for. Empty when the lines do not align. */
|
|
39
|
+
function askedPairs(lines, words) {
|
|
40
|
+
if (!lines?.length) return new Set();
|
|
41
|
+
const pieces = [];
|
|
42
|
+
lines.forEach((line, li) => {
|
|
43
|
+
for (const piece of String(line?.text ?? "").replace(PAUSE_MARK, " $& ").trim().split(/\s+/).filter(Boolean)) {
|
|
44
|
+
pieces.push({ li, piece, spoken: spoken(piece) });
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const heard = [];
|
|
48
|
+
words.forEach((word, i) => {
|
|
49
|
+
if (isZeroDurationSpeech(word)) return;
|
|
50
|
+
heard.push({ i, spoken: spoken(wordText(word)) });
|
|
51
|
+
});
|
|
52
|
+
let h = 0;
|
|
53
|
+
const at = [];
|
|
54
|
+
for (const piece of pieces) {
|
|
55
|
+
if (!piece.spoken) {
|
|
56
|
+
at.push(null);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
while (h < heard.length && heard[h].spoken !== piece.spoken) h++;
|
|
60
|
+
if (h >= heard.length) return new Set();
|
|
61
|
+
at.push(heard[h].i);
|
|
62
|
+
h++;
|
|
63
|
+
}
|
|
64
|
+
const pairs = new Set();
|
|
65
|
+
for (let p = 0; p < pieces.length; p++) {
|
|
66
|
+
if (at[p] === null) continue;
|
|
67
|
+
let n = p + 1;
|
|
68
|
+
while (n < pieces.length && at[n] === null) n++;
|
|
69
|
+
if (n >= pieces.length) break;
|
|
70
|
+
const from = at[p];
|
|
71
|
+
const to = at[n];
|
|
72
|
+
const fromHeard = heard.findIndex((entry) => entry.i === from);
|
|
73
|
+
const toHeard = heard.findIndex((entry) => entry.i === to);
|
|
74
|
+
if (toHeard !== fromHeard + 1) continue;
|
|
75
|
+
const between = pieces.slice(p + 1, n).map((piece) => piece.piece).join(" ");
|
|
76
|
+
const fromLine = lines[pieces[p].li];
|
|
77
|
+
const toLine = lines[pieces[n].li];
|
|
78
|
+
if (
|
|
79
|
+
WRITTEN_PAUSE.test(between) ||
|
|
80
|
+
fromLine?.asksPause ||
|
|
81
|
+
toLine?.asksPause ||
|
|
82
|
+
(pieces[p].li !== pieces[n].li && fromLine?.cuesBeat)
|
|
83
|
+
) {
|
|
84
|
+
pairs.add(`${from}:${to}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return pairs;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function subtractWindows(span, windows) {
|
|
91
|
+
let pieces = [span];
|
|
92
|
+
for (const window of windows) {
|
|
93
|
+
const start = windowStart(window);
|
|
94
|
+
const end = windowEnd(window);
|
|
95
|
+
if (!(end > start)) continue;
|
|
96
|
+
const next = [];
|
|
97
|
+
for (const piece of pieces) {
|
|
98
|
+
if (end <= piece.startSec || start >= piece.endSec) {
|
|
99
|
+
next.push(piece);
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (start > piece.startSec) next.push({ startSec: piece.startSec, endSec: ms(start) });
|
|
103
|
+
if (end < piece.endSec) next.push({ startSec: ms(end), endSec: piece.endSec });
|
|
104
|
+
}
|
|
105
|
+
pieces = next;
|
|
106
|
+
}
|
|
107
|
+
return pieces.filter((piece) => piece.endSec > piece.startSec + 1e-6);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function mergeSpans(spans) {
|
|
111
|
+
const merged = [];
|
|
112
|
+
for (const span of [...spans].sort((a, b) => a.startSec - b.startSec)) {
|
|
113
|
+
const prev = merged.at(-1);
|
|
114
|
+
if (prev && span.startSec <= prev.endSec) prev.endSec = Math.max(prev.endSec, span.endSec);
|
|
115
|
+
else merged.push({ ...span });
|
|
116
|
+
}
|
|
117
|
+
return merged;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Fallback lead for pre-line action prose not covered by a resolved edge window. */
|
|
121
|
+
export const AUTHORED_ACTION_LEAD_SEC = 1.2;
|
|
122
|
+
/** Fallback tail for reaction prose not covered by a resolved edge window. */
|
|
123
|
+
export const AUTHORED_REACTION_TAIL_SEC = 1.0;
|
|
124
|
+
|
|
125
|
+
const PRE_LINE_ACTION = /\b(?:cross(?:es)?|grabs?|sits?|taps?|installs?|leans?\s+in|hid(?:e|es|ing))\b|\bsets?\b(?:\s+\S+){0,6}\s+down\b|\btak(?:e|es|ing)\b(?:\s+\S+){0,6}\s+out\b/i;
|
|
126
|
+
const POST_LINE_REACTION = /\b(?:laugh(?:s|ing)?|nods?|smiles?|smiling|grins?|sighs?)\b/i;
|
|
127
|
+
const TIMED_BEAT = /(?:about\s+)?(\d+(?:\.\d+)?)\s*-?\s*(?:s|sec|secs|second|seconds)\b[^.;]{0,60}\b(?:silent\s+)?(?:beat|pause)\b|\b(?:silent\s+)?(?:beat|pause)\b[^.;]{0,60}(?:about\s+)?(\d+(?:\.\d+)?)\s*-?\s*(?:s|sec|secs|second|seconds)\b/i;
|
|
128
|
+
|
|
129
|
+
function directionText(value) {
|
|
130
|
+
if (Array.isArray(value)) return value.map(directionText).filter(Boolean).join(" ");
|
|
131
|
+
return typeof value === "string" ? value : "";
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* What a stage direction authors, with no added seconds. Planning and the
|
|
136
|
+
* trim each apply their own allowance, so the same text cannot be counted twice.
|
|
137
|
+
* A numbered beat/pause before the line (or with no "after") is a lead; "after" is a tail.
|
|
138
|
+
*/
|
|
139
|
+
export function parseAuthoredBeat(direction) {
|
|
140
|
+
const text = directionText(direction);
|
|
141
|
+
let timedLeadSec = 0;
|
|
142
|
+
let timedTailSec = 0;
|
|
143
|
+
// A period inside 1.25 is not a clause break.
|
|
144
|
+
for (const clause of text.split(/;|(?<!\d)\.(?!\d)/)) {
|
|
145
|
+
const match = clause.match(TIMED_BEAT);
|
|
146
|
+
const seconds = Number(match?.[1] ?? match?.[2]);
|
|
147
|
+
if (!(seconds > 0)) continue;
|
|
148
|
+
if (/\bafter\b/i.test(clause)) timedTailSec = Math.max(timedTailSec, seconds);
|
|
149
|
+
else timedLeadSec = Math.max(timedLeadSec, seconds);
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
timedLeadSec,
|
|
153
|
+
timedTailSec,
|
|
154
|
+
preLineAction: PRE_LINE_ACTION.test(text),
|
|
155
|
+
postLineReaction: POST_LINE_REACTION.test(text),
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function authoredDirection(opts) {
|
|
160
|
+
return directionText([
|
|
161
|
+
opts.direction,
|
|
162
|
+
...(opts.lines ?? []).flatMap((line) => [line?.stageDirection, line?.performanceDirection, line?.action]),
|
|
163
|
+
]);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** Explicit director windows replace fallback handles only on the speech edge they cover. */
|
|
167
|
+
function derivedBeatHandles(opts, windows, firstStart, lastEnd) {
|
|
168
|
+
const plan = parseAuthoredBeat(authoredDirection(opts));
|
|
169
|
+
const coversEdge = (window) => window.kind === "director-beat" || window.kind === "action-phase";
|
|
170
|
+
const leadCovered = windows.some((window) => coversEdge(window) &&
|
|
171
|
+
window.startSec < firstStart && window.endSec >= firstStart);
|
|
172
|
+
const tailCovered = windows.some((window) => coversEdge(window) &&
|
|
173
|
+
window.startSec <= lastEnd && window.endSec > lastEnd);
|
|
174
|
+
return {
|
|
175
|
+
lead: leadCovered ? 0 : Math.max(plan.timedLeadSec, plan.preLineAction ? AUTHORED_ACTION_LEAD_SEC : 0),
|
|
176
|
+
tail: tailCovered ? 0 : Math.max(plan.timedTailSec, plan.postLineReaction ? AUTHORED_REACTION_TAIL_SEC : 0),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** Both timestamps finite and no duration. An incomplete time is not this. */
|
|
181
|
+
export function isZeroDurationSpeech(word) {
|
|
182
|
+
const start = wordStart(word);
|
|
183
|
+
const end = wordEnd(word);
|
|
184
|
+
return Number.isFinite(start) && Number.isFinite(end) && !(end > start);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Template join anchors. A proven zero-duration token is ignored. A word with
|
|
189
|
+
* only one timestamp stays, so the join does not borrow another word's clock.
|
|
190
|
+
*/
|
|
191
|
+
export function templateJoinAnchors(words) {
|
|
192
|
+
const list = words ?? [];
|
|
193
|
+
const kept = list.filter((word) => !isZeroDurationSpeech(word));
|
|
194
|
+
const usable = kept.length ? kept : list;
|
|
195
|
+
const starts = usable.map(wordStart).filter((n) => Number.isFinite(n));
|
|
196
|
+
const ends = usable.map(wordEnd).filter((n) => Number.isFinite(n));
|
|
197
|
+
return {
|
|
198
|
+
firstSec: starts.length ? Math.min(...starts) : undefined,
|
|
199
|
+
lastSec: ends.length ? Math.max(...ends) : undefined,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** A measured word with a real duration. */
|
|
204
|
+
function positiveSpan(word) {
|
|
205
|
+
if (isZeroDurationSpeech(word)) return null;
|
|
206
|
+
const start = wordStart(word);
|
|
207
|
+
const end = wordEnd(word);
|
|
208
|
+
if (!Number.isFinite(start) || !Number.isFinite(end) || !(end > start)) return null;
|
|
209
|
+
return { start, end };
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Bind authored intent to the measured source clock, never to guessed speech
|
|
213
|
+
* duration. These windows reserve picture; they do not prove an action happened.
|
|
214
|
+
* Tagged words are authoritative. Legacy untagged words may bind only when the
|
|
215
|
+
* complete supplied lines match the complete transcript in order.
|
|
216
|
+
*/
|
|
217
|
+
export function templateActionWindows(words, opts = {}) {
|
|
218
|
+
if (!opts.actionPhases?.length && !opts.directorBeats?.length) return [];
|
|
219
|
+
const list = (words ?? []).filter((word) => !isZeroDurationSpeech(word));
|
|
220
|
+
const byLine = new Map();
|
|
221
|
+
const add = (id, word) => {
|
|
222
|
+
if (typeof id !== "string" || !id) return;
|
|
223
|
+
if (!byLine.has(id)) byLine.set(id, []);
|
|
224
|
+
byLine.get(id).push(word);
|
|
225
|
+
};
|
|
226
|
+
if (list.some((word) => typeof word.lineId === "string" && word.lineId)) {
|
|
227
|
+
for (const word of list) add(word.lineId, word);
|
|
228
|
+
} else {
|
|
229
|
+
const expected = (opts.lines ?? []).flatMap((line) =>
|
|
230
|
+
String(line?.text ?? "").split(/\s+/).map(spoken).filter(Boolean)
|
|
231
|
+
.map((text) => ({ id: line.lineId, text })));
|
|
232
|
+
if (expected.length === list.length && expected.every((entry, i) => entry.text === spoken(wordText(list[i])))) {
|
|
233
|
+
expected.forEach((entry, i) => add(entry.id, list[i]));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const cap = Number.isFinite(opts.durationSec) && opts.durationSec > 0 ? opts.durationSec : undefined;
|
|
237
|
+
const anchor = (value) => {
|
|
238
|
+
if (value?.boundary === "scene-start") return 0;
|
|
239
|
+
if (value?.boundary === "scene-end") return cap;
|
|
240
|
+
if (value?.edge !== "start" && value?.edge !== "end") return undefined;
|
|
241
|
+
const line = byLine.get(value.lineId);
|
|
242
|
+
if (!line?.length) return undefined;
|
|
243
|
+
const times = line.map(value.edge === "start" ? wordStart : wordEnd);
|
|
244
|
+
// Missing word times are uncertainty, not permission to borrow another word.
|
|
245
|
+
if (!times.every(Number.isFinite)) return undefined;
|
|
246
|
+
return value.edge === "start" ? Math.min(...times) : Math.max(...times);
|
|
247
|
+
};
|
|
248
|
+
const windows = [];
|
|
249
|
+
const note = (code, entry, detail) => opts.notes?.push(
|
|
250
|
+
`${code}: scene ${opts.sceneIndex ?? "unknown"} ${entry.id}: ${detail}; reservation is not observed action`);
|
|
251
|
+
const bind = (entry, window, kind) => {
|
|
252
|
+
if (typeof entry?.id !== "string" || !entry.id) return;
|
|
253
|
+
const start = anchor(window?.start);
|
|
254
|
+
const end = anchor(window?.end);
|
|
255
|
+
if (!Number.isFinite(start) || !Number.isFinite(end) || start < 0 || !(end > start)) {
|
|
256
|
+
note("beat-reservation-unresolved", entry, "authored anchors have no usable source interval");
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
const endSec = cap === undefined ? end : Math.min(cap, end);
|
|
260
|
+
if (!(endSec > start)) {
|
|
261
|
+
note("beat-reservation-unresolved", entry, "authored interval is outside available source");
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
windows.push({ id: entry.id, kind, startSec: start, endSec });
|
|
265
|
+
if (endSec < end || (window.minActionSec > 0 && endSec - start + 1e-6 < window.minActionSec)) {
|
|
266
|
+
note("beat-reservation-short", entry, `${ms(endSec - start)}s available against ${window.minActionSec ?? ms(end - start)}s requested`);
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
for (const phase of opts.actionPhases ?? []) {
|
|
270
|
+
// Full-scene phases scope proof/observation, not an instruction to retain
|
|
271
|
+
// every source frame. Only a separately resolved edit window reserves time.
|
|
272
|
+
if (phase?.window?.start?.boundary === "scene-start" &&
|
|
273
|
+
phase?.window?.end?.boundary === "scene-end") continue;
|
|
274
|
+
if (phase?.required === true) bind(phase, phase.window, "action-phase");
|
|
275
|
+
}
|
|
276
|
+
for (const beat of opts.directorBeats ?? []) {
|
|
277
|
+
if (Number.isFinite(beat?.timing?.minActionSec) && beat.timing.minActionSec > 0) {
|
|
278
|
+
// A shorter measured interval cannot be repaired by inventing source time.
|
|
279
|
+
bind(beat, beat.timing, "director-beat");
|
|
280
|
+
} else if (typeof beat?.id === "string" && beat.id) {
|
|
281
|
+
note("beat-reservation-unresolved", beat, "no positive authored acting minimum");
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return windows;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
export function templateSpeechEdit(words, opts = {}) {
|
|
291
|
+
const list = words ?? [];
|
|
292
|
+
const fromIndex = opts.span?.first ?? 0;
|
|
293
|
+
const toIndex = opts.span ? opts.span.last : list.length - 1;
|
|
294
|
+
const kept = list.slice(fromIndex, toIndex + 1);
|
|
295
|
+
if (!kept.length) return null;
|
|
296
|
+
const first = kept[0];
|
|
297
|
+
const last = kept[kept.length - 1];
|
|
298
|
+
const firstStart = isZeroDurationSpeech(first)
|
|
299
|
+
? kept.slice(1).map(positiveSpan).find(Boolean)?.start
|
|
300
|
+
: wordStart(first);
|
|
301
|
+
const lastEnd = isZeroDurationSpeech(last)
|
|
302
|
+
? [...kept].reverse().slice(1).map(positiveSpan).find(Boolean)?.end
|
|
303
|
+
: wordEnd(last);
|
|
304
|
+
let latestEnd = -Infinity;
|
|
305
|
+
for (const word of kept) {
|
|
306
|
+
if (isZeroDurationSpeech(word)) continue;
|
|
307
|
+
const end = wordEnd(word);
|
|
308
|
+
if (Number.isFinite(end)) latestEnd = Math.max(latestEnd, end);
|
|
309
|
+
}
|
|
310
|
+
const fps = opts.fps;
|
|
311
|
+
const floorFrame = (sec) => (fps ? Math.floor(sec * fps + 1e-6) / fps : sec);
|
|
312
|
+
const ceilFrame = (sec) => (fps ? Math.ceil(sec * fps - 1e-6) / fps : sec);
|
|
313
|
+
const windows = [...(opts.protectedWindows ?? []), ...templateActionWindows(list, opts)];
|
|
314
|
+
const beat = derivedBeatHandles(opts, windows, firstStart, latestEnd);
|
|
315
|
+
// dialogueBreath has a single allowed value, so any value set asks for the longer breath.
|
|
316
|
+
const breath = Boolean(opts.editingTreatment?.dialogueBreath);
|
|
317
|
+
const lead = Math.max(breath ? DIALOGUE_BREATH_LEAD_SEC : TEMPLATE_SPEECH_LEAD_SEC, opts.actionLeadSec ?? 0, beat.lead);
|
|
318
|
+
const tail = Math.max(breath ? DIALOGUE_BREATH_TAIL_SEC : TEMPLATE_SPEECH_TAIL_SEC, opts.actionTailSec ?? 0, beat.tail);
|
|
319
|
+
const cap = opts.durationSec !== undefined && opts.durationSec > 0 ? opts.durationSec : Infinity;
|
|
320
|
+
// A missing time on the boundary word is uncertain: keep that side. When the last word has an end, the tail is the latest measured end plus 0.28 s, so an earlier word that outlasts it is not cut.
|
|
321
|
+
let headSec = Number.isFinite(firstStart) ? Math.max(0, floorFrame(firstStart - lead)) : 0;
|
|
322
|
+
let tailSec = Number.isFinite(lastEnd) && Number.isFinite(latestEnd) ? Math.min(cap, ceilFrame(latestEnd + tail)) : cap;
|
|
323
|
+
for (const window of windows) {
|
|
324
|
+
const start = windowStart(window);
|
|
325
|
+
const end = windowEnd(window);
|
|
326
|
+
if (!(end > start)) continue;
|
|
327
|
+
if (start < headSec) headSec = Math.max(0, start);
|
|
328
|
+
if (end > tailSec && start < cap) tailSec = Math.min(cap, end);
|
|
329
|
+
}
|
|
330
|
+
headSec = ms(Number.isFinite(firstStart) ? Math.min(headSec, firstStart) : headSec);
|
|
331
|
+
tailSec = ms(Number.isFinite(lastEnd) && Number.isFinite(latestEnd) ? Math.max(tailSec, Math.min(cap, latestEnd)) : tailSec);
|
|
332
|
+
if (!Number.isFinite(tailSec) || !(tailSec > headSec)) return null;
|
|
333
|
+
|
|
334
|
+
const asked = askedPairs(opts.lines, list);
|
|
335
|
+
const cuts = [];
|
|
336
|
+
if (opts.editingTreatment?.time === "continuous-dramatic") return { headSec, tailSec, cuts };
|
|
337
|
+
const nodes = [];
|
|
338
|
+
for (let i = fromIndex; i <= toIndex; i++) {
|
|
339
|
+
if (isZeroDurationSpeech(list[i])) continue;
|
|
340
|
+
const span = positiveSpan(list[i]);
|
|
341
|
+
nodes.push(span ? { index: i, barrier: false, ...span } : { index: i, barrier: true });
|
|
342
|
+
}
|
|
343
|
+
let runningEnd = -Infinity;
|
|
344
|
+
for (let p = 0; p + 1 < nodes.length; p++) {
|
|
345
|
+
const earlier = nodes[p];
|
|
346
|
+
const later = nodes[p + 1];
|
|
347
|
+
// An incomplete word blocks its adjoining pairs, not the protection of
|
|
348
|
+
// an earlier word whose measured end still overlaps later words.
|
|
349
|
+
if (!earlier.barrier) runningEnd = Math.max(runningEnd, earlier.end);
|
|
350
|
+
if (earlier.barrier || later.barrier) continue;
|
|
351
|
+
// Same millisecond clock as sentenceGapCuts, so 1.4→2.2 stays 0.8 s and is kept.
|
|
352
|
+
const gap = ms(later.start - runningEnd);
|
|
353
|
+
if (!(gap > TEMPLATE_INTERNAL_PAUSE_SEC)) continue;
|
|
354
|
+
if (asked.has(`${earlier.index}:${later.index}`)) continue;
|
|
355
|
+
const startSec = ms(ceilFrame(runningEnd + TEMPLATE_PAUSE_KEEP_AFTER_SEC));
|
|
356
|
+
const endSec = ms(floorFrame(later.start - TEMPLATE_PAUSE_KEEP_BEFORE_SEC));
|
|
357
|
+
if (!(endSec > startSec)) continue;
|
|
358
|
+
cuts.push(...subtractWindows({ startSec, endSec }, windows));
|
|
359
|
+
}
|
|
360
|
+
return { headSec, tailSec, cuts: mergeSpans(cuts) };
|
|
361
|
+
}
|
|
@@ -2,6 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { spawnSync } from "node:child_process";
|
|
3
3
|
import { readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
|
+
import { LOWER_PANEL_TOP, READOUT_INSET_BOX } from "./first-cut-text.mjs";
|
|
5
6
|
|
|
6
7
|
const literal = (lines) => {
|
|
7
8
|
if (!Array.isArray(lines) || lines.some((line) => typeof line !== "string" || /[{}\\\r\n]/.test(line))) {
|
|
@@ -32,6 +33,20 @@ export function measuredTextAss(directives, { W = 1080, H = 1920, style = "" } =
|
|
|
32
33
|
};
|
|
33
34
|
for (const c of directives.captions ?? []) event(c.s, c.e, "Cap", Math.round(c.xShare * W), Math.round(c.yShare * H), c.fs, c.lines);
|
|
34
35
|
for (const c of [...(directives.cards ?? []), directives.hook, directives.endCard].filter(Boolean)) {
|
|
36
|
+
// Only template-gated proof directives carry this field. The insert is an
|
|
37
|
+
// opaque editorial surface, not a claim to have tracked/generated a screen.
|
|
38
|
+
if (c.proof) {
|
|
39
|
+
const window = textFrameWindow(c.in, c.out);
|
|
40
|
+
if (c.proof.kind === "readout") {
|
|
41
|
+
// Readout proof is an editorial inset, never an opaque replacement for
|
|
42
|
+
// the filmed phone/action. Keep the ground bounded even for old boards.
|
|
43
|
+
const [left, top, right, bottom] = READOUT_INSET_BOX.map((v, i) => Math.round(v * (i % 2 ? H : W)));
|
|
44
|
+
events.push(`Dialogue: -1,${assTime(window.startCs)},${assTime(window.endCs)},Card,,0,0,0,,{\\an7\\pos(0,0)\\bord2\\3c&H665544&\\shad4\\1c&HFFFFFF&\\1a&H00&\\p1}m ${left} ${top} l ${right} ${top} ${right} ${bottom} ${left} ${bottom}{\\p0}`);
|
|
45
|
+
} else {
|
|
46
|
+
const top = c.proof.presentation === "lower-panel" ? Math.round(H * LOWER_PANEL_TOP) : 0;
|
|
47
|
+
events.push(`Dialogue: -1,${assTime(window.startCs)},${assTime(window.endCs)},Card,,0,0,0,,{\\an7\\pos(0,0)\\bord0\\shad0\\1c&HFFFFFF&\\1a&H00&\\p1}m 0 ${top} l ${W} ${top} ${W} ${H} 0 ${H}{\\p0}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
35
50
|
const [x, y] = anchor(c.renderBox, W, H);
|
|
36
51
|
event(c.in, c.out, c.kind === "end" ? "End" : "Card", x, y, c.fs, c.lines);
|
|
37
52
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// B32–B34 consumer contract. No source mutation, policy table or width estimate.
|
|
2
|
+
export const LOWER_PANEL_TOP: number;
|
|
3
|
+
export const READOUT_INSET_BOX: [number, number, number, number];
|
|
2
4
|
/** Normalized [left, top, right, bottom] (XYXY), not storyboard XYWH. */
|
|
3
5
|
export type Box = [number, number, number, number];
|
|
4
6
|
export interface TextHold { code: string; id: string; reason: string; required: true; inherited?: true }
|
|
@@ -33,9 +35,17 @@ export interface CaptionScreen {
|
|
|
33
35
|
s: number; e: number; xShare: number; yShare: number; box: Box;
|
|
34
36
|
measurement: RasterMeasurement;
|
|
35
37
|
}
|
|
38
|
+
export interface ProofInsert {
|
|
39
|
+
kind: string; sourceQuote: string; assertion: "source-assertion";
|
|
40
|
+
requirementQuote?: string;
|
|
41
|
+
actionPhaseId?: string;
|
|
42
|
+
presentation: "full-frame" | "lower-panel";
|
|
43
|
+
}
|
|
36
44
|
export interface TextItem {
|
|
37
45
|
id: string; kind?: string; text: string; required?: boolean; in?: number; out?: number;
|
|
38
46
|
box?: Box; placement?: string; provenance?: "post" | "physical-readout" | "authentic-lettering";
|
|
47
|
+
/** Honored only with the template capability; never an observed physical readout. */
|
|
48
|
+
proof?: ProofInsert;
|
|
39
49
|
/** Authored question boundary is not clamped to this explanatory heard line. */
|
|
40
50
|
within?: { start: number; end: number };
|
|
41
51
|
/** Supplied authored readability requirement; never computed from string length.
|
|
@@ -52,6 +62,7 @@ export interface TextCard {
|
|
|
52
62
|
/** Authored geometry used for the raster and final burn. Do not recenter on ink. */
|
|
53
63
|
renderBox: Box;
|
|
54
64
|
in: number; out: number; moved: false; measurement: RasterMeasurement;
|
|
65
|
+
proof?: ProofInsert;
|
|
55
66
|
}
|
|
56
67
|
export interface Observation {
|
|
57
68
|
source: SourceIdentity; text: string; box: Box;
|
|
@@ -102,6 +113,7 @@ export interface CardOptions {
|
|
|
102
113
|
avoid?: Avoidance[]; captionRects?: Avoidance[]; W: number; H: number;
|
|
103
114
|
totalSec?: number | null; endCardAllowed?: boolean; measureText?: MeasureText;
|
|
104
115
|
source?: SourceIdentity; words?: HeardWord[]; verifyObservation?: VerifyObservation;
|
|
116
|
+
template?: boolean;
|
|
105
117
|
}
|
|
106
118
|
export interface PlanTextInput extends CardOptions {
|
|
107
119
|
treatment: string; words?: HeardWord[];
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
// The consumer supplies its actual libass raster measurement and trusted media
|
|
3
3
|
// observation capabilities. Neither an item receipt nor a font-width estimate
|
|
4
4
|
// is evidence. Missing capabilities produce holds, never source mutations.
|
|
5
|
+
// Mirrors video/lib/readableProof.ts; executable/TS lockstep is regression-tested.
|
|
6
|
+
export const LOWER_PANEL_TOP = .65;
|
|
7
|
+
/** Editorial app readouts leave the filmed action visible; mirrored in readableProof.ts. */
|
|
8
|
+
export const READOUT_INSET_BOX = [.08, .70, .92, .88];
|
|
5
9
|
const hasText = (v) => typeof v === "string" && v.trim().length > 0;
|
|
6
10
|
const squash = (s) => String(s ?? "").replace(/\s+/gu, " ").trim();
|
|
7
11
|
const CONTROL = /[{}\\\u0000-\u001f\u007f]/u;
|
|
@@ -194,7 +198,7 @@ function observe(item, { source, words = [], verifyObservation }) {
|
|
|
194
198
|
return o;
|
|
195
199
|
}
|
|
196
200
|
|
|
197
|
-
export function planCards(items, { avoid = [], captionRects = [], W, H, totalSec = null, endCardAllowed = false, measureText, source, words, verifyObservation } = {}) {
|
|
201
|
+
export function planCards(items, { avoid = [], captionRects = [], W, H, totalSec = null, endCardAllowed = false, measureText, source, words, verifyObservation, template = false } = {}) {
|
|
198
202
|
const holds = [], skipped = [], readouts = [], notes = [], reservations = [], cards = [];
|
|
199
203
|
const placed = [...captionRects];
|
|
200
204
|
const fail = (item, code, reason) => item.required === true || ["physical-readout", "authentic-lettering"].includes(item.provenance) ? holds.push(hold(code, item.id, reason)) : skipped.push({ id: item.id, code, reason });
|
|
@@ -227,14 +231,24 @@ export function planCards(items, { avoid = [], captionRects = [], W, H, totalSec
|
|
|
227
231
|
const text = squash(item.text);
|
|
228
232
|
const m = fitText(text, { kind, fs: Math.round(H * FONT_SHARE[kind]), box: item.box, xShare: (item.box[0] + item.box[2]) / 2, yShare: (item.box[1] + item.box[3]) / 2, W, H, maxLines: MAX_LINES[kind], measureText });
|
|
229
233
|
if (m.code) { fail(item, m.code, "no trusted raster measurement fits the authored box"); continue; }
|
|
234
|
+
const proof = template ? item.proof : undefined;
|
|
235
|
+
if (proof && (proof.assertion !== "source-assertion" || !hasText(proof.sourceQuote) ||
|
|
236
|
+
!["full-frame", "lower-panel"].includes(proof.presentation) || item.provenance !== "post")) {
|
|
237
|
+
fail(item, "proof-invalid", "a template insert must remain a source assertion on a post-owned surface"); continue;
|
|
238
|
+
}
|
|
239
|
+
const surface = proof?.kind === "readout" ? READOUT_INSET_BOX
|
|
240
|
+
: proof?.presentation === "full-frame" ? [0, 0, 1, 1] : proof ? [0, LOWER_PANEL_TOP, 1, 1] : null;
|
|
241
|
+
if (surface && reservations.some(r => overlapsTime(item, r) && meets(surface, r.box))) {
|
|
242
|
+
fail(item, "proof-obscures-readout", "an opaque insert cannot cover reserved observed evidence"); continue;
|
|
243
|
+
}
|
|
230
244
|
if ([...avoid, ...reservations, ...placed].some((a) => validBox(a.box) && overlapsTime(item, a) && meets(m.box, a.box))) { fail(item, "geometry-blocked", "measured text intersects reserved pixels; no invented relocation"); continue; }
|
|
231
|
-
const card = { id: item.id, kind, label: text, lines: m.lines, fs: m.fs, box: m.box, renderBox: item.box, in: item.in, out: item.out, moved: false, measurement: m.measurement };
|
|
245
|
+
const card = { id: item.id, kind, label: text, lines: m.lines, fs: m.fs, box: m.box, renderBox: item.box, in: item.in, out: item.out, moved: false, measurement: m.measurement, ...(proof ? { proof } : {}) };
|
|
232
246
|
placed.push(card); cards.push(card);
|
|
233
247
|
}
|
|
234
248
|
return { cards: cards.filter((c) => !["hook", "end"].includes(c.kind)).map((c, i) => ({ n: i + 1, ...c })), hook: cards.find((c) => c.kind === "hook") ?? null, endCard: cards.find((c) => c.kind === "end") ?? null, readouts, holds, skipped, notes, reservations };
|
|
235
249
|
}
|
|
236
250
|
|
|
237
|
-
export function planText({ treatment, words = [], captions = {}, items = [], avoid = [], selection = {}, libass = false, W, H, totalSec = null, inheritedHolds = [], measureText, source, verifyObservation, cuts = [] }) {
|
|
251
|
+
export function planText({ treatment, words = [], captions = {}, items = [], avoid = [], selection = {}, libass = false, W, H, totalSec = null, inheritedHolds = [], measureText, source, verifyObservation, cuts = [], template = false }) {
|
|
238
252
|
const holds = inheritedHolds.map((h) => ({ ...h, required: true, inherited: true }));
|
|
239
253
|
const permissions = outputPermissions({ treatment, captions: captions.on === true, selection });
|
|
240
254
|
holds.push(...permissions.holds);
|
|
@@ -251,7 +265,7 @@ export function planText({ treatment, words = [], captions = {}, items = [], avo
|
|
|
251
265
|
}
|
|
252
266
|
if (permissions.endCard) all.push({ ...selection.endCard, id: "end-card", kind: "end", required: true });
|
|
253
267
|
if (permissions.offer) all.push({ ...selection.offer, id: "offer", kind: "offer", required: true });
|
|
254
|
-
const cp = planCards(all, { avoid, W, H, totalSec, endCardAllowed: permissions.endCard, measureText, source, words, verifyObservation });
|
|
268
|
+
const cp = planCards(all, { avoid, W, H, totalSec, endCardAllowed: permissions.endCard, measureText, source, words, verifyObservation, template });
|
|
255
269
|
holds.push(...cp.holds); result.skipped.push(...cp.skipped); result.readouts = cp.readouts;
|
|
256
270
|
directives.cards = cp.cards; directives.hook = cp.hook; directives.endCard = cp.endCard;
|
|
257
271
|
if (captions.on === true) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// #2988: the types of the exports the Trigger worker calls. The script is
|
|
2
2
|
// plain JS so the CLI can run it with `node` and no build.
|
|
3
|
-
import type { SourceIdentity, TextItem, TextPlan, VerifyObservation, RasterMeasurement, MeasureText } from "./first-cut-text.mjs";
|
|
3
|
+
import type { SourceIdentity, TextItem, TextPlan, PlanTextInput, VerifyObservation, RasterMeasurement, MeasureText } from "./first-cut-text.mjs";
|
|
4
4
|
|
|
5
5
|
// The worker's shapes (scout cut-sounds.ts, temporal-action-evidence.ts), kept loose here: the root typecheck
|
|
6
6
|
// runs without scout's packages, so the tool's types must not load the worker.
|
|
@@ -33,7 +33,12 @@ export interface FinishFulfillment {
|
|
|
33
33
|
ok: boolean;
|
|
34
34
|
lines: Array<{
|
|
35
35
|
lineId: string; sourceSpan: { lineId: string; startChar: number; endChar: number; partId: string } | null;
|
|
36
|
+
/** Honest token comparison of the retained heard words; false never by itself holds an ASR route. */
|
|
36
37
|
retained: string[]; exactCanonicalWords: boolean;
|
|
38
|
+
/** Template native/song ASR routes only: the line is proven by its measured
|
|
39
|
+
* source/master audio window surviving the actual edit; null when a retained
|
|
40
|
+
* scene has no heard word measuring the line (unknown, advisory). Aligned TTS omits these. */
|
|
41
|
+
audioRoute?: "native-asr" | "song-asr"; audioWindowRetained?: boolean | null;
|
|
37
42
|
}>;
|
|
38
43
|
beats: Array<{
|
|
39
44
|
id: string; windows: Array<{ start: number; end: number }>; seconds: number; reservedSeconds: number | null;
|
|
@@ -49,6 +54,8 @@ export interface FinishFulfillment {
|
|
|
49
54
|
};
|
|
50
55
|
holds: FinishHold[];
|
|
51
56
|
resolvedPlanningFindings: Array<{ scene: number; code: string; phaseId: string }>;
|
|
57
|
+
/** Advisory ASR wording disagreements on retained native/song audio. */
|
|
58
|
+
notes: string[];
|
|
52
59
|
}
|
|
53
60
|
export interface TemporalFinishEvidence {
|
|
54
61
|
requirements: TemporalRequirement[];
|
|
@@ -93,6 +100,8 @@ export interface SourceMapFinding {
|
|
|
93
100
|
code: string;
|
|
94
101
|
scene: number | null;
|
|
95
102
|
detail: string;
|
|
103
|
+
/** Ordered actionable choices for the current selected inputs; never an unchanged deterministic retry. */
|
|
104
|
+
nextActions?: Array<"choose-longer-target">;
|
|
96
105
|
}
|
|
97
106
|
|
|
98
107
|
export interface NarrationFinishClock {
|
|
@@ -176,6 +185,8 @@ export interface SourceEditMap {
|
|
|
176
185
|
/** Each sung scene's stretch, in frames into the song. */
|
|
177
186
|
intervals: Array<{ scene: number; fromFrame: number; toFrame: number }>;
|
|
178
187
|
sampleRate?: number; primingSamples?: number; decodedSec?: number; samples?: number; endSample?: number; pictureEndSample?: number;
|
|
188
|
+
/** Original source decodedSec stays intact; only measured trailing silence is omitted from the retained sample span. */
|
|
189
|
+
trimmedSilenceSamples?: number;
|
|
179
190
|
} | null;
|
|
180
191
|
/** The bytes each measured clock was read from. */
|
|
181
192
|
sources?: Array<{ file: string; bytes: number; sha256: string }>;
|
|
@@ -353,7 +364,35 @@ export interface CutMotion {
|
|
|
353
364
|
}>;
|
|
354
365
|
}
|
|
355
366
|
|
|
367
|
+
/** Assembly provenance, not a new final-audio ASR or visual-quality observation.
|
|
368
|
+
* Template runs write <name>.finish.json, including a non-final receipt when a
|
|
369
|
+
* missing-scene pull is refused. Door 1 keeps its existing return shape. */
|
|
370
|
+
export interface CutFinishEvidence {
|
|
371
|
+
version: "cut-finish-evidence.v1";
|
|
372
|
+
provenance: {
|
|
373
|
+
kind: "partial" | "pre-text" | "final";
|
|
374
|
+
isFinal: boolean;
|
|
375
|
+
complete: boolean;
|
|
376
|
+
expectedSceneIndexes: number[];
|
|
377
|
+
retainedSceneIndexes: number[];
|
|
378
|
+
missingSceneIndexes: number[];
|
|
379
|
+
skippedSceneIndexes: number[];
|
|
380
|
+
/** Available pulled scenes intentionally omitted by the editor; these do not make a cut partial. */
|
|
381
|
+
editorOmittedSceneIndexes: number[];
|
|
382
|
+
};
|
|
383
|
+
artifact: { file: string; sha256: string; bytes: number } | null;
|
|
384
|
+
loudness: { status: "measured" | "unknown"; integratedLufs: number | null; truePeakDbtp: number | null; rangeLu: number | null };
|
|
385
|
+
words: {
|
|
386
|
+
basis: "source-word-sidecars-through-audible-edit-clock";
|
|
387
|
+
finalAudioTranscribed: false;
|
|
388
|
+
expected: number; source: number; native: number; final: number;
|
|
389
|
+
coverage: "complete" | "incomplete" | "unknown";
|
|
390
|
+
missing: string[];
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
|
|
356
394
|
export interface FirstCut {
|
|
395
|
+
notes?: string[];
|
|
357
396
|
out: string;
|
|
358
397
|
durationSec: number;
|
|
359
398
|
/** The music file the cut used, or null. */
|
|
@@ -363,6 +402,7 @@ export interface FirstCut {
|
|
|
363
402
|
left: string[];
|
|
364
403
|
};
|
|
365
404
|
motion?: CutMotion;
|
|
405
|
+
finishEvidence?: CutFinishEvidence;
|
|
366
406
|
/** Budget-only decoded receipt; also supported when sourceEditMap is absent. */
|
|
367
407
|
planningTiming?: FinalPlanningTiming;
|
|
368
408
|
/** Present only when the manifest turned a finishing setting on. */
|
|
@@ -385,13 +425,48 @@ export interface FirstCut {
|
|
|
385
425
|
/** The map's file beside the cut: <name>.source-map.json. */
|
|
386
426
|
export function sourceMapPath(outPath: string): string;
|
|
387
427
|
|
|
428
|
+
/** A complete Template final rendered without prepareText owes the same exact
|
|
429
|
+
* approved-word proof as completeFirstCutText: any required-words-not-retained
|
|
430
|
+
* line writes <out>.text.json { fulfillment: { lines, holds } }, removes the
|
|
431
|
+
* unproven cut and throws TextFinishRefusal. Captions/cards off never weaken it.
|
|
432
|
+
* A word's explicit lineId (or a mapped cut's measured line part) owns it and
|
|
433
|
+
* is never corrected; one its scene does not claim holds that scene's lines.
|
|
434
|
+
* An untagged word on an unmapped cut, including a native Omni transcript,
|
|
435
|
+
* belongs to its scene's one uniquely owned line. A narration/song piece may
|
|
436
|
+
* also use the existing lineParts map only when that map measures every claimed
|
|
437
|
+
* line and covers every retained word in order. Anything unplaced or ambiguous
|
|
438
|
+
* holds; untagged multi-line native pieces cannot use a narration line map. */
|
|
388
439
|
export function firstCut(options: FirstCutOptions): FirstCut;
|
|
440
|
+
export interface FinalSetupEvidence {
|
|
441
|
+
setupSegments: Array<{
|
|
442
|
+
sceneIndex: number | null; file: string | null;
|
|
443
|
+
setId: string | null; anchorEditEpoch: string | null; baseShotId: string | null;
|
|
444
|
+
finalStartSec: number; finalEndSec: number;
|
|
445
|
+
sourceStartSec: number | null; sourceEndSec: number | null;
|
|
446
|
+
identity: "authored"; clock: "mapped" | "timeline";
|
|
447
|
+
}>;
|
|
448
|
+
setupJoins: Array<{
|
|
449
|
+
atSec: number; left: number; right: number;
|
|
450
|
+
kind: "different-setup" | "continuous-same-source" | "discontinuous-same-setup" | "unknown";
|
|
451
|
+
}>;
|
|
452
|
+
}
|
|
453
|
+
/** Authored identity plus actual timeline/source continuity, never watched-angle proof. */
|
|
454
|
+
export function finalSetupAdjacency(timeline: unknown, board: unknown, graphics?: readonly unknown[]): FinalSetupEvidence;
|
|
455
|
+
/** Actual decoded kept clips plus source-clock authored reservations; never action observations. */
|
|
456
|
+
export function directorCutEvidence(cut: unknown, board: unknown): FinalSetupEvidence & {
|
|
457
|
+
segments?: Array<{ sceneIndex: number; sourceStartSec: number; sourceEndSec: number; finalStartSec: number; finalEndSec: number }>;
|
|
458
|
+
beatWindows: Array<{ sceneIndex: number; beatId: string; startSec: number; endSec: number }>;
|
|
459
|
+
};
|
|
389
460
|
/** Resolve approved authored phases against visible source/word windows.
|
|
390
461
|
* Flexible template phases bind actual planPicture slots, never unused capacity. */
|
|
391
462
|
export function resolveTemporalRequirements(cut: FirstCut, board: unknown): Pick<TemporalFinishEvidence, "requirements" | "owners" | "holds">;
|
|
392
463
|
/** Consume exact-source temporal evidence and retained media. Unknown inputs are
|
|
393
464
|
* serialized board/policy/receipt shapes; this does not manufacture observations. */
|
|
394
465
|
export function finishFulfillment(cut: FirstCut, board: unknown, policy: unknown, temporal?: unknown): FinishFulfillment;
|
|
466
|
+
/** Convert serialized board/policy inputs into the actual selected text layout. */
|
|
467
|
+
export function textMaterial(cut: unknown, board: unknown, policy: unknown): Omit<PlanTextInput, "libass"> & {
|
|
468
|
+
items: TextItem[]; pictureHolds: FinishHold[]; skippedPictures: FinishHold[];
|
|
469
|
+
};
|
|
395
470
|
/** Measures the actual final file without constructing a source map or changing media. */
|
|
396
471
|
export function measureCutPlanningTiming(file: string, planningBudget: PlanningBudget): {
|
|
397
472
|
planningTiming: FinalPlanningTiming;
|