hyperframes 0.8.180 → 0.8.183

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 (215) hide show
  1. package/bin/hyperframes.mjs +3 -1
  2. package/dist/{add-HUVEWSVU.js → add-HW3ZGR36.js} +22 -22
  3. package/dist/{animatedGifPrep-V6GJQOEB.js → animatedGifPrep-EPLN37ZN.js} +13 -13
  4. package/dist/api.js +28 -28
  5. package/dist/{asset-ZGQHDMIO.js → asset-TOASKL3Z.js} +3 -3
  6. package/dist/{assetCataloger-MZWCOV6C.js → assetCataloger-PZN5HYG2.js} +15 -13
  7. package/dist/{audio-XDWHLNIW.js → audio-F5OIQVJO.js} +29 -29
  8. package/dist/{auth-VIV3M7S6.js → auth-YVQLRS3T.js} +4 -4
  9. package/dist/{autoUpdate-R32XDL42.js → autoUpdate-EG4ZFW4D.js} +2 -2
  10. package/dist/{backgroundChecks-A2N6EVCP.js → backgroundChecks-WINNQVR2.js} +3 -3
  11. package/dist/backgroundChecksWorker.js +3 -3
  12. package/dist/{batchRender-3AYDQRBI.js → batchRender-PASZTMEE.js} +7 -7
  13. package/dist/{beats-2O423Z6Q.js → beats-KGIOEBLW.js} +12 -12
  14. package/dist/{benchmark-YXP3PTZP.js → benchmark-ZNY2L7HN.js} +24 -24
  15. package/dist/{browser-M47BNOTJ.js → browser-REAO7RU4.js} +20 -20
  16. package/dist/{bundleWithLocalizedFonts-GCIHOMIU.js → bundleWithLocalizedFonts-OAYLYC4W.js} +2 -2
  17. package/dist/{capture-IV3Y2MT4.js → capture-IK6GWQDD.js} +8 -5
  18. package/dist/{capture-BT2ZXN5P.js → capture-WOSF276U.js} +49 -41
  19. package/dist/{captureCompositionFrame-BMZEKPOU.js → captureCompositionFrame-DDZNKYRE.js} +21 -20
  20. package/dist/{captureTimeout-K2JNVVCI.js → captureTimeout-RIMG6IYH.js} +1 -1
  21. package/dist/{catalog-GI6P22KI.js → catalog-AKTXS7OJ.js} +42 -42
  22. package/dist/{catch-up-QS6HUHAO.js → catch-up-O3VZMPVE.js} +15 -15
  23. package/dist/check-6E46NIWI.js +116 -0
  24. package/dist/checkBrowser-UNZHQFNH.js +117 -0
  25. package/dist/{chunk-ST2ARHQ5.js → chunk-3BA2GP4H.js} +5 -5
  26. package/dist/{chunk-7Z6AARJR.js → chunk-3OLIGYWN.js} +3 -3
  27. package/dist/{chunk-OR5WCFWZ.js → chunk-3Q47QC46.js} +2 -2
  28. package/dist/{chunk-Q2ASTBSG.js → chunk-4FQKS7BJ.js} +16 -14
  29. package/dist/{chunk-G2ZMCNRN.js → chunk-4UFJWRHG.js} +527 -283
  30. package/dist/{chunk-537IYAEE.js → chunk-4UMPIPCQ.js} +9 -1
  31. package/dist/{chunk-65CLIHK2.js → chunk-5MBLWFLM.js} +1 -1
  32. package/dist/{chunk-UVEQLDKB.js → chunk-5OGDBU4G.js} +3 -2
  33. package/dist/{chunk-L3YOGIPG.js → chunk-66LREXGS.js} +1 -1
  34. package/dist/{chunk-W4SLIGGM.js → chunk-73LTCCZI.js} +249 -161
  35. package/dist/{chunk-GZVP4TWN.js → chunk-7JAD4MEW.js} +1 -1
  36. package/dist/{chunk-NAMGMP3R.js → chunk-7KVVNF7B.js} +1 -1
  37. package/dist/{chunk-GK2FIKIQ.js → chunk-ADDHW2FS.js} +214 -37
  38. package/dist/{chunk-WUQUR33W.js → chunk-AKFADCMS.js} +1 -1
  39. package/dist/{chunk-2VJNKE7C.js → chunk-ANR6WOC3.js} +1 -1
  40. package/dist/{chunk-L527FLMV.js → chunk-ATMDOUNN.js} +2 -2
  41. package/dist/{chunk-ZJPCQBU7.js → chunk-B2SZZFWW.js} +4 -4
  42. package/dist/{chunk-TO6JNTML.js → chunk-BP4VNTZL.js} +13 -8
  43. package/dist/{chunk-3YXTFXT7.js → chunk-CAHTO62O.js} +8 -8
  44. package/dist/{chunk-MPWLGNM2.js → chunk-CGK4XZ2J.js} +1 -1
  45. package/dist/{chunk-NOXGG4C7.js → chunk-CJYAJ3QM.js} +37 -33
  46. package/dist/{chunk-F5VMPELS.js → chunk-COTLNID2.js} +16 -16
  47. package/dist/{chunk-E24HSMZV.js → chunk-CYBXXSC4.js} +65 -14
  48. package/dist/{chunk-NZZYJOMJ.js → chunk-CZUAX3BV.js} +6 -5
  49. package/dist/{chunk-K7RGIADJ.js → chunk-DEORFAWP.js} +12 -12
  50. package/dist/{chunk-GV5R5B7Q.js → chunk-DGECWPTL.js} +1 -1
  51. package/dist/{chunk-BRHI7EIA.js → chunk-DKPNNYBZ.js} +4 -0
  52. package/dist/{chunk-R46P7TGY.js → chunk-DLC2FICN.js} +7 -7
  53. package/dist/{chunk-D3ZWBHZP.js → chunk-DYAPHNV6.js} +3 -2
  54. package/dist/{chunk-RGHQID2E.js → chunk-EHSBBBR2.js} +5 -3
  55. package/dist/{chunk-IWTRHPTP.js → chunk-EVAQPW6O.js} +8 -8
  56. package/dist/{chunk-S3RYRF3W.js → chunk-F6WHPHLF.js} +1 -1
  57. package/dist/chunk-FG4BBFZI.js +122 -0
  58. package/dist/{chunk-V6MQP32U.js → chunk-GAGMLVCV.js} +2 -2
  59. package/dist/chunk-GMNHAOMJ.js +3805 -0
  60. package/dist/{chunk-KIO3R4QN.js → chunk-GPE3WWTO.js} +16 -6
  61. package/dist/{chunk-ULWZYLCV.js → chunk-GTE5WZAM.js} +72 -140
  62. package/dist/{chunk-2JDLESMS.js → chunk-HLBODNGW.js} +1 -1
  63. package/dist/{chunk-KMAAOHLO.js → chunk-HRPWRZGF.js} +1 -1
  64. package/dist/{chunk-UPFUC4DB.js → chunk-HTIUNMTP.js} +1 -1
  65. package/dist/{chunk-FCUTQM2P.js → chunk-IC2WYONA.js} +5 -5
  66. package/dist/{chunk-VE3OKVSD.js → chunk-ITSLKUQM.js} +2 -2
  67. package/dist/{chunk-YJDB4FLT.js → chunk-JQYJXUJW.js} +1 -1
  68. package/dist/{chunk-PBN6GBJE.js → chunk-JVBRJMOP.js} +14 -1
  69. package/dist/{chunk-XH262OWN.js → chunk-K2Z5DZBS.js} +1 -1
  70. package/dist/{chunk-RHWJKSGH.js → chunk-KANNRHY7.js} +1 -1
  71. package/dist/{chunk-Y5APFFMD.js → chunk-KRFAX5JK.js} +1 -1
  72. package/dist/{chunk-4J7DHVN2.js → chunk-LBWRQ4XA.js} +1 -1
  73. package/dist/{chunk-MQOE5RE4.js → chunk-MIZDJVPZ.js} +9 -9
  74. package/dist/{chunk-32GKETR7.js → chunk-MMQ52NIZ.js} +74 -0
  75. package/dist/chunk-MOEGCMKI.js +180 -0
  76. package/dist/{chunk-E6RPWJVC.js → chunk-NAUKCKCJ.js} +5 -1
  77. package/dist/{chunk-JBCU6NR5.js → chunk-NZ3BE2QE.js} +56 -55
  78. package/dist/{chunk-VKMP3IVR.js → chunk-O7N3A7PE.js} +2 -2
  79. package/dist/{chunk-3QENZQSL.js → chunk-OH56PXFH.js} +5 -5
  80. package/dist/{chunk-H4YZZ2VQ.js → chunk-PFD25NAC.js} +1 -1
  81. package/dist/{check-HE5E4Q7Q.js → chunk-Q6UYKWBG.js} +198 -142
  82. package/dist/{chunk-3DKN5WKL.js → chunk-QH3T4WI2.js} +77 -6
  83. package/dist/{chunk-RGXAN3YU.js → chunk-QX4GGPMY.js} +2 -2
  84. package/dist/{chunk-A3NFBMYX.js → chunk-R6OV4J4K.js} +6 -6
  85. package/dist/{chunk-LL5VQ4WS.js → chunk-RZXUQR42.js} +2 -2
  86. package/dist/{chunk-SEMOZNVE.js → chunk-SAQYJLI6.js} +1 -1
  87. package/dist/{chunk-55P7GDT6.js → chunk-TJB4GAV6.js} +2 -2
  88. package/dist/{checkBrowser-BHLYP3YW.js → chunk-TOHA5NAU.js} +187 -114
  89. package/dist/{chunk-RXQHSGAQ.js → chunk-TXGZZKDF.js} +2 -2
  90. package/dist/{chunk-KZ3VI5K6.js → chunk-U5YVWG5W.js} +3 -3
  91. package/dist/{chunk-ICMXC3MI.js → chunk-U6RXZNZE.js} +31 -18
  92. package/dist/{chunk-XO6CWU7D.js → chunk-UNOSCGBG.js} +2 -2
  93. package/dist/{chunk-NXYBR4QX.js → chunk-VAK7A2N6.js} +16 -16
  94. package/dist/{chunk-OFY6JTZC.js → chunk-VDJO4DJ7.js} +2 -2
  95. package/dist/{chunk-LBQFLUIY.js → chunk-VFBAKPRC.js} +9 -49
  96. package/dist/{chunk-K3KANDZQ.js → chunk-VH5KESLX.js} +1 -1
  97. package/dist/{chunk-22QHO26F.js → chunk-W64L7IFS.js} +1 -1
  98. package/dist/{chunk-4IEH6EAC.js → chunk-WT4PYV2J.js} +4 -6
  99. package/dist/{chunk-XFCLWWL3.js → chunk-X3IA5RYH.js} +2 -2
  100. package/dist/{chunk-UZOZ2W2E.js → chunk-XAQDR5Y5.js} +2 -2
  101. package/dist/{chunk-BI52RNRW.js → chunk-XJHKJXT4.js} +103 -20
  102. package/dist/{chunk-HFZ4UILX.js → chunk-XOVHO3TT.js} +25 -14
  103. package/dist/{chunk-VARUKXOZ.js → chunk-XR5BSEUF.js} +7 -15
  104. package/dist/{chunk-IZM562YJ.js → chunk-Z4R35NJS.js} +4 -4
  105. package/dist/{chunk-AMX53HVX.js → chunk-ZFO3A3QL.js} +2 -2
  106. package/dist/{clean-TQOW24OF.js → clean-WNEIVBF3.js} +40 -40
  107. package/dist/cli.js +68 -64
  108. package/dist/{cloud-7TOVPUMY.js → cloud-6GSSDCJL.js} +4 -4
  109. package/dist/{cloudrun-2BKGY53X.js → cloudrun-4NEJRE4T.js} +8 -8
  110. package/dist/commands/layout-audit.browser.js +15 -4
  111. package/dist/commands/motion-signature.browser.js +52 -0
  112. package/dist/{compare-WDV3Q6WC.js → compare-2JWQ5ABA.js} +50 -47
  113. package/dist/{compiler-U3W6CJW7.js → compiler-27KQD7KW.js} +6 -6
  114. package/dist/{component-U66GBIUO.js → component-HCRET3MH.js} +4 -4
  115. package/dist/{compositions-Y63YGLCE.js → compositions-HTSQ6SUJ.js} +28 -29
  116. package/dist/{contactSheet-27SRU7A4.js → contactSheet-CAGMKI3E.js} +3 -1
  117. package/dist/{delete-TBAIAD7M.js → delete-GHQ5UYM7.js} +9 -9
  118. package/dist/{deploy-BIWOSWS3.js → deploy-I3Z3NAVA.js} +11 -11
  119. package/dist/{destroy-QBLMYDBF.js → destroy-4B5HW5FH.js} +5 -5
  120. package/dist/{deterministicFonts-L7YEEFGI.js → deterministicFonts-JFLSSKRB.js} +2 -2
  121. package/dist/{dist-2FMTAVGL.js → dist-SENYPQGW.js} +4 -4
  122. package/dist/{dist-VO7OXOFK.js → dist-WRDLWRMS.js} +5 -5
  123. package/dist/{docs-MPOM3PHH.js → docs-UEWLIP6D.js} +1 -1
  124. package/dist/{doctor-GC4REGB6.js → doctor-UGFVQZHI.js} +27 -27
  125. package/dist/{events-PUUP24FT.js → events-BLJGWMNP.js} +9 -9
  126. package/dist/{events-4NMQVUZR.js → events-YS4OVX3I.js} +6 -6
  127. package/dist/{feedback-BIDXK7TE.js → feedback-AZ3SJ5HF.js} +35 -35
  128. package/dist/{ffmpeg-2VJDEWQQ.js → ffmpeg-2AECXG7V.js} +15 -15
  129. package/dist/{figma-THMXYLMU.js → figma-DRYIJQHV.js} +3 -3
  130. package/dist/fontLocalizeCli.js +23 -23
  131. package/dist/{get-5T4B7ERH.js → get-DDEAOFPB.js} +9 -9
  132. package/dist/{gpuPolicy-GLUATV5I.js → gpuPolicy-UDJT2MQK.js} +13 -13
  133. package/dist/{grade-compare-2A65YEHZ.js → grade-compare-LJKK5NSY.js} +55 -50
  134. package/dist/{help-JFBDXFRC.js → help-TQBGYOID.js} +1 -1
  135. package/dist/{history-OJEWFWMS.js → history-5TOOCF2Y.js} +15 -15
  136. package/dist/hyperframe.manifest.json +1 -1
  137. package/dist/hyperframe.runtime.iife.js +17 -17
  138. package/dist/hyperframes-player.global.js +8 -3
  139. package/dist/{info-KJZBU3SZ.js → info-ENI5MP4W.js} +20 -20
  140. package/dist/{init-6V4ELU4Z.js → init-JXPXWV3G.js} +68 -68
  141. package/dist/{inspect-WGBZZUZU.js → inspect-WZNYQ5AB.js} +45 -44
  142. package/dist/{installer-EPRSH6QI.js → installer-3SGRBLJW.js} +7 -7
  143. package/dist/{keyframes-57LYKC2M.js → keyframes-HEOC4CT4.js} +16 -16
  144. package/dist/{lambda-5P5X2X5E.js → lambda-2VHQ4AL2.js} +15 -15
  145. package/dist/{layout-PM2VAUT2.js → layout-7WEUNO6T.js} +45 -44
  146. package/dist/{lint-DXS6QRYZ.js → lint-5YMAF3L7.js} +23 -23
  147. package/dist/{lintProject-ARKJXDQF.js → lintProject-C2ONSH2U.js} +4 -4
  148. package/dist/{list-6IBSX7FU.js → list-BIE3X7CO.js} +10 -10
  149. package/dist/{login-RY3PWK44.js → login-YDIGJWCG.js} +7 -7
  150. package/dist/{logout-DKJANASY.js → logout-DDC4QLVK.js} +3 -3
  151. package/dist/{manager-N3COY6BJ.js → manager-D2UV6RDQ.js} +16 -16
  152. package/dist/{manager-V2QCCPOJ.js → manager-UHWEKPXC.js} +8 -3
  153. package/dist/{media-treatment-3HEZR7ZS.js → media-treatment-FSKHPMWA.js} +33 -33
  154. package/dist/{media-use-4XXGABIL.js → media-use-JBN57JE3.js} +1 -1
  155. package/dist/{models-FEULJWSX.js → models-COEK6LXG.js} +24 -24
  156. package/dist/{motionShot-BZTEIZEO.js → motionShot-HYZ2ZGJQ.js} +28 -26
  157. package/dist/{normalize-audio-O4X4LPLK.js → normalize-audio-UXR6WQ7Q.js} +12 -12
  158. package/dist/{open-H3MX4TI2.js → open-OFT2GIDG.js} +24 -24
  159. package/dist/{parakeetRunner-5ABMPCI6.js → parakeetRunner-4NZ3QXS3.js} +25 -25
  160. package/dist/{pipeline-RJ4DOVWX.js → pipeline-ZKE54JMG.js} +18 -18
  161. package/dist/{play-3PBKEZIX.js → play-2VG77FT6.js} +39 -38
  162. package/dist/{policies-5NTZOHJA.js → policies-XXNGXWHV.js} +1 -1
  163. package/dist/{preflight-3RABQJT3.js → preflight-QTWDIM5C.js} +18 -18
  164. package/dist/{present-6SNRG3GI.js → present-OONXQLJG.js} +33 -33
  165. package/dist/{preview-LSDFCJ3H.js → preview-6RZJFU76.js} +49 -49
  166. package/dist/{producer-SUZDRXHJ.js → producer-6YM3UH3B.js} +1 -1
  167. package/dist/{progress-I37JB7R4.js → progress-NHJIHAAG.js} +2 -2
  168. package/dist/{projectConfig-5QCNTGQT.js → projectConfig-YMW4P2X6.js} +9 -9
  169. package/dist/{publication-2QT7VVE2.js → publication-SEINUAPZ.js} +5 -5
  170. package/dist/{publish-53EBL7OO.js → publish-KZBTBWFO.js} +27 -27
  171. package/dist/{refresh-MGCVWX56.js → refresh-RXTOPRBB.js} +3 -3
  172. package/dist/{remove-background-4G4MX5WK.js → remove-background-BIQNMIR7.js} +31 -31
  173. package/dist/{render-RXKUYTYI.js → render-65K3K6SD.js} +31 -31
  174. package/dist/{render-SKY6FKYB.js → render-FIH37HJA.js} +101 -96
  175. package/dist/{render-75CRB3BW.js → render-LW76HOMJ.js} +8 -8
  176. package/dist/{render-batch-CEVWUYBP.js → render-batch-POLEEYD4.js} +8 -8
  177. package/dist/renderSetupWorker.js +12 -9
  178. package/dist/{resolver-4ICE2AT6.js → resolver-O2SED3XB.js} +7 -7
  179. package/dist/{screenshotCapture-HXEZ3TNJ.js → screenshotCapture-UBY6TT75.js} +33 -6
  180. package/dist/{sherpa-TMX3WBTM.js → sherpa-HTFFFTVQ.js} +24 -24
  181. package/dist/{sites-3ZBYB5X4.js → sites-MAVH57MO.js} +2 -2
  182. package/dist/skills/hyperframes/references/review-loop.md +1 -1
  183. package/dist/{skills-MCWFAGIP.js → skills-J6MBGS5O.js} +17 -17
  184. package/dist/{skillsUpdateCheck-NXOI35BW.js → skillsUpdateCheck-ZAXNLBF3.js} +3 -3
  185. package/dist/{snapshot-ESZMKQ6J.js → snapshot-TL7TTFS6.js} +72 -71
  186. package/dist/{src-XRTZOBO5.js → src-EL6HGIS4.js} +35 -26
  187. package/dist/{src-GYYWBQXJ.js → src-Z5H5N5T4.js} +19 -19
  188. package/dist/{state-KAXGHF77.js → state-ORRPOLMQ.js} +2 -2
  189. package/dist/{staticProjectServer-GYPUQGI7.js → staticProjectServer-EO7X7RAY.js} +20 -20
  190. package/dist/{status-BV7QAUQD.js → status-CM7IQTU2.js} +6 -6
  191. package/dist/studio/assets/{hyperframes-player-1wdLVP-x.js → hyperframes-player-hz_VqxBZ.js} +7 -2
  192. package/dist/studio/assets/{index-CaWPPTQ1.js → index-CV_ojgp5.js} +1 -1
  193. package/dist/studio/assets/{index-mdtW0Ug-.js → index-S1ceEagc.js} +71 -71
  194. package/dist/studio/index.html +1 -1
  195. package/dist/{studio-api-IXGX5ZFI.js → studio-api-CUZDC5B3.js} +17 -17
  196. package/dist/{studioServer-XVGYU6O3.js → studioServer-EZPRV43Y.js} +90 -84
  197. package/dist/{telemetry-E355EUDZ.js → telemetry-LFUVHARP.js} +10 -10
  198. package/dist/{telemetry-CQYHCCPL.js → telemetry-QG5AANZ4.js} +1 -1
  199. package/dist/{timeline-VWH6WSD7.js → timeline-GSH743JE.js} +41 -41
  200. package/dist/{tokens-IOAVF4UI.js → tokens-3ZMPSH7B.js} +3 -3
  201. package/dist/{transcribe-EGUXJGD4.js → transcribe-4SHNDPWW.js} +47 -47
  202. package/dist/{transcribe-EJA7OOHH.js → transcribe-TV7JBZQS.js} +19 -19
  203. package/dist/{tts-EDK3QS7M.js → tts-A2WILYGN.js} +6 -6
  204. package/dist/{updateCheck-U2CVTKPF.js → updateCheck-W7FTFOQF.js} +2 -2
  205. package/dist/{upgrade-CWEKQ4JO.js → upgrade-7YYYNAPF.js} +3 -3
  206. package/dist/{urlDownloader-DY5BLAFA.js → urlDownloader-PQSUS2CP.js} +12 -12
  207. package/dist/{validate-XOMNMKD6.js → validate-GCHAEVXM.js} +39 -38
  208. package/dist/{video-22NN6OEH.js → video-KGN7NJS5.js} +16 -14
  209. package/dist/warmCheck.js +227 -0
  210. package/dist/warmCheckClient.js +139 -0
  211. package/package.json +4 -2
  212. package/dist/chunk-BAZ5LCR3.js +0 -3805
  213. package/dist/hyperframe-runtime.js +0 -1125
  214. package/dist/{chunk-B4VT6YU2.js → chunk-QGOYNPQT.js} +3 -3
  215. package/dist/{synthesize-I2C24XJ5.js → synthesize-PKTB5ATG.js} +1 -1
