hyperframes 0.9.5 → 0.9.7

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 (231) hide show
  1. package/dist/{add-XI5CW2YO.js → add-WLXYFHMC.js} +12 -12
  2. package/dist/{agentPromptGenerator-EEP7CJRK.js → agentPromptGenerator-2SMADJAL.js} +6 -6
  3. package/dist/{animatedGifPrep-3VKPC32B.js → animatedGifPrep-4WCFONEJ.js} +6 -6
  4. package/dist/api.d.ts +2 -0
  5. package/dist/api.js +25 -25
  6. package/dist/{asset-RYVHIREA.js → asset-UQBTWAMJ.js} +2 -2
  7. package/dist/{assetCataloger-MG3GSWNQ.js → assetCataloger-GOUD7VDG.js} +7 -7
  8. package/dist/{audio-CNKU2KQR.js → audio-LDVXMRHU.js} +506 -147
  9. package/dist/{auth-MX2SGZQH.js → auth-6LVATNTF.js} +6 -6
  10. package/dist/{autoUpdate-MB3SWOXG.js → autoUpdate-X6KZRI5E.js} +2 -2
  11. package/dist/{backgroundChecks-TYCDOGQX.js → backgroundChecks-3HGGWYLY.js} +3 -3
  12. package/dist/backgroundChecksWorker.js +3 -3
  13. package/dist/{batchRender-PHXZBVEA.js → batchRender-4ISYYVPQ.js} +3 -3
  14. package/dist/{beats-5SXSGNUM.js → beats-WN2KYIK3.js} +9 -9
  15. package/dist/{benchmark-V5Y5OQ3W.js → benchmark-HZPGQ2MP.js} +9 -9
  16. package/dist/{billing-FFWAEIQ6.js → billing-3Q2EAZFJ.js} +4 -4
  17. package/dist/{browser-CJ2HDBEC.js → browser-6XC7MTQL.js} +4 -4
  18. package/dist/{bundleWithLocalizedFonts-2FPP3MMD.js → bundleWithLocalizedFonts-ZZ6Y4CEO.js} +2 -2
  19. package/dist/{capture-KE3474CJ.js → capture-46LJ2VU2.js} +3 -3
  20. package/dist/{capture-424KH55L.js → capture-FCLAEX5L.js} +19 -19
  21. package/dist/{captureCompositionFrame-ZPZCQTYL.js → captureCompositionFrame-SMUDCZ2L.js} +11 -11
  22. package/dist/{catalog-3S4LAGZH.js → catalog-72AEDDEG.js} +12 -12
  23. package/dist/{catch-up-7ZLNBOG4.js → catch-up-6WIX7SWV.js} +5 -5
  24. package/dist/{check-6OCBPXX5.js → check-R2G5OYIA.js} +37 -37
  25. package/dist/{checkAudio-O5RDEOEX.js → checkAudio-2RP7BNQ3.js} +9 -9
  26. package/dist/{checkBrowser-DJPH634D.js → checkBrowser-OWLF2BT4.js} +31 -31
  27. package/dist/{chunk-T46SP3UD.js → chunk-2BARV2ZU.js} +48 -8
  28. package/dist/{chunk-DRXVRDUX.js → chunk-2X43RFKM.js} +1 -1
  29. package/dist/{chunk-6U4EV64B.js → chunk-3AH6KE6F.js} +39 -11
  30. package/dist/{chunk-ZDQEVQHB.js → chunk-3LHJHMFK.js} +1 -1
  31. package/dist/{chunk-ZFQ4N6D2.js → chunk-3Q7UFKFN.js} +3 -3
  32. package/dist/{chunk-TWIPYH4G.js → chunk-3YJB4QVS.js} +1 -1
  33. package/dist/{chunk-M56MEMPF.js → chunk-46HMQ4I3.js} +1 -1
  34. package/dist/{chunk-HMMHCSSN.js → chunk-6IW2HWYI.js} +7 -8
  35. package/dist/{chunk-OHWVSTNO.js → chunk-74VSOKKS.js} +6 -4
  36. package/dist/{chunk-JX5GUEFA.js → chunk-7LCZBNX7.js} +1 -1
  37. package/dist/{chunk-QIFINY2N.js → chunk-7XRS2NDR.js} +7 -7
  38. package/dist/{chunk-5FAU3XAO.js → chunk-AWQE37H3.js} +2 -2
  39. package/dist/{chunk-NASVSJQK.js → chunk-BGMMC352.js} +19 -7
  40. package/dist/{chunk-6NJVSTSY.js → chunk-BVAPHHMQ.js} +7 -3
  41. package/dist/{chunk-CRDXU4IX.js → chunk-C3FKYBZ4.js} +10 -10
  42. package/dist/{chunk-NVPB37H4.js → chunk-C7XW5WPZ.js} +2 -2
  43. package/dist/{chunk-YK6ERJTN.js → chunk-CTPYBHF3.js} +2 -2
  44. package/dist/{chunk-JZJ3LLIO.js → chunk-CUCDUPTA.js} +1 -1
  45. package/dist/{chunk-MNW4FTAJ.js → chunk-CX6MGY2B.js} +13 -13
  46. package/dist/{chunk-BXE6GDIL.js → chunk-DOS6S7HW.js} +1 -1
  47. package/dist/{chunk-MBOZUQFZ.js → chunk-DZNJD7BH.js} +1 -1
  48. package/dist/{chunk-YPBGUVLY.js → chunk-E3IBPTX7.js} +1 -1
  49. package/dist/{chunk-7FERR4YN.js → chunk-E4XS2M2E.js} +1 -1
  50. package/dist/{chunk-44IJ426Z.js → chunk-EG7FZSEF.js} +1 -1
  51. package/dist/{chunk-GOPJLAMZ.js → chunk-ETYQYG6Q.js} +78 -19
  52. package/dist/chunk-FLDSZTHP.js +134 -0
  53. package/dist/{chunk-S5SVW6ZY.js → chunk-FYDFHW22.js} +13 -13
  54. package/dist/{chunk-JD7MLLJD.js → chunk-FYR2GKAA.js} +4 -4
  55. package/dist/{chunk-WAQX3AYB.js → chunk-GBEGZOP3.js} +1 -1
  56. package/dist/{chunk-4W2ZN4HT.js → chunk-GK3OROLS.js} +1 -1
  57. package/dist/{chunk-Y6TDJUHR.js → chunk-HBCY63DS.js} +2 -2
  58. package/dist/{chunk-5TBRPDH3.js → chunk-HRSZOW3U.js} +55 -16
  59. package/dist/{chunk-MX7NW3QW.js → chunk-HZG42ZYW.js} +3 -3
  60. package/dist/{chunk-RTUQDHKE.js → chunk-IAZ2A7D6.js} +97 -11
  61. package/dist/{chunk-KLJEGC6M.js → chunk-IOECRDWX.js} +1 -1
  62. package/dist/{chunk-CGXL36FR.js → chunk-IX3R4BKU.js} +1 -1
  63. package/dist/{chunk-SXKFFBN3.js → chunk-IXGZ6YFZ.js} +85 -9
  64. package/dist/{chunk-TI4JPSFS.js → chunk-KD22R2UE.js} +3 -3
  65. package/dist/{chunk-JDT5PZWS.js → chunk-KDTOB4TD.js} +1 -1
  66. package/dist/{chunk-RUZ63CJF.js → chunk-LAZREIJF.js} +1 -1
  67. package/dist/{chunk-PYOEIKGI.js → chunk-LCDXHXYH.js} +2 -2
  68. package/dist/{chunk-2RLI5ISA.js → chunk-LFDPOL45.js} +3 -3
  69. package/dist/{chunk-YGSQABOD.js → chunk-LIA4GZ4F.js} +2 -2
  70. package/dist/{chunk-HWIGWPIG.js → chunk-N6O2RQLQ.js} +3 -1
  71. package/dist/{chunk-MYTROPEC.js → chunk-NEI65CWG.js} +2 -2
  72. package/dist/{chunk-MGXQXY4C.js → chunk-NFNYH6VQ.js} +2 -2
  73. package/dist/{chunk-FZM6E4S4.js → chunk-OJTXXFYO.js} +2 -2
  74. package/dist/{chunk-JAYAOI3W.js → chunk-OO7U23BR.js} +1 -1
  75. package/dist/chunk-OUZSRPKC.js +5035 -0
  76. package/dist/{chunk-XXFWK5Y7.js → chunk-P73MHFBX.js} +1 -1
  77. package/dist/{chunk-46DXV7OQ.js → chunk-P7CVKVPD.js} +2 -2
  78. package/dist/{chunk-C555UZ5B.js → chunk-PG356QHK.js} +2 -2
  79. package/dist/{chunk-EG2ESF6S.js → chunk-PPNA6EBI.js} +1 -1
  80. package/dist/{chunk-5FFHLOVF.js → chunk-PUMQDN2T.js} +1 -1
  81. package/dist/{chunk-64OUBJSX.js → chunk-PYWJGSWO.js} +1 -1
  82. package/dist/{chunk-JAJ6PAR6.js → chunk-QXUDHDJU.js} +7 -7
  83. package/dist/{chunk-WTUIK6Y4.js → chunk-QXVW22VM.js} +3 -1
  84. package/dist/{chunk-ARNCWQNR.js → chunk-RJ6LXDUC.js} +1 -1
  85. package/dist/{chunk-WAK6IPMP.js → chunk-RWHCRVZV.js} +5 -5
  86. package/dist/{chunk-7XCGHD55.js → chunk-RY7Z6KFS.js} +4 -4
  87. package/dist/{chunk-HZMM3D6P.js → chunk-SE6O4APZ.js} +2 -2
  88. package/dist/{chunk-K4SINZFP.js → chunk-SEJ7UBR2.js} +2 -2
  89. package/dist/{chunk-VPVO5COM.js → chunk-SIJYH7XM.js} +1 -1
  90. package/dist/{chunk-CS6UO5NC.js → chunk-SXGXJAA7.js} +1 -1
  91. package/dist/{chunk-UL3SKAZB.js → chunk-T252SG67.js} +2 -2
  92. package/dist/{chunk-NRO2PLEC.js → chunk-TBCRTIXP.js} +2 -2
  93. package/dist/{chunk-5T2D2XYR.js → chunk-TSCO4XR4.js} +1 -1
  94. package/dist/{chunk-QEQEKBL7.js → chunk-TSQZ3DSC.js} +20 -5
  95. package/dist/{chunk-3B3LGZ36.js → chunk-UDY3FS6G.js} +9 -9
  96. package/dist/{chunk-ALBHEVJJ.js → chunk-ULH6TLE3.js} +1 -1
  97. package/dist/{chunk-Q2LWMJAQ.js → chunk-UQH3MOES.js} +2 -2
  98. package/dist/{chunk-HDKRDALC.js → chunk-V6MZZEA7.js} +5 -5
  99. package/dist/{chunk-H7KAHDJJ.js → chunk-WAURLEUO.js} +3 -3
  100. package/dist/{chunk-6447ORC2.js → chunk-WZGVBZY6.js} +1 -1
  101. package/dist/{chunk-NUGADGXQ.js → chunk-X2PPRHKO.js} +1 -1
  102. package/dist/{chunk-RW4DTMPK.js → chunk-X3DTUYKZ.js} +7 -7
  103. package/dist/{chunk-PMQ65BTY.js → chunk-X4K7Q5PT.js} +1 -1
  104. package/dist/{chunk-KW2ZREKY.js → chunk-XEP7PGXS.js} +1 -1
  105. package/dist/{chunk-6PLIPRVQ.js → chunk-XFA6NPMP.js} +3 -3
  106. package/dist/{chunk-GC2GKCRQ.js → chunk-XKTLYF4N.js} +18 -18
  107. package/dist/{chunk-HZDSKYTV.js → chunk-XXEOJXXY.js} +2 -2
  108. package/dist/{chunk-MCROAQ7A.js → chunk-Y2R4N6HQ.js} +9 -9
  109. package/dist/{chunk-FEC4UQK2.js → chunk-YHO5SKUR.js} +5 -5
  110. package/dist/{chunk-IWMVCOUX.js → chunk-YTWTG67C.js} +7 -7
  111. package/dist/{chunk-SBPDYU34.js → chunk-ZVERYNYS.js} +1 -1
  112. package/dist/{clean-ZKPZ4HHG.js → clean-52TVJH4U.js} +16 -16
  113. package/dist/cli.js +58 -57
  114. package/dist/{cloud-GQZYBRBI.js → cloud-FEPPMA5F.js} +4 -4
  115. package/dist/{cloudrun-TWSNNKIV.js → cloudrun-DFWQ7ZJW.js} +4 -4
  116. package/dist/{compare-3IXL3WVG.js → compare-UBQUKWOB.js} +28 -28
  117. package/dist/{compiler-SKQTN3EA.js → compiler-UCJ4KC75.js} +3 -3
  118. package/dist/{component-RV72K74J.js → component-6YUQ2XAM.js} +3 -3
  119. package/dist/{compositions-W2IKF36U.js → compositions-KGZO4UYR.js} +11 -11
  120. package/dist/{curve-TRCKVHYB.js → curve-VISYHZKL.js} +10 -10
  121. package/dist/{cuts-SRXTGX33.js → cuts-HCWYCBI2.js} +11 -11
  122. package/dist/{delete-7PZLZFBE.js → delete-CNKHLEDS.js} +6 -6
  123. package/dist/{deploy-GORJQIPX.js → deploy-TS3R7DTD.js} +4 -4
  124. package/dist/{describeProject-ZIFVZUSV.js → describeProject-6TNE4FY4.js} +7 -7
  125. package/dist/{diff-PHRMVJMC.js → diff-YRBYR56R.js} +25 -25
  126. package/dist/{dist-IHPMKRYN.js → dist-H4C7ZCFU.js} +1 -1
  127. package/dist/{dist-4KKPG6A5.js → dist-T57O7KXT.js} +4 -2
  128. package/dist/{doctor-C6Q2FECX.js → doctor-PLA77GFC.js} +10 -10
  129. package/dist/{energy-CNXVSSE6.js → energy-7BTNGNR7.js} +11 -11
  130. package/dist/{events-FSUH46NR.js → events-25FIG2O6.js} +13 -13
  131. package/dist/{events-27C4TXPP.js → events-IMWCEFSZ.js} +4 -4
  132. package/dist/{events-UG3LC2PB.js → events-QTM2OEFB.js} +3 -3
  133. package/dist/{extract-GLPADLLV.js → extract-C66C5A22.js} +11 -11
  134. package/dist/{face-TTOHRJEY.js → face-MDOI2JO5.js} +11 -11
  135. package/dist/{feedback-BYONPSSM.js → feedback-26OSAZF3.js} +11 -11
  136. package/dist/{ffmpeg-WAM27CD6.js → ffmpeg-R5ND25AV.js} +6 -6
  137. package/dist/{figma-Y4UR2EDE.js → figma-276JAPS4.js} +3 -3
  138. package/dist/fontLocalizeCli.js +9 -9
  139. package/dist/{frames-CNQUJEUV.js → frames-AMLBNI5B.js} +12 -12
  140. package/dist/{generate-BPYDIEPB.js → generate-YIZS4JFA.js} +17 -17
  141. package/dist/{get-4LY5VJW2.js → get-HFEFIRAJ.js} +6 -6
  142. package/dist/{gpuPolicy-OUHJ7GVX.js → gpuPolicy-7JA66MJG.js} +6 -6
  143. package/dist/{grade-compare-WEZBE3WM.js → grade-compare-7NH6XYIY.js} +29 -29
  144. package/dist/{heifImagePrep-7L4HH33F.js → heifImagePrep-WCL36MHY.js} +7 -7
  145. package/dist/{help-QKNWJOBV.js → help-HHIAUMBQ.js} +2 -1
  146. package/dist/{history-XQEWP2IW.js → history-SLWPRU6Q.js} +7 -7
  147. package/dist/hyperframe.manifest.json +1 -1
  148. package/dist/hyperframe.runtime.iife.js +64 -64
  149. package/dist/hyperframes-player.global.js +90 -3
  150. package/dist/{info-AMRQ5R4N.js → info-MIPROXSM.js} +8 -8
  151. package/dist/{init-4VTMKZSQ.js → init-T56UGI6Z.js} +32 -29
  152. package/dist/{ink-KB3LZMJY.js → ink-TY7CKC6Q.js} +11 -11
  153. package/dist/{inspect-ZWN2DVO4.js → inspect-TIF7YHGN.js} +29 -29
  154. package/dist/{installer-2NUMLKHQ.js → installer-72QUKTPE.js} +4 -4
  155. package/dist/{keyframes-I456RFGP.js → keyframes-I4JRA37J.js} +7 -7
  156. package/dist/{lambda-2QKB4BJM.js → lambda-VGFSEG56.js} +10 -10
  157. package/dist/{layout-WPHWXQCM.js → layout-K776Z2IS.js} +29 -29
  158. package/dist/{lint-EO5DXJ36.js → lint-XLTSC66T.js} +8 -8
  159. package/dist/{lintProject-SG4KRUAV.js → lintProject-NZADSVSU.js} +1 -1
  160. package/dist/{list-LZOUUJBY.js → list-6V3IKLXF.js} +6 -6
  161. package/dist/{localPage-SZWQWWJ7.js → localPage-RM6EXBBT.js} +6 -6
  162. package/dist/{login-IEWPNTGD.js → login-HD47X3JE.js} +12 -13
  163. package/dist/{logout-B6H5F5YP.js → logout-UMDA3HDE.js} +3 -3
  164. package/dist/{look-6L3CPY4H.js → look-KUDJYDTK.js} +11 -11
  165. package/dist/{manager-C7677YAV.js → manager-TUKVGY7O.js} +7 -7
  166. package/dist/{measure-TINTS6YY.js → measure-6BRNY3II.js} +11 -11
  167. package/dist/{media-treatment-3BDHM4P6.js → media-treatment-MLME5LNQ.js} +13 -13
  168. package/dist/{media-use-JC2B2JSE.js → media-use-3YTDQKGR.js} +9 -5
  169. package/dist/{models-JMM25YO6.js → models-IUX642FY.js} +10 -10
  170. package/dist/{motionShot-4WB3SH6V.js → motionShot-INNVFSPU.js} +14 -14
  171. package/dist/{normalize-audio-2ZJKR5G3.js → normalize-audio-ZMJIN2OV.js} +9 -9
  172. package/dist/{open-LMYSLYH2.js → open-FDQ3NDSX.js} +12 -12
  173. package/dist/{parakeetRunner-HTQVLX2B.js → parakeetRunner-WZ6JW3QQ.js} +11 -11
  174. package/dist/{pipeline-FMVCPIRU.js → pipeline-V3TOATHS.js} +9 -9
  175. package/dist/{play-GFHBG3NZ.js → play-5WIU4CZL.js} +20 -20
  176. package/dist/{preflight-L5GC6ASI.js → preflight-JXEVL63B.js} +7 -7
  177. package/dist/{present-PW3RWNWF.js → present-UHWGVCP4.js} +16 -16
  178. package/dist/{preview-IRLHPLSD.js → preview-W75P6D7E.js} +18 -18
  179. package/dist/probe-O2ADL5FX.js +69 -0
  180. package/dist/{producer-M6IWCFMK.js → producer-6GQQQT7M.js} +1 -1
  181. package/dist/{projectConfig-IVJE7A42.js → projectConfig-FQ7CAOXL.js} +10 -6
  182. package/dist/{publication-BS2YATIF.js → publication-YRVC6D56.js} +2 -2
  183. package/dist/{publish-OTRA2JWM.js → publish-4IN3WW5G.js} +15 -15
  184. package/dist/{refresh-T6JLFCS4.js → refresh-4FQFQ2SW.js} +3 -3
  185. package/dist/{remove-background-UV37Y7T7.js → remove-background-L4KWXVMH.js} +10 -10
  186. package/dist/{render-3FANM5MO.js → render-73VGDCCH.js} +5 -5
  187. package/dist/{render-XSDVVBEY.js → render-GZ4DBQ5E.js} +41 -31
  188. package/dist/{render-7VBLI4AZ.js → render-IP7KBRD7.js} +32 -32
  189. package/dist/{render-batch-DPWJHKFY.js → render-batch-RX3TJ4NY.js} +5 -5
  190. package/dist/renderSetupWorker.js +1 -1
  191. package/dist/{resolver-VQ32ZH6Y.js → resolver-SNTBG6O2.js} +4 -4
  192. package/dist/reverse-5SHT4TC6.js +32 -0
  193. package/dist/{run-MTGSR5HH.js → run-GV6MEM2M.js} +4 -4
  194. package/dist/{sherpa-BSIBIIIO.js → sherpa-LJJHQNQ6.js} +10 -10
  195. package/dist/skills/hyperframes-cli/references/cloud.md +1 -1
  196. package/dist/skills/media-use/SKILL.md +5 -5
  197. package/dist/skills/media-use/audio/references/requirements.md +7 -7
  198. package/dist/skills/media-use/audio/references/tts.md +7 -6
  199. package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +16 -10
  200. package/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +32 -0
  201. package/dist/skills/media-use/references/heygen.md +1 -1
  202. package/dist/{skills-S7JNBPZZ.js → skills-NVNRQU7K.js} +6 -6
  203. package/dist/{skillsUpdateCheck-WFEV6VYU.js → skillsUpdateCheck-QNFIPFLX.js} +3 -3
  204. package/dist/{snapshot-NCWXYS2E.js → snapshot-75S4SIRK.js} +173 -66
  205. package/dist/{src-AYBT7IBT.js → src-KS6W3WRC.js} +8 -8
  206. package/dist/{src-7WW3KXOI.js → src-MTLH4YHV.js} +17 -5
  207. package/dist/start-4UCLBL76.js +226 -0
  208. package/dist/{staticProjectServer-VYZV4BSU.js → staticProjectServer-USD7TCZH.js} +17 -17
  209. package/dist/{status-Z5BPMROD.js → status-MPCREDMQ.js} +9 -6
  210. package/dist/studio/assets/hyperframes-player-CQLtM2zB.js +565 -0
  211. package/dist/studio/assets/{index-BohL7wdo.js → index-CKnGNPHF.js} +1 -1
  212. package/dist/studio/assets/{index-CTbhykVD.js → index-CdWK2GVp.js} +101 -101
  213. package/dist/studio/index.html +1 -1
  214. package/dist/{studio-api-OTNMLH4B.js → studio-api-447CJUUM.js} +9 -9
  215. package/dist/{studioServer-AA4B3YP7.js → studioServer-TMPKQRQA.js} +48 -48
  216. package/dist/{sync-3M7VO3UJ.js → sync-V456U5AA.js} +11 -11
  217. package/dist/{telemetry-VJ3A6ZMD.js → telemetry-NK6K3VRH.js} +4 -4
  218. package/dist/{timeline-ZLZ45W7F.js → timeline-M5URP7QS.js} +18 -18
  219. package/dist/{tokens-WXEJNNJV.js → tokens-5OIFB4MD.js} +2 -2
  220. package/dist/{transcribe-XMVXOBHM.js → transcribe-N3E7T7AW.js} +21 -21
  221. package/dist/{transcribe-PPH5H67E.js → transcribe-ON5WTZV3.js} +9 -9
  222. package/dist/{updateCheck-HDLNWLIC.js → updateCheck-JQOAKPNR.js} +2 -2
  223. package/dist/{upgrade-6UXVTJII.js → upgrade-737POFN4.js} +2 -2
  224. package/dist/{urlDownloader-DPN2KRCX.js → urlDownloader-ZIPT6PZC.js} +5 -5
  225. package/dist/{validate-BZOURM4G.js → validate-6IPCQFXI.js} +23 -23
  226. package/dist/{video-BE42DAT2.js → video-BEZHDPH2.js} +7 -7
  227. package/dist/warmCheck.js +37 -37
  228. package/package.json +1 -1
  229. package/dist/chunk-2YQ2XYO5.js +0 -5030
  230. package/dist/probe-FPHFC3SD.js +0 -179
  231. package/dist/studio/assets/hyperframes-player-Cum4k6V2.js +0 -478
