@skyphusion-labs/vivijure-core 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +87 -0
- package/dist/audio-routing.d.ts +2 -0
- package/dist/audio-routing.d.ts.map +1 -0
- package/dist/audio-routing.js +4 -0
- package/dist/audio-routing.js.map +1 -0
- package/dist/audio-stage.d.ts +4 -0
- package/dist/audio-stage.d.ts.map +1 -0
- package/dist/audio-stage.js +25 -0
- package/dist/audio-stage.js.map +1 -0
- package/dist/beat-analyze.d.ts +22 -0
- package/dist/beat-analyze.d.ts.map +1 -0
- package/dist/beat-analyze.js +111 -0
- package/dist/beat-analyze.js.map +1 -0
- package/dist/beat-sync-types.d.ts +33 -0
- package/dist/beat-sync-types.d.ts.map +1 -0
- package/dist/beat-sync-types.js +4 -0
- package/dist/beat-sync-types.js.map +1 -0
- package/dist/bundle-assembler.d.ts +54 -0
- package/dist/bundle-assembler.d.ts.map +1 -0
- package/dist/bundle-assembler.js +376 -0
- package/dist/bundle-assembler.js.map +1 -0
- package/dist/bundle-durations.d.ts +5 -0
- package/dist/bundle-durations.d.ts.map +1 -0
- package/dist/bundle-durations.js +68 -0
- package/dist/bundle-durations.js.map +1 -0
- package/dist/bundle-storyboard.d.ts +11 -0
- package/dist/bundle-storyboard.d.ts.map +1 -0
- package/dist/bundle-storyboard.js +82 -0
- package/dist/bundle-storyboard.js.map +1 -0
- package/dist/captions.d.ts +25 -0
- package/dist/captions.d.ts.map +1 -0
- package/dist/captions.js +56 -0
- package/dist/captions.js.map +1 -0
- package/dist/cast-db.d.ts +61 -0
- package/dist/cast-db.d.ts.map +1 -0
- package/dist/cast-db.js +324 -0
- package/dist/cast-db.js.map +1 -0
- package/dist/cast-lora-train.d.ts +18 -0
- package/dist/cast-lora-train.d.ts.map +1 -0
- package/dist/cast-lora-train.js +215 -0
- package/dist/cast-lora-train.js.map +1 -0
- package/dist/cast-loras.d.ts +21 -0
- package/dist/cast-loras.d.ts.map +1 -0
- package/dist/cast-loras.js +69 -0
- package/dist/cast-loras.js.map +1 -0
- package/dist/clip-content-validate.d.ts +43 -0
- package/dist/clip-content-validate.d.ts.map +1 -0
- package/dist/clip-content-validate.js +115 -0
- package/dist/clip-content-validate.js.map +1 -0
- package/dist/clip-job-model.d.ts +42 -0
- package/dist/clip-job-model.d.ts.map +1 -0
- package/dist/clip-job-model.js +8 -0
- package/dist/clip-job-model.js.map +1 -0
- package/dist/clip-validate.d.ts +33 -0
- package/dist/clip-validate.d.ts.map +1 -0
- package/dist/clip-validate.js +247 -0
- package/dist/clip-validate.js.map +1 -0
- package/dist/d1-retry.d.ts +20 -0
- package/dist/d1-retry.d.ts.map +1 -0
- package/dist/d1-retry.js +67 -0
- package/dist/d1-retry.js.map +1 -0
- package/dist/db-env.d.ts +6 -0
- package/dist/db-env.d.ts.map +1 -0
- package/dist/db-env.js +2 -0
- package/dist/db-env.js.map +1 -0
- package/dist/dialogue-lines.d.ts +23 -0
- package/dist/dialogue-lines.d.ts.map +1 -0
- package/dist/dialogue-lines.js +84 -0
- package/dist/dialogue-lines.js.map +1 -0
- package/dist/film-advance-lease.d.ts +9 -0
- package/dist/film-advance-lease.d.ts.map +1 -0
- package/dist/film-advance-lease.js +19 -0
- package/dist/film-advance-lease.js.map +1 -0
- package/dist/film-model.d.ts +415 -0
- package/dist/film-model.d.ts.map +1 -0
- package/dist/film-model.js +541 -0
- package/dist/film-model.js.map +1 -0
- package/dist/film-orchestrator.d.ts +216 -0
- package/dist/film-orchestrator.d.ts.map +1 -0
- package/dist/film-orchestrator.js +2204 -0
- package/dist/film-orchestrator.js.map +1 -0
- package/dist/film-render-bridge.d.ts +26 -0
- package/dist/film-render-bridge.d.ts.map +1 -0
- package/dist/film-render-bridge.js +176 -0
- package/dist/film-render-bridge.js.map +1 -0
- package/dist/finish-hash.d.ts +10 -0
- package/dist/finish-hash.d.ts.map +1 -0
- package/dist/finish-hash.js +60 -0
- package/dist/finish-hash.js.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/key-safety.d.ts +5 -0
- package/dist/key-safety.d.ts.map +1 -0
- package/dist/key-safety.js +23 -0
- package/dist/key-safety.js.map +1 -0
- package/dist/lora-bundle.d.ts +19 -0
- package/dist/lora-bundle.d.ts.map +1 -0
- package/dist/lora-bundle.js +75 -0
- package/dist/lora-bundle.js.map +1 -0
- package/dist/lora-keys.d.ts +2 -0
- package/dist/lora-keys.d.ts.map +1 -0
- package/dist/lora-keys.js +4 -0
- package/dist/lora-keys.js.map +1 -0
- package/dist/modules/conformance.d.ts +58 -0
- package/dist/modules/conformance.d.ts.map +1 -0
- package/dist/modules/conformance.js +369 -0
- package/dist/modules/conformance.js.map +1 -0
- package/dist/modules/manifest-validate.d.ts +5 -0
- package/dist/modules/manifest-validate.d.ts.map +1 -0
- package/dist/modules/manifest-validate.js +60 -0
- package/dist/modules/manifest-validate.js.map +1 -0
- package/dist/modules/registry.d.ts +184 -0
- package/dist/modules/registry.d.ts.map +1 -0
- package/dist/modules/registry.js +653 -0
- package/dist/modules/registry.js.map +1 -0
- package/dist/modules/render-pipeline.d.ts +38 -0
- package/dist/modules/render-pipeline.d.ts.map +1 -0
- package/dist/modules/render-pipeline.js +40 -0
- package/dist/modules/render-pipeline.js.map +1 -0
- package/dist/modules/types.d.ts +544 -0
- package/dist/modules/types.d.ts.map +1 -0
- package/dist/modules/types.js +57 -0
- package/dist/modules/types.js.map +1 -0
- package/dist/operator-config.d.ts +20 -0
- package/dist/operator-config.d.ts.map +1 -0
- package/dist/operator-config.js +85 -0
- package/dist/operator-config.js.map +1 -0
- package/dist/output-extract.d.ts +8 -0
- package/dist/output-extract.d.ts.map +1 -0
- package/dist/output-extract.js +129 -0
- package/dist/output-extract.js.map +1 -0
- package/dist/planner-prompt.d.ts +12 -0
- package/dist/planner-prompt.d.ts.map +1 -0
- package/dist/planner-prompt.js +337 -0
- package/dist/planner-prompt.js.map +1 -0
- package/dist/planner-yaml.d.ts +15 -0
- package/dist/planner-yaml.d.ts.map +1 -0
- package/dist/planner-yaml.js +157 -0
- package/dist/planner-yaml.js.map +1 -0
- package/dist/platform/fetcher.d.ts +3 -0
- package/dist/platform/fetcher.d.ts.map +1 -0
- package/dist/platform/fetcher.js +7 -0
- package/dist/platform/fetcher.js.map +1 -0
- package/dist/platform/index.d.ts +6 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +5 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/object-store-r2.d.ts +26 -0
- package/dist/platform/object-store-r2.d.ts.map +1 -0
- package/dist/platform/object-store-r2.js +74 -0
- package/dist/platform/object-store-r2.js.map +1 -0
- package/dist/platform/orchestrator-context.d.ts +20 -0
- package/dist/platform/orchestrator-context.d.ts.map +1 -0
- package/dist/platform/orchestrator-context.js +28 -0
- package/dist/platform/orchestrator-context.js.map +1 -0
- package/dist/platform/r2-types.d.ts +41 -0
- package/dist/platform/r2-types.d.ts.map +1 -0
- package/dist/platform/r2-types.js +3 -0
- package/dist/platform/r2-types.js.map +1 -0
- package/dist/platform/types.d.ts +90 -0
- package/dist/platform/types.d.ts.map +1 -0
- package/dist/platform/types.js +23 -0
- package/dist/platform/types.js.map +1 -0
- package/dist/preflight.d.ts +57 -0
- package/dist/preflight.d.ts.map +1 -0
- package/dist/preflight.js +243 -0
- package/dist/preflight.js.map +1 -0
- package/dist/presign.d.ts +5 -0
- package/dist/presign.d.ts.map +1 -0
- package/dist/presign.js +24 -0
- package/dist/presign.js.map +1 -0
- package/dist/public-id.d.ts +8 -0
- package/dist/public-id.d.ts.map +1 -0
- package/dist/public-id.js +25 -0
- package/dist/public-id.js.map +1 -0
- package/dist/render-adopt.d.ts +3 -0
- package/dist/render-adopt.d.ts.map +1 -0
- package/dist/render-adopt.js +92 -0
- package/dist/render-adopt.js.map +1 -0
- package/dist/render-log.d.ts +25 -0
- package/dist/render-log.d.ts.map +1 -0
- package/dist/render-log.js +139 -0
- package/dist/render-log.js.map +1 -0
- package/dist/render-module-config.d.ts +28 -0
- package/dist/render-module-config.d.ts.map +1 -0
- package/dist/render-module-config.js +124 -0
- package/dist/render-module-config.js.map +1 -0
- package/dist/render-mux.d.ts +18 -0
- package/dist/render-mux.d.ts.map +1 -0
- package/dist/render-mux.js +69 -0
- package/dist/render-mux.js.map +1 -0
- package/dist/render-orchestrator.d.ts +71 -0
- package/dist/render-orchestrator.d.ts.map +1 -0
- package/dist/render-orchestrator.js +376 -0
- package/dist/render-orchestrator.js.map +1 -0
- package/dist/render-sweep.d.ts +5 -0
- package/dist/render-sweep.d.ts.map +1 -0
- package/dist/render-sweep.js +62 -0
- package/dist/render-sweep.js.map +1 -0
- package/dist/renders-db.d.ts +129 -0
- package/dist/renders-db.d.ts.map +1 -0
- package/dist/renders-db.js +752 -0
- package/dist/renders-db.js.map +1 -0
- package/dist/runpod-submit.d.ts +151 -0
- package/dist/runpod-submit.d.ts.map +1 -0
- package/dist/runpod-submit.js +469 -0
- package/dist/runpod-submit.js.map +1 -0
- package/dist/runpod-types.d.ts +2 -0
- package/dist/runpod-types.d.ts.map +1 -0
- package/dist/runpod-types.js +4 -0
- package/dist/runpod-types.js.map +1 -0
- package/dist/scatter-notify.d.ts +4 -0
- package/dist/scatter-notify.d.ts.map +1 -0
- package/dist/scatter-notify.js +43 -0
- package/dist/scatter-notify.js.map +1 -0
- package/dist/scatter-orchestrator-types.d.ts +56 -0
- package/dist/scatter-orchestrator-types.d.ts.map +1 -0
- package/dist/scatter-orchestrator-types.js +3 -0
- package/dist/scatter-orchestrator-types.js.map +1 -0
- package/dist/scatter-orchestrator.d.ts +70 -0
- package/dist/scatter-orchestrator.d.ts.map +1 -0
- package/dist/scatter-orchestrator.js +614 -0
- package/dist/scatter-orchestrator.js.map +1 -0
- package/dist/scatter.d.ts +35 -0
- package/dist/scatter.d.ts.map +1 -0
- package/dist/scatter.js +171 -0
- package/dist/scatter.js.map +1 -0
- package/dist/secret-store.d.ts +5 -0
- package/dist/secret-store.d.ts.map +1 -0
- package/dist/secret-store.js +19 -0
- package/dist/secret-store.js.map +1 -0
- package/dist/shot-durations-parse.d.ts +3 -0
- package/dist/shot-durations-parse.d.ts.map +1 -0
- package/dist/shot-durations-parse.js +43 -0
- package/dist/shot-durations-parse.js.map +1 -0
- package/dist/srt.d.ts +11 -0
- package/dist/srt.d.ts.map +1 -0
- package/dist/srt.js +54 -0
- package/dist/srt.js.map +1 -0
- package/dist/storyboard-ids.d.ts +2 -0
- package/dist/storyboard-ids.d.ts.map +1 -0
- package/dist/storyboard-ids.js +12 -0
- package/dist/storyboard-ids.js.map +1 -0
- package/dist/storyboard-projects-db.d.ts +31 -0
- package/dist/storyboard-projects-db.d.ts.map +1 -0
- package/dist/storyboard-projects-db.js +153 -0
- package/dist/storyboard-projects-db.js.map +1 -0
- package/dist/storyboard-validate.d.ts +72 -0
- package/dist/storyboard-validate.d.ts.map +1 -0
- package/dist/storyboard-validate.js +595 -0
- package/dist/storyboard-validate.js.map +1 -0
- package/dist/structured-events.d.ts +6 -0
- package/dist/structured-events.d.ts.map +1 -0
- package/dist/structured-events.js +15 -0
- package/dist/structured-events.js.map +1 -0
- package/dist/tar.d.ts +9 -0
- package/dist/tar.d.ts.map +1 -0
- package/dist/tar.js +151 -0
- package/dist/tar.js.map +1 -0
- package/dist/voices.d.ts +12 -0
- package/dist/voices.d.ts.map +1 -0
- package/dist/voices.js +37 -0
- package/dist/voices.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import type { Env } from "./platform/orchestrator-context.js";
|
|
2
|
+
import { type FilmScene, type FilmKeyframeRef, type FilmJob } from "./film-model.js";
|
|
3
|
+
import type { RegisteredModule, DialogueLine } from "./modules/types.js";
|
|
4
|
+
import { clipFileMatchesShot, type ClipJob } from "./render-orchestrator.js";
|
|
5
|
+
export * from "./film-model.js";
|
|
6
|
+
/** Collect finished clip keys from a terminal clips_only (or full) film job doc. */
|
|
7
|
+
export declare function clipKeysFromFilmJob(env: Env, job: FilmJob): Promise<Map<string, string>>;
|
|
8
|
+
/** #584 dialogue-aware finish order. A finish module that CONSUMES the shot dialogue audio
|
|
9
|
+
* (`finish_consumes_audio`, i.e. lip-sync) is calibrated to the SOURCE frame rate, so it must run on
|
|
10
|
+
* the native-fps clip BEFORE any finish step that resamples time (interpolation); otherwise its
|
|
11
|
+
* audio->mouth mapping smears across the interpolated frames (the breathy look). For a shot that HAS a
|
|
12
|
+
* dialogue line, stable-partition `serving` so audio-consuming modules run first, preserving ui.order
|
|
13
|
+
* within each group (`serving` is already ui.order-sorted and Array.filter keeps order): rife 10 ->
|
|
14
|
+
* lipsync 15 -> upscale 20 becomes lipsync -> rife -> upscale. A shot with NO line keeps the plain
|
|
15
|
+
* ui.order unchanged, where such a module no-ops (no audio_key). The reorder changes each step INPUT
|
|
16
|
+
* clip, so the #583 finishStepInputHash differs on its own -- no special-case. */
|
|
17
|
+
export declare function finishChainForShot(serving: RegisteredModule[], isDialogueShot: boolean): RegisteredModule[];
|
|
18
|
+
/** Call the video-finish container's POST /finish, retrying on a transient gateway status -- 503 (a
|
|
19
|
+
* cold container can 503 while its port is still binding -- same shape as callImagePrep in
|
|
20
|
+
* bundle-assembler) or 504 (a cold-boot + ffmpeg concat that exceeds the request window; issue #82).
|
|
21
|
+
* backoffMs is injectable so tests do not actually wait. Returns the Response or null on a network
|
|
22
|
+
* error. The orchestrator (enterAssemblePhase) adds an outer, across-polls auto-recover on top of
|
|
23
|
+
* this in-request retry, since a single request window may not outlast a fully-cold container. */
|
|
24
|
+
export declare function callVideoFinish(env: Env, payload: {
|
|
25
|
+
clips: {
|
|
26
|
+
url: string;
|
|
27
|
+
}[];
|
|
28
|
+
outputUrl: string;
|
|
29
|
+
outputKey: string;
|
|
30
|
+
width?: number;
|
|
31
|
+
height?: number;
|
|
32
|
+
fps?: number;
|
|
33
|
+
audioUrl?: string;
|
|
34
|
+
remuxAudioOnly?: boolean;
|
|
35
|
+
keepClipAudio?: boolean;
|
|
36
|
+
}, opts?: {
|
|
37
|
+
retries?: number;
|
|
38
|
+
backoffMs?: number;
|
|
39
|
+
}): Promise<Response | null>;
|
|
40
|
+
/** POST to the always-on fleet audio-mix container (/mix), mirroring callVideoFinish: a private
|
|
41
|
+
* Workers VPC binding, retry the transient gateway statuses. Returns null when the binding is not
|
|
42
|
+
* provisioned (#231 is additive -- the caller then degrades to the single-track remux). */
|
|
43
|
+
export declare function callAudioMix(env: Env, payload: {
|
|
44
|
+
tracks: {
|
|
45
|
+
url: string;
|
|
46
|
+
role: "dialogue" | "music" | "sfx";
|
|
47
|
+
gainDb?: number;
|
|
48
|
+
}[];
|
|
49
|
+
outputUrl: string;
|
|
50
|
+
outputKey: string;
|
|
51
|
+
format?: string;
|
|
52
|
+
loudnessTargetLufs?: number;
|
|
53
|
+
}, opts?: {
|
|
54
|
+
retries?: number;
|
|
55
|
+
backoffMs?: number;
|
|
56
|
+
}): Promise<Response | null>;
|
|
57
|
+
/** Pure: should the mux phase run the multi-track mix (#231)? Only when the film has BOTH dialogue
|
|
58
|
+
* (baked into the assembled video by lip-sync) AND a music bed, and the audio-mix VPC is bound.
|
|
59
|
+
* Otherwise the single-track remux is correct (and unchanged). */
|
|
60
|
+
export declare function shouldMultiTrackMix(job: FilmJob, env: Env): boolean;
|
|
61
|
+
export declare const FILM_FINISH_INFLIGHT_WINDOW_SECONDS = 1200;
|
|
62
|
+
/** Inputs for runFilmFinish -- job-shape-agnostic so BOTH the single-film path (advanceFilmJob) and the
|
|
63
|
+
* scatter gather can run the film.finish chain on an assembled+muxed film (#284/#285). */
|
|
64
|
+
export interface RunFilmFinishInput {
|
|
65
|
+
film_key: string;
|
|
66
|
+
scenes: FilmScene[];
|
|
67
|
+
dialogue_lines?: DialogueLine[];
|
|
68
|
+
film_titles?: {
|
|
69
|
+
title?: {
|
|
70
|
+
text: string;
|
|
71
|
+
subtitle?: string;
|
|
72
|
+
};
|
|
73
|
+
credits?: {
|
|
74
|
+
lines: string[];
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
film_finish_config?: Record<string, Record<string, unknown>>;
|
|
78
|
+
bundle_key: string;
|
|
79
|
+
project: string;
|
|
80
|
+
job_id: string;
|
|
81
|
+
actual_durations?: Record<string, number>;
|
|
82
|
+
}
|
|
83
|
+
export interface RunFilmFinishResult {
|
|
84
|
+
ran: boolean;
|
|
85
|
+
film_key: string;
|
|
86
|
+
applied: string[];
|
|
87
|
+
adopted: string[];
|
|
88
|
+
errors: string[];
|
|
89
|
+
steps?: string[];
|
|
90
|
+
degraded?: string;
|
|
91
|
+
complete: boolean;
|
|
92
|
+
sidecar_key?: string;
|
|
93
|
+
}
|
|
94
|
+
export declare const FILM_FINISH_STEP_MAX_ATTEMPTS = 3;
|
|
95
|
+
export declare const FILM_FINISH_ASYNC_PRESIGN_TTL_SECONDS = 7200;
|
|
96
|
+
/** Run the film.finish chain (subtitle / title / credit cards) on an assembled+muxed film. Reused by the
|
|
97
|
+
* single-film path AND the scatter gather. Captions are FILM-LEVEL (buildCaptionCues computes each line
|
|
98
|
+
* start from the cumulative duration of preceding shots), so the caller passes the FULL scenes +
|
|
99
|
+
* dialogue_lines in assembled (shot) order.
|
|
100
|
+
*
|
|
101
|
+
* #600 SURVIVABLE: each step writes a DETERMINISTIC per-step key (<film>-ff<n>.mp4), so before running a
|
|
102
|
+
* step the chain HEADs that key -- PRESENT means ADOPT the prior attempt output (no re-encode), ABSENT
|
|
103
|
+
* means dispatch. A big film whose whole chain exceeds one request budget therefore makes progress
|
|
104
|
+
* across the existing per-tick assemble re-entry: each tick adopts every completed step and re-runs only
|
|
105
|
+
* the incomplete one, instead of re-burning the whole chain under a fresh random key (the film-374268a2
|
|
106
|
+
* loop). R2 presence IS the persisted progress (#122 / #141). FAIL-SAFE: a step soft-degrade / failure
|
|
107
|
+
* passes the film through (recorded in degraded), never drops it (#190). */
|
|
108
|
+
export declare function runFilmFinish(env: Env, input: RunFilmFinishInput, preModules?: RegisteredModule[], opts?: {
|
|
109
|
+
dispatched?: Record<string, number>;
|
|
110
|
+
persistDispatch?: (key: string, ts: number) => Promise<void>;
|
|
111
|
+
polls?: Record<string, string>;
|
|
112
|
+
attempts?: Record<string, number>;
|
|
113
|
+
persistPoll?: (key: string, token: string | null) => Promise<void>;
|
|
114
|
+
prepends?: Record<string, number>;
|
|
115
|
+
persistPrepend?: (key: string, seconds: number) => Promise<void>;
|
|
116
|
+
now?: number;
|
|
117
|
+
}): Promise<RunFilmFinishResult>;
|
|
118
|
+
/** Start a film at the clips phase using existing keyframe keys (finalize / cloud / hybrid). */
|
|
119
|
+
export declare function startFilmFromKeyframes(env: Env, args: {
|
|
120
|
+
project: string;
|
|
121
|
+
bundle_key: string;
|
|
122
|
+
scenes: FilmScene[];
|
|
123
|
+
keyframes: FilmKeyframeRef[];
|
|
124
|
+
motion_backend?: string;
|
|
125
|
+
per_shot_motion?: Record<string, string>;
|
|
126
|
+
motion_config?: Record<string, unknown>;
|
|
127
|
+
motion_configs?: Record<string, Record<string, unknown>>;
|
|
128
|
+
finish_config?: Record<string, Record<string, unknown>>;
|
|
129
|
+
speech_config?: Record<string, Record<string, unknown>>;
|
|
130
|
+
film_finish_config?: Record<string, Record<string, unknown>>;
|
|
131
|
+
master_config?: Record<string, Record<string, unknown>>;
|
|
132
|
+
derive_mode: "finalized" | "cloud-finalized";
|
|
133
|
+
parent_render_id?: number;
|
|
134
|
+
audio_key?: string;
|
|
135
|
+
}, preModules?: RegisteredModule[]): Promise<FilmJob>;
|
|
136
|
+
/** Start a film job: resolve the keyframe module, submit the project preview, persist the poll token. */
|
|
137
|
+
export declare function startFilmJob(env: Env, args: {
|
|
138
|
+
project: string;
|
|
139
|
+
bundle_key: string;
|
|
140
|
+
scenes: FilmScene[];
|
|
141
|
+
motion_backend?: string;
|
|
142
|
+
keyframe_backend?: string;
|
|
143
|
+
keyframe_config?: Record<string, unknown>;
|
|
144
|
+
motion_config?: Record<string, unknown>;
|
|
145
|
+
finish_config?: Record<string, Record<string, unknown>>;
|
|
146
|
+
speech_config?: Record<string, Record<string, unknown>>;
|
|
147
|
+
film_finish_config?: Record<string, Record<string, unknown>>;
|
|
148
|
+
master_config?: Record<string, Record<string, unknown>>;
|
|
149
|
+
keyframes_only?: boolean;
|
|
150
|
+
clips_only?: boolean;
|
|
151
|
+
pretrained_loras?: Record<string, string>;
|
|
152
|
+
quality_tier?: "draft" | "standard" | "final";
|
|
153
|
+
audio_key?: string;
|
|
154
|
+
dialogue_lines?: DialogueLine[];
|
|
155
|
+
cast_loras?: Record<string, number>;
|
|
156
|
+
film_titles?: {
|
|
157
|
+
title?: {
|
|
158
|
+
text: string;
|
|
159
|
+
subtitle?: string;
|
|
160
|
+
};
|
|
161
|
+
credits?: {
|
|
162
|
+
lines: string[];
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
}, preModules?: RegisteredModule[]): Promise<FilmJob>;
|
|
166
|
+
/** Mark an in-flight film job cancelled. Terminal jobs are returned unchanged. */
|
|
167
|
+
export declare function cancelFilmJob(env: Env, filmId: string): Promise<FilmJob | null>;
|
|
168
|
+
/** List the keyframe PNGs the GPU wrote for a project and join them to the job's scenes. The keyframe
|
|
169
|
+
* stage writes `renders/<project>/keyframes/<shot_id>.png` itself (its own R2 creds; see the keyframe
|
|
170
|
+
* module), so the core can recover an orphaned keyframe phase straight from R2 presence -- no GPU re-
|
|
171
|
+
* run. Returns only keyframes whose shot_id is in the storyboard, so a stale PNG from an older render
|
|
172
|
+
* of the same project can never inject a shot the film did not ask for. Also drops any keyframe written BEFORE
|
|
173
|
+
* this run started (`createdAtMs`, the film job created_at): a prior render of the same project name leaves a
|
|
174
|
+
* FULL stale set at the identical shot_id paths, which the pending-poll fast path would otherwise adopt on
|
|
175
|
+
* tick one -- cancelling the live producer and shipping wrong content silently (#661, the #245/#249 class).
|
|
176
|
+
* This run own orphans (the #129/#619/#143 recovery) always upload AFTER created_at, so legit recovery
|
|
177
|
+
* survives; a leftover from an older render becomes invisible. */
|
|
178
|
+
export declare function listProjectKeyframes(env: Env, project: string, scenes: FilmScene[], createdAtMs: number): Promise<FilmKeyframeRef[]>;
|
|
179
|
+
/** True iff EVERY scene's keyframe is already in R2 (the full set, one per shot). Gate for adopting on a
|
|
180
|
+
* pending poll (#129 envelope-freeze): a partial set means generation is still in flight, so we must NOT
|
|
181
|
+
* advance early -- only adopt once the set is complete. (The 20min stall backstop is intentionally
|
|
182
|
+
* lenient on partials, treating absent shots as genuine non-renders at the ceiling.) */
|
|
183
|
+
export declare function keyframeSetCompleteInR2(env: Env, job: FilmJob): Promise<boolean>;
|
|
184
|
+
/** Cancel the film's in-flight keyframe RunPod job THROUGH its module, honestly. No-op when no keyframe
|
|
185
|
+
* job is in flight (wrong phase, no poll token, or no bound backend). When the bound module is missing
|
|
186
|
+
* or not `cancelable`, or the cancel call fails, we LOG the orphan rather than swallow it: an orphaned
|
|
187
|
+
* GPU job is a money leak that betrays scale-to-zero (#327 / #328), so it stays visible even when we
|
|
188
|
+
* cannot stop it. Read keyframe_poll BEFORE the caller clears it. Exported for the orchestrator
|
|
189
|
+
* unit test (it asserts the adopt + DELETE-cancel paths actually issue a cancel). */
|
|
190
|
+
export declare function cancelInFlightKeyframe(env: Env, job: FilmJob): Promise<void>;
|
|
191
|
+
export { clipFileMatchesShot };
|
|
192
|
+
/** List the motion clips the GPU wrote for a project, joined to the job's scenes by shot id (scene-shaped
|
|
193
|
+
* wrapper over render-orchestrator's listClipsByShotId). When a motion.backend poll never resolves (GC'd
|
|
194
|
+
* RunPod job), the clip is still in R2; matching by shot-id boundary recovers a stalled clips phase from
|
|
195
|
+
* R2 presence, no GPU re-run. Only shots in the storyboard are returned. */
|
|
196
|
+
export declare function listProjectClips(env: Env, project: string, scenes: FilmScene[], createdAtMs: number): Promise<{
|
|
197
|
+
shot_id: string;
|
|
198
|
+
clip_key: string;
|
|
199
|
+
}[]>;
|
|
200
|
+
/** Advance a film job across its two phases. Returns the job + the underlying clip job (for the
|
|
201
|
+
* summary), or null if no such film job exists.
|
|
202
|
+
*
|
|
203
|
+
* ONE DRIVER PER TICK (S4): this function is driven concurrently by the 1-minute cron sweep AND
|
|
204
|
+
* every client status poll, and its body is an unlocked read-modify-write on the R2 job doc with
|
|
205
|
+
* submit-bearing legs (clip start, dialogue batch, per-shot finish/speech/master steps, mux,
|
|
206
|
+
* notify). Two concurrent drivers could each observe phase N incomplete and BOTH submit phase
|
|
207
|
+
* N+1's external work -- duplicated GPU spend -- and clobber each other's doc writes (a lost
|
|
208
|
+
* poll token orphans a RunPod job). So the whole tick runs under a D1 lease (claimFilmAdvance,
|
|
209
|
+
* the claimFinish conditional-UPDATE pattern): the loser skips quietly and reports the doc
|
|
210
|
+
* read-only; the lease is released after the tick and expires on its own if the winner crashed,
|
|
211
|
+
* so a genuine retry is never deadlocked. */
|
|
212
|
+
export declare function advanceFilmJob(env: Env, filmId: string): Promise<{
|
|
213
|
+
job: FilmJob;
|
|
214
|
+
clipJob: ClipJob | null;
|
|
215
|
+
} | null>;
|
|
216
|
+
//# sourceMappingURL=film-orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"film-orchestrator.d.ts","sourceRoot":"","sources":["../src/film-orchestrator.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AAc9D,OAAO,EAGL,KAAK,SAAS,EAGd,KAAK,eAAe,EACpB,KAAK,OAAO,EAwCb,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAEV,gBAAgB,EAQhB,YAAY,EAUb,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAML,mBAAmB,EAMnB,KAAK,OAAO,EAEb,MAAM,0BAA0B,CAAC;AAalC,cAAc,iBAAiB,CAAC;AAYhC,oFAAoF;AACpF,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,GAAG,EACR,GAAG,EAA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