hyperframes 0.9.4 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/dist/{add-KGLQRDOR.js → add-FI2ERBMZ.js} +11 -11
  2. package/dist/{agentPromptGenerator-43OTO3ZQ.js → agentPromptGenerator-DZTXHJV3.js} +5 -5
  3. package/dist/{animatedGifPrep-AELBI6OZ.js → animatedGifPrep-GXQA4KCD.js} +5 -5
  4. package/dist/api.d.ts +2 -0
  5. package/dist/api.js +19 -19
  6. package/dist/{asset-IDDA6YDA.js → asset-BRSG6JNL.js} +2 -2
  7. package/dist/{assetCataloger-3ODHJX74.js → assetCataloger-KVWF4SRK.js} +6 -6
  8. package/dist/{audio-YL5WE2ZH.js → audio-BVZOX6LU.js} +502 -143
  9. package/dist/{auth-73AQ4C6J.js → auth-HFFN7USX.js} +2 -2
  10. package/dist/{autoUpdate-PRACQEE2.js → autoUpdate-JNGMUXLZ.js} +2 -2
  11. package/dist/{backgroundChecks-GF7DD3CT.js → backgroundChecks-O4ADPXOL.js} +3 -3
  12. package/dist/backgroundChecksWorker.js +3 -3
  13. package/dist/{batchRender-PHXZBVEA.js → batchRender-A2HW6QW7.js} +3 -3
  14. package/dist/{beats-RIYL6FAW.js → beats-F7Q3G6VW.js} +7 -7
  15. package/dist/{benchmark-ZXWBR4Q2.js → benchmark-4BDMIYTW.js} +8 -8
  16. package/dist/{billing-FFWAEIQ6.js → billing-35NVMZWK.js} +1 -1
  17. package/dist/{browser-RQVUIRKR.js → browser-S6ADXSB7.js} +3 -3
  18. package/dist/{bundleWithLocalizedFonts-U23CIGZT.js → bundleWithLocalizedFonts-EE27EYEU.js} +2 -2
  19. package/dist/{capture-XLIZO7S4.js → capture-CXDJO524.js} +18 -18
  20. package/dist/{capture-DKLV3MKZ.js → capture-LWWBL6SH.js} +3 -3
  21. package/dist/{captureCompositionFrame-IDLA33HO.js → captureCompositionFrame-BB2ZGM6R.js} +10 -10
  22. package/dist/{catalog-GCEMAJ2A.js → catalog-RQ6HIUBG.js} +18 -15
  23. package/dist/{catch-up-JGEVDQYE.js → catch-up-PBAXR7FI.js} +4 -4
  24. package/dist/{check-UFFVDSOH.js → check-O4V4UWE3.js} +35 -35
  25. package/dist/{checkAudio-AJHD4QXP.js → checkAudio-EUT3AO3L.js} +8 -8
  26. package/dist/{checkBrowser-HZPWQLY6.js → checkBrowser-QQUBR4QI.js} +29 -29
  27. package/dist/{chunk-R4KSPN37.js → chunk-27AVZR7K.js} +17 -17
  28. package/dist/{chunk-Y5PWLNW3.js → chunk-2FNUCIHD.js} +1 -1
  29. package/dist/{chunk-KXU3FDXG.js → chunk-2KO357TJ.js} +1 -1
  30. package/dist/chunk-2KYY75JP.js +134 -0
  31. package/dist/{chunk-HVWZ5V2N.js → chunk-3SB24TVT.js} +1 -1
  32. package/dist/{chunk-BXE6GDIL.js → chunk-44T2V4EW.js} +1 -1
  33. package/dist/{chunk-LSFXDBHZ.js → chunk-47IBOMXH.js} +3 -3
  34. package/dist/{chunk-VUGARSNN.js → chunk-4E7G2GME.js} +1 -1
  35. package/dist/{chunk-VBR3OBZU.js → chunk-4III3SDC.js} +9 -9
  36. package/dist/{chunk-CS6UO5NC.js → chunk-4VOK22DG.js} +1 -1
  37. package/dist/{chunk-G5X2YP75.js → chunk-5BCFV2HE.js} +3 -3
  38. package/dist/{chunk-5T2D2XYR.js → chunk-6GZB32Q5.js} +1 -1
  39. package/dist/{chunk-HWIGWPIG.js → chunk-6JMNJYYR.js} +1 -1
  40. package/dist/{chunk-SYHDFH34.js → chunk-6UOHLXVU.js} +2 -2
  41. package/dist/{chunk-T6NMZNAE.js → chunk-7DKGU6CY.js} +2 -2
  42. package/dist/{chunk-CPXT5NUE.js → chunk-AB3ZXWI3.js} +1 -1
  43. package/dist/{chunk-OKMXRVAN.js → chunk-APVBITVZ.js} +55 -16
  44. package/dist/{chunk-AVJDYPVP.js → chunk-BIJBGCF4.js} +1 -1
  45. package/dist/{chunk-C3OOOE6D.js → chunk-BMRZP6X6.js} +1 -1
  46. package/dist/{chunk-EYYILEMR.js → chunk-BQQTZET2.js} +2 -2
  47. package/dist/{chunk-RDE3O5OK.js → chunk-BUDP4GF4.js} +1 -1
  48. package/dist/{chunk-VSDUDDHB.js → chunk-C47ZGVKT.js} +7 -7
  49. package/dist/{chunk-7UVXHPVS.js → chunk-CUAZHDVV.js} +3 -3
  50. package/dist/{chunk-XZ2DZYFD.js → chunk-DETBSOYO.js} +1 -1
  51. package/dist/{chunk-DAF2SYII.js → chunk-DUSSDJJC.js} +2 -2
  52. package/dist/{chunk-CQL77BAS.js → chunk-E2VWKW2A.js} +2 -2
  53. package/dist/{chunk-IWMVCOUX.js → chunk-FB366S4I.js} +5 -5
  54. package/dist/{chunk-YL6X26WT.js → chunk-FDZXVTBY.js} +1 -1
  55. package/dist/{chunk-W6NEVGAE.js → chunk-FIIFME5M.js} +1 -1
  56. package/dist/{chunk-OOGTMIN4.js → chunk-FM7VWSN3.js} +1 -1
  57. package/dist/{chunk-MYTROPEC.js → chunk-FP37FSOT.js} +2 -2
  58. package/dist/{chunk-SEFLUI7L.js → chunk-G4VDT5D7.js} +1 -1
  59. package/dist/{chunk-WRIA42TA.js → chunk-GKVERDJ2.js} +1 -1
  60. package/dist/{chunk-XHLPTVXH.js → chunk-GP7OHHXR.js} +1 -1
  61. package/dist/{chunk-KW2ZREKY.js → chunk-GR3LU4D5.js} +1 -1
  62. package/dist/{chunk-QAB2ZMFL.js → chunk-GYPSZFRF.js} +2 -2
  63. package/dist/{chunk-ZDBN76JQ.js → chunk-HTTGTROQ.js} +1 -1
  64. package/dist/{chunk-UWNLBTFA.js → chunk-I2OMLFBJ.js} +1 -1
  65. package/dist/{chunk-LBETJASR.js → chunk-I47SIQGX.js} +4 -4
  66. package/dist/{chunk-K3AKRESE.js → chunk-IG3GSBHB.js} +2 -2
  67. package/dist/{chunk-6LDW4TLQ.js → chunk-IVFZG3CU.js} +2 -2
  68. package/dist/{chunk-HZMM3D6P.js → chunk-JFIBO4CZ.js} +1 -1
  69. package/dist/{chunk-2RLI5ISA.js → chunk-JLKEXS4I.js} +2 -2
  70. package/dist/{chunk-SGTO3Y2K.js → chunk-JLLNDU2F.js} +84 -8
  71. package/dist/{chunk-TGX5AWVQ.js → chunk-KAWNVSAE.js} +7 -7
  72. package/dist/{chunk-DUZII3C4.js → chunk-KJDQS24S.js} +2 -2
  73. package/dist/{chunk-NYQRWXZZ.js → chunk-KJLZZ4MY.js} +1 -1
  74. package/dist/{chunk-EOVTVB5X.js → chunk-KXAGCBVO.js} +250 -137
  75. package/dist/{chunk-7SYZRT4L.js → chunk-L6MNWJTL.js} +1 -1
  76. package/dist/{chunk-Q4PFOT6Z.js → chunk-LS4CCRTK.js} +1 -1
  77. package/dist/{chunk-VGARKT5Y.js → chunk-M4WEGGF7.js} +2 -2
  78. package/dist/{chunk-ZXD4YXXC.js → chunk-ODKXNWDL.js} +2 -2
  79. package/dist/{chunk-6U4EV64B.js → chunk-P5GOQDA2.js} +8 -8
  80. package/dist/{chunk-GS4C2FNZ.js → chunk-PWYAOU4I.js} +1 -1
  81. package/dist/{chunk-IIBNGLEX.js → chunk-QDB7EFLI.js} +259 -50
  82. package/dist/{chunk-5PKNT2BQ.js → chunk-RYNMIBZM.js} +2 -2
  83. package/dist/{chunk-65ERKMRH.js → chunk-SAWXMCHB.js} +1 -1
  84. package/dist/{chunk-A2PZLDHN.js → chunk-SWWDVPVO.js} +7 -4
  85. package/dist/{chunk-KBKDDTOZ.js → chunk-T57ARBNR.js} +7 -7
  86. package/dist/{chunk-VGIEM4JZ.js → chunk-TIXW6JWD.js} +1 -1
  87. package/dist/chunk-TNWWLO4T.js +5030 -0
  88. package/dist/{chunk-R5XOR2IO.js → chunk-TS4HYR6I.js} +1 -1
  89. package/dist/{chunk-AQW3ZDDM.js → chunk-VFOCEFRZ.js} +5 -5
  90. package/dist/{chunk-SXGR4GCO.js → chunk-VG4JPJMI.js} +2 -2
  91. package/dist/{chunk-TLYTMIXP.js → chunk-VWRIARRR.js} +12 -12
  92. package/dist/{chunk-T46SP3UD.js → chunk-W3G7DNCR.js} +2 -2
  93. package/dist/{chunk-6OBVJUMS.js → chunk-WCET3OHQ.js} +4 -4
  94. package/dist/{chunk-U7DQYDRQ.js → chunk-XC3LDNBH.js} +1 -1
  95. package/dist/{chunk-VVPDROQU.js → chunk-YDG5LVIK.js} +4 -4
  96. package/dist/{chunk-QT7F5JKP.js → chunk-YFISKULK.js} +2 -2
  97. package/dist/{chunk-F4LQGW5F.js → chunk-YIWNZ2CI.js} +13 -13
  98. package/dist/{chunk-WTUIK6Y4.js → chunk-YOZPHSYV.js} +2 -0
  99. package/dist/{chunk-DRXVRDUX.js → chunk-YUMVQB2F.js} +1 -1
  100. package/dist/{chunk-YBFS5PCE.js → chunk-YVUOJW4H.js} +1 -1
  101. package/dist/{chunk-FI7SOWBQ.js → chunk-YY7YI2FW.js} +1 -1
  102. package/dist/{chunk-RISL4HHS.js → chunk-ZP3LPFTA.js} +9 -9
  103. package/dist/{chunk-5NWS6KLM.js → chunk-ZR2GMFNH.js} +2 -2
  104. package/dist/{chunk-H7KAHDJJ.js → chunk-ZV5GD5LV.js} +3 -3
  105. package/dist/{clean-T7DQNAR2.js → clean-2AFJGFIG.js} +15 -15
  106. package/dist/cli.js +58 -57
  107. package/dist/{cloud-S4DTHZEW.js → cloud-JM5MFMVV.js} +4 -4
  108. package/dist/{cloudrun-TWSNNKIV.js → cloudrun-PNVETMPA.js} +4 -4
  109. package/dist/{compare-UZS33RAM.js → compare-ST4DXEMX.js} +26 -26
  110. package/dist/{compiler-SKQTN3EA.js → compiler-UCX3MZVN.js} +2 -2
  111. package/dist/{component-RHX4425M.js → component-ECFJIDUD.js} +3 -3
  112. package/dist/{compositions-PE5F4Z6K.js → compositions-ZCAD47PD.js} +9 -9
  113. package/dist/{curve-NFVM6GS3.js → curve-NYXZWGPO.js} +9 -9
  114. package/dist/{cuts-EKHMAUOZ.js → cuts-CKUCNNOX.js} +10 -10
  115. package/dist/{delete-IQQLQS7T.js → delete-MVGSOWSC.js} +2 -2
  116. package/dist/{deploy-GG24Q4EE.js → deploy-WBKPSWPG.js} +4 -4
  117. package/dist/{describeProject-DCUVSIOQ.js → describeProject-ZDI5B6JO.js} +6 -6
  118. package/dist/{diff-IQVYEYA3.js → diff-3UYDXIEZ.js} +21 -21
  119. package/dist/{dist-4KKPG6A5.js → dist-XRAW3URT.js} +2 -2
  120. package/dist/{doctor-BEFL6PWV.js → doctor-A4HMMBII.js} +9 -9
  121. package/dist/{energy-LZY5CQVP.js → energy-RN6KTYH6.js} +10 -10
  122. package/dist/{events-C335VVXI.js → events-6NE2NRCQ.js} +12 -12
  123. package/dist/{events-VSDE4FFW.js → events-AO3FEPL3.js} +3 -3
  124. package/dist/{events-Z4I2YBA4.js → events-LSEMS2LO.js} +2 -2
  125. package/dist/{extract-N4KV7KUQ.js → extract-6UO4QR77.js} +10 -10
  126. package/dist/{face-DCKACTUC.js → face-FTKPGC2O.js} +10 -10
  127. package/dist/{feedback-FQ2P62K7.js → feedback-GSKVBGA7.js} +6 -6
  128. package/dist/{ffmpeg-HYYU3M6K.js → ffmpeg-HPMQUKY4.js} +5 -5
  129. package/dist/{figma-JWZLYFMJ.js → figma-UIWB3XSX.js} +3 -3
  130. package/dist/fontLocalizeCli.js +8 -8
  131. package/dist/{frames-Z6ATQUGJ.js → frames-U3LLSXSV.js} +11 -11
  132. package/dist/{generate-FHVQMXVB.js → generate-AFCKBHGB.js} +13 -13
  133. package/dist/{get-FBUXTOJS.js → get-J3TJCAZW.js} +2 -2
  134. package/dist/{gpuPolicy-MNPLXHRJ.js → gpuPolicy-W2OEEW7Y.js} +5 -5
  135. package/dist/{grade-compare-ELKVVO7W.js → grade-compare-AOXNJ53Z.js} +27 -27
  136. package/dist/{heifImagePrep-ALPO36IR.js → heifImagePrep-4RSVCLPX.js} +6 -6
  137. package/dist/{help-JHGASQ27.js → help-5NYIBLJJ.js} +2 -1
  138. package/dist/{history-R3MGVTZ2.js → history-KAXYCLVT.js} +6 -6
  139. package/dist/hyperframe.manifest.json +1 -1
  140. package/dist/hyperframe.runtime.iife.js +64 -64
  141. package/dist/hyperframes-player.global.js +90 -3
  142. package/dist/{info-G4NZMSC5.js → info-Z6KNUMH6.js} +7 -7
  143. package/dist/{init-DS4YZTWE.js → init-GSMXQX3U.js} +30 -27
  144. package/dist/{ink-6KESLHVK.js → ink-IPPBJFH3.js} +10 -10
  145. package/dist/{inspect-T3YH6Y7Z.js → inspect-MXIGEN6Z.js} +27 -27
  146. package/dist/{installer-YVNEAOSW.js → installer-JXI2JC3T.js} +4 -4
  147. package/dist/{keyframes-6QMTPUAB.js → keyframes-Z53YGH5F.js} +6 -6
  148. package/dist/{lambda-PVKMQ5RR.js → lambda-KD7ZRYVK.js} +9 -9
  149. package/dist/{layout-ZNH7EW6L.js → layout-NLDWEPDQ.js} +27 -27
  150. package/dist/{lint-FF7YK3QK.js → lint-MSZMGQO5.js} +6 -6
  151. package/dist/{list-TJTH6NN6.js → list-OLNBKKB4.js} +2 -2
  152. package/dist/{localPage-TUWJD4GJ.js → localPage-BQ2LKHED.js} +5 -5
  153. package/dist/{login-3GRKVAMH.js → login-TBJVG5PZ.js} +4 -4
  154. package/dist/{look-5ZFSZPPB.js → look-T5V6JBD5.js} +10 -10
  155. package/dist/{manager-POO6RLB4.js → manager-FHVSGJNR.js} +6 -6
  156. package/dist/{measure-OYR7XHOE.js → measure-KI3XY2MJ.js} +11 -11
  157. package/dist/{media-treatment-PJ3NZ2PR.js → media-treatment-UZI55RS3.js} +11 -11
  158. package/dist/{media-use-PQUFJ2ZJ.js → media-use-2PIPVWX4.js} +1 -1
  159. package/dist/{models-RCJQAORM.js → models-MV4HBZKZ.js} +9 -9
  160. package/dist/{motionShot-2UAWH6B2.js → motionShot-A3TWOBRE.js} +13 -13
  161. package/dist/{normalize-audio-ESIM3KEX.js → normalize-audio-37WYHLP4.js} +8 -8
  162. package/dist/{open-A3DRPHEK.js → open-4PPPV45S.js} +11 -11
  163. package/dist/{parakeetRunner-W2EYPYLF.js → parakeetRunner-J22MMWSM.js} +10 -10
  164. package/dist/{pipeline-KIFB5R5M.js → pipeline-GE4LBTRO.js} +8 -8
  165. package/dist/{play-26X5I67T.js → play-MZSW7GIL.js} +18 -18
  166. package/dist/{preflight-RF5UZJUA.js → preflight-NXMN7P4B.js} +6 -6
  167. package/dist/{present-7IFGQBVD.js → present-TWZLASXI.js} +14 -14
  168. package/dist/{preview-IAMB4ULR.js → preview-OEXP2RPO.js} +16 -16
  169. package/dist/probe-HNAD6ACH.js +69 -0
  170. package/dist/{producer-6NKNMOIT.js → producer-E4AN4ADM.js} +1 -1
  171. package/dist/{projectConfig-MYKQOOIG.js → projectConfig-HKWVTV5Q.js} +10 -6
  172. package/dist/{publication-BS2YATIF.js → publication-DTIE7G2E.js} +2 -2
  173. package/dist/{publish-3BUTNKVA.js → publish-CUU5W6CP.js} +8 -8
  174. package/dist/{remove-background-PEJXPBJA.js → remove-background-2MRQ3YH4.js} +9 -9
  175. package/dist/{render-W72TDIHA.js → render-EEIQAOGV.js} +34 -15
  176. package/dist/{render-3FANM5MO.js → render-JP6JUXWP.js} +5 -5
  177. package/dist/{render-HGGE5CBB.js → render-QRWGJUCD.js} +37 -32
  178. package/dist/{render-batch-DPWJHKFY.js → render-batch-46SYPMYV.js} +5 -5
  179. package/dist/{resolver-5IXI5IFJ.js → resolver-DPRCISSD.js} +4 -4
  180. package/dist/reverse-MY6DSOXL.js +32 -0
  181. package/dist/{run-MTGSR5HH.js → run-2VGZ3URU.js} +1 -1
  182. package/dist/{sherpa-4GLU4QU7.js → sherpa-5LOEXZ46.js} +9 -9
  183. package/dist/{skills-3IEY3EGH.js → skills-BBHR4SHX.js} +5 -5
  184. package/dist/{skillsUpdateCheck-6HQLY6GT.js → skillsUpdateCheck-HBOVCIXG.js} +3 -3
  185. package/dist/{snapshot-UNRFRCCW.js → snapshot-S264O54Z.js} +31 -31
  186. package/dist/{src-FT34LZAJ.js → src-G2EK32ZO.js} +15 -7
  187. package/dist/{src-VWCIVPJX.js → src-GLO4X3WA.js} +20 -4
  188. package/dist/start-6AFMEXPO.js +226 -0
  189. package/dist/{staticProjectServer-WFK4N6P3.js → staticProjectServer-KWSV5IRS.js} +16 -16
  190. package/dist/{status-Z5BPMROD.js → status-5ZRM4R4N.js} +1 -1
  191. package/dist/studio/assets/hyperframes-player-CGO8wE5a.js +565 -0
  192. package/dist/studio/assets/{index-EB7sh_Tw.js → index-COtefOSM.js} +1 -1
  193. package/dist/studio/assets/{index-h1lPtzPa.js → index-DHPJjAUV.js} +4 -4
  194. package/dist/studio/index.html +1 -1
  195. package/dist/{studio-api-OTNMLH4B.js → studio-api-JJO6VEFD.js} +8 -8
  196. package/dist/{studioServer-3CHSYLFZ.js → studioServer-YFZIESIH.js} +45 -45
  197. package/dist/{sync-2IZJ7HAC.js → sync-DBMNZ32Z.js} +10 -10
  198. package/dist/{telemetry-DHLLX5EC.js → telemetry-OPZTKPDG.js} +3 -3
  199. package/dist/{timeline-TK4RV66K.js → timeline-MCJUCDME.js} +16 -16
  200. package/dist/{tokens-PV67HFRX.js → tokens-3DREMPWC.js} +2 -2
  201. package/dist/{transcribe-HJ3AWR2D.js → transcribe-AU7TPKMU.js} +8 -8
  202. package/dist/{transcribe-5HXQG64W.js → transcribe-TMGPK6FM.js} +17 -17
  203. package/dist/{updateCheck-EI4WIVIS.js → updateCheck-YKTRFFFV.js} +2 -2
  204. package/dist/{upgrade-ADM4CRK4.js → upgrade-UAKM3KAT.js} +2 -2
  205. package/dist/{urlDownloader-6TM5CH5Q.js → urlDownloader-77YL7TXO.js} +4 -4
  206. package/dist/{validate-K27UCOGM.js → validate-SR35R3QM.js} +21 -21
  207. package/dist/{video-KAN4FULD.js → video-GNMQTE4D.js} +6 -6
  208. package/dist/warmCheck.js +35 -35
  209. package/package.json +1 -1
  210. package/dist/chunk-2YQ2XYO5.js +0 -5030
  211. package/dist/probe-EZS36TUR.js +0 -179
  212. package/dist/studio/assets/hyperframes-player--MmARLPY.js +0 -478