@@ -6,16 +6,16 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  refreshIfNeeded
9
- } from "./chunk-QEQEKBL7.js";
9
+ } from "./chunk-TSQZ3DSC.js";
10
10
  import {
11
11
  buildAuthHeaders,
12
12
  envCredentialVar,
13
13
  isTokenExpired,
14
14
  tryResolveCredential
15
- } from "./chunk-GOPJLAMZ.js";
15
+ } from "./chunk-ETYQYG6Q.js";
16
16
  import {
17
17
  isAuthError
18
- } from "./chunk-6NJVSTSY.js";
18
+ } from "./chunk-BVAPHHMQ.js";
19
19
  import {
20
20
  CSS_URL_RE,
21
21
  isNonRelativeUrl,
@@ -235,7 +235,9 @@ async function resolvePublishCredential(checked) {
235
235
  if (!credential) return null;
236
236
  const expired = credential.type === "oauth" && isTokenExpired(credential.expires_at, /* @__PURE__ */ new Date());
237
237
  if (expired && !credential.refresh_token) throw new Error(LOGIN_EXPIRED);
238
- return await refreshIfNeeded(expired ? { ...credential, refreshable: true } : credential);
238
+ return await refreshIfNeeded(expired ? { ...credential, refreshable: true } : credential, {
239
+ envFallback: checked === void 0
240
+ });
239
241
  } catch (error) {
240
242
  if (isAuthError(error) && (error.code === "REFRESH_FAILED" || error.code === "LOGIN_EXPIRED")) {
241
243
  throw new Error(LOGIN_EXPIRED);
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  round,
9
9
  runFfmpeg
10
- } from "./chunk-ARNCWQNR.js";
10
+ } from "./chunk-RJ6LXDUC.js";
11
11
 
12
12
  // src/measure/drawn.ts
13
13
  import { mkdtempSync, readFileSync, rmSync } from "fs";
@@ -7,32 +7,32 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  RegistryCompatibilityError,
9
9
  gateRegistryItemsCompatibility
10
- } from "./chunk-YPBGUVLY.js";
10
+ } from "./chunk-E3IBPTX7.js";
11
11
  import {
12
12
  DEFAULT_PROJECT_CONFIG,
13
13
  createProjectConfig,
14
14
  loadProjectConfig,
15
15
  projectConfigPath,
16
16
  recordProjectRegistryItems
17
- } from "./chunk-5TBRPDH3.js";
17
+ } from "./chunk-HRSZOW3U.js";
18
18
  import {
19
19
  resolveItemWithDependencies,
20
20
  resolveItemsByTag
21
- } from "./chunk-KLJEGC6M.js";
21
+ } from "./chunk-IOECRDWX.js";
22
22
  import {
23
23
  InvalidVariableValuesError,
24
24
  prepareItem,
25
25
  publishItem
26
- } from "./chunk-PYOEIKGI.js";
26
+ } from "./chunk-LCDXHXYH.js";
27
27
  import {
28
28
  DEFAULT_REGISTRY_URL
29
- } from "./chunk-NUGADGXQ.js";
29
+ } from "./chunk-X2PPRHKO.js";
30
30
  import {
31
31
  readJsonFlag
32
32
  } from "./chunk-EHZESMRB.js";
