@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.
Files changed (267) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +87 -0
  3. package/dist/audio-routing.d.ts +2 -0
  4. package/dist/audio-routing.d.ts.map +1 -0
  5. package/dist/audio-routing.js +4 -0
  6. package/dist/audio-routing.js.map +1 -0
  7. package/dist/audio-stage.d.ts +4 -0
  8. package/dist/audio-stage.d.ts.map +1 -0
  9. package/dist/audio-stage.js +25 -0
  10. package/dist/audio-stage.js.map +1 -0
  11. package/dist/beat-analyze.d.ts +22 -0
  12. package/dist/beat-analyze.d.ts.map +1 -0
  13. package/dist/beat-analyze.js +111 -0
  14. package/dist/beat-analyze.js.map +1 -0
  15. package/dist/beat-sync-types.d.ts +33 -0
  16. package/dist/beat-sync-types.d.ts.map +1 -0
  17. package/dist/beat-sync-types.js +4 -0
  18. package/dist/beat-sync-types.js.map +1 -0
  19. package/dist/bundle-assembler.d.ts +54 -0
  20. package/dist/bundle-assembler.d.ts.map +1 -0
  21. package/dist/bundle-assembler.js +376 -0
  22. package/dist/bundle-assembler.js.map +1 -0
  23. package/dist/bundle-durations.d.ts +5 -0
  24. package/dist/bundle-durations.d.ts.map +1 -0
  25. package/dist/bundle-durations.js +68 -0
  26. package/dist/bundle-durations.js.map +1 -0
  27. package/dist/bundle-storyboard.d.ts +11 -0
  28. package/dist/bundle-storyboard.d.ts.map +1 -0
  29. package/dist/bundle-storyboard.js +82 -0
  30. package/dist/bundle-storyboard.js.map +1 -0
  31. package/dist/captions.d.ts +25 -0
  32. package/dist/captions.d.ts.map +1 -0
  33. package/dist/captions.js +56 -0
  34. package/dist/captions.js.map +1 -0
  35. package/dist/cast-db.d.ts +61 -0
  36. package/dist/cast-db.d.ts.map +1 -0
  37. package/dist/cast-db.js +324 -0
  38. package/dist/cast-db.js.map +1 -0
  39. package/dist/cast-lora-train.d.ts +18 -0
  40. package/dist/cast-lora-train.d.ts.map +1 -0
  41. package/dist/cast-lora-train.js +215 -0
  42. package/dist/cast-lora-train.js.map +1 -0
  43. package/dist/cast-loras.d.ts +21 -0
  44. package/dist/cast-loras.d.ts.map +1 -0
  45. package/dist/cast-loras.js +69 -0
  46. package/dist/cast-loras.js.map +1 -0
  47. package/dist/clip-content-validate.d.ts +43 -0
  48. package/dist/clip-content-validate.d.ts.map +1 -0
  49. package/dist/clip-content-validate.js +115 -0
  50. package/dist/clip-content-validate.js.map +1 -0
  51. package/dist/clip-job-model.d.ts +42 -0
  52. package/dist/clip-job-model.d.ts.map +1 -0
  53. package/dist/clip-job-model.js +8 -0
  54. package/dist/clip-job-model.js.map +1 -0
  55. package/dist/clip-validate.d.ts +33 -0
  56. package/dist/clip-validate.d.ts.map +1 -0
  57. package/dist/clip-validate.js +247 -0
  58. package/dist/clip-validate.js.map +1 -0
  59. package/dist/d1-retry.d.ts +20 -0
  60. package/dist/d1-retry.d.ts.map +1 -0
  61. package/dist/d1-retry.js +67 -0
  62. package/dist/d1-retry.js.map +1 -0
  63. package/dist/db-env.d.ts +6 -0
  64. package/dist/db-env.d.ts.map +1 -0
  65. package/dist/db-env.js +2 -0
  66. package/dist/db-env.js.map +1 -0
  67. package/dist/dialogue-lines.d.ts +23 -0
  68. package/dist/dialogue-lines.d.ts.map +1 -0
  69. package/dist/dialogue-lines.js +84 -0
  70. package/dist/dialogue-lines.js.map +1 -0
  71. package/dist/film-advance-lease.d.ts +9 -0
  72. package/dist/film-advance-lease.d.ts.map +1 -0
  73. package/dist/film-advance-lease.js +19 -0
  74. package/dist/film-advance-lease.js.map +1 -0
  75. package/dist/film-model.d.ts +415 -0
  76. package/dist/film-model.d.ts.map +1 -0
  77. package/dist/film-model.js +541 -0
  78. package/dist/film-model.js.map +1 -0
  79. package/dist/film-orchestrator.d.ts +216 -0
  80. package/dist/film-orchestrator.d.ts.map +1 -0
  81. package/dist/film-orchestrator.js +2204 -0
  82. package/dist/film-orchestrator.js.map +1 -0
  83. package/dist/film-render-bridge.d.ts +26 -0
  84. package/dist/film-render-bridge.d.ts.map +1 -0
  85. package/dist/film-render-bridge.js +176 -0
  86. package/dist/film-render-bridge.js.map +1 -0
  87. package/dist/finish-hash.d.ts +10 -0
  88. package/dist/finish-hash.d.ts.map +1 -0
  89. package/dist/finish-hash.js +60 -0
  90. package/dist/finish-hash.js.map +1 -0
  91. package/dist/index.d.ts +48 -0
  92. package/dist/index.d.ts.map +1 -0
  93. package/dist/index.js +45 -0
  94. package/dist/index.js.map +1 -0
  95. package/dist/key-safety.d.ts +5 -0
  96. package/dist/key-safety.d.ts.map +1 -0
  97. package/dist/key-safety.js +23 -0
  98. package/dist/key-safety.js.map +1 -0
  99. package/dist/lora-bundle.d.ts +19 -0
  100. package/dist/lora-bundle.d.ts.map +1 -0
  101. package/dist/lora-bundle.js +75 -0
  102. package/dist/lora-bundle.js.map +1 -0
  103. package/dist/lora-keys.d.ts +2 -0
  104. package/dist/lora-keys.d.ts.map +1 -0
  105. package/dist/lora-keys.js +4 -0
  106. package/dist/lora-keys.js.map +1 -0
  107. package/dist/modules/conformance.d.ts +58 -0
  108. package/dist/modules/conformance.d.ts.map +1 -0
  109. package/dist/modules/conformance.js +369 -0
  110. package/dist/modules/conformance.js.map +1 -0
  111. package/dist/modules/manifest-validate.d.ts +5 -0
  112. package/dist/modules/manifest-validate.d.ts.map +1 -0
  113. package/dist/modules/manifest-validate.js +60 -0
  114. package/dist/modules/manifest-validate.js.map +1 -0
  115. package/dist/modules/registry.d.ts +184 -0
  116. package/dist/modules/registry.d.ts.map +1 -0
  117. package/dist/modules/registry.js +653 -0
  118. package/dist/modules/registry.js.map +1 -0
  119. package/dist/modules/render-pipeline.d.ts +38 -0
  120. package/dist/modules/render-pipeline.d.ts.map +1 -0
  121. package/dist/modules/render-pipeline.js +40 -0
  122. package/dist/modules/render-pipeline.js.map +1 -0
  123. package/dist/modules/types.d.ts +544 -0
  124. package/dist/modules/types.d.ts.map +1 -0
  125. package/dist/modules/types.js +57 -0
  126. package/dist/modules/types.js.map +1 -0
  127. package/dist/operator-config.d.ts +20 -0
  128. package/dist/operator-config.d.ts.map +1 -0
  129. package/dist/operator-config.js +85 -0
  130. package/dist/operator-config.js.map +1 -0
  131. package/dist/output-extract.d.ts +8 -0
  132. package/dist/output-extract.d.ts.map +1 -0
  133. package/dist/output-extract.js +129 -0
  134. package/dist/output-extract.js.map +1 -0
  135. package/dist/planner-prompt.d.ts +12 -0
  136. package/dist/planner-prompt.d.ts.map +1 -0
  137. package/dist/planner-prompt.js +337 -0
  138. package/dist/planner-prompt.js.map +1 -0
  139. package/dist/planner-yaml.d.ts +15 -0
  140. package/dist/planner-yaml.d.ts.map +1 -0
  141. package/dist/planner-yaml.js +157 -0
  142. package/dist/planner-yaml.js.map +1 -0
  143. package/dist/platform/fetcher.d.ts +3 -0
  144. package/dist/platform/fetcher.d.ts.map +1 -0
  145. package/dist/platform/fetcher.js +7 -0
  146. package/dist/platform/fetcher.js.map +1 -0
  147. package/dist/platform/index.d.ts +6 -0
  148. package/dist/platform/index.d.ts.map +1 -0
  149. package/dist/platform/index.js +5 -0
  150. package/dist/platform/index.js.map +1 -0
  151. package/dist/platform/object-store-r2.d.ts +26 -0
  152. package/dist/platform/object-store-r2.d.ts.map +1 -0
  153. package/dist/platform/object-store-r2.js +74 -0
  154. package/dist/platform/object-store-r2.js.map +1 -0
  155. package/dist/platform/orchestrator-context.d.ts +20 -0
  156. package/dist/platform/orchestrator-context.d.ts.map +1 -0
  157. package/dist/platform/orchestrator-context.js +28 -0
  158. package/dist/platform/orchestrator-context.js.map +1 -0
  159. package/dist/platform/r2-types.d.ts +41 -0
  160. package/dist/platform/r2-types.d.ts.map +1 -0
  161. package/dist/platform/r2-types.js +3 -0
  162. package/dist/platform/r2-types.js.map +1 -0
  163. package/dist/platform/types.d.ts +90 -0
  164. package/dist/platform/types.d.ts.map +1 -0
  165. package/dist/platform/types.js +23 -0
  166. package/dist/platform/types.js.map +1 -0
  167. package/dist/preflight.d.ts +57 -0
  168. package/dist/preflight.d.ts.map +1 -0
  169. package/dist/preflight.js +243 -0
  170. package/dist/preflight.js.map +1 -0
  171. package/dist/presign.d.ts +5 -0
  172. package/dist/presign.d.ts.map +1 -0
  173. package/dist/presign.js +24 -0
  174. package/dist/presign.js.map +1 -0
  175. package/dist/public-id.d.ts +8 -0
  176. package/dist/public-id.d.ts.map +1 -0
  177. package/dist/public-id.js +25 -0
  178. package/dist/public-id.js.map +1 -0
  179. package/dist/render-adopt.d.ts +3 -0
  180. package/dist/render-adopt.d.ts.map +1 -0
  181. package/dist/render-adopt.js +92 -0
  182. package/dist/render-adopt.js.map +1 -0
  183. package/dist/render-log.d.ts +25 -0
  184. package/dist/render-log.d.ts.map +1 -0
  185. package/dist/render-log.js +139 -0
  186. package/dist/render-log.js.map +1 -0
  187. package/dist/render-module-config.d.ts +28 -0
  188. package/dist/render-module-config.d.ts.map +1 -0
  189. package/dist/render-module-config.js +124 -0
  190. package/dist/render-module-config.js.map +1 -0
  191. package/dist/render-mux.d.ts +18 -0
  192. package/dist/render-mux.d.ts.map +1 -0
  193. package/dist/render-mux.js +69 -0
  194. package/dist/render-mux.js.map +1 -0
  195. package/dist/render-orchestrator.d.ts +71 -0
  196. package/dist/render-orchestrator.d.ts.map +1 -0
  197. package/dist/render-orchestrator.js +376 -0
  198. package/dist/render-orchestrator.js.map +1 -0
  199. package/dist/render-sweep.d.ts +5 -0
  200. package/dist/render-sweep.d.ts.map +1 -0
  201. package/dist/render-sweep.js +62 -0
  202. package/dist/render-sweep.js.map +1 -0
  203. package/dist/renders-db.d.ts +129 -0
  204. package/dist/renders-db.d.ts.map +1 -0
  205. package/dist/renders-db.js +752 -0
  206. package/dist/renders-db.js.map +1 -0
  207. package/dist/runpod-submit.d.ts +151 -0
  208. package/dist/runpod-submit.d.ts.map +1 -0
  209. package/dist/runpod-submit.js +469 -0
  210. package/dist/runpod-submit.js.map +1 -0
  211. package/dist/runpod-types.d.ts +2 -0
  212. package/dist/runpod-types.d.ts.map +1 -0
  213. package/dist/runpod-types.js +4 -0
  214. package/dist/runpod-types.js.map +1 -0
  215. package/dist/scatter-notify.d.ts +4 -0
  216. package/dist/scatter-notify.d.ts.map +1 -0
  217. package/dist/scatter-notify.js +43 -0
  218. package/dist/scatter-notify.js.map +1 -0
  219. package/dist/scatter-orchestrator-types.d.ts +56 -0
  220. package/dist/scatter-orchestrator-types.d.ts.map +1 -0
  221. package/dist/scatter-orchestrator-types.js +3 -0
  222. package/dist/scatter-orchestrator-types.js.map +1 -0
  223. package/dist/scatter-orchestrator.d.ts +70 -0
  224. package/dist/scatter-orchestrator.d.ts.map +1 -0
  225. package/dist/scatter-orchestrator.js +614 -0
  226. package/dist/scatter-orchestrator.js.map +1 -0
  227. package/dist/scatter.d.ts +35 -0
  228. package/dist/scatter.d.ts.map +1 -0
  229. package/dist/scatter.js +171 -0
  230. package/dist/scatter.js.map +1 -0
  231. package/dist/secret-store.d.ts +5 -0
  232. package/dist/secret-store.d.ts.map +1 -0
  233. package/dist/secret-store.js +19 -0
  234. package/dist/secret-store.js.map +1 -0
  235. package/dist/shot-durations-parse.d.ts +3 -0
  236. package/dist/shot-durations-parse.d.ts.map +1 -0
  237. package/dist/shot-durations-parse.js +43 -0
  238. package/dist/shot-durations-parse.js.map +1 -0
  239. package/dist/srt.d.ts +11 -0
  240. package/dist/srt.d.ts.map +1 -0
  241. package/dist/srt.js +54 -0
  242. package/dist/srt.js.map +1 -0
  243. package/dist/storyboard-ids.d.ts +2 -0
  244. package/dist/storyboard-ids.d.ts.map +1 -0
  245. package/dist/storyboard-ids.js +12 -0
  246. package/dist/storyboard-ids.js.map +1 -0
  247. package/dist/storyboard-projects-db.d.ts +31 -0
  248. package/dist/storyboard-projects-db.d.ts.map +1 -0
  249. package/dist/storyboard-projects-db.js +153 -0
  250. package/dist/storyboard-projects-db.js.map +1 -0
  251. package/dist/storyboard-validate.d.ts +72 -0
  252. package/dist/storyboard-validate.d.ts.map +1 -0
  253. package/dist/storyboard-validate.js +595 -0
  254. package/dist/storyboard-validate.js.map +1 -0
  255. package/dist/structured-events.d.ts +6 -0
  256. package/dist/structured-events.d.ts.map +1 -0
  257. package/dist/structured-events.js +15 -0
  258. package/dist/structured-events.js.map +1 -0
  259. package/dist/tar.d.ts +9 -0
  260. package/dist/tar.d.ts.map +1 -0
  261. package/dist/tar.js +151 -0
  262. package/dist/tar.js.map +1 -0
  263. package/dist/voices.d.ts +12 -0
  264. package/dist/voices.d.ts.map +1 -0
  265. package/dist/voices.js +37 -0
  266. package/dist/voices.js.map +1 -0
  267. package/package.json +71 -0