@@ -8,12 +8,12 @@ import {
8
8
  Semaphore,
9
9
  prepareHeifImageInputs,
10
10
  withMediaProbeSlot
11
- } from "./chunk-T6NMZNAE.js";
11
+ } from "./chunk-7DKGU6CY.js";
12
12
  import {
13
13
  EncoderInterruptedError,
14
14
  encoderFailureError,
15
15
  prepareAnimatedGifInputs
16
- } from "./chunk-EYYILEMR.js";
16
+ } from "./chunk-BQQTZET2.js";
17
17
  import {
18
18
  GENERIC_FAMILIES,
19
19
  collectFontFamilyCustomProperties,
@@ -43,6 +43,7 @@ import {
43
43
  ManagedChildProcess,
44
44
  NotMediaPayloadError,
45
45
  PRORES_PROFILE_NAMES,
46
+ REFERENCE_BACKGROUND_FIELD,
46
47
  VIDEO_FRAME_FORMATS,
47
48
  aacSegmentCount,
48
49
  analyzeCompositionHdr,
@@ -82,6 +83,7 @@ import {
82
83
  createCaptureSession,
83
84
  createFrameLookupTable,
84
85
  createFrameReorderBuffer,
86
+ createReferenceBackgroundRecorder,
85
87
  createVideoFrameInjector,
86
88
  declareContentAddressedUrl,
87
89
  declareProbeFactsUrl,
@@ -153,9 +155,11 @@ import {
153
155
  psnrDb,
154
156
  qualifyVideoLayer,
155
157
  queryElementStacking,
158
+ readReferenceBackground,
156
159
  readWebGlVendorInfoFromCanvas,
157
160
  rebaseVideoToWindow,
158
161
  recaptureDrawElementFrameForVerify,
162
+ referenceBackgroundResult,
159
163
  removeDomLayerMask,
160
164
  resampleRgb48leObjectFit,
161
165
  resolveBrowserGpuMode,
@@ -181,7 +185,7 @@ import {
181
185
  videoAudioId,
182
186
  videoStartOnMediaTimeline,
183
187
  writeCapturedFrame
184
- } from "./chunk-IIBNGLEX.js";
188
+ } from "./chunk-QDB7EFLI.js";
185
189
  import {
186
190
  assignBundledRuntimeCompositionIds,
187
191
  emitMountedModuleScripts,
@@ -193,7 +197,7 @@ import {
193
197
  parsesAsScript,
194
198
  prepareFlattenedInnerRoot,
195
199
  stripSdrPngColourTags
196
- } from "./chunk-HZMM3D6P.js";
200
+ } from "./chunk-JFIBO4CZ.js";
197
201
  import {
198
202
  collectScratchLeftovers,
199
203
  removeScratch,
@@ -212,7 +216,7 @@ import {
212
216
  parseVfxChain,
213
217
  resolveAuthoredTimingWindow,
214
218
  toFps
215
- } from "./chunk-HWIGWPIG.js";
219
+ } from "./chunk-6JMNJYYR.js";
216
220
  import {
217
221
  gsapCdnDist,
218
222
  normalizeGsapBaseUrl
@@ -251,7 +255,7 @@ import {
251
255
  sourceTimeAt,
252
256
  styleElementsFor,
253
257
  timeAtSourceTime
254
- } from "./chunk-2YQ2XYO5.js";
258
+ } from "./chunk-TNWWLO4T.js";
255
259
  import {
256
260
  TRANSITIONS,
257
261
  convertTransfer,
@@ -8151,6 +8155,7 @@ async function runProbeStage(input) {
8151
8155
  const motionBlur = job.config.motionBlur;
8152
8156
  const captureFormat = resolveCaptureImageFormat({ needsAlpha, motionBlur });
8153
8157
  const captureOpts = {
8158
+ recordReferenceBackground: input.recordReferenceBackground,
8154
8159
  width,
8155
8160
  height,
8156
8161
  fps: job.config.fps,
@@ -11711,6 +11716,17 @@ function applyRenderWarningPolicy(job, captureWarnings, log = defaultLogger) {
11711
11716
  throw new RenderQualityError(job.warnings);
11712
11717
  }
11713
11718
  }
11719
+ var stopPrepSessionOnScriptFailure = (options) => ({
11720
+ ...options,
11721
+ onSubTimelineScriptFailure: () => {
11722
+ throw new Error("a composition script failed, so this preparation session stops");
11723
+ }
11724
+ });
11725
+ var surfaceScriptFailure = (error, job) => error instanceof RenderQualityError || error instanceof RenderCancelledError || !job.warnings?.some((warning) => warning.code === "sub_timeline_script_failure") ? error : new RenderQualityError(job.warnings);
11726
+ var withScriptFailureStop = (options, job, log) => ({
11727
+ ...options,
11728
+ onSubTimelineScriptFailure: (warnings) => applyRenderWarningPolicy(job, warnings, log)
11729
+ });
11714
11730
  var RenderCancelledError = class extends Error {
11715
11731
  reason;
11716
11732
  constructor(message = "render_cancelled", reason = "aborted") {
@@ -12078,6 +12094,7 @@ async function executeDiskCaptureWithAdaptiveRetry(options) {
12078
12094
  }
12079
12095
  function createRenderJob(config) {
12080
12096
  return {
12097
+ ...referenceBackgroundResult(void 0),
12081
12098
  id: randomUUID(),
12082
12099
  config: {
12083
12100
  ...config,
@@ -12843,6 +12860,9 @@ async function executeRenderPipeline(input) {
12843
12860
  cfg.protocolTimeout = scaledProtocolTimeout;
12844
12861
  updateCaptureObservability({ protocolTimeoutMs: scaledProtocolTimeout });
12845
12862
  }
12863
+ const recordReferenceBackground = createReferenceBackgroundRecorder(
12864
+ (result) => Object.assign(job, result)
12865
+ );
12846
12866
  const subTimelineWaitMemo = {};
12847
12867
  const probeResult = await observeRenderStage(
12848
12868
  observability,
@@ -12863,7 +12883,8 @@ async function executeRenderPipeline(input) {
12863
12883
  height,
12864
12884
  needsAlpha,
12865
12885
  deviceScaleFactor,
12866
- subTimelineWaitMemo
12886
+ subTimelineWaitMemo,
12887
+ recordReferenceBackground
12867
12888
  }),
12868
12889
  // Browser probe is pre-capture; report `browser calibrating` so a
12869
12890
  // slow probe (~64s SwiftShader warm-up on Windows was the reported
@@ -13119,6 +13140,7 @@ async function executeRenderPipeline(input) {
13119
13140
  let routePageMotionBlur;
13120
13141
  const buildCaptureOptions = () => ({
13121
13142
  ...captureOptions,
13143
+ recordReferenceBackground,
13122
13144
  ...routePageMotionBlur ? { pageMotionBlur: routePageMotionBlur } : {},
13123
13145
  videoMetadataHints,
13124
13146
  skipReadinessVideoIds: videoReadinessSkipIds,
@@ -13151,6 +13173,8 @@ async function executeRenderPipeline(input) {
13151
13173
  });
13152
13174
  }
13153
13175
  });
13176
+ const buildPrepCaptureOptions = () => stopPrepSessionOnScriptFailure(buildCaptureOptions());
13177
+ const buildWorkerCaptureOptions = () => withScriptFailureStop(buildCaptureOptions(), job, log);
13154
13178
  const createRenderVideoFrameInjector = () => createVideoFrameInjector(frameLookup, frameCacheOptions(cfg, workerCount));
13155
13179
  let captureCalibration;
13156
13180
  const htmlInCanvasDetected = compiled.renderModeHints.reasons.some(
@@ -13254,7 +13278,7 @@ async function executeRenderPipeline(input) {
13254
13278
  probeSession = await createCaptureSession(
13255
13279
  activeFileServer.url,
13256
13280
  framesDir,
13257
- buildCaptureOptions(),
13281
+ buildPrepCaptureOptions(),
13258
13282
  null,
13259
13283
  { ...cfg, forceScreenshot: captureForceScreenshot }
13260
13284
  );
@@ -13337,7 +13361,7 @@ async function executeRenderPipeline(input) {
13337
13361
  totalFrames,
13338
13362
  forceScreenshot: captureForceScreenshot,
13339
13363
  probeSession,
13340
- buildCaptureOptions,
13364
+ buildCaptureOptions: buildPrepCaptureOptions,
13341
13365
  createRenderVideoFrameInjector,
13342
13366
  assertNotAborted
13343
13367
  }),
@@ -13809,7 +13833,7 @@ async function executeRenderPipeline(input) {
13809
13833
  effectiveBitrate,
13810
13834
  deliveryEncoder,
13811
13835
  fileServer: activeFileServer,
13812
- buildCaptureOptions,
13836
+ buildCaptureOptions: buildWorkerCaptureOptions,
13813
13837
  createRenderVideoFrameInjector,
13814
13838
  hdrDiagnostics,
13815
13839
  abortSignal: attempt,
@@ -13927,7 +13951,7 @@ async function executeRenderPipeline(input) {
13927
13951
  // Each segment sets its own GOP (at most the interval); hls never reaches this route.
13928
13952
  ...deliveryEncoder
13929
13953
  },
13930
- buildCaptureOptions,
13954
+ buildCaptureOptions: buildWorkerCaptureOptions,
13931
13955
  createRenderVideoFrameInjector,
13932
13956
  abortSignal: executionSignal,
13933
13957
  assertNotAborted,
@@ -14075,7 +14099,7 @@ async function executeRenderPipeline(input) {
14075
14099
  // encoder's open-GOP output untouched.
14076
14100
  ...deliveryEncoder
14077
14101
  },
14078
- buildCaptureOptions,
14102
+ buildCaptureOptions: buildWorkerCaptureOptions,
14079
14103
  createRenderVideoFrameInjector,
14080
14104
  abortSignal: executionSignal,
14081
14105
  assertNotAborted,
@@ -14260,7 +14284,7 @@ async function executeRenderPipeline(input) {
14260
14284
  probeSession,
14261
14285
  captureAttempts,
14262
14286
  dedupPerfs,
14263
- buildCaptureOptions,
14287
+ buildCaptureOptions: buildWorkerCaptureOptions,
14264
14288
  createRenderVideoFrameInjector,
14265
14289
  abortSignal: executionSignal,
14266
14290
  assertNotAborted,
@@ -14493,7 +14517,7 @@ async function executeRenderPipeline(input) {
14493
14517
  await eventPublisher.flush();
14494
14518
  } catch (caught) {
14495
14519
  await pendingAudio;
14496
- const error = tooSlowError ?? caught;
14520
+ const error = surfaceScriptFailure(tooSlowError ?? caught, job);
14497
14521
  if (!tooSlowError && (error instanceof RenderCancelledError || executionSignal?.aborted)) {
14498
14522
  job.error = error instanceof Error ? error.message : "render_cancelled";
14499
14523
  updateJobStatus(job, "cancelled", "Render cancelled", job.progress, onProgress);
@@ -14586,7 +14610,7 @@ async function executeRenderPipeline(input) {
14586
14610
 
14587
14611
  // ../producer/src/services/distributed/renderSpan.ts
14588
14612
  import { mkdirSync as mkdirSync16, mkdtempSync as mkdtempSync7, readFileSync as readFileSync11, rmSync as rmSync14 } from "fs";
14589
- import { join as join39 } from "path";
14613
+ import { join as join40 } from "path";
14590
14614
  import { tmpdir as tmpdir4 } from "os";
14591
14615
 
14592
14616
  // ../producer/src/services/distributed/mp4Stitch.ts
@@ -14981,7 +15005,7 @@ import {
14981
15005
  rmSync as rmSync10,
14982
15006
  writeFileSync as writeFileSync8
14983
15007
  } from "fs";
14984
- import { extname as extname6, isAbsolute as isAbsolute2, join as join34, relative as relative5, sep as sep2 } from "path";
15008
+ import { extname as extname6, isAbsolute as isAbsolute2, join as join35, relative as relative5, sep as sep2 } from "path";
14985
15009
 
14986
15010
  // ../producer/src/services/distributed/planFrameCost.ts
14987
15011
  import { join as join30 } from "path";
@@ -15596,9 +15620,59 @@ function buildWeightedChunkSlices(weights, chunkCount, minFrames, maxFrames) {
15596
15620
  return slices;
15597
15621
  }
15598
15622
 
15623
+ // ../producer/src/services/render/planReferenceBackground.ts
15624
+ import { join as join31 } from "path";
15625
+ async function readPlanReferenceBackground(input) {
15626
+ let server;
15627
+ let session;
15628
+ try {
15629
+ server = await createFileServer({
15630
+ projectDir: input.projectDir,
15631
+ compiledDir: join31(input.workDir, "compiled"),
15632
+ port: 0,
15633
+ preHeadScripts: [VIRTUAL_TIME_SHIM],
15634
+ fps: input.options.fps
15635
+ });
15636
+ session = await createCaptureSession(
15637
+ server.url,
15638
+ join31(input.workDir, "reference"),
15639
+ {
15640
+ ...input.options,
15641
+ requiresWebGpu: false
15642
+ },
15643
+ null,
15644
+ {
15645
+ ...input.cfg,
15646
+ forceScreenshot: true,
15647
+ useDrawElement: false,
15648
+ enablePageSideCompositing: false
15649
+ }
15650
+ );
15651
+ const page = session.page;
15652
+ await page.goto(`${server.url}/index.html`, {
15653
+ waitUntil: "domcontentloaded",
15654
+ timeout: input.cfg.pageNavigationTimeout
15655
+ });
15656
+ await page.evaluate("window.__hfFlushSync?.()");
15657
+ await page.waitForFunction(
15658
+ '!!(window.__hf && typeof window.__hf.seek === "function" && window.__hf.duration > 0)',
15659
+ { timeout: input.cfg.playerReadyTimeout, polling: 100 }
15660
+ );
15661
+ return referenceBackgroundResult(await readReferenceBackground(page));
15662
+ } catch (error) {
15663
+ input.log.debug("Reference background unavailable", {
15664
+ error: error instanceof Error ? error.message : String(error)
15665
+ });
15666
+ return referenceBackgroundResult(void 0);
15667
+ } finally {
15668
+ if (session) await closeCaptureSession(session).catch(() => void 0);
15669
+ if (server) closeFileServerSafely(server, "reference background", input.log);
15670
+ }
15671
+ }
15672
+
15599
15673
  // ../producer/src/services/render/stages/freezePlan.ts
15600
15674
  import { existsSync as existsSync20, mkdirSync as mkdirSync10, readFileSync as readFileSync7, readdirSync as readdirSync7, writeFileSync as writeFileSync6 } from "fs";
15601
- import { join as join31, relative as relative3, resolve as resolve7 } from "path";
15675
+ import { join as join32, relative as relative3, resolve as resolve7 } from "path";
15602
15676
 
15603
15677
  // ../producer/src/services/distributed/planProtocol.ts
15604
15678
  var PLAN_SCHEMA_VERSION = 1;
@@ -15812,7 +15886,7 @@ function listPlanFiles(planDir) {
15812
15886
  function walk(dir) {
15813
15887
  const entries = readdirSync7(dir, { withFileTypes: true });
15814
15888
  for (const entry of entries) {
15815
- const full = join31(dir, entry.name);
15889
+ const full = join32(dir, entry.name);
15816
15890
  if (entry.isDirectory()) {
15817
15891
  walk(full);
15818
15892
  } else if (entry.isFile()) {
@@ -15853,15 +15927,15 @@ var PLAN_REMOTE_FILES_RELATIVE_PATH = "meta/remote-files.json";
15853
15927
  function writePlanRemoteFiles(planDir, files) {
15854
15928
  if (files.length === 0) return;
15855
15929
  const sorted = [...files].sort((a, b) => a.path < b.path ? -1 : 1);
15856
- writeFileSync6(join31(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH), JSON.stringify(sorted), "utf-8");
15930
+ writeFileSync6(join32(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH), JSON.stringify(sorted), "utf-8");
15857
15931
  }
15858
15932
  function readPlanRemoteFiles(planDir) {
15859
- const path = join31(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH);
15933
+ const path = join32(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH);
15860
15934
  return existsSync20(path) ? JSON.parse(readFileSync7(path, "utf-8")) : [];
15861
15935
  }
15862
15936
  function recomputePlanHashFromPlanDir(planDir, digests) {
15863
- const planJsonPath = join31(planDir, "plan.json");
15864
- const encoderJsonPath = join31(planDir, "meta", "encoder.json");
15937
+ const planJsonPath = join32(planDir, "plan.json");
15938
+ const encoderJsonPath = join32(planDir, "meta", "encoder.json");
15865
15939
  if (!existsSync20(planJsonPath)) {
15866
15940
  throw new Error(`[freezePlan] plan.json missing: ${planJsonPath}`);
15867
15941
  }
@@ -15898,18 +15972,18 @@ async function freezePlan(input) {
15898
15972
  if (!existsSync20(planDir)) {
15899
15973
  throw new Error(`[freezePlan] planDir does not exist: ${planDir}`);
15900
15974
  }
15901
- const metaDir = join31(planDir, "meta");
15975
+ const metaDir = join32(planDir, "meta");
15902
15976
  if (!existsSync20(metaDir)) mkdirSync10(metaDir, { recursive: true });
15903
15977
  writeFileSync6(
15904
- join31(metaDir, "composition.json"),
15978
+ join32(metaDir, "composition.json"),
15905
15979
  `${JSON.stringify(composition, null, 2)}
15906
15980
  `,
15907
15981
  "utf-8"
15908
15982
  );
15909
15983
  const encoderForCanonical = stripUndefined(encoder);
15910
15984
  const encoderConfigCanonicalJson = canonicalJsonStringify(encoderForCanonical);
15911
- writeFileSync6(join31(metaDir, "encoder.json"), encoderConfigCanonicalJson, "utf-8");
15912
- writeFileSync6(join31(metaDir, "chunks.json"), `${JSON.stringify(chunks, null, 2)}
15985
+ writeFileSync6(join32(metaDir, "encoder.json"), encoderConfigCanonicalJson, "utf-8");
15986
+ writeFileSync6(join32(metaDir, "chunks.json"), `${JSON.stringify(chunks, null, 2)}
15913
15987
  `, "utf-8");
15914
15988
  const { compositionHtml, assets } = collectPlanAssetShas(planDir, digests);
15915
15989
  const planHash = computePlanHash({
@@ -15922,6 +15996,7 @@ async function freezePlan(input) {
15922
15996
  dimensions
15923
15997
  });
15924
15998
  const planJson = {
15999
+ ...referenceBackgroundResult(composition[REFERENCE_BACKGROUND_FIELD]),
15925
16000
  protocol: PLAN_PROTOCOL_V1,
15926
16001
  planHash,
15927
16002
  producerVersion,
@@ -15933,7 +16008,7 @@ async function freezePlan(input) {
15933
16008
  duration: durationSeconds,
15934
16009
  hasAudio
15935
16010
  };
15936
- const planJsonPath = join31(planDir, "plan.json");
16011
+ const planJsonPath = join32(planDir, "plan.json");
15937
16012
  writeFileSync6(planJsonPath, `${JSON.stringify(planJson, null, 2)}
15938
16013
  `, "utf-8");
15939
16014
  return { planJsonPath, planHash };
@@ -15977,7 +16052,7 @@ function applyRuntimeEnvSnapshot(snapshot, env = process.env) {
15977
16052
  // ../producer/src/services/distributed/chunkAudio.ts
15978
16053
  import { closeSync as closeSync5, existsSync as existsSync21, ftruncateSync, mkdirSync as mkdirSync11, openSync as openSync5, readFileSync as readFileSync8 } from "fs";
15979
16054
  import { writeFileSync as writeFileSync7, writeSync } from "fs";
15980
- import { join as join32 } from "path";
16055
+ import { join as join33 } from "path";
15981
16056
  function audioCutForChunk(grid, chunks, index, fps) {
15982
16057
  const firstPacketAt = (frame) => Math.min(
15983
16058
  grid.packetCount,
@@ -16064,7 +16139,7 @@ async function writeChunkAudioSlices(input) {
16064
16139
  });
16065
16140
  const bytes = readFileSync8(input.audioPath);
16066
16141
  const layout = { sizeBytes: bytes.length, payloadStart, payloadEnd, partStarts: {} };
16067
- mkdirSync11(join32(input.planDir, SLICE_DIR), { recursive: true });
16142
+ mkdirSync11(join33(input.planDir, SLICE_DIR), { recursive: true });
16068
16143
  input.chunks.forEach((_, index) => {
16069
16144
  const cut = audioCutForChunk(grid, input.chunks, index, input.fps);
16070
16145
  if (!cut) return;
@@ -16072,17 +16147,17 @@ async function writeChunkAudioSlices(input) {
16072
16147
  const start = offsets[cut.firstPacket];
16073
16148
  layout.partStarts[index] = start;
16074
16149
  const end = offsets[last] + track.sizes[last];
16075
- writeFileSync7(join32(input.planDir, chunkAudioSlicePath(index)), bytes.subarray(start, end));
16150
+ writeFileSync7(join33(input.planDir, chunkAudioSlicePath(index)), bytes.subarray(start, end));
16076
16151
  });
16077
16152
  const frame = [bytes.subarray(0, payloadStart), bytes.subarray(payloadEnd)];
16078
- writeFileSync7(join32(input.planDir, SLICE_FRAME), Buffer.concat(frame));
16079
- writeFileSync7(join32(input.planDir, SLICE_LAYOUT), JSON.stringify(layout));
16153
+ writeFileSync7(join33(input.planDir, SLICE_FRAME), Buffer.concat(frame));
16154
+ writeFileSync7(join33(input.planDir, SLICE_LAYOUT), JSON.stringify(layout));
16080
16155
  }
16081
16156
  function chunkAudioSource(planDir, chunkIndex, scratchPath) {
16082
- const layoutPath = join32(planDir, SLICE_LAYOUT);
16157
+ const layoutPath = join33(planDir, SLICE_LAYOUT);
16083
16158
  if (!existsSync21(layoutPath)) return resolvePlanAudioPath(planDir);
16084
16159
  const layout = JSON.parse(readFileSync8(layoutPath, "utf-8"));
16085
- const frame = readFileSync8(join32(planDir, SLICE_FRAME));
16160
+ const frame = readFileSync8(join33(planDir, SLICE_FRAME));
16086
16161
  const fd = openSync5(scratchPath, "w");
16087
16162
  try {
16088
16163
  writeSync(fd, frame, 0, layout.payloadStart, 0);
@@ -16095,7 +16170,7 @@ function chunkAudioSource(planDir, chunkIndex, scratchPath) {
16095
16170
  );
16096
16171
  const start = layout.partStarts[chunkIndex];
16097
16172
  if (start !== void 0) {
16098
- const part = readFileSync8(join32(planDir, chunkAudioSlicePath(chunkIndex)));
16173
+ const part = readFileSync8(join33(planDir, chunkAudioSlicePath(chunkIndex)));
16099
16174
  writeSync(fd, part, 0, part.length, start);
16100
16175
  }
16101
16176
  ftruncateSync(fd, layout.sizeBytes);
@@ -16151,7 +16226,7 @@ async function muxChunkWithAudio(input) {
16151
16226
  // ../producer/src/services/distributed/planSize.ts
16152
16227
  import { createHash as createHash7 } from "crypto";
16153
16228
  import { lstatSync as lstatSync2, readdirSync as readdirSync8 } from "fs";
16154
- import { extname as extname5, join as join33, relative as relative4 } from "path";
16229
+ import { extname as extname5, join as join34, relative as relative4 } from "path";
16155
16230
  var MAX_TOP_COMPONENTS = 10;
16156
16231
  var SOURCE_MEDIA_EXTENSIONS = /* @__PURE__ */ new Set([
16157
16232
  ".aac",
@@ -16263,7 +16338,7 @@ function walkRegularFiles(dir, visit) {
16263
16338
  return;
16264
16339
  }
16265
16340
  for (const entry of entries) {
16266
- const full = join33(dir, entry.name);
16341
+ const full = join34(dir, entry.name);
16267
16342
  if (entry.isDirectory()) {
16268
16343
  walkRegularFiles(full, visit);
16269
16344
  } else if (entry.isFile()) {
@@ -16475,13 +16550,13 @@ function assertPositiveInteger2(name, value) {
16475
16550
  }
16476
16551
  var FREEZE_OWNED_PLAN_FILES = [
16477
16552
  "plan.json",
16478
- join34("meta", "composition.json"),
16479
- join34("meta", "encoder.json"),
16480
- join34("meta", "chunks.json")
16553
+ join35("meta", "composition.json"),
16554
+ join35("meta", "encoder.json"),
16555
+ join35("meta", "chunks.json")
16481
16556
  ];
16482
16557
  function removeFreezeOwnedPlanFiles(planDir) {
16483
16558
  for (const relativePath of FREEZE_OWNED_PLAN_FILES) {
16484
- rmSync10(join34(planDir, relativePath), { force: true });
16559
+ rmSync10(join35(planDir, relativePath), { force: true });
16485
16560
  }
16486
16561
  }
16487
16562
  function buildChunkSlices(totalFrames, chunkCount, effectiveChunkSize) {
@@ -16636,19 +16711,19 @@ function createVideoSourceShipper(input) {
16636
16711
  const known = shipped.get(srcPath);
16637
16712
  if (known) return known;
16638
16713
  const stagedRel = pathInside(input.workVideoFramesDir, srcPath);
16639
- const current = stagedRel === null ? srcPath : join34(input.planDir, "video-frames", stagedRel);
16714
+ const current = stagedRel === null ? srcPath : join35(input.planDir, "video-frames", stagedRel);
16640
16715
  let result = null;
16641
16716
  for (const root of stagedRel === null ? [input.workCompiledDir, input.projectDir] : []) {
16642
16717
  const rel = pathInside(root, srcPath);
16643
- if (rel !== null && (existsSync22(join34(input.planDir, "compiled", rel)) || input.isRemote(srcPath))) {
16718
+ if (rel !== null && (existsSync22(join35(input.planDir, "compiled", rel)) || input.isRemote(srcPath))) {
16644
16719
  result = ["compiled", ...rel.split(sep2)].join("/");
16645
16720
  break;
16646
16721
  }
16647
16722
  }
16648
16723
  if (result === null) {
16649
16724
  result = `video-sources/${shipped.size}${extname6(current)}`;
16650
- const destination = join34(input.planDir, ...result.split("/"));
16651
- mkdirSync12(join34(input.planDir, "video-sources"), { recursive: true });
16725
+ const destination = join35(input.planDir, ...result.split("/"));
16726
+ mkdirSync12(join35(input.planDir, "video-sources"), { recursive: true });
16652
16727
  try {
16653
16728
  linkSync(current, destination);
16654
16729
  } catch {
@@ -16697,14 +16772,14 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
16697
16772
  variables: config.variables
16698
16773
  });
16699
16774
  const entryFile = config.entryFile ?? "index.html";
16700
- const htmlPath = join34(projectDir, entryFile);
16775
+ const htmlPath = join35(projectDir, entryFile);
16701
16776
  if (!existsSync22(htmlPath)) {
16702
16777
  throw new Error(`[plan] entry file not found: ${htmlPath}`);
16703
16778
  }
16704
- const workDir = join34(planDir, ".plan-work");
16779
+ const workDir = join35(planDir, ".plan-work");
16705
16780
  rmSync10(workDir, { recursive: true, force: true });
16706
16781
  mkdirSync12(workDir, { recursive: true });
16707
- const compiledDir = join34(workDir, "compiled");
16782
+ const compiledDir = join35(workDir, "compiled");
16708
16783
  mkdirSync12(compiledDir, { recursive: true });
16709
16784
  let stageStarted = Date.now();
16710
16785
  cpSync2(projectDir, compiledDir, {
@@ -16718,10 +16793,10 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
16718
16793
  }
16719
16794
  });
16720
16795
  logPlanStage(log, "copy", stageStarted);
16721
- const finalCompiledDir = join34(planDir, "compiled");
16796
+ const finalCompiledDir = join35(planDir, "compiled");
16722
16797
  const needsAlpha = outputNeedsAlpha(config.format);
16723
16798
  const remoteFiles = Object.entries(options.remoteFiles ?? {});
16724
- const remoteLocalPath = (rel) => join34(projectDir, ...rel.split("/"));
16799
+ const remoteLocalPath = (rel) => join35(projectDir, ...rel.split("/"));
16725
16800
  for (const [, file] of remoteFiles) {
16726
16801
  declareContentAddressedUrl(file.url, file.sha256);
16727
16802
  if (file.probeFactsUrl) declareProbeFactsUrl(file.url, file.probeFactsUrl);
@@ -16771,6 +16846,9 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
16771
16846
  }
16772
16847
  stageStarted = Date.now();
16773
16848
  const probeResult = await runProbeStage({
16849
+ recordReferenceBackground: createReferenceBackgroundRecorder(
16850
+ (result) => Object.assign(job, result)
16851
+ ),
16774
16852
  projectDir,
16775
16853
  workDir,
16776
16854
  job,
@@ -16788,6 +16866,21 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
16788
16866
  subTimelineWaitMemo: {}
16789
16867
  });
16790
16868
  logPlanStage(log, "probe", stageStarted);
16869
+ if (!probeResult.probeSession) {
16870
+ stageStarted = Date.now();
16871
+ Object.assign(
16872
+ job,
16873
+ await readPlanReferenceBackground({
16874
+ projectDir,
16875
+ workDir,
16876
+ cfg,
16877
+ log,
16878
+ options: { width, height, fps: job.config.fps, variables: job.config.variables }
16879
+ })
16880
+ );
16881
+ assertNotAborted();
16882
+ logPlanStage(log, "reference_background", stageStarted);
16883
+ }
16791
16884
  compiled = probeResult.compiled;
16792
16885
  job.duration = probeResult.duration;
16793
16886
  job.totalFrames = probeResult.totalFrames;
@@ -16800,7 +16893,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
16800
16893
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
16801
16894
  if (probeResult.probeSession) {
16802
16895
  try {
16803
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-VWCIVPJX.js");
16896
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-GLO4X3WA.js");
16804
16897
  await closeCaptureSession2(probeResult.probeSession);
16805
16898
  } catch (err) {
16806
16899
  log.warn("[plan] probe session close failed", {
@@ -16907,10 +17000,10 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
16907
17000
  let stageStarted = Date.now();
16908
17001
  const extractResult = await extractPlanVideos(c, options.deferVideoExtraction);
16909
17002
  logPlanStage(log, "extract", stageStarted);
16910
- const stagedVideoFrames = join34(compiledDir, "__hyperframes_video_frames");
16911
- const videoFramesDst = join34(planDir, "video-frames");
17003
+ const stagedVideoFrames = join35(compiledDir, "__hyperframes_video_frames");
17004
+ const videoFramesDst = join35(planDir, "video-frames");
16912
17005
  if (existsSync22(videoFramesDst)) rmSync10(videoFramesDst, { recursive: true, force: true });
16913
- const videoSourcesDir = join34(planDir, "video-sources");
17006
+ const videoSourcesDir = join35(planDir, "video-sources");
16914
17007
  rmSync10(videoSourcesDir, { recursive: true, force: true });
16915
17008
  if (existsSync22(stagedVideoFrames)) {
16916
17009
  renameWithRetry(stagedVideoFrames, videoFramesDst);
@@ -16947,7 +17040,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
16947
17040
  };
16948
17041
  })
16949
17042
  });
16950
- mkdirSync12(join34(planDir, "meta"), { recursive: true });
17043
+ mkdirSync12(join35(planDir, "meta"), { recursive: true });
16951
17044
  writePlanRemoteFiles(
16952
17045
  planDir,
16953
17046
  remoteFiles.map(([rel, { sha256, sizeBytes }]) => ({
@@ -16957,7 +17050,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
16957
17050
  }))
16958
17051
  );
16959
17052
  writeFileSync8(
16960
- join34(planDir, PLAN_VIDEOS_META_RELATIVE_PATH),
17053
+ join35(planDir, PLAN_VIDEOS_META_RELATIVE_PATH),
16961
17054
  JSON.stringify(planVideosJson, null, 2),
16962
17055
  "utf-8"
16963
17056
  );
@@ -17036,7 +17129,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
17036
17129
  if (audioResult?.audioError) {
17037
17130
  applyDistributedAudioWarningPolicy(job, audioResult.audioError, audioResult.audioFailures, log);
17038
17131
  }
17039
- const planAudioPath = join34(planDir, PLAN_AUDIO_RELATIVE_PATH);
17132
+ const planAudioPath = join35(planDir, PLAN_AUDIO_RELATIVE_PATH);
17040
17133
  if (audioResult?.hasAudio && existsSync22(audioResult.audioOutputPath)) {
17041
17134
  renameWithRetry(audioResult.audioOutputPath, planAudioPath);
17042
17135
  }
@@ -17069,6 +17162,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
17069
17162
  separateAudio
17070
17163
  });
17071
17164
  const compositionJson = {
17165
+ ...referenceBackgroundResult(job[REFERENCE_BACKGROUND_FIELD]),
17072
17166
  durationSeconds: job.duration ?? 0,
17073
17167
  width,
17074
17168
  height,
@@ -17124,6 +17218,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
17124
17218
  log
17125
17219
  });
17126
17220
  return {
17221
+ ...referenceBackgroundResult(job[REFERENCE_BACKGROUND_FIELD]),
17127
17222
  executionPlanDir: planDir,
17128
17223
  executionPlanHash: planHash,
17129
17224
  chunkCount,
@@ -17139,6 +17234,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
17139
17234
  async function plan(projectDir, config, planDir, options = {}) {
17140
17235
  const executionPlan = await buildLocalExecutionPlan(projectDir, config, planDir, options);
17141
17236
  return {
17237
+ ...referenceBackgroundResult(executionPlan[REFERENCE_BACKGROUND_FIELD]),
17142
17238
  planDir: executionPlan.executionPlanDir,
17143
17239
  planProtocol: PLAN_PROTOCOL_V1,
17144
17240
  planHash: executionPlan.executionPlanHash,
@@ -17157,7 +17253,7 @@ async function plan(projectDir, config, planDir, options = {}) {
17157
17253
  import { randomBytes } from "crypto";
17158
17254
  import { existsSync as existsSync25, mkdirSync as mkdirSync15, readFileSync as readFileSync10, readdirSync as readdirSync10, rmSync as rmSync13, writeFileSync as writeFileSync11 } from "fs";
17159
17255
  import { cpus as cpus3 } from "os";
17160
- import { join as join38 } from "path";
17256
+ import { join as join39 } from "path";
17161
17257
 
17162
17258
  // ../producer/src/services/distributed/planV2.ts
17163
17259
  import {
@@ -17173,7 +17269,7 @@ import {
17173
17269
  writeFileSync as writeFileSync10
17174
17270
  } from "fs";
17175
17271
  import { tmpdir as tmpdir3 } from "os";
17176
- import { dirname as dirname14, isAbsolute as isAbsolute3, join as join37, relative as relative6, resolve as resolve8, sep as sep3 } from "path";
17272
+ import { dirname as dirname14, isAbsolute as isAbsolute3, join as join38, relative as relative6, resolve as resolve8, sep as sep3 } from "path";
17177
17273
 
17178
17274
  // ../producer/src/services/distributed/planV2Publisher.ts
17179
17275
  import {
@@ -17186,7 +17282,7 @@ import {
17186
17282
  statSync as statSync7,
17187
17283
  writeFileSync as writeFileSync9
17188
17284
  } from "fs";
17189
- import { dirname as dirname13, join as join36 } from "path";
17285
+ import { dirname as dirname13, join as join37 } from "path";
17190
17286
 
17191
17287
  // ../producer/src/services/distributed/planV2Errors.ts
17192
17288
  var PLAN_V2_INTEGRITY_UNRECOVERABLE = "PLAN_V2_INTEGRITY_UNRECOVERABLE";
@@ -17201,7 +17297,7 @@ var PlanV2IntegrityError = class extends Error {
17201
17297
  };
17202
17298
 
17203
17299
  // ../producer/src/services/distributed/planV2Layout.ts
17204
- import { join as join35 } from "path";
17300
+ import { join as join36 } from "path";
17205
17301
  var SHA256_PATTERN = /^[0-9a-f]{64}$/;
17206
17302
  function assertPlanV2Sha256(value, field) {
17207
17303
  if (typeof value !== "string" || !SHA256_PATTERN.test(value)) {
@@ -17211,7 +17307,7 @@ function assertPlanV2Sha256(value, field) {
17211
17307
  }
17212
17308
  function planV2BlobPath(root, sha256) {
17213
17309
  const digest = assertPlanV2Sha256(sha256, "artifact sha256");
17214
- return join35(root, "artifacts", "sha256", digest.slice(0, 2), digest);
17310
+ return join36(root, "artifacts", "sha256", digest.slice(0, 2), digest);
17215
17311
  }
17216
17312
 
17217
17313
  // ../producer/src/services/distributed/planV2Publisher.ts
@@ -17252,7 +17348,7 @@ var LocalPlanV2ArtifactPublisher = class {
17252
17348
  this.destinationDir = destinationDir;
17253
17349
  this.#linkFile = options.linkFile ?? linkSync2;
17254
17350
  mkdirSync13(dirname13(destinationDir), { recursive: true });
17255
- this.temporaryDir = mkdtempSync5(join36(dirname13(destinationDir), ".plan-v2-publish-"));
17351
+ this.temporaryDir = mkdtempSync5(join37(dirname13(destinationDir), ".plan-v2-publish-"));
17256
17352
  }
17257
17353
  async putBlob(blob) {
17258
17354
  const digest = assertPlanV2Sha256(blob.sha256, "published blob sha256");
@@ -17265,8 +17361,8 @@ var LocalPlanV2ArtifactPublisher = class {
17265
17361
  const destinationPath = planV2BlobPath(this.temporaryDir, digest);
17266
17362
  if (existsSync23(destinationPath)) return;
17267
17363
  mkdirSync13(dirname13(destinationPath), { recursive: true });
17268
- const stagingDir = mkdtempSync5(join36(dirname13(destinationPath), ".plan-v2-blob-"));
17269
- const temporaryPath = join36(stagingDir, "blob");
17364
+ const stagingDir = mkdtempSync5(join37(dirname13(destinationPath), ".plan-v2-blob-"));
17365
+ const temporaryPath = join37(stagingDir, "blob");
17270
17366
  try {
17271
17367
  try {
17272
17368
  this.#linkFile(blob.sourcePath, temporaryPath);
@@ -17287,7 +17383,7 @@ var LocalPlanV2ArtifactPublisher = class {
17287
17383
  );
17288
17384
  }
17289
17385
  }
17290
- writeFileSync9(join36(this.temporaryDir, "plan.json"), manifestBytes, "utf-8");
17386
+ writeFileSync9(join37(this.temporaryDir, "plan.json"), manifestBytes, "utf-8");
17291
17387
  renameWithRetry(this.temporaryDir, this.destinationDir);
17292
17388
  this.#committed = true;
17293
17389
  }
@@ -17332,7 +17428,7 @@ function listFiles(root) {
17332
17428
  const rootResolved = resolve8(root);
17333
17429
  function walk(dir) {
17334
17430
  for (const entry of readdirSync9(dir, { withFileTypes: true })) {
17335
- const absolutePath = join37(dir, entry.name);
17431
+ const absolutePath = join38(dir, entry.name);
17336
17432
  if (entry.isDirectory()) {
17337
17433
  walk(absolutePath);
17338
17434
  } else if (entry.isFile()) {
@@ -17359,13 +17455,13 @@ function assertValidExtractionCacheCompleteSentinel(path) {
17359
17455
  }
17360
17456
  }
17361
17457
  function validateExtractionCacheCompleteSentinels(executionPlanDir) {
17362
- const videoRoot = join37(executionPlanDir, "video-frames");
17458
+ const videoRoot = join38(executionPlanDir, "video-frames");
17363
17459
  if (!existsSync24(videoRoot)) return;
17364
17460
  for (const videoEntry of readdirSync9(videoRoot, { withFileTypes: true })) {
17365
17461
  if (!videoEntry.isDirectory()) continue;
17366
- const videoDir = join37(videoRoot, videoEntry.name);
17462
+ const videoDir = join38(videoRoot, videoEntry.name);
17367
17463
  if (readdirSync9(videoDir).includes(EXTRACTION_CACHE_COMPLETE_SENTINEL)) {
17368
- const sentinelPath = join37(videoDir, EXTRACTION_CACHE_COMPLETE_SENTINEL);
17464
+ const sentinelPath = join38(videoDir, EXTRACTION_CACHE_COMPLETE_SENTINEL);
17369
17465
  assertValidExtractionCacheCompleteSentinel(sentinelPath);
17370
17466
  }
17371
17467
  }
@@ -17412,7 +17508,7 @@ function listVideoFramePaths(executionPlanDir, videos) {
17412
17508
  if (video.deferredRange) {
17413
17509
  const framePaths2 = /* @__PURE__ */ new Map();
17414
17510
  for (let index = 0; index < video.totalFrames; index++) {
17415
- framePaths2.set(index, join37(outputDir, String(index)));
17511
+ framePaths2.set(index, join38(outputDir, String(index)));
17416
17512
  }
17417
17513
  return { ...video, outputDir, framePaths: framePaths2, ownedByLookup: false };
17418
17514
  }
@@ -17420,7 +17516,7 @@ function listVideoFramePaths(executionPlanDir, videos) {
17420
17516
  const framePaths = /* @__PURE__ */ new Map();
17421
17517
  for (const frameName of frameNames) {
17422
17518
  if (frameName === EXTRACTION_CACHE_COMPLETE_SENTINEL) {
17423
- assertValidExtractionCacheCompleteSentinel(join37(outputDir, frameName));
17519
+ assertValidExtractionCacheCompleteSentinel(join38(outputDir, frameName));
17424
17520
  continue;
17425
17521
  }
17426
17522
  const match = /(\d+)(?=\.[^.]+$)/.exec(frameName);
@@ -17439,7 +17535,7 @@ function listVideoFramePaths(executionPlanDir, videos) {
17439
17535
  `duplicate extracted frame index ${frameIndex} in ${outputDir}`
17440
17536
  );
17441
17537
  }
17442
- framePaths.set(frameIndex, join37(outputDir, frameName));
17538
+ framePaths.set(frameIndex, join38(outputDir, frameName));
17443
17539
  }
17444
17540
  return {
17445
17541
  ...video,
@@ -17460,7 +17556,7 @@ function parsePlanVideosJson2(value) {
17460
17556
  }
17461
17557
  }
17462
17558
  function materializeExtractedVideoDirectories(planDir) {
17463
- const videosPath = join37(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
17559
+ const videosPath = join38(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
17464
17560
  if (!existsSync24(videosPath)) return;
17465
17561
  const videos = parsePlanVideosJson2(readJsonFile(videosPath, PLAN_VIDEOS_META_RELATIVE_PATH));
17466
17562
  for (const video of videos.extracted) {
@@ -17494,13 +17590,13 @@ function parseChunkSlices(value) {
17494
17590
  });
17495
17591
  }
17496
17592
  function buildVideoChunkDependencies(executionPlanDir, dimensions) {
17497
- const videoRoot = join37(executionPlanDir, "video-frames");
17593
+ const videoRoot = join38(executionPlanDir, "video-frames");
17498
17594
  const hasExtractedFrames = existsSync24(videoRoot) && listFiles(videoRoot).length > 0;
17499
- const videosPath = join37(executionPlanDir, PLAN_VIDEOS_META_RELATIVE_PATH);
17595
+ const videosPath = join38(executionPlanDir, PLAN_VIDEOS_META_RELATIVE_PATH);
17500
17596
  if (!existsSync24(videosPath)) {
17501
17597
  return hasExtractedFrames ? { mode: "full-source-pack", dependencies: null } : { mode: "exact-rendered-frames", dependencies: /* @__PURE__ */ new Map() };
17502
17598
  }
17503
- const chunksPath = join37(executionPlanDir, "meta", "chunks.json");
17599
+ const chunksPath = join38(executionPlanDir, "meta", "chunks.json");
17504
17600
  const videos = readJsonFile(videosPath, PLAN_VIDEOS_META_RELATIVE_PATH);
17505
17601
  const chunks = readJsonFile(chunksPath, "meta/chunks.json");
17506
17602
  const parsedVideos = parsePlanVideosJson2(videos);
@@ -17556,8 +17652,8 @@ function computeManifestHash(manifest) {
17556
17652
  function writeBlob(sourcePath, destinationPath) {
17557
17653
  if (existsSync24(destinationPath)) return;
17558
17654
  mkdirSync14(dirname14(destinationPath), { recursive: true });
17559
- const temporaryDir = mkdtempSync6(join37(dirname14(destinationPath), ".plan-v2-blob-"));
17560
- const temporaryPath = join37(temporaryDir, "blob");
17655
+ const temporaryDir = mkdtempSync6(join38(dirname14(destinationPath), ".plan-v2-blob-"));
17656
+ const temporaryPath = join38(temporaryDir, "blob");
17561
17657
  try {
17562
17658
  copyFileSync6(sourcePath, temporaryPath);
17563
17659
  renameWithRetry(temporaryPath, destinationPath);
@@ -17593,7 +17689,7 @@ async function putTasks(tasks) {
17593
17689
  if (failure) throw failure.reason;
17594
17690
  }
17595
17691
  function buildPlanV2Publication(executionPlanDir, digests) {
17596
- const executionPlanPath = join37(executionPlanDir, "plan.json");
17692
+ const executionPlanPath = join38(executionPlanDir, "plan.json");
17597
17693
  if (!existsSync24(executionPlanPath)) {
17598
17694
  throw new PlanV2IntegrityError(`execution plan is missing plan.json: ${executionPlanPath}`);
17599
17695
  }
@@ -17621,7 +17717,7 @@ function buildPlanV2Publication(executionPlanDir, digests) {
17621
17717
  }
17622
17718
  validateExtractionCacheCompleteSentinels(executionPlanDir);
17623
17719
  const videoDependencyPlan = buildVideoChunkDependencies(executionPlanDir, dimensions);
17624
- const encoder = readJsonFile(join37(executionPlanDir, "meta", "encoder.json"), "meta/encoder.json");
17720
+ const encoder = readJsonFile(join38(executionPlanDir, "meta", "encoder.json"), "meta/encoder.json");
17625
17721
  const files = listFiles(executionPlanDir);
17626
17722
  const chunkAudio = !isRecord3(encoder) || encoder.chunksCarryAudio !== true ? "none" : files.some((file) => chunkAudioSliceTarget(file.path) !== null) ? "sliced" : "whole";
17627
17723
  for (const file of files) {
@@ -17682,13 +17778,13 @@ function createPlanV2FromExecutionPlan(executionPlanDir, planV2Dir) {
17682
17778
  throw new PlanV2IntegrityError("a local plan v2 directory cannot reference remote files");
17683
17779
  }
17684
17780
  mkdirSync14(dirname14(planV2Dir), { recursive: true });
17685
- const tempDir = mkdtempSync6(join37(dirname14(planV2Dir), ".plan-v2-build-"));
17781
+ const tempDir = mkdtempSync6(join38(dirname14(planV2Dir), ".plan-v2-build-"));
17686
17782
  try {
17687
17783
  for (const blob of publication.blobs) {
17688
17784
  writeBlob(blob.sourcePath, planV2BlobPath(tempDir, blob.sha256));
17689
17785
  }
17690
17786
  writeFileSync10(
17691
- join37(tempDir, "plan.json"),
17787
+ join38(tempDir, "plan.json"),
17692
17788
  canonicalJsonStringify(publication.manifest),
17693
17789
  "utf-8"
17694
17790
  );
@@ -17729,7 +17825,7 @@ async function publishExecutionPlan(executionPlanDir, publisher, { digests, log
17729
17825
  }
17730
17826
  }
17731
17827
  async function planV2WithPublisher(projectDir, config, publisher, options = {}) {
17732
- const stagingRoot = mkdtempSync6(join37(options.stagingParentDir ?? tmpdir3(), ".execution-plan-"));
17828
+ const stagingRoot = mkdtempSync6(join38(options.stagingParentDir ?? tmpdir3(), ".execution-plan-"));
17733
17829
  const digests = /* @__PURE__ */ new Map();
17734
17830
  try {
17735
17831
  await buildLocalExecutionPlan(projectDir, config, stagingRoot, {
@@ -17740,7 +17836,7 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
17740
17836
  // artifactTargets ships every compiled/ file to all chunks, so each is in the manifest.
17741
17837
  whileAudioMixes: () => putBlobs(
17742
17838
  publisher,
17743
- listFiles(join37(stagingRoot, "compiled")).map(
17839
+ listFiles(join38(stagingRoot, "compiled")).map(
17744
17840
  (file) => publishBlobFor(file.absolutePath, digests)
17745
17841
  )
17746
17842
  ),
@@ -17770,9 +17866,14 @@ async function planV2(projectDir, config, planV2Dir) {
17770
17866
  return resultFromManifest(planV2Dir, manifest);
17771
17867
  }
17772
17868
  function resultFromManifest(planV2Dir, manifest) {
17869
+ const artifact = manifest.artifacts.find((entry) => entry.path === "plan.json");
17870
+ const executionPlan = artifact ? readJsonFile(verifyBlob(planV2Dir, artifact), "execution plan.json") : null;
17773
17871
  return {
17872
+ ...referenceBackgroundResult(
17873
+ isRecord3(executionPlan) ? executionPlan[REFERENCE_BACKGROUND_FIELD] : void 0
17874
+ ),
17774
17875
  planDir: planV2Dir,
17775
- manifestPath: join37(planV2Dir, "plan.json"),
17876
+ manifestPath: join38(planV2Dir, "plan.json"),
17776
17877
  planProtocol: PLAN_PROTOCOL_V2,
17777
17878
  planHash: manifest.planHash,
17778
17879
  sourcePlanV1Hash: getPlanV2ExecutionPlanHash(manifest),
@@ -17908,7 +18009,7 @@ function parsePlanV2Manifest(value) {
17908
18009
  return parsed;
17909
18010
  }
17910
18011
  function readPlanV2Manifest(planV2Dir) {
17911
- const manifestPath = join37(planV2Dir, "plan.json");
18012
+ const manifestPath = join38(planV2Dir, "plan.json");
17912
18013
  if (!existsSync24(manifestPath)) {
17913
18014
  throw new PlanV2IntegrityError(`missing v2 manifest: ${manifestPath}`);
17914
18015
  }
@@ -17954,16 +18055,16 @@ function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}
17954
18055
  sourcePath: verifyBlob(planV2Dir, artifact)
17955
18056
  }));
17956
18057
  mkdirSync14(dirname14(destinationDir), { recursive: true });
17957
- const tempDir = mkdtempSync6(join37(dirname14(destinationDir), ".plan-v2-materialize-"));
18058
+ const tempDir = mkdtempSync6(join38(dirname14(destinationDir), ".plan-v2-materialize-"));
17958
18059
  try {
17959
18060
  for (const { artifact, sourcePath } of verified) {
17960
- const destinationPath = join37(tempDir, ...artifact.path.split("/"));
18061
+ const destinationPath = join38(tempDir, ...artifact.path.split("/"));
17961
18062
  mkdirSync14(dirname14(destinationPath), { recursive: true });
17962
18063
  copyFileSync6(sourcePath, destinationPath);
17963
18064
  }
17964
18065
  if (target.role === "chunk") materializeExtractedVideoDirectories(tempDir);
17965
18066
  writeFileSync10(
17966
- join37(tempDir, PLAN_V2_MATERIALIZATION_MARKER),
18067
+ join38(tempDir, PLAN_V2_MATERIALIZATION_MARKER),
17967
18068
  canonicalJsonStringify({
17968
18069
  manifest,
17969
18070
  target,
@@ -17986,7 +18087,7 @@ function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}
17986
18087
  // Join the artifact's OWN name, not the current constant: a plan written
17987
18088
  // before the container change carries the legacy name, and materializing it
17988
18089
  // under the new one would point at a file that was never written.
17989
- audioPath: target.role === "assembler" ? audioArtifact ? join37(destinationDir, audioArtifact.path) : null : null
18090
+ audioPath: target.role === "assembler" ? audioArtifact ? join38(destinationDir, audioArtifact.path) : null : null
17990
18091
  };
17991
18092
  }
17992
18093
  function assertRemoteSources(remoteSources, artifacts) {
@@ -18005,7 +18106,7 @@ function validatePlanV2MaterializedTarget(planDir, expectedTarget) {
18005
18106
  return readValidatedPlanV2Materialization(planDir, expectedTarget)?.manifest ?? null;
18006
18107
  }
18007
18108
  function readValidatedPlanV2Materialization(planDir, expectedTarget) {
18008
- const markerPath = join37(planDir, PLAN_V2_MATERIALIZATION_MARKER);
18109
+ const markerPath = join38(planDir, PLAN_V2_MATERIALIZATION_MARKER);
18009
18110
  if (!existsSync24(markerPath)) return null;
18010
18111
  const marker = readJsonFile(markerPath, "materialization marker");
18011
18112
  if (!isRecord3(marker) || !isRecord3(marker.manifest) || !isRecord3(marker.target)) {
@@ -18023,7 +18124,7 @@ function readValidatedPlanV2Materialization(planDir, expectedTarget) {
18023
18124
  assertRemoteSources(remoteSources, required);
18024
18125
  for (const artifact of required) {
18025
18126
  if (Object.hasOwn(remoteSources, artifact.path)) continue;
18026
- const path = join37(planDir, ...artifact.path.split("/"));
18127
+ const path = join38(planDir, ...artifact.path.split("/"));
18027
18128
  if (!existsSync24(path) || statSync8(path).size !== artifact.sizeBytes) {
18028
18129
  throw new PlanV2IntegrityError(
18029
18130
  `materialized artifact missing or truncated: ${artifact.path}`
@@ -18143,7 +18244,7 @@ function hashChunkOutput(outputPath, kind) {
18143
18244
  if (kind === "file") return sha256Hex(readFileSync10(outputPath));
18144
18245
  const entries = readdirSync10(outputPath).filter((name) => /\.(png|jpg|jpeg)$/i.test(name)).sort();
18145
18246
  const lines = entries.map(
18146
- (name) => `${name}\0${sha256Hex(readFileSync10(join38(outputPath, name)))}`
18247
+ (name) => `${name}\0${sha256Hex(readFileSync10(join39(outputPath, name)))}`
18147
18248
  );
18148
18249
  return sha256Hex(lines.join("\0"));
18149
18250
  }
@@ -18160,9 +18261,9 @@ function resolveLockedVp9CpuUsed(lockedEncoder) {
18160
18261
  async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18161
18262
  const start = Date.now();
18162
18263
  const log = defaultLogger;
18163
- const planJsonPath = join38(planDir, "plan.json");
18164
- const encoderJsonPath = join38(planDir, "meta", "encoder.json");
18165
- const chunksJsonPath = join38(planDir, "meta", "chunks.json");
18264
+ const planJsonPath = join39(planDir, "plan.json");
18265
+ const encoderJsonPath = join39(planDir, "meta", "encoder.json");
18266
+ const chunksJsonPath = join39(planDir, "meta", "chunks.json");
18166
18267
  if (!existsSync25(planJsonPath)) {
18167
18268
  throw new RenderChunkValidationError(
18168
18269
  MISSING_PLAN_ARTIFACT,
@@ -18188,7 +18289,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18188
18289
  }
18189
18290
  const encoder = JSON.parse(readFileSync10(encoderJsonPath, "utf-8"));
18190
18291
  const chunks = JSON.parse(readFileSync10(chunksJsonPath, "utf-8"));
18191
- const videosJsonPath = join38(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
18292
+ const videosJsonPath = join39(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
18192
18293
  let planVideos = null;
18193
18294
  if (existsSync25(videosJsonPath)) {
18194
18295
  try {
@@ -18220,7 +18321,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18220
18321
  }
18221
18322
  const range = resolveChunkFrameRange(slice, chunkIndex, options?.frameRange);
18222
18323
  const framesInChunk = range.endFrame - range.startFrame;
18223
- const compiledDir = join38(planDir, "compiled");
18324
+ const compiledDir = join39(planDir, "compiled");
18224
18325
  if (!existsSync25(compiledDir)) {
18225
18326
  throw new RenderChunkValidationError(
18226
18327
  MISSING_PLAN_ARTIFACT,
@@ -18278,7 +18379,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18278
18379
  };
18279
18380
  const workDir = `${outputChunkPath}.work.${process.pid}.${randomBytes(4).toString("hex")}`;
18280
18381
  mkdirSync15(workDir, { recursive: true });
18281
- const framesDir = join38(workDir, "captured-frames");
18382
+ const framesDir = join39(workDir, "captured-frames");
18282
18383
  mkdirSync15(framesDir, { recursive: true });
18283
18384
  const videoFramesDir = `${workDir}.video-frames`;
18284
18385
  const chunkFrameNumbers = Array.from({ length: framesInChunk }, (_, i) => range.startFrame + i);
@@ -18303,7 +18404,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18303
18404
  dimensions: plan2.dimensions,
18304
18405
  encoder,
18305
18406
  videoCount: planVideos?.videos.length ?? 0,
18306
- html: readFileSync10(join38(compiledDir, "index.html"), "utf-8"),
18407
+ html: readFileSync10(join39(compiledDir, "index.html"), "utf-8"),
18307
18408
  // The plan ships a deferred source only to chunks that show it; don't wait on the rest.
18308
18409
  skipReadinessVideoIds: deferredVideos.filter(
18309
18410
  (video) => !shownFrames.get(video.videoId)?.size || remoteVideoIds.has(video.videoId)
@@ -18473,7 +18574,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18473
18574
  if (isPngSequence) {
18474
18575
  if (!existsSync25(outputChunkPath)) mkdirSync15(outputChunkPath, { recursive: true });
18475
18576
  } else {
18476
- const outDir = join38(outputChunkPath, "..");
18577
+ const outDir = join39(outputChunkPath, "..");
18477
18578
  if (!existsSync25(outDir)) mkdirSync15(outDir, { recursive: true });
18478
18579
  }
18479
18580
  const encodeInput = {
@@ -18747,10 +18848,10 @@ async function renderSpan(projectDir, config, span, outputPath) {
18747
18848
  if (config.cfr === true) {
18748
18849
  throw new RenderSpanUnsupportedError("--start/--end cannot be combined with a cfr re-encode.");
18749
18850
  }
18750
- const workDir = mkdtempSync7(join39(tmpdir4(), "hf-render-span-"));
18851
+ const workDir = mkdtempSync7(join40(tmpdir4(), "hf-render-span-"));
18751
18852
  try {
18752
- const planDir = join39(workDir, "plan");
18753
- const partsDir = join39(workDir, "parts");
18853
+ const planDir = join40(workDir, "plan");
18854
+ const partsDir = join40(workDir, "parts");
18754
18855
  mkdirSync16(partsDir, { recursive: true });
18755
18856
  const planned = await plan(
18756
18857
  projectDir,
@@ -18765,7 +18866,7 @@ async function renderSpan(projectDir, config, span, outputPath) {
18765
18866
  planned.totalFrames
18766
18867
  );
18767
18868
  const slices = JSON.parse(
18768
- readFileSync11(join39(planDir, "meta", "chunks.json"), "utf-8")
18869
+ readFileSync11(join40(planDir, "meta", "chunks.json"), "utf-8")
18769
18870
  );
18770
18871
  const parts = [];
18771
18872
  for (const slice of slices) {
@@ -18775,13 +18876,18 @@ async function renderSpan(projectDir, config, span, outputPath) {
18775
18876
  };
18776
18877
  if (range.endFrame <= range.startFrame) continue;
18777
18878
  throwIfAborted(config.abortSignal);
18778
- const part = join39(partsDir, `part-${String(parts.length).padStart(4, "0")}.mp4`);
18879
+ const part = join40(partsDir, `part-${String(parts.length).padStart(4, "0")}.mp4`);
18779
18880
  await renderChunk(planDir, slice.index, part, { frameRange: range });
18780
18881
  parts.push(part);
18781
18882
  }
18782
18883
  throwIfAborted(config.abortSignal);
18783
18884
  await writeStitchedMp4(parts, outputPath);
18784
- return { startFrame, endFrame, framesEncoded: endFrame - startFrame };
18885
+ return {
18886
+ ...referenceBackgroundResult(planned[REFERENCE_BACKGROUND_FIELD]),
18887
+ startFrame,
18888
+ endFrame,
18889
+ framesEncoded: endFrame - startFrame
18890
+ };
18785
18891
  } finally {
18786
18892
  rmSync14(workDir, { recursive: true, force: true });
18787
18893
  }
@@ -19336,7 +19442,7 @@ import {
19336
19442
  rmSync as rmSync15,
19337
19443
  createReadStream as createReadStream5
19338
19444
  } from "fs";
19339
- import { resolve as resolve10, dirname as dirname16, join as join42 } from "path";
19445
+ import { resolve as resolve10, dirname as dirname16, join as join43 } from "path";
19340
19446
  import { tmpdir as tmpdir5 } from "os";
19341
19447
  import { parseArgs } from "util";
19342
19448
  import crypto from "crypto";
@@ -19354,7 +19460,7 @@ import {
19354
19460
  closeSync as closeSync6,
19355
19461
  constants as constants3
19356
19462
  } from "fs";
19357
- import { resolve as resolve9, join as join40, relative as relative7, isAbsolute as isAbsolute4, sep as sep4 } from "path";
19463
+ import { resolve as resolve9, join as join41, relative as relative7, isAbsolute as isAbsolute4, sep as sep4 } from "path";
19358
19464
  function isStringRecord(value) {
19359
19465
  if (!value || typeof value !== "object" || Array.isArray(value)) {
19360
19466
  return false;
@@ -19421,7 +19527,7 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
19421
19527
  }
19422
19528
  }
19423
19529
  return {
19424
- error: `No HTML entry file found in project directory: ${join40(absProjectDir, preferredEntryFile || "index.html")}`
19530
+ error: `No HTML entry file found in project directory: ${join41(absProjectDir, preferredEntryFile || "index.html")}`
19425
19531
  };
19426
19532
  }
19427
19533
  function prepareHyperframeLintBody(body) {
@@ -19467,7 +19573,7 @@ async function runHyperframeLint(prepared) {
19467
19573
  // ../producer/src/services/healthWorker.ts
19468
19574
  import { Worker as Worker2 } from "worker_threads";
19469
19575
  import { fileURLToPath as fileURLToPath6 } from "url";
19470
- import { dirname as dirname15, join as join41 } from "path";
19576
+ import { dirname as dirname15, join as join42 } from "path";
19471
19577
  import { existsSync as existsSync27 } from "fs";
19472
19578
  var DEFAULT_HEALTH_PORT = 9848;
19473
19579
  async function startHealthWorker(options = {}) {
@@ -19543,7 +19649,7 @@ function defaultLogger2() {
19543
19649
  }
19544
19650
  function resolveWorkerEntry2() {
19545
19651
  const here = dirname15(fileURLToPath6(import.meta.url));
19546
- const candidates = [join41(here, "healthWorkerThread.js"), join41(here, "healthWorkerThread.ts")];
19652
+ const candidates = [join42(here, "healthWorkerThread.js"), join42(here, "healthWorkerThread.ts")];
19547
19653
  for (const candidate of candidates) {
19548
19654
  if (existsSync27(candidate)) return candidate;
19549
19655
  }
@@ -19748,8 +19854,8 @@ async function resolveInlineRenderHtml(body) {
19748
19854
  }
19749
19855
  function materializeInlineProject(html, options) {
19750
19856
  const tempRoot = process.env.PRODUCER_TMP_PROJECT_DIR || tmpdir5();
19751
- const tempProjectDir = mkdtempSync8(join42(tempRoot, "producer-project-"));
19752
- writeFileSync12(join42(tempProjectDir, "index.html"), html, "utf-8");
19857
+ const tempProjectDir = mkdtempSync8(join43(tempRoot, "producer-project-"));
19858
+ writeFileSync12(join43(tempProjectDir, "index.html"), html, "utf-8");
19753
19859
  return {
19754
19860
  prepared: {
19755
19861
  input: { projectDir: tempProjectDir, ...options },
@@ -20006,6 +20112,7 @@ function createRenderHandlers(options = {}) {
20006
20112
  outputUrl,
20007
20113
  fileSize,
20008
20114
  durationMs,
20115
+ ...referenceBackgroundResult(job[REFERENCE_BACKGROUND_FIELD]),
20009
20116
  videoDurationSeconds: job.duration ?? null,
20010
20117
  outcome: job.outcome ?? "completed",
20011
20118
  warnings: job.warnings,
@@ -20093,6 +20200,7 @@ function createRenderHandlers(options = {}) {
20093
20200
  outputToken,
20094
20201
  outputUrl,
20095
20202
  fileSize,
20203
+ ...referenceBackgroundResult(job[REFERENCE_BACKGROUND_FIELD]),
20096
20204
  videoDurationSeconds: job.duration ?? null,
20097
20205
  outcome: job.outcome ?? "completed",
20098
20206
  warnings: job.warnings,
@@ -20168,7 +20276,7 @@ function startServer(options = {}) {
20168
20276
  });
20169
20277
  async function shutdown(signal) {
20170
20278
  log.info(`Received ${signal}, shutting down`);
20171
- const { drainBrowserPool } = await import("./src-VWCIVPJX.js");
20279
+ const { drainBrowserPool } = await import("./src-GLO4X3WA.js");
20172
20280
  await drainBrowserPool().catch(() => {
20173
20281
  });
20174
20282
  const handle = await Promise.race([
@@ -20206,7 +20314,7 @@ if (isPublicServerEntry) {
20206
20314
  // ../producer/src/services/distributed/planV2Execution.ts
20207
20315
  import { mkdtempSync as mkdtempSync10, rmSync as rmSync17 } from "fs";
20208
20316
  import { tmpdir as tmpdir6 } from "os";
20209
- import { join as join44 } from "path";
20317
+ import { join as join45 } from "path";
20210
20318
 
20211
20319
  // ../producer/src/services/distributed/assemble.ts
20212
20320
  import {
@@ -20220,7 +20328,7 @@ import {
20220
20328
  statSync as statSync11,
20221
20329
  writeFileSync as writeFileSync13
20222
20330
  } from "fs";
20223
- import { dirname as dirname17, join as join43 } from "path";
20331
+ import { dirname as dirname17, join as join44 } from "path";
20224
20332
  function cfrRateControlArgs(locked) {
20225
20333
  const preset = getEncoderPreset(locked.quality ?? "standard", "mp4");
20226
20334
  if (locked.crf == null && locked.bitrate) {
@@ -20235,12 +20343,16 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
20235
20343
  const plan2 = readAssemblePlan(planDir, chunkOutputs);
20236
20344
  const chunkPaths = chunkOutputs.flat();
20237
20345
  if (plan2.dimensions.format === "png-sequence") {
20238
- return mergePngFrameDirs(chunkPaths, outputPath, plan2.totalFrames, audioPath, start);
20346
+ return {
20347
+ ...mergePngFrameDirs(chunkPaths, outputPath, plan2.totalFrames, audioPath, start),
20348
+ ...referenceBackgroundResult(plan2[REFERENCE_BACKGROUND_FIELD])
20349
+ };
20239
20350
  }
20240
20351
  if (chunksAreStitchedMp4(planDir, cfr)) {
20241
20352
  const separateAudio = stitchesSeparateAudio(planDir) && audioPath !== null;
20242
20353
  await writeStitchedMp4(chunkPaths, outputPath, separateAudio ? audioPath : void 0);
20243
20354
  return {
20355
+ ...referenceBackgroundResult(plan2[REFERENCE_BACKGROUND_FIELD]),
20244
20356
  outputPath,
20245
20357
  durationMs: Date.now() - start,
20246
20358
  framesEncoded: plan2.totalFrames,
@@ -20272,7 +20384,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
20272
20384
  };
20273
20385
  try {
20274
20386
  const videoSources = cfrEncoder ? [await reencodeCfr(ctx, chunkPaths, cfrEncoder)] : chunkPaths;
20275
- const finalPath = join43(workDir, `output.${format}`);
20387
+ const finalPath = join44(workDir, `output.${format}`);
20276
20388
  const audio = audioPath !== null && existsSync29(audioPath) ? audioPath : null;
20277
20389
  await writeJoined(ctx, videoSources, audio, finalPath);
20278
20390
  renameWithRetry(finalPath, outputPath);
@@ -20293,6 +20405,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
20293
20405
  }
20294
20406
  const fileSize = existsSync29(outputPath) ? statSync11(outputPath).size : 0;
20295
20407
  return {
20408
+ ...referenceBackgroundResult(plan2[REFERENCE_BACKGROUND_FIELD]),
20296
20409
  outputPath,
20297
20410
  durationMs: Date.now() - start,
20298
20411
  framesEncoded: plan2.totalFrames,
@@ -20300,8 +20413,8 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
20300
20413
  };
20301
20414
  }
20302
20415
  function readAssemblePlan(planDir, chunkPaths) {
20303
- const planJsonPath = join43(planDir, "plan.json");
20304
- const chunksJsonPath = join43(planDir, "meta", "chunks.json");
20416
+ const planJsonPath = join44(planDir, "plan.json");
20417
+ const chunksJsonPath = join44(planDir, "meta", "chunks.json");
20305
20418
  if (!existsSync29(planJsonPath)) {
20306
20419
  throw new Error(`[assemble] planDir missing plan.json: ${planJsonPath}`);
20307
20420
  }
@@ -20352,7 +20465,7 @@ function cfrEncodeArgs(inputArgs, encoder, fpsArg) {
20352
20465
  return args;
20353
20466
  }
20354
20467
  async function reencodeCfr(ctx, chunkPaths, encoder) {
20355
- const cfrOutputPath = join43(ctx.workDir, `cfr.${ctx.format}`);
20468
+ const cfrOutputPath = join44(ctx.workDir, `cfr.${ctx.format}`);
20356
20469
  const cfrArgs = cfrEncodeArgs(videoInputArgs(ctx, chunkPaths), encoder, ctx.fpsArg);
20357
20470
  appendRenderProvenanceArgs(cfrArgs, cfrOutputPath);
20358
20471
  cfrArgs.push("-y", cfrOutputPath);
@@ -20379,7 +20492,7 @@ async function writeJoined(ctx, videoSources, audioPath, finalPath) {
20379
20492
  );
20380
20493
  return;
20381
20494
  }
20382
- const paddedAudioPath = join43(ctx.workDir, "audio-padded.m4a");
20495
+ const paddedAudioPath = join44(ctx.workDir, "audio-padded.m4a");
20383
20496
  const padTrimResult = await ctx.timed(
20384
20497
  "audioMs",
20385
20498
  () => padOrTrimAudioToVideoFrameCount({
@@ -20419,7 +20532,7 @@ async function writeJoined(ctx, videoSources, audioPath, finalPath) {
20419
20532
  }
20420
20533
  }
20421
20534
  function concatDemuxerInput(chunkPaths, workDir, fpsArg) {
20422
- const listPath = join43(workDir, "concat-list.txt");
20535
+ const listPath = join44(workDir, "concat-list.txt");
20423
20536
  const body = chunkPaths.map((path) => `file '${path.replace(/'/g, "'\\''")}'`).join("\n");
20424
20537
  writeFileSync13(listPath, `${body}
20425
20538
  `, "utf-8");
@@ -20457,11 +20570,11 @@ function stitchesSeparateAudio(planDir) {
20457
20570
  return lockedAudio(planDir).separateAudio === true;
20458
20571
  }
20459
20572
  function planFormat(planDir) {
20460
- const plan2 = JSON.parse(readFileSync13(join43(planDir, "plan.json"), "utf-8"));
20573
+ const plan2 = JSON.parse(readFileSync13(join44(planDir, "plan.json"), "utf-8"));
20461
20574
  return plan2.dimensions.format;
20462
20575
  }
20463
20576
  function lockedAudio(planDir) {
20464
- const encoderJsonPath = join43(planDir, "meta", "encoder.json");
20577
+ const encoderJsonPath = join44(planDir, "meta", "encoder.json");
20465
20578
  if (!existsSync29(encoderJsonPath)) return {};
20466
20579
  return JSON.parse(readFileSync13(encoderJsonPath, "utf-8"));
20467
20580
  }
@@ -20471,7 +20584,7 @@ function readCfrEncoder(planDir, format) {
20471
20584
  `[assemble] cfr=true is only supported for format="mp4" (got "${format}"). Stream-copy paths for webm and mov already produce exact avg_frame_rate; cfr re-encode is not needed.`
20472
20585
  );
20473
20586
  }
20474
- const encoderJsonPath = join43(planDir, "meta", "encoder.json");
20587
+ const encoderJsonPath = join44(planDir, "meta", "encoder.json");
20475
20588
  if (!existsSync29(encoderJsonPath)) {
20476
20589
  throw new Error(`[assemble] planDir missing meta/encoder.json: ${encoderJsonPath}`);
20477
20590
  }
@@ -20498,8 +20611,8 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
20498
20611
  throw new Error(`[assemble] png-sequence chunk has no frames: ${chunkDir}`);
20499
20612
  }
20500
20613
  for (const frame of frames) {
20501
- const dst = join43(outputPath, formatExportFrameName(globalIdx, "png"));
20502
- cpSync3(join43(chunkDir, frame), dst);
20614
+ const dst = join44(outputPath, formatExportFrameName(globalIdx, "png"));
20615
+ cpSync3(join44(chunkDir, frame), dst);
20503
20616
  globalIdx += 1;
20504
20617
  }
20505
20618
  }
@@ -20509,13 +20622,13 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
20509
20622
  );
20510
20623
  }
20511
20624
  if (audioPath !== null && existsSync29(audioPath)) {
20512
- const sidecar = join43(outputPath, MIXED_AUDIO_FILENAME);
20625
+ const sidecar = join44(outputPath, MIXED_AUDIO_FILENAME);
20513
20626
  cpSync3(audioPath, sidecar);
20514
20627
  }
20515
20628
  let fileSize = 0;
20516
20629
  for (const name of readdirSync11(outputPath)) {
20517
20630
  try {
20518
- fileSize += statSync11(join43(outputPath, name)).size;
20631
+ fileSize += statSync11(join44(outputPath, name)).size;
20519
20632
  } catch {
20520
20633
  }
20521
20634
  }
@@ -20529,8 +20642,8 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
20529
20642
 
20530
20643
  // ../producer/src/services/distributed/planV2Execution.ts
20531
20644
  async function renderChunkV2(planV2Dir, chunkIndex, outputChunkPath, options) {
20532
- const workRoot = mkdtempSync10(join44(tmpdir6(), "hf-plan-v2-chunk-"));
20533
- const materializedPlanDir = join44(workRoot, "plan");
20645
+ const workRoot = mkdtempSync10(join45(tmpdir6(), "hf-plan-v2-chunk-"));
20646
+ const materializedPlanDir = join45(workRoot, "plan");
20534
20647
  try {
20535
20648
  materializePlanV2Target(planV2Dir, { role: "chunk", chunkIndex }, materializedPlanDir);
20536
20649
  return await renderChunk(materializedPlanDir, chunkIndex, outputChunkPath, options);
@@ -20539,8 +20652,8 @@ async function renderChunkV2(planV2Dir, chunkIndex, outputChunkPath, options) {
20539
20652
  }
20540
20653
  }
20541
20654
  async function assembleV2(planV2Dir, chunkPaths, outputPath, options) {
20542
- const workRoot = mkdtempSync10(join44(tmpdir6(), "hf-plan-v2-assembler-"));
20543
- const materializedPlanDir = join44(workRoot, "plan");
20655
+ const workRoot = mkdtempSync10(join45(tmpdir6(), "hf-plan-v2-assembler-"));
20656
+ const materializedPlanDir = join45(workRoot, "plan");
20544
20657
  try {
20545
20658
  const materialized = materializePlanV2Target(
20546
20659
  planV2Dir,
@@ -20562,7 +20675,7 @@ async function assembleV2(planV2Dir, chunkPaths, outputPath, options) {
20562
20675
  // ../producer/src/services/distributed/projectHash.ts
20563
20676
  import { closeSync as closeSync7, openSync as openSync7, readdirSync as readdirSync12, readSync as readSync5, realpathSync as realpathSync2, statSync as statSync12 } from "fs";
20564
20677
  import { createHash as createHash8 } from "crypto";
20565
- import { join as join45 } from "path";
20678
+ import { join as join46 } from "path";
20566
20679
  var READ_CHUNK_BYTES = 256 * 1024;
20567
20680
 
20568
20681
  // ../producer/src/services/distributed/audioSidecar.ts