hyperframes 0.8.195 → 0.8.197

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 (179) hide show
  1. package/dist/{add-NL6XABRV.js → add-5GQIR5OE.js} +12 -12
  2. package/dist/{animatedGifPrep-JD4BBM2L.js → animatedGifPrep-MGFQWIGJ.js} +8 -8
  3. package/dist/api.js +16 -16
  4. package/dist/{asset-LRRHLG4L.js → asset-ADX55DGH.js} +2 -2
  5. package/dist/{assetCataloger-D7KGO346.js → assetCataloger-GGBWBQZW.js} +8 -8
  6. package/dist/{audio-34CZM4HF.js → audio-SPB4CLRU.js} +14 -14
  7. package/dist/{auth-FL5ZMOXB.js → auth-WBAB35QA.js} +1 -1
  8. package/dist/{autoUpdate-FZTJFLIH.js → autoUpdate-5VUDX7JO.js} +2 -2
  9. package/dist/{backgroundChecks-6ZKDCQET.js → backgroundChecks-ATZQQUMR.js} +3 -3
  10. package/dist/backgroundChecksWorker.js +3 -3
  11. package/dist/{batchRender-KDZ4F4QT.js → batchRender-6S2XULOE.js} +4 -4
  12. package/dist/{beats-7PK677VR.js → beats-WJPHWDZ6.js} +9 -9
  13. package/dist/{benchmark-LO36QH5D.js → benchmark-LZVR7PF6.js} +9 -9
  14. package/dist/{browser-3F7NDHU2.js → browser-QJ3PFVDY.js} +3 -3
  15. package/dist/{bundleWithLocalizedFonts-JL5J52L6.js → bundleWithLocalizedFonts-564BQ73K.js} +2 -2
  16. package/dist/{capture-DOP3ONNZ.js → capture-3PUQLQNM.js} +11 -11
  17. package/dist/{capture-JOSZZYUW.js → capture-IRAYPK52.js} +2 -2
  18. package/dist/{captureCompositionFrame-SWZ4GEJP.js → captureCompositionFrame-OHS3WBTA.js} +13 -13
  19. package/dist/{catalog-EZLHZMLM.js → catalog-IQKJLTSF.js} +12 -12
  20. package/dist/{catch-up-6B7VY43I.js → catch-up-C4JJJNP3.js} +4 -4
  21. package/dist/{check-QGELCBBF.js → check-46Z5CAA4.js} +37 -37
  22. package/dist/{checkBrowser-A5C2AB4L.js → checkBrowser-KAC54SLQ.js} +32 -32
  23. package/dist/{chunk-NKNRVPNV.js → chunk-2C4VIQ2H.js} +2 -2
  24. package/dist/{chunk-D6XDOYMB.js → chunk-2R7QYR2D.js} +1 -1
  25. package/dist/{chunk-W7GMPEY3.js → chunk-33BFEUCL.js} +15 -11
  26. package/dist/{chunk-KJ6ZQL34.js → chunk-3DEBV7RH.js} +1 -1
  27. package/dist/{chunk-7DFIVUOW.js → chunk-3HOQ5ZMS.js} +6 -6
  28. package/dist/{chunk-L4BFXWHC.js → chunk-454VK7CA.js} +17 -17
  29. package/dist/{chunk-IZR7U27Z.js → chunk-46J53I7B.js} +47 -16
  30. package/dist/{chunk-SMROKE63.js → chunk-4FXJ54L4.js} +2 -2
  31. package/dist/{chunk-OB4GJZTY.js → chunk-4MNF7ALL.js} +1 -1
  32. package/dist/{chunk-GKMRLES4.js → chunk-5FY7ARKL.js} +1 -1
  33. package/dist/{chunk-YUFECVHG.js → chunk-5L6UY76S.js} +1 -1
  34. package/dist/{chunk-IZCW2NKT.js → chunk-5S7W3TUO.js} +1 -0
  35. package/dist/{chunk-YSXCPSJ4.js → chunk-6DMFWXDH.js} +3 -3
  36. package/dist/{chunk-KVLGJJTE.js → chunk-6LN4GQH3.js} +5 -5
  37. package/dist/{chunk-E527A6RS.js → chunk-6UX32GRW.js} +2 -2
  38. package/dist/{chunk-4R2NWLQL.js → chunk-7JMUJID2.js} +1 -1
  39. package/dist/{chunk-WUL5LPI2.js → chunk-AHE4R7PV.js} +9 -1
  40. package/dist/{chunk-F4T7XYMF.js → chunk-AXJMD32I.js} +1 -1
  41. package/dist/{chunk-FWDDLW2H.js → chunk-B6D7KOXQ.js} +2 -2
  42. package/dist/{chunk-ES7KSCSO.js → chunk-BF3ACZAB.js} +9 -9
  43. package/dist/{chunk-3OAFRLD3.js → chunk-BNMVX4JK.js} +11 -8
  44. package/dist/{chunk-66Q27H72.js → chunk-BXXEQFRW.js} +2 -2
  45. package/dist/{chunk-NOHH25WS.js → chunk-C4REI4HU.js} +2 -2
  46. package/dist/{chunk-CCZMCX3F.js → chunk-DTC4KKFP.js} +1 -1
  47. package/dist/{chunk-ST35C4K6.js → chunk-DY53XJ3P.js} +1 -1
  48. package/dist/{chunk-BBXZPDEA.js → chunk-FFPKJU7T.js} +2 -2
  49. package/dist/{chunk-ROEW726S.js → chunk-FMTJ4I6I.js} +1 -1
  50. package/dist/{chunk-ORZMO6NY.js → chunk-FUAS4KCJ.js} +3 -3
  51. package/dist/chunk-G5RNOVAV.js +3901 -0
  52. package/dist/{chunk-7Y5RVQQ7.js → chunk-GC4NUZAR.js} +4 -4
  53. package/dist/{chunk-7G2LQM3J.js → chunk-GGURM4ZM.js} +27 -18
  54. package/dist/{chunk-VNWX5GBF.js → chunk-GI2WXOY5.js} +4 -3
  55. package/dist/{chunk-ZOJHEN3C.js → chunk-GM6WM6YH.js} +1 -1
  56. package/dist/{chunk-6ORTRIDW.js → chunk-IFOJM6PV.js} +3 -3
  57. package/dist/{chunk-SC6NILKD.js → chunk-IHSFWHXI.js} +1 -1
  58. package/dist/{chunk-E74JMKSK.js → chunk-IK4Q7EKF.js} +2 -2
  59. package/dist/{chunk-TE6VGYHQ.js → chunk-IY2NZKMG.js} +1 -1
  60. package/dist/{chunk-636WBDXB.js → chunk-J756NYRP.js} +5 -5
  61. package/dist/{chunk-GJG4CTXD.js → chunk-KBVJ6G65.js} +3 -3
  62. package/dist/{chunk-3PYIQLPL.js → chunk-MGSQPE6P.js} +1 -1
  63. package/dist/{chunk-YFTO5YD7.js → chunk-NAZ54XAE.js} +5 -5
  64. package/dist/{chunk-XOUWCZHD.js → chunk-OEC7RJVD.js} +1 -1
  65. package/dist/{chunk-W4SSWOOD.js → chunk-PDDVEHWJ.js} +2 -2
  66. package/dist/{chunk-OJNNKHAZ.js → chunk-PGDWNIOK.js} +7 -2
  67. package/dist/{chunk-RZUEXJRC.js → chunk-POYHL7UJ.js} +2 -2
  68. package/dist/{chunk-L2EBYFU7.js → chunk-PRURJIVL.js} +1 -1
  69. package/dist/{chunk-2OYYNKJ4.js → chunk-QXPZGDTI.js} +1 -1
  70. package/dist/{chunk-IA7HZ4CM.js → chunk-RHYXITPN.js} +3 -3
  71. package/dist/{chunk-GOOE33GV.js → chunk-RNPTRRLX.js} +1 -1
  72. package/dist/{chunk-ELQ2QQC5.js → chunk-SD2IVQXM.js} +1 -1
  73. package/dist/{chunk-HJINEUHY.js → chunk-T3CBCGU4.js} +179 -131
  74. package/dist/{chunk-7PXVXRVX.js → chunk-UP7IRMTI.js} +9 -9
  75. package/dist/{chunk-HTLCE7M2.js → chunk-VFSFTVOT.js} +67 -24
  76. package/dist/{chunk-CZNSLFYD.js → chunk-VLVQQJOX.js} +14 -7
  77. package/dist/{chunk-B7Y2DGU6.js → chunk-WKHPW2BC.js} +1 -1
  78. package/dist/{chunk-RAACYYWX.js → chunk-WNLHEUZU.js} +1 -1
  79. package/dist/{chunk-2G6JZJAV.js → chunk-WWE73ZFN.js} +2 -2
  80. package/dist/{chunk-HT33OHQL.js → chunk-WY6X5Q33.js} +1 -1
  81. package/dist/{chunk-ZL6ZCLY6.js → chunk-X56HO2IP.js} +1 -1
  82. package/dist/{chunk-XC7SJ2UR.js → chunk-X73MOLUS.js} +3 -3
  83. package/dist/{chunk-2HSRLKZR.js → chunk-XE5DW6UC.js} +3 -3
  84. package/dist/{chunk-B7RJV74O.js → chunk-XOTUPVIF.js} +4 -0
  85. package/dist/{chunk-2TU4OKIR.js → chunk-YUODO5H2.js} +31 -0
  86. package/dist/{chunk-ZAVUASNT.js → chunk-ZAY376M4.js} +1 -1
  87. package/dist/{chunk-P5X5URNQ.js → chunk-ZE6CLWXL.js} +1 -1
  88. package/dist/{clean-PI4JLT6O.js → clean-JM6Y5V2G.js} +18 -18
  89. package/dist/cli.js +53 -53
  90. package/dist/{cloud-SQRY723M.js → cloud-DWKTRWWB.js} +4 -4
  91. package/dist/{cloudrun-VMPROR43.js → cloudrun-HLUQOVRO.js} +6 -6
  92. package/dist/{compare-EHX4APTP.js → compare-GVTQBP4N.js} +29 -29
  93. package/dist/{compiler-FZCJGGBF.js → compiler-3MDCAKFB.js} +4 -4
  94. package/dist/{component-I75ZKJYH.js → component-QSRD6BSP.js} +3 -3
  95. package/dist/{compositions-YNYYUEQD.js → compositions-BDITIWMO.js} +12 -12
  96. package/dist/{delete-7BVTBKOC.js → delete-G2MXPSLU.js} +2 -2
  97. package/dist/{deploy-TUEEJP3W.js → deploy-Q7RDYGFL.js} +1 -1
  98. package/dist/{deterministicFonts-RADD3BSX.js → deterministicFonts-RMA7GDJC.js} +2 -2
  99. package/dist/{dist-VVROHSP4.js → dist-WHAM6TAE.js} +3 -3
  100. package/dist/{dist-VRGIE57H.js → dist-XPD7X6JB.js} +1 -1
  101. package/dist/{doctor-53DSQFW4.js → doctor-Q7SJW3MZ.js} +12 -12
  102. package/dist/{events-AD3U6E7I.js → events-DOABLVUG.js} +2 -2
  103. package/dist/{events-M6FIUDNQ.js → events-XEAJVOX2.js} +3 -3
  104. package/dist/{feedback-7SQ7KKAR.js → feedback-K7I2FQQF.js} +8 -8
  105. package/dist/{ffmpeg-3HSSPXS4.js → ffmpeg-2LKYJYAF.js} +8 -8
  106. package/dist/{figma-B5XII2BO.js → figma-LXJRAIDI.js} +3 -3
  107. package/dist/fontLocalizeCli.js +11 -11
  108. package/dist/{get-RZKNBIRD.js → get-EDCTYZB6.js} +2 -2
  109. package/dist/{gpuPolicy-77LOK3K6.js → gpuPolicy-4YOOXLBX.js} +8 -8
  110. package/dist/{grade-compare-K3YB3FQA.js → grade-compare-ZWUXB3MD.js} +30 -30
  111. package/dist/{help-UM6INVL5.js → help-LEZ3E433.js} +1 -1
  112. package/dist/{history-EWKPACWR.js → history-YD7OKO74.js} +7 -7
  113. package/dist/hyperframe.manifest.json +1 -1
  114. package/dist/hyperframe.runtime.iife.js +58 -58
  115. package/dist/hyperframes-player.global.js +1 -1
  116. package/dist/{info-KY3MFTCY.js → info-SI2KU7J7.js} +8 -8
  117. package/dist/{init-LURF2PL5.js → init-INX5WA2G.js} +28 -28
  118. package/dist/{inspect-46CZJM6P.js → inspect-SJENYN3F.js} +30 -30
  119. package/dist/{installer-NGFX6INI.js → installer-JQ6DMFZ2.js} +5 -5
  120. package/dist/{keyframes-YCSK6POI.js → keyframes-EAVHD4PM.js} +6 -6
  121. package/dist/{lambda-5KXULI2S.js → lambda-323RMLN5.js} +8 -8
  122. package/dist/{layout-WOLH24YE.js → layout-JGCQYWWK.js} +30 -30
  123. package/dist/{lint-P3P2LX6S.js → lint-SFE43W5P.js} +7 -7
  124. package/dist/{lintProject-ESAJKFOX.js → lintProject-Q4ZVEF3G.js} +1 -1
  125. package/dist/{list-RUYQWMF2.js → list-N2NSYK6G.js} +2 -2
  126. package/dist/{login-THBBWZAY.js → login-QGISW3KF.js} +4 -4
  127. package/dist/{manager-V34BMSAG.js → manager-IXZJADWC.js} +9 -9
  128. package/dist/{media-treatment-IMBLTYGV.js → media-treatment-BTA7BV52.js} +14 -14
  129. package/dist/{models-3NW7HU72.js → models-NZEBSWXZ.js} +12 -12
  130. package/dist/{motionShot-VTTYZ6KW.js → motionShot-E4GNRX4N.js} +16 -16
  131. package/dist/{normalize-audio-ME3X7HBX.js → normalize-audio-F4Q5ZX5R.js} +6 -6
  132. package/dist/{open-GLGSJISM.js → open-A4U2RXCG.js} +12 -12
  133. package/dist/{parakeetRunner-T3UGRZWC.js → parakeetRunner-OVNNGTEB.js} +13 -13
  134. package/dist/{pipeline-IJXVEQCU.js → pipeline-Z76DCEY7.js} +9 -9
  135. package/dist/{play-HFFGGAZH.js → play-NWSZMZZG.js} +21 -21
  136. package/dist/{preflight-QV6V3UO2.js → preflight-I6UXFNYV.js} +9 -9
  137. package/dist/{present-TH34CTYY.js → present-QFZQ5VRM.js} +17 -17
  138. package/dist/{preview-R67EQGQP.js → preview-GXNG3UOV.js} +19 -19
  139. package/dist/{producer-HWPFETDU.js → producer-MGXGNSQX.js} +1 -1
  140. package/dist/{projectConfig-AO4V3RHS.js → projectConfig-TNL3ZDIP.js} +7 -7
  141. package/dist/{publication-BDQ3PXYG.js → publication-OO772CBM.js} +3 -3
  142. package/dist/{publish-PXYTWSXN.js → publish-X33ZCMFO.js} +11 -11
  143. package/dist/{remove-background-BVDJPT3Z.js → remove-background-JAD2RBYP.js} +10 -10
  144. package/dist/{render-45YHWV6W.js → render-2FX26ITP.js} +6 -6
  145. package/dist/{render-5MZY4TAB.js → render-BZCK6XNT.js} +16 -16
  146. package/dist/{render-5RQUYPIV.js → render-OJEKVJNG.js} +30 -30
  147. package/dist/{render-batch-ZUTUBTHX.js → render-batch-SP6HKIF4.js} +6 -6
  148. package/dist/renderSetupWorker.js +1 -1
  149. package/dist/{resolver-FN2M3XVM.js → resolver-QB7L6U4Q.js} +5 -5
  150. package/dist/{sherpa-6KWNPRWB.js → sherpa-BZLXBJTD.js} +12 -12
  151. package/dist/skills/hyperframes/references/film.md +1 -0
  152. package/dist/skills/media-use/scripts/lib/recipe-store.mjs +1 -0
  153. package/dist/skills/media-use/scripts/lib/recipe-store.test.mjs +24 -0
  154. package/dist/skills/media-use/scripts/lib/svg-sanitize.mjs +2 -2
  155. package/dist/{skills-PWQCM2BT.js → skills-OMKCU4HZ.js} +5 -5
  156. package/dist/{skillsUpdateCheck-EHV2G3JX.js → skillsUpdateCheck-NNURJXBS.js} +3 -3
  157. package/dist/{snapshot-7Q24NFEI.js → snapshot-J7Y3PCCI.js} +58 -37
  158. package/dist/{src-OS2FRVZV.js → src-2YZVFDNC.js} +7 -7
  159. package/dist/{src-J43SXEHJ.js → src-T5WHBOD2.js} +10 -10
  160. package/dist/{staticProjectServer-YJWOQJF4.js → staticProjectServer-PHNKV2NL.js} +18 -18
  161. package/dist/studio/assets/{hyperframes-player-DnIPEARk.js → hyperframes-player-Cyi8HgFo.js} +1 -1
  162. package/dist/studio/assets/{index-Dkt4c1MV.js → index-6njHuMnJ.js} +106 -105
  163. package/dist/studio/assets/{index-CVppCm_X.js → index-DG6ZXBnu.js} +1 -1
  164. package/dist/studio/index.html +1 -1
  165. package/dist/{studio-api-CZBZ4D65.js → studio-api-VLJJP2GQ.js} +11 -11
  166. package/dist/{studioServer-U6EX5DSB.js → studioServer-G7RGGTWJ.js} +49 -49
  167. package/dist/{telemetry-VP4UWWO3.js → telemetry-2R6G2A54.js} +3 -3
  168. package/dist/{timeline-LMSUKEG6.js → timeline-B2CM5IZO.js} +19 -19
  169. package/dist/{tokens-FQ5AI5H4.js → tokens-7EOFUTMX.js} +2 -2
  170. package/dist/{transcribe-DNQFPZ2S.js → transcribe-7GTD3CEW.js} +11 -11
  171. package/dist/{transcribe-VAMXV7QS.js → transcribe-YJM673R7.js} +17 -17
  172. package/dist/{updateCheck-TOU7VLZK.js → updateCheck-JBIJ7L2D.js} +2 -2
  173. package/dist/{upgrade-CJRMRR2S.js → upgrade-WF2CBHOE.js} +2 -2
  174. package/dist/{urlDownloader-GETNWEIT.js → urlDownloader-HMXLCV4T.js} +7 -7
  175. package/dist/{validate-PRI2UTQS.js → validate-OHWQ7DQO.js} +24 -24
  176. package/dist/{video-VOCQA6AG.js → video-OEEM43V6.js} +8 -8
  177. package/dist/warmCheck.js +37 -37
  178. package/package.json +2 -2
  179. package/dist/chunk-ZQRD62QZ.js +0 -3901