33
33
  import {
34
34
  trackRegistryItemAdded
35
- } from "./chunk-64OUBJSX.js";
35
+ } from "./chunk-PYWJGSWO.js";
36
36
  import {
37
37
  defineCommand
38
38
  } from "./chunk-DL4OD7IA.js";
@@ -41,7 +41,7 @@ import {
41
41
  } from "./chunk-2GICKZ3I.js";
42
42
  import {
43
43
  ITEM_TYPE_DIRS
44
- } from "./chunk-HWIGWPIG.js";
44
+ } from "./chunk-N6O2RQLQ.js";
45
45
  import {
46
46
  isProjectRootMissing,
47
47
  realpath
@@ -21,10 +21,10 @@ import {
21
21
  emitWords,
22
22
  getPreparedWavDurationSeconds,
23
23
  prepareWav
24
- } from "./chunk-MX7NW3QW.js";
24
+ } from "./chunk-HZG42ZYW.js";
25
25
  import {
26
26
  stoppedByCancelSignal
27
- } from "./chunk-44IJ426Z.js";
27
+ } from "./chunk-EG7FZSEF.js";
28
28
  import {
29
29
  verifies
30
30
  } from "./chunk-RZ6CXJ56.js";
@@ -8038,6 +8038,19 @@ async function loadGsapScriptMotionPathFirstUseIndex() {
8038
8038
  }