@@ -0,0 +1,180 @@
1
+ import { createRequire as __hf_createRequire } from "node:module";
2
+ import { fileURLToPath as __hf_fileURLToPath } from "node:url";
3
+ import { dirname as __hf_dirname } from "node:path";
4
+ var require = __hf_createRequire(import.meta.url);
5
+ var __filename = __hf_fileURLToPath(import.meta.url);
6
+ var __dirname = __hf_dirname(__filename);
7
+ import {
8
+ isDegradableEvaluateTimeoutError,
9
+ isNavigationTimeoutError,
10
+ withRemainingBudget
11
+ } from "./chunk-EHSBBBR2.js";
12
+
13
+ // src/capture/navigateForCapture.ts
14
+ var NETWORK_IDLE_ATTEMPT_MS = 3e4;
15
+ function networkIdleAttemptTimeoutMs(totalTimeoutMs) {
16
+ return Math.min(NETWORK_IDLE_ATTEMPT_MS, Math.max(0, totalTimeoutMs));
17
+ }
18
+ async function navigateForCapture(page, url, totalTimeoutMs) {
19
+ const networkIdleTimeoutMs = networkIdleAttemptTimeoutMs(totalTimeoutMs);
20
+ try {
21
+ const response2 = await page.goto(url, {
22
+ waitUntil: "networkidle2",
23
+ timeout: networkIdleTimeoutMs
24
+ });
25
+ return {
26
+ response: response2,
27
+ waitUntil: "networkidle2",
28
+ networkIdleTimeoutMs,
29
+ fellBackFromNetworkIdle: false
30
+ };
31
+ } catch (err) {
32
+ if (!isNavigationTimeoutError(err) || networkIdleTimeoutMs >= totalTimeoutMs) {
33
+ throw err;
34
+ }
35
+ }
36
+ const fallbackTimeoutMs = totalTimeoutMs - networkIdleTimeoutMs;
37
+ const response = await page.goto(url, {
38
+ waitUntil: "domcontentloaded",
39
+ timeout: fallbackTimeoutMs
40
+ });
41
+ return {
42
+ response,
43
+ waitUntil: "domcontentloaded",
44
+ networkIdleTimeoutMs,
45
+ fellBackFromNetworkIdle: true
46
+ };
47
+ }
48
+ async function waitForPageReady(page, options = {}) {
49
+ const { timeoutMs = 15e3, networkIdle = "always" } = options;
50
+ const deadline = Date.now() + timeoutMs;
51
+ const remaining = () => Math.max(0, deadline - Date.now());
52
+ const idle = async () => {
53
+ try {
54
+ await page.waitForNetworkIdle?.({
55
+ idleTime: 500,
56
+ timeout: remaining(),
57
+ concurrency: 2
58
+ });
59
+ } catch {
60
+ }
61
+ };
62
+ if (networkIdle === "always" && remaining() > 0) await idle();
63
+ let waitedOutLoad = false;
64
+ while (remaining() > 0) {
65
+ let timer;
66
+ const loading = await Promise.race([
67
+ page.evaluate(() => document.readyState === "loading").catch((err) => {
68
+ if (isDegradableEvaluateTimeoutError(err)) throw err;
69
+ return true;
70
+ }),
71
+ new Promise((resolve) => {
72
+ timer = setTimeout(() => resolve(true), Math.max(1, remaining()));
73
+ })
74
+ ]).finally(() => {
75
+ if (timer !== void 0) clearTimeout(timer);
76
+ });
77
+ if (loading !== true) break;
78
+ waitedOutLoad = true;
79
+ if (remaining() > 0) {
80
+ await new Promise((resolve) => setTimeout(resolve, Math.min(500, remaining())));
81
+ }
82
+ }
83
+ if (waitedOutLoad && remaining() > 0) await idle();
84
+ }
85
+ var PUPPETEER_LAUNCH_DEFAULT_TIMEOUT_MS = 3e4;
86
+ var PAGE_LOAD_BLOCKING_TYPES = /* @__PURE__ */ new Set(["Document", "Script", "Stylesheet"]);
87
+ var NAMED_BLOCKING_REQUESTS = 3;
88
+ var SENT_OR_ANSWERED_WITHOUT_NETWORK = [
89
+ "Network.requestWillBeSentExtraInfo",
90
+ "Network.responseReceived"
91
+ ];
92
+ async function gotoWhenSent(page, url, timeoutMs, coldChromeFirstRequestTimeoutMs = PUPPETEER_LAUNCH_DEFAULT_TIMEOUT_MS) {
93
+ const { TimeoutError } = await import("puppeteer-core");
94
+ const cdp = await page.createCDPSession();
95
+ try {
96
+ await cdp.send("Network.enable");
97
+ const sent = documentRequestSent(cdp);
98
+ const unfinished = unfinishedPageLoadRequests(cdp);
99
+ const navigation = page.goto(url, { waitUntil: "domcontentloaded", timeout: 0 });
100
+ const navigationAwaitedBelow = navigation.catch(() => void 0);
101
+ await withRemainingBudget(
102
+ Promise.race([sent, navigationAwaitedBelow]),
103
+ coldChromeFirstRequestTimeoutMs,
104
+ "sending the page request",
105
+ () => new TimeoutError(
106
+ `Navigation timeout: Chrome did not send the page request within ${coldChromeFirstRequestTimeoutMs} ms`
107
+ )
108
+ );
109
+ return await withRemainingBudget(
110
+ navigation,
111
+ timeoutMs,
112
+ "loading the page",
113
+ () => new TimeoutError(pageLoadTimeoutMessage(timeoutMs, url, unfinished()))
114
+ );
115
+ } finally {
116
+ await cdp.detach().catch(() => void 0);
117
+ }
118
+ }
119
+ function documentRequestSent(cdp) {
120
+ const documents = /* @__PURE__ */ new Set();
121
+ const sent = /* @__PURE__ */ new Set();
122
+ return new Promise((resolve) => {
123
+ const settle = (requestId) => {
124
+ if (documents.has(requestId) && sent.has(requestId)) resolve();
125
+ };
126
+ cdp.on("Network.requestWillBeSent", ({ requestId, type }) => {
127
+ if (type === "Document") documents.add(requestId);
128
+ settle(requestId);
129
+ });
130
+ for (const event of SENT_OR_ANSWERED_WITHOUT_NETWORK) {
131
+ cdp.on(event, ({ requestId }) => {
132
+ sent.add(requestId);
133
+ settle(requestId);
134
+ });
135
+ }
136
+ });
137
+ }
138
+ function unfinishedPageLoadRequests(cdp) {
139
+ const unfinished = /* @__PURE__ */ new Map();
140
+ cdp.on("Network.requestWillBeSent", ({ requestId, request, type }) => {
141
+ if (type && PAGE_LOAD_BLOCKING_TYPES.has(type)) unfinished.set(requestId, request.url);
142
+ });
143
+ for (const event of ["Network.loadingFinished", "Network.loadingFailed"]) {
144
+ cdp.on(event, ({ requestId }) => unfinished.delete(requestId));
145
+ }
146
+ return () => [...unfinished.values()];
147
+ }
148
+ function urlWithoutSecrets(raw) {
149
+ try {
150
+ const url = new URL(raw);
151
+ if (url.protocol !== "http:" && url.protocol !== "https:") return `${url.protocol}\u2026`;
152
+ return `${url.origin}${url.pathname}${url.search ? "?\u2026" : ""}`;
153
+ } catch {
154
+ return "(unreadable URL)";
155
+ }
156
+ }
157
+ function originOf(raw) {
158
+ try {
159
+ return new URL(raw).origin;
160
+ } catch {
161
+ return null;
162
+ }
163
+ }
164
+ function pageLoadTimeoutMessage(timeoutMs, pageUrl, waitingOn) {
165
+ const exceeded = `Navigation timeout of ${timeoutMs} ms exceeded`;
166
+ if (waitingOn.length === 0) return exceeded;
167
+ const named = waitingOn.slice(0, NAMED_BLOCKING_REQUESTS).map(urlWithoutSecrets).join(", ");
168
+ const unnamed = waitingOn.length - NAMED_BLOCKING_REQUESTS;
169
+ const more = unnamed > 0 ? ` and ${unnamed} more` : "";
170
+ const pageOrigin = new URL(pageUrl).origin;
171
+ const fromAnotherServer = waitingOn.some((request) => originOf(request) !== pageOrigin);
172
+ const advice = fromAnotherServer ? " A <script> or stylesheet from another server holds the page until it arrives; serve it from the project instead." : "";
173
+ return `${exceeded} while the page was still loading ${named}${more}.${advice}`;
174
+ }
175
+
176
+ export {
177
+ navigateForCapture,
178
+ waitForPageReady,
179
+ gotoWhenSent
180
+ };
@@ -7,9 +7,11 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  writeCaptureFileSync
9
9
  } from "./chunk-MRF4AMKD.js";
