hyperframes 0.8.211 → 0.8.213

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 (220) hide show
  1. package/dist/{add-WERDY37C.js → add-GRJ6BQMO.js} +14 -13
  2. package/dist/{agentPromptGenerator-SEAPWYY5.js → agentPromptGenerator-2HTUGEKK.js} +6 -6
  3. package/dist/{animatedGifPrep-LC43PROA.js → animatedGifPrep-7KPZBZXD.js} +6 -6
  4. package/dist/api.js +18 -18
  5. package/dist/{asset-IVDQNYHP.js → asset-YVIFFWCU.js} +5 -4
  6. package/dist/{assetCataloger-PPE7M2WM.js → assetCataloger-IZW7LPCT.js} +7 -7
  7. package/dist/{audio-IJ22GXO6.js → audio-X7274SUF.js} +316 -210
  8. package/dist/{auth-FZMDHX2H.js → auth-II6SIDJD.js} +4 -4
  9. package/dist/{autoUpdate-EO6SFALF.js → autoUpdate-WJIT74BG.js} +4 -2
  10. package/dist/{backgroundChecks-YW5VIAYF.js → backgroundChecks-NMKJAES7.js} +5 -3
  11. package/dist/backgroundChecksWorker.js +5 -3
  12. package/dist/{batchRender-OOXYNZOT.js → batchRender-I7GRY73M.js} +8 -7
  13. package/dist/{beats-X7GRQA4J.js → beats-6VXALJZT.js} +15 -14
  14. package/dist/{benchmark-JGGBMRZO.js → benchmark-RLIRA74V.js} +19 -17
  15. package/dist/{browser-FQ5JPTME.js → browser-7T3JMNTR.js} +12 -10
  16. package/dist/{bundleWithLocalizedFonts-XA73ZJ4S.js → bundleWithLocalizedFonts-C2LP6QZZ.js} +2 -2
  17. package/dist/{capture-GUVCA5JQ.js → capture-OZFDTN4A.js} +48 -18
  18. package/dist/{capture-KKVB3MKM.js → capture-V4HWHG7C.js} +13 -10
  19. package/dist/{captureCompositionFrame-LNKWWCXE.js → captureCompositionFrame-WZAVXCRQ.js} +14 -13
  20. package/dist/{catalog-LKJEMEOC.js → catalog-UFC7JS4T.js} +18 -17
  21. package/dist/{catch-up-FA6KWX4S.js → catch-up-YBNKJDWJ.js} +8 -7
  22. package/dist/{check-6GIDKL6S.js → check-ESQJHRGA.js} +42 -41
  23. package/dist/{checkAudio-H3AUFC4M.js → checkAudio-OIIBWFBF.js} +26 -11
  24. package/dist/{checkBrowser-YWWF63S6.js → checkBrowser-WAWL6TKX.js} +35 -34
  25. package/dist/{chunk-KSNIYQRB.js → chunk-26AQTUU4.js} +5 -7
  26. package/dist/{chunk-B2B4MN3R.js → chunk-2GS2RUVI.js} +2 -2
  27. package/dist/{chunk-WNDTMINP.js → chunk-2WELGDXU.js} +3 -3
  28. package/dist/{chunk-OE5EHGDG.js → chunk-3OYLHBQZ.js} +1 -1
  29. package/dist/{chunk-U46JEU26.js → chunk-4645UHJF.js} +1 -0
  30. package/dist/{chunk-FI7SSV73.js → chunk-46HYDDZ5.js} +1 -1
  31. package/dist/{chunk-YPNBEBQ6.js → chunk-4BXPCS5B.js} +26 -19
  32. package/dist/{chunk-ABBVDJMG.js → chunk-53VXGZ3L.js} +2 -2
  33. package/dist/{chunk-66KMYUNO.js → chunk-5ODMV7X6.js} +2 -2
  34. package/dist/{chunk-MMJAHBH2.js → chunk-5SKC4G26.js} +4 -1
  35. package/dist/{chunk-J2JG4XGP.js → chunk-5ZBMHUY2.js} +4 -0
  36. package/dist/{chunk-YRO3PXWU.js → chunk-6CGYINE7.js} +97 -2
  37. package/dist/{chunk-JMD5HDPB.js → chunk-6ZLDIMPL.js} +2 -2
  38. package/dist/{chunk-3R5MYOJN.js → chunk-76T7KAYD.js} +2 -2
  39. package/dist/{chunk-OOA6C4AG.js → chunk-7I5N36JA.js} +2 -2
  40. package/dist/{chunk-CNU65QE2.js → chunk-7JWRVKN4.js} +9 -5
  41. package/dist/{chunk-CJ5QZRY7.js → chunk-7KBS6ZLB.js} +2 -2
  42. package/dist/{chunk-T2L2GJ4C.js → chunk-7LOVQRUJ.js} +7 -7
  43. package/dist/{chunk-FBN5AQJL.js → chunk-7TWX4Y7I.js} +3 -3
  44. package/dist/{chunk-VBC3DQFS.js → chunk-AJ3QW6RX.js} +12 -5
  45. package/dist/{chunk-FIC3E7IM.js → chunk-BE6XXZAR.js} +9 -9
  46. package/dist/{chunk-5MCR5DA5.js → chunk-BVHNFPRF.js} +5 -5
  47. package/dist/{chunk-PKWZG642.js → chunk-CLA4XSBO.js} +3 -3
  48. package/dist/{chunk-DAXKGMJL.js → chunk-D3Q2TABU.js} +5 -5
  49. package/dist/{chunk-AIY2Y5UY.js → chunk-DJFEYX23.js} +5 -5
  50. package/dist/{chunk-FVY2XRX4.js → chunk-DKEZSH6M.js} +2 -2
  51. package/dist/{chunk-LALLQUSK.js → chunk-DP5LF7GF.js} +2 -0
  52. package/dist/{chunk-Q52ISCT4.js → chunk-DQ26IA5P.js} +1 -1
  53. package/dist/{chunk-3WL7WU6K.js → chunk-ENE4IKFX.js} +19 -20
  54. package/dist/{chunk-JZVUSRZ5.js → chunk-EQ66MVWZ.js} +1 -1
  55. package/dist/{chunk-VWG7OQKU.js → chunk-EQGKUPBJ.js} +4 -1
  56. package/dist/{chunk-KZBBY72Q.js → chunk-F4EX52FU.js} +1 -1
  57. package/dist/{chunk-4JWKC3GH.js → chunk-FGIMC5I4.js} +5 -5
  58. package/dist/{chunk-CGAUUUDL.js → chunk-FHO3FXTW.js} +3 -3
  59. package/dist/chunk-FJ646TIT.js +201 -0
  60. package/dist/{chunk-77KGX4A3.js → chunk-FKFGGAXN.js} +50 -8
  61. package/dist/{chunk-VUEWZXZG.js → chunk-G6HUXX3L.js} +1 -1
  62. package/dist/{chunk-5YHQBCWH.js → chunk-G6OKQMJI.js} +12 -2
  63. package/dist/{chunk-VGKQFZCC.js → chunk-GNSNCIHF.js} +14 -14
  64. package/dist/{chunk-SXJJTFV4.js → chunk-H3I2VLLL.js} +16 -4
  65. package/dist/{chunk-UYEZTK4U.js → chunk-HPTFD6MO.js} +10 -10
  66. package/dist/{chunk-5KOZRJR7.js → chunk-HWHPYCBZ.js} +1 -1
  67. package/dist/{chunk-22OGII5H.js → chunk-I3G45TWG.js} +1 -1
  68. package/dist/{chunk-DMIFCIG6.js → chunk-IHYWP4V5.js} +1 -1
  69. package/dist/{chunk-5LITFBMY.js → chunk-ISMOBMWF.js} +35 -24
  70. package/dist/{chunk-DDRCX7P2.js → chunk-KL2UJXCY.js} +2 -2
  71. package/dist/{chunk-KDDO3UYI.js → chunk-KSMCX5EP.js} +3 -3
  72. package/dist/{chunk-UI7X4L4M.js → chunk-KVFOQ3EM.js} +2137 -2100
  73. package/dist/{chunk-472C35EW.js → chunk-KY67MTBH.js} +1 -1
  74. package/dist/{chunk-DPYI2HRJ.js → chunk-L34IH4SH.js} +5 -5
  75. package/dist/{chunk-AHPGAESX.js → chunk-L72RQ45A.js} +1 -1
  76. package/dist/{chunk-YWPCMOX4.js → chunk-LALMFSLB.js} +5 -5
  77. package/dist/{chunk-4D46TX6Q.js → chunk-LGDRKQKL.js} +1 -1
  78. package/dist/{chunk-DWIMUPFK.js → chunk-LTQXIYNL.js} +2 -2
  79. package/dist/{chunk-Z2UZAY2Q.js → chunk-LYON3VGF.js} +2 -2
  80. package/dist/{chunk-AQMGYRX6.js → chunk-MBSESQED.js} +1 -1
  81. package/dist/{chunk-ZPXXWUQ3.js → chunk-MFC2PE7D.js} +30 -4
  82. package/dist/{chunk-6J2G57BB.js → chunk-N3MOQTRS.js} +7 -7
  83. package/dist/chunk-N3ZAIZF3.js +4870 -0
  84. package/dist/{chunk-JLGVBK5M.js → chunk-N4XNRHFM.js} +18 -4
  85. package/dist/{chunk-3NIESDKN.js → chunk-NGJS5H5E.js} +1 -1
  86. package/dist/{chunk-DJ3H6EW3.js → chunk-NP4G4WPP.js} +10 -9
  87. package/dist/{chunk-RQNFW6YC.js → chunk-O63A26XQ.js} +8 -3
  88. package/dist/{chunk-XNFDDVJS.js → chunk-ONMTNYGR.js} +4 -1
  89. package/dist/{chunk-SJK64HHG.js → chunk-OWV36OJP.js} +5 -2
  90. package/dist/{chunk-4EO7DNRJ.js → chunk-PAZ7WUYZ.js} +2 -2
  91. package/dist/{chunk-K43XLAQV.js → chunk-Q55JNFDV.js} +3 -3
  92. package/dist/{chunk-CZCRSS3U.js → chunk-QHWVCKC5.js} +1 -1
  93. package/dist/{chunk-ORXLO64X.js → chunk-S2HWGG5O.js} +1 -1
  94. package/dist/{chunk-5AKWJHRJ.js → chunk-S3ZWVEGQ.js} +1 -1
  95. package/dist/chunk-SJGE5I5F.js +131 -0
  96. package/dist/{chunk-GSXA4YLV.js → chunk-STK62RL7.js} +1 -1
  97. package/dist/{chunk-B4KGJHTE.js → chunk-SZOCI3JJ.js} +2 -2
  98. package/dist/{chunk-PICG2XRD.js → chunk-TCCCAEZD.js} +2 -2
  99. package/dist/{chunk-KF6I5WA7.js → chunk-TDNPJHEQ.js} +15 -18
  100. package/dist/{chunk-BGC5S3OZ.js → chunk-TLXK5A2N.js} +49 -36
  101. package/dist/{chunk-6EN2LWOM.js → chunk-TWCICOCI.js} +1 -1
  102. package/dist/{chunk-NEQIJUV2.js → chunk-UBDO4EHA.js} +10 -1
  103. package/dist/{chunk-2QAR7ZNY.js → chunk-V2H5UABS.js} +3 -3
  104. package/dist/{chunk-3LACB6HG.js → chunk-VTX27LET.js} +3 -3
  105. package/dist/{chunk-3JYKWNFR.js → chunk-VVDHSRKD.js} +1 -1
  106. package/dist/{chunk-2RQZQJHV.js → chunk-WSEPFRJV.js} +1 -1
  107. package/dist/{chunk-K3LLHG6I.js → chunk-XNY2KI2Z.js} +1 -1
  108. package/dist/{chunk-ZNSKOXFW.js → chunk-Z65ZQYBW.js} +3 -3
  109. package/dist/{chunk-QVHC77IF.js → chunk-Z7QHOT65.js} +2 -2
  110. package/dist/{chunk-LAR5VTCN.js → chunk-ZGG53XZX.js} +5 -5
  111. package/dist/{chunk-67JTGRNM.js → chunk-ZSRNM6LP.js} +1 -1
  112. package/dist/{chunk-IEVU4FXB.js → chunk-ZTCILR3V.js} +3 -3
  113. package/dist/{clean-SVEOBRPM.js → clean-XBQ54UZX.js} +22 -21
  114. package/dist/cli.js +151 -82
  115. package/dist/{cloud-ADFJGIEH.js → cloud-E2GUGXXL.js} +4 -4
  116. package/dist/{cloudrun-BNY7Q5RK.js → cloudrun-IAPFT66T.js} +23 -20
  117. package/dist/commands/layout-audit.browser.js +7 -10
  118. package/dist/{compare-QC3T22KV.js → compare-2VPIOCLV.js} +45 -46
  119. package/dist/{compiler-4ITKK4XI.js → compiler-3ED6KJYN.js} +3 -3
  120. package/dist/{component-CNZCB3RY.js → component-IH2KSDNM.js} +6 -5
  121. package/dist/{compositions-UO32IP6Z.js → compositions-MIMF2GM3.js} +14 -13
  122. package/dist/{delete-RWTOSI24.js → delete-5H5EYSYK.js} +13 -11
  123. package/dist/{deploy-OKWS53NP.js → deploy-DMQT34K2.js} +5 -5
  124. package/dist/{destroy-4RL5VOXQ.js → destroy-BQ5R7LUF.js} +3 -3
  125. package/dist/{deterministicFonts-LKAGUNE5.js → deterministicFonts-2ISM3LMW.js} +1 -1
  126. package/dist/{dist-AEE3QTRB.js → dist-ANQ2CIIO.js} +2 -2
  127. package/dist/{dist-NCI6JOJZ.js → dist-OKQM7BQ3.js} +3 -1
  128. package/dist/{docs-UMIA66EZ.js → docs-6EM6FDNI.js} +5 -4
  129. package/dist/{doctor-SIF72ESZ.js → doctor-MTRZJQZZ.js} +12 -10
  130. package/dist/{events-S3VUTFEG.js → events-2GNMM2YS.js} +5 -3
  131. package/dist/{events-34PIVLZQ.js → events-TBKM6B5H.js} +8 -5
  132. package/dist/{feedback-VS4LRXHW.js → feedback-6NNSKXQP.js} +20 -19
  133. package/dist/{ffmpeg-YVQOKNV6.js → ffmpeg-622QCJLB.js} +6 -6
  134. package/dist/{figma-AF4JKDBA.js → figma-TFHZ3N5A.js} +3 -3
  135. package/dist/fontLocalizeCli.js +11 -11
  136. package/dist/{get-UQGCS6Q4.js → get-P6RA7MAU.js} +8 -7
  137. package/dist/{gpuPolicy-Q4B3D6PW.js → gpuPolicy-CK2XDEAM.js} +6 -6
  138. package/dist/{grade-compare-G34673XC.js → grade-compare-LK6U7OJD.js} +47 -45
  139. package/dist/{heifImagePrep-XD4DGOUS.js → heifImagePrep-3OXKQUEZ.js} +7 -7
  140. package/dist/{help-3QSD26IC.js → help-YENCFXYK.js} +11 -7
  141. package/dist/{history-6DC24UCF.js → history-V3E4UCMY.js} +15 -12
  142. package/dist/hyperframe.manifest.json +1 -1
  143. package/dist/hyperframe.runtime.iife.js +64 -64
  144. package/dist/hyperframes-player.global.js +1 -1
  145. package/dist/{info-6JUHWWJK.js → info-ZGKQMX3Z.js} +11 -10
  146. package/dist/{init-2DPX6U3J.js → init-D6PJI2TA.js} +38 -37
  147. package/dist/{inspect-Z55YUSXC.js → inspect-UCHLILOX.js} +33 -32
  148. package/dist/{installer-XVKYJU7S.js → installer-CV2OKJFW.js} +4 -4
  149. package/dist/{keyframes-YHF4AQIL.js → keyframes-2IJTDJ7K.js} +10 -9
  150. package/dist/{lambda-JITTS37E.js → lambda-GKZBKWTK.js} +32 -30
  151. package/dist/{layout-V5NYJXIX.js → layout-KKPRCTME.js} +33 -32
  152. package/dist/{lint-V4WMO7YL.js → lint-NAC6M4NT.js} +18 -15
  153. package/dist/{lintProject-EM7Y2ZRB.js → lintProject-MSATZIK7.js} +1 -1
  154. package/dist/{list-W7UCIYKA.js → list-QRMXOTNB.js} +11 -10
  155. package/dist/{live-LAHBXVK2.js → live-WWPFZQ74.js} +33 -7
  156. package/dist/{localPage-BLQFFIDF.js → localPage-KMXALM7A.js} +6 -6
  157. package/dist/{login-IX3MOREU.js → login-GBN5ZMEA.js} +11 -11
  158. package/dist/{logout-46NLNY2K.js → logout-C6P6ERZ3.js} +5 -5
  159. package/dist/{manager-WJOWZNHM.js → manager-GPDDRQIW.js} +8 -8
  160. package/dist/{media-treatment-XBO6EXL4.js → media-treatment-4Q7G27JJ.js} +44 -34
  161. package/dist/{media-use-3RFKY7XJ.js → media-use-ZRHFRO46.js} +1 -1
  162. package/dist/{models-P3NSHDQS.js → models-7KJF4LYJ.js} +27 -20
  163. package/dist/{motionShot-D4QMLTQP.js → motionShot-DQAX2QTZ.js} +17 -16
  164. package/dist/{normalize-audio-Q4VUR3QJ.js → normalize-audio-K7VCJQYJ.js} +30 -19
  165. package/dist/{open-LGKX534P.js → open-ZSBVR3KC.js} +17 -16
  166. package/dist/{parakeetRunner-FAOQMPS6.js → parakeetRunner-XXZHJYKO.js} +12 -12
  167. package/dist/{pipeline-2YONKZYC.js → pipeline-KNLOS5CL.js} +11 -11
  168. package/dist/{play-PJOUIY55.js → play-GQWF7MU5.js} +32 -34
  169. package/dist/{policies-UPNRQ7IW.js → policies-J5BWAZHM.js} +11 -10
  170. package/dist/{preflight-3PPM7QBU.js → preflight-UMKQ5C5W.js} +7 -7
  171. package/dist/{present-323D6OE2.js → present-X7BPH35M.js} +28 -30
  172. package/dist/{preview-E42QP2KX.js → preview-5Q7HPEOF.js} +25 -24
  173. package/dist/{producer-MTMNLJSC.js → producer-IXOPGETH.js} +1 -1
  174. package/dist/{progress-LMQ2DXM4.js → progress-X3QFO3FE.js} +4 -4
  175. package/dist/{projectConfig-5QRVB5KY.js → projectConfig-YGI5AINR.js} +6 -6
  176. package/dist/{prompts-P3IT5H36.js → prompts-VAO7RDKX.js} +2 -2
  177. package/dist/{publication-AUZLFOG5.js → publication-ZSDCS2ST.js} +2 -2
  178. package/dist/{publish-H5P7UHRV.js → publish-S2IIRPFZ.js} +18 -18
  179. package/dist/{refresh-4XRQS3N6.js → refresh-IYRGLHG5.js} +5 -5
  180. package/dist/{remove-background-T2RV476S.js → remove-background-F2WFDCNM.js} +22 -18
  181. package/dist/{render-4XEB3XWI.js → render-CHRSSQNM.js} +60 -58
  182. package/dist/{render-3FRGIWES.js → render-NVHUPEDG.js} +28 -27
  183. package/dist/{render-GJH7446R.js → render-WYBQO4SR.js} +11 -10
  184. package/dist/{render-batch-77X5453X.js → render-batch-SDGA2643.js} +12 -11
  185. package/dist/renderSetupWorker.js +1 -1
  186. package/dist/{resolver-DIUNK525.js → resolver-3W2OPVGC.js} +4 -4
  187. package/dist/{sam-FHJ7IL7T.js → sam-QA7JT7IM.js} +2 -1
  188. package/dist/{sherpa-SUS3YSEP.js → sherpa-HCPAOYGA.js} +11 -11
  189. package/dist/{sites-V42IFVTK.js → sites-MTLVMYJ6.js} +2 -2
  190. package/dist/{skills-YCGSIOCE.js → skills-KOVM4OP5.js} +17 -13
  191. package/dist/{skillsUpdateCheck-VCQIZGOL.js → skillsUpdateCheck-ISMQFMPY.js} +5 -3
  192. package/dist/{snapshot-H6R5PWNS.js → snapshot-K7LVZDHG.js} +340 -107
  193. package/dist/{src-ED5VCIRC.js → src-FUMXFZYG.js} +10 -10
  194. package/dist/{src-HHDLJV4L.js → src-QEFKMRH7.js} +11 -5
  195. package/dist/{state-D5SYQFCB.js → state-6QHNNHDA.js} +2 -2
  196. package/dist/{staticProjectServer-VY7QG5XH.js → staticProjectServer-MF57NBIU.js} +18 -18
  197. package/dist/{status-GEZNVPII.js → status-SLILCDBZ.js} +12 -7
  198. package/dist/studio/assets/{hyperframes-player-CzrqgMUX.js → hyperframes-player-Bb6n05RB.js} +1 -1
  199. package/dist/studio/assets/{index-B3SPHPi1.js → index-DOtf09XR.js} +1 -1
  200. package/dist/studio/assets/{index-k4nVfS2D.js → index-pq574E5O.js} +119 -119
  201. package/dist/studio/index.html +1 -1
  202. package/dist/{studio-api-TR5RPX57.js → studio-api-Y4S3W7XE.js} +10 -10
  203. package/dist/{studioServer-4SZLLQOV.js → studioServer-5LUZQOQV.js} +53 -52
  204. package/dist/{synthesize-QALK5SQR.js → synthesize-FQML2LN2.js} +2 -2
  205. package/dist/{telemetry-KGY7G3UR.js → telemetry-NTO4FJFN.js} +5 -4
  206. package/dist/{telemetry-7HUKOQ6X.js → telemetry-TJMB5BTF.js} +6 -5
  207. package/dist/{timeline-CGIKWCQI.js → timeline-CU6CIWYL.js} +31 -27
  208. package/dist/{tokens-AZALDJEK.js → tokens-7P4N2FWN.js} +5 -4
  209. package/dist/{transcribe-CTF5EIXJ.js → transcribe-FZ7JK6QS.js} +28 -25
  210. package/dist/{transcribe-V6K5547L.js → transcribe-TFDEQFMG.js} +10 -10
  211. package/dist/{tts-C2HBLFKK.js → tts-K5HRN6NQ.js} +17 -13
  212. package/dist/{updateCheck-5I563YLB.js → updateCheck-HUDVZHVM.js} +4 -2
  213. package/dist/{upgrade-GRPVQE7Z.js → upgrade-KP4RQZKY.js} +7 -6
  214. package/dist/{urlDownloader-EP6Q4WES.js → urlDownloader-5SHSHWMB.js} +5 -5
  215. package/dist/{validate-TVCDSQS3.js → validate-VWX423M4.js} +27 -26
  216. package/dist/{video-CFEIRKAE.js → video-K4L2YFU2.js} +10 -10
  217. package/dist/warmCheck.js +44 -43
  218. package/package.json +1 -1
  219. package/dist/chunk-FWKZ3O52.js +0 -4870
  220. package/dist/chunk-WQ6ZXHFQ.js +0 -133