8039
8039
  var SCENE_BOUNDARY_EPSILON_SECONDS = 0.05;
8040
8040
  var TWEEN_ENDPOINT_EPSILON_SECONDS = 1e-3;
8041
+ function windowOverlap(a, b) {
8042
+ const aIsPoint = a.end <= a.position;
8043
+ const bIsPoint = b.end <= b.position;
8044
+ if (aIsPoint && bIsPoint) return null;
8045
+ if (aIsPoint || bIsPoint) {
8046
+ const [point, running] = aIsPoint ? [a, b] : [b, a];
8047
+ const inside = point.position > running.position + TWEEN_ENDPOINT_EPSILON_SECONDS && point.position < running.end - TWEEN_ENDPOINT_EPSILON_SECONDS;
8048
+ return inside ? { start: point.position, end: point.position, running } : null;
8049
+ }
8050
+ const start = Math.max(a.position, b.position);
8051
+ const end = Math.min(a.end, b.end);
8052
+ return end - start > TWEEN_ENDPOINT_EPSILON_SECONDS ? { start, end } : null;
8053
+ }
8041
8054
  var UNRESOLVED_TARGET = "__unresolved__";
8042
8055
  function targetHasNoStableIdentity(selector, identity) {
8043
8056
  if (identity) return false;
@@ -8772,29 +8785,28 @@ var gsapRules = [
8772
8785
  for (let i = 0; i < gsapWindows.length; i++) {
8773
8786
  const left = gsapWindows[i];
8774
8787
  if (!left) continue;
8775
- if (left.end <= left.position) continue;
8776
8788
  if (targetHasNoStableIdentity(left.targetSelector, left.targetIdentity)) continue;
8777
8789
  for (let j = i + 1; j < gsapWindows.length; j++) {
8778
8790
  const right = gsapWindows[j];
8779
8791
  if (!right) continue;
8780
- if (right.end <= right.position) continue;
8781
8792
  const leftIdentity = left.targetIdentity ?? left.targetSelector;
8782
8793
  const rightIdentity = right.targetIdentity ?? right.targetSelector;
8783
8794
  if (leftIdentity !== rightIdentity) continue;
8784
- const overlapStart = Math.max(left.position, right.position);
8785
- const overlapEnd = Math.min(left.end, right.end);
8786
- if (overlapEnd - overlapStart <= TWEEN_ENDPOINT_EPSILON_SECONDS) continue;
8795
+ const overlap = windowOverlap(left, right);
8796
+ if (!overlap) continue;
8787
8797
  if (left.overwriteAuto || right.overwriteAuto) continue;
8788
8798
  const sharedProperties = left.properties.filter(
8789
8799
  (prop) => right.properties.includes(prop)
8790
8800
  );
8791
8801
  if (sharedProperties.length === 0) continue;
8802
+ const properties = sharedProperties.join(", ");
8803
+ const { running } = overlap;
8792
8804
  findings.push({
8793
8805
  code: "overlapping_gsap_tweens",
8794
8806
  severity: "warning",
8795
- message: `GSAP tweens overlap on "${left.targetSelector}" for ${sharedProperties.join(", ")} between ${overlapStart.toFixed(2)}s and ${overlapEnd.toFixed(2)}s.`,
8807
+ message: running ? `A GSAP set on "${left.targetSelector}" for ${properties} fires at ${overlap.start.toFixed(2)}s while a tween on it is still running (${running.position.toFixed(2)}s to ${running.end.toFixed(2)}s).` : `GSAP tweens overlap on "${left.targetSelector}" for ${properties} between ${overlap.start.toFixed(2)}s and ${overlap.end.toFixed(2)}s.`,
8796
8808
  selector: left.targetSelector,
8797
- fixHint: 'Shorten the earlier tween, move the later tween, or add `overwrite: "auto"`.',
8809
+ fixHint: running ? `Let the tween finish before the set fires: move the set to ${running.end.toFixed(2)}s or later, or shorten the tween. Played in order the set wins; seeked (scrub, export) the tween can win, so an old state stays visible.` : 'Shorten the earlier tween, move the later tween, or add `overwrite: "auto"`.',
8798
8810
  snippet: truncateSnippet(`${left.raw}
8799
8811
  ${right.raw}`)
8800
8812
  });
@@ -9,11 +9,14 @@ var __dirname = __hf_dirname(__filename);
9
9
  var AuthError = class extends Error {
10
10
  code;
11
11
  hint;
12
- constructor(code, message, hint) {
12
+ /** HeyGen refused a token refresh (400/401), so the grant is gone; a reply the CLI couldn't read is not this. */
13
+ refused;
14
+ constructor(code, message, hint, opts = {}) {
13
15
  super(message);
14
16
  this.name = "AuthError";
15
17
  this.code = code;
16
18
  this.hint = hint;
19
+ this.refused = opts.refused ?? false;
17
20
  }
18
21
  };
19
22
  var ErrNotConfigured = () => new AuthError(
@@ -37,10 +40,11 @@ var ErrOAuthNotConfigured = () => new AuthError(
37
40
  "OAuth client is not configured",
38
41
  "Set HYPERFRAMES_OAUTH_CLIENT_ID, or run `hyperframes auth login --api-key`."
39
42
  );
40
- var ErrRefreshFailed = (detail) => new AuthError(
43
+ var ErrRefreshFailed = (detail, opts = {}) => new AuthError(
41
44
  "REFRESH_FAILED",
42
45
  detail ? `Failed to refresh OAuth tokens: ${detail}` : "Failed to refresh OAuth tokens",
43
- "Run `hyperframes auth login` to re-authenticate."
46
+ "Run `hyperframes auth login` to re-authenticate.",
47
+ opts
44
48
  );
45
49
  var ErrLoginExpired = () => new AuthError(
46
50
  "LOGIN_EXPIRED",
@@ -12,22 +12,22 @@ import {
12
12
  } from "./chunk-262C25DQ.js";
13
13
  import {
14
14
  pageNavigationTimeoutMs
15
- } from "./chunk-TI4JPSFS.js";
15
+ } from "./chunk-KD22R2UE.js";
16
16
  import {
17
17
  SEEK_SETTLES_BEFORE_PROTOCOL_TIMEOUT_MS
18
18
  } from "./chunk-YGGZ23BB.js";
19
19
  import {
20
20
  resolveCompositionViewportFromHtml
21
- } from "./chunk-KW2ZREKY.js";
21
+ } from "./chunk-XEP7PGXS.js";
22
22
  import {
23
23
  launchManagedBrowser,
24
24
  resolveManagedGpuMode,
25
25
  rethrowAfterBrowserCleanup
26
- } from "./chunk-NRO2PLEC.js";
26
+ } from "./chunk-TBCRTIXP.js";
27
27
  import {
28
28
  resolveLocalBrowserGpuMode,
29
29
  resolveLocalWebGpu
30
- } from "./chunk-46DXV7OQ.js";
30
+ } from "./chunk-P7CVKVPD.js";
31
31
  import {
32
32
  c
33
33
  } from "./chunk-2GICKZ3I.js";
@@ -35,7 +35,7 @@ import {
35
35
  assertWebGpuAdapterAvailable,
36
36
  compositionRequiresWebGpu,
37
37
  oneProcessOverPipe
38
- } from "./chunk-RTUQDHKE.js";
38
+ } from "./chunk-IAZ2A7D6.js";
39
39
  import {
40
40
  normalizeErrorMessage
41
41
  } from "./chunk-E63BDV4Z.js";
@@ -143,7 +143,7 @@ async function waitForCompositionSettle(page, options) {
143
143
  console.warn(` ${c.warn("\u26A0")} Shader transitions did not finish pre-rendering`);
144
144
  });
145
145
  await waitForLateSubresources(page, options.lateSubresourceTimeoutMs ?? CAPTURE_SETTLE_MS);
146
- const { resolveConfig, waitForImagesReady } = await import("./src-7WW3KXOI.js");
146
+ const { resolveConfig, waitForImagesReady } = await import("./src-MTLH4YHV.js");
147
147
  const imageTimeoutMs = resolveConfig().playerReadyTimeout;
148
148
  await waitForImagesReady(
149
149
  page,
@@ -192,7 +192,7 @@ async function installPageFunctionGuard(page) {
192
192
  async function openSettledCompositionPage(html, url, options) {
193
193
  const viewport = resolveCompositionViewportFromHtml(html);
194
194
  const requiresWebGpu = compositionRequiresWebGpu(html);
195
- const answer = (await import("./staticProjectServer-VYZV4BSU.js")).inProcessAnswer(url);
195
+ const answer = (await import("./staticProjectServer-USD7TCZH.js")).inProcessAnswer(url);
196
196
  const noListen = answer !== void 0;
197
197
  let chromeBrowser;
198
198
  try {
@@ -203,7 +203,7 @@ async function openSettledCompositionPage(html, url, options) {
203
203
  options.onBrowserReady?.();
204
204
  const page = await chromeBrowser.newPage();
205
205
  await installPageFunctionGuard(page);
206
- const { installMediaRenderIdBridge, forcePreservedDrawingBuffer } = await import("./src-7WW3KXOI.js");
206
+ const { installMediaRenderIdBridge, forcePreservedDrawingBuffer } = await import("./src-MTLH4YHV.js");
207
207
  await installMediaRenderIdBridge(page);
208
208
  await page.evaluateOnNewDocument(forcePreservedDrawingBuffer);
209
209
  await page.evaluateOnNewDocument("window.__HF_REPLAY_SKIPPED_FRAMES = true");
@@ -213,7 +213,7 @@ async function openSettledCompositionPage(html, url, options) {
213
213
  await options.beforeNavigate?.(page);
214
214
  await gotoWhenSent(page, url, pageNavigationTimeoutMs(options.navigationTimeoutMs));
215
215
  await assertWebGpuAdapterAvailable(page, requiresWebGpu, softwareWebGpu);
216
- options.onLoaded?.();
216
+ await options.onLoaded?.(page);
217
217
  const renderReadyTimedOut = !await waitForCompositionSettle(page, options);
218
218
  return { browser: chromeBrowser, page, renderReadyTimedOut };
219
219
  } catch (err) {
@@ -225,7 +225,7 @@ async function launchCompositionBrowser(html, noListen, options) {
225
225
  const { ensureBrowser, findSystemBrowser } = await import("./manager-SAXHANEY.js");
226
226
  const browser = await ensureBrowser({ signal: options.signal });
227
227
  const puppeteer = await import("puppeteer-core");
228
- const { buildChromeArgs } = await import("./src-7WW3KXOI.js");
228
+ const { buildChromeArgs } = await import("./src-MTLH4YHV.js");
229
229
  const requestedGpuMode = options.browserGpuMode ?? resolveCliChromeGpuMode();
230
230
  const requiresWebGpu = compositionRequiresWebGpu(html);
231
231
  let softwareWebGpu = false;
@@ -6,14 +6,14 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  findCuts
9
- } from "./chunk-5FFHLOVF.js";
9
+ } from "./chunk-PUMQDN2T.js";
10
10
  import {
11
11
  grey,
12
12
  readClip,
13
13
  round,
14
14
  videoClip,
15
15
  writeImage
16
- } from "./chunk-ARNCWQNR.js";
16
+ } from "./chunk-RJ6LXDUC.js";
17
17
 
18
18
  // src/measure/events.ts
19
19
  var EVENT_W = 160;
@@ -10,13 +10,13 @@ import {
10
10
  parseNumbers,
11
11
  parseRoi,
12
12
  probeVideo
13
- } from "./chunk-ARNCWQNR.js";
13
+ } from "./chunk-RJ6LXDUC.js";
14
14
  import {
15
15
  c
16
16
  } from "./chunk-2GICKZ3I.js";
17
17
  import {
18
18
  withMeta
19
- } from "./chunk-HMMHCSSN.js";
19
+ } from "./chunk-6IW2HWYI.js";
20
20
  import {
21
21
  failCommand
22
22
  } from "./chunk-66W5IWLO.js";
@@ -10,7 +10,7 @@ import {
10
10
  ratioOf,
11
11
  readClip,
12
12
  round
13
- } from "./chunk-ARNCWQNR.js";
13
+ } from "./chunk-RJ6LXDUC.js";
14
14
 
15
15
  // src/measure/energy.ts
16
16
  var ENERGY_RATE = 12;
@@ -6,23 +6,23 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveProject
9
- } from "./chunk-M56MEMPF.js";
9
+ } from "./chunk-46HMQ4I3.js";
10
10
  import {
11
11
  installPageFunctionGuard,
12
12
  resolveCliChromeGpuMode,
13
13
  seekCompositionTimeline,
14
14
  waitForRuntimeReady
15
- } from "./chunk-CRDXU4IX.js";
15
+ } from "./chunk-C3FKYBZ4.js";
16
16
  import {
17
17
  pageNavigationTimeoutMs
18
- } from "./chunk-TI4JPSFS.js";
18
+ } from "./chunk-KD22R2UE.js";
19
19
  import {
20
20
  resolveCompositionViewportFromHtml
21
- } from "./chunk-KW2ZREKY.js";
21
+ } from "./chunk-XEP7PGXS.js";
22
22
  import {
23
23
  launchManagedBrowser,
24
24
  resolveManagedGpuMode
25
- } from "./chunk-NRO2PLEC.js";
25
+ } from "./chunk-TBCRTIXP.js";
26
26
  import {
27
27
  defineCommand
28
28
  } from "./chunk-DL4OD7IA.js";
