hyperframes 0.9.14 → 0.9.16

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 (274) hide show
  1. package/README.md +9 -0
  2. package/dist/{add-JNKCTPWJ.js → add-GEGI5ERI.js} +15 -14
  3. package/dist/{agentPromptGenerator-DSF7AEVE.js → agentPromptGenerator-VV7UQDGL.js} +7 -8
  4. package/dist/{animatedGifPrep-BIEUMGB3.js → animatedGifPrep-JTPCKJ44.js} +7 -8
  5. package/dist/api.js +36 -36
  6. package/dist/{appHistory-BCWH6XYH.js → appHistory-WXJ4STHX.js} +2 -1
  7. package/dist/{asset-V6JAJRCF.js → asset-ZTXZ6HGB.js} +2 -2
  8. package/dist/{assetCataloger-SCLH2WAC.js → assetCataloger-ATGUE5IY.js} +9 -10
  9. package/dist/{audio-JX76VDCY.js → audio-5SBZBNSP.js} +19 -19
  10. package/dist/{auth-TRE4ASYT.js → auth-NDUIJ4HS.js} +4 -4
  11. package/dist/{autoUpdate-D5UUCIOR.js → autoUpdate-PZTBUAA5.js} +25 -16
  12. package/dist/{avatars-26EUVWXR.js → avatars-YY7FU76E.js} +16 -16
  13. package/dist/{backgroundChecks-RM5GWZIW.js → backgroundChecks-6KERI5QL.js} +5 -4
  14. package/dist/backgroundChecksWorker.js +5 -4
  15. package/dist/{batchRender-5ZEQ6U4N.js → batchRender-L3IIY2FT.js} +5 -4
  16. package/dist/{beats-3YW7MGZY.js → beats-UBUJBSVD.js} +11 -11
  17. package/dist/{benchmark-MYQTWUO3.js → benchmark-YJ2U5KE3.js} +11 -11
  18. package/dist/{billing-2X3JNNM4.js → billing-YN35KTEH.js} +79 -36
  19. package/dist/{browser-CQSY36GL.js → browser-NRDSXRX7.js} +8 -7
  20. package/dist/{bundleWithLocalizedFonts-Z6KCDBP2.js → bundleWithLocalizedFonts-5T25BRZU.js} +1 -1
  21. package/dist/{capture-IK5GIWOS.js → capture-7K7VWXBQ.js} +17 -18
  22. package/dist/{capture-NWBNWBIX.js → capture-MP46JHB7.js} +3 -3
  23. package/dist/{captureCompositionFrame-KR3PELMO.js → captureCompositionFrame-4VZCJGGD.js} +13 -14
  24. package/dist/{catalog-2Q73F42B.js → catalog-32CQF7IT.js} +23 -21
  25. package/dist/{catch-up-JP3FL3FX.js → catch-up-IVBUCPZM.js} +9 -7
  26. package/dist/{check-UIMXDUPK.js → check-U5PPKHG5.js} +43 -43
  27. package/dist/{checkAudio-CSX4G35O.js → checkAudio-ZCRRON4E.js} +10 -11
  28. package/dist/{checkBrowser-MTCJVJYJ.js → checkBrowser-MS5NKDXR.js} +36 -36
  29. package/dist/{chunk-RX2PFZ5W.js → chunk-344RFO72.js} +2 -2
  30. package/dist/{chunk-US4BCRYB.js → chunk-3L2POG2J.js} +23 -1
  31. package/dist/{chunk-HZSAOL5O.js → chunk-4ECLIUTB.js} +2 -2
  32. package/dist/{chunk-WXYV47JX.js → chunk-4FHTWYDZ.js} +1 -1
  33. package/dist/{chunk-TESXTEV5.js → chunk-5IVECOVN.js} +2 -2
  34. package/dist/{chunk-DSIGJUNY.js → chunk-5L2CII4L.js} +1 -1
  35. package/dist/{chunk-I5PI43EI.js → chunk-65XOIIBM.js} +1 -1
  36. package/dist/{chunk-D3FZQL5R.js → chunk-6H5KN7CJ.js} +5 -5
  37. package/dist/{chunk-U22NZEQV.js → chunk-6H5NILM5.js} +1 -1
  38. package/dist/{chunk-GY7D2OEQ.js → chunk-6M3TQUDF.js} +9 -3
  39. package/dist/{chunk-X5FSMQEJ.js → chunk-6RPKPL22.js} +1 -1
  40. package/dist/{chunk-B6C33MNL.js → chunk-72PVZ2A4.js} +2 -2
  41. package/dist/{chunk-SQC4CTD2.js → chunk-75PTCQAO.js} +1 -1
  42. package/dist/{chunk-7YCF2F5M.js → chunk-77E2UIIR.js} +1 -1
  43. package/dist/{chunk-DX4OFRBN.js → chunk-A4OX3TI6.js} +2 -2
  44. package/dist/{chunk-PYPW33ET.js → chunk-AD2T3VAJ.js} +2 -2
  45. package/dist/{chunk-4NE6CBMW.js → chunk-AGQNRDYJ.js} +2 -2
  46. package/dist/{chunk-CIWX5UKC.js → chunk-ALQAHCK5.js} +14 -5
  47. package/dist/{chunk-UWZ2OIWM.js → chunk-AZO2YY3U.js} +1 -1
  48. package/dist/{chunk-FZRTCVU6.js → chunk-B2W2CPXF.js} +2 -2
  49. package/dist/{chunk-4MY6FPX4.js → chunk-BB5CZTGW.js} +1 -1
  50. package/dist/{chunk-W7ITBVJE.js → chunk-BJAESOYP.js} +12 -9
  51. package/dist/{chunk-7NPHPQH5.js → chunk-BSPE37DP.js} +4 -4
  52. package/dist/{chunk-3CXUZSLE.js → chunk-CAD6G75K.js} +2 -2
  53. package/dist/{chunk-CKEOCCMK.js → chunk-CMQZP52Y.js} +22 -18
  54. package/dist/{chunk-PA27AW3Y.js → chunk-DM7WRHB5.js} +1 -1
  55. package/dist/{chunk-IPZ3QGDO.js → chunk-DV7RLE6B.js} +3 -3
  56. package/dist/{chunk-EOCFNE53.js → chunk-ENVFGBRD.js} +1 -1
  57. package/dist/chunk-EXA6R6SW.js +24 -0
  58. package/dist/{chunk-FC2OXEBQ.js → chunk-G4OGVFUJ.js} +1 -1
  59. package/dist/{chunk-ZSAKJRZB.js → chunk-G54QPS3F.js} +5 -5
  60. package/dist/{chunk-YBR4L5JA.js → chunk-GGSTJZQL.js} +3 -3
  61. package/dist/{chunk-XQ26I3PL.js → chunk-GKLZMLX3.js} +4 -2
  62. package/dist/chunk-GR2E54E6.js +31 -0
  63. package/dist/{chunk-6UM5C4R6.js → chunk-HK4AN44J.js} +2 -2
  64. package/dist/{chunk-N7ZKI2CE.js → chunk-IR3JMMFT.js} +55 -4
  65. package/dist/{chunk-5ENBFVPD.js → chunk-IX5QY54Q.js} +2 -2
  66. package/dist/{chunk-SAAJ2O7A.js → chunk-J2I2LTJM.js} +2 -2
  67. package/dist/chunk-J3G5KEPY.js +5035 -0
  68. package/dist/{chunk-BY7PZB6H.js → chunk-J3QW55W5.js} +2 -2
  69. package/dist/{chunk-T32JKZX3.js → chunk-JCIPZMKD.js} +3 -3
  70. package/dist/{chunk-CZ5NNJ6H.js → chunk-JFUXZERX.js} +2 -2
  71. package/dist/{chunk-766MOTIZ.js → chunk-JOQR4AP6.js} +5 -1
  72. package/dist/{chunk-CMPHS5E6.js → chunk-JPODNK2G.js} +2 -2
  73. package/dist/{chunk-AWV4F5TS.js → chunk-JWCMOC7O.js} +3 -3
  74. package/dist/{chunk-2OIONPKY.js → chunk-K2JGJUMR.js} +3 -3
  75. package/dist/{chunk-LZYXYJMX.js → chunk-KWORPYKW.js} +1 -1
  76. package/dist/{chunk-ZFZXGZTX.js → chunk-L24NAUBS.js} +1 -1
  77. package/dist/{chunk-HVIQQCLM.js → chunk-L4ZMCB52.js} +29 -18
  78. package/dist/{chunk-35RZMUTX.js → chunk-L6X4ONBM.js} +7 -7
  79. package/dist/{chunk-M34AOUVK.js → chunk-LHRQP7TF.js} +7 -7
  80. package/dist/{chunk-7AVR3VZE.js → chunk-LIUJRACZ.js} +1 -1
  81. package/dist/{chunk-6FOO4QTU.js → chunk-LOKTVSTM.js} +1 -1
  82. package/dist/{chunk-BVAPHHMQ.js → chunk-LP7B3JLC.js} +4 -2
  83. package/dist/{chunk-BNUN7KXZ.js → chunk-M2Y245ET.js} +2 -2
  84. package/dist/{chunk-FQFWGAON.js → chunk-N32TVQYQ.js} +2 -2
  85. package/dist/{chunk-5UT3R43E.js → chunk-NL4RCLQF.js} +1 -1
  86. package/dist/{chunk-ZNHWAGMH.js → chunk-NNXS4VBX.js} +1 -1
  87. package/dist/{chunk-DD47NQJZ.js → chunk-NPDBBMXX.js} +1 -1
  88. package/dist/{chunk-DTU4XJNP.js → chunk-O2B3YNUH.js} +3 -3
  89. package/dist/{chunk-BXCPOMS3.js → chunk-OIJHKOV2.js} +26 -9
  90. package/dist/{chunk-AOJBIFKU.js → chunk-OK3IQC32.js} +1 -1
  91. package/dist/{chunk-2YT656R2.js → chunk-P2AOKCAC.js} +16 -9
  92. package/dist/{chunk-7RFIT26L.js → chunk-P7DCQJ6N.js} +37 -11
  93. package/dist/{chunk-T4FLVFQE.js → chunk-PC662ORN.js} +8 -3
  94. package/dist/{chunk-X46MRJYK.js → chunk-PGM5YXBA.js} +1 -1
  95. package/dist/{chunk-4VYPICIA.js → chunk-PJEXCOCR.js} +12 -4
  96. package/dist/{chunk-ZE2QZHUH.js → chunk-PLVIN7X6.js} +1 -1
  97. package/dist/{chunk-PCY67JUL.js → chunk-PNZD5LZL.js} +29 -16
  98. package/dist/{chunk-K5CK4G75.js → chunk-PWOMLJFV.js} +2 -2
  99. package/dist/{chunk-2L4HQ5K4.js → chunk-PWTWZF3F.js} +1 -1
  100. package/dist/{chunk-MY2W7VWC.js → chunk-Q5M3JAME.js} +14 -14
  101. package/dist/{chunk-RXFKSZN2.js → chunk-QCHPM3C2.js} +1 -1
  102. package/dist/{chunk-6ZRGEVAM.js → chunk-QXGT6KRX.js} +49 -10
  103. package/dist/{chunk-O4ONYFY3.js → chunk-R5LSL2C7.js} +1 -1
  104. package/dist/{chunk-DTZSKJV5.js → chunk-S6AMEEGZ.js} +3 -3
  105. package/dist/{chunk-XMOWL46H.js → chunk-S7UUJ77M.js} +3 -3
  106. package/dist/{chunk-TRK77R5G.js → chunk-SE4WJJ43.js} +1 -1
  107. package/dist/{chunk-FF3VKFCN.js → chunk-SOQNCHO5.js} +245 -201
  108. package/dist/{chunk-2BDSLTEG.js → chunk-SPJX4LQR.js} +11 -11
  109. package/dist/{chunk-DVJUBMS7.js → chunk-SREJU7NR.js} +1 -1
  110. package/dist/{chunk-53UV2EUT.js → chunk-TEEPLD64.js} +2 -2
  111. package/dist/{chunk-B3CSMKM7.js → chunk-TJUJJYJC.js} +1 -1
  112. package/dist/{chunk-VD5G4Y6U.js → chunk-TTEOPEJJ.js} +1 -1
  113. package/dist/{chunk-2NHPNI42.js → chunk-U7LBN2BQ.js} +7 -7
  114. package/dist/{chunk-L24GJQNZ.js → chunk-U7MRV4RM.js} +7 -7
  115. package/dist/{chunk-3B7TDQEW.js → chunk-UGYQBRHG.js} +4 -4
  116. package/dist/{chunk-SSBAETRX.js → chunk-UK5DBUJX.js} +7 -7
  117. package/dist/{chunk-XLPCBE2Q.js → chunk-US2SO6O4.js} +1 -1
  118. package/dist/{chunk-QSEHVJFA.js → chunk-VPBE4USM.js} +25 -20
  119. package/dist/{chunk-NBUPR3ZF.js → chunk-W2BP25U5.js} +1 -1
  120. package/dist/{chunk-7X3UDKJK.js → chunk-WMRHEI4N.js} +2 -2
  121. package/dist/{chunk-TTBCQFRY.js → chunk-WWEFNXQI.js} +2 -2
  122. package/dist/{chunk-WAH2X7FF.js → chunk-XDT2DMH6.js} +2 -2
  123. package/dist/{chunk-ZZBO3GF5.js → chunk-XS27ELRN.js} +3 -3
  124. package/dist/{chunk-O4ZD7TVR.js → chunk-YFHOTWWE.js} +2 -2
  125. package/dist/{chunk-2SYOEZ2Z.js → chunk-YKAK4ALT.js} +3 -3
  126. package/dist/{chunk-NWFIYKEI.js → chunk-YNAKUHSJ.js} +5 -5
  127. package/dist/{chunk-IO3BC2ZK.js → chunk-YQ4LB3XC.js} +2 -2
  128. package/dist/{chunk-MWPPZOY5.js → chunk-ZAD422DC.js} +6 -6
  129. package/dist/{chunk-NLEIM52W.js → chunk-ZEOPRYFK.js} +42 -27
  130. package/dist/{chunk-6OSVMSGV.js → chunk-ZLWRAHBZ.js} +11 -11
  131. package/dist/{chunk-3BHDAXDA.js → chunk-ZO5QD2FA.js} +2 -2
  132. package/dist/{chunk-7LQVFIO4.js → chunk-ZUZPIM6R.js} +8 -5
  133. package/dist/{clean-P3SZCIFU.js → clean-5K2KTH5M.js} +22 -22
  134. package/dist/cli.js +65 -64
  135. package/dist/{cloud-G7YQIVI7.js → cloud-7O2Q7IHJ.js} +4 -4
  136. package/dist/{cloud-RFM3PYTR.js → cloud-D3WTNTF2.js} +5 -4
  137. package/dist/{cloudrun-LXZT5UDK.js → cloudrun-3HRDMWIS.js} +10 -8
  138. package/dist/{compare-BHQHEOMX.js → compare-D22HJO5V.js} +35 -35
  139. package/dist/{compiler-V72QWKGC.js → compiler-RY6IVESI.js} +3 -3
  140. package/dist/{component-6GDCT3GK.js → component-B7V7A5AP.js} +3 -3
  141. package/dist/{compositions-JM6HKCRF.js → compositions-HFBRVNYW.js} +14 -14
  142. package/dist/{contactSheet-RJTY6IIV.js → contactSheet-RWRMLRZI.js} +3 -3
  143. package/dist/{curve-Y7JRXLIJ.js → curve-7PLN35CZ.js} +13 -13
  144. package/dist/{cuts-LDVDQTRL.js → cuts-ZG7TBYVD.js} +14 -14
  145. package/dist/{delete-NCZIKWHU.js → delete-YL4IMJJZ.js} +8 -7
  146. package/dist/{deploy-R4OEJEB6.js → deploy-A6CDKFQZ.js} +2 -2
  147. package/dist/{describeProject-4GKZTYHA.js → describeProject-VZCHDSWT.js} +8 -9
  148. package/dist/{deterministicFonts-HY5GWGQQ.js → deterministicFonts-DQDB47K3.js} +2 -2
  149. package/dist/{diff-C53GPSNU.js → diff-PBVZRS5Z.js} +40 -40
  150. package/dist/{dist-R7SPMKEZ.js → dist-BU547SVG.js} +2 -3
  151. package/dist/{dist-TI44VPHO.js → dist-FPRADDH6.js} +1 -1
  152. package/dist/{dist-TJZSSDR2.js → dist-HRK4GWLN.js} +11 -12
  153. package/dist/docs/examples.md +4 -0
  154. package/dist/docs/motion-blur.md +1 -0
  155. package/dist/{doctor-V4RICWU2.js → doctor-IFTYCM3E.js} +15 -15
  156. package/dist/{energy-S5Z7CGSB.js → energy-ENGAT6Z5.js} +14 -14
  157. package/dist/{events-QKJE5XRN.js → events-A6SBEKVH.js} +5 -4
  158. package/dist/{events-RAJGQK7Y.js → events-AZ5XEDBE.js} +16 -16
  159. package/dist/{events-6HROTYLC.js → events-CMAXQTDX.js} +6 -5
  160. package/dist/{extract-RYGWEC5V.js → extract-IE74J44O.js} +15 -15
  161. package/dist/{face-IWRDW2QO.js → face-JAPTS7VJ.js} +14 -14
  162. package/dist/{feedback-HQTDLLPE.js → feedback-QCFWXJCD.js} +13 -13
  163. package/dist/{ffmpeg-BX334YEK.js → ffmpeg-4YMUUJP7.js} +7 -8
  164. package/dist/{figma-P6U76KGI.js → figma-C36IECKZ.js} +3 -3
  165. package/dist/fontLocalizeCli.js +11 -12
  166. package/dist/{frames-G2WYTVWV.js → frames-ZW26G4UP.js} +16 -16
  167. package/dist/{generate-ZUE2AVOB.js → generate-ZXR73M22.js} +27 -27
  168. package/dist/{get-7C3UC46A.js → get-3KICFW3X.js} +8 -7
  169. package/dist/{gpuPolicy-5ZVYYWXN.js → gpuPolicy-SBYZLOAU.js} +7 -8
  170. package/dist/{grade-compare-IS3OVI7R.js → grade-compare-DCL3OPKF.js} +35 -35
  171. package/dist/{heifImagePrep-FBLLKI3P.js → heifImagePrep-YQWEIVTC.js} +8 -9
  172. package/dist/{help-2MPB27YU.js → help-PUL7OS7X.js} +1 -1
  173. package/dist/{history-Q5EBBFPW.js → history-GPBKC5DE.js} +12 -11
  174. package/dist/hyperframe.manifest.json +1 -1
  175. package/dist/hyperframe.runtime.iife.js +68 -68
  176. package/dist/hyperframes-player.global.js +3 -3
  177. package/dist/{info-TNG5QGFC.js → info-7I6ZVJ64.js} +10 -10
  178. package/dist/{init-UFPBBWC7.js → init-5MCEGVHR.js} +77 -42
  179. package/dist/{ink-UTPJHGZR.js → ink-NLYWOBTK.js} +14 -14
  180. package/dist/{inspect-KXKKPWKX.js → inspect-52COR3TB.js} +34 -34
  181. package/dist/{installer-UTFXM6KP.js → installer-ARMP4WLF.js} +5 -5
  182. package/dist/{keyframes-S6V36BW6.js → keyframes-3UMSTEYW.js} +9 -8
  183. package/dist/{lambda-XWHALRKM.js → lambda-FYHLXH4H.js} +11 -12
  184. package/dist/{layout-SSVKZKCZ.js → layout-QKWAPDPV.js} +34 -34
  185. package/dist/{lint-OQWGRKG5.js → lint-WJCUB2CR.js} +18 -11
  186. package/dist/{lintProject-Z2TEXMY4.js → lintProject-FPLCK7VP.js} +1 -1
  187. package/dist/{list-FYLBMEL7.js → list-4FQ4BDXW.js} +8 -7
  188. package/dist/{localPage-4GSU6N3J.js → localPage-YINL6OV7.js} +7 -8
  189. package/dist/{login-JKFCYHRS.js → login-P74VBTVA.js} +8 -7
  190. package/dist/{logout-YACQMRZN.js → logout-EQ2HJDL4.js} +4 -3
  191. package/dist/{look-WQ2DOKXH.js → look-QCOMYMSD.js} +14 -14
  192. package/dist/{manager-SAXHANEY.js → manager-MKDNQ5KZ.js} +4 -2
  193. package/dist/{manager-F4F4A734.js → manager-V2ZJSF3Q.js} +8 -9
  194. package/dist/{measure-XIFLTAMC.js → measure-7IODZ7VY.js} +11 -11
  195. package/dist/{media-treatment-S3LHQSQQ.js → media-treatment-UJIFSAXV.js} +16 -16
  196. package/dist/{media-use-NFM3ZXCF.js → media-use-4Y5XRY6B.js} +6 -5
  197. package/dist/{models-G4KNLV66.js → models-WPBGJ7K6.js} +11 -12
  198. package/dist/{motionShot-IJGA5CBH.js → motionShot-DZZXLIIT.js} +17 -18
  199. package/dist/{normalize-audio-UP54N6J4.js → normalize-audio-QS2GZ5IT.js} +11 -11
  200. package/dist/{open-TAEKCYDB.js → open-SIWIC52J.js} +16 -15
  201. package/dist/{parakeetRunner-WFA4K7BH.js → parakeetRunner-YUUCCA3S.js} +13 -14
  202. package/dist/{pipeline-SNENB5MZ.js → pipeline-AJKIZGUM.js} +11 -12
  203. package/dist/{play-QTYMY453.js → play-4EF3JLTU.js} +24 -24
  204. package/dist/{preflight-CZUKW3CW.js → preflight-LSDOTWZ5.js} +9 -10
  205. package/dist/{present-KVHQECWG.js → present-AOLHT3YC.js} +20 -20
  206. package/dist/{preview-6U62DM4P.js → preview-WP5VAX3M.js} +28 -26
  207. package/dist/{probe-UCVL3JDC.js → probe-WZ3OWMKG.js} +14 -14
  208. package/dist/{producer-A4RPG3XL.js → producer-C72VSLBR.js} +1 -1
  209. package/dist/{projectConfig-FIW6FPZW.js → projectConfig-LPC7WK4W.js} +7 -7
  210. package/dist/{publication-CCIGDK2X.js → publication-QGBUXKB2.js} +2 -3
  211. package/dist/{publish-VKSABRA4.js → publish-KA2LPVL7.js} +16 -15
  212. package/dist/{refresh-L5C2HPMC.js → refresh-ARZZRKMP.js} +4 -3
  213. package/dist/{remove-background-CJJ54SHA.js → remove-background-MC6HXEAW.js} +12 -13
  214. package/dist/{render-2YY64XPU.js → render-2STR3XR5.js} +62 -43
  215. package/dist/{render-G54RA46B.js → render-IQUQ7EKS.js} +30 -30
  216. package/dist/{render-I2MWX5GH.js → render-RPMLSL7M.js} +5 -6
  217. package/dist/{render-batch-X562GNRH.js → render-batch-2AWWGFNK.js} +5 -6
  218. package/dist/renderSetupWorker.js +3 -3
  219. package/dist/{resolver-GC4ZLQPV.js → resolver-D3Q6LTIO.js} +5 -5
  220. package/dist/{reverse-2KZQ65Y7.js → reverse-62TKSQ7Q.js} +1 -1
  221. package/dist/{run-65M6ECM2.js → run-GQNVIYMD.js} +6 -5
  222. package/dist/{screenshotCapture-HTGXPA7D.js → screenshotCapture-MM5V4H7M.js} +37 -4
  223. package/dist/{sherpa-SLRKS4SR.js → sherpa-ZHAABYE3.js} +12 -13
  224. package/dist/skills/hyperframes/SKILL.md +1 -1
  225. package/dist/skills/hyperframes/references/format.md +1 -1
  226. package/dist/skills/hyperframes/references/path-tracing.md +36 -0
  227. package/dist/skills/hyperframes/references/runtimes.md +1 -1
  228. package/dist/skills/hyperframes/references/storyboard.md +1 -1
  229. package/dist/skills/hyperframes/references/types/3d.md +1 -1
  230. package/dist/skills/media-use/SKILL.md +1 -1
  231. package/dist/skills/media-use/references/media-treatments.md +1 -1
  232. package/dist/skills/media-use/references/setup-providers.md +1 -1
  233. package/dist/skills/media-use/scripts/lib/local-media-search.mjs +6 -2
  234. package/dist/skills/media-use/scripts/lib/local-media-search.test.mjs +23 -0
  235. package/dist/skills/media-use/scripts/lib/telemetry.mjs +6 -1
  236. package/dist/skills/media-use/scripts/lib/telemetry.test.mjs +34 -0
  237. package/dist/{skills-SOXKW42T.js → skills-BYABSOL3.js} +10 -9
  238. package/dist/{skillsUpdateCheck-4RUEBT6B.js → skillsUpdateCheck-FKOS3ME7.js} +5 -4
  239. package/dist/{snapshot-KIWJWZGW.js → snapshot-N5O5VEBT.js} +48 -57
  240. package/dist/{src-DYWF24IK.js → src-272JLFKW.js} +8 -7
  241. package/dist/{src-ABVBEVVK.js → src-O6ITP7WU.js} +10 -11
  242. package/dist/{start-EADJCDST.js → start-K2LGEUB5.js} +43 -28
  243. package/dist/{staticProjectServer-UCHJYCR6.js → staticProjectServer-C7A4W2B4.js} +19 -20
  244. package/dist/{status-E4OUQSHN.js → status-USHH6OD5.js} +19 -16
  245. package/dist/studio/assets/{hyperframes-player-CfYFgHV8.js → hyperframes-player-Bb-Fbf5k.js} +1 -1
  246. package/dist/studio/assets/{index-COfhX0Gz.js → index-BZuKog_A.js} +139 -139
  247. package/dist/studio/assets/{index-RUPGNyct.css → index-CNZk2EFC.css} +1 -1
  248. package/dist/studio/assets/{index-Cj5x3rVD.js → index-Cap2SGKw.js} +1 -1
  249. package/dist/studio/index.html +2 -2
  250. package/dist/{studio-api-RGOTUJXP.js → studio-api-FVBB2MVZ.js} +11 -12
  251. package/dist/{studioSelectionClient-FA6XPVIL.js → studioSelectionClient-W2S3H2VO.js} +3 -1
  252. package/dist/{studioServer-72COILB5.js → studioServer-SFN7YUNV.js} +59 -60
  253. package/dist/{sync-5Z5OQFB3.js → sync-JUDSPP46.js} +14 -14
  254. package/dist/{synthesize-S3FF5KXC.js → synthesize-GX74JPPZ.js} +2 -2
  255. package/dist/{telemetry-OQ2JM37Y.js → telemetry-3DEZK5Q3.js} +6 -5
  256. package/dist/{telemetry-5WZGQCKA.js → telemetry-IXOTZW4E.js} +2 -1
  257. package/dist/{templates-YH5CUHHN.js → templates-3FJRJ6KB.js} +16 -15
  258. package/dist/{timeline-IWU2T2BX.js → timeline-P4CS4INR.js} +40 -25
  259. package/dist/{tokens-F7IBDWGE.js → tokens-EFAVVV56.js} +2 -2
  260. package/dist/{transcribe-YXDOCF32.js → transcribe-JKV42B3Q.js} +29 -29
  261. package/dist/{transcribe-GL3J3JB3.js → transcribe-YTBSMCFG.js} +10 -11
  262. package/dist/{tts-QRQEYR3Q.js → tts-QW53FBKW.js} +3 -3
  263. package/dist/{update-MR5NL567.js → update-6QVOSVBW.js} +11 -10
  264. package/dist/{updateCheck-ONT2ZVAF.js → updateCheck-2FWJ2X62.js} +4 -3
  265. package/dist/{upgrade-BJEGLKQS.js → upgrade-AUHNDKNP.js} +5 -4
  266. package/dist/{urlDownloader-3PV5WURP.js → urlDownloader-6ZSSYTOY.js} +6 -7
  267. package/dist/{validate-GTTWJYCS.js → validate-DKEWYJ3V.js} +28 -28
  268. package/dist/{video-VP6X6YL5.js → video-N6AEYBUW.js} +9 -10
  269. package/dist/{voices-3EO2NQ5Q.js → voices-MT7CM6O5.js} +24 -24
  270. package/dist/warmCheck.js +44 -44
  271. package/dist/warmCheckClient.js +2 -2
  272. package/package.json +1 -1
  273. package/dist/chunk-EAO46VPT.js +0 -5035
  274. package/dist/chunk-MEJH7VEA.js +0 -63