@@ -25,7 +25,7 @@ import {
25
25
  findFFmpeg,
26
26
  findFFprobe,
27
27
  getFFmpegInstallHint
28
- } from "./chunk-22OGII5H.js";
28
+ } from "./chunk-I3G45TWG.js";
29
29
  import {
30
30
  parseTimeoutMs,
31
31
  pngDimensions,
@@ -34,22 +34,22 @@ import {
34
34
  } from "./chunk-KUXOAS4Z.js";
35
35
  import {
36
36
  captureArtifactRevision
37
- } from "./chunk-K3LLHG6I.js";
38
- import "./chunk-KZBBY72Q.js";
37
+ } from "./chunk-XNY2KI2Z.js";
38
+ import "./chunk-F4EX52FU.js";
39
39
  import "./chunk-X7MTZ4T2.js";
40
40
  import {
41
41
  resolveProject
42
- } from "./chunk-IEVU4FXB.js";
42
+ } from "./chunk-ZTCILR3V.js";
43
43
  import {
44
44
  serveStaticProjectHtml
45
- } from "./chunk-6J2G57BB.js";
46
- import "./chunk-ZNSKOXFW.js";
45
+ } from "./chunk-N3MOQTRS.js";
46
+ import "./chunk-Z65ZQYBW.js";
47
47
  import "./chunk-X7MTZ4T2.js";