@@ -31,14 +31,14 @@ import {
31
31
  } from "./chunk-2GICKZ3I.js";
32
32
  import {
33
33
  resolveNaturalMediaTimelineDuration
34
- } from "./chunk-2YQ2XYO5.js";
34
+ } from "./chunk-OUZSRPKC.js";
35
35
  import {
36
36
  decodeWellFormedEscapes
37
37
  } from "./chunk-C2KEGBR3.js";
38
38
  import {
39
39
  printDeprecationNotice,
40
40
  withMeta
41
- } from "./chunk-HMMHCSSN.js";
41
+ } from "./chunk-6IW2HWYI.js";
42
42
  import {
43
43
  failureMessage,
44
44
  jsonFailure
@@ -252,7 +252,7 @@ function extractCompositionErrorsFromLint(lintResult) {
252
252
  async function localizeRemoteAssets(html) {
253
253
  let dir;
254
254
  try {
255
- const { loadProducer } = await import("./producer-M6IWCFMK.js");
255
+ const { loadProducer } = await import("./producer-6GQQQT7M.js");
256
256
  const { localizeRemoteMediaSources, localizeRemoteImageSources, localizeRemoteFontFaces } = await loadProducer();
257
257
  dir = mkdtempSync(join(tmpdir(), "hf-validate-assets-"));
258
258
  const assetDir = dir;
@@ -273,10 +273,10 @@ async function localizeRemoteAssets(html) {
273
273
  }
274
274
  async function validateInBrowser(project, opts) {
275
275
  const projectDir = project.dir;
276
- const { bundleToSingleHtml } = await import("./compiler-SKQTN3EA.js");
276
+ const { bundleToSingleHtml } = await import("./compiler-UCJ4KC75.js");
277
277
  const { ensureBrowser } = await import("./manager-SAXHANEY.js");
278
- const { serveStaticProjectHtml } = await import("./staticProjectServer-VYZV4BSU.js");
279
- const { lintProject } = await import("./lintProject-SG4KRUAV.js");
278
+ const { serveStaticProjectHtml } = await import("./staticProjectServer-USD7TCZH.js");
279
+ const { lintProject } = await import("./lintProject-NZADSVSU.js");
280
280
  const lintResult = await lintProject(projectDir);
281
281
  const compositionErrors = extractCompositionErrorsFromLint(lintResult);
282
282
  const html = await bundleToSingleHtml(projectDir);
@@ -297,9 +297,9 @@ async function validateInBrowser(project, opts) {
297
297
  try {
298
298
  const browser = await ensureBrowser();
299
299
  const puppeteer = await import("puppeteer-core");
300
- const { buildChromeArgs, analyzeClipMediaFit } = await import("./src-7WW3KXOI.js");
300
+ const { buildChromeArgs, analyzeClipMediaFit } = await import("./src-MTLH4YHV.js");
301
301
  const requestedGpuMode = resolveCliChromeGpuMode();
302
- const { assertWebGpuAdapterAvailable, compositionRequiresWebGpu, resolveLocalWebGpu } = await import("./gpuPolicy-OUHJ7GVX.js");
302
+ const { assertWebGpuAdapterAvailable, compositionRequiresWebGpu, resolveLocalWebGpu } = await import("./gpuPolicy-7JA66MJG.js");
303
303
  const resolvedGpuMode = await resolveManagedGpuMode(requestedGpuMode, browser.executablePath);
304
304
  const requiresWebGpu = compositionRequiresWebGpu(html);
305
305
  const { gpuConfig, softwareWebGpu } = resolveLocalWebGpu(resolvedGpuMode, requiresWebGpu);
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  findCompositionDimensions
9
- } from "./chunk-KW2ZREKY.js";
9
+ } from "./chunk-XEP7PGXS.js";
10
10
  import {
11
11
  outputResolutionForSize
12
12
  } from "./chunk-T5ELONXY.js";
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  getCachedGpuEncoder
9
- } from "./chunk-RTUQDHKE.js";
9
+ } from "./chunk-IAZ2A7D6.js";
10
10
  import {
11
11
  runCancellableProcess
12
12
  } from "./chunk-X6JUUQCM.js";
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  VERSION
9
- } from "./chunk-UL3SKAZB.js";
9
+ } from "./chunk-T252SG67.js";
10
10
 
11
11
  // src/registry/compatibility.ts
12
12
  import { compareVersions } from "compare-versions";
@@ -11,7 +11,7 @@ import {
11
11
  round,
12
12
  runFfmpeg,
13
13
  videoClip
14
- } from "./chunk-ARNCWQNR.js";
14
+ } from "./chunk-RJ6LXDUC.js";
15
15
 
