@aicopycoders/exodus 2026.11.1200-beta.14 → 2026.11.1200-beta.15
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.
|
@@ -362,10 +362,15 @@ the run started:
|
|
|
362
362
|
|
|
363
363
|
- **The app makes the cut** of a swiped video, a video from the dashboard's
|
|
364
364
|
Video page and a beta tester's run, once every clip is made and no scene is
|
|
365
|
-
held.
|
|
365
|
+
held. While it makes it, `status` on an admin key says "Every piece is
|
|
366
|
+
made. The app makes the cut now; look again in a minute: exodus video
|
|
367
|
+
status <runId>": make no cut of your own, and read `status` again in a
|
|
368
|
+
minute. `exodus video wait <runId>` waits through it. On a run started with `--one-shot` that cut is delivered by itself,
|
|
366
369
|
with no approve: on an admin key `status` then says "Final cut: approved
|
|
367
370
|
and delivered.", and on a beta tester's key "Your video is ready: <link>".
|
|
368
|
-
|
|
371
|
+
In the minute between the cut and the delivery, `status` on an admin key
|
|
372
|
+
says "Final cut: made. This run delivers it by itself; look again in a
|
|
373
|
+
minute.": read it again then, and send no approve. Only when the app's check of the finished film against its own sound fails
|
|
369
374
|
(One-take UGC checks it) does a One-shot cut wait instead, as a Guided one
|
|
370
375
|
does, with the check's sentences under it in `status`. The member's last say is before that: the One-shot yes, and the yes to keep
|
|
371
376
|
the last held take, since that keep starts the cut. Say so at each. Give
|
|
@@ -388,14 +393,18 @@ it): ask approve, a new run that films every take again at its full price
|
|
|
388
393
|
(for a swiped video, `exodus video swipe start <swipeId> --again`, its price
|
|
389
394
|
first), or stop here.
|
|
390
395
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
396
|
+
`pull` also writes the finished video as `video.<ext>` once the run has one,
|
|
397
|
+
on an admin key as on a beta tester's. On a delivered run it ends "This run
|
|
398
|
+
is delivered. The finished video is <file>.": give the member that file and
|
|
399
|
+
the run page to watch it. On a run the app cuts, once every piece is made
|
|
400
|
+
and until it is delivered, it ends with no upload line: make no cut of your
|
|
401
|
+
own, unless `status` says the app's cut didn't work and offers you to cut it
|
|
402
|
+
yourself, and the member says yes.
|
|
395
403
|
|
|
396
404
|
- Approve: `exodus video approve <runId>` makes the cut the ad. It is one-way.
|
|
397
|
-
- Redo a clip: `retry-clip` as at stop 4, after their yes.
|
|
398
|
-
|
|
405
|
+
- Redo a clip: `retry-clip` as at stop 4, after their yes. On a run the app
|
|
406
|
+
cuts, it cuts again by itself (read `status`); on any other, pull, cut and
|
|
407
|
+
upload again.
|
|
399
408
|
|
|
400
409
|
**On the song format**, tell the member this before they approve: "The song
|
|
401
410
|
made here is for review. Before this video runs as a paid ad, make the same
|
|
@@ -1003,9 +1012,9 @@ every video has started:
|
|
|
1003
1012
|
<runId>` and do what it prints. The app makes a swiped video's cut ("End:
|
|
1004
1013
|
watch and approve"), so make no cut of your own. A one-shot run is
|
|
1005
1014
|
delivered by itself once that cut is made: give the member its run page.
|
|
1006
|
-
While the app makes it, `status`
|
|
1007
|
-
|
|
1008
|
-
again
|
|
1015
|
+
While the app makes it, `status` says "Every piece is made. The app makes
|
|
1016
|
+
the cut now; look again in a minute: exodus video status <runId>": read
|
|
1017
|
+
`status` again in a minute. A run that stopped at the storyboard goes to
|
|
1009
1018
|
stop 3, then the end.
|
|
1010
1019
|
|
|
1011
1020
|
**Never start the same swipe twice.** One swipe is one video. A start of a
|
|
@@ -1648,7 +1657,10 @@ under it:
|
|
|
1648
1657
|
`retry-frame --note` before `retry-clip`; the clip redo alone resends the
|
|
1649
1658
|
refused picture. On a video the app cuts itself (one started from the
|
|
1650
1659
|
dashboard, a swiped video, a beta tester's run: "End: watch and approve"),
|
|
1651
|
-
the app makes the cut
|
|
1660
|
+
the app makes the cut. While it makes it, the stop block says "Every piece
|
|
1661
|
+
is made. The app makes the cut now; look again in a minute: exodus video
|
|
1662
|
+
status <runId>" and names no pull, upload or `retry-clip`: read `status`
|
|
1663
|
+
again in a minute. When a scene's clip still has a drawing fault after it was made
|
|
1652
1664
|
again, the stop block says `Held:` and names the scene
|
|
1653
1665
|
(`stop.heldScenes` in `--json`). No cut is made until each held scene is
|
|
1654
1666
|
made again with `retry-clip`, or kept as it is with `exodus video keep
|
|
@@ -1657,7 +1669,8 @@ under it:
|
|
|
1657
1669
|
A One-take take held for its words, for a picture that came out turned on
|
|
1658
1670
|
its side or upside down, or for a product label that came out backwards and
|
|
1659
1671
|
could not be fixed, is named under `Held:` with its own
|
|
1660
|
-
sentence, every reason it was held for (`stop.heldTakes` in `--json`)
|
|
1672
|
+
sentence, every reason it was held for (`stop.heldTakes` in `--json`), from
|
|
1673
|
+
the moment the take is made. It
|
|
1661
1674
|
cannot be made again on its own, so no `retry-clip` is offered. Show the user the sentence
|
|
1662
1675
|
and ask them to watch the take. With their yes, `exodus video keep <runId>
|
|
1663
1676
|
--scene <n>` keeps it as it is: it orders nothing, and keeping the last held
|
|
@@ -2318,8 +2331,10 @@ length. Do not invent a number.
|
|
|
2318
2331
|
`pull` writes a flat folder and a `manifest.json` that indexes it. The manifest
|
|
2319
2332
|
is the data you decide from; the filenames are its values. Scene numbers are the
|
|
2320
2333
|
run's own. Every `pull` re-downloads and overwrites every file, so running it
|
|
2321
|
-
again is always safe.
|
|
2322
|
-
watch and approve")
|
|
2334
|
+
again is always safe. Once the run has a finished video, it writes that too,
|
|
2335
|
+
as `video.<ext>` ("End: watch and approve"), except while the app makes the
|
|
2336
|
+
cut again after a redo: the one on the run then is about to be replaced. When
|
|
2337
|
+
a different `video.<ext>` was already in the folder, it says it replaced it.
|
|
2323
2338
|
|
|
2324
2339
|
```
|
|
2325
2340
|
storyboard.json the whole storyboard envelope (see below)
|
|
@@ -2334,6 +2349,7 @@ narration.mp3 one continuous narrator take of the whole script
|
|
|
2334
2349
|
narration.json that take's settings, master-timeline words, and the
|
|
2335
2350
|
per-scene ranges it was cut into
|
|
2336
2351
|
music.<ext> the music bed
|
|
2352
|
+
video.<ext> the finished video, once the run has one
|
|
2337
2353
|
manifest.json the index below
|
|
2338
2354
|
```
|
|
2339
2355
|
|
|
@@ -2413,6 +2429,8 @@ provenance which saved rulebook this run followed:
|
|
|
2413
2429
|
rig is a copy. Names, ids and a version
|
|
2414
2430
|
only — never the rules themselves
|
|
2415
2431
|
failed[] files that did not download: {file, url, error}
|
|
2432
|
+
video the finished video's filename; null when it
|
|
2433
|
+
did not download. Absent when the run has none
|
|
2416
2434
|
```
|
|
2417
2435
|
|
|
2418
2436
|
### What each piece is
|
|
@@ -3133,6 +3133,8 @@ function runStateWord(data) {
|
|
|
3133
3133
|
return "failed";
|
|
3134
3134
|
if (run.isTerminal)
|
|
3135
3135
|
return "done";
|
|
3136
|
+
if (run.appCut === "making")
|
|
3137
|
+
return "running";
|
|
3136
3138
|
if (run.status === "awaiting-approval" || run.status === "awaiting-review") {
|
|
3137
3139
|
const parked = run.nodes.find((node) => node.nodeId === run.pausedNodeId);
|
|
3138
3140
|
return run.pauseReason === undefined && parked && ["scene-frames", "storyboard"].includes(parked.kind) ? "storyboard" : "waiting";
|
package/dist/commands/video.d.ts
CHANGED
|
@@ -107,6 +107,7 @@ export type ArtifactSubset = {
|
|
|
107
107
|
words?: ClipWord[];
|
|
108
108
|
qc?: ClipQc;
|
|
109
109
|
final?: boolean;
|
|
110
|
+
autoCut?: boolean;
|
|
110
111
|
revoiced?: boolean;
|
|
111
112
|
speechTrimmed?: boolean;
|
|
112
113
|
tailTrimmed?: boolean;
|
|
@@ -225,6 +226,9 @@ export interface VideoRun {
|
|
|
225
226
|
};
|
|
226
227
|
workflowId?: string;
|
|
227
228
|
cutHeldScenes?: number[];
|
|
229
|
+
appCut?: "making" | "needs-person";
|
|
230
|
+
storyboardAutoApprove?: boolean;
|
|
231
|
+
moduleKey?: string;
|
|
228
232
|
cutFailure?: {
|
|
229
233
|
sentence: string;
|
|
230
234
|
};
|
|
@@ -256,6 +260,9 @@ export interface NodeItem {
|
|
|
256
260
|
error?: string;
|
|
257
261
|
attempt?: number;
|
|
258
262
|
flagged?: boolean;
|
|
263
|
+
acceptedAsIs?: {
|
|
264
|
+
at: number;
|
|
265
|
+
};
|
|
259
266
|
findings?: ClipFinding[];
|
|
260
267
|
speech?: SpeechSummary;
|
|
261
268
|
staleClaim?: boolean;
|
|
@@ -290,12 +297,14 @@ export interface FlowResult {
|
|
|
290
297
|
lines: string[];
|
|
291
298
|
usage?: true;
|
|
292
299
|
}
|
|
300
|
+
export declare function checkDownloadSize(received: number, headers: Pick<Headers, "get">): void;
|
|
293
301
|
export interface VideoDeps {
|
|
294
302
|
get: (path: string) => Promise<ApiResponse<unknown>>;
|
|
295
303
|
post: (path: string, body: unknown) => Promise<ApiResponse<unknown>>;
|
|
296
304
|
mkdirp: (dir: string) => void;
|
|
297
305
|
writeFile: (filePath: string, text: string) => void;
|
|
298
306
|
downloadToFile: (url: string, filePath: string) => Promise<void>;
|
|
307
|
+
piecesOnly?: true;
|
|
299
308
|
readFile: (filePath: string) => string;
|
|
300
309
|
readFileBytes: (filePath: string) => Uint8Array;
|
|
301
310
|
statFile: (filePath: string) => {
|
|
@@ -334,6 +343,10 @@ export type RunStop = {
|
|
|
334
343
|
heldScenes?: number[];
|
|
335
344
|
heldTakes?: HeldTake[];
|
|
336
345
|
cutFailure?: string;
|
|
346
|
+
appMakesCut?: true;
|
|
347
|
+
appCutOnRun?: true;
|
|
348
|
+
appOutdatesCut?: true;
|
|
349
|
+
redoingScenes?: number[];
|
|
337
350
|
} | {
|
|
338
351
|
at: "pilot";
|
|
339
352
|
nodeId?: string;
|
|
@@ -388,7 +401,10 @@ export interface HeldTake {
|
|
|
388
401
|
sentence: string;
|
|
389
402
|
}
|
|
390
403
|
export declare function heldTakesOf(scenes: readonly number[] | undefined, items: readonly NodeItem[] | null | undefined): HeldTake[];
|
|
404
|
+
export declare function flaggedHeldTakesOf(items: readonly NodeItem[] | null | undefined): HeldTake[];
|
|
391
405
|
export declare function resolveStop(stop: RunStop, cutAttached: boolean | null, items?: NodeItem[] | null): ResolvedStop;
|
|
406
|
+
export declare function appCutOutdates(run: Pick<VideoRun, "appCut" | "moduleKey">): boolean;
|
|
407
|
+
export declare function appIsCutting(stop: ResolvedStop): boolean;
|
|
392
408
|
export declare function resolveStopAtPark(stop: RunStop, runId: string, deps: Pick<VideoDeps, "get">): Promise<ResolvedStop>;
|
|
393
409
|
export declare function stageWord(stage: string): string;
|
|
394
410
|
export declare function stepName(kind: string | undefined): string;
|
|
@@ -502,6 +518,7 @@ export interface VideoManifest {
|
|
|
502
518
|
file: string | null;
|
|
503
519
|
reason?: string;
|
|
504
520
|
};
|
|
521
|
+
video?: string | null;
|
|
505
522
|
}
|
|
506
523
|
export interface RunShots {
|
|
507
524
|
frame?: string;
|
|
@@ -520,6 +537,7 @@ export declare function scenePrefix(sceneIndex: number): string;
|
|
|
520
537
|
export declare function planPull(run: VideoRun, items: NodeItem[], opts: {
|
|
521
538
|
pulledAt: string;
|
|
522
539
|
dashboardUrl: string;
|
|
540
|
+
piecesOnly?: true;
|
|
523
541
|
}): PullPlan;
|
|
524
542
|
export declare function markPullFailure(manifest: VideoManifest, failure: PullFailure): void;
|
|
525
543
|
export declare function missingSetupLabels(progress: ShowRow["setupProgress"]): string[];
|
package/dist/commands/video.js
CHANGED
|
@@ -703,6 +703,17 @@ export function asVideoRun(data) {
|
|
|
703
703
|
const run = (data ?? {});
|
|
704
704
|
return { ...run, nodes: Array.isArray(run.nodes) ? run.nodes : [] };
|
|
705
705
|
}
|
|
706
|
+
export function checkDownloadSize(received, headers) {
|
|
707
|
+
if (received === 0)
|
|
708
|
+
throw new Error("the download was empty");
|
|
709
|
+
const encoding = headers.get("content-encoding");
|
|
710
|
+
if (encoding && encoding !== "identity")
|
|
711
|
+
return;
|
|
712
|
+
const stated = Number(headers.get("content-length") ?? "");
|
|
713
|
+
if (Number.isFinite(stated) && stated > 0 && stated !== received) {
|
|
714
|
+
throw new Error(`the download came to ${received} bytes, not the ${stated} the server sent`);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
706
717
|
export const defaultDeps = {
|
|
707
718
|
get: (p) => apiGet(p),
|
|
708
719
|
post: (p, body) => apiPost(p, body),
|
|
@@ -714,7 +725,17 @@ export const defaultDeps = {
|
|
|
714
725
|
const res = await fetch(url);
|
|
715
726
|
if (!res.ok)
|
|
716
727
|
throw new Error(`HTTP ${res.status}`);
|
|
717
|
-
|
|
728
|
+
const bytes = Buffer.from(await res.arrayBuffer());
|
|
729
|
+
checkDownloadSize(bytes.length, res.headers);
|
|
730
|
+
const part = `${filePath}.part`;
|
|
731
|
+
try {
|
|
732
|
+
fs.writeFileSync(part, bytes);
|
|
733
|
+
fs.renameSync(part, filePath);
|
|
734
|
+
}
|
|
735
|
+
catch (err) {
|
|
736
|
+
fs.rmSync(part, { force: true });
|
|
737
|
+
throw err;
|
|
738
|
+
}
|
|
718
739
|
},
|
|
719
740
|
readFile: (filePath) => fs.readFileSync(filePath, "utf-8"),
|
|
720
741
|
readFileBytes: (filePath) => fs.readFileSync(filePath),
|
|
@@ -917,6 +938,8 @@ export function classifyRun(run) {
|
|
|
917
938
|
...(missingScenes.length > 0 && framesNodeId ? { framesNodeId } : {}),
|
|
918
939
|
...(run.cutHeldScenes?.length ? { heldScenes: run.cutHeldScenes } : {}),
|
|
919
940
|
...(run.cutFailure?.sentence ? { cutFailure: run.cutFailure.sentence } : {}),
|
|
941
|
+
...(run.appCut === "making" ? { appMakesCut: true } : {}),
|
|
942
|
+
...(appCutOutdates(run) ? { appOutdatesCut: true } : {}),
|
|
920
943
|
};
|
|
921
944
|
}
|
|
922
945
|
return { at: "paused", nodeId: run.pausedNodeId, reason: run.pauseReason };
|
|
@@ -943,13 +966,33 @@ export function heldTakesOf(scenes, items) {
|
|
|
943
966
|
if (!scenes?.length || !items)
|
|
944
967
|
return [];
|
|
945
968
|
return scenes.flatMap((sceneIndex) => {
|
|
946
|
-
const
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
969
|
+
const said = holdSentenceOf(latestClipRow(items, sceneIndex));
|
|
970
|
+
return said !== null ? [{ sceneIndex, sentence: said }] : [];
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
function latestClipRow(items, sceneIndex) {
|
|
974
|
+
return items
|
|
975
|
+
.filter((i) => i.itemKind === "clip" && i.sceneIndex === sceneIndex)
|
|
976
|
+
.reduce((best, i) => (!best || (i.attempt ?? 0) >= (best.attempt ?? 0) ? i : best), undefined);
|
|
977
|
+
}
|
|
978
|
+
function holdSentenceOf(row) {
|
|
979
|
+
const said = (row?.findings ?? [])
|
|
980
|
+
.filter((f) => ONE_TAKE_HOLD_CODES.includes(f.code) && f.detail.trim())
|
|
981
|
+
.map((f) => f.detail.trim());
|
|
982
|
+
return said.length > 0 ? said.join(" ") : null;
|
|
983
|
+
}
|
|
984
|
+
export function flaggedHeldTakesOf(items) {
|
|
985
|
+
if (!items)
|
|
986
|
+
return [];
|
|
987
|
+
const scenes = [...new Set(items.filter((i) => i.itemKind === "clip" && isPullSceneIndex(i.sceneIndex)).map((i) => i.sceneIndex))];
|
|
988
|
+
return scenes
|
|
989
|
+
.sort((a, b) => a - b)
|
|
990
|
+
.flatMap((sceneIndex) => {
|
|
991
|
+
const latest = latestClipRow(items, sceneIndex);
|
|
992
|
+
if (!latest || latest.status !== "done" || latest.flagged !== true || latest.acceptedAsIs)
|
|
993
|
+
return [];
|
|
994
|
+
const said = holdSentenceOf(latest);
|
|
995
|
+
return said !== null ? [{ sceneIndex, sentence: said }] : [];
|
|
953
996
|
});
|
|
954
997
|
}
|
|
955
998
|
export function resolveStop(stop, cutAttached, items) {
|
|
@@ -962,8 +1005,36 @@ export function resolveStop(stop, cutAttached, items) {
|
|
|
962
1005
|
}
|
|
963
1006
|
if (stop.at !== "final-watch")
|
|
964
1007
|
return stop;
|
|
965
|
-
const
|
|
966
|
-
|
|
1008
|
+
const named = heldTakesOf(stop.heldScenes, items);
|
|
1009
|
+
const fromRows = cutAttached === false
|
|
1010
|
+
? flaggedHeldTakesOf(items).filter((t) => !(stop.heldScenes ?? []).includes(t.sceneIndex))
|
|
1011
|
+
: [];
|
|
1012
|
+
const heldTakes = fromRows.length > 0 ? [...named, ...fromRows].sort((a, b) => a.sceneIndex - b.sceneIndex) : named;
|
|
1013
|
+
const heldScenes = fromRows.length > 0
|
|
1014
|
+
? [...(stop.heldScenes ?? []), ...fromRows.map((t) => t.sceneIndex)].sort((a, b) => a - b)
|
|
1015
|
+
: stop.heldScenes;
|
|
1016
|
+
return {
|
|
1017
|
+
...stop,
|
|
1018
|
+
cutAttached,
|
|
1019
|
+
...(heldScenes?.length ? { heldScenes } : {}),
|
|
1020
|
+
...(heldTakes.length > 0 ? { heldTakes } : {}),
|
|
1021
|
+
...(items && hasAppCut(items) ? { appCutOnRun: true } : {}),
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
export function appCutOutdates(run) {
|
|
1025
|
+
return run.appCut === "making" && run.moduleKey === "script-video";
|
|
1026
|
+
}
|
|
1027
|
+
function hasAppCut(items) {
|
|
1028
|
+
return items.some((i) => i.itemKind === "final" && i.status === "done" && i.artifact?.type === "video" && i.artifact.autoCut === true);
|
|
1029
|
+
}
|
|
1030
|
+
export function appIsCutting(stop) {
|
|
1031
|
+
return (stop.at === "final-watch" &&
|
|
1032
|
+
stop.appMakesCut === true &&
|
|
1033
|
+
!stop.missingScenes?.length &&
|
|
1034
|
+
!stop.heldScenes?.length &&
|
|
1035
|
+
!stop.cutFailure &&
|
|
1036
|
+
stop.cutAttached !== null &&
|
|
1037
|
+
(!stop.cutAttached || (stop.appCutOnRun === true && stop.appOutdatesCut === true)));
|
|
967
1038
|
}
|
|
968
1039
|
export async function resolveStopAtPark(stop, runId, deps) {
|
|
969
1040
|
if (stop.at !== "final-watch" && stop.at !== "pilot")
|
|
@@ -1159,6 +1230,21 @@ export function stopLines(stop, runId, runUrl, videoPage) {
|
|
|
1159
1230
|
`Watch it here: ${runUrl}`,
|
|
1160
1231
|
];
|
|
1161
1232
|
}
|
|
1233
|
+
if (appIsCutting(stop)) {
|
|
1234
|
+
if (stop.redoingScenes?.length) {
|
|
1235
|
+
const many = stop.redoingScenes.length > 1;
|
|
1236
|
+
return [
|
|
1237
|
+
`Scene${many ? "s" : ""} ${stop.redoingScenes.join(", ")} ${many ? "are" : "is"} being made again. The app cuts the video again once ${many ? "they are" : "it is"} made; look again in a few minutes: exodus video status ${runId}`,
|
|
1238
|
+
`Watch it here: ${runUrl}`,
|
|
1239
|
+
];
|
|
1240
|
+
}
|
|
1241
|
+
return [
|
|
1242
|
+
stop.cutAttached
|
|
1243
|
+
? `Every piece is made. The app makes the cut again now; look again in a minute: exodus video status ${runId}`
|
|
1244
|
+
: `Every piece is made. The app makes the cut now; look again in a minute: exodus video status ${runId}`,
|
|
1245
|
+
`Watch it here: ${runUrl}`,
|
|
1246
|
+
];
|
|
1247
|
+
}
|
|
1162
1248
|
if (stop.cutAttached) {
|
|
1163
1249
|
return [
|
|
1164
1250
|
"Parked: your cut is uploaded and waiting for your approval.",
|
|
@@ -1732,6 +1818,8 @@ export function planPull(run, items, opts) {
|
|
|
1732
1818
|
};
|
|
1733
1819
|
});
|
|
1734
1820
|
const { cast, downloads: castDownloads } = planCastRefs(run, items, castVoicePins(storyboardArtifact));
|
|
1821
|
+
const finishedUrl = opts.piecesOnly || appCutOutdates(run) ? undefined : finishedVideoUrl(items);
|
|
1822
|
+
const finished = finishedUrl ? { file: `video.${extFor(finishedUrl, "video")}`, url: finishedUrl } : null;
|
|
1735
1823
|
const downloads = [
|
|
1736
1824
|
...(reference ? [reference] : []),
|
|
1737
1825
|
...(productSheet ? [productSheet] : []),
|
|
@@ -1743,6 +1831,7 @@ export function planPull(run, items, opts) {
|
|
|
1743
1831
|
...[...clipByScene.values()].map((c) => c.download),
|
|
1744
1832
|
...(music ? [music] : []),
|
|
1745
1833
|
...castDownloads,
|
|
1834
|
+
...(finished ? [finished] : []),
|
|
1746
1835
|
];
|
|
1747
1836
|
return {
|
|
1748
1837
|
downloads,
|
|
@@ -1788,11 +1877,40 @@ export function planPull(run, items, opts) {
|
|
|
1788
1877
|
...(run.videoChoice?.videoModel === "template-video" && run.heldSong === true
|
|
1789
1878
|
? { wholeVoice: true, templateMotion: { enabled: true } } : {}),
|
|
1790
1879
|
...(run.shots?.frame || run.shots?.pacing ? { shots: run.shots } : {}),
|
|
1880
|
+
...(finished ? { video: finished.file } : {}),
|
|
1791
1881
|
},
|
|
1792
1882
|
};
|
|
1793
1883
|
}
|
|
1884
|
+
function finishedVideoUrl(items) {
|
|
1885
|
+
const finals = items.filter((i) => i.itemKind === "final" && i.status === "done" && i.artifact?.type === "video");
|
|
1886
|
+
return finals.length === 1 && finals[0].artifact?.type === "video" ? finals[0].artifact.videoUrl || undefined : undefined;
|
|
1887
|
+
}
|
|
1888
|
+
function appCutsRun(run, items) {
|
|
1889
|
+
return run.appCut !== undefined || hasAppCut(items);
|
|
1890
|
+
}
|
|
1891
|
+
function fingerprintInFolder(dir, file, deps) {
|
|
1892
|
+
if (!file || deps.statFile(path.join(dir, file)) === null)
|
|
1893
|
+
return null;
|
|
1894
|
+
return createHash("sha256").update(deps.readFileBytes(path.join(dir, file))).digest("hex");
|
|
1895
|
+
}
|
|
1896
|
+
function replacedVideoLines(dir, file, before, deps) {
|
|
1897
|
+
if (!file || before === null)
|
|
1898
|
+
return [];
|
|
1899
|
+
const after = fingerprintInFolder(dir, file, deps);
|
|
1900
|
+
return after !== null && after !== before
|
|
1901
|
+
? [`A different ${file} was already in ${dir}; the pull replaced it with this run's finished video.`]
|
|
1902
|
+
: [];
|
|
1903
|
+
}
|
|
1904
|
+
function runStopped(run) {
|
|
1905
|
+
return run.status === "failed" || run.status === "cancelled" || run.status === "canceled";
|
|
1906
|
+
}
|
|
1907
|
+
function deliveredLine(dir, video) {
|
|
1908
|
+
return video ? `This run is delivered. The finished video is ${path.join(dir, video)}.` : "This run is delivered.";
|
|
1909
|
+
}
|
|
1794
1910
|
export function markPullFailure(manifest, failure) {
|
|
1795
1911
|
manifest.failed.push(failure);
|
|
1912
|
+
if (manifest.video === failure.file)
|
|
1913
|
+
manifest.video = null;
|
|
1796
1914
|
if (manifest.storyboard === failure.file)
|
|
1797
1915
|
manifest.storyboard = null;
|
|
1798
1916
|
if (manifest.reference === failure.file)
|
|
@@ -3802,6 +3920,10 @@ export async function waitFlow(runId, opts, deps) {
|
|
|
3802
3920
|
}
|
|
3803
3921
|
}
|
|
3804
3922
|
const resolved = resolveStop(stop, items ? hasAttachedCut(items) : null, items);
|
|
3923
|
+
if (appIsCutting(resolved)) {
|
|
3924
|
+
progress("Working: the app makes the cut…");
|
|
3925
|
+
continue;
|
|
3926
|
+
}
|
|
3805
3927
|
if (opts.json) {
|
|
3806
3928
|
return {
|
|
3807
3929
|
code: stop.at === "failed" ? 1 : 0,
|
|
@@ -3844,6 +3966,9 @@ function carryingOn(run) {
|
|
|
3844
3966
|
return (run.status === "queued" &&
|
|
3845
3967
|
run.nodes.some((n) => n.status !== "idle" && n.status !== "out-of-scope"));
|
|
3846
3968
|
}
|
|
3969
|
+
function cutDeliversItself(run, stop) {
|
|
3970
|
+
return run.storyboardAutoApprove === true && stop.at === "running";
|
|
3971
|
+
}
|
|
3847
3972
|
export async function statusFlow(runId, json, deps) {
|
|
3848
3973
|
const runRes = await deps.get(`${RUN_PATH}?runId=${encodeURIComponent(runId)}`);
|
|
3849
3974
|
if (!runRes.ok)
|
|
@@ -3861,7 +3986,9 @@ export async function statusFlow(runId, json, deps) {
|
|
|
3861
3986
|
return errorResult(itemsRes, json);
|
|
3862
3987
|
const items = itemsRes.data.items ?? [];
|
|
3863
3988
|
const hasFinal = hasAttachedCut(items);
|
|
3864
|
-
const
|
|
3989
|
+
const resolved = resolveStop(classifyRun(run), hasFinal, items);
|
|
3990
|
+
const redoingScenes = resolved.at === "final-watch" ? scenesBeingRedone(run, items) : [];
|
|
3991
|
+
const stop = resolved.at === "final-watch" && redoingScenes.length > 0 ? { ...resolved, redoingScenes } : resolved;
|
|
3865
3992
|
const failedStoryboard = failedStoryboardNode(run);
|
|
3866
3993
|
const guidance = stopLines(stop.at === "failed" && errorEchoesReasons(stop.error, failedStoryboard?.planFailure)
|
|
3867
3994
|
? { ...stop, error: undefined }
|
|
@@ -4019,11 +4146,17 @@ export async function statusFlow(runId, json, deps) {
|
|
|
4019
4146
|
lines.push(...(await statusVoiceLines(runId, deps)));
|
|
4020
4147
|
}
|
|
4021
4148
|
const cost = runCostLine(run, items);
|
|
4022
|
-
lines.push("", ...(cost ? [cost] : []),
|
|
4023
|
-
? "Final cut:
|
|
4024
|
-
: hasFinal
|
|
4025
|
-
?
|
|
4026
|
-
:
|
|
4149
|
+
lines.push("", ...(cost ? [cost] : []), runStopped(run)
|
|
4150
|
+
? hasFinal ? "Final cut: on the run, which stopped before it was delivered." : "Final cut: none. This run stopped before one was made."
|
|
4151
|
+
: hasFinal && stop.at === "finished"
|
|
4152
|
+
? "Final cut: approved and delivered."
|
|
4153
|
+
: hasFinal && cutDeliversItself(run, stop)
|
|
4154
|
+
? "Final cut: made. This run delivers it by itself; look again in a minute."
|
|
4155
|
+
: hasFinal && appIsCutting(stop)
|
|
4156
|
+
? "Final cut: the app makes it again now; look again in a minute."
|
|
4157
|
+
: hasFinal
|
|
4158
|
+
? `Final cut: uploaded. Approve it with: exodus video approve ${runId}`
|
|
4159
|
+
: "Final cut: not uploaded yet.", ...(run.cutCheck ?? []));
|
|
4027
4160
|
let finalSpeech;
|
|
4028
4161
|
for (const item of items)
|
|
4029
4162
|
if (item.itemKind === "final" && item.status === "done")
|
|
@@ -5511,6 +5644,7 @@ async function customerPullFlow(run, dir, json, deps) {
|
|
|
5511
5644
|
dashboardUrl: deps.dashboardUrl,
|
|
5512
5645
|
});
|
|
5513
5646
|
deps.mkdirp(dir);
|
|
5647
|
+
const videoBefore = fingerprintInFolder(dir, manifest.video, deps);
|
|
5514
5648
|
const failures = (await runPool(downloads.map((download) => () => downloadWithRetry(download, dir, deps)), PULL_CONCURRENCY)).filter((f) => f !== null);
|
|
5515
5649
|
const landed = (file) => file !== null && !failures.some((f) => f.file === file) ? file : null;
|
|
5516
5650
|
for (const scene of manifest.scenes) {
|
|
@@ -5539,6 +5673,7 @@ async function customerPullFlow(run, dir, json, deps) {
|
|
|
5539
5673
|
lines: [
|
|
5540
5674
|
`Pulled ${downloads.length - failures.length + 1} files into ${dir}`,
|
|
5541
5675
|
`Every piece is listed in ${manifestPath}.`,
|
|
5676
|
+
...replacedVideoLines(dir, manifest.video, videoBefore, deps),
|
|
5542
5677
|
...(manifest.video ? [] : ["The finished video isn't ready yet, so only the scene pieces came down."]),
|
|
5543
5678
|
...(failures.length > 0
|
|
5544
5679
|
? [
|
|
@@ -5548,11 +5683,13 @@ async function customerPullFlow(run, dir, json, deps) {
|
|
|
5548
5683
|
"Run the same command again to retry.",
|
|
5549
5684
|
]
|
|
5550
5685
|
: []),
|
|
5551
|
-
"",
|
|
5552
|
-
`When your cut is ready: exodus video upload ${runId} --file cut.mp4`,
|
|
5686
|
+
...(customerDelivered(run) ? ["", deliveredLine(dir, manifest.video)] : []),
|
|
5553
5687
|
],
|
|
5554
5688
|
};
|
|
5555
5689
|
}
|
|
5690
|
+
function customerDelivered(run) {
|
|
5691
|
+
return run.stage === "ready" && run.awaitingSignOff !== true;
|
|
5692
|
+
}
|
|
5556
5693
|
export async function pullFlow(runId, dir, json, deps) {
|
|
5557
5694
|
const runRes = await deps.get(`${RUN_PATH}?runId=${encodeURIComponent(runId)}`);
|
|
5558
5695
|
if (!runRes.ok)
|
|
@@ -5568,6 +5705,7 @@ export async function pullFlow(runId, dir, json, deps) {
|
|
|
5568
5705
|
const plan = planPull(run, items, {
|
|
5569
5706
|
pulledAt: new Date(deps.now()).toISOString(),
|
|
5570
5707
|
dashboardUrl: deps.dashboardUrl,
|
|
5708
|
+
...(deps.piecesOnly ? { piecesOnly: true } : {}),
|
|
5571
5709
|
});
|
|
5572
5710
|
deps.mkdirp(dir);
|
|
5573
5711
|
if (plan.downloads.length === 0 && plan.texts.length === 0) {
|
|
@@ -5582,6 +5720,7 @@ export async function pullFlow(runId, dir, json, deps) {
|
|
|
5582
5720
|
for (const text of plan.texts) {
|
|
5583
5721
|
deps.writeFile(path.join(dir, text.file), text.body);
|
|
5584
5722
|
}
|
|
5723
|
+
const videoBefore = fingerprintInFolder(dir, plan.manifest.video, deps);
|
|
5585
5724
|
const failures = await runPool(plan.downloads.map((download) => () => downloadWithRetry(download, dir, deps)), PULL_CONCURRENCY);
|
|
5586
5725
|
for (const failure of failures) {
|
|
5587
5726
|
if (failure)
|
|
@@ -5601,6 +5740,7 @@ export async function pullFlow(runId, dir, json, deps) {
|
|
|
5601
5740
|
const lines = [
|
|
5602
5741
|
`Pulled ${wrote} files into ${dir}`,
|
|
5603
5742
|
`Every piece is indexed in ${path.join(dir, "manifest.json")} — scene numbers there are the run's own.`,
|
|
5743
|
+
...replacedVideoLines(dir, plan.manifest.video, videoBefore, deps),
|
|
5604
5744
|
...musicLines(plan.manifest),
|
|
5605
5745
|
];
|
|
5606
5746
|
if (plan.manifest.dropped.length > 0) {
|
|
@@ -5634,7 +5774,15 @@ export async function pullFlow(runId, dir, json, deps) {
|
|
|
5634
5774
|
lines.push(` ${failure.file}: ${failure.error}`);
|
|
5635
5775
|
lines.push("Run the same command again to retry just those.");
|
|
5636
5776
|
}
|
|
5637
|
-
|
|
5777
|
+
if (runStopped(run)) {
|
|
5778
|
+
lines.push("", "This run stopped before it was delivered, so no cut can be uploaded to it now.");
|
|
5779
|
+
}
|
|
5780
|
+
else if (hasAttachedCut(items) && classifyRun(run).at === "finished") {
|
|
5781
|
+
lines.push("", deliveredLine(dir, plan.manifest.video));
|
|
5782
|
+
}
|
|
5783
|
+
else if (!appCutsRun(run, items)) {
|
|
5784
|
+
lines.push("", `When your cut is ready: exodus video upload ${runId} --file cut.mp4`);
|
|
5785
|
+
}
|
|
5638
5786
|
return { code: failed.length > 0 ? 1 : 0, lines };
|
|
5639
5787
|
}
|
|
5640
5788
|
const BOX_HEADER = 8;
|