48
48
  import "./chunk-XUHOIDKG.js";
49
- import "./chunk-FIC3E7IM.js";
50
- import "./chunk-WNDTMINP.js";
49
+ import "./chunk-BE6XXZAR.js";
50
+ import "./chunk-2WELGDXU.js";
51
51
  import "./chunk-CTZJSMGU.js";
52
- import "./chunk-FVY2XRX4.js";
52
+ import "./chunk-DKEZSH6M.js";
53
53
  import {
54
54
  artifactDirectory,
55
55
  finishSnapshotRun,
@@ -57,8 +57,8 @@ import {
57
57
  recordArtifacts,
58
58
  retainSnapshotOutput
59
59
  } from "./chunk-24F7TOW2.js";
60
- import "./chunk-PICG2XRD.js";
61
- import "./chunk-DMIFCIG6.js";
60
+ import "./chunk-TCCCAEZD.js";
61
+ import "./chunk-IHYWP4V5.js";
62
62
  import "./chunk-ALVXFXUG.js";
63
63
  import {
64
64
  DEFAULT_ZOOM_SCALE,
@@ -70,49 +70,47 @@ import {
70
70
  runFfmpegOnce,
71
71
  seekCompositionTimelineOnly,
72
72
  settleCompositionSeek
73
- } from "./chunk-DJ3H6EW3.js";
73
+ } from "./chunk-NP4G4WPP.js";
74
74
  import "./chunk-7J6LQ3SQ.js";
75
- import "./chunk-T2L2GJ4C.js";
76
- import "./chunk-AQMGYRX6.js";
77
- import "./chunk-J2JG4XGP.js";
75
+ import "./chunk-7LOVQRUJ.js";
76
+ import "./chunk-MBSESQED.js";
77
+ import "./chunk-5ZBMHUY2.js";
78
78
  import "./chunk-EHSBBBR2.js";
79
- import "./chunk-3NIESDKN.js";
79
+ import "./chunk-NGJS5H5E.js";
80
80
  import "./chunk-543U46OR.js";
81
- import "./chunk-CZCRSS3U.js";
81
+ import "./chunk-QHWVCKC5.js";
82
82
  import "./chunk-XT7X6QCP.js";
83
83
  import "./chunk-5YPMCCCA.js";
84
84
  import "./chunk-HVW7ABXD.js";
85
- import "./chunk-GSXA4YLV.js";
85
+ import "./chunk-STK62RL7.js";
86
86
  import {
87
87
  runWithConcurrencyLimit
88
88
  } from "./chunk-JHOCK3DG.js";
89
- import "./chunk-DWIMUPFK.js";
90
- import "./chunk-5KOZRJR7.js";
89
+ import "./chunk-LTQXIYNL.js";
90
+ import "./chunk-HWHPYCBZ.js";
91
91
  import "./chunk-AWDFDFI3.js";
92
92
  import "./chunk-P6LJ4Y32.js";
93
93
  import "./chunk-T2WJO4XM.js";
94
94
  import "./chunk-W4DMQZL5.js";
95
- import "./chunk-5MCR5DA5.js";
95
+ import "./chunk-BVHNFPRF.js";
96
96
  import {
97
97
  resolveLocalBrowserGpuMode
98
- } from "./chunk-Z2UZAY2Q.js";
98
+ } from "./chunk-LYON3VGF.js";
99
99
  import "./chunk-A4ZTSQLW.js";