@@ -11,17 +11,17 @@ import {
11
11
  iterateFontFamilyDeclarations,
12
12
  normalizeSystemFontPrimaryFamilies,
13
13
  resolveFontFamilyDeclarationFamilies
14
- } from "./chunk-EOCFNE53.js";
14
+ } from "./chunk-ENVFGBRD.js";
15
15
  import {
16
16
  Semaphore,
17
17
  prepareHeifImageInputs,
18
18
  withMediaProbeSlot
19
- } from "./chunk-TTBCQFRY.js";
19
+ } from "./chunk-WWEFNXQI.js";
20
20
  import {
21
21
  EncoderInterruptedError,
22
22
  encoderFailureError,
23
23
  prepareAnimatedGifInputs
24
- } from "./chunk-CMPHS5E6.js";
24
+ } from "./chunk-JPODNK2G.js";
25
25
  import {
26
26
  openRangeEnd,
27
27
  parseEncoderOptions
@@ -92,6 +92,7 @@ import {
92
92
  deriveBeginFrameProbeTimeTicks,
93
93
  describeFfmpegFailure,
94
94
  detectTransfer,
95
+ displaySize,
95
96
  distributeFrames,
96
97
  distributeFramesInterleaved,
97
98
  downloadToTemp,
@@ -185,7 +186,7 @@ import {
185
186
  videoAudioId,
186
187
  videoStartOnMediaTimeline,
187
188
  writeCapturedFrame
188
- } from "./chunk-6ZRGEVAM.js";
189
+ } from "./chunk-QXGT6KRX.js";
189
190
  import {
190
191
  assignBundledRuntimeCompositionIds,
191
192
  emitMountedModuleScripts,
@@ -197,7 +198,7 @@ import {
197
198
  parsesAsScript,
198
199
  prepareFlattenedInnerRoot,
199
200
  stripSdrPngColourTags
200
- } from "./chunk-53UV2EUT.js";
201
+ } from "./chunk-TEEPLD64.js";
201
202
  import {
202
203
  collectScratchLeftovers,
203
204
  removeScratch,
@@ -211,16 +212,14 @@ import {
211
212
  fpsToFfmpegArg,
212
213
  fpsToNumber,
213
214
  gifClearsAfterLeavingFrameInPlace,
215
+ gsapCdnDist,
214
216
  isDistributedFps,
217
+ normalizeGsapBaseUrl,
215
218
  parseFps,
216
219
  parseVfxChain,
217
220
  resolveAuthoredTimingWindow,
218
221
  toFps
219
- } from "./chunk-N7ZKI2CE.js";
220
- import {
221
- gsapCdnDist,
222
- normalizeGsapBaseUrl
223
- } from "./chunk-MEJH7VEA.js";
222
+ } from "./chunk-IR3JMMFT.js";
224
223
  import {
225
224
  COMPOSITION_SOURCE_URL,
226
225
  HF_COLOR_GRADING_ATTR,
@@ -255,7 +254,7 @@ import {
255
254
  sourceTimeAt,
256
255
  styleElementsFor,
257
256
  timeAtSourceTime
258
- } from "./chunk-EAO46VPT.js";
257
+ } from "./chunk-J3G5KEPY.js";
259
258
  import {
260
259
  TRANSITIONS,
261
260
  convertTransfer,
@@ -271,7 +270,7 @@ import {
271
270
  import {
272
271
  lintHyperframeHtml,
273
272
  resolveReferencedStart
274
- } from "./chunk-CZ5NNJ6H.js";
273
+ } from "./chunk-JFUXZERX.js";
275
274
  import {
276
275
  isUnresolvedAssetPlaceholder,
277
276
  readProjectFile,
@@ -317,12 +316,12 @@ import {
317
316
 
318
317
  // ../producer/src/services/renderOrchestrator.ts
319
318
  import {
320
- existsSync as existsSync17,
319
+ existsSync as existsSync19,
321
320
  mkdirSync as mkdirSync8,
322
321
  readdirSync as readdirSync5,
323
322
  rmSync as rmSync8,
324
323
  statSync as statSync6,
325
- writeFileSync as writeFileSync5,
324
+ writeFileSync as writeFileSync6,
326
325
  copyFileSync as copyFileSync3,
327
326
  appendFileSync
328
327
  } from "fs";
@@ -6002,6 +6001,7 @@ function countAuthoredTimedClips(html) {
6002
6001
  }
6003
6002
 
6004
6003
  // ../producer/src/services/render/stages/compileStage.ts
6004
+ import { existsSync as existsSync10, writeFileSync as writeFileSync4 } from "fs";
6005
6005
  import { join as join14 } from "path";
6006
6006
 
6007
6007
  // ../producer/src/services/htmlCompiler.ts
@@ -6150,7 +6150,7 @@ function placeAudio(audio, window2) {
6150
6150
  }
6151
6151
 
6152
6152
  // ../core/dist/generated/position-edits-render-inline.js
6153
- var POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function x(){return globalThis}function T(e,t){if(typeof window>"u")return;let o=x(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var P=null;function R(e,t){if(P)try{P({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){T("runtime.analytics.site1",o)}}var I="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function _(e){return N(e)&&(e.namespaceURI===I||e.namespaceURI==="http://www.w3.org/2000/svg")}var y="data-hf-edit-base-x",w="data-hf-edit-base-y",m="data-hf-edit-original-translate",k=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},C=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},$=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,E=(e,t)=>$.test(e)&&$.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,O=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,s,a]=C(e);if(r===void 0)return`${t} ${o}`;if(s===void 0)return`${E(r,t)} ${o}`;let i=a===void 0?"":` ${a}`;return`${E(r,t)} ${E(s,o)}${i}`},j=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},V=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},b=new WeakMap;function B(e,t){let o=b.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){R("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=k(e.getAttribute("data-x"))-k(e.getAttribute(y)),s=k(e.getAttribute("data-y"))-k(e.getAttribute(w));e.hasAttribute(m)||e.setAttribute(m,V(e)),o===void 0&&j(e);let a=e.getAttribute(m)??"",i=O(a,`${r}px`,`${s}px`);e.style.setProperty("translate",i),b.set(e,e.style.getPropertyValue("translate"))}function S(e,t){let o=e.querySelectorAll(`[${m}]:not([${y}]):not([${w}])`);for(let a=0;a<o.length;a++){let i=o[a];if(i===void 0||!_(i))continue;let g=i.getAttribute(m)??"";g===""?i.style.removeProperty("translate"):i.style.setProperty("translate",g),i.removeAttribute(m),b.delete(i)}let r=e.querySelectorAll(`[${y}], [${w}]`),s=0;for(let a=0;a<r.length;a++){let i=r[a];i===void 0||!_(i)||(B(i,t),s+=1)}return s}var L="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,F=new WeakMap,H=new WeakMap;function M(e){let t=e,o=()=>{try{S(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[L]),s=n=>{D.add(n);try{Object.defineProperty(n,L,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let l=function(...u){let d=n.apply(this,u);return o(),d};return s(l),l},i=(n,l)=>{let u=F.get(n);if(u?.has(l))return!0;let d=Object.getOwnPropertyDescriptor(n,l);if(d?.configurable===!1){let c=n[l];return typeof c=="function"&&(n[l]=a(c),o()),!1}let p=n[l],f=d?.set;return Object.defineProperty(n,l,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:c=>{p=a(c),f?.call(n,c)}}),p=a(p),u??(u=new Set),u.add(l),F.set(n,u),o(),!0},g=(n,l)=>{let u=H.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let c=t[n];return c?i(c,l):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:c=>{f=c,f&&i(f,l)}}),u??(u=new Set),u.add(n),H.set(t,u)}let p=t[n];return p?i(p,l):!1},h=()=>{let n=g("__hf","seek"),l=g("__player","renderSeek");return n&&l};if(h())return;let v=120,A=t.setInterval(()=>{if(h()){t.clearInterval(A);return}v-=1,v<=0&&t.clearInterval(A)},50)}function W(){document.querySelector(`[${y}], [${w}]`)&&(S(document),M(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",W,{once:!0}):W();})();\n';
6153
+ var POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function x(){return globalThis}function R(e,t){if(typeof window>"u")return;let o=x(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var T=null;function P(e,t){if(T)try{T({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){R("runtime.analytics.site1",o)}}var I="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function k(e){return N(e)&&(e.namespaceURI===I||e.namespaceURI==="http://www.w3.org/2000/svg")}var w="data-hf-edit-base-x",y="data-hf-edit-base-y",m="data-hf-edit-original-translate",_=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},C=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},$=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,E=(e,t)=>$.test(e)&&$.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,O=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,s,a]=C(e);if(r===void 0)return`${t} ${o}`;if(s===void 0)return`${E(r,t)} ${o}`;let i=a===void 0?"":` ${a}`;return`${E(r,t)} ${E(s,o)}${i}`},j=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},B=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},b=new WeakMap;function V(e,t){let o=b.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){P("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=_(e.getAttribute("data-x"))-_(e.getAttribute(w)),s=_(e.getAttribute("data-y"))-_(e.getAttribute(y));e.hasAttribute(m)||e.setAttribute(m,B(e)),o===void 0&&j(e);let a=e.getAttribute(m)??"",i=O(a,`${r}px`,`${s}px`);e.style.setProperty("translate",i),b.set(e,e.style.getPropertyValue("translate"))}function h(e,t){let o=e.querySelectorAll(`[${m}]:not([${w}]):not([${y}])`);for(let a=0;a<o.length;a++){let i=o[a];if(i===void 0||!k(i))continue;let g=i.getAttribute(m)??"";g===""?i.style.removeProperty("translate"):i.style.setProperty("translate",g),i.removeAttribute(m),b.delete(i)}let r=e.querySelectorAll(`[${w}], [${y}]`),s=0;for(let a=0;a<r.length;a++){let i=r[a];i===void 0||!k(i)||(V(i,t),s+=1)}return s}var L="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,F=new WeakMap,H=new WeakMap;function W(e){let t=e,o=()=>{try{h(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[L]),s=n=>{D.add(n);try{Object.defineProperty(n,L,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let l=function(...u){let d=n.apply(this,u);return o(),d};return s(l),l},i=(n,l)=>{let u=F.get(n);if(u?.has(l))return!0;let d=Object.getOwnPropertyDescriptor(n,l);if(d?.configurable===!1){let c=n[l];return typeof c=="function"&&(n[l]=a(c),o()),!1}let p=n[l],f=d?.set;return Object.defineProperty(n,l,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:c=>{p=a(c),f?.call(n,c)}}),p=a(p),u??(u=new Set),u.add(l),F.set(n,u),o(),!0},g=(n,l)=>{let u=H.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let c=t[n];return c?i(c,l):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:c=>{f=c,f&&i(f,l)}}),u??(u=new Set),u.add(n),H.set(t,u)}let p=t[n];return p?i(p,l):!1},S=()=>{let n=g("__hf","seek"),l=g("__player","renderSeek");return n&&l};if(S())return;let v=120,A=t.setInterval(()=>{if(S()){t.clearInterval(A);return}v-=1,v<=0&&t.clearInterval(A)},50)}function M(){document.querySelector(`[${w}], [${y}]`)&&(h(document),W(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",M,{once:!0}):M();})();\n';
6154
6154
  function getPositionEditsRenderScript() {
6155
6155
  return POSITION_EDITS_RENDER_IIFE;
6156
6156
  }
@@ -7324,7 +7324,7 @@ async function readLocalFont(absPath) {
7324
7324
  return { kind: "inline", buffer: Buffer.concat(chunks, totalBytes) };
7325
7325
  }
7326
7326
  async function embedLocalFontFaces(html, projectDir) {
7327
- const { fontToDataUri: toDataUri } = await import("./deterministicFonts-HY5GWGQQ.js");
7327
+ const { fontToDataUri: toDataUri } = await import("./deterministicFonts-DQDB47K3.js");
7328
7328
  const styleBlockRe = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
7329
7329
  const fontFaceRe = /@font-face\s*\{([^}]*)\}/gi;
7330
7330
  let result = html;
@@ -7970,11 +7970,36 @@ function adaptAspectAgnosticResolution(requested, aspectAgnostic, width, height,
7970
7970
  });
7971
7971
  return flipped;
7972
7972
  }
7973
+ function resolveEntryHtmlPath(input) {
7974
+ const { projectDir, workDir, entryFile, log } = input;
7975
+ const htmlPath = join14(projectDir, entryFile);
7976
+ const rawEntry = readTextFile(htmlPath);
7977
+ if (entryFile === "index.html" || !isTemplateEntry(rawEntry)) return htmlPath;
7978
+ const projectIndexPath = join14(projectDir, "index.html");
7979
+ if (!existsSync10(projectIndexPath)) {
7980
+ throw new Error(
7981
+ `Template entry file "${entryFile}" requires a project index.html to extract its render shell.`
7982
+ );
7983
+ }
7984
+ const standaloneHtml = extractStandaloneEntryFromIndex(
7985
+ readTextFile(projectIndexPath),
7986
+ entryFile,
7987
+ rawEntry
7988
+ );
7989
+ if (!standaloneHtml) {
7990
+ throw new Error(
7991
+ `Entry file "${entryFile}" is not mounted from index.html via data-composition-src, so it cannot be rendered independently.`
7992
+ );
7993
+ }
7994
+ const wrapperPath = join14(workDir, "standalone-entry.html");
7995
+ writeFileSync4(wrapperPath, standaloneHtml, "utf-8");
7996
+ log.info("Extracted standalone entry from index.html host context", { entryFile });
7997
+ return wrapperPath;
7998
+ }
7973
7999
  async function runCompileStage(input) {
7974
8000
  const {
7975
8001
  projectDir,
7976
8002
  workDir,
7977
- htmlPath,
7978
8003
  entryFile,
7979
8004
  job,
7980
8005
  cfg,
@@ -7985,6 +8010,7 @@ async function runCompileStage(input) {
7985
8010
  allowSystemFontCapture,
7986
8011
  abortSignal
7987
8012
  } = input;
8013
+ const htmlPath = resolveEntryHtmlPath({ projectDir, workDir, entryFile, log });
7988
8014
  const compileStart = Date.now();
7989
8015
  const compiled = await compileForRender(projectDir, htmlPath, join14(workDir, "downloads"), {
7990
8016
  log,
@@ -8783,7 +8809,7 @@ function validateDistributedDuration(input) {
8783
8809
  }
8784
8810
 
8785
8811
  // ../producer/src/services/render/stages/extractVideosStage.ts
8786
- import { existsSync as existsSync10 } from "fs";
8812
+ import { existsSync as existsSync11 } from "fs";
8787
8813
  import { join as join16 } from "path";
8788
8814
 
8789
8815
  // ../producer/src/services/render/extractionFailureMetadata.ts
@@ -9040,7 +9066,7 @@ async function runExtractVideosStage(input) {
9040
9066
  const probeFailures = await Promise.all(
9041
9067
  composition.videos.map(async (v) => {
9042
9068
  const videoPath = resolveProjectRelativeSrc(v.src, projectDir, compiledDir);
9043
- if (!existsSync10(videoPath)) return null;
9069
+ if (!existsSync11(videoPath)) return null;
9044
9070
  try {
9045
9071
  const attempted = extractionPolicy.maxTransientRetries === 0 ? { result: await extractMediaMetadata(videoPath), retries: 0 } : await runVideoExtractionWithRetry(() => extractMediaMetadata(videoPath), {
9046
9072
  signal: abortSignal,
@@ -9078,7 +9104,7 @@ async function runExtractVideosStage(input) {
9078
9104
  const probed = await Promise.all(
9079
9105
  composition.images.map(async (img) => {
9080
9106
  const imgPath = resolveProjectRelativeSrc(img.src, projectDir, compiledDir);
9081
- if (!existsSync10(imgPath)) return null;
9107
+ if (!existsSync11(imgPath)) return null;
9082
9108
  const colorSpace = await probeColorSpaceSafely(imgPath, log);
9083
9109
  if (isHdrColorSpace(colorSpace)) {
9084
9110
  nativeHdrImageIds.add(img.id);
@@ -9198,7 +9224,7 @@ async function appendVideoAudioFromProbe(input) {
9198
9224
  videos.map(async (video) => {
9199
9225
  const path = isHttpUrl(video.src) ? video.src : resolveProjectRelativeSrc(video.src, projectDir, compiledDir);
9200
9226
  const readFrom = urlByAbsentLocalPath?.get(path) ?? path;
9201
- if (!isHttpUrl(readFrom) && !existsSync10(readFrom)) return null;
9227
+ if (!isHttpUrl(readFrom) && !existsSync11(readFrom)) return null;
9202
9228
  const metadata = await extractMediaMetadata(readFrom);
9203
9229
  const window2 = await resolveFinalFrameExtractionWindow(
9204
9230
  readFrom,
@@ -9218,7 +9244,7 @@ async function appendVideoAudioFromProbe(input) {
9218
9244
  }
9219
9245
 
9220
9246
  // ../producer/src/services/render/videoLayerPassthroughPlan.ts
9221
- import { existsSync as existsSync11 } from "fs";
9247
+ import { existsSync as existsSync12 } from "fs";
9222
9248
  var SAMPLES = 9;
9223
9249
  function inspectVideoLayout(id, w, h, time) {
9224
9250
  window.__hf?.seek?.(time);
@@ -9280,7 +9306,7 @@ async function planVideoLayerPassthrough(input) {
9280
9306
  const { video } = q;
9281
9307
  if (isHttpUrl(video.src)) return { reason: "remote_source" };
9282
9308
  const path = resolveProjectRelativeSrc(video.src, input.projectDir, input.compiledDir);
9283
- if (!existsSync11(path)) return { reason: "source_missing" };
9309
+ if (!existsSync12(path)) return { reason: "source_missing" };
9284
9310
  const layout = await probeVideoLayout(input.page, video.id, input.canvas, input.duration);
9285
9311
  if ("reason" in layout) return layout;
9286
9312
  const layer = await buildVideoLayerInput(
@@ -9295,10 +9321,11 @@ async function planVideoLayerPassthrough(input) {
9295
9321
  }
9296
9322
 
9297
9323
  // ../producer/src/services/render/stages/audioStage.ts
9324
+ import { existsSync as existsSync14 } from "fs";
9298
9325
  import { join as join19 } from "path";
9299
9326
 
9300
9327
  // ../producer/src/services/render/audioDeliveryLimit.ts
9301
- import { existsSync as existsSync12 } from "fs";
9328
+ import { existsSync as existsSync13 } from "fs";
9302
9329
  import { dirname as dirname7, join as join18 } from "path";
9303
9330
 
9304
9331
  // ../producer/src/services/render/audioPadTrim.ts
@@ -9396,8 +9423,9 @@ var AUDIO_DURATION_TOLERANCE_SECONDS = 1e-3;
9396
9423
  var AAC_DELIVERY_TRUE_PEAK_DBFS = -1;
9397
9424
  var AAC_TRUE_PEAK_CORRECTION_HEADROOM_DB = 0.5;
9398
9425
  var MAX_TRUE_PEAK_CORRECTION_PASSES = 3;
9426
+ var gainFilter = (gainDb) => `volume=${gainDb.toFixed(3)}dB`;
9399
9427
  function aacTruePeakCorrectionFilter(targetDurationSeconds, attenuationDb) {
9400
- return `volume=${attenuationDb.toFixed(3)}dB,apad,atrim=0:${formatSeconds(targetDurationSeconds)}`;
9428
+ return `${gainFilter(attenuationDb)},apad,atrim=0:${formatSeconds(targetDurationSeconds)}`;
9401
9429
  }
9402
9430
  function buildPadTrimAudioPlan(audioPath, outputPath, sourceDurationSeconds, targetDurationSeconds) {
9403
9431
  const delta = targetDurationSeconds - sourceDurationSeconds;
@@ -9435,7 +9463,7 @@ async function padOrTrimAudioToVideoFrameCount(input) {
9435
9463
  const probeAudio = input.probeAudioInfo ?? defaultProbeAudioInfo;
9436
9464
  const timeoutMs = input.timeoutMs ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
9437
9465
  const runner = input.runFfmpeg ?? ((args) => defaultRunFfmpeg(args, timeoutMs, input.signal));
9438
- const encode = input.encodeAac ?? defaultAacEncoder(timeoutMs, input.signal);
9466
+ const encode = input.encodeAac ?? defaultAacEncoder(timeoutMs, input.signal, input.sourcePath);
9439
9467
  const probeTruePeak = input.probeAudioTruePeakDbfs ?? (input.runFfmpeg || input.encodeAac ? void 0 : (audioPath, signal) => measureTruePeakDbfs(audioPath, { timeoutMs, signal }));
9440
9468
  const [videoResult, audioResult] = await Promise.allSettled([
9441
9469
  probeVideo(input.videoPath),
@@ -9483,7 +9511,12 @@ async function padOrTrimAudioToVideoFrameCount(input) {
9483
9511
  );
9484
9512
  try {
9485
9513
  for (const step of plan2.steps) {
9486
- const ffmpegResult = step.kind === "copy" ? await runner(step.args) : await encode(input.audioPath, input.outputPath, targetDurationSeconds, step.filter);
9514
+ const ffmpegResult = step.kind === "copy" ? await runner(step.args) : await encode(
9515
+ input.sourcePath ?? input.audioPath,
9516
+ input.outputPath,
9517
+ targetDurationSeconds,
9518
+ step.filter
9519
+ );
9487
9520
  if (!ffmpegResult.success) {
9488
9521
  return {
9489
9522
  success: false,
@@ -9512,6 +9545,7 @@ async function padOrTrimAudioToVideoFrameCount(input) {
9512
9545
  if (probeTruePeak) {
9513
9546
  const correction = await enforceAacTruePeak({
9514
9547
  audioPath: input.outputPath,
9548
+ sourcePath: input.sourcePath,
9515
9549
  targetDurationSeconds,
9516
9550
  signal: input.signal,
9517
9551
  probeTruePeak,
@@ -9547,9 +9581,27 @@ async function constrainAacTruePeak(input) {
9547
9581
  targetDurationSeconds: input.targetDurationSeconds,
9548
9582
  signal: input.signal,
9549
9583
  probeTruePeak: input.probeTruePeakDbfs ?? ((audioPath, signal) => measureTruePeakDbfs(audioPath, { timeoutMs, signal })),
9550
- encode: input.encodeAac ?? defaultAacEncoder(timeoutMs, input.signal, input.sourcePath)
9584
+ encode: input.encodeAac ?? defaultAacEncoder(timeoutMs, input.signal, input.sourcePath),
9585
+ rewriteSource: input.rewriteSource ?? ((sourcePath, outputPath, filter) => defaultRunFfmpeg(
9586
+ ["-i", sourcePath, "-af", filter, "-c:a", "pcm_f32le", "-y", outputPath],
9587
+ timeoutMs,
9588
+ input.signal
9589
+ ))
9551
9590
  });
9552
9591
  }
9592
+ async function cutSource(input, scratchDir, attenuationDb) {
9593
+ if (!input.sourcePath || !input.rewriteSource) return true;
9594
+ const cutPath = join17(scratchDir, "source.wav");
9595
+ try {
9596
+ const result = await input.rewriteSource(input.sourcePath, cutPath, gainFilter(attenuationDb));
9597
+ if (!result.success) throw new Error(result.error);
9598
+ renameWithRetry(cutPath, input.sourcePath, { copyFallback: true });
9599
+ return true;
9600
+ } catch {
9601
+ removeScratch(input.sourcePath);
9602
+ return false;
9603
+ }
9604
+ }
9553
9605
  async function enforceAacTruePeak(input) {
9554
9606
  let scratchDir;
9555
9607
  try {
@@ -9569,8 +9621,10 @@ async function enforceAacTruePeak(input) {
9569
9621
  }
9570
9622
  if (truePeakDbfs <= AAC_DELIVERY_TRUE_PEAK_DBFS) {
9571
9623
  if (measuredPath !== correctedPath) return { success: true };
9624
+ const sourceCut = await cutSource(input, scratchDir, attenuationDb);
9572
9625
  renameWithRetry(correctedPath, input.audioPath, { copyFallback: true });
9573
- return { success: true, loweredDb: Number((-attenuationDb).toFixed(2)) };
9626
+ const loweredDb = Number((-attenuationDb).toFixed(2));
9627
+ return sourceCut ? { success: true, loweredDb } : { success: true, loweredDb, sourceStale: true };
9574
9628
  }
9575
9629
  if (pass === MAX_TRUE_PEAK_CORRECTION_PASSES) break;
9576
9630
  const headroomDb = AAC_TRUE_PEAK_CORRECTION_HEADROOM_DB * 2 ** pass;
@@ -9580,7 +9634,7 @@ async function enforceAacTruePeak(input) {
9580
9634
  const referenceDbfs = Math.max(truePeakDbfs, (sourcePeakDbfs ?? -Infinity) + attenuationDb);
9581
9635
  attenuationDb += AAC_DELIVERY_TRUE_PEAK_DBFS - headroomDb - referenceDbfs;
9582
9636
  const result = await input.encode(
9583
- input.audioPath,
9637
+ input.sourcePath ?? input.audioPath,
9584
9638
  correctedPath,
9585
9639
  input.targetDurationSeconds,
9586
9640
  aacTruePeakCorrectionFilter(input.targetDurationSeconds, attenuationDb)
@@ -9753,7 +9807,7 @@ async function limitDeliveryPeaks(input, deps = {
9753
9807
  applyChain: applyAudioFxChain,
9754
9808
  encode: encodeAac,
9755
9809
  rename: renameWithRetry,
9756
- sourceExists: existsSync12
9810
+ sourceExists: existsSync13
9757
9811
  }) {
9758
9812
  const { audioPath, sourcePath, signal, timeoutMs } = input;
9759
9813
  if (!deps.sourceExists(sourcePath)) return { success: true };
@@ -9809,36 +9863,54 @@ async function runAudioStageScoped(input) {
9809
9863
  const stageStart = Date.now();
9810
9864
  const pcmSourcePath = join19(input.workDir, "audio-source.wav");
9811
9865
  const duration = input.totalFrames * input.fps.den / input.fps.num;
9866
+ let deliverySourcePath;
9812
9867
  try {
9813
9868
  const result = await mixAudioForDelivery(input, duration, pcmSourcePath);
9814
9869
  let audioLoweredDb;
9815
9870
  if (result.hasAudio) {
9816
9871
  const guardStart = Date.now();
9817
- const limited = await limitDeliveryPeaks({
9818
- audioPath: result.audioOutputPath,
9819
- sourcePath: pcmSourcePath,
9820
- targetDurationSeconds: duration,
9821
- signal: input.abortSignal,
9822
- timeoutMs: input.ffmpegProcessTimeout,
9823
- warn: (message, details) => input.log?.warn?.(message, details)
9824
- });
9825
- if (!limited.success) throw encoderFailureError("Audio true-peak limit failed", limited);
9826
- const peak = await constrainAacTruePeak({
9827
- audioPath: result.audioOutputPath,
9828
- sourcePath: pcmSourcePath,
9829
- targetDurationSeconds: duration,
9830
- signal: input.abortSignal,
9831
- timeoutMs: input.ffmpegProcessTimeout
9832
- });
9833
- if (!peak.success) throw encoderFailureError("Audio true-peak check failed", peak);
9834
- audioLoweredDb = peak.loweredDb;
9872
+ const guard = await guardDeliveryPeaks(
9873
+ input,
9874
+ result.audioOutputPath,
9875
+ pcmSourcePath,
9876
+ duration
9877
+ );
9878
+ audioLoweredDb = guard.loweredDb;
9835
9879
  input.log?.info("[audio] phases", { ...result.audioPhaseMs, guard: Date.now() - guardStart });
9880
+ if (input.keepDeliverySource && !guard.sourceStale && existsSync14(pcmSourcePath)) {
9881
+ deliverySourcePath = pcmSourcePath;
9882
+ }
9836
9883
  }
9837
- return { ...result, audioLoweredDb, audioProcessMs: Date.now() - stageStart };
9884
+ return {
9885
+ ...result,
9886
+ audioLoweredDb,
9887
+ deliverySourcePath,
9888
+ audioProcessMs: Date.now() - stageStart
9889
+ };
9838
9890
  } finally {
9839
- removeScratch(pcmSourcePath);
9891
+ if (!deliverySourcePath) removeScratch(pcmSourcePath);
9840
9892
  }
9841
9893
  }
9894
+ async function guardDeliveryPeaks(input, audioPath, sourcePath, duration) {
9895
+ const limited = await limitDeliveryPeaks({
9896
+ audioPath,
9897
+ sourcePath,
9898
+ targetDurationSeconds: duration,
9899
+ signal: input.abortSignal,
9900
+ timeoutMs: input.ffmpegProcessTimeout,
9901
+ warn: (message, details) => input.log?.warn?.(message, details)
9902
+ });
9903
+ if (!limited.success) throw encoderFailureError("Audio true-peak limit failed", limited);
9904
+ const peak = await constrainAacTruePeak({
9905
+ audioPath,
9906
+ sourcePath,
9907
+ targetDurationSeconds: duration,
9908
+ signal: input.abortSignal,
9909
+ timeoutMs: input.ffmpegProcessTimeout
9910
+ });
9911
+ if (!peak.success) throw encoderFailureError("Audio true-peak check failed", peak);
9912
+ return { loweredDb: peak.loweredDb, sourceStale: peak.sourceStale };
9913
+ }
9842
9914
  async function mixAudioForDelivery(input, duration, pcmSourcePath) {
9843
9915
  const {
9844
9916
  projectDir,
@@ -9933,7 +10005,7 @@ async function mixAudioForDelivery(input, duration, pcmSourcePath) {
9933
10005
  }
9934
10006
 
9935
10007
  // ../producer/src/services/render/stages/captureStage.ts
9936
- import { existsSync as existsSync13, readdirSync as readdirSync3, statfsSync as statfsSync2 } from "fs";
10008
+ import { existsSync as existsSync15, readdirSync as readdirSync3, statfsSync as statfsSync2 } from "fs";
9937
10009
  import { join as join20 } from "path";
9938
10010
  function shouldAllowAdaptiveCaptureRetry(workerCount, _explicitlyConfigured) {
9939
10011
  return workerCount > 1;
@@ -9990,7 +10062,7 @@ function diskCaptureShortfallError(needBytes, freeBytes, framesDir, basis, remed
9990
10062
  }
9991
10063
  function measureCaptureFrameBytes(workDir, framesDir) {
9992
10064
  let total = sampleDirectoryBytes(framesDir);
9993
- if (!existsSync13(workDir)) return total;
10065
+ if (!existsSync15(workDir)) return total;
9994
10066
  for (const attempt of readdirSync3(workDir)) {
9995
10067
  if (/^retry-\d+-batch-\d+-worker-\d+$/.test(attempt)) {
9996
10068
  total += sampleDirectoryBytes(join20(workDir, attempt));
@@ -10293,7 +10365,7 @@ async function captureSessionFrames(session, { input, rangeStart, rangeEnd, resu
10293
10365
  }
10294
10366
 
10295
10367
  // ../producer/src/services/render/stages/captureHdrStage.ts
10296
- import { existsSync as existsSync15, mkdirSync as mkdirSync6 } from "fs";
10368
+ import { existsSync as existsSync17, mkdirSync as mkdirSync6 } from "fs";
10297
10369
  import { join as join24 } from "path";
10298
10370
 
10299
10371
  // ../producer/src/services/hdrImageTransferCache.ts
@@ -10516,7 +10588,7 @@ import { Worker } from "worker_threads";
10516
10588
  import { fileURLToPath as fileURLToPath3, pathToFileURL } from "url";
10517
10589
  import { dirname as dirname8, join as join22 } from "path";
10518
10590
  import { createRequire } from "module";
10519
- import { existsSync as existsSync14 } from "fs";
10591
+ import { existsSync as existsSync16 } from "fs";
10520
10592
  import { cpus as cpus2 } from "os";
10521
10593
  function resolveWorkerEntry(explicit) {
10522
10594
  if (explicit && explicit.length > 0) {
@@ -10529,7 +10601,7 @@ function resolveWorkerEntry(explicit) {
10529
10601
  }
10530
10602
  const moduleDir = dirname8(fileURLToPath3(import.meta.url));
10531
10603
  const jsPath = join22(moduleDir, "shaderTransitionWorker.js");
10532
- if (existsSync14(jsPath)) return { path: jsPath, isTs: false };
10604
+ if (existsSync16(jsPath)) return { path: jsPath, isTs: false };
10533
10605
  const tsPath = join22(moduleDir, "shaderTransitionWorker.ts");
10534
10606
  return { path: tsPath, isTs: true };
10535
10607
  }
@@ -11090,7 +11162,7 @@ async function runCaptureHdrStage(input) {
11090
11162
  }
11091
11163
  const debugDumpEnabled = process.env.KEEP_TEMP === "1";
11092
11164
  const debugDumpDir = debugDumpEnabled ? join24(framesDir, "debug-composite") : null;
11093
- if (debugDumpDir && !existsSync15(debugDumpDir)) {
11165
+ if (debugDumpDir && !existsSync17(debugDumpDir)) {
11094
11166
  mkdirSync6(debugDumpDir, { recursive: true });
11095
11167
  }
11096
11168
  const compositeTransfer = resolveCompositeTransfer(hasHdrContent, effectiveHdr);
@@ -11247,13 +11319,13 @@ async function runCaptureHdrStage(input) {
11247
11319
  // ../producer/src/services/render/stages/encodeStage.ts
11248
11320
  import {
11249
11321
  copyFileSync as copyFileSync2,
11250
- existsSync as existsSync16,
11322
+ existsSync as existsSync18,
11251
11323
  mkdirSync as mkdirSync7,
11252
11324
  readdirSync as readdirSync4,
11253
11325
  readFileSync as readFileSync6,
11254
11326
  rmSync as rmSync7,
11255
11327
  statSync as statSync5,
11256
- writeFileSync as writeFileSync4
11328
+ writeFileSync as writeFileSync5
11257
11329
  } from "fs";
11258
11330
  import { readFile as readFile2 } from "fs/promises";
11259
11331
  import { dirname as dirname9, join as join25 } from "path";
@@ -11334,7 +11406,7 @@ async function reencodeWithClearedWholeFrames(argsInput, run, startTime) {
11334
11406
  const error = "[FFmpeg] GIF output could not be parsed to clear its frames";
11335
11407
  return gifEncodeFailure(startTime, outputPath, error);
11336
11408
  }
11337
- writeFileSync4(outputPath, gif);
11409
+ writeFileSync5(outputPath, gif);
11338
11410
  return null;
11339
11411
  }
11340
11412
  async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
@@ -11366,7 +11438,7 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
11366
11438
  const failure = await reencodeWithClearedWholeFrames(argsInput, run, startTime);
11367
11439
  if (failure) return failure;
11368
11440
  }
11369
- const fileSize = existsSync16(outputPath) ? statSync5(outputPath).size : 0;
11441
+ const fileSize = existsSync18(outputPath) ? statSync5(outputPath).size : 0;
11370
11442
  return {
11371
11443
  success: true,
11372
11444
  outputPath,
@@ -11527,7 +11599,7 @@ async function runEncodeStage(input) {
11527
11599
  const stage5Start = Date.now();
11528
11600
  if (isPngSequence) {
11529
11601
  const encoded = startEncodeProgress(job, "Writing PNG sequence", onProgress);
11530
- if (!existsSync16(outputPath)) mkdirSync7(outputPath, { recursive: true });
11602
+ if (!existsSync18(outputPath)) mkdirSync7(outputPath, { recursive: true });
11531
11603
  const captured = readdirSync4(framesDir).filter((name) => name.endsWith(".png")).sort();
11532
11604
  if (captured.length === 0) {
11533
11605
  throw new Error(
@@ -11538,7 +11610,7 @@ async function runEncodeStage(input) {
11538
11610
  const dst = join25(outputPath, formatExportFrameName(i, "png"));
11539
11611
  copyFileSync2(join25(framesDir, name), dst);
11540
11612
  });
11541
- if (hasAudio && audioOutputPath && existsSync16(audioOutputPath)) {
11613
+ if (hasAudio && audioOutputPath && existsSync18(audioOutputPath)) {
11542
11614
  copyFileSync2(audioOutputPath, join25(outputPath, MIXED_AUDIO_FILENAME));
11543
11615
  log.info(
11544
11616
  `[Render] png-sequence: ${MIXED_AUDIO_FILENAME} sidecar written to ${outputPath}/${MIXED_AUDIO_FILENAME}`
@@ -11648,6 +11720,7 @@ async function assembleOutput(input, onSecondsWritten) {
11648
11720
  const normalizeResult = await padOrTrimAudioToVideoFrameCount({
11649
11721
  videoPath: videoOnlyPath,
11650
11722
  audioPath: audioOutputPath,
11723
+ sourcePath: input.audioPcmPath,
11651
11724
  outputPath: normalizedAudioPath,
11652
11725
  signal: abortSignal,
11653
11726
  timeoutMs: ffmpegProcessTimeout
@@ -11918,18 +11991,14 @@ function hasUsableVideoDimensions(metadata) {
11918
11991
  return Number.isFinite(metadata.width) && Number.isFinite(metadata.height) && metadata.width > 0 && metadata.height > 0;
11919
11992
  }
11920
11993
  function collectVideoMetadataHints(extractedVideos) {
11921
- return extractedVideos.filter((video) => hasUsableVideoDimensions(video.metadata)).map((video) => ({
11922
- id: video.videoId,
11923
- width: video.metadata.width,
11924
- height: video.metadata.height
11925
- })).sort((a, b) => a.id.localeCompare(b.id));
11994
+ return extractedVideos.filter((video) => hasUsableVideoDimensions(video.metadata)).map((video) => ({ id: video.videoId, ...displaySize(video.metadata) })).sort((a, b) => a.id.localeCompare(b.id));
11926
11995
  }
11927
11996
  function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
11928
11997
  const ranges = [];
11929
11998
  let rangeStart = null;
11930
11999
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
11931
12000
  const framePath = join26(framesDir, formatCaptureFrameName(frameIndex, frameExt));
11932
- const missing = !existsSync17(framePath) || statSync6(framePath).size <= 8;
12001
+ const missing = !existsSync19(framePath) || statSync6(framePath).size <= 8;
11933
12002
  if (missing && rangeStart === null) {
11934
12003
  rangeStart = frameIndex;
11935
12004
  } else if (!missing && rangeStart !== null) {
@@ -12054,7 +12123,7 @@ function countCapturedFrames(totalFrames, framesDir, frameExt) {
12054
12123
  let captured = 0;
12055
12124
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
12056
12125
  const framePath = join26(framesDir, formatCaptureFrameName(frameIndex, frameExt));
12057
- if (existsSync17(framePath)) captured++;
12126
+ if (existsSync19(framePath)) captured++;
12058
12127
  }
12059
12128
  return captured;
12060
12129
  }
@@ -12719,7 +12788,7 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
12719
12788
  validateDeliveryEncoderConfig(job.config);
12720
12789
  const debugDir = resolveRenderDebugDir();
12721
12790
  const outputDir = dirname10(outputPath);
12722
- if (!existsSync17(outputDir)) mkdirSync8(outputDir, { recursive: true });
12791
+ if (!existsSync19(outputDir)) mkdirSync8(outputDir, { recursive: true });
12723
12792
  const workDir = job.config.debug ? join26(debugDir, job.id) : createRenderWorkDir(resolveRenderWorkDirPrefix(outputPath, job.id), outputDir);
12724
12793
  const pipelineStart = Date.now();
12725
12794
  const baseLog = job.config.logger ?? defaultLogger;
@@ -12861,7 +12930,7 @@ async function executeRenderPipeline(input) {
12861
12930
  job.startedAt = /* @__PURE__ */ new Date();
12862
12931
  assertNotAborted();
12863
12932
  assertConfiguredFfmpegBinariesExist();
12864
- if (!existsSync17(workDir)) mkdirSync8(workDir, { recursive: true });
12933
+ if (!existsSync19(workDir)) mkdirSync8(workDir, { recursive: true });
12865
12934
  if (job.config.debug) {
12866
12935
  log.info("[Render] Debug artifacts enabled", { workDir, logPath });
12867
12936
  }
@@ -12890,36 +12959,11 @@ async function executeRenderPipeline(input) {
12890
12959
  requestedWorkers: job.config.workers ?? "auto"
12891
12960
  });
12892
12961
  const entryFile = job.config.entryFile || "index.html";
12893
- let htmlPath = join26(projectDir, entryFile);
12894
- if (!existsSync17(htmlPath)) {
12962
+ const htmlPath = join26(projectDir, entryFile);
12963
+ if (!existsSync19(htmlPath)) {
12895
12964
  throw new Error(`Entry file not found: ${htmlPath}`);
12896
12965
  }
12897
12966
  assertNotAborted();
12898
- const rawEntry = readTextFile(htmlPath);
12899
- if (entryFile !== "index.html" && isTemplateEntry(rawEntry)) {
12900
- const wrapperPath = join26(workDir, "standalone-entry.html");
12901
- const projectIndexPath = join26(projectDir, "index.html");
12902
- if (!existsSync17(projectIndexPath)) {
12903
- throw new Error(
12904
- `Template entry file "${entryFile}" requires a project index.html to extract its render shell.`
12905
- );
12906
- }
12907
- const standaloneHtml = extractStandaloneEntryFromIndex(
12908
- readTextFile(projectIndexPath),
12909
- entryFile,
12910
- rawEntry
12911
- );
12912
- if (!standaloneHtml) {
12913
- throw new Error(
12914
- `Entry file "${entryFile}" is not mounted from index.html via data-composition-src, so it cannot be rendered independently.`
12915
- );
12916
- }
12917
- writeFileSync5(wrapperPath, standaloneHtml, "utf-8");
12918
- htmlPath = wrapperPath;
12919
- log.info("Extracted standalone entry from index.html host context", {
12920
- entryFile
12921
- });
12922
- }
12923
12967
  const stage1Start = Date.now();
12924
12968
  updateJobStatus(job, "preprocessing", "Compiling composition", 5, onProgress, {
12925
12969
  code: "compile"
@@ -12931,7 +12975,6 @@ async function executeRenderPipeline(input) {
12931
12975
  () => runCompileStage({
12932
12976
  projectDir,
12933
12977
  workDir,
12934
- htmlPath,
12935
12978
  entryFile,
12936
12979
  job,
12937
12980
  cfg,
@@ -13210,7 +13253,8 @@ async function executeRenderPipeline(input) {
13210
13253
  masterFxChain: composition.masterFxChain,
13211
13254
  abortSignal: executionSignal,
13212
13255
  assertNotAborted,
13213
- log
13256
+ log,
13257
+ keepDeliverySource: true
13214
13258
  })
13215
13259
  );
13216
13260
  pendingAudio = audioStage.catch(() => void 0);
@@ -13242,7 +13286,7 @@ async function executeRenderPipeline(input) {
13242
13286
  throw new Error("File server failed to initialize before frame capture");
13243
13287
  }
13244
13288
  const framesDir = join26(workDir, "captured-frames");
13245
- if (!existsSync17(framesDir)) mkdirSync8(framesDir, { recursive: true });
13289
+ if (!existsSync19(framesDir)) mkdirSync8(framesDir, { recursive: true });
13246
13290
  updateJobStatus(job, "rendering", "Checking browser GPU", 25, onProgress, {
13247
13291
  code: "start_browsers"
13248
13292
  });
@@ -13918,7 +13962,7 @@ async function executeRenderPipeline(input) {
13918
13962
  const effectiveQuality = job.config.crf ?? preset.quality;
13919
13963
  const effectiveBitrate = job.config.crf != null ? void 0 : job.config.videoBitrate;
13920
13964
  const audioResult = await audioStage;
13921
- const { audioOutputPath, hasAudio } = audioResult;
13965
+ const { audioOutputPath, deliverySourcePath, hasAudio } = audioResult;
13922
13966
  perfStages.audioProcessMs = audioResult.audioProcessMs;
13923
13967
  recordLimiterAttenuation(job, audioResult.audioLoweredDb);
13924
13968
  if (audioResult.audioError) {
@@ -14544,6 +14588,7 @@ async function executeRenderPipeline(input) {
14544
14588
  job,
14545
14589
  videoOnlyPath,
14546
14590
  audioOutputPath,
14591
+ audioPcmPath: deliverySourcePath,
14547
14592
  outputPath: stagedOutputPath,
14548
14593
  hasAudio,
14549
14594
  format: outputFormat,
@@ -14569,7 +14614,7 @@ async function executeRenderPipeline(input) {
14569
14614
  })
14570
14615
  );
14571
14616
  const totalElapsed = Date.now() - pipelineStart;
14572
- const tmpPeakBytes = existsSync17(workDir) ? sampleDirectoryBytes(workDir) : 0;
14617
+ const tmpPeakBytes = existsSync19(workDir) ? sampleDirectoryBytes(workDir) : 0;
14573
14618
  recordTransientRetryObservability();
14574
14619
  observability.checkpoint("pipeline", "artifact validated", { totalElapsedMs: totalElapsed });
14575
14620
  const observabilitySummary = observability.summary({
@@ -14641,7 +14686,7 @@ async function executeRenderPipeline(input) {
14641
14686
  job.perfSummary = perfSummary;
14642
14687
  if (job.config.debug) {
14643
14688
  try {
14644
- writeFileSync5(perfOutputPath, JSON.stringify(perfSummary, null, 2), "utf-8");
14689
+ writeFileSync6(perfOutputPath, JSON.stringify(perfSummary, null, 2), "utf-8");
14645
14690
  } catch (err) {
14646
14691
  log.debug("Failed to write perf summary", {
14647
14692
  perfOutputPath,
@@ -14650,7 +14695,7 @@ async function executeRenderPipeline(input) {
14650
14695
  }
14651
14696
  }
14652
14697
  if (job.config.debug) {
14653
- if (!isPngSequence && !isHls && existsSync17(stagedOutputPath)) {
14698
+ if (!isPngSequence && !isHls && existsSync19(stagedOutputPath)) {
14654
14699
  const debugOutput = join26(workDir, `output${videoExt}`);
14655
14700
  copyFileSync3(stagedOutputPath, debugOutput);
14656
14701
  }
@@ -15151,11 +15196,11 @@ async function writeStitchedMp4(chunkPaths, outputPath, audioPath) {
15151
15196
  import {
15152
15197
  copyFileSync as copyFileSync4,
15153
15198
  cpSync as cpSync2,
15154
- existsSync as existsSync22,
15199
+ existsSync as existsSync24,
15155
15200
  linkSync,
15156
15201
  mkdirSync as mkdirSync12,
15157
15202
  rmSync as rmSync10,
15158
- writeFileSync as writeFileSync8
15203
+ writeFileSync as writeFileSync9
15159
15204
  } from "fs";
15160
15205
  import { extname as extname6, isAbsolute as isAbsolute2, join as join35, relative as relative5, sep as sep2 } from "path";
15161
15206
 
@@ -15163,13 +15208,13 @@ import { extname as extname6, isAbsolute as isAbsolute2, join as join35, relativ
15163
15208
  import { join as join30 } from "path";
15164
15209
 
15165
15210
  // ../producer/src/services/distributed/chunkFrames.ts
15166
- import { existsSync as existsSync19, readdirSync as readdirSync6 } from "fs";
15211
+ import { existsSync as existsSync21, readdirSync as readdirSync6 } from "fs";
15167
15212
  import { extname as extname4, join as join29 } from "path";
15168
15213
 
15169
15214
  // ../producer/src/services/distributed/shared.ts
15170
15215
  import { execFile as execFileCallback } from "child_process";
15171
15216
  import { dirname as dirname12, join as join28 } from "path";
15172
- import { existsSync as existsSync18, readFileSync as readFileSync7 } from "fs";
15217
+ import { existsSync as existsSync20, readFileSync as readFileSync7 } from "fs";
15173
15218
  import { fileURLToPath as fileURLToPath5 } from "url";
15174
15219
  import { promisify as promisify2 } from "util";
15175
15220
  var PLAN_VIDEOS_META_RELATIVE_PATH = "meta/videos.json";
@@ -15181,7 +15226,7 @@ function isPlanAudioArtifactPath(path) {
15181
15226
  function resolvePlanAudioPath(planDir) {
15182
15227
  for (const name of [PLAN_AUDIO_RELATIVE_PATH, PLAN_AUDIO_LEGACY_RELATIVE_PATH]) {
15183
15228
  const candidate = join28(planDir, name);
15184
- if (existsSync18(candidate)) return candidate;
15229
+ if (existsSync20(candidate)) return candidate;
15185
15230
  }
15186
15231
  return null;
15187
15232
  }
@@ -15442,7 +15487,7 @@ function readProducerVersion() {
15442
15487
  let current = startDir;
15443
15488
  for (let i = 0; i < 10; i++) {
15444
15489
  const candidate = join28(current, "package.json");
15445
- if (existsSync18(candidate)) {
15490
+ if (existsSync20(candidate)) {
15446
15491
  try {
15447
15492
  const pkg = JSON.parse(readFileSync7(candidate, "utf-8"));
15448
15493
  if (pkg.name === "@hyperframes/producer" && typeof pkg.version === "string") {
@@ -15496,7 +15541,7 @@ function rebuildExtractedFramesFromPlanDir(planDir, videos, indexMode = "dense-v
15496
15541
  const result = [];
15497
15542
  for (const v of videos) {
15498
15543
  const outputDir = join29(planDir, "video-frames", v.videoId);
15499
- if (!existsSync19(outputDir)) {
15544
+ if (!existsSync21(outputDir)) {
15500
15545
  throw new Error(
15501
15546
  `[renderChunk] planDir missing extracted video frames for ${JSON.stringify(v.videoId)}: ${outputDir} not present. plan() should have written frames here; the planDir is malformed.`
15502
15547
  );
@@ -15612,7 +15657,7 @@ async function extractDeferredVideoFramesForChunk(input) {
15612
15657
  const range = video.deferredRange;
15613
15658
  const remoteUrl = remoteSources[range.sourcePath];
15614
15659
  const sourcePath = remoteUrl ?? join29(input.planDir, ...range.sourcePath.split("/"));
15615
- if (remoteUrl === void 0 && !existsSync19(sourcePath)) {
15660
+ if (remoteUrl === void 0 && !existsSync21(sourcePath)) {
15616
15661
  throw new RenderChunkValidationError(
15617
15662
  MISSING_PLAN_ARTIFACT,
15618
15663
  `[renderChunk] planDir is missing the source for video ${JSON.stringify(video.videoId)}: ${range.sourcePath}`
@@ -15823,7 +15868,7 @@ async function readPlanReferenceBackground(input) {
15823
15868
  }
15824
15869
 
15825
15870
  // ../producer/src/services/render/stages/freezePlan.ts
15826
- import { existsSync as existsSync20, mkdirSync as mkdirSync10, readFileSync as readFileSync8, readdirSync as readdirSync7, writeFileSync as writeFileSync6 } from "fs";
15871
+ import { existsSync as existsSync22, mkdirSync as mkdirSync10, readFileSync as readFileSync8, readdirSync as readdirSync7, writeFileSync as writeFileSync7 } from "fs";
15827
15872
  import { join as join32, relative as relative3, resolve as resolve7 } from "path";
15828
15873
 
15829
15874
  // ../producer/src/services/distributed/planProtocol.ts
@@ -16013,7 +16058,7 @@ function planFileSha256(absolutePath, digests) {
16013
16058
  return sha256;
16014
16059
  }
16015
16060
  async function prehashPlanFiles(dir, digests) {
16016
- if (!existsSync20(dir)) return;
16061
+ if (!existsSync22(dir)) return;
16017
16062
  for (const { absolutePath } of listPlanFiles(dir)) {
16018
16063
  if (!digests.has(absolutePath)) digests.set(absolutePath, await sha256FileAsync(absolutePath));
16019
16064
  }
@@ -16079,19 +16124,19 @@ var PLAN_REMOTE_FILES_RELATIVE_PATH = "meta/remote-files.json";
16079
16124
  function writePlanRemoteFiles(planDir, files) {
16080
16125
  if (files.length === 0) return;
16081
16126
  const sorted = [...files].sort((a, b) => a.path < b.path ? -1 : 1);
16082
- writeFileSync6(join32(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH), JSON.stringify(sorted), "utf-8");
16127
+ writeFileSync7(join32(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH), JSON.stringify(sorted), "utf-8");
16083
16128
  }
16084
16129
  function readPlanRemoteFiles(planDir) {
16085
16130
  const path = join32(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH);
16086
- return existsSync20(path) ? JSON.parse(readFileSync8(path, "utf-8")) : [];
16131
+ return existsSync22(path) ? JSON.parse(readFileSync8(path, "utf-8")) : [];
16087
16132
  }
16088
16133
  function recomputePlanHashFromPlanDir(planDir, digests) {
16089
16134
  const planJsonPath = join32(planDir, "plan.json");
16090
16135
  const encoderJsonPath = join32(planDir, "meta", "encoder.json");
16091
- if (!existsSync20(planJsonPath)) {
16136
+ if (!existsSync22(planJsonPath)) {
16092
16137
  throw new Error(`[freezePlan] plan.json missing: ${planJsonPath}`);
16093
16138
  }
16094
- if (!existsSync20(encoderJsonPath)) {
16139
+ if (!existsSync22(encoderJsonPath)) {
16095
16140
  throw new Error(`[freezePlan] meta/encoder.json missing: ${encoderJsonPath}`);
16096
16141
  }
16097
16142
  const planJson = JSON.parse(readFileSync8(planJsonPath, "utf-8"));
@@ -16121,12 +16166,12 @@ async function freezePlan(input) {
16121
16166
  hasAudio,
16122
16167
  digests
16123
16168
  } = input;
16124
- if (!existsSync20(planDir)) {
16169
+ if (!existsSync22(planDir)) {
16125
16170
  throw new Error(`[freezePlan] planDir does not exist: ${planDir}`);
16126
16171
  }
16127
16172
  const metaDir = join32(planDir, "meta");
16128
- if (!existsSync20(metaDir)) mkdirSync10(metaDir, { recursive: true });
16129
- writeFileSync6(
16173
+ if (!existsSync22(metaDir)) mkdirSync10(metaDir, { recursive: true });
16174
+ writeFileSync7(
16130
16175
  join32(metaDir, "composition.json"),
16131
16176
  `${JSON.stringify(composition, null, 2)}
16132
16177
  `,
@@ -16134,8 +16179,8 @@ async function freezePlan(input) {
16134
16179
  );
16135
16180
  const encoderForCanonical = stripUndefined(encoder);
16136
16181
  const encoderConfigCanonicalJson = canonicalJsonStringify(encoderForCanonical);
16137
- writeFileSync6(join32(metaDir, "encoder.json"), encoderConfigCanonicalJson, "utf-8");
16138
- writeFileSync6(join32(metaDir, "chunks.json"), `${JSON.stringify(chunks, null, 2)}
16182
+ writeFileSync7(join32(metaDir, "encoder.json"), encoderConfigCanonicalJson, "utf-8");
16183
+ writeFileSync7(join32(metaDir, "chunks.json"), `${JSON.stringify(chunks, null, 2)}
16139
16184
  `, "utf-8");
16140
16185
  const { compositionHtml, assets } = collectPlanAssetShas(planDir, digests);
16141
16186
  const planHash = computePlanHash({
@@ -16161,7 +16206,7 @@ async function freezePlan(input) {
16161
16206
  hasAudio
16162
16207
  };
16163
16208
  const planJsonPath = join32(planDir, "plan.json");
16164
- writeFileSync6(planJsonPath, `${JSON.stringify(planJson, null, 2)}
16209
+ writeFileSync7(planJsonPath, `${JSON.stringify(planJson, null, 2)}
16165
16210
  `, "utf-8");
16166
16211
  return { planJsonPath, planHash };
16167
16212
  }
@@ -16202,8 +16247,8 @@ function applyRuntimeEnvSnapshot(snapshot, env = process.env) {
16202
16247
  }
16203
16248
 
16204
16249
  // ../producer/src/services/distributed/chunkAudio.ts
16205
- import { closeSync as closeSync5, existsSync as existsSync21, ftruncateSync, mkdirSync as mkdirSync11, openSync as openSync5, readFileSync as readFileSync9 } from "fs";
16206
- import { writeFileSync as writeFileSync7, writeSync } from "fs";
16250
+ import { closeSync as closeSync5, existsSync as existsSync23, ftruncateSync, mkdirSync as mkdirSync11, openSync as openSync5, readFileSync as readFileSync9 } from "fs";
16251
+ import { writeFileSync as writeFileSync8, writeSync } from "fs";
16207
16252
  import { join as join33 } from "path";
16208
16253
  function audioCutForChunk(grid, chunks, index, fps) {
16209
16254
  const firstPacketAt = (frame) => Math.min(
@@ -16299,15 +16344,15 @@ async function writeChunkAudioSlices(input) {
16299
16344
  const start = offsets[cut.firstPacket];
16300
16345
  layout.partStarts[index] = start;
16301
16346
  const end = offsets[last] + track.sizes[last];
16302
- writeFileSync7(join33(input.planDir, chunkAudioSlicePath(index)), bytes.subarray(start, end));
16347
+ writeFileSync8(join33(input.planDir, chunkAudioSlicePath(index)), bytes.subarray(start, end));
16303
16348
  });
16304
16349
  const frame = [bytes.subarray(0, payloadStart), bytes.subarray(payloadEnd)];
16305
- writeFileSync7(join33(input.planDir, SLICE_FRAME), Buffer.concat(frame));
16306
- writeFileSync7(join33(input.planDir, SLICE_LAYOUT), JSON.stringify(layout));
16350
+ writeFileSync8(join33(input.planDir, SLICE_FRAME), Buffer.concat(frame));
16351
+ writeFileSync8(join33(input.planDir, SLICE_LAYOUT), JSON.stringify(layout));
16307
16352
  }
16308
16353
  function chunkAudioSource(planDir, chunkIndex, scratchPath) {
16309
16354
  const layoutPath = join33(planDir, SLICE_LAYOUT);
16310
- if (!existsSync21(layoutPath)) return resolvePlanAudioPath(planDir);
16355
+ if (!existsSync23(layoutPath)) return resolvePlanAudioPath(planDir);
16311
16356
  const layout = JSON.parse(readFileSync9(layoutPath, "utf-8"));
16312
16357
  const frame = readFileSync9(join33(planDir, SLICE_FRAME));
16313
16358
  const fd = openSync5(scratchPath, "w");
@@ -16867,7 +16912,7 @@ function createVideoSourceShipper(input) {
16867
16912
  let result = null;
16868
16913
  for (const root of stagedRel === null ? [input.workCompiledDir, input.projectDir] : []) {
16869
16914
  const rel = pathInside(root, srcPath);
16870
- if (rel !== null && (existsSync22(join35(input.planDir, "compiled", rel)) || input.isRemote(srcPath))) {
16915
+ if (rel !== null && (existsSync24(join35(input.planDir, "compiled", rel)) || input.isRemote(srcPath))) {
16871
16916
  result = ["compiled", ...rel.split(sep2)].join("/");
16872
16917
  break;
16873
16918
  }
@@ -16895,7 +16940,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
16895
16940
  useGpu: false,
16896
16941
  browserGpuMode: "software"
16897
16942
  });
16898
- if (!existsSync22(planDir)) mkdirSync12(planDir, { recursive: true });
16943
+ if (!existsSync24(planDir)) mkdirSync12(planDir, { recursive: true });
16899
16944
  const log = config.logger ?? defaultLogger;
16900
16945
  const sizeLimitBytes = options.executionPlanSizeLimitBytes ?? config.planDirSizeLimitBytes ?? PLAN_DIR_SIZE_LIMIT_BYTES;
16901
16946
  const abortSignal = config.abortSignal;
@@ -16925,7 +16970,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
16925
16970
  });
16926
16971
  const entryFile = config.entryFile ?? "index.html";
16927
16972
  const htmlPath = join35(projectDir, entryFile);
16928
- if (!existsSync22(htmlPath)) {
16973
+ if (!existsSync24(htmlPath)) {
16929
16974
  throw new Error(`[plan] entry file not found: ${htmlPath}`);
16930
16975
  }
16931
16976
  const workDir = join35(planDir, ".plan-work");
@@ -16969,7 +17014,6 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
16969
17014
  urlByAbsentLocalPath,
16970
17015
  projectDir,
16971
17016
  workDir,
16972
- htmlPath,
16973
17017
  entryFile,
16974
17018
  job,
16975
17019
  cfg,
@@ -17045,7 +17089,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
17045
17089
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
17046
17090
  if (probeResult.probeSession) {
17047
17091
  try {
17048
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-DYWF24IK.js");
17092
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-272JLFKW.js");
17049
17093
  await closeCaptureSession2(probeResult.probeSession);
17050
17094
  } catch (err) {
17051
17095
  log.warn("[plan] probe session close failed", {
@@ -17154,15 +17198,15 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
17154
17198
  logPlanStage(log, "extract", stageStarted);
17155
17199
  const stagedVideoFrames = join35(compiledDir, "__hyperframes_video_frames");
17156
17200
  const videoFramesDst = join35(planDir, "video-frames");
17157
- if (existsSync22(videoFramesDst)) rmSync10(videoFramesDst, { recursive: true, force: true });
17201
+ if (existsSync24(videoFramesDst)) rmSync10(videoFramesDst, { recursive: true, force: true });
17158
17202
  const videoSourcesDir = join35(planDir, "video-sources");
17159
17203
  rmSync10(videoSourcesDir, { recursive: true, force: true });
17160
- if (existsSync22(stagedVideoFrames)) {
17204
+ if (existsSync24(stagedVideoFrames)) {
17161
17205
  renameWithRetry(stagedVideoFrames, videoFramesDst);
17162
17206
  } else {
17163
17207
  mkdirSync12(videoFramesDst, { recursive: true });
17164
17208
  }
17165
- if (existsSync22(finalCompiledDir)) rmSync10(finalCompiledDir, { recursive: true, force: true });
17209
+ if (existsSync24(finalCompiledDir)) rmSync10(finalCompiledDir, { recursive: true, force: true });
17166
17210
  renameWithRetry(compiledDir, finalCompiledDir);
17167
17211
  const shipVideoSource = createVideoSourceShipper({
17168
17212
  planDir,
@@ -17201,7 +17245,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
17201
17245
  sizeBytes
17202
17246
  }))
17203
17247
  );
17204
- writeFileSync8(
17248
+ writeFileSync9(
17205
17249
  join35(planDir, PLAN_VIDEOS_META_RELATIVE_PATH),
17206
17250
  JSON.stringify(planVideosJson, null, 2),
17207
17251
  "utf-8"
@@ -17282,10 +17326,10 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
17282
17326
  applyDistributedAudioWarningPolicy(job, audioResult.audioError, audioResult.audioFailures, log);
17283
17327
  }
17284
17328
  const planAudioPath = join35(planDir, PLAN_AUDIO_RELATIVE_PATH);
17285
- if (audioResult?.hasAudio && existsSync22(audioResult.audioOutputPath)) {
17329
+ if (audioResult?.hasAudio && existsSync24(audioResult.audioOutputPath)) {
17286
17330
  renameWithRetry(audioResult.audioOutputPath, planAudioPath);
17287
17331
  }
17288
- if (chunksCarryAudio && existsSync22(planAudioPath)) {
17332
+ if (chunksCarryAudio && existsSync24(planAudioPath)) {
17289
17333
  if (options.sliceChunkAudio) {
17290
17334
  stageStarted = Date.now();
17291
17335
  await writeChunkAudioSlices({
@@ -17403,14 +17447,14 @@ async function plan(projectDir, config, planDir, options = {}) {
17403
17447
 
17404
17448
  // ../producer/src/services/distributed/renderChunk.ts
17405
17449
  import { randomBytes } from "crypto";
17406
- import { existsSync as existsSync25, mkdirSync as mkdirSync15, readFileSync as readFileSync11, readdirSync as readdirSync10, rmSync as rmSync13, writeFileSync as writeFileSync11 } from "fs";
17450
+ import { existsSync as existsSync27, mkdirSync as mkdirSync15, readFileSync as readFileSync11, readdirSync as readdirSync10, rmSync as rmSync13, writeFileSync as writeFileSync12 } from "fs";
17407
17451
  import { cpus as cpus3 } from "os";
17408
17452
  import { join as join39 } from "path";
17409
17453
 
17410
17454
  // ../producer/src/services/distributed/planV2.ts
17411
17455
  import {
17412
17456
  copyFileSync as copyFileSync6,
17413
- existsSync as existsSync24,
17457
+ existsSync as existsSync26,
17414
17458
  lstatSync as lstatSync3,
17415
17459
  mkdirSync as mkdirSync14,
17416
17460
  mkdtempSync as mkdtempSync6,
@@ -17418,7 +17462,7 @@ import {
17418
17462
  readdirSync as readdirSync9,
17419
17463
  rmSync as rmSync12,
17420
17464
  statSync as statSync8,
17421
- writeFileSync as writeFileSync10
17465
+ writeFileSync as writeFileSync11
17422
17466
  } from "fs";
17423
17467
  import { tmpdir as tmpdir3 } from "os";
17424
17468
  import { dirname as dirname14, isAbsolute as isAbsolute3, join as join38, relative as relative6, resolve as resolve8, sep as sep3 } from "path";
@@ -17426,13 +17470,13 @@ import { dirname as dirname14, isAbsolute as isAbsolute3, join as join38, relati
17426
17470
  // ../producer/src/services/distributed/planV2Publisher.ts
17427
17471
  import {
17428
17472
  copyFileSync as copyFileSync5,
17429
- existsSync as existsSync23,
17473
+ existsSync as existsSync25,
17430
17474
  linkSync as linkSync2,
17431
17475
  mkdirSync as mkdirSync13,
17432
17476
  mkdtempSync as mkdtempSync5,
17433
17477
  rmSync as rmSync11,
17434
17478
  statSync as statSync7,
17435
- writeFileSync as writeFileSync9
17479
+ writeFileSync as writeFileSync10
17436
17480
  } from "fs";
17437
17481
  import { dirname as dirname13, join as join37 } from "path";
17438
17482
 
@@ -17494,7 +17538,7 @@ var LocalPlanV2ArtifactPublisher = class {
17494
17538
  #linkFile;
17495
17539
  #committed = false;
17496
17540
  constructor(destinationDir, options = {}) {
17497
- if (existsSync23(destinationDir)) {
17541
+ if (existsSync25(destinationDir)) {
17498
17542
  throw new PlanV2IntegrityError(`output directory already exists: ${destinationDir}`);
17499
17543
  }
17500
17544
  this.destinationDir = destinationDir;
@@ -17511,7 +17555,7 @@ var LocalPlanV2ArtifactPublisher = class {
17511
17555
  );
17512
17556
  }
17513
17557
  const destinationPath = planV2BlobPath(this.temporaryDir, digest);
17514
- if (existsSync23(destinationPath)) return;
17558
+ if (existsSync25(destinationPath)) return;
17515
17559
  mkdirSync13(dirname13(destinationPath), { recursive: true });
17516
17560
  const stagingDir = mkdtempSync5(join37(dirname13(destinationPath), ".plan-v2-blob-"));
17517
17561
  const temporaryPath = join37(stagingDir, "blob");
@@ -17529,13 +17573,13 @@ var LocalPlanV2ArtifactPublisher = class {
17529
17573
  }
17530
17574
  async commitManifest(manifestBytes) {
17531
17575
  for (const digest of new Set(manifestDigests(manifestBytes))) {
17532
- if (!existsSync23(planV2BlobPath(this.temporaryDir, digest))) {
17576
+ if (!existsSync25(planV2BlobPath(this.temporaryDir, digest))) {
17533
17577
  throw new PlanV2IntegrityError(
17534
17578
  `cannot commit manifest before referenced blob is durable: ${digest}`
17535
17579
  );
17536
17580
  }
17537
17581
  }
17538
- writeFileSync9(join37(this.temporaryDir, "plan.json"), manifestBytes, "utf-8");
17582
+ writeFileSync10(join37(this.temporaryDir, "plan.json"), manifestBytes, "utf-8");
17539
17583
  renameWithRetry(this.temporaryDir, this.destinationDir);
17540
17584
  this.#committed = true;
17541
17585
  }
@@ -17608,7 +17652,7 @@ function assertValidExtractionCacheCompleteSentinel(path) {
17608
17652
  }
17609
17653
  function validateExtractionCacheCompleteSentinels(executionPlanDir) {
17610
17654
  const videoRoot = join38(executionPlanDir, "video-frames");
17611
- if (!existsSync24(videoRoot)) return;
17655
+ if (!existsSync26(videoRoot)) return;
17612
17656
  for (const videoEntry of readdirSync9(videoRoot, { withFileTypes: true })) {
17613
17657
  if (!videoEntry.isDirectory()) continue;
17614
17658
  const videoDir = join38(videoRoot, videoEntry.name);
@@ -17709,7 +17753,7 @@ function parsePlanVideosJson2(value) {
17709
17753
  }
17710
17754
  function materializeExtractedVideoDirectories(planDir) {
17711
17755
  const videosPath = join38(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
17712
- if (!existsSync24(videosPath)) return;
17756
+ if (!existsSync26(videosPath)) return;
17713
17757
  const videos = parsePlanVideosJson2(readJsonFile(videosPath, PLAN_VIDEOS_META_RELATIVE_PATH));
17714
17758
  for (const video of videos.extracted) {
17715
17759
  mkdirSync14(resolveExtractedVideoOutputDir(planDir, video.videoId), { recursive: true });
@@ -17743,9 +17787,9 @@ function parseChunkSlices(value) {
17743
17787
  }
17744
17788
  function buildVideoChunkDependencies(executionPlanDir, dimensions) {
17745
17789
  const videoRoot = join38(executionPlanDir, "video-frames");
17746
- const hasExtractedFrames = existsSync24(videoRoot) && listFiles(videoRoot).length > 0;
17790
+ const hasExtractedFrames = existsSync26(videoRoot) && listFiles(videoRoot).length > 0;
17747
17791
  const videosPath = join38(executionPlanDir, PLAN_VIDEOS_META_RELATIVE_PATH);
17748
- if (!existsSync24(videosPath)) {
17792
+ if (!existsSync26(videosPath)) {
17749
17793
  return hasExtractedFrames ? { mode: "full-source-pack", dependencies: null } : { mode: "exact-rendered-frames", dependencies: /* @__PURE__ */ new Map() };
17750
17794
  }
17751
17795
  const chunksPath = join38(executionPlanDir, "meta", "chunks.json");
@@ -17802,7 +17846,7 @@ function computeManifestHash(manifest) {
17802
17846
  return sha256Hex(`${PLAN_V2_HASH_PREFIX}${canonicalJsonStringify(manifestPayload(manifest))}`);
17803
17847
  }
17804
17848
  function writeBlob(sourcePath, destinationPath) {
17805
- if (existsSync24(destinationPath)) return;
17849
+ if (existsSync26(destinationPath)) return;
17806
17850
  mkdirSync14(dirname14(destinationPath), { recursive: true });
17807
17851
  const temporaryDir = mkdtempSync6(join38(dirname14(destinationPath), ".plan-v2-blob-"));
17808
17852
  const temporaryPath = join38(temporaryDir, "blob");
@@ -17842,7 +17886,7 @@ async function putTasks(tasks) {
17842
17886
  }
17843
17887
  function buildPlanV2Publication(executionPlanDir, digests) {
17844
17888
  const executionPlanPath = join38(executionPlanDir, "plan.json");
17845
- if (!existsSync24(executionPlanPath)) {
17889
+ if (!existsSync26(executionPlanPath)) {
17846
17890
  throw new PlanV2IntegrityError(`execution plan is missing plan.json: ${executionPlanPath}`);
17847
17891
  }
17848
17892
  const executionPlanValue = readJsonFile(executionPlanPath, "execution plan.json");
@@ -17922,7 +17966,7 @@ function buildPlanV2Publication(executionPlanDir, digests) {
17922
17966
  };
17923
17967
  }
17924
17968
  function createPlanV2FromExecutionPlan(executionPlanDir, planV2Dir) {
17925
- if (existsSync24(planV2Dir)) {
17969
+ if (existsSync26(planV2Dir)) {
17926
17970
  throw new PlanV2IntegrityError(`output directory already exists: ${planV2Dir}`);
17927
17971
  }
17928
17972
  const publication = buildPlanV2Publication(executionPlanDir);
@@ -17935,7 +17979,7 @@ function createPlanV2FromExecutionPlan(executionPlanDir, planV2Dir) {
17935
17979
  for (const blob of publication.blobs) {
17936
17980
  writeBlob(blob.sourcePath, planV2BlobPath(tempDir, blob.sha256));
17937
17981
  }
17938
- writeFileSync10(
17982
+ writeFileSync11(
17939
17983
  join38(tempDir, "plan.json"),
17940
17984
  canonicalJsonStringify(publication.manifest),
17941
17985
  "utf-8"
@@ -18008,7 +18052,7 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
18008
18052
  }
18009
18053
  }
18010
18054
  async function planV2(projectDir, config, planV2Dir) {
18011
- if (existsSync24(planV2Dir)) {
18055
+ if (existsSync26(planV2Dir)) {
18012
18056
  throw new PlanV2IntegrityError(`output directory already exists: ${planV2Dir}`);
18013
18057
  }
18014
18058
  const publisher = new LocalPlanV2ArtifactPublisher(planV2Dir);
@@ -18162,7 +18206,7 @@ function parsePlanV2Manifest(value) {
18162
18206
  }
18163
18207
  function readPlanV2Manifest(planV2Dir) {
18164
18208
  const manifestPath = join38(planV2Dir, "plan.json");
18165
- if (!existsSync24(manifestPath)) {
18209
+ if (!existsSync26(manifestPath)) {
18166
18210
  throw new PlanV2IntegrityError(`missing v2 manifest: ${manifestPath}`);
18167
18211
  }
18168
18212
  const value = readJsonFile(manifestPath, "v2 manifest");
@@ -18181,7 +18225,7 @@ function listPlanV2ArtifactsForTarget(manifest, target) {
18181
18225
  }
18182
18226
  function verifyBlob(planV2Dir, artifact) {
18183
18227
  const sourcePath = planV2BlobPath(planV2Dir, artifact.sha256);
18184
- if (!existsSync24(sourcePath)) {
18228
+ if (!existsSync26(sourcePath)) {
18185
18229
  throw new PlanV2IntegrityError(`missing content-addressed artifact ${artifact.sha256}`);
18186
18230
  }
18187
18231
  const stats = statSync8(sourcePath);
@@ -18194,7 +18238,7 @@ function verifyBlob(planV2Dir, artifact) {
18194
18238
  return sourcePath;
18195
18239
  }
18196
18240
  function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}) {
18197
- if (existsSync24(destinationDir)) {
18241
+ if (existsSync26(destinationDir)) {
18198
18242
  throw new PlanV2IntegrityError(`materialization destination already exists: ${destinationDir}`);
18199
18243
  }
18200
18244
  const manifest = readPlanV2Manifest(planV2Dir);
@@ -18215,7 +18259,7 @@ function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}
18215
18259
  copyFileSync6(sourcePath, destinationPath);
18216
18260
  }
18217
18261
  if (target.role === "chunk") materializeExtractedVideoDirectories(tempDir);
18218
- writeFileSync10(
18262
+ writeFileSync11(
18219
18263
  join38(tempDir, PLAN_V2_MATERIALIZATION_MARKER),
18220
18264
  canonicalJsonStringify({
18221
18265
  manifest,
@@ -18259,7 +18303,7 @@ function validatePlanV2MaterializedTarget(planDir, expectedTarget) {
18259
18303
  }
18260
18304
  function readValidatedPlanV2Materialization(planDir, expectedTarget) {
18261
18305
  const markerPath = join38(planDir, PLAN_V2_MATERIALIZATION_MARKER);
18262
- if (!existsSync24(markerPath)) return null;
18306
+ if (!existsSync26(markerPath)) return null;
18263
18307
  const marker = readJsonFile(markerPath, "materialization marker");
18264
18308
  if (!isRecord3(marker) || !isRecord3(marker.manifest) || !isRecord3(marker.target)) {
18265
18309
  throw new PlanV2IntegrityError("malformed materialization marker");
@@ -18277,7 +18321,7 @@ function readValidatedPlanV2Materialization(planDir, expectedTarget) {
18277
18321
  for (const artifact of required) {
18278
18322
  if (Object.hasOwn(remoteSources, artifact.path)) continue;
18279
18323
  const path = join38(planDir, ...artifact.path.split("/"));
18280
- if (!existsSync24(path) || statSync8(path).size !== artifact.sizeBytes) {
18324
+ if (!existsSync26(path) || statSync8(path).size !== artifact.sizeBytes) {
18281
18325
  throw new PlanV2IntegrityError(
18282
18326
  `materialized artifact missing or truncated: ${artifact.path}`
18283
18327
  );
@@ -18416,7 +18460,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18416
18460
  const planJsonPath = join39(planDir, "plan.json");
18417
18461
  const encoderJsonPath = join39(planDir, "meta", "encoder.json");
18418
18462
  const chunksJsonPath = join39(planDir, "meta", "chunks.json");
18419
- if (!existsSync25(planJsonPath)) {
18463
+ if (!existsSync27(planJsonPath)) {
18420
18464
  throw new RenderChunkValidationError(
18421
18465
  MISSING_PLAN_ARTIFACT,
18422
18466
  `[renderChunk] planDir is missing required artifact: ${planJsonPath}`
@@ -18432,7 +18476,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18432
18476
  const v2Manifest = v2Materialization?.manifest ?? null;
18433
18477
  const remoteSources = v2Materialization?.remoteSources ?? {};
18434
18478
  for (const required of [encoderJsonPath, chunksJsonPath]) {
18435
- if (!existsSync25(required)) {
18479
+ if (!existsSync27(required)) {
18436
18480
  throw new RenderChunkValidationError(
18437
18481
  MISSING_PLAN_ARTIFACT,
18438
18482
  `[renderChunk] planDir is missing required artifact: ${required}`
@@ -18443,7 +18487,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18443
18487
  const chunks = JSON.parse(readFileSync11(chunksJsonPath, "utf-8"));
18444
18488
  const videosJsonPath = join39(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
18445
18489
  let planVideos = null;
18446
- if (existsSync25(videosJsonPath)) {
18490
+ if (existsSync27(videosJsonPath)) {
18447
18491
  try {
18448
18492
  planVideos = validatePlanVideosForChunk(JSON.parse(readFileSync11(videosJsonPath, "utf-8")));
18449
18493
  } catch (err) {
@@ -18474,7 +18518,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18474
18518
  const range = resolveChunkFrameRange(slice, chunkIndex, options?.frameRange);
18475
18519
  const framesInChunk = range.endFrame - range.startFrame;
18476
18520
  const compiledDir = join39(planDir, "compiled");
18477
- if (!existsSync25(compiledDir)) {
18521
+ if (!existsSync27(compiledDir)) {
18478
18522
  throw new RenderChunkValidationError(
18479
18523
  MISSING_PLAN_ARTIFACT,
18480
18524
  `[renderChunk] planDir missing compiled/ directory: ${compiledDir}`
@@ -18724,10 +18768,10 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18724
18768
  const effectiveBitrate = encoder.crf != null ? void 0 : encoder.bitrate;
18725
18769
  const videoOnlyPath = encoder.chunksCarryAudio ? `${outputChunkPath}.video.mp4` : outputChunkPath;
18726
18770
  if (isPngSequence) {
18727
- if (!existsSync25(outputChunkPath)) mkdirSync15(outputChunkPath, { recursive: true });
18771
+ if (!existsSync27(outputChunkPath)) mkdirSync15(outputChunkPath, { recursive: true });
18728
18772
  } else {
18729
18773
  const outDir = join39(outputChunkPath, "..");
18730
- if (!existsSync25(outDir)) mkdirSync15(outDir, { recursive: true });
18774
+ if (!existsSync27(outDir)) mkdirSync15(outDir, { recursive: true });
18731
18775
  }
18732
18776
  const encodeInput = {
18733
18777
  job,
@@ -18937,7 +18981,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18937
18981
  producerVersion: plan2.producerVersion,
18938
18982
  ffmpegVersion
18939
18983
  };
18940
- writeFileSync11(perfPath, `${JSON.stringify(perfPayload, null, 2)}
18984
+ writeFileSync12(perfPath, `${JSON.stringify(perfPayload, null, 2)}
18941
18985
  `, "utf-8");
18942
18986
  try {
18943
18987
  rmSync13(workDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
@@ -19587,11 +19631,11 @@ function renderRequestFromDistributedConfig(input) {
19587
19631
 
19588
19632
  // ../producer/src/server.ts
19589
19633
  import {
19590
- existsSync as existsSync28,
19634
+ existsSync as existsSync30,
19591
19635
  mkdirSync as mkdirSync17,
19592
19636
  statSync as statSync10,
19593
19637
  mkdtempSync as mkdtempSync8,
19594
- writeFileSync as writeFileSync12,
19638
+ writeFileSync as writeFileSync13,
19595
19639
  rmSync as rmSync15,
19596
19640
  createReadStream as createReadStream5
19597
19641
  } from "fs";
@@ -19605,7 +19649,7 @@ import { serve as serve2 } from "@hono/node-server";
19605
19649
 
19606
19650
  // ../producer/src/services/hyperframeLint.ts
19607
19651
  import {
19608
- existsSync as existsSync26,
19652
+ existsSync as existsSync28,
19609
19653
  readFileSync as readFileSync13,
19610
19654
  statSync as statSync9,
19611
19655
  openSync as openSync6,
@@ -19658,7 +19702,7 @@ function readEntryHtml(filePath) {
19658
19702
  }
19659
19703
  function readProjectEntryFile(projectDir, preferredEntryFile) {
19660
19704
  const absProjectDir = resolve9(projectDir);
19661
- if (!existsSync26(absProjectDir) || !statSync9(absProjectDir).isDirectory()) {
19705
+ if (!existsSync28(absProjectDir) || !statSync9(absProjectDir).isDirectory()) {
19662
19706
  return { error: `Project directory not found: ${absProjectDir}` };
19663
19707
  }
19664
19708
  const entryCandidates = [preferredEntryFile, "index.html", "src/index.html"].filter(
@@ -19727,7 +19771,7 @@ async function runHyperframeLint(prepared) {
19727
19771
  import { Worker as Worker2 } from "worker_threads";
19728
19772
  import { fileURLToPath as fileURLToPath6 } from "url";
19729
19773
  import { dirname as dirname15, join as join42 } from "path";
19730
- import { existsSync as existsSync27 } from "fs";
19774
+ import { existsSync as existsSync29 } from "fs";
19731
19775
  var DEFAULT_HEALTH_PORT = 9848;
19732
19776
  async function startHealthWorker(options = {}) {
19733
19777
  const log = options.logger ?? defaultLogger2();
@@ -19804,7 +19848,7 @@ function resolveWorkerEntry2() {
19804
19848
  const here = dirname15(fileURLToPath6(import.meta.url));
19805
19849
  const candidates = [join42(here, "healthWorkerThread.js"), join42(here, "healthWorkerThread.ts")];
19806
19850
  for (const candidate of candidates) {
19807
- if (existsSync27(candidate)) return candidate;
19851
+ if (existsSync29(candidate)) return candidate;
19808
19852
  }
19809
19853
  return void 0;
19810
19854
  }
@@ -19944,7 +19988,7 @@ function resolvePreparedRenderOutput(prepared, rendersDir, log) {
19944
19988
  const { input, cleanupProjectDir } = prepared;
19945
19989
  const absoluteOutputPath = resolveOutputPath(input.projectDir, input.outputPath, rendersDir, log);
19946
19990
  const outputDir = dirname16(absoluteOutputPath);
19947
- if (!existsSync28(outputDir)) mkdirSync17(outputDir, { recursive: true });
19991
+ if (!existsSync30(outputDir)) mkdirSync17(outputDir, { recursive: true });
19948
19992
  return { input, cleanupProjectDir, absoluteOutputPath };
19949
19993
  }
19950
19994
  function validateRenderOverrides(body) {
@@ -19985,11 +20029,11 @@ function prepareProjectDirectory(projectDir, options) {
19985
20029
  const candidate = nonEmptyString(projectDir);
19986
20030
  if (!candidate) return null;
19987
20031
  const absProjectDir = resolve10(candidate);
19988
- if (!existsSync28(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
20032
+ if (!existsSync30(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
19989
20033
  return { error: `Project directory not found: ${absProjectDir}` };
19990
20034
  }
19991
20035
  const entry = options.entryFile || "index.html";
19992
- if (!existsSync28(resolve10(absProjectDir, entry))) {
20036
+ if (!existsSync30(resolve10(absProjectDir, entry))) {
19993
20037
  return { error: `Entry file "${entry}" not found in project directory: ${absProjectDir}` };
19994
20038
  }
19995
20039
  return { prepared: { input: { projectDir: absProjectDir, ...options } } };
@@ -20011,7 +20055,7 @@ async function resolveInlineRenderHtml(body) {
20011
20055
  function materializeInlineProject(html, options) {
20012
20056
  const tempRoot = process.env.PRODUCER_TMP_PROJECT_DIR || tmpdir5();
20013
20057
  const tempProjectDir = mkdtempSync8(join43(tempRoot, "producer-project-"));
20014
- writeFileSync12(join43(tempProjectDir, "index.html"), html, "utf-8");
20058
+ writeFileSync13(join43(tempProjectDir, "index.html"), html, "utf-8");
20015
20059
  return {
20016
20060
  prepared: {
20017
20061
  input: { projectDir: tempProjectDir, ...options },
@@ -20081,7 +20125,7 @@ function cleanupTempDir(dir, log) {
20081
20125
  }
20082
20126
  }
20083
20127
  function outputFileSize(path) {
20084
- return existsSync28(path) ? statSync10(path).size : 0;
20128
+ return existsSync30(path) ? statSync10(path).size : 0;
20085
20129
  }
20086
20130
  function createBlockingProgressReporter(log, requestId) {
20087
20131
  let lastLoggedPct = -10;
@@ -20385,7 +20429,7 @@ function createRenderHandlers(options = {}) {
20385
20429
  if (!artifact) {
20386
20430
  return c.json({ success: false, error: "Output artifact not found or expired" }, 404);
20387
20431
  }
20388
- if (!existsSync28(artifact.path)) {
20432
+ if (!existsSync30(artifact.path)) {
20389
20433
  store.delete(token);
20390
20434
  return c.json({ success: false, error: "Output artifact file missing" }, 404);
20391
20435
  }
@@ -20432,7 +20476,7 @@ function startServer(options = {}) {
20432
20476
  });
20433
20477
  async function shutdown(signal) {
20434
20478
  log.info(`Received ${signal}, shutting down`);
20435
- const { drainBrowserPool } = await import("./src-DYWF24IK.js");
20479
+ const { drainBrowserPool } = await import("./src-272JLFKW.js");
20436
20480
  await drainBrowserPool().catch(() => {
20437
20481
  });
20438
20482
  const handle = await Promise.race([
@@ -20475,14 +20519,14 @@ import { join as join45 } from "path";
20475
20519
  // ../producer/src/services/distributed/assemble.ts
20476
20520
  import {
20477
20521
  cpSync as cpSync3,
20478
- existsSync as existsSync29,
20522
+ existsSync as existsSync31,
20479
20523
  mkdirSync as mkdirSync18,
20480
20524
  mkdtempSync as mkdtempSync9,
20481
20525
  readFileSync as readFileSync14,
20482
20526
  readdirSync as readdirSync11,
20483
20527
  rmSync as rmSync16,
20484
20528
  statSync as statSync11,
20485
- writeFileSync as writeFileSync13
20529
+ writeFileSync as writeFileSync14
20486
20530
  } from "fs";
20487
20531
  import { dirname as dirname17, join as join44 } from "path";
20488
20532
  function cfrRateControlArgs(locked) {
@@ -20517,7 +20561,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
20517
20561
  }
20518
20562
  const format = plan2.dimensions.format;
20519
20563
  const cfrEncoder = cfr ? readCfrEncoder(planDir, format) : null;
20520
- if (!existsSync29(dirname17(outputPath))) {
20564
+ if (!existsSync31(dirname17(outputPath))) {
20521
20565
  mkdirSync18(dirname17(outputPath), { recursive: true });
20522
20566
  }
20523
20567
  const workDir = mkdtempSync9(`${outputPath}.assemble-work-`);
@@ -20541,7 +20585,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
20541
20585
  try {
20542
20586
  const videoSources = cfrEncoder ? [await reencodeCfr(ctx, chunkPaths, cfrEncoder)] : chunkPaths;
20543
20587
  const finalPath = join44(workDir, `output.${format}`);
20544
- const audio = audioPath !== null && existsSync29(audioPath) ? audioPath : null;
20588
+ const audio = audioPath !== null && existsSync31(audioPath) ? audioPath : null;
20545
20589
  await writeJoined(ctx, videoSources, audio, finalPath);
20546
20590
  renameWithRetry(finalPath, outputPath);
20547
20591
  log.info("[assemble] stage timings", {
@@ -20559,7 +20603,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
20559
20603
  });
20560
20604
  }
20561
20605
  }
20562
- const fileSize = existsSync29(outputPath) ? statSync11(outputPath).size : 0;
20606
+ const fileSize = existsSync31(outputPath) ? statSync11(outputPath).size : 0;
20563
20607
  return {
20564
20608
  ...referenceBackgroundResult(plan2[REFERENCE_BACKGROUND_FIELD]),
20565
20609
  outputPath,
@@ -20571,13 +20615,13 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
20571
20615
  function readAssemblePlan(planDir, chunkPaths) {
20572
20616
  const planJsonPath = join44(planDir, "plan.json");
20573
20617
  const chunksJsonPath = join44(planDir, "meta", "chunks.json");
20574
- if (!existsSync29(planJsonPath)) {
20618
+ if (!existsSync31(planJsonPath)) {
20575
20619
  throw new Error(`[assemble] planDir missing plan.json: ${planJsonPath}`);
20576
20620
  }
20577
20621
  const plan2 = JSON.parse(readFileSync14(planJsonPath, "utf-8"));
20578
20622
  readPlanProtocolV1(plan2, DISTRIBUTED_RENDER_CAPABILITIES.roles.assembler);
20579
20623
  validatePlanV2MaterializedTarget(planDir, { role: "assembler" });
20580
- if (!existsSync29(chunksJsonPath)) {
20624
+ if (!existsSync31(chunksJsonPath)) {
20581
20625
  throw new Error(`[assemble] planDir missing meta/chunks.json: ${chunksJsonPath}`);
20582
20626
  }
20583
20627
  const chunks = JSON.parse(readFileSync14(chunksJsonPath, "utf-8"));
@@ -20592,7 +20636,7 @@ function readAssemblePlan(planDir, chunkPaths) {
20592
20636
  }
20593
20637
  }
20594
20638
  for (const path of chunkPaths.flat()) {
20595
- if (!existsSync29(path)) {
20639
+ if (!existsSync31(path)) {
20596
20640
  throw new Error(`[assemble] chunk path does not exist: ${path}`);
20597
20641
  }
20598
20642
  }
@@ -20690,7 +20734,7 @@ async function writeJoined(ctx, videoSources, audioPath, finalPath) {
20690
20734
  function concatDemuxerInput(chunkPaths, workDir, fpsArg) {
20691
20735
  const listPath = join44(workDir, "concat-list.txt");
20692
20736
  const body = chunkPaths.map((path) => `file '${path.replace(/'/g, "'\\''")}'`).join("\n");
20693
- writeFileSync13(listPath, `${body}
20737
+ writeFileSync14(listPath, `${body}
20694
20738
  `, "utf-8");
20695
20739
  return ["-r", fpsArg, "-f", "concat", "-safe", "0", "-i", listPath];
20696
20740
  }
@@ -20731,7 +20775,7 @@ function planFormat(planDir) {
20731
20775
  }
20732
20776
  function lockedAudio(planDir) {
20733
20777
  const encoderJsonPath = join44(planDir, "meta", "encoder.json");
20734
- if (!existsSync29(encoderJsonPath)) return {};
20778
+ if (!existsSync31(encoderJsonPath)) return {};
20735
20779
  return JSON.parse(readFileSync14(encoderJsonPath, "utf-8"));
20736
20780
  }
20737
20781
  function readCfrEncoder(planDir, format) {
@@ -20741,7 +20785,7 @@ function readCfrEncoder(planDir, format) {
20741
20785
  );
20742
20786
  }
20743
20787
  const encoderJsonPath = join44(planDir, "meta", "encoder.json");
20744
- if (!existsSync29(encoderJsonPath)) {
20788
+ if (!existsSync31(encoderJsonPath)) {
20745
20789
  throw new Error(`[assemble] planDir missing meta/encoder.json: ${encoderJsonPath}`);
20746
20790
  }
20747
20791
  const encoderJson = JSON.parse(readFileSync14(encoderJsonPath, "utf-8"));
@@ -20753,7 +20797,7 @@ function readCfrEncoder(planDir, format) {
20753
20797
  return encoderJson;
20754
20798
  }
20755
20799
  function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, startTimeMs) {
20756
- if (existsSync29(outputPath)) rmSync16(outputPath, { recursive: true, force: true });
20800
+ if (existsSync31(outputPath)) rmSync16(outputPath, { recursive: true, force: true });
20757
20801
  mkdirSync18(outputPath, { recursive: true });
20758
20802
  let globalIdx = 0;
20759
20803
  for (const chunkDir of chunkPaths) {
@@ -20777,7 +20821,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
20777
20821
  `[assemble] png-sequence frame count mismatch: merged ${globalIdx} frames vs plan.totalFrames=${totalFrames}. Using on-disk count.`
20778
20822
  );
20779
20823
  }
20780
- if (audioPath !== null && existsSync29(audioPath)) {
20824
+ if (audioPath !== null && existsSync31(audioPath)) {
20781
20825
  const sidecar = join44(outputPath, MIXED_AUDIO_FILENAME);
20782
20826
  cpSync3(audioPath, sidecar);
20783
20827
  }
@@ -20839,7 +20883,7 @@ import { extname as extname7 } from "path";
20839
20883
  var AUDIO_SIDECAR_MIN_BYTES = 32 * 1024 * 1024;
20840
20884
 
20841
20885
  // ../producer/src/services/distributed/probeFacts.ts
20842
- import { writeFileSync as writeFileSync14 } from "fs";
20886
+ import { writeFileSync as writeFileSync15 } from "fs";
20843
20887
  import { extname as extname8 } from "path";
20844
20888
 
20845
20889
  export {