16
16
  // src/measure/sync.ts
17
17
  var RATE = 16e3;
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  setHostHandlesSigint
9
- } from "./chunk-RTUQDHKE.js";
9
+ } from "./chunk-IAZ2A7D6.js";
10
10
  import {
11
11
  processAncestorSnapshot,
12
12
  processIdentity,
@@ -22,7 +22,7 @@ import {
22
22
  resolveClientId,
23
23
  revokeEndpoint,
24
24
  tokenEndpoint
25
- } from "./chunk-6NJVSTSY.js";
25
+ } from "./chunk-BVAPHHMQ.js";
26
26
  import {
27
27
  c
28
28
  } from "./chunk-2GICKZ3I.js";
@@ -750,7 +750,15 @@ function retryAfterSeconds(response, nowMs) {
750
750
  if (!Number.isFinite(retryAt)) return void 0;
751
751
  return Math.min(Math.max(Math.ceil((retryAt - nowMs) / 1e3), 0), MAX_DEVICE_POLL_SECONDS);
752
752
  }
753
- async function refreshTokens(refresh_token, opts = {}) {
753
+ var refreshing = /* @__PURE__ */ new Map();
754
+ function refreshTokens(refresh_token, opts = {}) {
755
+ const pending = refreshing.get(refresh_token);
756
+ if (pending) return pending;
757
+ const request = refreshOnce(refresh_token, opts).finally(() => refreshing.delete(refresh_token));
758
+ refreshing.set(refresh_token, request);
759
+ return request;
760
+ }
761
+ async function refreshOnce(refresh_token, opts) {
754
762
  const { credentials } = await readStore();
755
763
  if (credentials.oauth?.refresh_token !== refresh_token) throw ErrLoginChanged();
756
764
  assertOAuthIdentity(credentials.oauth);
@@ -770,7 +778,7 @@ async function refreshTokens(refresh_token, opts = {}) {
770
778
  body: body.toString()
771
779
  });
772
780
  if (res.status === 400 || res.status === 401) {
773
- throw ErrRefreshFailed(await safeText2(res));
781
+ throw ErrRefreshFailed(await safeText2(res), { refused: true });
774
782
  }
775
783
  if (!res.ok) {
776
784
  throw ErrApi(res.status, await safeText2(res) || res.statusText);
@@ -1087,30 +1095,80 @@ var envCredentialVar = (source) => source in ENV_CREDENTIAL_VAR ? ENV_CREDENTIAL
1087
1095
  var EXPIRY_SKEW_MS = 60 * 1e3;
1088
1096
  async function resolveCredential(opts = {}) {
1089
1097
  const now = (opts.now ?? (() => /* @__PURE__ */ new Date()))();
1090
- const heygenEnv = headerSafeEnv(ENV_CREDENTIAL_VAR.env);
1091
- if (heygenEnv) {
1092
- return { type: "api_key", key: heygenEnv, source: "env" };
1093
- }
1094
- const hfEnv = headerSafeEnv(ENV_CREDENTIAL_VAR.env_alias);
1095
- if (hfEnv) {
1096
- return { type: "api_key", key: hfEnv, source: "env_alias" };
1097
- }
1098
+ const envKey = envApiKey();
1099
+ if (envKey && !heygenApiHost()) return envKey;
1098
1100
  const accessToken = headerSafeEnv(ENV_CREDENTIAL_VAR.env_oauth);
1099
1101
  if (accessToken) {
1100
1102
  return { type: "oauth", access_token: accessToken, source: "env_oauth", refreshable: false };
1101
1103
  }
1102
- const { credentials, source } = await readStore();
1103
- if (source === "absent") throw ErrNotConfigured();
1104
+ if (envKey && loginRefreshFailed) return envKey;
1105
+ return await fromStore(now, envKey);
1106
+ }
1107
+ async function fromStore(now, envKey) {
1108
+ const store = await readStore().catch((err) => {
1109
+ if (envKey) return null;
1110
+ throw err;
1111
+ });
1112
+ if (!store || store.source === "absent") {
1113
+ if (envKey) return envKey;
1114
+ throw ErrNotConfigured();
1115
+ }
1116
+ const { credentials, source } = store;
1104
1117
  const fileSource = source === "file_legacy" ? "file_legacy" : "file_json";
1105
- if (credentials.oauth) assertOAuthIdentity(credentials.oauth);
1106
- const oauth = credentials.oauth ? pickOAuth(credentials.oauth, now, fileSource) : null;
1107
- if (oauth) return oauth;
1108
- if (credentials.oauth) throw ErrLoginExpired();
1109
- if (credentials.api_key) {
1110
- return { type: "api_key", key: credentials.api_key, source: fileSource };
1118
+ const login = credentials.oauth && boundToThisClient(credentials.oauth) ? pickOAuth(credentials.oauth, now, fileSource) : null;
1119
+ return login ?? envKey ?? storedApiKey(credentials, fileSource);
1120
+ }
1121
+ function storedApiKey(credentials, source) {
1122
+ if (credentials.oauth) {
1123
+ assertOAuthIdentity(credentials.oauth);
1124
+ throw ErrLoginExpired();
1111
1125
  }
1126
+ if (credentials.api_key) return { type: "api_key", key: credentials.api_key, source };
1112
1127
  throw ErrNotConfigured();
1113
1128
  }
1129
+ function envApiKey() {
1130
+ const heygenEnv = headerSafeEnv(ENV_CREDENTIAL_VAR.env);
1131
+ if (heygenEnv) return { type: "api_key", key: heygenEnv, source: "env" };
1132
+ const hfEnv = headerSafeEnv(ENV_CREDENTIAL_VAR.env_alias);
1133
+ if (hfEnv) return { type: "api_key", key: hfEnv, source: "env_alias" };
1134
+ return void 0;
1135
+ }
1136
+ function heygenApiHost() {
1137
+ const mediaBase = process.env["HEYGEN_API_BASE"]?.trim();
1138
+ return [apiBaseUrl(), ...mediaBase ? [mediaBase] : []].every((base) => {
1139
+ try {
1140
+ const host = new URL(base).hostname;
1141
+ return host === "heygen.com" || host.endsWith(".heygen.com");
1142
+ } catch {
1143
+ return false;
1144
+ }
1145
+ });
1146
+ }
1147
+ function boundToThisClient(tokens) {
1148
+ try {
1149
+ assertOAuthIdentity(tokens);
1150
+ return true;
1151
+ } catch {
1152
+ return false;
1153
+ }
1154
+ }
1155
+ var loginRefreshFailed = false;
1156
+ async function afterRefreshFailure(err, refreshToken) {
1157
+ if (!isAuthError(err)) throw err;
1158
+ if (err.code === "LOGIN_CHANGED" || err.code === "REFRESH_FAILED") {
1159
+ const stored = await readStore().catch(() => null);
1160
+ const current = stored?.credentials.oauth?.refresh_token;
1161
+ if (current && current !== refreshToken) {
1162
+ const next = await resolveCredential();
1163
+ if (next.type !== "oauth" || !next.refreshable) return next;
1164
+ }
1165
+ }
1166
+ if (!err.refused && err.code !== "LOGIN_EXPIRED") throw err;
1167
+ const key = envApiKey();
1168
+ if (!key) throw err;
1169
+ loginRefreshFailed = true;
1170
+ return key;
1171
+ }
1114
1172
  function headerSafeEnv(name) {
1115
1173
  const value = process.env[name];
1116
1174
  if (value && !isHeaderSafe(value)) {
@@ -1172,6 +1230,7 @@ export {
1172
1230
  ENV_CREDENTIAL_VAR,
1173
1231
  envCredentialVar,
1174
1232
  resolveCredential,
1233
+ afterRefreshFailure,
1175
1234
  tryResolveCredential,
1176
1235
  isTokenExpired
1177
1236
  };