100
- import "./chunk-SXJJTFV4.js";
101
- import "./chunk-3R5MYOJN.js";
102
- import "./chunk-VWG7OQKU.js";
100
+ import {
101
+ trackSnapshotRun
102
+ } from "./chunk-H3I2VLLL.js";
103
+ import "./chunk-76T7KAYD.js";
104
+ import "./chunk-EQGKUPBJ.js";
103
105
  import {
104
106
  defineCommand
105
107
  } from "./chunk-DL4OD7IA.js";
106
108
  import "./chunk-S3S4TGEH.js";
107
109
  import "./chunk-54HJ63Q2.js";
108
- import {
109
- CliRuntimeError,
110
- failCommand
111
- } from "./chunk-LALLQUSK.js";
112
110
  import {
113
111
  c
114
112
  } from "./chunk-2GICKZ3I.js";
115
- import "./chunk-5YHQBCWH.js";
113
+ import "./chunk-G6OKQMJI.js";
116
114
  import "./chunk-EVMY7IPL.js";
117
115
  import "./chunk-7FMUTGOH.js";
118
116
  import {
@@ -122,11 +120,11 @@ import {
122
120
  extractMediaMetadata,
123
121
  isHdrColorSpace,
124
122
  sdrCanvasColourFilters
125
- } from "./chunk-UI7X4L4M.js";
123
+ } from "./chunk-KVFOQ3EM.js";
126
124
  import "./chunk-Z5J67X44.js";
127
125
  import "./chunk-5S7W3TUO.js";
128
126
  import "./chunk-D3MUHMFG.js";
129
- import "./chunk-VBC3DQFS.js";
127
+ import "./chunk-AJ3QW6RX.js";
130
128
  import "./chunk-YWRUQ7XZ.js";
131
129
  import {
132
130
  createRuntimeStartTimeResolver,
@@ -135,12 +133,12 @@ import {
135
133
  isClipVisibleAt,
136
134
  isInClipWindow,
137
135
  parseFirstFrameColour
138
- } from "./chunk-472C35EW.js";
136
+ } from "./chunk-KY67MTBH.js";
139
137
  import {
140
138
  readElementRateSpec,
141
139
  sourceTimeAt,
142
140
  timeAtSourceTime
143
- } from "./chunk-FWKZ3O52.js";
141
+ } from "./chunk-N3ZAIZF3.js";
144
142
  import "./chunk-VC76R6W2.js";
145
143
  import "./chunk-OFQWTKPW.js";
146
144
  import "./chunk-RQVDTPGD.js";
@@ -160,7 +158,7 @@ import "./chunk-K4MJX7SR.js";
160
158
  import "./chunk-WE42NVH7.js";
161
159
  import {
162
160
  lintProject
163
- } from "./chunk-U46JEU26.js";
161
+ } from "./chunk-4645UHJF.js";
164
162
  import "./chunk-CZGHFATT.js";
165
163
  import "./chunk-VAS6HQX3.js";
166
164
  import "./chunk-PBNWRWKA.js";
@@ -180,12 +178,21 @@ import "./chunk-WC4MTXGN.js";
180
178
  import "./chunk-32NEJ553.js";
181
179
  import {
182
180
  withMeta
183
- } from "./chunk-RQNFW6YC.js";
181
+ } from "./chunk-O63A26XQ.js";
184
182
  import "./chunk-K4WIOZFP.js";
185
183
  import "./chunk-ZCHULPJZ.js";
186
184
  import "./chunk-ISN5GRYI.js";
185
+ import {
186
+ failureMessage,
187
+ jsonFailure
188
+ } from "./chunk-SJGE5I5F.js";
189
+ import {
190
+ CliRuntimeError,
191
+ CliUsageError,
192
+ failCommand
193
+ } from "./chunk-DP5LF7GF.js";
187
194
  import "./chunk-J3RXEDR2.js";