10
+ import {
11
+ loadSharp
12
+ } from "./chunk-QH3T4WI2.js";
10
13
 
11
14
  // src/capture/contactSheet.ts
12
- import sharp from "sharp";
13
15
  import { readdirSync, readFileSync, unlinkSync, existsSync } from "fs";
14
16
  import { join, extname, basename, dirname } from "path";
15
17
  async function createContactSheet(imagePaths, outputPath, opts = {}) {
@@ -25,6 +27,7 @@ async function createContactSheet(imagePaths, outputPath, opts = {}) {
25
27
  if ((opts.remainingMs?.() ?? 1) <= 0) return null;
26
28
  const files = imagePaths.slice(0, maxImages);
27
29
  if (files.length === 0) return null;
30
+ const sharp = await loadSharp("contact sheets");
28
31
  const firstMeta = await sharp(files[0]).metadata();
29
32
  const srcW = firstMeta.width || 1920;
30
33
  const srcH = firstMeta.height || 1080;
@@ -157,6 +160,7 @@ async function createSvgContactSheet(svgsDir, outputPath, assetsRootDir, budget
157
160
  }
158
161
  }
159
162
  if (svgPaths.length === 0) return [];
163
+ const sharp = await loadSharp("contact sheets");
160
164
  const svgFileNames = svgPaths.map((p) => p.split("/").pop());
161
165
  const thumbSize = 200;
162
166
  const tmpDir = dirname(outputPath);
@@ -19,7 +19,11 @@ import {
19
19
  splitElementInHtml,
20
20
  unwrapElementsFromHtml,
21
21
  wrapElementsInHtml
22
- } from "./chunk-IWTRHPTP.js";
22
+ } from "./chunk-EVAQPW6O.js";
23
+ import {
24
+ MEDIA_LINK_ATTR,
25
+ relinkSplitHalves
26
+ } from "./chunk-6JR2XUEE.js";
23
27
  import {
24
28
  DEFAULT_TARGET_LUFS,
25
29
  absoluteLoudnessPlan,
@@ -30,9 +34,19 @@ import {
30
34
  resolveLocalAudioPath
31
35
  } from "./chunk-TTVHYD5R.js";
32
36
  import {
33
- MEDIA_LINK_ATTR,
34
- relinkSplitHalves
35
- } from "./chunk-6JR2XUEE.js";
37
+ HistoryBusyError,
38
+ MAX_WINDOW_IDLE_MS,
39
+ STUDIO_SIGNATURE_MANIFEST_PATHS,
40
+ UNDO_MODES,
41
+ clearFileWriteReceipt,
42
+ createProjectSignature,
43
+ createWriteToken,
44
+ fileContentVersion,
45
+ recordFileWriteReceipt,
46
+ resolveProjectAndSignature,
47
+ resolveProjectSignature,
48
+ settledFileTag
49
+ } from "./chunk-U6RXZNZE.js";
36
50
  import {
37
51
  PROXY_PARAMS_VERSION,
38
52
  PROXY_PENDING_RETRY_AFTER_SECONDS,
@@ -54,21 +68,7 @@ import {
54
68
  scanProjectMediaCodecMap,
55
69
  shouldPrewarmProxy,
56
70
  waitForProxy
57
- } from "./chunk-KIO3R4QN.js";
58
- import {
59
- HistoryBusyError,
60
- MAX_WINDOW_IDLE_MS,
61
- STUDIO_SIGNATURE_MANIFEST_PATHS,
62
- UNDO_MODES,
63
- clearFileWriteReceipt,
64
- createProjectSignature,
65
- createWriteToken,
66
- fileContentVersion,
67
- recordFileWriteReceipt,
68
- resolveProjectAndSignature,
69
- resolveProjectSignature,
70
- settledFileTag
71
- } from "./chunk-ICMXC3MI.js";
71
+ } from "./chunk-GPE3WWTO.js";
72
72
  import {
73
73
  STUDIO_MOTION_PATH,
74
74
  createStudioMotionRenderBodyScript,
@@ -84,6 +84,11 @@ import {
84
84
  findTimelineScript,
85
85
  parseGsapScriptAcorn
86
86
  } from "./chunk-5CS4T6C6.js";
87
+ import {
88
+ atomicTempPath,
89
+ createFileAtomically,
90
+ replaceFileAtomically
91
+ } from "./chunk-EOVYQ3IG.js";
87
92
  import {
88
93
  parseEncoderOptions
89
94
  } from "./chunk-KLIKCX6Q.js";
@@ -96,16 +101,6 @@ import {
96
101
  fontDirectories,
97
102
  locateSystemFont
98
103
  } from "./chunk-7FMUTGOH.js";
99
- import {
100
- atomicTempPath,
101
- createFileAtomically,
102
- replaceFileAtomically
103
- } from "./chunk-EOVYQ3IG.js";
104
- import {
105
- addScenePartsManifest,
106
- ensureHfIds,
107
- stampHfIdsInPlace
108
- } from "./chunk-4IEH6EAC.js";
109
104
  import {
110
105
  PREVIEW_PROXY_BOX_PARAM,
111
106
  formatPreviewProxyBox,
@@ -114,7 +109,12 @@ import {
114
109
  motionPathPluginUrl,
115
110
  parseFps,
116
111
  parsePreviewProxyBox
117
- } from "./chunk-LBQFLUIY.js";
112
+ } from "./chunk-VFBAKPRC.js";
113
+ import {
114
+ addScenePartsManifest,
115
+ ensureHfIds,
116
+ stampHfIdsInPlace
117
+ } from "./chunk-WT4PYV2J.js";
118
118
  import {
119
119
  AFTER_FONTS_SCRIPT_TYPE,
120
120
  RUNTIME_BOOTSTRAP_ATTR,
@@ -128,7 +128,7 @@ import {
128
128
  resolveRateSpec,
129
129
  sourceTimeAt,
130
130
  stripEmbeddedRuntimeScripts
131
- } from "./chunk-BAZ5LCR3.js";
131
+ } from "./chunk-GMNHAOMJ.js";
132
132
  import {
133
133
  HTML_ATTRIBUTE_ENTITIES,
134
134
  MagicString,
@@ -145,17 +145,17 @@ import {
145
145
  mkdirWithinProject,
146
146
  realpath
147
147
  } from "./chunk-OFQWTKPW.js";
148
- import {
149
- isWithinProjectRoot,
150
- readProjectFile
151
- } from "./chunk-6BNTGNGD.js";
152
148
  import {
153
149
  FFPROBE_PATH_ENV,
154
150
  findFfBinary
155
151
  } from "./chunk-VAS6HQX3.js";
152
+ import {
153
+ isWithinProjectRoot,
154
+ readProjectFile
155
+ } from "./chunk-6BNTGNGD.js";
156
156
  import {
157
157
  sameInstant
158
- } from "./chunk-32GKETR7.js";
158
+ } from "./chunk-MMQ52NIZ.js";
159
159
  import {
160
160
  decodeCssEscapes,
161
161
  decodeWellFormedEscapes,
@@ -306,7 +306,7 @@ function clearElementScreenshotIsolation() {
306
306
  page.__hfThumbnailFaded = [];
307
307
  }
308
308
 
309
- // ../studio-server/dist/chunk-7L3DUCM3.js
309
+ // ../studio-server/dist/chunk-436CO7P5.js
310
310
  import { resolve } from "path";
311
311
  function isAutoProxyEnabled(adapter) {
312
312
  return adapter.autoProxy !== false;
@@ -3731,11 +3731,11 @@ function registerProjectRoutes(api, adapter) {
3731
3731
  });
3732
3732
  }
3733
3733
  var MIME_TYPES = {
3734
- ".html": "text/html",
3735
- ".css": "text/css",
3736
- ".js": "text/javascript",
3737
- ".mjs": "text/javascript",
3738
- ".json": "application/json",
3734
+ ".html": "text/html; charset=utf-8",
3735
+ ".css": "text/css; charset=utf-8",
3736
+ ".js": "text/javascript; charset=utf-8",
3737
+ ".mjs": "text/javascript; charset=utf-8",
3738
+ ".json": "application/json; charset=utf-8",
3739
3739
  ".svg": "image/svg+xml",
3740
3740
  ".png": "image/png",
3741
3741
  ".jpg": "image/jpeg",
@@ -5499,7 +5499,7 @@ async function prepareGsapMutationScript(c, res, firstMutation) {
5499
5499
  let block = extractGsapScriptBlock(html);
5500
5500
  if (!block && (firstMutation.type === "add" || firstMutation.type === "add-with-keyframes")) {
5501
5501
  const compId = html.match(/data-composition-id="([^"]+)"/)?.[1] ?? "main";
5502
- const { GSAP_CDN } = await import("./dist-VO7OXOFK.js");
5502
+ const { GSAP_CDN } = await import("./dist-WRDLWRMS.js");
5503
5503
  const bootstrap = [
5504
5504
  `<script src="${GSAP_CDN}"></script>`,
5505
5505
  "<script>",
@@ -8302,18 +8302,18 @@ var ThumbnailGenerationCoordinator = class {
8302
8302
  var thumbnailGenerationCoordinator = new ThumbnailGenerationCoordinator(1);
8303
8303
  var MAX_SOURCE_BYTES = 64 * 1024 * 1024;
8304
8304
  var MAX_CACHE_BYTES = 8 * 1024 * 1024;
8305
- var sharpLoad;
8306
- function loadSharp() {
8307
- sharpLoad ??= import("sharp").then(
8308
- (module) => module.default,
8309
- (error) => {
8310
- console.warn("[Studio] JPEG thumbnails are off: sharp could not load:", error);
8311
- throw error;
8312
- }
8313
- );
8314
- return sharpLoad;
8305
+ function retryingSharpLoader(adapter) {
8306
+ let loaded;
8307
+ let warned = false;
8308
+ const load = () => adapter.loadSharp?.() ?? import("sharp").then((module) => module.default);
8309
+ return () => loaded ??= load().catch((error) => {
8310
+ loaded = void 0;
8311
+ if (!warned) console.warn("[Studio] JPEG thumbnails are off: sharp could not load:", error);
8312
+ warned = true;
8313
+ throw error;
8314
+ });
8315
8315
  }
8316
- async function generateThumbnail(path, signal) {
8316
+ async function generateThumbnail(loadSharp, path, signal) {
8317
8317
  const sharp = await loadSharp();
8318
8318
  const file = await open(path, "r");
8319
8319
  try {
@@ -8354,6 +8354,7 @@ async function resolveSource(adapter, id, url) {
8354
8354
  }
8355
8355
  function registerImageThumbnailRoutes(api, adapter) {
8356
8356
  const coordinator = new ThumbnailGenerationCoordinator(2);
8357
+ const loadSharp = retryingSharpLoader(adapter);
8357
8358
  const cache = /* @__PURE__ */ new Map();
8358
8359
  let cacheBytes = 0;
8359
8360
  const remember = (key, image) => {
@@ -8382,7 +8383,7 @@ function registerImageThumbnailRoutes(api, adapter) {
8382
8383
  else {
8383
8384
  if (coordinator.protectedKeys().size >= 32) return c.text("thumbnail queue full", 429);
8384
8385
  result = await coordinator.acquire(key, c.req.raw.signal, async (signal) => {
8385
- const image = await generateThumbnail(path, signal);
8386
+ const image = await generateThumbnail(loadSharp, path, signal);
8386
8387
  remember(key, image);
8387
8388
  return image;
8388
8389
  }) ?? void 0;
@@ -6,14 +6,14 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveProject
9
- } from "./chunk-55P7GDT6.js";
9
+ } from "./chunk-TJB4GAV6.js";
10
10
  import {
11
11
  DEFAULT_HISTORY_ROOT,
12
12
  HistoryBusyError,
13
13
  MAX_WINDOW_IDLE_MS,
14
14
  openProjectHistory,
15
15
  readProjectHistory
16
- } from "./chunk-ICMXC3MI.js";
16
+ } from "./chunk-U6RXZNZE.js";
17
17
  import {
18
18
  findPreviewServerForProject,
19
19
  studioApiUrl
@@ -6,16 +6,16 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  detectGpuEncoder
9
- } from "./chunk-W4SLIGGM.js";
10
- import {
11
- detectWsl
12
- } from "./chunk-W2LGJSEN.js";
9
+ } from "./chunk-73LTCCZI.js";
13
10
  import {
14
11
  runCancellableProcess
15
- } from "./chunk-D3ZWBHZP.js";
12
+ } from "./chunk-DYAPHNV6.js";
16
13
  import {
17
14
  findFfBinary
18
15
  } from "./chunk-VAS6HQX3.js";
16
+ import {
17
+ detectWsl
18
+ } from "./chunk-W2LGJSEN.js";
19
19
 
20
20
  // src/browser/linuxDeps.ts
21
21
  import { execFileSync } from "child_process";
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  failCommand
9
- } from "./chunk-PBN6GBJE.js";
9
+ } from "./chunk-JVBRJMOP.js";
10
10
 
11
11
  // src/commands/lambda/state.ts
12
12
  import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "fs";