@@ -0,0 +1,415 @@
1
+ import type { ConfigSchema, DialogueLine, FinishOutput, MasterOutput, RegisteredModule, SpeechOutput } from "./modules/types.js";
2
+ import { type ClipJob, type JobSummary } from "./clip-job-model.js";
3
+ export interface FilmScene {
4
+ shot_id: string;
5
+ prompt: string;
6
+ seconds: number;
7
+ }
8
+ /** One clip moving through the `finish` chain (post-clips). `chain` is the finish module bindings in
9
+ * ui.order; `idx` walks through them, each consuming the previous module's output clip. `configs` is
10
+ * the validated config for each chain step (parallel to `chain`), so each module gets its
11
+ * config_schema defaults -- without it a module receives `{}` and no-ops (see issue #75). */
12
+ /** #662: one finish CHAIN STEP's honest outcome, recorded as the step resolves. `binding` is the chain
13
+ * ref (chain[idx]); `tags` is what the step contributed to the output clip (the module's applied markers
14
+ * on a run, the reconstructed marker on a reuse); `reused` is true when the step was adopted from an R2
15
+ * artifact (#583) rather than run this pass. The ordered list of these reconciles 1:1 to the shot chain. */
16
+ export interface FinishStepRecord {
17
+ binding: string;
18
+ tags: string[];
19
+ reused: boolean;
20
+ }
21
+ export interface FinishShot {
22
+ shot_id: string;
23
+ clip_key: string;
24
+ chain: string[];
25
+ configs?: Record<string, unknown>[];
26
+ idx: number;
27
+ status: "pending" | "done" | "failed";
28
+ poll?: string;
29
+ applied: string[];
30
+ adopted?: string[];
31
+ ledger?: FinishStepRecord[];
32
+ error?: string;
33
+ attempts?: number;
34
+ }
35
+ /** One shot's dialogue audio moving through the `speech` chain (post-dialogue, pre-finish). `chain` is
36
+ * the speech module bindings in ui.order; `idx` walks them, each consuming the previous module's
37
+ * enhanced audio. `configs` is the validated config per step (parallel to `chain`). Mirrors FinishShot,
38
+ * but threads AUDIO (audio_key) instead of the video clip. A speech step is a POLISH step: a hard
39
+ * failure DEGRADES the shot (keeps its current audio) rather than failing the render. */
40
+ export interface SpeechShot {
41
+ shot_id: string;
42
+ audio_key: string;
43
+ chain: string[];
44
+ configs?: Record<string, unknown>[];
45
+ idx: number;
46
+ status: "pending" | "done" | "failed";
47
+ poll?: string;
48
+ applied: string[];
49
+ degraded?: string;
50
+ error?: string;
51
+ attempts?: number;
52
+ }
53
+ export interface FilmKeyframeRef {
54
+ shot_id: string;
55
+ keyframe_key: string;
56
+ }
57
+ export interface FilmJob {
58
+ film_id: string;
59
+ project: string;
60
+ bundle_key: string;
61
+ scenes: FilmScene[];
62
+ motion_backend: string | null;
63
+ motion_config: Record<string, unknown>;
64
+ finish_config: Record<string, Record<string, unknown>>;
65
+ speech_config?: Record<string, Record<string, unknown>>;
66
+ film_finish_config?: Record<string, Record<string, unknown>>;
67
+ master_config?: Record<string, Record<string, unknown>>;
68
+ keyframe_binding: string | null;
69
+ phase: "keyframe" | "clips" | "dialogue" | "speech" | "finish" | "assemble" | "master" | "mux" | "done" | "failed";
70
+ keyframe_poll?: string;
71
+ keyframe_job_id?: string;
72
+ clip_job_id?: string;
73
+ finish_shots?: FinishShot[];
74
+ speech_shots?: SpeechShot[];
75
+ dialogue_lines?: DialogueLine[];
76
+ dialogue_poll?: string;
77
+ dialogue_audio?: Record<string, string>;
78
+ cast_loras?: Record<string, number>;
79
+ quality_tier?: "draft" | "standard" | "final";
80
+ film_key?: string;
81
+ silent_film_key?: string;
82
+ actual_clip_durations?: Record<string, number>;
83
+ audio_key?: string;
84
+ master?: {
85
+ chain: string[];
86
+ idx: number;
87
+ poll?: string;
88
+ attempts?: number;
89
+ applied: string[];
90
+ degraded: string[];
91
+ configs?: Record<string, unknown>[];
92
+ };
93
+ film_titles?: {
94
+ title?: {
95
+ text: string;
96
+ subtitle?: string;
97
+ };
98
+ credits?: {
99
+ lines: string[];
100
+ };
101
+ };
102
+ film_finish?: {
103
+ applied: string[];
104
+ errors: string[];
105
+ steps?: string[];
106
+ degraded?: string;
107
+ adopted?: string[];
108
+ sidecar_key?: string;
109
+ };
110
+ film_finish_dispatched?: Record<string, number>;
111
+ film_finish_polls?: Record<string, string>;
112
+ film_finish_attempts?: Record<string, number>;
113
+ film_finish_prepend?: Record<string, number>;
114
+ finish_unavailable?: {
115
+ at: "assemble" | "mux";
116
+ reason: string;
117
+ delivered: "clips" | "silent_film";
118
+ clips?: {
119
+ shot_id: string;
120
+ clip_key: string;
121
+ }[];
122
+ };
123
+ keyframes_incomplete?: {
124
+ adopted: number;
125
+ expected: number;
126
+ dropped: string[];
127
+ };
128
+ mux_output_key?: string;
129
+ mix_audio_key?: string;
130
+ mux_attempts?: number;
131
+ keyframes_only?: boolean;
132
+ /** Scatter shard: stop after finish (per-shot clips in R2), skip assemble. */
133
+ clips_only?: boolean;
134
+ keyframes?: FilmKeyframeRef[];
135
+ cancelled?: boolean;
136
+ /** Child animation from a keyframes-only preview (finalize / cloud / hybrid). */
137
+ derive_mode?: "finalized" | "cloud-finalized";
138
+ parent_render_id?: number;
139
+ assemble_attempts?: number;
140
+ phase_started_at?: number;
141
+ keyframe_recovered?: boolean;
142
+ clips_recovered?: boolean;
143
+ last_progress_at?: number;
144
+ progress_marker?: string;
145
+ error?: string;
146
+ created_at: number;
147
+ }
148
+ declare const filmKey: (id: string) => string;
149
+ declare const clipDocKey: (clipJobId: string) => string;
150
+ export { filmKey as filmJobDocKey, clipDocKey as clipJobDocKey };
151
+ /** Map a film job phase to a shard status string for scatter gather decisions. */
152
+ export declare function filmPhaseToShardStatus(job: FilmJob): string;
153
+ /** Pure: join keyframe outputs to scenes by shot_id. A scene with no matching keyframe is dropped
154
+ * and reported in `missing` (so the caller knows which shots the keyframe stage did not produce). */
155
+ export declare function joinKeyframesToScenes(scenes: FilmScene[], keyframes: {
156
+ shot_id: string;
157
+ keyframe_key: string;
158
+ }[]): {
159
+ matched: {
160
+ shot_id: string;
161
+ keyframe_key: string;
162
+ prompt: string;
163
+ seconds: number;
164
+ }[];
165
+ missing: string[];
166
+ };
167
+ export interface FinishSummary {
168
+ total: number;
169
+ done: number;
170
+ failed: number;
171
+ pending: number;
172
+ adopted: number;
173
+ }
174
+ /** #707: per-shot delivered-vs-planned duration, surfaced on the film summary. A fixed-grid motion
175
+ * backend (e.g. CogVideoX: 8fps pinned, per-tier frame caps) honestly clamps a shot's requested
176
+ * duration; the clamp was always visible in the module output but silent to the API/UI. One entry per
177
+ * done shot whose backend reported usable fps+frames; a backend that reports nothing contributes no
178
+ * entry (absence over fabrication). */
179
+ export interface ClipDelivery {
180
+ shot_id: string;
181
+ planned_seconds: number;
182
+ delivered_seconds: number;
183
+ fps: number;
184
+ frames: number;
185
+ distilled?: boolean;
186
+ }
187
+ export declare function clipDeliveries(clipJob: ClipJob | null): ClipDelivery[] | undefined;
188
+ export interface FilmSummary {
189
+ film_id: string;
190
+ phase: FilmJob["phase"];
191
+ error?: string;
192
+ clips?: JobSummary;
193
+ clip_deliveries?: ClipDelivery[];
194
+ finish?: FinishSummary;
195
+ film_key?: string;
196
+ film_finish?: FilmJob["film_finish"];
197
+ finish_unavailable?: FilmJob["finish_unavailable"];
198
+ keyframes_incomplete?: FilmJob["keyframes_incomplete"];
199
+ }
200
+ export declare function summarizeFinish(shots: FinishShot[]): FinishSummary;
201
+ export declare function summarizeFilm(job: FilmJob, clipJob: ClipJob | null): FilmSummary;
202
+ /** Pure: order a set of finished clips by the storyboard's scene order, keeping only shots that
203
+ * produced a clip. The film must play in scene order regardless of which order the clip/finish
204
+ * stages happened to complete in. A shot with no clip is dropped (it never rendered). */
205
+ export declare function orderFinalClips(scenes: FilmScene[], shots: {
206
+ shot_id: string;
207
+ clip_key: string;
208
+ }[]): {
209
+ shot_id: string;
210
+ clip_key: string;
211
+ }[];
212
+ /** Pure: fold one finish module's output into the shot -- chain its output clip into the next module,
213
+ * record what it applied, advance the chain index; status -> done when the chain is exhausted. */
214
+ export declare function applyFinishOutput(fs: FinishShot, out: FinishOutput): void;
215
+ /** Pure: fold an ADOPTED (reused-from-R2, NOT run this pass) finish-step artifact into the shot. Same
216
+ * chain advance as applyFinishOutput, but the step marker lands in `adopted` (the honest reuse channel)
217
+ * and is NEVER pushed into `applied` -- the record must not claim a run that did not happen (#583).
218
+ * `clip_key` is the adopted artifact key; `tag` is the reconstructed step marker (finishStepAppliedTag). */
219
+ export declare function adoptFinishStepOutput(fs: FinishShot, clip_key: string, tag: string): void;
220
+ /** Pure: fold one speech module's output into the shot. On a REAL enhancement (no `degraded`), thread the
221
+ * new audio_key forward so the next step (and finish) sees the cleaned audio; on an honest soft-degrade,
222
+ * LEAVE audio_key UNCHANGED (the original audio survives) and record the reason -- no fake applied tag,
223
+ * the chain never fails on a polish miss. Advance idx; done when the chain is exhausted. */
224
+ export declare function applySpeechOutput(ss: SpeechShot, out: SpeechOutput): void;
225
+ export declare const FINISH_STEP_MAX_ATTEMPTS = 3;
226
+ /** Classify an invokeModule / pollModule failure string. Transport shapes are transient:
227
+ * "module /invoke -> 503", "module /poll -> 504", "module unreachable: <timeout/network>". A module-
228
+ * logic ok:false (input reject, "job failed", "no clip_key") or a 4xx is deterministic -> fail. */
229
+ export declare function classifyFinishFailure(error: string | undefined): "transient" | "deterministic";
230
+ /** Decide whether to re-dispatch a failed finish step or fail it. Pure so the retry contract is
231
+ * unit-testable without a module fetcher. */
232
+ export declare function classifyFinishRetry(error: string | undefined, priorAttempts: number, maxAttempts?: number): {
233
+ action: "retry";
234
+ attempts: number;
235
+ } | {
236
+ action: "fail";
237
+ };
238
+ /** Pure: resolve the validated config for each finish module, in chain order. Each module gets its
239
+ * config_schema defaults (the contract promises config is "already validated against the module's
240
+ * config_schema"); user overrides are keyed by module NAME (what /api/modules exposes), one hop,
241
+ * same words down. Without this a module receives `{}` and falls back to its do-nothing path, so
242
+ * finish-rife no-op'd in the first e2e (issue #75). */
243
+ export declare function resolveFinishConfigs(serving: {
244
+ name: string;
245
+ config_schema?: ConfigSchema;
246
+ }[], finishConfig: Record<string, Record<string, unknown>> | undefined): Record<string, unknown>[];
247
+ /** Pure: is this finish shot eligible to be adopted from its R2 artifact? R2 PRESENCE IS AUTHORITATIVE
248
+ * -- if <shot>_finished.mp4 is in R2 the work is done regardless of what the RunPod job envelope says.
249
+ * Two cases are adoptable:
250
+ * - `failed`: a module fast-failed a shot whose finished clip is actually in R2 (the GC'd-job path, #141).
251
+ * - `pending` on its LAST chain module with a submitted poll token: a finish job whose RunPod envelope
252
+ * froze at IN_PROGRESS (worker recycled, /status never flips to COMPLETED) so the poll reports
253
+ * pending forever -- but the finish output already landed in R2. Without this the shot pends to the
254
+ * 90min hard-deadline and FALSE-FAILS a complete render (surfaced by RUN #29; sibling of #141/#142).
255
+ * A `pending` shot mid-chain (idx < last) is NOT adopted: its R2 key would be an intermediate module's
256
+ * output, not the chain's final artifact, so the remaining modules must still run. */
257
+ export declare function finishShotAdoptableFromR2(fs: FinishShot): boolean;
258
+ /** Pure: adopt every adoptable finish shot whose finished clip is present in R2 (the artifact overrides
259
+ * the module's verdict / a stuck envelope). Mutates `finishShots`, returns the number adopted. Mirrors
260
+ * reclaimClipsFromR2 on the clips leg so the two phases recover symmetrically. */
261
+ export declare function reclaimFinishShotsFromR2(finishShots: FinishShot[], present: Map<string, string>, modules?: RegisteredModule[]): number;
262
+ /** #662 honesty invariant: does this finish shot's per-step ledger reconcile 1:1 to its chain? True unless
263
+ * a DONE shot has a ledger that fails to cover every chain step in order. Absent ledger (a pre-#662 job
264
+ * doc) or a non-done shot (still advancing, or failed mid-chain with a partial ledger) is NOT asserted.
265
+ * The invariant a DONE shot must hold: every chain step is accounted for exactly once (run or reused), so
266
+ * an adopted shot's ledger never looks like it dropped a step (the #245/#249 honesty-ledger discipline). */
267
+ export declare function finishShotLedgerReconciles(fs: FinishShot): boolean;
268
+ /** Pure: the R2 key the CURRENT finish step (fs.chain[fs.idx]) is expected to write, given its input
269
+ * clip (fs.clip_key). Mirrors each finish module's OWN output-key convention so the orchestrator can
270
+ * check R2 PRESENCE for a step whose RunPod job was GC'd / froze MID-chain (the #141/#166 R2-authoritative
271
+ * pattern, extended from the final step to any step). The modules: finish-rife writes
272
+ * `<project>/clips/<shot>_finished.mp4` (named off the shot id by its container); the append-convention
273
+ * modules derive `<input-base>_<suffix>.<ext>` from the input clip key (musetalk lip-sync -> `_ls`,
274
+ * upscale -> `_up`; see vivijure-musetalk / vivijure-upscale handler.py). Returns null for a module whose
275
+ * convention we do not model (e.g. text-overlay), so an unmodeled step gets NO R2 shortcut and can never
276
+ * be advanced off a sibling step's artifact -- the mid-chain phantom-adopt the silent-render bug warned of. */
277
+ export declare function finishStepOutputKey(project: string, fs: FinishShot, modules?: RegisteredModule[]): string | null;
278
+ /** Pure: the `applied` tag the CURRENT finish step would report, reconstructed from its validated config
279
+ * so an R2-adopted step (whose job is gone, so its real response is lost) still carries the marker the
280
+ * verifier and UI read (e.g. `lipsync:v15`, `upscale:2x`, `interpolate:2x`). Mirrors each module's own
281
+ * `applied` string. Unmodeled modules get a `<binding>:r2-adopted` marker so the adoption is never silent. */
282
+ export declare function finishStepAppliedTag(fs: FinishShot, modules?: RegisteredModule[]): string;
283
+ /** Pure: classify a video-finish assemble attempt and advance the bounded retry counter (issue #82).
284
+ * `status` is the HTTP status, or null when the container was unreachable (network error). The counter
285
+ * tracks CONSECUTIVE transient failures, so the returned `attempts` is always the value to store:
286
+ * - transient gateway outcome (unreachable, or 502/503/504 from a cold or slow ffmpeg concat
287
+ * exceeding the request window) -> prior + 1; the film stays in "assemble" and the next poll
288
+ * re-attempts (re-PUTting the same film key is idempotent), bounded by maxAttempts.
289
+ * - any definitive answer from the container ("ok": a real success, OR the container's own terminal
290
+ * error like a 500 ffmpeg body) -> 0, because the transient streak is broken. Resetting here is
291
+ * what keeps a slow-but-successful finish from carrying stale attempts toward the cap, and gives a
292
+ * later manual phase-reset a full retry budget. The caller then distinguishes success from the
293
+ * container's terminal error (which must NOT loop).
294
+ * A fully-rendered film therefore self-heals from a cold-container 504 instead of failing on the last
295
+ * CPU-only step and needing a human phase-reset. */
296
+ export type AssembleTransport = {
297
+ state: "ok";
298
+ attempts: number;
299
+ } | {
300
+ state: "retry";
301
+ attempts: number;
302
+ error: string;
303
+ } | {
304
+ state: "exhausted";
305
+ attempts: number;
306
+ error: string;
307
+ };
308
+ export declare function classifyAssembleTransport(status: number | null, priorAttempts: number, maxAttempts: number): AssembleTransport;
309
+ /** The film-level `master` chain state carried on a FilmJob (the master module bindings in ui.order, the
310
+ * step cursor, the in-flight poll token, and the accumulated applied / degraded record). */
311
+ export type MasterState = NonNullable<FilmJob["master"]>;
312
+ export declare const MASTER_STEP_MAX_ATTEMPTS = 3;
313
+ export declare const MASTER_STALL_SECONDS: number;
314
+ /** Pure: total film length (seconds) from the scenes -- the optional `seconds` hint a master module gets
315
+ * (it probes the bed if absent). Returns undefined for a job with no scene durations. */
316
+ export declare function filmSeconds(job: Pick<FilmJob, "scenes">): number | undefined;
317
+ /** Pure: the mastered bed's R2 key -- beside the source with a `_mastered` suffix, so the original
318
+ * survives and each chain step writes a fresh, deterministic key (`renders/p/audio/bed.wav` ->
319
+ * `renders/p/audio/bed_mastered.wav`). The core presigns a PUT for this key and passes it to the master
320
+ * module; the extension is `.wav`, the master config default (the master phase does not thread per-user
321
+ * the planner's master config (so a user-selected mp3 lands on a `.mp3` key the container PUT matches).
322
+ * A deterministic key makes a transient-retry re-PUT idempotent (it overwrites, never orphans). */
323
+ export declare function masteredBedKey(audioKey: string, format?: "wav" | "mp3"): string;
324
+ /** Pure: fold one master step's SUCCESS output into the chain state, returning the bed key to carry to
325
+ * the next step (and the mux). Advances idx, resets the step's poll + attempts. `applied` tags
326
+ * accumulate; a module soft-degrade (ok:true + output.degraded -- it passed the bed through because it
327
+ * could not do the work) is recorded against the step binding, so a passthrough is never silent (#77).
328
+ * Returns the input bed unchanged when the module returned no usable audio_key. */
329
+ export declare function applyMasterOutput(m: MasterState, prevKey: string, out: MasterOutput): string;
330
+ /** Pure: record a step that could NOT run at all (unbound module, a terminal failure, or a stall) as a
331
+ * soft-degrade and advance the cursor. The bed carries through unchanged -- the render never fails on a
332
+ * master miss (#249 / #77). */
333
+ export declare function degradeMasterStep(m: MasterState, reason: string): void;
334
+ /** Pure: true once every master step has run (or degraded). */
335
+ export declare function masterChainDone(m: MasterState): boolean;
336
+ /** Pure: normalize caller scene ids to the canonical `shot_NN` the bundle uses. /api/storyboard/bundle
337
+ * runs validateStoryboard, which coerces every scene id to `shot_<index+1>` in declaration order --
338
+ * so a caller that supplies its own ids (e.g. the Slate bot's `s1`/`s2`) gets a bundle storyboard
339
+ * whose ids do NOT match the film's shot_ids, and the keyframe stage rejects them
340
+ * (`process_shot_ids not in storyboard`). Coerce here with the SAME function so they line up by
341
+ * position (a valid `shot_NN` survives; anything else is renumbered). */
342
+ export declare function coerceSceneIds(scenes: FilmScene[]): FilmScene[];
343
+ /** Pure: remap dialogue-line shot ids through the SAME positional coercion coerceSceneIds applies to
344
+ * the scenes, keyed off the ORIGINAL (pre-coercion) scene ids. Without this a caller that supplies
345
+ * its own scene ids (`s1`/`s2`) plus dialogue_lines gets a film whose dialogue map is keyed `s1`
346
+ * while every consumer joins on the coerced `shot_01`: the lip-sync finish step reads no audio_key
347
+ * (noop:no-dialogue), buildCaptionCues yields zero cues, and the film ships silent + uncaptioned
348
+ * even though the TTS ran. A line whose id matches no scene is passed through unchanged (same
349
+ * fail-soft posture as the dialogue stage). Canonical `shot_NN` ids survive coerceShotId, so this
350
+ * is a no-op for the planner UI / scatter paths. */
351
+ export declare function coerceDialogueLineIds(originalScenes: FilmScene[], lines: DialogueLine[] | undefined): DialogueLine[] | undefined;
352
+ export declare const KEYFRAME_STALL_SECONDS: number;
353
+ export declare const PHASE_HARD_DEADLINE_SECONDS: number;
354
+ export declare const POLLABLE_PHASES: ReadonlySet<FilmJob["phase"]>;
355
+ /** Seconds the job has sat in its current phase. Falls back to created_at on pre-#129 jobs (no
356
+ * phase_started_at stamp); `now` is injectable so tests do not depend on the wall clock. */
357
+ export declare function phaseAgeSeconds(job: FilmJob, now?: number): number;
358
+ /** The phases that advance one shot at a time inside a single phase (the fan-out phases). These are
359
+ * the phases where a long wall-clock is healthy as long as shots keep landing -- which is why the
360
+ * hard ceiling measures them from last_progress_at, not phase_started_at (#704). */
361
+ export declare const PER_SHOT_PHASES: ReadonlySet<FilmJob["phase"]>;
362
+ /** Seconds since the last REAL progress, for the hard-ceiling check (#704). A per-shot phase
363
+ * (clips/speech/finish) on a slow local-gpu card lands one clip every few minutes for hours; that is
364
+ * genuine progress, so the 90min ceiling measures from last_progress_at (re-stamped on every finished
365
+ * shot via filmProgressMarker, #136): a phase that keeps landing shots never dies at the ceiling,
366
+ * while 90min since the LAST landed shot still fails loudly. Batch phases (keyframe) keep the
367
+ * phase_started_at clock: no phase-level progress for the whole window really is wedged (#129).
368
+ * Falls back to phase_started_at (then created_at) on jobs with no last_progress_at stamp. */
369
+ export declare function ceilingAgeSeconds(job: FilmJob, now?: number): number;
370
+ /** Progress fingerprint for the stall signal (#136): the current phase plus how many of its per-shot
371
+ * units are done. Monotonic within a phase (shots only go pending->done) and it changes on every phase
372
+ * transition, so ANY change is genuine forward progress -- which is what re-stamps last_progress_at.
373
+ * Phases with no per-shot fan-out (keyframe/dialogue/assemble/master/mux) report :0, so their stall
374
+ * window runs from when the phase began, exactly as before. */
375
+ export declare function filmProgressMarker(job: FilmJob, clipJob: ClipJob | null): string;
376
+ /** Default fraction of a shot`s planned seconds an assembled clip must reach before it is treated as a
377
+ * truncation defect (#697) rather than a legitimate beat-trim. Clamped to [0,1]; a 0 disables the gate. */
378
+ export declare const DEFAULT_CLIP_DURATION_FLOOR = 0.5;
379
+ /** Pure: parse + clamp the per-shot duration-floor knob (env.FILM_CLIP_DURATION_FLOOR) into [0,1].
380
+ * Unset / non-numeric falls back to the default; out-of-range clamps (never throws). */
381
+ export declare function resolveClipDurationFloor(raw: string | undefined): number;
382
+ /** Pure: map the video-finish container`s per-clip `clipDurations` array (same order as the clips it was
383
+ * handed) onto shot ids, using the finalClips order the Worker submitted. Non-numeric / negative / missing
384
+ * entries are dropped so absence never fabricates a duration. Returns {} when the container reported none
385
+ * (an older build) -- callers treat an empty map as "no evidence", never as "all zero". */
386
+ export declare function mapClipDurationsToShots(finalClips: {
387
+ shot_id: string;
388
+ }[], clipDurations: unknown): Record<string, number>;
389
+ /** Pure: resolve each shot`s PLANNED seconds -- the bundle`s beat-trimmed target_seconds (preferred),
390
+ * else the authored scene seconds. Only positive values are kept (a plan of 0/unknown cannot gate). This
391
+ * mirrors captions.shotDuration`s resolution so the gate and the cue timeline agree on "the plan". */
392
+ export declare function resolvePlannedSeconds(scenes: {
393
+ shot_id: string;
394
+ seconds: number;
395
+ }[], bundleDurations: Record<string, number>): Record<string, number>;
396
+ /** One shot whose assembled clip fell below the duration floor. */
397
+ export interface ClipDurationShortfall {
398
+ shot_id: string;
399
+ actual: number;
400
+ planned: number;
401
+ floor: number;
402
+ }
403
+ /** Pure per-shot duration honesty gate (#697). Flags every clip with BOTH a known actual duration and a
404
+ * positive plan whose actual < planned * fraction. A shot with no reported actual (older container) or no
405
+ * positive plan is NOT flagged -- the gate fires on EVIDENCE, never on absence, so it can never fail a
406
+ * film just because a duration was unavailable. A fraction of 0 flags nothing (operator off switch). */
407
+ export declare function findClipDurationShortfalls(finalClips: {
408
+ shot_id: string;
409
+ }[], actual: Record<string, number>, planned: Record<string, number>, fraction: number): ClipDurationShortfall[];
410
+ /** Pure: build the caption-timeline durations map (#698) -- the ACTUAL assembled per-clip seconds win,
411
+ * the bundle plan fills any shot the container did not report, and captions.shotDuration falls back to
412
+ * the authored scene seconds for anything in neither. This is what times cues to the real cut instead of
413
+ * the plan (which drifts on every non-final tier where actual != planned). */
414
+ export declare function captionDurations(bundleDurations: Record<string, number>, actualDurations?: Record<string, number>): Record<string, number>;
415
+ //# sourceMappingURL=film-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"film-model.d.ts","sourceRoot":"","sources":["../src/film-model.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjI,OAAO,EAAgB,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIlF,MAAM,WAAW,SAAS;IAAG,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;CAAE;AAEhF;;;8FAG8F;AAC9F;;;6GAG6G;AAC7G,MAAM,WAAW,gBAAgB;IAAG,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;CAAE;AAEvF,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAIlB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAMnB,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;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