188
- import "./chunk-DDRCX7P2.js";
195
+ import "./chunk-KL2UJXCY.js";
189
196
  import {
190
197
  atStep,
191
198
  normalizeErrorMessage
@@ -200,13 +207,19 @@ function parseSnapshotRange(value) {
200
207
  const parts = value.split(/[,:]/);
201
208
  const range = parts.map((part) => part.trim() === "" ? NaN : Number(part));
202
209
  if (parts.length !== 2 || !range.every(Number.isFinite) || range[0] < 0 || range[1] <= range[0])
203
- throw new Error("--range must be START,END in seconds, with 0 <= START < END");
210
+ throw new CliUsageError("--range must be START,END in seconds, with 0 <= START < END");
204
211
  return [range[0], range[1]];
205
212
  }
213
+ function parseSnapshotFrames(value) {
214
+ const frames = Number(value);
215
+ if (value.trim() === "" || !Number.isInteger(frames) || frames < 1)
216
+ throw new CliUsageError("--frames must be a positive integer");
217
+ return frames;
218
+ }
206
219
  function parseSnapshotAt(value) {
207
220
  const times = value.split(",").map((part) => part.trim() === "" ? NaN : Number(part));
208
221
  if (!times.every((time) => Number.isFinite(time) && time >= 0))
209
- throw new Error("--at must be comma-separated times in seconds, each 0 or more");
222
+ throw new CliUsageError("--at must be comma-separated times in seconds, each 0 or more");
210
223
  return times;
211
224
  }
212
225
  function sampleSnapshotRange([start, end], frames, duration, exclusiveEnd = false) {
@@ -283,6 +296,93 @@ function describeSharpLoadFailure(error) {
283
296
  return reason && !reason.startsWith("Possible solutions") ? `${header} (${reason})` : header;
284
297
  }
285
298
 
299
+ // src/commands/snapshotFrameBank.ts
300
+ var slotKey = (path, want) => `${path}\0${want.time.toFixed(6)}\0${want.displayedPixels}\0${want.holdLastFrame}`;
301
+ function groupOverlappingDecodes(frames) {
302
+ const sorted = [...frames].sort((a, b) => a.decodesFrom - b.decodesFrom);
303
+ const groups = [];
304
+ let end = Number.NEGATIVE_INFINITY;
305
+ for (const frame of sorted) {
306
+ if (frame.decodesFrom > end) groups.push([]);
307
+ groups[groups.length - 1].push(frame);
308
+ end = Math.max(end, frame.seek + frame.select);
309
+ }
310
+ return groups;
311
+ }
312
+ function countAsked(path, wants) {
313
+ const asked = /* @__PURE__ */ new Map();
314
+ for (const want of wants) {
315
+ const key = slotKey(path, want);
316
+ asked.set(key, { want, uses: (asked.get(key)?.uses ?? 0) + 1 });
317
+ }
318
+ return asked;
319
+ }
320
+ async function probeFrames(probe, path, wants) {
321
+ try {
322
+ const plans = await Promise.all(
323
+ wants.map((want) => probe(path, want.time, want.holdLastFrame))
324
+ );
325
+ return plans.flatMap(
326
+ (plan, i) => plan?.seek !== void 0 && plan.select !== void 0 ? [
327
+ {
328
+ ...wants[i],
329
+ seek: plan.seek,
330
+ select: plan.select,
331
+ decodesFrom: plan.decodesFrom ?? plan.seek
332
+ }
333
+ ] : []
334
+ );
335
+ } catch {
336
+ return [];
337
+ }
338
+ }
339
+ function passGroups(planned) {
340
+ const sizes = [...new Set(planned.map((frame) => frame.displayedPixels))];
341
+ return sizes.flatMap(
342
+ (size) => groupOverlappingDecodes(planned.filter((frame) => frame.displayedPixels === size))
343
+ );
344
+ }
345
+ function countPass(stats, group) {
346
+ stats.passes += 1;
347
+ stats.frames += group.length;
348
+ if (group.length > 1) stats.sharedFrames += group.length;
349
+ for (const frame of group)
350
+ stats.longestDecodeSeconds = Math.max(
351
+ stats.longestDecodeSeconds,
352
+ frame.seek + frame.select - frame.decodesFrom
353
+ );
354
+ }
355
+ function createFrameBank(deps) {
356
+ const slots = /* @__PURE__ */ new Map();
357
+ const stats = { passes: 0, frames: 0, sharedFrames: 0, longestDecodeSeconds: 0 };
358
+ return {
359
+ stats,
360
+ async plan(path, wants) {
361
+ const asked = countAsked(path, wants);
362
+ const fresh = [...asked].filter(([key]) => !slots.has(key)).map(([, { want }]) => want);
363
+ for (const group of passGroups(await probeFrames(deps.probe, path, fresh))) {
364
+ countPass(stats, group);
365
+ let run;
366
+ const start = () => run ??= deps.decode(path, group).catch(() => void 0);
367
+ for (const [i, frame] of group.entries()) {
368
+ const key = slotKey(path, frame);
369
+ slots.set(key, {
370
+ frame: () => start().then((buffers) => buffers?.[i]),
371
+ uses: asked.get(key)?.uses ?? 1
372
+ });
373
+ }
374
+ }
375
+ },
376
+ /** The planned frame's bytes; undefined, now or once its pass failed, means decode it alone. */
377
+ take(path, want) {
378
+ const key = slotKey(path, want);
379
+ const slot = slots.get(key);
380
+ if (slot && --slot.uses <= 0) slots.delete(key);
381
+ return slot?.frame();
382
+ }
383
+ };
384
+ }
385
+
286
386
  // src/commands/snapshotReview.ts
287
387
  var REVIEW_SETTLE_SEC = 0.3;
288
388
  var REVIEW_MID_GAP_SEC = 0.5;
@@ -559,7 +659,7 @@ function assertDistinctKeepNames(times) {
559
659
  const label = formatSnapshotTimestamp(time);
560
660
  const other = timeByLabel.get(label);
561
661
  if (other !== void 0 && other !== time) {
562
- throw new Error(
662
+ throw new CliUsageError(
563
663
  `--keep would name both ${other} and ${time} at-${label}.png; pass times at least 1 ms apart`
564
664
  );
565
665
  }
@@ -588,6 +688,24 @@ function resolveSnapshotVideoRateSpec(input) {
588
688
  };
589
689
  return readElementRateSpec({ getAttribute: (name) => attrs[name] ?? null });
590
690
  }
691
+ function activeVideoAt(candidate, time, compositionDuration) {
692
+ const start = resolveSnapshotVideoClipStart(candidate);
693
+ const playbackRate = resolveSnapshotVideoRateSpec(candidate);
694
+ const duration = candidate.authoredDuration ?? (candidate.srcDuration > 0 ? Math.max(0, timeAtSourceTime(playbackRate, candidate.srcDuration - candidate.mediaStart)) : Number.POSITIVE_INFINITY);
695
+ let relTime = sourceTimeAt(playbackRate, time - start) + candidate.mediaStart;
696
+ if (candidate.loop && candidate.srcDuration > candidate.mediaStart && relTime >= candidate.srcDuration) {
697
+ relTime = candidate.mediaStart + (relTime - candidate.mediaStart) % (candidate.srcDuration - candidate.mediaStart);
698
+ }
699
+ const frameTime = resolveSnapshotVideoFrameTime({
700
+ globalTime: time,
701
+ clipStart: start,
702
+ clipDuration: duration,
703
+ relativeTime: relTime,
704
+ sourceDuration: candidate.srcDuration,
705
+ compositionDuration
706
+ });
707
+ return frameTime === null ? null : { ...candidate, start, playbackRate, duration, relTime: frameTime };
708
+ }
591
709
  function requireSnapshotFfmpeg(ffmpegPath) {
592
710
  if (ffmpegPath) return ffmpegPath;
593
711
  throw new Error(
@@ -692,13 +810,15 @@ async function probeContainingSourceFrameSeek(videoPath, time, holdLastFrame) {
692
810
  const landed = await landing(candidate.pts);
693
811
  if (landed === null) break;
694
812
  if (landed <= 0 || landed > frame) continue;
695
- if (landed < candidate.pts - 1e-6) return { seek: candidate.pts, select: mid - candidate.pts };
813
+ if (landed < candidate.pts - 1e-6)
814
+ return { seek: candidate.pts, select: mid - candidate.pts, decodesFrom: candidate.pts };
696
815
  const again = Math.abs(landed - candidate.pts) < 1e-6 ? landed : await landing(landed);
697
816
  if (again !== null && Math.abs(again - landed) < 1e-6)
698
- return { seek: landed, select: mid - landed };
817
+ return { seek: landed, select: mid - landed, decodesFrom: landed };
699
818
  }
700
819
  const from = timestamps.filter((t) => t > 0 && t <= mid - FALLBACK_SEEK_LEAD_SECONDS).at(-1) ?? 0;
701
- return from > 0 ? { seek: from, select: mid - from } : { select: mid - (timestamps.find((t) => t >= 0) ?? frame) };
820
+ const keyframeBefore = packets.filter((packet) => packet.key && packet.pts <= from).at(-1);
821
+ return from > 0 ? { seek: from, select: mid - from, decodesFrom: keyframeBefore?.pts ?? 0 } : { select: mid - (timestamps.find((t) => t >= 0) ?? frame) };
702
822
  }
703
823
  async function probeSeekLanding(ffmpeg, videoPath, seek) {
704
824
  try {
@@ -734,6 +854,35 @@ function warnNoHdrFiltersOnce() {
734
854
  ` ${c.warn("\u26A0")} A video in this project is HDR, but this ffmpeg has no zscale/tonemap (libzimg), so the still shows it as the browser does and will not match an SDR export. Install an ffmpeg with libzimg.`
735
855
  );
736
856
  }
857
+ async function videoColour(ffmpegPath, videoPath) {
858
+ const metadata = findFFprobe() ? await extractMediaMetadata(videoPath) : null;
859
+ if (!metadata) warnColourUnknownOnce();
860
+ const toneMap = metadata && isHdrColorSpace(metadata.colorSpace) ? hdrToSdrToneMapFilter(
861
+ metadata.colorSpace ?? {},
862
+ parseFirstFrameColour(
863
+ (await runFfmpegOnce(
864
+ ffmpegPath,
865
+ firstFrameColourArgs(videoPath),
866
+ FFMPEG_EXTRACT_TIMEOUT_MS
867
+ )).stderr
868
+ )
869
+ ) : null;
870
+ return { metadata, toneMap };
871
+ }
872
+ function frameFilters(select, displayedPixels, metadata, toneMapFilter) {
873
+ const filters = [];
874
+ if (select !== void 0) filters.push(`select=gte(t-start_t\\,${select})`);
875
+ if (metadata) {
876
+ if (toneMapFilter) filters.push(toneMapFilter);
877
+ filters.push(...sdrCanvasColourFilters(metadata, toneMapFilter !== null));
878
+ }
879
+ if (displayedPixels > 0) {
880
+ filters.push(
881
+ `scale='min(iw,${displayedPixels})':'min(ih,${displayedPixels})':force_original_aspect_ratio=increase`
882
+ );
883
+ }
884
+ return filters;
885
+ }
737
886
  async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDecoder = false, holdLastFrame = false, displayedPixels = 0) {
738
887
  const tmp = mkdtempSync(join(tmpdir(), "hf-snapshot-frame-"));
739
888
  const outPath = join(tmp, "frame.png");
@@ -745,34 +894,13 @@ async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDeco
745
894
  holdLastFrame
746
895
  );
747
896
  if (seek === null) return null;
748
- const metadata = findFFprobe() ? await extractMediaMetadata(videoPath) : null;
749
- if (!metadata) warnColourUnknownOnce();
750
- const toneMap = metadata && isHdrColorSpace(metadata.colorSpace) ? hdrToSdrToneMapFilter(
751
- metadata.colorSpace ?? {},
752
- parseFirstFrameColour(
753
- (await runFfmpegOnce(
754
- ffmpegPath,
755
- firstFrameColourArgs(videoPath),
756
- FFMPEG_EXTRACT_TIMEOUT_MS
757
- )).stderr
758
- )
759
- ) : null;
897
+ const { metadata, toneMap } = await videoColour(ffmpegPath, videoPath);
760
898
  const frameArgs = (toneMapFilter) => {
761
899
  const args = ["-hide_banner", "-loglevel", "error"];
762
900
  if (useVp9AlphaDecoder) args.push("-c:v", "libvpx-vp9");
763
901
  if (seek.seek !== void 0) args.push("-ss", String(seek.seek));
764
902
  args.push("-i", videoPath, "-map", "0:v:0");
765
- const filters = [];
766
- if (seek.select !== void 0) filters.push(`select=gte(t-start_t\\,${seek.select})`);
767
- if (metadata) {
768
- if (toneMapFilter) filters.push(toneMapFilter);
769
- filters.push(...sdrCanvasColourFilters(metadata, toneMapFilter !== null));
770
- }
771
- if (displayedPixels > 0) {
772
- filters.push(
773
- `scale='min(iw,${displayedPixels})':'min(ih,${displayedPixels})':force_original_aspect_ratio=increase`
774
- );
775
- }
903
+ const filters = frameFilters(seek.select, displayedPixels, metadata, toneMapFilter);
776
904
  if (filters.length > 0) args.push("-vf", filters.join(","));
777
905
  args.push("-frames:v", "1", "-q:v", "2", "-y", outPath);
778
906
  return args;
@@ -801,9 +929,65 @@ async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDeco
801
929
  }
802
930
  }
803
931
  }
804
- async function extractVideoFrameOrWarn(warnings, ...args) {
932
+ function selectFirstFrameAfterEach(offsets) {
933
+ const sinceLast = "if(isnan(prev_selected_t)\\,-1\\,prev_selected_t-start_t)";
934
+ const open = offsets.map((offset) => `gte(t-start_t\\,${offset})*gt(${offset}\\,${sinceLast})`);
935
+ return `select=gt(${open.join("+")}\\,0)`;
936
+ }
937
+ async function decodeFramesInOnePass(videoPath, frames, useVp9AlphaDecoder = false) {
938
+ const tmp = mkdtempSync(join(tmpdir(), "hf-snapshot-frames-"));
939
+ try {
940
+ const ffmpegPath = requireSnapshotFfmpeg(findFFmpeg());
941
+ const { metadata, toneMap } = await videoColour(ffmpegPath, videoPath);
942
+ const start = Math.min(...frames.map((frame) => frame.seek));
943
+ const byOffset = /* @__PURE__ */ new Map();
944
+ for (const [index, frame] of frames.entries()) {
945
+ const offset = Number((frame.seek + frame.select - start).toFixed(6));
946
+ byOffset.set(offset, [...byOffset.get(offset) ?? [], index]);
947
+ }
948
+ const byTime = [...byOffset].sort(([a], [b]) => a - b);
949
+ const passArgs = (toneMapFilter) => {
950
+ const rest = frameFilters(void 0, frames[0].displayedPixels, metadata, toneMapFilter);
951
+ const filters = [selectFirstFrameAfterEach(byTime.map(([offset]) => offset)), ...rest];
952
+ const args = ["-hide_banner", "-loglevel", "error"];
953
+ if (useVp9AlphaDecoder) args.push("-c:v", "libvpx-vp9");
954
+ args.push("-ss", String(start), "-i", videoPath, "-map", "0:v:0", "-vf", filters.join(","));
955
+ args.push("-fps_mode", "passthrough", "-frames:v", String(byTime.length));
956
+ args.push("-q:v", "2", "-y", join(tmp, "%d.png"));
957
+ return args;
958
+ };
959
+ const timeoutMs = FFMPEG_EXTRACT_TIMEOUT_MS * frames.length;
960
+ let result = await runFfmpegOnce(ffmpegPath, passArgs(toneMap), timeoutMs);
961
+ if (toneMap && result.code !== 0 && /no such filter/i.test(result.stderr)) {
962
+ warnNoHdrFiltersOnce();
963
+ result = await runFfmpegOnce(ffmpegPath, passArgs(null), timeoutMs);
964
+ }
965
+ const what = `${frames.length} frames of ${videoPath}`;
966
+ if (result.timedOut) {
967
+ throw new FrameExtractError(`FFmpeg timed out after ${timeoutMs / 1e3}s extracting ${what}`);
968
+ }
969
+ const written = (n) => join(tmp, `${n}.png`);
970
+ if (result.code !== 0 || !byTime.every((_, i) => existsSync(written(i + 1)))) {
971
+ throw new FrameExtractError(
972
+ `FFmpeg could not extract ${what}: ${lastLine(result.stderr) || `exit code ${result.code}`}`
973
+ );
974
+ }
975
+ const buffers = [];
976
+ for (const [i, [, indexes]] of byTime.entries()) {
977
+ const png = readFileSync(written(i + 1));
978
+ for (const index of indexes) buffers[index] = png;
979
+ }
980
+ return buffers;
981
+ } finally {
982
+ try {
983
+ rmSync(tmp, { recursive: true, force: true });
984
+ } catch {
985
+ }
986
+ }
987
+ }
988
+ async function frameOrWarn(warnings, frame) {
805
989
  try {
806
- return await extractVideoFrameToBuffer(...args);
990
+ return await frame();
807
991
  } catch (error) {
808
992
  if (!(error instanceof FrameExtractError)) throw error;
809
993
  warnings.push(error.message);
@@ -811,6 +995,9 @@ async function extractVideoFrameOrWarn(warnings, ...args) {
811
995
  return null;
812
996
  }
813
997
  }
998
+ function extractVideoFrameOrWarn(warnings, ...args) {
999
+ return frameOrWarn(warnings, () => extractVideoFrameToBuffer(...args));
1000
+ }
814
1001
  var examples = [
815
1002
  ["Capture 5 key frames from a composition", "snapshot capture"],
816
1003
  ["Capture 10 evenly-spaced frames", "snapshot capture --frames 10"],
@@ -868,8 +1055,9 @@ function serveCapturePage(projectDir, html, proxy) {
868
1055
  return serveStaticProjectHtml(projectDir, html, void 0, [], proxy === true);
869
1056
  }
870
1057
  async function captureSnapshots(projectDir, opts) {
1058
+ const startedAt = performance.now();
871
1059
  const log = opts.log ?? ((message) => console.log(message));
872
- const { bundleWithLocalizedFonts } = await import("./bundleWithLocalizedFonts-XA73ZJ4S.js");
1060
+ const { bundleWithLocalizedFonts } = await import("./bundleWithLocalizedFonts-C2LP6QZZ.js");
873
1061
  const capture = await captureArtifactRevision(projectDir).catch(warnSnapshotsNotRecorded);
874
1062
  const invocation = randomUUID();
875
1063
  const artifacts = [];
@@ -996,7 +1184,7 @@ async function captureSnapshots(projectDir, opts) {
996
1184
  let syncVideoFrameVisibility = null;
997
1185
  let extractMediaMetadata2 = null;
998
1186
  try {
999
- const engine = await import("./src-HHDLJV4L.js");
1187
+ const engine = await import("./src-QEFKMRH7.js");
1000
1188
  injectVideoFramesBatch = engine.injectVideoFramesBatch;
1001
1189
  syncVideoFrameVisibility = engine.syncVideoFrameVisibility;
1002
1190
  extractMediaMetadata2 = engine.extractMediaMetadata;
@@ -1019,14 +1207,28 @@ async function captureSnapshots(projectDir, opts) {
1019
1207
  if (!hasPlayer) {
1020
1208
  console.warn(` ${c.warn("\u26A0")} No player API \u2014 seeks will be skipped`);
1021
1209
  }
1210
+ const frameBank = createFrameBank({
1211
+ probe: probeContainingSourceFrameSeek,
1212
+ decode: async (path, frames) => decodeFramesInOnePass(
1213
+ path,
1214
+ frames,
1215
+ /^https?:\/\//i.test(path) ? false : await shouldUseVp9AlphaDecoder(path)
1216
+ )
1217
+ });
1218
+ const plannedClips = /* @__PURE__ */ new Set();
1219
+ const loopStartedAt = performance.now();
1220
+ let seekMs = 0;
1221
+ let videoMs = 0;
1022
1222
  for (let i = 0; i < positions.length; i++) {
1023
1223
  const time = positions[i];
1024
1224
  console.error(`[hyperframes] snapshot: frame ${i + 1}/${positions.length} at ${time}s`);
1025
1225
  const seekOptions = { exactTime: true, waitForImagesMs: SCREENSHOT_IMAGE_WAIT_MS };
1226
+ const seekStartedAt = performance.now();
1026
1227
  await atStep(
1027
1228
  `seeking to ${time}s, frame ${i + 1} of ${positions.length}`,
1028
1229
  () => seekCompositionTimelineOnly(page, time, seekOptions)
1029
1230
  );
1231
+ seekMs += performance.now() - seekStartedAt;
1030
1232
  if (cameraExpr) await page.evaluate(cameraExpr);
1031
1233
  if (injectVideoFramesBatch && syncVideoFrameVisibility) {
1032
1234
  const candidates = await page.evaluate(() => {
@@ -1056,29 +1258,17 @@ async function captureSnapshots(projectDir, opts) {
1056
1258
  };
1057
1259
  });
1058
1260
  });
1059
- const compositionDuration = duration;
1261
+ let unreadable = 0;
1060
1262
  const active = candidates.flatMap((candidate) => {
1061
- const start = resolveSnapshotVideoClipStart(candidate);
1062
- const playbackRate = resolveSnapshotVideoRateSpec(candidate);
1063
- const duration2 = candidate.authoredDuration ?? (candidate.srcDuration > 0 ? Math.max(
1064
- 0,
1065
- timeAtSourceTime(playbackRate, candidate.srcDuration - candidate.mediaStart)
1066
- ) : Number.POSITIVE_INFINITY);
1067
- let relTime = sourceTimeAt(playbackRate, time - start) + candidate.mediaStart;
1068
- if (candidate.loop && candidate.srcDuration > candidate.mediaStart && relTime >= candidate.srcDuration) {
1069
- relTime = candidate.mediaStart + (relTime - candidate.mediaStart) % (candidate.srcDuration - candidate.mediaStart);
1263
+ const video = activeVideoAt(candidate, time, duration);
1264
+ if (!video) return [];
1265
+ if (!candidate.id || !candidate.src) {
1266
+ unreadable += 1;
1267
+ return [];
1070
1268
  }
1071
- if (!candidate.id || !candidate.src) return [];
1072
- const frameTime = resolveSnapshotVideoFrameTime({
1073
- globalTime: time,
1074
- clipStart: start,
1075
- clipDuration: duration2,
1076
- relativeTime: relTime,
1077
- sourceDuration: candidate.srcDuration,
1078
- compositionDuration
1079
- });
1080
- return frameTime === null ? [] : [{ ...candidate, start, playbackRate, duration: duration2, relTime: frameTime }];
1269
+ return [video];
1081
1270
  });
1271
+ const videoStartedAt = performance.now();
1082
1272
  const extracted = await runWithConcurrencyLimit(
1083
1273
  active,
1084
1274
  VIDEO_FRAME_EXTRACT_CONCURRENCY,
@@ -1100,14 +1290,33 @@ async function captureSnapshots(projectDir, opts) {
1100
1290
  }
1101
1291
  if (!ffmpegInput) return null;
1102
1292
  const useVp9AlphaDecoder = inputIsLocal ? await shouldUseVp9AlphaDecoder(ffmpegInput) : false;
1103
- const png = await extractVideoFrameOrWarn(
1293
+ const displayedPixels = Math.ceil(
1294
+ v.displayedSize * (opts.zoom ? opts.zoomScale ?? DEFAULT_ZOOM_SCALE : v.devicePixelRatio)
1295
+ );
1296
+ const wantAt = (t) => {
1297
+ const shown = activeVideoAt(v, t, duration);
1298
+ if (!shown) return null;
1299
+ const holdLastFrame = shown.srcDuration > 0 && shown.relTime >= shown.srcDuration - 1;
1300
+ return { time: Math.max(0, shown.relTime), displayedPixels, holdLastFrame };
1301
+ };
1302
+ const planKey = `${v.id}\0${ffmpegInput}`;
1303
+ if (!plannedClips.has(planKey)) {
1304
+ plannedClips.add(planKey);
1305
+ await frameBank.plan(
1306
+ ffmpegInput,
1307
+ positions.slice(i).flatMap((t) => wantAt(t) ?? [])
1308
+ );
1309
+ }
1310
+ const want = wantAt(time);
1311
+ const banked = await frameBank.take(ffmpegInput, want);
1312
+ const png = await frameOrWarn(
1104
1313
  warnings,
1105
- ffmpegInput,
1106
- Math.max(0, v.relTime),
1107
- useVp9AlphaDecoder,
1108
- v.srcDuration > 0 && v.relTime >= v.srcDuration - 1,
1109
- Math.ceil(
1110
- v.displayedSize * (opts.zoom ? opts.zoomScale ?? DEFAULT_ZOOM_SCALE : v.devicePixelRatio)
1314
+ async () => banked ?? extractVideoFrameToBuffer(
1315
+ ffmpegInput,
1316
+ want.time,
1317
+ useVp9AlphaDecoder,
1318
+ want.holdLastFrame,
1319
+ want.displayedPixels
1111
1320
  )
1112
1321
  );
1113
1322
  if (!png) return null;
@@ -1115,11 +1324,12 @@ async function captureSnapshots(projectDir, opts) {
1115
1324
  }
1116
1325
  );
1117
1326
  const updates = extracted.filter((update) => update !== null);
1118
- if (active.length > 0 && updates.length < active.length) {
1119
- const missed = active.length - updates.length;
1327
+ const onScreen = active.length + unreadable;
1328
+ if (updates.length < onScreen) {
1329
+ const missed = onScreen - updates.length;
1120
1330
  warnings.push(`${missed} video frames missing at ${time}s`);
1121
1331
  console.warn(
1122
- ` ${c.warn("\u26A0")} ${missed}/${active.length} active <video> frame(s) could not be extracted at ${time.toFixed(1)}s \u2014 those videos will appear black/stale in this snapshot`
1332
+ ` ${c.warn("\u26A0")} ${missed}/${onScreen} active <video> frame(s) could not be extracted at ${time.toFixed(1)}s \u2014 those videos will appear black/stale in this snapshot`
1123
1333
  );
1124
1334
  }
1125
1335
  try {
@@ -1136,6 +1346,7 @@ async function captureSnapshots(projectDir, opts) {
1136
1346
  ` ${c.warn("\u26A0")} video frame injection failed at ${time.toFixed(1)}s \u2014 <video> elements will appear black/stale in this snapshot`
1137
1347
  );
1138
1348
  }
1349
+ videoMs += performance.now() - videoStartedAt;
1139
1350
  }
1140
1351
  warnUnsettledImages(await settleCompositionSeek(page, seekOptions), time, warnings);
1141
1352
  await recaptureSnapshotComposite(page);
@@ -1222,6 +1433,23 @@ async function captureSnapshots(projectDir, opts) {
1222
1433
  const rel = relative(projectDir, framePath);
1223
1434
  savedPaths.push(rel.startsWith("..") || isAbsolute(rel) ? framePath : rel);
1224
1435
  }
1436
+ const loopMs = performance.now() - loopStartedAt;
1437
+ const stageMs = {
1438
+ open: loopStartedAt - startedAt,
1439
+ seek: seekMs,
1440
+ video: videoMs,
1441
+ capture: Math.max(0, loopMs - seekMs - videoMs)
1442
+ };
1443
+ trackSnapshotRun({
1444
+ frames: positions.length,
1445
+ videoFrames: frameBank.stats.frames,
1446
+ decodePasses: frameBank.stats.passes,
1447
+ sharedFrames: frameBank.stats.sharedFrames,
1448
+ longestDecodeSeconds: frameBank.stats.longestDecodeSeconds,
1449
+ slowStage: Object.keys(stageMs).reduce(
1450
+ (a, b) => stageMs[b] > stageMs[a] ? b : a
1451
+ )
1452
+ });
1225
1453
  completed = true;
1226
1454
  } finally {
1227
1455
  await chromeBrowser.close();
@@ -1447,25 +1675,26 @@ var snapshot_default = defineCommand({
1447
1675
  const asJson = args.json === true;
1448
1676
  const log = (message) => asJson ? console.error(message) : console.log(message);
1449
1677
  const fail = (message) => {
1450
- if (asJson) console.log(JSON.stringify(withMeta({ ok: false, error: message }), null, 2));
1678
+ if (asJson)
1679
+ console.log(JSON.stringify(withMeta(jsonFailure("runtime_error", message)), null, 2));
1451
1680
  else log(message);
1452
1681
  failCommand();
1453
1682
  };
1454
1683
  if ([args.at, args.range, args.composition].filter((value) => value !== void 0).length > 1)
1455
- throw new Error("Use only one of --at, --range, or --composition");
1684
+ throw new CliUsageError("Use only one of --at, --range, or --composition");
1456
1685
  const reviewMode = args.review === true;
1457
1686
  if (reviewMode) {
1458
1687
  const clash = ["at", "range", "zoom", "keep", "against"].find(
1459
1688
  (flag) => args[flag] !== void 0 && args[flag] !== false
1460
1689
  );
1461
- if (clash) throw new Error(`--review picks its own frames; drop --${clash}`);
1690
+ if (clash) throw new CliUsageError(`--review picks its own frames; drop --${clash}`);
1462
1691
  }
1463
- const frames = parseInt(args.frames, 10) || 5;
1692
+ const frames = args.frames === void 0 ? 5 : parseSnapshotFrames(String(args.frames));
1464
1693
  const range = args.range === void 0 ? void 0 : parseSnapshotRange(String(args.range));
1465
1694
  const atTimestamps = args.at === void 0 ? void 0 : parseSnapshotAt(String(args.at));
1466
1695
  if (args.keep === true && atTimestamps) assertDistinctKeepNames(atTimestamps);
1467
1696
  const composition = args.composition === void 0 ? void 0 : String(args.composition).trim();
1468
- if (composition === "") throw new Error("--composition requires a composition ID");
1697
+ if (composition === "") throw new CliUsageError("--composition requires a composition ID");
1469
1698
  const project = resolveProject(args.dir);
1470
1699
  const lintResult = await lintProject(project.dir);
1471
1700
  if (hasDefinitiveEntryMismatch(lintResult)) {
@@ -1688,8 +1917,8 @@ ${mark} ${count} snapshots saved to ${snapshotDir}`);
1688
1917
  });
1689
1918
  } catch (err) {
1690
1919
  if (err instanceof CliRuntimeError && err.result.presented) throw err;
1691
- const msg = normalizeErrorMessage(err);
1692
- if (asJson) console.log(JSON.stringify(withMeta({ ok: false, error: msg }), null, 2));
1920
+ const msg = failureMessage(err);
1921
+ if (asJson) console.log(JSON.stringify(withMeta(jsonFailure("runtime_error", msg)), null, 2));
1693
1922
  else console.error(`
1694
1923
  ${c.error("\u2717")} Snapshot failed: ${msg}`);
1695
1924
  failCommand();
@@ -1701,15 +1930,18 @@ ${c.error("\u2717")} Snapshot failed: ${msg}`);
1701
1930
  });
1702
1931
  export {
1703
1932
  SNAPSHOT_IMAGE_NAME,
1933
+ activeVideoAt,
1704
1934
  clearEarlierStills,
1705
1935
  clearedNote,
1706
1936
  computeSnapshotTimes,
1707
1937
  containingSourceFrameIndex,
1938
+ decodeFramesInOnePass,
1708
1939
  snapshot_default as default,
1709
1940
  examples,
1710
1941
  extractVideoFrameOrWarn,
1711
1942
  extractVideoFrameToBuffer,
1712
1943
  formatSnapshotTimestamp,
1944
+ frameOrWarn,
1713
1945
  parseZoomScale,
1714
1946
  probeContainingSourceFrameSeek,
1715
1947
  recaptureSnapshotComposite,
@@ -1718,6 +1950,7 @@ export {
1718
1950
  resolveSnapshotVideoClipStart,
1719
1951
  resolveSnapshotVideoFrameTime,
1720
1952
  resolveSnapshotVideoRateSpec,
1953
+ selectFirstFrameAfterEach,
1721
1954
  serveCapturePage,
1722
1955
  snapshotsOnDisk,
1723
1956
  tailFrameTime,