@@ -6,8 +6,9 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  alphaDecoderFor,
9
+ pixelFormatHasAlpha,
9
10
  videoStreamHasAlpha
10
- } from "./chunk-IZCW2NKT.js";
11
+ } from "./chunk-5S7W3TUO.js";
11
12
  import {
12
13
  DISTRIBUTED_FPS,
13
14
  MEDIA_VISUAL_STYLE_PROPERTIES,
@@ -26,7 +27,7 @@ import {
26
27
  renderFrameIdForRenderId,
27
28
  resolveAuthoredTimingWindow,
28
29
  toFps
29
- } from "./chunk-E74JMKSK.js";
30
+ } from "./chunk-IK4Q7EKF.js";
30
31
  import {
31
32
  AUDIO_GROUP_RENDER_ID_ATTR,
32
33
  COLOR_GRADING_SOURCE_HIDDEN_ATTR,
@@ -63,7 +64,7 @@ import {
63
64
  sourceTimeAt,
64
65
  timeAtSourceTime,
65
66
  volumeSegmentSampleCount
66
- } from "./chunk-ZQRD62QZ.js";
67
+ } from "./chunk-G5RNOVAV.js";
67
68
  import {
68
69
  clampAudioGain,
69
70
  clipGain,
@@ -86,7 +87,7 @@ import {
86
87
  } from "./chunk-4UMPIPCQ.js";
87
88
  import {
88
89
  resolveReferencedStart
89
- } from "./chunk-2TU4OKIR.js";
90
+ } from "./chunk-YUODO5H2.js";
90
91
  import {
91
92
  FFMPEG_PATH_ENV,
92
93
  FFPROBE_PATH_ENV,
@@ -7862,7 +7863,7 @@ import {
7862
7863
  existsSync as existsSync5,
7863
7864
  ftruncateSync,
7864
7865
  mkdirSync as mkdirSync2,
7865
- mkdtempSync,
7866
+ mkdtempSync as mkdtempSync2,
7866
7867
  openSync,
7867
7868
  readFileSync as readFileSync3,
7868
7869
  readdirSync as readdirSync3,
@@ -7870,7 +7871,7 @@ import {
7870
7871
  writeFileSync as writeFileSync2,
7871
7872
  writeSync
7872
7873
  } from "fs";
7873
- import { join as join6, dirname as dirname2, extname, resolve } from "path";
7874
+ import { join as join7, dirname as dirname2, extname, resolve } from "path";
7874
7875
 
7875
7876
  // ../engine/src/utils/gpuEncoder.ts
7876
7877
  import { spawn } from "child_process";
@@ -8437,9 +8438,10 @@ async function runFfmpeg(args, opts) {
8437
8438
 
8438
8439
  // ../engine/src/utils/ffprobe.ts
8439
8440
  import { spawn as spawn3 } from "child_process";
8440
- import { createReadStream, readFileSync, statSync as statSync2 } from "fs";
8441
+ import { createReadStream, mkdtempSync, readFileSync, rmSync, statSync as statSync2 } from "fs";
8441
8442
  import { StringDecoder as StringDecoder2 } from "string_decoder";
8442
- import { basename } from "path";
8443
+ import { tmpdir as tmpdir2 } from "os";
8444
+ import { basename, join as join5 } from "path";
8443
8445
 
8444
8446
  // ../engine/src/utils/urlInput.ts
8445
8447
  import { existsSync as existsSync4 } from "fs";
@@ -8915,6 +8917,49 @@ function parseFrameRate(frameRateStr) {
8915
8917
  if (!Number.isFinite(rounded)) return 0;
8916
8918
  return rounded > 0 ? rounded : 0.01;
8917
8919
  }
8920
+ async function probeDecodedAlphaPlane(filePath, decoder) {
8921
+ let probeDir;
8922
+ try {
8923
+ probeDir = mkdtempSync(join5(tmpdir2(), "hf-decoded-alpha-"));
8924
+ const framePath = join5(probeDir, "frame.nut");
8925
+ const decoded = await runFfmpeg(
8926
+ [
8927
+ "-v",
8928
+ "error",
8929
+ ...urlInputArgs(filePath),
8930
+ "-c:v",
8931
+ decoder,
8932
+ "-i",
8933
+ filePath,
8934
+ "-frames:v",
8935
+ "1",
8936
+ "-vf",
8937
+ "scale=8:8",
8938
+ "-c:v",
8939
+ "rawvideo",
8940
+ "-f",
8941
+ "nut",
8942
+ framePath
8943
+ ],
8944
+ { timeout: 3e4 }
8945
+ );
8946
+ if (!decoded.success) return void 0;
8947
+ const stdout = await runFfprobe(framePath, [
8948
+ "-select_streams",
8949
+ "v:0",
8950
+ "-show_entries",
8951
+ "stream=pix_fmt",
8952
+ "-of",
8953
+ "json"
8954
+ ]);
8955
+ const pixFmt = JSON.parse(stdout).streams?.[0]?.pix_fmt;
8956
+ return pixFmt ? pixelFormatHasAlpha(pixFmt) : void 0;
8957
+ } catch {
8958
+ return void 0;
8959
+ } finally {
8960
+ if (probeDir) rmSync(probeDir, { recursive: true, force: true });
8961
+ }
8962
+ }
8918
8963
  async function extractMediaMetadata(filePath) {
8919
8964
  const identity = mediaFileIdentity(filePath);
8920
8965
  const cached = readMetadataCache(videoMetadataCache, filePath, identity);
@@ -8969,6 +9014,8 @@ async function extractMediaMetadata(filePath) {
8969
9014
  const colorSpace = merged.colorTransfer || merged.colorPrimaries || merged.colorSpace ? merged : null;
8970
9015
  const pixelFormat = videoStream.pix_fmt || "";
8971
9016
  const hasAlpha = videoStreamHasAlpha(videoStream);
9017
+ const alphaDecoder = hasAlpha ? null : alphaDecoderFor(videoStream.codec_name);
9018
+ const alphaPlaneDecoded = alphaDecoder ? await probeDecodedAlphaPlane(filePath, alphaDecoder) : void 0;
8972
9019
  const containerDuration = output?.format.duration ? parseFloat(output.format.duration) : 0;
8973
9020
  const streamDuration = videoStream.duration ? parseFloat(videoStream.duration) : 0;
8974
9021
  const parsedStreamStart = videoStream.start_time ? parseFloat(videoStream.start_time) : 0;
@@ -8996,6 +9043,7 @@ async function extractMediaMetadata(filePath) {
8996
9043
  hasAudio: output?.streams.some((s) => s.codec_type === "audio") ?? false,
8997
9044
  isVFR,
8998
9045
  hasAlpha,
9046
+ ...alphaPlaneDecoded === void 0 ? {} : { alphaPlaneDecoded },
8999
9047
  colorSpace,
9000
9048
  colorRange: videoStream.color_range,
9001
9049
  pixelFormat,
@@ -9293,7 +9341,7 @@ function appendSoftwareEncoderThreadsArg(args, encoder, parallelism = availableP
9293
9341
 
9294
9342
  // ../engine/src/utils/renderProvenance.ts
9295
9343
  import { readFileSync as readFileSync2 } from "fs";
9296
- import { dirname, join as join5 } from "path";
9344
+ import { dirname, join as join6 } from "path";
9297
9345
  import { fileURLToPath } from "url";
9298
9346
  var PROVENANCE_RENDERER_TAG = "hyperframes_renderer";
9299
9347
  var PROVENANCE_VERSION_TAG = "hyperframes_version";
@@ -9304,7 +9352,7 @@ var MAX_WALK_DEPTH = 12;
9304
9352
  function resolveOwnVersionFrom(startDir) {
9305
9353
  let dir = startDir;
9306
9354
  for (let depth = 0; depth < MAX_WALK_DEPTH; depth++) {
9307
- const candidate = join5(dir, "package.json");
9355
+ const candidate = join6(dir, "package.json");
9308
9356
  let pkg;
9309
9357
  try {
9310
9358
  pkg = JSON.parse(readFileSync2(candidate, "utf8"));
@@ -9710,7 +9758,7 @@ function buildConcatArgs(concatListPath, outputPath) {
9710
9758
  var concatListSeq = 0;
9711
9759
  function writeConcatList(dir, inputPaths) {
9712
9760
  concatListSeq += 1;
9713
- const listPath = join6(dir, `concat-list-${process.pid}-${concatListSeq}.txt`);
9761
+ const listPath = join7(dir, `concat-list-${process.pid}-${concatListSeq}.txt`);
9714
9762
  const body = inputPaths.map((p) => `file '${resolve(p).replace(/'/g, "'\\''")}'`).join("\n");
9715
9763
  writeFileSync2(listPath, body, "utf-8");
9716
9764
  return listPath;
@@ -9754,7 +9802,7 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
9754
9802
  const chunkSize = Math.max(30, Math.floor(chunkSizeFrames));
9755
9803
  const chunkCount = Math.ceil(files.length / chunkSize);
9756
9804
  mkdirSync2(dirname2(outputPath), { recursive: true });
9757
- const chunkDir = mkdtempSync(join6(dirname2(outputPath), "chunk-encode-"));
9805
+ const chunkDir = mkdtempSync2(join7(dirname2(outputPath), "chunk-encode-"));
9758
9806
  const chunkPaths = [];
9759
9807
  for (let i = 0; i < chunkCount; i++) {
9760
9808
  if (signal?.aborted) {
@@ -9770,7 +9818,7 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
9770
9818
  const startNumber = i * chunkSize;
9771
9819
  const framesInChunk = Math.min(chunkSize, files.length - startNumber);
9772
9820
  const ext = outputPath.endsWith(".webm") ? ".webm" : outputPath.endsWith(".mov") ? ".mov" : ".mp4";
9773
- const chunkPath = join6(chunkDir, `chunk_${String(i).padStart(4, "0")}${ext}`);
9821
+ const chunkPath = join7(chunkDir, `chunk_${String(i).padStart(4, "0")}${ext}`);
9774
9822
  const inputPath = frameSequencePath(framesDir, framePattern);
9775
9823
  const inputArgs = [
9776
9824
  "-framerate",
@@ -9940,14 +9988,14 @@ async function packageHls(videoPath, audioPath, outputDir, options) {
9940
9988
  "-master_pl_name",
9941
9989
  HLS_MASTER_PLAYLIST,
9942
9990
  "-hls_segment_filename",
9943
- join6(outputDir, "%v_%05d.ts"),
9991
+ join7(outputDir, "%v_%05d.ts"),
9944
9992
  // Without these the mpegts muxer starts the stream at PTS 1.4 s.
9945
9993
  "-muxdelay",
9946
9994
  "0",
9947
9995
  "-muxpreload",
9948
9996
  "0"
9949
9997
  );
9950
- args.push("-y", join6(outputDir, "%v.m3u8"));
9998
+ args.push("-y", join7(outputDir, "%v.m3u8"));
9951
9999
  const processTimeout = options.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
9952
10000
  const result = await runFfmpeg(args, { signal, timeout: processTimeout });
9953
10001
  if (signal?.aborted) {
@@ -9959,7 +10007,7 @@ async function packageHls(videoPath, audioPath, outputDir, options) {
9959
10007
  };
9960
10008
  }
9961
10009
  if (result.success && hasAudio) {
9962
- const masterPath = join6(outputDir, HLS_MASTER_PLAYLIST);
10010
+ const masterPath = join7(outputDir, HLS_MASTER_PLAYLIST);
9963
10011
  let master;
9964
10012
  try {
9965
10013
  master = openSync(masterPath, "r+", 384);
@@ -10536,8 +10584,8 @@ function isMemberGroupHidden(groupsById, el) {
10536
10584
  }
10537
10585
 
10538
10586
  // ../engine/src/services/videoFrameExtractor.ts
10539
- import { copyFileSync as copyFileSync2, existsSync as existsSync9, linkSync as linkSync2, mkdirSync as mkdirSync6, rmSync as rmSync4 } from "fs";
10540
- import { join as join10 } from "path";
10587
+ import { copyFileSync as copyFileSync2, existsSync as existsSync9, linkSync as linkSync2, mkdirSync as mkdirSync6, rmSync as rmSync5 } from "fs";
10588
+ import { join as join11 } from "path";
10541
10589
  import { cpus } from "os";
10542
10590
 
10543
10591
  // ../engine/src/utils/concurrencyLimit.ts
@@ -10579,9 +10627,9 @@ function isKnownInactiveTimelineWindow(element, resolvedStart) {
10579
10627
  }
10580
10628
 
10581
10629
  // ../engine/src/utils/alphaPlaneProbe.ts
10582
- import { mkdtempSync as mkdtempSync2, readFileSync as readFileSync4, rmSync } from "fs";
10583
- import { tmpdir as tmpdir2 } from "os";
10584
- import { join as join7 } from "path";
10630
+ import { mkdtempSync as mkdtempSync3, readFileSync as readFileSync4, rmSync as rmSync2 } from "fs";
10631
+ import { tmpdir as tmpdir3 } from "os";
10632
+ import { join as join8 } from "path";
10585
10633
  var BYTES_PER_SAMPLE_FRAME = 8 * 8 * 4;
10586
10634
  var MAX_SAMPLE_BYTES = BYTES_PER_SAMPLE_FRAME * 3;
10587
10635
  function sampledRgbaAlphaIsFullyOpaque(buf) {
@@ -10596,8 +10644,8 @@ function sampledRgbaAlphaIsFullyOpaque(buf) {
10596
10644
  async function probeInputAlphaPlane(videoPath, decoder, signal) {
10597
10645
  let probeDir;
10598
10646
  try {
10599
- probeDir = mkdtempSync2(join7(tmpdir2(), "hf-alpha-probe-"));
10600
- const samplePath = join7(probeDir, "alpha.raw");
10647
+ probeDir = mkdtempSync3(join8(tmpdir3(), "hf-alpha-probe-"));
10648
+ const samplePath = join8(probeDir, "alpha.raw");
10601
10649
  const result = await runFfmpeg(
10602
10650
  [
10603
10651
  "-v",
@@ -10623,7 +10671,7 @@ async function probeInputAlphaPlane(videoPath, decoder, signal) {
10623
10671
  } catch {
10624
10672
  return void 0;
10625
10673
  } finally {
10626
- if (probeDir) rmSync(probeDir, { recursive: true, force: true });
10674
+ if (probeDir) rmSync2(probeDir, { recursive: true, force: true });
10627
10675
  }
10628
10676
  }
10629
10677
  function inputAlphaOpaqueWarning(src) {
@@ -10639,19 +10687,19 @@ import {
10639
10687
  existsSync as existsSync7,
10640
10688
  fsyncSync,
10641
10689
  linkSync,
10642
- mkdtempSync as mkdtempSync3,
10690
+ mkdtempSync as mkdtempSync4,
10643
10691
  mkdirSync as mkdirSync4,
10644
10692
  lstatSync,
10645
10693
  openSync as openSync2,
10646
10694
  readdirSync as readdirSync4,
10647
10695
  rmdirSync,
10648
- rmSync as rmSync2,
10696
+ rmSync as rmSync3,
10649
10697
  statSync as statSync5,
10650
10698
  unlinkSync
10651
10699
  } from "fs";
10652
10700
  import { createHash, randomUUID as randomUUID2 } from "crypto";
10653
10701
  import { BlockList, isIP } from "net";
10654
- import { dirname as dirname4, extname as extname2, join as join8 } from "path";
10702
+ import { dirname as dirname4, extname as extname2, join as join9 } from "path";
10655
10703
  import { Readable, Transform } from "stream";
10656
10704
  import { pipeline } from "stream/promises";
10657
10705
  var inFlightDownloads = /* @__PURE__ */ new Map();
@@ -10843,7 +10891,7 @@ function removeCacheLockDirectoryIfEmpty(lockPath) {
10843
10891
  }
10844
10892
  function releaseOwnedCachePathLock(lockPath, owner) {
10845
10893
  try {
10846
- rmdirSync(join8(lockPath, owner));
10894
+ rmdirSync(join9(lockPath, owner));
10847
10895
  } catch (error) {
10848
10896
  if (error.code === "ENOENT") return;
10849
10897
  throw error;
@@ -10884,12 +10932,12 @@ async function acquireCachePathLock(localPath, timeoutMs, signal) {
10884
10932
  if (createdLock) {
10885
10933
  const owner = `${CACHE_LOCK_OWNER_PREFIX}${randomUUID2()}`;
10886
10934
  try {
10887
- mkdirSync4(join8(lockPath, owner));
10935
+ mkdirSync4(join9(lockPath, owner));
10888
10936
  const entries = readdirSync4(lockPath);
10889
10937
  if (entries.length === 1 && entries[0] === owner) {
10890
10938
  return () => releaseOwnedCachePathLock(lockPath, owner);
10891
10939
  }
10892
- rmdirSync(join8(lockPath, owner));
10940
+ rmdirSync(join9(lockPath, owner));
10893
10941
  removeCacheLockDirectoryIfEmpty(lockPath);
10894
10942
  continue;
10895
10943
  } catch (error) {
@@ -10907,7 +10955,7 @@ async function acquireCachePathLock(localPath, timeoutMs, signal) {
10907
10955
  if (Date.now() - observedLock.stats.mtimeMs > CACHE_LOCK_STALE_MS) {
10908
10956
  if (observedLock.owner) {
10909
10957
  try {
10910
- rmdirSync(join8(lockPath, observedLock.owner));
10958
+ rmdirSync(join9(lockPath, observedLock.owner));
10911
10959
  } catch (error) {
10912
10960
  if (error.code === "ENOENT") continue;
10913
10961
  throw error;
@@ -10915,7 +10963,7 @@ async function acquireCachePathLock(localPath, timeoutMs, signal) {
10915
10963
  removeCacheLockDirectoryIfEmpty(lockPath);
10916
10964
  continue;
10917
10965
  }
10918
- const reclaimPath = join8(lockPath, CACHE_LOCK_RECLAIM_NAME);
10966
+ const reclaimPath = join9(lockPath, CACHE_LOCK_RECLAIM_NAME);
10919
10967
  try {
10920
10968
  mkdirSync4(reclaimPath);
10921
10969
  } catch (error) {
@@ -11355,8 +11403,8 @@ function emitDownloadTelemetry(options, event) {
11355
11403
  }
11356
11404
  }
11357
11405
  async function runDownloadAttempt(url, localPath, timeoutMs, attempt, options, signal) {
11358
- const attemptDir = mkdtempSync3(join8(dirname4(localPath), ".hf-download-"));
11359
- const partialPath = join8(attemptDir, "payload");
11406
+ const attemptDir = mkdtempSync4(join9(dirname4(localPath), ".hf-download-"));
11407
+ const partialPath = join9(attemptDir, "payload");
11360
11408
  const controller = new AbortController();
11361
11409
  let timedOut = false;
11362
11410
  let callerAborted = signal?.aborted ?? false;
@@ -11458,7 +11506,7 @@ async function runDownloadAttempt(url, localPath, timeoutMs, attempt, options, s
11458
11506
  clearTimeout(timeoutId);
11459
11507
  signal?.removeEventListener("abort", onCallerAbort);
11460
11508
  controller.abort();
11461
- rmSync2(attemptDir, { recursive: true, force: true });
11509
+ rmSync3(attemptDir, { recursive: true, force: true });
11462
11510
  }
11463
11511
  }
11464
11512
  async function downloadWithRetry(url, localPath, timeoutMs, signal, onTransientRetry, options = {}) {
@@ -11537,7 +11585,7 @@ async function reuseOrInvalidateCachedFile(url, localPath, timeoutMs, signal, op
11537
11585
  throw error;
11538
11586
  }
11539
11587
  if (!before.isFile() || before.size === 0) {
11540
- rmSync2(localPath, { recursive: before.isDirectory(), force: true });
11588
+ rmSync3(localPath, { recursive: before.isDirectory(), force: true });
11541
11589
  return false;
11542
11590
  }
11543
11591
  let inspection;
@@ -11569,7 +11617,7 @@ async function reuseOrInvalidateCachedFile(url, localPath, timeoutMs, signal, op
11569
11617
  });
11570
11618
  return true;
11571
11619
  }
11572
- rmSync2(localPath, { force: true });
11620
+ rmSync3(localPath, { force: true });
11573
11621
  return false;
11574
11622
  }
11575
11623
  return false;
@@ -11592,7 +11640,7 @@ async function downloadToTemp(url, destDir, timeoutMs = 3e5, signal, onTransient
11592
11640
  mkdirSync4(destDir, { recursive: true });
11593
11641
  }
11594
11642
  const filename = getFilenameFromUrl(url, validationScope);
11595
- const localPath = join8(destDir, filename);
11643
+ const localPath = join9(destDir, filename);
11596
11644
  const downloadPromise = (async () => {
11597
11645
  const cacheStartedAt = Date.now();
11598
11646
  const reused = await reuseOrInvalidateCachedFile(
@@ -11669,7 +11717,7 @@ import {
11669
11717
  lstatSync as lstatSync2,
11670
11718
  mkdirSync as mkdirSync5,
11671
11719
  readdirSync as readdirSync5,
11672
- rmSync as rmSync3,
11720
+ rmSync as rmSync4,
11673
11721
  statSync as statSync6,
11674
11722
  utimesSync,
11675
11723
  writeFileSync as writeFileSync3
@@ -11715,7 +11763,7 @@ async function renameWithRetryAsync(from, to, options = {}) {
11715
11763
  }
11716
11764
 
11717
11765
  // ../engine/src/services/extractionCache.ts
11718
- import { join as join9 } from "path";
11766
+ import { join as join10 } from "path";
11719
11767
  var COMPLETE_SENTINEL = ".hf-complete";
11720
11768
  var GC_MARKER = ".hf-last-gc";
11721
11769
  var SCHEMA_PREFIX = "hfcache-v8-";
@@ -11766,8 +11814,8 @@ function hasFrameFiles(dir) {
11766
11814
  }
11767
11815
  function lookupCacheEntry(rootDir, input) {
11768
11816
  const keyHash = computeCacheKey(input);
11769
- const dir = join9(rootDir, cacheEntryDirName(keyHash));
11770
- const complete = existsSync8(join9(dir, COMPLETE_SENTINEL)) && hasFrameFiles(dir);
11817
+ const dir = join10(rootDir, cacheEntryDirName(keyHash));
11818
+ const complete = existsSync8(join10(dir, COMPLETE_SENTINEL)) && hasFrameFiles(dir);
11771
11819
  return { entry: { dir, keyHash }, hit: complete };
11772
11820
  }
11773
11821
  function partialCacheEntryDir(entry) {
@@ -11778,13 +11826,13 @@ function isTargetExistsRenameError(err) {
11778
11826
  return code === "EEXIST" || code === "ENOTEMPTY" || code === "EPERM";
11779
11827
  }
11780
11828
  function adoptPublishedWinner(entry, partialDir) {
11781
- if (!existsSync8(join9(entry.dir, COMPLETE_SENTINEL)) || !hasFrameFiles(entry.dir)) return null;
11829
+ if (!existsSync8(join10(entry.dir, COMPLETE_SENTINEL)) || !hasFrameFiles(entry.dir)) return null;
11782
11830
  removeDir(partialDir);
11783
11831
  return { dir: entry.dir, published: true };
11784
11832
  }
11785
11833
  function publishCacheEntry(entry, partialDir) {
11786
11834
  try {
11787
- writeFileSync3(join9(partialDir, COMPLETE_SENTINEL), "", "utf-8");
11835
+ writeFileSync3(join10(partialDir, COMPLETE_SENTINEL), "", "utf-8");
11788
11836
  } catch {
11789
11837
  return { dir: partialDir, published: false };
11790
11838
  }
@@ -11797,7 +11845,7 @@ function publishCacheEntry(entry, partialDir) {
11797
11845
  const winner = adoptPublishedWinner(entry, partialDir);
11798
11846
  if (winner) return winner;
11799
11847
  try {
11800
- rmSync3(entry.dir, { recursive: true, force: true });
11848
+ rmSync4(entry.dir, { recursive: true, force: true });
11801
11849
  } catch {
11802
11850
  return { dir: partialDir, published: false };
11803
11851
  }
@@ -11815,7 +11863,7 @@ function touchCacheDir(dir) {
11815
11863
  } catch {
11816
11864
  }
11817
11865
  try {
11818
- utimesSync(join9(dir, COMPLETE_SENTINEL), now, now);
11866
+ utimesSync(join10(dir, COMPLETE_SENTINEL), now, now);
11819
11867
  } catch {
11820
11868
  }
11821
11869
  }
@@ -11844,7 +11892,7 @@ function directorySizeBytes(path) {
11844
11892
  return 0;
11845
11893
  }
11846
11894
  for (const child of children) {
11847
- const childPath = join9(path, child);
11895
+ const childPath = join10(path, child);
11848
11896
  try {
11849
11897
  const stat = lstatSync2(childPath);
11850
11898
  if (stat.isDirectory()) {
@@ -11859,7 +11907,7 @@ function directorySizeBytes(path) {
11859
11907
  }
11860
11908
  function removeDir(path) {
11861
11909
  try {
11862
- rmSync3(path, { recursive: true, force: true });
11910
+ rmSync4(path, { recursive: true, force: true });
11863
11911
  } catch {
11864
11912
  }
11865
11913
  }
@@ -11873,7 +11921,7 @@ function collectGcEntry(dir, name, now, minAgeMs, stats, remove) {
11873
11921
  }
11874
11922
  let lastUseMs = dirStat.mtimeMs;
11875
11923
  try {
11876
- lastUseMs = statSync6(join9(dir, COMPLETE_SENTINEL)).mtimeMs;
11924
+ lastUseMs = statSync6(join10(dir, COMPLETE_SENTINEL)).mtimeMs;
11877
11925
  } catch {
11878
11926
  }
11879
11927
  return { dir, size: directorySizeBytes(dir), lastUseMs, ageMs: now - lastUseMs };
@@ -11883,14 +11931,14 @@ function collectGcEntry(dir, name, now, minAgeMs, stats, remove) {
11883
11931
  }
11884
11932
  function gcSweepDue(rootDir, maxAgeMs) {
11885
11933
  try {
11886
- return Date.now() - statSync6(join9(rootDir, GC_MARKER)).mtimeMs > maxAgeMs;
11934
+ return Date.now() - statSync6(join10(rootDir, GC_MARKER)).mtimeMs > maxAgeMs;
11887
11935
  } catch {
11888
11936
  return true;
11889
11937
  }
11890
11938
  }
11891
11939
  function markGcSweep(rootDir) {
11892
11940
  try {
11893
- writeFileSync3(join9(rootDir, GC_MARKER), "", "utf-8");
11941
+ writeFileSync3(join10(rootDir, GC_MARKER), "", "utf-8");
11894
11942
  } catch {
11895
11943
  }
11896
11944
  }
@@ -11905,7 +11953,7 @@ function gcExtractionCache(rootDir, opts) {
11905
11953
  for (const child of readdirSync5(rootDir, { withFileTypes: true })) {
11906
11954
  if (!child.isDirectory() || !isCacheLikeChild(child.name)) continue;
11907
11955
  const entry = collectGcEntry(
11908
- join9(rootDir, child.name),
11956
+ join10(rootDir, child.name),
11909
11957
  child.name,
11910
11958
  now,
11911
11959
  opts.minAgeMs,
@@ -12460,7 +12508,7 @@ async function extractVideoFramesRangeUnredacted(videoPath, videoId, startTime,
12460
12508
  const normalizedFps = toFps(options.fps);
12461
12509
  const fps = fpsToNumber(normalizedFps);
12462
12510
  const ffmpegFps = fpsToFfmpegArg(normalizedFps);
12463
- const videoOutputDir = outputDirOverride ?? join10(outputDir, videoId);
12511
+ const videoOutputDir = outputDirOverride ?? join11(outputDir, videoId);
12464
12512
  if (!existsSync9(videoOutputDir)) mkdirSync6(videoOutputDir, { recursive: true });
12465
12513
  let metadata;
12466
12514
  try {
@@ -12838,8 +12886,8 @@ function decoderForCodec(codec) {
12838
12886
  return alphaDecoderFor(codec) ?? (codec ?? "").toLowerCase();
12839
12887
  }
12840
12888
  function resolveFrameFormat(metadata, requested) {
12841
- if (metadata.hasAlpha || SIDECAR_ALPHA_CODECS.has((metadata.videoCodec ?? "").toLowerCase()))
12842
- return "png";
12889
+ const sidecar = SIDECAR_ALPHA_CODECS.has((metadata.videoCodec ?? "").toLowerCase());
12890
+ if (metadata.hasAlpha || sidecar && metadata.alphaPlaneDecoded !== false) return "png";
12843
12891
  if (requested === "png" || requested === "jpg") return requested;
12844
12892
  return "jpg";
12845
12893
  }
@@ -12954,7 +13002,7 @@ function planSupersetGroups(misses, fps) {
12954
13002
  }
12955
13003
  function sliceSupersetMember(member, superset, outputDir, fps, configuredFps) {
12956
13004
  const { work } = member.miss;
12957
- rmSync4(outputDir, { recursive: true, force: true });
13005
+ rmSync5(outputDir, { recursive: true, force: true });
12958
13006
  mkdirSync6(outputDir, { recursive: true });
12959
13007
  const requestedFrames = extractionFrameCountForDuration(
12960
13008
  work.videoDuration,
@@ -12966,7 +13014,7 @@ function sliceSupersetMember(member, superset, outputDir, fps, configuredFps) {
12966
13014
  for (let i = 0; i < frameCount; i += 1) {
12967
13015
  const sourceFrame = superset.framePaths.get(member.offsetFrames + i);
12968
13016
  if (!sourceFrame) throw new Error(`superset frame ${member.offsetFrames + i} missing`);
12969
- linkOrCopyFrame(sourceFrame, join10(outputDir, frameFileName(i + 1, work.format)));
13017
+ linkOrCopyFrame(sourceFrame, join11(outputDir, frameFileName(i + 1, work.format)));
12970
13018
  }
12971
13019
  return extractedFramesFromDirectory(work, outputDir, work.videoPath, fps);
12972
13020
  }
@@ -13022,7 +13070,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
13022
13070
  continue;
13023
13071
  }
13024
13072
  if (isHttpUrl(videoPath)) {
13025
- const downloadDir = join10(options.outputDir, DOWNLOAD_SUBDIR);
13073
+ const downloadDir = join11(options.outputDir, DOWNLOAD_SUBDIR);
13026
13074
  mkdirSync6(downloadDir, { recursive: true });
13027
13075
  videoPath = await downloadToTemp(
13028
13076
  videoPath,
@@ -13063,7 +13111,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
13063
13111
  }
13064
13112
  breakdown.resolveMs = Date.now() - phase1Start;
13065
13113
  const contentKeyedDirs = [
13066
- join10(options.outputDir, DOWNLOAD_SUBDIR),
13114
+ join11(options.outputDir, DOWNLOAD_SUBDIR),
13067
13115
  ...options.contentKeyedDirs ?? []
13068
13116
  ];
13069
13117
  const cacheKeyInputs = resolvedVideos.map(({ video, videoPath }) => {
@@ -13270,7 +13318,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
13270
13318
  async function extractDirectMiss(miss, maxTransientRetries = options.maxTransientRetries ?? 0) {
13271
13319
  const { work, cacheTarget } = miss;
13272
13320
  if (!cacheTarget) {
13273
- const outputDir = join10(options.outputDir, work.video.id);
13321
+ const outputDir = join11(options.outputDir, work.video.id);
13274
13322
  const attempted2 = await runVideoExtractionWithRetry(
13275
13323
  () => extractVideoFramesRange(
13276
13324
  work.videoPath,
@@ -13286,14 +13334,14 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
13286
13334
  maxTransientRetries,
13287
13335
  onRetry: () => {
13288
13336
  recordTransientRetries(1);
13289
- rmSync4(outputDir, { recursive: true, force: true });
13337
+ rmSync5(outputDir, { recursive: true, force: true });
13290
13338
  }
13291
13339
  }
13292
13340
  );
13293
13341
  return attempted2.result;
13294
13342
  }
13295
13343
  const partialDir = partialCacheEntryDir(cacheTarget.entry);
13296
- rmSync4(partialDir, { recursive: true, force: true });
13344
+ rmSync5(partialDir, { recursive: true, force: true });
13297
13345
  mkdirSync6(partialDir, { recursive: true });
13298
13346
  const attempted = await runVideoExtractionWithRetry(
13299
13347
  () => extractVideoFramesRange(
@@ -13311,7 +13359,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
13311
13359
  maxTransientRetries,
13312
13360
  onRetry: () => {
13313
13361
  recordTransientRetries(1);
13314
- rmSync4(partialDir, { recursive: true, force: true });
13362
+ rmSync5(partialDir, { recursive: true, force: true });
13315
13363
  mkdirSync6(partialDir, { recursive: true });
13316
13364
  }
13317
13365
  }
@@ -13336,7 +13384,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
13336
13384
  const tailFrames = Math.min(expectedFrames, Math.ceil(fps));
13337
13385
  if (expectedFrames <= tailFrames) return null;
13338
13386
  const deferred = (totalFrames) => {
13339
- const outputDir = join10(options.outputDir, work.video.id);
13387
+ const outputDir = join11(options.outputDir, work.video.id);
13340
13388
  mkdirSync6(outputDir, { recursive: true });
13341
13389
  return {
13342
13390
  videoId: work.video.id,
@@ -13373,7 +13421,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
13373
13421
  const totalFrames = firstTailFrame + storedTailFrames;
13374
13422
  return totalFrames <= expectedFrames * 0.6 ? null : deferred(totalFrames);
13375
13423
  }
13376
- const probeDir = join10(options.outputDir, `${work.video.id}.tail-probe`);
13424
+ const probeDir = join11(options.outputDir, `${work.video.id}.tail-probe`);
13377
13425
  try {
13378
13426
  const tail = await extractVideoFramesRange(
13379
13427
  work.videoPath,
@@ -13395,7 +13443,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
13395
13443
  } catch {
13396
13444
  return null;
13397
13445
  } finally {
13398
- rmSync4(probeDir, { recursive: true, force: true });
13446
+ rmSync5(probeDir, { recursive: true, force: true });
13399
13447
  }
13400
13448
  }
13401
13449
  async function executeDirectMiss(miss, maxTransientRetries = options.maxTransientRetries ?? 0) {
@@ -13412,7 +13460,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
13412
13460
  return sliceSupersetMember(
13413
13461
  member,
13414
13462
  superset,
13415
- join10(options.outputDir, work.video.id),
13463
+ join11(options.outputDir, work.video.id),
13416
13464
  fps,
13417
13465
  configuredFps
13418
13466
  );
@@ -13429,9 +13477,9 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
13429
13477
  async function executeSupersetGroup(group) {
13430
13478
  const first = group.members[0]?.miss.work;
13431
13479
  if (!first) return [];
13432
- const tempDir = cacheRootDir ? join10(cacheRootDir, `${group.groupId}.partial-${process.pid}`) : join10(options.outputDir, group.groupId);
13480
+ const tempDir = cacheRootDir ? join11(cacheRootDir, `${group.groupId}.partial-${process.pid}`) : join11(options.outputDir, group.groupId);
13433
13481
  try {
13434
- rmSync4(tempDir, { recursive: true, force: true });
13482
+ rmSync5(tempDir, { recursive: true, force: true });
13435
13483
  const superset = await extractVideoFramesRange(
13436
13484
  first.videoPath,
13437
13485
  group.groupId,
@@ -13464,7 +13512,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
13464
13512
  );
13465
13513
  return fallback;
13466
13514
  } finally {
13467
- rmSync4(tempDir, { recursive: true, force: true });
13515
+ rmSync5(tempDir, { recursive: true, force: true });
13468
13516
  }
13469
13517
  }
13470
13518
  const preparedExtractions = await Promise.all(
@@ -13772,7 +13820,7 @@ var FrameLookupTable = class {
13772
13820
  for (const video of this.videos.values()) {
13773
13821
  if (video.extracted.ownedByLookup) continue;
13774
13822
  if (existsSync9(video.extracted.outputDir)) {
13775
- rmSync4(video.extracted.outputDir, { recursive: true, force: true });
13823
+ rmSync5(video.extracted.outputDir, { recursive: true, force: true });
13776
13824
  }
13777
13825
  }
13778
13826
  this.videos.clear();
@@ -14270,8 +14318,8 @@ async function queryElementStacking(page, nativeHdrIds) {
14270
14318
  }
14271
14319
 
14272
14320
  // ../engine/src/services/audioMixer.ts
14273
- import { closeSync as closeSync4, existsSync as existsSync11, mkdirSync as mkdirSync7, mkdtempSync as mkdtempSync7, openSync as openSync4, rmSync as rmSync8, writeFileSync as writeFileSync7 } from "fs";
14274
- import { join as join14, dirname as dirname7, isAbsolute, relative } from "path";
14321
+ import { closeSync as closeSync4, existsSync as existsSync11, mkdirSync as mkdirSync7, mkdtempSync as mkdtempSync8, openSync as openSync4, rmSync as rmSync9, writeFileSync as writeFileSync7 } from "fs";
14322
+ import { join as join15, dirname as dirname7, isAbsolute, relative } from "path";
14275
14323
 
14276
14324
  // ../engine/src/utils/notMediaPayload.ts
14277
14325
  import { createHash as createHash3 } from "crypto";
@@ -14390,8 +14438,8 @@ import { cpus as cpus2 } from "os";
14390
14438
 
14391
14439
  // ../engine/src/services/aacEncode.ts
14392
14440
  import { execFile as execFile3 } from "child_process";
14393
- import { mkdtempSync as mkdtempSync4, readFileSync as readFileSync5, rmSync as rmSync5, writeFileSync as writeFileSync4 } from "fs";
14394
- import { dirname as dirname5, join as join11 } from "path";
14441
+ import { mkdtempSync as mkdtempSync5, readFileSync as readFileSync5, rmSync as rmSync6, writeFileSync as writeFileSync4 } from "fs";
14442
+ import { dirname as dirname5, join as join12 } from "path";
14395
14443
  var SAMPLE_RATE = 48e3;
14396
14444
  var FRAME_SAMPLES = 1024;
14397
14445
  var MIN_SEGMENT_SECONDS = 60;
@@ -14454,11 +14502,11 @@ async function encodeAac(input, outputPath, totalDuration, {
14454
14502
  if (!await supportsSettsDuration()) {
14455
14503
  return encodeInOnePass(input, outputPath, { signal, timeout, filter });
14456
14504
  }
14457
- const dir = mkdtempSync4(join11(dirname5(outputPath), ".aac-segments-"));
14505
+ const dir = mkdtempSync5(join12(dirname5(outputPath), ".aac-segments-"));
14458
14506
  try {
14459
14507
  const segments = planSegments(totalDuration, count).map((segment, k) => ({
14460
14508
  ...segment,
14461
- path: join11(dir, `${k}.aac`)
14509
+ path: join12(dir, `${k}.aac`)
14462
14510
  }));
14463
14511
  const results = await Promise.all(
14464
14512
  segments.map(
@@ -14485,7 +14533,7 @@ async function encodeAac(input, outputPath, totalDuration, {
14485
14533
  );
14486
14534
  const failed = results.find((result) => !result.success);
14487
14535
  if (failed) return failed;
14488
- const joined = join11(dir, "joined.aac");
14536
+ const joined = join12(dir, "joined.aac");
14489
14537
  const frames = segments.flatMap(({ path, keepFrom, keepTo }) => {
14490
14538
  const segmentFrames = splitAdtsFrames(readFileSync5(path));
14491
14539
  if (segmentFrames.length < keepTo) {
@@ -14516,7 +14564,7 @@ async function encodeAac(input, outputPath, totalDuration, {
14516
14564
  const slowest = Math.max(...results.map((result) => result.durationMs));
14517
14565
  return { ...muxed, durationMs: slowest + muxed.durationMs };
14518
14566
  } finally {
14519
- rmSync5(dir, { recursive: true, force: true });
14567
+ rmSync6(dir, { recursive: true, force: true });
14520
14568
  }
14521
14569
  }
14522
14570
 
@@ -14619,8 +14667,8 @@ function audioFailureDiagnostics(values) {
14619
14667
  }
14620
14668
 
14621
14669
  // ../engine/src/services/audioVolumeEnvelope.ts
14622
- import { mkdtempSync as mkdtempSync5, readFileSync as readFileSync6, rmSync as rmSync6, writeFileSync as writeFileSync5 } from "fs";
14623
- import { dirname as dirname6, join as join12 } from "path";
14670
+ import { mkdtempSync as mkdtempSync6, readFileSync as readFileSync6, rmSync as rmSync7, writeFileSync as writeFileSync5 } from "fs";
14671
+ import { dirname as dirname6, join as join13 } from "path";
14624
14672
 
14625
14673
  // ../core/dist/runtime/mediaVolumeEnvelope.js
14626
14674
  function normaliseEnvelope(keyframes, trackStart, baseVolume) {
@@ -14746,8 +14794,8 @@ function applyVolumeEnvelopeToWav(wavPath, keyframes, trackStart, baseVolume) {
14746
14794
  const layout = parseWavLayout(buffer);
14747
14795
  if (!layout) return false;
14748
14796
  scaleSamples(buffer, layout, gainAt);
14749
- stagingDir = mkdtempSync5(join12(dirname6(wavPath), ".hf-volume-"));
14750
- const tempPath = join12(stagingDir, "audio.wav");
14797
+ stagingDir = mkdtempSync6(join13(dirname6(wavPath), ".hf-volume-"));
14798
+ const tempPath = join13(stagingDir, "audio.wav");
14751
14799
  writeFileSync5(tempPath, buffer, { flag: "wx" });
14752
14800
  renameWithRetry(tempPath, wavPath);
14753
14801
  return true;
@@ -14756,7 +14804,7 @@ function applyVolumeEnvelopeToWav(wavPath, keyframes, trackStart, baseVolume) {
14756
14804
  } finally {
14757
14805
  if (stagingDir) {
14758
14806
  try {
14759
- rmSync6(stagingDir, { recursive: true, force: true });
14807
+ rmSync7(stagingDir, { recursive: true, force: true });
14760
14808
  } catch {
14761
14809
  }
14762
14810
  }
@@ -14977,17 +15025,17 @@ function chainTailSeconds(chain, automation) {
14977
15025
  import {
14978
15026
  closeSync as closeSync3,
14979
15027
  existsSync as existsSync10,
14980
- mkdtempSync as mkdtempSync6,
15028
+ mkdtempSync as mkdtempSync7,
14981
15029
  openSync as openSync3,
14982
15030
  readFileSync as readFileSync7,
14983
15031
  readSync,
14984
- rmSync as rmSync7,
15032
+ rmSync as rmSync8,
14985
15033
  statSync as statSync7,
14986
15034
  writeFileSync as writeFileSync6,
14987
15035
  writeSync as writeSync2
14988
15036
  } from "fs";
14989
- import { tmpdir as tmpdir3 } from "os";
14990
- import { join as join13 } from "path";
15037
+ import { tmpdir as tmpdir4 } from "os";
15038
+ import { join as join14 } from "path";
14991
15039
  import { pathToFileURL } from "url";
14992
15040
 
14993
15041
  // ../core/dist/generated/audio-fx-runtime-inline.js
@@ -15339,7 +15387,7 @@ async function applyAudioFxChain(inputWav, chain, outputWav, options) {
15339
15387
  });
15340
15388
  }
15341
15389
  async function withFxBrowser(options, body) {
15342
- const hostDir = mkdtempSync6(join13(tmpdir3(), "hf-fx-host-"));
15390
+ const hostDir = mkdtempSync7(join14(tmpdir4(), "hf-fx-host-"));
15343
15391
  let lease = null;
15344
15392
  try {
15345
15393
  if (options.signal?.aborted) {
@@ -15354,14 +15402,14 @@ async function withFxBrowser(options, body) {
15354
15402
  `Audio FX failed for track ${options.trackId}: ${err.message}`
15355
15403
  );
15356
15404
  } finally {
15357
- rmSync7(hostDir, { recursive: true, force: true });
15405
+ rmSync8(hostDir, { recursive: true, force: true });
15358
15406
  await lease?.release().catch(() => void 0);
15359
15407
  }
15360
15408
  }
15361
15409
  async function openFxPage(browser, hostDir) {
15362
15410
  const page = await browser.newPage();
15363
15411
  try {
15364
- const hostPage = join13(hostDir, "audio-fx.html");
15412
+ const hostPage = join14(hostDir, "audio-fx.html");
15365
15413
  writeFileSync6(hostPage, "<!doctype html><meta charset=utf-8><title>audio fx</title>");
15366
15414
  await page.goto(pathToFileURL(hostPage).href, {
15367
15415
  waitUntil: "domcontentloaded"
@@ -15826,8 +15874,8 @@ async function extractAudioSegment(srcPath, outputPath, stage, mediaStart, durat
15826
15874
  });
15827
15875
  const loopDuration = (metadata?.durationSeconds ?? 0) - mediaStart;
15828
15876
  if (options?.loop && loopDuration > 0 && sourceDuration > loopDuration) {
15829
- const cycleDir = mkdtempSync7(join14(outputDir, ".audio-loop-"));
15830
- const cyclePath = join14(cycleDir, "cycle.wav");
15877
+ const cycleDir = mkdtempSync8(join15(outputDir, ".audio-loop-"));
15878
+ const cyclePath = join15(cycleDir, "cycle.wav");
15831
15879
  try {
15832
15880
  const cycle = await extractAudioSegment(
15833
15881
  srcPath,
@@ -15873,7 +15921,7 @@ async function extractAudioSegment(srcPath, outputPath, stage, mediaStart, durat
15873
15921
  failure: failure2
15874
15922
  };
15875
15923
  } finally {
15876
- rmSync8(cycleDir, { recursive: true, force: true });
15924
+ rmSync9(cycleDir, { recursive: true, force: true });
15877
15925
  }
15878
15926
  }
15879
15927
  const inputSeek = mediaStart >= (metadata?.latestStreamLeadSeconds ?? 0);
@@ -16020,8 +16068,8 @@ async function mixAudioTracksFlat(tracks, outputPath, totalDuration, signal, con
16020
16068
  const runMix = async (ignoreAutomation, useNormalize2) => {
16021
16069
  const inputs = [];
16022
16070
  tracks.forEach((track) => inputs.push("-i", track.srcPath));
16023
- const scriptDir = mkdtempSync7(join14(outputDir, ".filter-complex-"));
16024
- const scriptPath = join14(scriptDir, "graph.txt");
16071
+ const scriptDir = mkdtempSync8(join15(outputDir, ".filter-complex-"));
16072
+ const scriptPath = join15(scriptDir, "graph.txt");
16025
16073
  const fd = openSync4(scriptPath, "wx", 384);
16026
16074
  try {
16027
16075
  writeFileSync7(fd, buildFilterComplex(ignoreAutomation, useNormalize2));
@@ -16052,7 +16100,7 @@ async function mixAudioTracksFlat(tracks, outputPath, totalDuration, signal, con
16052
16100
  currentArgs[currentArgs.indexOf("-filter_complex_script")] = "-/filter_complex";
16053
16101
  return await runFfmpeg(currentArgs, { signal, timeout: ffmpegProcessTimeout });
16054
16102
  } finally {
16055
- rmSync8(scriptDir, { recursive: true, force: true });
16103
+ rmSync9(scriptDir, { recursive: true, force: true });
16056
16104
  }
16057
16105
  };
16058
16106
  let useNormalize = true;
@@ -16131,8 +16179,8 @@ async function mixGroupMembersFlat(memberTracks, outputPath, totalDuration, sign
16131
16179
  `${mixInputs}amix=inputs=${memberTracks.length}:duration=longest:dropout_transition=0[mixed];[mixed]volume=${formatFilterNumber(memberTracks.length)}[out]`
16132
16180
  );
16133
16181
  const filterComplex = [...inputFilters, mixFilter].join(";");
16134
- const scriptDir = mkdtempSync7(join14(outputDir, ".group-filter-complex-"));
16135
- const scriptPath = join14(scriptDir, "graph.txt");
16182
+ const scriptDir = mkdtempSync8(join15(outputDir, ".group-filter-complex-"));
16183
+ const scriptPath = join15(scriptDir, "graph.txt");
16136
16184
  const fd = openSync4(scriptPath, "wx", 384);
16137
16185
  try {
16138
16186
  writeFileSync7(fd, filterComplex);
@@ -16172,7 +16220,7 @@ async function mixGroupMembersFlat(memberTracks, outputPath, totalDuration, sign
16172
16220
  currentArgs[currentArgs.indexOf("-filter_complex_script")] = "-/filter_complex";
16173
16221
  return await runFfmpeg(currentArgs, { signal, timeout: ffmpegProcessTimeout });
16174
16222
  } finally {
16175
- rmSync8(scriptDir, { recursive: true, force: true });
16223
+ rmSync9(scriptDir, { recursive: true, force: true });
16176
16224
  }
16177
16225
  };
16178
16226
  let useNormalize = true;
@@ -16211,7 +16259,7 @@ async function sumInSlices(tracks, scratchDir, totalDuration, signal, config) {
16211
16259
  let degradedAutomation = false;
16212
16260
  for (let at = 0; at < tracks.length; at += MAX_MIX_INPUTS) {
16213
16261
  const id = `sum-${at / MAX_MIX_INPUTS}`;
16214
- const slicePath = join14(scratchDir, `${id}-slice.wav`);
16262
+ const slicePath = join15(scratchDir, `${id}-slice.wav`);
16215
16263
  const slice = await mixGroupMembersFlat(
16216
16264
  tracks.slice(at, at + MAX_MIX_INPUTS),
16217
16265
  slicePath,
@@ -16225,7 +16273,7 @@ async function sumInSlices(tracks, scratchDir, totalDuration, signal, config) {
16225
16273
  running = wavTrack(id, slicePath);
16226
16274
  continue;
16227
16275
  }
16228
- const foldedPath = join14(scratchDir, `${id}.wav`);
16276
+ const foldedPath = join15(scratchDir, `${id}.wav`);
16229
16277
  const folded = await mixGroupMembersFlat(
16230
16278
  [running, wavTrack(`${id}-slice`, slicePath)],
16231
16279
  foldedPath,
@@ -16233,8 +16281,8 @@ async function sumInSlices(tracks, scratchDir, totalDuration, signal, config) {
16233
16281
  signal,
16234
16282
  config
16235
16283
  );
16236
- rmSync8(running.srcPath, { force: true });
16237
- rmSync8(slicePath, { force: true });
16284
+ rmSync9(running.srcPath, { force: true });
16285
+ rmSync9(slicePath, { force: true });
16238
16286
  if (!folded.success) return folded;
16239
16287
  running = wavTrack(id, foldedPath);
16240
16288
  }
@@ -16246,14 +16294,14 @@ async function mixGroupMembers(memberTracks, outputPath, totalDuration, signal,
16246
16294
  return mixGroupMembersFlat(memberTracks, outputPath, totalDuration, signal, config);
16247
16295
  }
16248
16296
  mkdirSync7(dirname7(outputPath), { recursive: true });
16249
- const scratchDir = mkdtempSync7(join14(dirname7(outputPath), ".mix-batches-"));
16297
+ const scratchDir = mkdtempSync8(join15(dirname7(outputPath), ".mix-batches-"));
16250
16298
  try {
16251
16299
  const summed = await sumInSlices(memberTracks, scratchDir, totalDuration, signal, config);
16252
16300
  if (!summed.success) return summed;
16253
16301
  renameWithRetry(summed.track.srcPath, outputPath);
16254
16302
  return { success: true, degradedAutomation: summed.degradedAutomation };
16255
16303
  } finally {
16256
- rmSync8(scratchDir, { recursive: true, force: true });
16304
+ rmSync9(scratchDir, { recursive: true, force: true });
16257
16305
  }
16258
16306
  }
16259
16307
  async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config) {
@@ -16261,7 +16309,7 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config)
16261
16309
  return mixAudioTracksFlat(tracks, outputPath, totalDuration, signal, config);
16262
16310
  }
16263
16311
  mkdirSync7(dirname7(outputPath), { recursive: true });
16264
- const scratchDir = mkdtempSync7(join14(dirname7(outputPath), ".mix-batches-"));
16312
+ const scratchDir = mkdtempSync8(join15(dirname7(outputPath), ".mix-batches-"));
16265
16313
  try {
16266
16314
  const summed = await sumInSlices(tracks, scratchDir, totalDuration, signal, config);
16267
16315
  if (!summed.success) {
@@ -16287,16 +16335,16 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config)
16287
16335
  error: summed.degradedAutomation ? "Volume automation exceeded this ffmpeg build's expression limits; rendered at base volume" : mixed.error
16288
16336
  } : mixed;
16289
16337
  } finally {
16290
- rmSync8(scratchDir, { recursive: true, force: true });
16338
+ rmSync9(scratchDir, { recursive: true, force: true });
16291
16339
  }
16292
16340
  }
16293
16341
  async function mixThroughFloatSum(tracks, masterChain, outputPath, workDir, totalDuration, signal, config) {
16294
- const sumPath = join14(workDir, "master-sum.wav");
16342
+ const sumPath = join15(workDir, "master-sum.wav");
16295
16343
  const mixStart = Date.now();
16296
16344
  const sum = await mixAudioTracks(tracks, sumPath, totalDuration, signal, config);
16297
16345
  if (!sum.success) return { ...sum, outputPath };
16298
16346
  const masterStart = Date.now();
16299
- const encoderInput = masterChain ? (await applyAudioFxChain(sumPath, masterChain, join14(workDir, "master-fx.wav"), {
16347
+ const encoderInput = masterChain ? (await applyAudioFxChain(sumPath, masterChain, join15(workDir, "master-fx.wav"), {
16300
16348
  trackId: "master",
16301
16349
  signal
16302
16350
  })).path : sumPath;
@@ -16440,7 +16488,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
16440
16488
  }
16441
16489
  let audioSrcPath = srcPath;
16442
16490
  if (element.type === "video") {
16443
- const extractedPath = join14(workDir, `${element.id}-extracted.wav`);
16491
+ const extractedPath = join15(workDir, `${element.id}-extracted.wav`);
16444
16492
  const extractResult = await extractAudioSegment(
16445
16493
  srcPath,
16446
16494
  extractedPath,
@@ -16468,7 +16516,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
16468
16516
  }
16469
16517
  audioSrcPath = extractedPath;
16470
16518
  } else {
16471
- const trimmedPath = join14(workDir, `${element.id}-trimmed.wav`);
16519
+ const trimmedPath = join15(workDir, `${element.id}-trimmed.wav`);
16472
16520
  const prepResult = await extractAudioSegment(
16473
16521
  srcPath,
16474
16522
  trimmedPath,
@@ -16520,7 +16568,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
16520
16568
  const fxResult = await applyAudioFxChain(
16521
16569
  audioSrcPath,
16522
16570
  chain,
16523
- join14(workDir, `${element.id}-fx.wav`),
16571
+ join15(workDir, `${element.id}-fx.wav`),
16524
16572
  {
16525
16573
  trackId: element.id,
16526
16574
  signal: effectiveSignal,
@@ -16573,7 +16621,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
16573
16621
  ).catch((err) => {
16574
16622
  internalController.abort();
16575
16623
  try {
16576
- rmSync8(workDir, { recursive: true, force: true });
16624
+ rmSync9(workDir, { recursive: true, force: true });
16577
16625
  } catch {
16578
16626
  }
16579
16627
  throw err;
@@ -16598,7 +16646,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
16598
16646
  });
16599
16647
  const removeWorkDir = () => {
16600
16648
  try {
16601
- rmSync8(workDir, { recursive: true, force: true });
16649
+ rmSync9(workDir, { recursive: true, force: true });
16602
16650
  } catch {
16603
16651
  }
16604
16652
  };
@@ -16643,7 +16691,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
16643
16691
  const meta = groupMeta.get(groupId);
16644
16692
  if (!meta) continue;
16645
16693
  const pathId = safePathSegment(groupId, groupIndex);
16646
- const groupWavPath = join14(workDir, `group-${pathId}.wav`);
16694
+ const groupWavPath = join15(workDir, `group-${pathId}.wav`);
16647
16695
  try {
16648
16696
  const subMix = await mixGroupMembers(
16649
16697
  memberTracks,
@@ -16676,7 +16724,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
16676
16724
  const fxResult = await applyAudioFxChain(
16677
16725
  groupSrcPath,
16678
16726
  chain,
16679
- join14(workDir, `group-${pathId}-fx.wav`),
16727
+ join15(workDir, `group-${pathId}-fx.wav`),
16680
16728
  {
16681
16729
  trackId: groupId,
16682
16730
  signal: effectiveSignal,
@@ -16758,21 +16806,21 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
16758
16806
  import { cpus as cpus3, freemem } from "os";
16759
16807
  import { existsSync as existsSync12, mkdirSync as mkdirSync8, readdirSync as readdirSync6 } from "fs";
16760
16808
  import { copyFile, readFile as readFile2 } from "fs/promises";
16761
- import { join as join16 } from "path";
16809
+ import { join as join17 } from "path";
16762
16810
  import { getHeapStatistics } from "v8";
16763
16811
 
16764
16812
  // ../engine/src/utils/psnr.ts
16765
16813
  import { execFile as execFile4 } from "child_process";
16766
16814
  import { mkdtemp, rm, writeFile } from "fs/promises";
16767
- import { tmpdir as tmpdir4 } from "os";
16768
- import { join as join15 } from "path";
16815
+ import { tmpdir as tmpdir5 } from "os";
16816
+ import { join as join16 } from "path";
16769
16817
  import { promisify as promisify3 } from "util";
16770
16818
  async function psnrDb(a, b) {
16771
16819
  const execFileP = promisify3(execFile4);
16772
- const dir = await mkdtemp(join15(tmpdir4(), "hf-de-verify-"));
16820
+ const dir = await mkdtemp(join16(tmpdir5(), "hf-de-verify-"));
16773
16821
  try {
16774
- const pa = join15(dir, "a.jpg");
16775
- const pb = join15(dir, "b.jpg");
16822
+ const pa = join16(dir, "a.jpg");
16823
+ const pb = join16(dir, "b.jpg");
16776
16824
  await Promise.all([writeFile(pa, a), writeFile(pb, b)]);
16777
16825
  const { stderr } = await execFileP(
16778
16826
  getFfmpegBinary(),
@@ -16996,7 +17044,7 @@ function distributeFrames(totalFrames, workerCount, workDir, rangeStart = 0) {
16996
17044
  workerId: i,
16997
17045
  startFrame,
16998
17046
  endFrame,
16999
- outputDir: join16(workDir, `worker-${i}`),
17047
+ outputDir: join17(workDir, `worker-${i}`),
17000
17048
  outputFrameOffset: rangeStart
17001
17049
  });
17002
17050
  }
@@ -17010,7 +17058,7 @@ function distributeFramesInterleaved(totalFrames, workerCount, workDir, rangeSta
17010
17058
  startFrame: rangeStart + i,
17011
17059
  endFrame: rangeStart + totalFrames,
17012
17060
  frameStride: workerCount,
17013
- outputDir: join16(workDir, `worker-${i}`),
17061
+ outputDir: join17(workDir, `worker-${i}`),
17014
17062
  outputFrameOffset: rangeStart
17015
17063
  });
17016
17064
  }
@@ -17212,7 +17260,7 @@ async function verifyDiskDrawElementSamples(session, task, streaming) {
17212
17260
  for (const idx of selectVerifySampleIndicesForTask(truths.keys(), task)) {
17213
17261
  const truth = truths.get(idx);
17214
17262
  if (!truth) continue;
17215
- const framePath = join16(task.outputDir, `frame_${String(idx - offset).padStart(6, "0")}.${ext}`);
17263
+ const framePath = join17(task.outputDir, `frame_${String(idx - offset).padStart(6, "0")}.${ext}`);
17216
17264
  const db = await psnrForDiskSample(framePath, truth, task.workerId, idx);
17217
17265
  if (db === null) continue;
17218
17266
  assertDiskSampleAboveFloor(db, verifyMinDb, idx, task.workerId);
@@ -17457,8 +17505,8 @@ async function mergeWorkerFrames(workDir, tasks, outputDir) {
17457
17505
  }
17458
17506
  const files = readdirSync6(task.outputDir).filter((f) => f.startsWith("frame_") && (f.endsWith(".jpg") || f.endsWith(".png"))).sort();
17459
17507
  const copyTasks = files.map(async (file) => {
17460
- const sourcePath = join16(task.outputDir, file);
17461
- const targetPath = join16(outputDir, file);
17508
+ const sourcePath = join17(task.outputDir, file);
17509
+ const targetPath = join17(outputDir, file);
17462
17510
  try {
17463
17511
  await renameWithRetryAsync(sourcePath, targetPath);
17464
17512
  } catch {
@@ -17483,7 +17531,7 @@ function getSystemResources() {
17483
17531
  import { Hono } from "hono";
17484
17532
  import { serve } from "@hono/node-server";
17485
17533
  import { readFileSync as readFileSync8, openSync as openSync5, fstatSync, closeSync as closeSync5, statSync as statSync8, constants } from "fs";
17486
- import { join as join17, extname as extname3 } from "path";
17534
+ import { join as join18, extname as extname3 } from "path";
17487
17535
  var MIME_TYPES = {
17488
17536
  ".html": "text/html; charset=utf-8",
17489
17537
  ".css": "text/css; charset=utf-8",
@@ -17530,10 +17578,10 @@ function readRegularFile(filePath) {
17530
17578
  }
17531
17579
  }
17532
17580
  function resolveContainedPaths(projectDir, compiledDir, relativePath) {
17533
- const projectPath = join17(projectDir, relativePath);
17581
+ const projectPath = join18(projectDir, relativePath);
17534
17582
  if (!isWithinProjectRoot(projectDir, projectPath)) return null;
17535
17583
  if (!compiledDir) return { projectPath, compiledPath: null };
17536
- const compiledPath = join17(compiledDir, relativePath);
17584
+ const compiledPath = join18(compiledDir, relativePath);
17537
17585
  if (!isWithinProjectRoot(compiledDir, compiledPath)) return null;
17538
17586
  return { projectPath, compiledPath };
17539
17587
  }