hyperframes 0.9.28-alpha.1 → 0.9.29
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.
- package/README.md +5 -2
- package/dist/{add-YDZMFKR3.js → add-BRXFSBYO.js} +14 -14
- package/dist/{agentPromptGenerator-AUXZZCIG.js → agentPromptGenerator-NJL6ZJQA.js} +7 -7
- package/dist/{animatedGifPrep-2DYVIBA4.js → animatedGifPrep-AVZAMI2D.js} +7 -7
- package/dist/api.js +38 -39
- package/dist/{asset-JHM3VF72.js → asset-FEAC2U74.js} +2 -2
- package/dist/{assetCataloger-2OB46SVM.js → assetCataloger-WGNEAI5A.js} +8 -8
- package/dist/{audio-T6YSLT2D.js → audio-PBKCPYW2.js} +24 -25
- package/dist/{auth-YSTRUKED.js → auth-IPHKPGNV.js} +4 -4
- package/dist/{autoUpdate-VYRYBZG6.js → autoUpdate-4HUTYRYX.js} +3 -3
- package/dist/{avatars-UU53IDAK.js → avatars-U2XLC3OS.js} +15 -16
- package/dist/{backgroundChecks-FNACAOZD.js → backgroundChecks-4Q4R56DT.js} +4 -4
- package/dist/backgroundChecksWorker.js +4 -4
- package/dist/{batchRender-KWIPFU5Q.js → batchRender-AL6DO5IA.js} +4 -4
- package/dist/{beats-X2LCSMYD.js → beats-VS4P6KKZ.js} +11 -11
- package/dist/{benchmark-4OB6M2FR.js → benchmark-MGDPACXB.js} +11 -11
- package/dist/{billing-DC6ODLSG.js → billing-JLASHFQM.js} +15 -16
- package/dist/{browser-PUJD4WCC.js → browser-FU4TZSMT.js} +8 -8
- package/dist/{bundleWithLocalizedFonts-7HQEKW2H.js → bundleWithLocalizedFonts-B2XFORNZ.js} +1 -1
- package/dist/{capture-IGQR6HTG.js → capture-CFESIHJR.js} +22 -22
- package/dist/{capture-PUB5WBLQ.js → capture-LL7WE2S7.js} +3 -3
- package/dist/{captureCompositionFrame-JT6HGVU7.js → captureCompositionFrame-DABFEOQO.js} +14 -14
- package/dist/{catalog-5NC5EV6Z.js → catalog-U6CHLXTI.js} +14 -14
- package/dist/{catch-up-6RJNWB5I.js → catch-up-DMREF334.js} +9 -9
- package/dist/{check-FXZOPV3Y.js → check-ILJC6WYD.js} +45 -44
- package/dist/{checkAudio-VSHZXO4J.js → checkAudio-MWSP2436.js} +15 -15
- package/dist/{checkBrowser-EOSAXIHJ.js → checkBrowser-HC3LYH6H.js} +38 -38
- package/dist/{chunk-W3XARNFW.js → chunk-2YZ6GA4E.js} +1 -1
- package/dist/{chunk-XGRXNWDK.js → chunk-3JFV42QB.js} +3 -3
- package/dist/{chunk-4J2J57RS.js → chunk-42MHKDVP.js} +3 -3
- package/dist/{chunk-UYVQDKGC.js → chunk-47JZ2UQC.js} +1 -1
- package/dist/{chunk-QTDTCTGB.js → chunk-4N3UVDIJ.js} +4 -6
- package/dist/{chunk-R6PUBUA4.js → chunk-4TCEF2I7.js} +1 -1
- package/dist/{chunk-C6S2NYQ4.js → chunk-4TPTB6PY.js} +4 -4
- package/dist/{chunk-6UJOLK4G.js → chunk-5QGDLMU3.js} +2 -2
- package/dist/{chunk-QB2USW3R.js → chunk-5RLMHG3E.js} +1 -1
- package/dist/{chunk-ME6L6GUF.js → chunk-6FHIR4KD.js} +1 -1
- package/dist/{chunk-2Q3Y7CI3.js → chunk-6JAB5BHX.js} +7 -7
- package/dist/{chunk-BP75ZLZ5.js → chunk-6LCIO2YY.js} +2 -2
- package/dist/chunk-72LMHSPL.js +29 -0
- package/dist/{chunk-FF25S7ZC.js → chunk-74PW4UVC.js} +1 -1
- package/dist/{chunk-44LVKFXU.js → chunk-76MHB2H6.js} +1 -1
- package/dist/{chunk-GTZVTATR.js → chunk-77B6C7CU.js} +2 -2
- package/dist/{chunk-XHP3V4WH.js → chunk-7GJKUOPX.js} +31 -20
- package/dist/{chunk-3BWFZFJK.js → chunk-7TION72L.js} +18 -18
- package/dist/{chunk-HPR2BPFS.js → chunk-AOPNJEQC.js} +2 -2
- package/dist/{chunk-MEVLYDL2.js → chunk-BJYCLZBQ.js} +1 -1
- package/dist/{chunk-TYPFNWE6.js → chunk-BX2BIU6Z.js} +1 -1
- package/dist/{chunk-SXGLW3OW.js → chunk-BYJEUZNT.js} +3 -3
- package/dist/{chunk-W4DMQZL5.js → chunk-BZULWFMJ.js} +11 -2
- package/dist/{chunk-YSIDK3VE.js → chunk-C25RSEQN.js} +12 -12
- package/dist/{chunk-CHCMXYER.js → chunk-C5JKRCSG.js} +1 -1
- package/dist/{chunk-VSQ5NWCF.js → chunk-DJVSNDF3.js} +3 -3
- package/dist/{chunk-N5TVFPYQ.js → chunk-DYKBB5HB.js} +1 -1
- package/dist/{chunk-IADGTP5X.js → chunk-EIVSIGS2.js} +3 -3
- package/dist/{chunk-3T6BFAKZ.js → chunk-F24B2PLD.js} +1 -1
- package/dist/{chunk-XLX7TDCI.js → chunk-FJPHKCWU.js} +17 -17
- package/dist/{chunk-CE765XG3.js → chunk-FNC3JNO7.js} +1 -1
- package/dist/{chunk-BF6RWOUF.js → chunk-FXPDWYD7.js} +100 -50
- package/dist/{chunk-SCPMSSQW.js → chunk-GGDJLN5I.js} +0 -20
- package/dist/{chunk-GNG7XNUY.js → chunk-GISQ7VOP.js} +15 -15
- package/dist/{chunk-VYEPG2N6.js → chunk-GQNV4DG6.js} +1 -1
- package/dist/{chunk-4XGKXBYH.js → chunk-GTUTZIRR.js} +22 -4
- package/dist/{chunk-63PVDQ6R.js → chunk-H5BHEZ4B.js} +2 -2
- package/dist/{chunk-OPGYOHU6.js → chunk-HCC7XLD7.js} +2 -2
- package/dist/{chunk-5YDJTVOQ.js → chunk-HLRYLZFX.js} +2 -2
- package/dist/{chunk-AAENGP3S.js → chunk-IOPIOX5K.js} +66 -16
- package/dist/{chunk-WYA575QX.js → chunk-IQKMIYLG.js} +5 -7
- package/dist/{chunk-XFE4R6I4.js → chunk-ITWIFUDS.js} +1 -1
- package/dist/{chunk-HW325JBH.js → chunk-IX3K55NA.js} +4 -4
- package/dist/{chunk-3OKVZXTH.js → chunk-IXMO4RXK.js} +2 -2
- package/dist/{chunk-WIJGRX5X.js → chunk-IYYZMZD2.js} +1 -1
- package/dist/{chunk-NVNKKVDH.js → chunk-J7PDBGQM.js} +2 -2
- package/dist/{chunk-4OZVFZCO.js → chunk-JLUOG6S2.js} +1 -1
- package/dist/{chunk-QKAXPYTV.js → chunk-JVAD6LD7.js} +38 -21
- package/dist/{chunk-6ODX6SHY.js → chunk-L2GOO2UY.js} +2 -2
- package/dist/{chunk-OJ5HAKL6.js → chunk-L6OXEDJQ.js} +7 -7
- package/dist/{chunk-CG65CRMP.js → chunk-LDTJCZZ2.js} +2 -2
- package/dist/{chunk-AHRX3FHF.js → chunk-LMCFILEY.js} +3 -3
- package/dist/{chunk-FID757D3.js → chunk-LP7B3JLC.js} +0 -1
- package/dist/{chunk-WXEXQLVV.js → chunk-M457GQGR.js} +344 -216
- package/dist/{chunk-TLVXCOMV.js → chunk-MKZ34726.js} +2 -2
- package/dist/{chunk-O2JZ6C3S.js → chunk-MTJ46TG7.js} +7 -7
- package/dist/{chunk-7U2B7OF6.js → chunk-MVJ7AX6W.js} +1 -1
- package/dist/{chunk-3MYEF34S.js → chunk-NFUXYBOR.js} +1 -1
- package/dist/{chunk-RERVXE6J.js → chunk-NHJ5YUBZ.js} +2 -2
- package/dist/{chunk-YFDCU6X5.js → chunk-NSQLSL42.js} +6 -6
- package/dist/{chunk-KJ5QBEMN.js → chunk-NURN5W6M.js} +6 -8
- package/dist/{chunk-WCPH2JRB.js → chunk-NXFUEPWT.js} +35 -21
- package/dist/{chunk-ALCP5OEW.js → chunk-NZUUKNNZ.js} +1 -1
- package/dist/{chunk-IMSLXLUI.js → chunk-OSDNRYQJ.js} +1 -1
- package/dist/{chunk-36G3XDN6.js → chunk-OY4YSQBK.js} +2 -2
- package/dist/{chunk-XOON4QRF.js → chunk-PGZSYDLZ.js} +1 -1
- package/dist/{chunk-5ROYFGQT.js → chunk-PVRJKEU5.js} +1 -1
- package/dist/{chunk-STTUDVAI.js → chunk-Q7FX7HOX.js} +1 -1
- package/dist/{chunk-KCRVZA7B.js → chunk-QBRBXVCE.js} +1 -1
- package/dist/{chunk-NHRLZESZ.js → chunk-RYFVUPXH.js} +1 -1
- package/dist/{chunk-Q6TVZY36.js → chunk-RYT22J4V.js} +2 -2
- package/dist/{chunk-J5CDV66Q.js → chunk-RZK5ZGVX.js} +4 -4
- package/dist/{chunk-MPC3L6A3.js → chunk-S3S3IHCR.js} +1 -1
- package/dist/chunk-SBYFFP7R.js +413 -0
- package/dist/{chunk-WOSVLHQH.js → chunk-SCNC7YPB.js} +1 -1
- package/dist/{chunk-7GZ4E5ID.js → chunk-SCUKEERJ.js} +4 -4
- package/dist/{chunk-WFO2PDZD.js → chunk-SS7OEJGR.js} +35 -18
- package/dist/{chunk-TF7VWCJM.js → chunk-TCQKCUDA.js} +1 -1
- package/dist/{chunk-JX4BEVC3.js → chunk-TIWO5QKS.js} +66 -52
- package/dist/{chunk-6RHKGQRA.js → chunk-TM5H5ZY3.js} +2 -2
- package/dist/{chunk-AJVYQVDB.js → chunk-U5RXCKWJ.js} +1 -1
- package/dist/{chunk-GVBAVADJ.js → chunk-UCCD6SY7.js} +1 -1
- package/dist/{chunk-LSSUDIEM.js → chunk-UKAZEO7A.js} +5 -5
- package/dist/{chunk-MWBRY5HN.js → chunk-USOP5XTT.js} +3 -3
- package/dist/{chunk-7XHVHBFV.js → chunk-V4Z37HFN.js} +3 -3
- package/dist/{chunk-2BSPL7YE.js → chunk-V4ZFL2E2.js} +3 -3
- package/dist/{chunk-7D4PARGG.js → chunk-VWEELCAJ.js} +6 -6
- package/dist/{chunk-YJBGA3W6.js → chunk-VXWASGGT.js} +2 -2
- package/dist/{chunk-JHSHEJU7.js → chunk-XGGEOBH2.js} +2 -2
- package/dist/{chunk-FZUIGBYD.js → chunk-XKSHWUIF.js} +3 -3
- package/dist/{chunk-ZMQYQHZU.js → chunk-XVDXYUQJ.js} +1 -1
- package/dist/{chunk-4TU5M4WX.js → chunk-YXNRWPF5.js} +31 -29
- package/dist/{chunk-DFKD43CD.js → chunk-ZCRATF6D.js} +3 -3
- package/dist/{chunk-COAB2OXQ.js → chunk-ZGQZTSP2.js} +1 -1
- package/dist/{chunk-PSGS27VB.js → chunk-ZQXK4L4G.js} +2 -2
- package/dist/{chunk-3Q7LAXFJ.js → chunk-ZUXES5HA.js} +2 -2
- package/dist/{chunk-L666J5OJ.js → chunk-ZY3N64NC.js} +2 -2
- package/dist/{clean-5WXYKIWX.js → clean-YU7AM7DC.js} +23 -23
- package/dist/cli.js +67 -69
- package/dist/{cloud-TEJ6UVBU.js → cloud-QJMPTQ3N.js} +5 -6
- package/dist/{cloud-X2ZPQOFN.js → cloud-U7RRT2TA.js} +4 -4
- package/dist/{cloudrun-A7DU7DQE.js → cloudrun-T7VVPRDG.js} +7 -7
- package/dist/{compare-URG6E3VF.js → compare-USGR7PZL.js} +36 -36
- package/dist/{compiler-J43BE6LC.js → compiler-ZSIKBZBR.js} +4 -4
- package/dist/{component-BE2ZLBPY.js → component-RIFXLYK3.js} +3 -3
- package/dist/{compositions-DJPSPCYI.js → compositions-QHRNVZ2K.js} +13 -13
- package/dist/{curve-I6CGCMG5.js → curve-BX46Q4OW.js} +12 -12
- package/dist/{cuts-TRTRMTCZ.js → cuts-JRLHBLOX.js} +13 -13
- package/dist/{delete-UMO7XCW3.js → delete-SE7ABVTH.js} +8 -9
- package/dist/{deploy-T2CETGFF.js → deploy-AQUEV6ND.js} +6 -6
- package/dist/{describeProject-AJ2SFRCN.js → describeProject-XBT7PHZD.js} +8 -8
- package/dist/{deterministicFonts-UZIF5XZW.js → deterministicFonts-SKRN3TCP.js} +2 -2
- package/dist/{diff-KCVI66ZW.js → diff-6TZLA6KU.js} +39 -40
- package/dist/{dist-AUYCAQMA.js → dist-ALNMJZ7K.js} +15 -15
- package/dist/{dist-4JHP47NU.js → dist-EFXKPJJT.js} +2 -2
- package/dist/{dist-F3Y2XHZL.js → dist-QRXJMFI7.js} +3 -3
- package/dist/{doctor-UTIGHYSY.js → doctor-DDKKCJMO.js} +12 -12
- package/dist/{energy-PJUDIY2I.js → energy-HC7BNZ5E.js} +13 -13
- package/dist/{events-ZMFIRGW4.js → events-EETQNKK2.js} +15 -15
- package/dist/{events-HI2WDYGV.js → events-KNH677YB.js} +4 -4
- package/dist/{events-P6Q6GB6K.js → events-ZRVQOB4Y.js} +8 -8
- package/dist/{extract-4RYOD7LZ.js → extract-I3J3ZK55.js} +16 -16
- package/dist/{face-X3DR3L7V.js → face-HJUZ2OXQ.js} +14 -14
- package/dist/{feedback-WOE25OSG.js → feedback-M6I5AVZ5.js} +14 -15
- package/dist/{ffmpeg-N3LZ7XBX.js → ffmpeg-OAKTUK5S.js} +7 -7
- package/dist/{figma-VPG54R3O.js → figma-RFAPGGBF.js} +3 -3
- package/dist/fontLocalizeCli.js +13 -13
- package/dist/{frames-VNQ5P43E.js → frames-FOAWRBW4.js} +14 -14
- package/dist/{generate-ZCTFKNNW.js → generate-FLG6B7RX.js} +26 -27
- package/dist/{get-K374EYQS.js → get-I5JCIGPW.js} +8 -9
- package/dist/{gpuPolicy-SAEOR4QY.js → gpuPolicy-SLVPAQK2.js} +7 -7
- package/dist/{grade-compare-UHNGFSNR.js → grade-compare-R3UOE4WI.js} +38 -38
- package/dist/{gsapParserAcorn-5YD4N6HQ.js → gsapParserAcorn-SKGP4R4N.js} +1 -1
- package/dist/{heifImagePrep-R7NDS5FP.js → heifImagePrep-BOIWW7FW.js} +8 -8
- package/dist/{help-6DADTB2R.js → help-NVQZEN6A.js} +1 -1
- package/dist/{history-2K4FPC4P.js → history-AGNMVDRQ.js} +12 -12
- package/dist/hyperframes-player.global.js +2 -2
- package/dist/{info-7NZB6ZUO.js → info-EXAJSKZP.js} +15 -15
- package/dist/{init-UVGSTDBD.js → init-Z7FZ7U5J.js} +29 -29
- package/dist/{ink-3GBOCKAV.js → ink-QYCQXNUY.js} +13 -13
- package/dist/{inspect-XWAQWM2Y.js → inspect-ZJNHBIJI.js} +35 -35
- package/dist/{installer-AJESSC5Y.js → installer-VPGNKCEU.js} +5 -5
- package/dist/{keyframes-7C6LAP5V.js → keyframes-QYRES5IL.js} +15 -12
- package/dist/{lambda-Y2BEBCDQ.js → lambda-3I4IV63E.js} +13 -13
- package/dist/{layout-Z35EOSYQ.js → layout-J33Y6DD7.js} +35 -35
- package/dist/{lint-QU5JDQX3.js → lint-JT74BZWJ.js} +12 -12
- package/dist/{lintProject-Z6TG3Z34.js → lintProject-5CBL7VFV.js} +2 -2
- package/dist/{list-6KUDG4X7.js → list-NOWT754O.js} +10 -11
- package/dist/{localPage-SM5JBV4M.js → localPage-66UVNGQR.js} +7 -7
- package/dist/{login-XCR35XUC.js → login-3JR3HXS6.js} +7 -8
- package/dist/{logout-AHGR3X5U.js → logout-FJ444652.js} +4 -6
- package/dist/{look-O452Y7XO.js → look-NKCQENM7.js} +13 -13
- package/dist/{manager-GCFCVNYS.js → manager-ML4OLLSM.js} +8 -8
- package/dist/{measure-D54QYN6X.js → measure-VSZBVJJZ.js} +11 -11
- package/dist/{media-treatment-LPL2SZ7W.js → media-treatment-733EANTU.js} +15 -15
- package/dist/{media-use-VL2EL53W.js → media-use-IUN5ATZQ.js} +7 -9
- package/dist/{models-YFFUQ757.js → models-A6FBCVFA.js} +11 -11
- package/dist/{motionShot-QHWXLUJM.js → motionShot-PVWZLEMB.js} +19 -19
- package/dist/{normalize-audio-72PTXCD7.js → normalize-audio-XD4QE5NE.js} +11 -11
- package/dist/{open-BLPP4OPX.js → open-TWEEOMZA.js} +14 -14
- package/dist/{parakeetRunner-3A66RNGS.js → parakeetRunner-GP47AAVT.js} +13 -13
- package/dist/{pipeline-BFMEIMNZ.js → pipeline-5HUQFOCY.js} +10 -10
- package/dist/{play-KG2B7KMX.js → play-ZOZRB5OG.js} +26 -26
- package/dist/{preflight-YNGNNHZC.js → preflight-NTJMXUS2.js} +8 -8
- package/dist/{present-WGQEDRXJ.js → present-IMQS3KJ7.js} +22 -22
- package/dist/{preview-JM6GYVIL.js → preview-JSK5IKSR.js} +23 -23
- package/dist/{probe-B5H6PBIG.js → probe-ZLRD2TRZ.js} +13 -13
- package/dist/{producer-QIHOQ53I.js → producer-ZZROH3WZ.js} +1 -1
- package/dist/{projectConfig-GJL2ZGOU.js → projectConfig-UHYPGWD5.js} +7 -7
- package/dist/{publication-BLLVTVD6.js → publication-5KOANEHK.js} +3 -3
- package/dist/{publish-CYPJA7T7.js → publish-C3ARXH6D.js} +23 -83
- package/dist/{refresh-TB4TNH7R.js → refresh-YY4K2RWR.js} +3 -4
- package/dist/{remove-background-MHKW4EBR.js → remove-background-VDTWA7BL.js} +11 -11
- package/dist/{render-F35USXZA.js → render-P27DEH4H.js} +44 -45
- package/dist/{render-RUEXLOWE.js → render-TSV3XTQV.js} +6 -6
- package/dist/{render-RTPE3OBI.js → render-UF5XKGO5.js} +939 -317
- package/dist/{render-batch-QFGQD5FM.js → render-batch-ISMXAG7F.js} +6 -6
- package/dist/renderSetupWorker.js +2 -2
- package/dist/{resolver-HQIDF3TF.js → resolver-ZWNLOG6O.js} +5 -5
- package/dist/{reverse-BEQHRYSZ.js → reverse-J4CLVRPY.js} +1 -1
- package/dist/{run-EVZGKUEX.js → run-UPKPPRV7.js} +4 -5
- package/dist/{screenshotCapture-4NDEWYCU.js → screenshotCapture-ZZE3GMOF.js} +8 -8
- package/dist/{sherpa-MNU3ORFR.js → sherpa-7ISRANWA.js} +12 -12
- package/dist/skills/hyperframes-cli/SKILL.md +3 -3
- package/dist/skills/hyperframes-cli/references/preview-render.md +0 -20
- package/dist/skills/media-use/SKILL.md +1 -1
- package/dist/skills/media-use/references/heygen.md +2 -2
- package/dist/{skills-3R6EC5PV.js → skills-AAETAWZH.js} +11 -11
- package/dist/{skillsUpdateCheck-TRRXLL46.js → skillsUpdateCheck-KCP2EYKX.js} +4 -4
- package/dist/{snapshot-BYNK523M.js → snapshot-5PMHOVPR.js} +51 -49
- package/dist/{src-EZMBCQBY.js → src-CHPZUZZ3.js} +12 -12
- package/dist/{src-FZ4EJHOK.js → src-NIMSUB4P.js} +6 -6
- package/dist/{start-FRPRXMEN.js → start-6D25MEIJ.js} +24 -25
- package/dist/{staticProjectServer-FF6IBUD6.js → staticProjectServer-LM3YLJ6K.js} +20 -20
- package/dist/{status-QZ7PKGAJ.js → status-22TRM6DI.js} +18 -20
- package/dist/studio/assets/{codec-DqodFzhT.js → codec-D84nARi6.js} +1 -1
- package/dist/studio/assets/{hyperframes-player-D03oERxc.js → hyperframes-player-C2-hh0bR.js} +2 -2
- package/dist/studio/assets/{index-9kcxLnm3.js → index-B0rj7KmJ.js} +1 -1
- package/dist/studio/assets/{index-DuOvEv27.js → index-D3lR9-ik.js} +184 -184
- package/dist/studio/assets/{index-Cq2w6U13.css → index-dsfjBidg.css} +1 -1
- package/dist/studio/assets/{pausedVideoDecoder-pYFINB0c.js → pausedVideoDecoder-D8vnt-Wd.js} +1 -1
- package/dist/studio/index.html +2 -2
- package/dist/{studio-api-RBURPKYX.js → studio-api-LSWAJEK4.js} +15 -15
- package/dist/{studioServer-YZDNK3AO.js → studioServer-MC57HJAV.js} +84 -435
- package/dist/{sync-6MHJVU4M.js → sync-SEN3M7GA.js} +13 -13
- package/dist/{telemetry-CLB2O4ZK.js → telemetry-NP2FXZQL.js} +8 -8
- package/dist/{templates-HFQXIAO2.js → templates-QN7ZUHHZ.js} +18 -19
- package/dist/{timeline-ORRCS7NO.js → timeline-V43AACFE.js} +22 -22
- package/dist/{tokens-OTBA5VQ3.js → tokens-NOFZVX4P.js} +2 -2
- package/dist/{transcribe-EMXH7CGF.js → transcribe-FGVGCTEU.js} +10 -10
- package/dist/{transcribe-PJIFWND6.js → transcribe-IVZ4OASF.js} +28 -29
- package/dist/{tts-NANTORLP.js → tts-HOZ6X3MD.js} +1 -1
- package/dist/{update-RT6R53XR.js → update-LML5YVLT.js} +12 -12
- package/dist/{updateCheck-LSLLTUFX.js → updateCheck-FFHCGLRU.js} +3 -3
- package/dist/{upgrade-SSPKJYOW.js → upgrade-UWT2FB5Y.js} +4 -4
- package/dist/{urlDownloader-FTYUJP2D.js → urlDownloader-4RWM3UH2.js} +6 -6
- package/dist/{validate-SN2JDYNN.js → validate-ZNK2THUV.js} +29 -29
- package/dist/{video-Z522PCEM.js → video-QXVXG7PW.js} +8 -8
- package/dist/{voices-AQWUK6GK.js → voices-JI7QOSLT.js} +23 -24
- package/dist/warmCheck.js +45 -44
- package/package.json +1 -2
- package/dist/chunk-37RCPDCR.js +0 -173
- package/dist/chunk-4UBGQTAT.js +0 -387
- package/dist/chunk-DGXKMYIX.js +0 -343
- package/dist/chunk-JE2YBPC5.js +0 -152
- package/dist/chunk-OUOZGJJF.js +0 -538
- package/dist/chunk-Q5JJDC2L.js +0 -51
- package/dist/chunk-QABQKJPY.js +0 -3761
- package/dist/contract/LICENSE-Unicode.txt +0 -39
- package/dist/contract/path-policy.json +0 -311
- package/dist/contract/unicode-15.1.0.json +0 -6179
- package/dist/execute-AUPUAYPW.js +0 -109
- package/dist/oauth-KUPQUH6E.js +0 -40
- package/dist/plan-2MKSJEUW.js +0 -88
- package/dist/service-XCT7W4PQ.js +0 -68
- package/dist/share-KRKP6VYV.js +0 -241
- package/dist/{destroy-IWHFUGJL.js → destroy-YAMTVR2W.js} +4 -4
- package/dist/{synthesize-NJKCIPKW.js → synthesize-MDW4ZWTN.js} +5 -5
package/dist/chunk-DGXKMYIX.js
DELETED
|
@@ -1,343 +0,0 @@
|
|
|
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
|
-
ReviewFailed,
|
|
9
|
-
addVersion,
|
|
10
|
-
bindShareHost,
|
|
11
|
-
createShareAccess,
|
|
12
|
-
latestShareRender,
|
|
13
|
-
observeShareMutation,
|
|
14
|
-
pendingReviewExport,
|
|
15
|
-
prepareCliShareSource,
|
|
16
|
-
prepareShareRender,
|
|
17
|
-
projectFingerprint,
|
|
18
|
-
refreshReviewExport,
|
|
19
|
-
reviewClient,
|
|
20
|
-
reviewRecord,
|
|
21
|
-
reviewStatus,
|
|
22
|
-
reviewUploadOrigins,
|
|
23
|
-
reviewVersion,
|
|
24
|
-
setReviewAccess,
|
|
25
|
-
setReviewSite,
|
|
26
|
-
shareForReview,
|
|
27
|
-
shareSite,
|
|
28
|
-
signedInRequest,
|
|
29
|
-
turnOffReviewLink,
|
|
30
|
-
uncheckedSource
|
|
31
|
-
} from "./chunk-QABQKJPY.js";
|
|
32
|
-
import {
|
|
33
|
-
apiBaseUrl
|
|
34
|
-
} from "./chunk-WXEXQLVV.js";
|
|
35
|
-
import {
|
|
36
|
-
findFFprobe
|
|
37
|
-
} from "./chunk-STTUDVAI.js";
|
|
38
|
-
import {
|
|
39
|
-
defaultClientId,
|
|
40
|
-
oauthEnvironment,
|
|
41
|
-
resolveClientId,
|
|
42
|
-
tokenEndpoint
|
|
43
|
-
} from "./chunk-FID757D3.js";
|
|
44
|
-
import {
|
|
45
|
-
CliUsageError
|
|
46
|
-
} from "./chunk-66W5IWLO.js";
|
|
47
|
-
|
|
48
|
-
// src/share/service.ts
|
|
49
|
-
import { basename as basename2 } from "path";
|
|
50
|
-
|
|
51
|
-
// src/share/host.ts
|
|
52
|
-
import { basename } from "path";
|
|
53
|
-
import { realpathSync } from "fs";
|
|
54
|
-
|
|
55
|
-
// src/share/uploadOrigins.ts
|
|
56
|
-
var PRODUCTION_UPLOAD_ORIGINS = [
|
|
57
|
-
"https://heygen-hyperframes-reviews-prod-767398024897-us-east-2.s3.amazonaws.com",
|
|
58
|
-
"https://heygen-hyperframes-reviews-prod-767398024897-us-east-2.s3.us-east-2.amazonaws.com",
|
|
59
|
-
"https://hyperframes-composition-sync-prod.s3.us-east-2.amazonaws.com"
|
|
60
|
-
];
|
|
61
|
-
function cliReviewUploadOrigins() {
|
|
62
|
-
const override = process.env.HYPERFRAMES_REVIEW_UPLOAD_ORIGINS;
|
|
63
|
-
if (override !== void 0)
|
|
64
|
-
return override.split(",").map((origin) => origin.trim()).filter(Boolean);
|
|
65
|
-
const standardProduction = oauthEnvironment() === "prod" && apiBaseUrl() === "https://api.heygen.com" && tokenEndpoint() === "https://api2.heygen.com/v1/oauth/token" && resolveClientId() === defaultClientId();
|
|
66
|
-
return standardProduction ? PRODUCTION_UPLOAD_ORIGINS : [];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// src/share/host.ts
|
|
70
|
-
var projects = /* @__PURE__ */ new Set();
|
|
71
|
-
function isStorageOrigin(origin) {
|
|
72
|
-
if (!URL.canParse(origin)) return false;
|
|
73
|
-
const url = new URL(origin);
|
|
74
|
-
const loopback = url.protocol === "http:" && url.hostname === "127.0.0.1";
|
|
75
|
-
return url.origin === origin && !url.hostname.includes("*") && (url.protocol === "https:" || loopback);
|
|
76
|
-
}
|
|
77
|
-
function assertReviewUploadStorage() {
|
|
78
|
-
const origins = reviewUploadOrigins().filter(Boolean);
|
|
79
|
-
if (origins.length === 0 || !origins.every(isStorageOrigin))
|
|
80
|
-
throw new ReviewFailed(503, "review_upload_origins_required");
|
|
81
|
-
}
|
|
82
|
-
function bindCliShareProject(path) {
|
|
83
|
-
const dir = realpathSync(path);
|
|
84
|
-
projects.add(dir);
|
|
85
|
-
bindShareHost({
|
|
86
|
-
reviewUploadOrigins: cliReviewUploadOrigins(),
|
|
87
|
-
normalize: realpathSync,
|
|
88
|
-
assertOpenProject: (path2) => {
|
|
89
|
-
const normalized = realpathSync(path2);
|
|
90
|
-
if (!projects.has(normalized)) throw new Error("This project is not open for sharing.");
|
|
91
|
-
return normalized;
|
|
92
|
-
},
|
|
93
|
-
resolveOpenProjectByPath: (path2) => {
|
|
94
|
-
const normalized = realpathSync(path2);
|
|
95
|
-
return projects.has(normalized) ? { id: normalized, dir: normalized } : null;
|
|
96
|
-
},
|
|
97
|
-
listOpenProjects: () => [...projects].map((dir2) => ({ dir: dir2 })),
|
|
98
|
-
homeName: basename,
|
|
99
|
-
latestExportFile: latestShareRender,
|
|
100
|
-
projectFingerprint,
|
|
101
|
-
signedInRequest: (deps) => signedInRequest({
|
|
102
|
-
...deps,
|
|
103
|
-
headers: { "X-HeyGen-Source": "cli", "X-HeyGen-Client-Source": "hyperframes" }
|
|
104
|
-
}),
|
|
105
|
-
ffBinary: () => {
|
|
106
|
-
const binary = findFFprobe();
|
|
107
|
-
if (!binary) throw new Error("Install FFmpeg to prepare a shared video.");
|
|
108
|
-
return binary;
|
|
109
|
-
},
|
|
110
|
-
channelSite: "https://hyperframes.dev",
|
|
111
|
-
signinSites: ["https://hyperframes.dev", "https://dev.hyperframes.dev"]
|
|
112
|
-
});
|
|
113
|
-
setReviewSite(shareSite());
|
|
114
|
-
return dir;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// src/share/service.ts
|
|
118
|
-
function linkState(share, ready, failed) {
|
|
119
|
-
if (!share) return "not_shared";
|
|
120
|
-
if (failed) return "failed";
|
|
121
|
-
if (!share.url) return "link_off";
|
|
122
|
-
return ready ? "ready" : "processing";
|
|
123
|
-
}
|
|
124
|
-
async function refreshShare(dir, client, expectedProjectId, onRecovery) {
|
|
125
|
-
const share = await reviewStatus({ projectPath: dir, client });
|
|
126
|
-
if (expectedProjectId) assertUploadProject(share, expectedProjectId);
|
|
127
|
-
if (onRecovery) onRecovery(isProcessing(await pendingReviewExport(dir), share));
|
|
128
|
-
if (share) await refreshReviewExport(dir, client);
|
|
129
|
-
return share;
|
|
130
|
-
}
|
|
131
|
-
async function readStatus(dir, client, expectedProjectId, onRecovery) {
|
|
132
|
-
const share = await refreshShare(dir, client, expectedProjectId, onRecovery);
|
|
133
|
-
const project = await readProject(share, client);
|
|
134
|
-
const latest = project?.latest_ready_version_id ?? null;
|
|
135
|
-
const version = await reviewVersion(dir, { latestReadyVersionId: latest });
|
|
136
|
-
const pending = await pendingReviewExport(dir);
|
|
137
|
-
const activeUrl = share?.url ?? null;
|
|
138
|
-
const processing = isProcessing(pending, share);
|
|
139
|
-
const failed = hasFailedVersion(version);
|
|
140
|
-
const ready = Boolean(activeUrl && latest && !processing && !failed);
|
|
141
|
-
return {
|
|
142
|
-
share,
|
|
143
|
-
version,
|
|
144
|
-
pending,
|
|
145
|
-
state: linkState(share, ready, failed),
|
|
146
|
-
ready,
|
|
147
|
-
source: uncheckedSource(),
|
|
148
|
-
...statusLinks(activeUrl, ready, processing || failed, project)
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
async function readProject(share, client) {
|
|
152
|
-
return share?.projectId ? client.project(share.projectId) : null;
|
|
153
|
-
}
|
|
154
|
-
function statusLinks(url, ready, processing, project) {
|
|
155
|
-
return {
|
|
156
|
-
url: ready ? url : null,
|
|
157
|
-
previousUrl: processing && project?.latest_ready_version_id ? url : null,
|
|
158
|
-
manageUrl: project?.authenticated_review_url ?? `${shareSite() === "https://hyperframes.dev" ? "https://hyperframes.studio" : shareSite()}/shares`
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
function isProcessing(pending, share) {
|
|
162
|
-
return Boolean(pending && pending.projectId === share?.projectId);
|
|
163
|
-
}
|
|
164
|
-
function selectSpace(spaces, id) {
|
|
165
|
-
if (id) return spaces.find((space) => space.space_id === id);
|
|
166
|
-
return spaces.find((space) => space.bound) ?? spaces.find((space) => space.kind === "personal");
|
|
167
|
-
}
|
|
168
|
-
function assertUploadProject(share, expectedId) {
|
|
169
|
-
const id = share?.projectId;
|
|
170
|
-
if (!id || expectedId && id !== expectedId)
|
|
171
|
-
throw new ReviewFailed(409, "review_binding_changed");
|
|
172
|
-
}
|
|
173
|
-
function assertExistingIntent(share, input) {
|
|
174
|
-
if (!share) {
|
|
175
|
-
if (input.action === "update") throw new ReviewFailed(404, "not_shared");
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
if (input.space && share.space?.id !== input.space)
|
|
179
|
-
throw new ReviewFailed(409, "workspace_mismatch");
|
|
180
|
-
if (input.audience && share.access !== input.audience)
|
|
181
|
-
throw new ReviewFailed(409, "manage_existing_audience");
|
|
182
|
-
}
|
|
183
|
-
function retrievesExisting(current, input) {
|
|
184
|
-
return current.share && input.action === "share" && (current.ready || current.state === "link_off" || current.version.last && current.state !== "processing");
|
|
185
|
-
}
|
|
186
|
-
async function preflightFirst(dir, client, input) {
|
|
187
|
-
const audience = input.audience;
|
|
188
|
-
if (!audience)
|
|
189
|
-
throw new CliUsageError(
|
|
190
|
-
"Choose an audience with --public, --team, --invite-only or --private. --yes is not audience consent.",
|
|
191
|
-
{ code: "audience_required" }
|
|
192
|
-
);
|
|
193
|
-
const [spaces, record] = await Promise.all([client.spaces(), reviewRecord(dir)]);
|
|
194
|
-
const space = selectSpace(spaces, registrationSpace(record, input.space));
|
|
195
|
-
if (!space || !space.can_create_review) throw new ReviewFailed(403, "workspace_cannot_share");
|
|
196
|
-
assertQuota(record, space);
|
|
197
|
-
assertAudience(audience, space);
|
|
198
|
-
return space.space_id;
|
|
199
|
-
}
|
|
200
|
-
function registrationSpace(record, requested) {
|
|
201
|
-
if (!record?.spaceId) return requested;
|
|
202
|
-
if (!requested || requested === record.spaceId) return record.spaceId;
|
|
203
|
-
if (record.registration || record.projectId) throw new ReviewFailed(409, "workspace_mismatch");
|
|
204
|
-
return requested;
|
|
205
|
-
}
|
|
206
|
-
function assertQuota(record, space) {
|
|
207
|
-
if (record?.registration || record?.projectId) return;
|
|
208
|
-
if (space.review_entitlements?.can_register_project === false)
|
|
209
|
-
throw new ReviewFailed(402, "review_project_limit_reached");
|
|
210
|
-
}
|
|
211
|
-
function assertAudience(audience, space) {
|
|
212
|
-
if (audience === "private") return;
|
|
213
|
-
if (!space.review_entitlements?.allowed_collaborative_access_modes.includes(audience))
|
|
214
|
-
throw new ReviewFailed(402, "review_subscription_required");
|
|
215
|
-
}
|
|
216
|
-
function assertResumeSource(current, input) {
|
|
217
|
-
if (current.share && current.pending && input.action === "share" && current.version.source !== "ready")
|
|
218
|
-
throw new Error(
|
|
219
|
-
"The shared video is unfinished and local edits have changed. Run hyperframes share --update to explicitly upload the current project."
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
function createShareService(projectPath, progress = () => {
|
|
223
|
-
}, options = {}) {
|
|
224
|
-
const dir = bindCliShareProject(projectPath);
|
|
225
|
-
const auth = createShareAccess(options.pinIdentity);
|
|
226
|
-
const client = reviewClient(auth);
|
|
227
|
-
const status = async (expectedProjectId) => {
|
|
228
|
-
await auth.access();
|
|
229
|
-
return readStatus(dir, client, expectedProjectId);
|
|
230
|
-
};
|
|
231
|
-
const upload = async (input, projectId, sources, attempt) => {
|
|
232
|
-
const end = Date.now() + (input.waitSeconds ?? 300) * 1e3;
|
|
233
|
-
let added = false;
|
|
234
|
-
const failure = await addVersion({
|
|
235
|
-
projectPath: dir,
|
|
236
|
-
projectId,
|
|
237
|
-
title: basename2(dir),
|
|
238
|
-
client,
|
|
239
|
-
onProgress: (value) => {
|
|
240
|
-
attempt.progress(value);
|
|
241
|
-
progress(value);
|
|
242
|
-
},
|
|
243
|
-
allowPending: true,
|
|
244
|
-
...sources.filesForExport && { filesForExport: sources.filesForExport },
|
|
245
|
-
requireSource: sources.requireSource,
|
|
246
|
-
omitSource: sources.source.at === "video_only",
|
|
247
|
-
onAdded: () => {
|
|
248
|
-
added = true;
|
|
249
|
-
},
|
|
250
|
-
open: () => Date.now() < end
|
|
251
|
-
});
|
|
252
|
-
if (failure) throw new Error(failure);
|
|
253
|
-
const result = { ...await status(projectId), source: sources.source };
|
|
254
|
-
if (result.version.failure) throw new Error(result.version.failure);
|
|
255
|
-
if (!added && !result.version.last?.current) {
|
|
256
|
-
attempt.complete(false, added);
|
|
257
|
-
return { ...result, state: "processing", ready: false, url: null };
|
|
258
|
-
}
|
|
259
|
-
attempt.complete(result.ready, added);
|
|
260
|
-
return result;
|
|
261
|
-
};
|
|
262
|
-
const uploadTarget = async (current, input, space) => {
|
|
263
|
-
const share = current ? await reviewStatus({ projectPath: dir, client }) : await shareForReview({
|
|
264
|
-
projectPath: dir,
|
|
265
|
-
title: basename2(dir),
|
|
266
|
-
client,
|
|
267
|
-
spaceId: space,
|
|
268
|
-
audience: input.audience
|
|
269
|
-
});
|
|
270
|
-
assertUploadProject(share, current?.projectId);
|
|
271
|
-
if (share.takedown) throw new ReviewFailed(409, "moderation_hold");
|
|
272
|
-
assertExistingIntent(share, {
|
|
273
|
-
...input,
|
|
274
|
-
space: input.space ?? space,
|
|
275
|
-
audience: input.audience ?? current?.access
|
|
276
|
-
});
|
|
277
|
-
return { projectId: share.projectId, spaceId: share.space?.id, audience: share.access };
|
|
278
|
-
};
|
|
279
|
-
const checkPreparedTarget = async (target) => {
|
|
280
|
-
const share = await reviewStatus({ projectPath: dir, client });
|
|
281
|
-
assertUploadProject(share, target.projectId);
|
|
282
|
-
if (share.takedown) throw new ReviewFailed(409, "moderation_hold");
|
|
283
|
-
assertExistingIntent(share, {
|
|
284
|
-
action: "update",
|
|
285
|
-
space: target.spaceId,
|
|
286
|
-
audience: target.audience
|
|
287
|
-
});
|
|
288
|
-
};
|
|
289
|
-
const mutate = async (input, attempt) => {
|
|
290
|
-
await auth.access();
|
|
291
|
-
attempt.authenticated();
|
|
292
|
-
const current = await readStatus(dir, client, void 0, attempt.recover);
|
|
293
|
-
assertExistingIntent(current.share, input);
|
|
294
|
-
if (retrievesExisting(current, input)) {
|
|
295
|
-
attempt.retrieved();
|
|
296
|
-
return current;
|
|
297
|
-
}
|
|
298
|
-
const flags = await client.reviewFlags();
|
|
299
|
-
if (!flags.versionSharing) throw new ReviewFailed(403, "feature_unavailable");
|
|
300
|
-
const space = current.share ? current.share.space?.id : await preflightFirst(dir, client, input);
|
|
301
|
-
assertResumeSource(current, input);
|
|
302
|
-
assertReviewUploadStorage();
|
|
303
|
-
await prepareShareRender(dir);
|
|
304
|
-
const target = await uploadTarget(current.share, input, space);
|
|
305
|
-
const sources = await prepareCliShareSource(dir, auth.access, target.spaceId, {
|
|
306
|
-
videoOnly: input.videoOnly,
|
|
307
|
-
shareFiles: flags.shareFiles
|
|
308
|
-
});
|
|
309
|
-
if (sources.requireSource) await checkPreparedTarget(target);
|
|
310
|
-
return upload(input, target.projectId, sources, attempt);
|
|
311
|
-
};
|
|
312
|
-
return {
|
|
313
|
-
checkSession: (verifyIdentity = false) => auth.access(void 0, verifyIdentity),
|
|
314
|
-
status,
|
|
315
|
-
run: (input) => input.action === "status" || input.action === "manage" ? status() : observeShareMutation(
|
|
316
|
-
input.action,
|
|
317
|
-
options.surface ?? "cli",
|
|
318
|
-
(attempt) => mutate(input, attempt)
|
|
319
|
-
),
|
|
320
|
-
capabilities: () => client.reviewFlags(),
|
|
321
|
-
spaces: () => client.spaces(),
|
|
322
|
-
setAccess: async (access) => {
|
|
323
|
-
await setReviewAccess({ projectPath: dir, client, change: { access } });
|
|
324
|
-
return status();
|
|
325
|
-
},
|
|
326
|
-
linkOff: async () => {
|
|
327
|
-
await turnOffReviewLink({ projectPath: dir, client });
|
|
328
|
-
return status();
|
|
329
|
-
},
|
|
330
|
-
linkOn: async () => {
|
|
331
|
-
if (!(await status()).share) throw new ReviewFailed(404, "not_shared");
|
|
332
|
-
await shareForReview({ projectPath: dir, title: basename2(dir), client });
|
|
333
|
-
return status();
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
function hasFailedVersion(version) {
|
|
338
|
-
return Boolean(version.failure && !version.held);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
export {
|
|
342
|
-
createShareService
|
|
343
|
-
};
|
package/dist/chunk-JE2YBPC5.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
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
|
-
apiBaseUrl,
|
|
9
|
-
isHeaderSafe,
|
|
10
|
-
readStore
|
|
11
|
-
} from "./chunk-WXEXQLVV.js";
|
|
12
|
-
import {
|
|
13
|
-
ErrInvalidStore,
|
|
14
|
-
ErrLoginExpired,
|
|
15
|
-
ErrNotConfigured,
|
|
16
|
-
assertOAuthIdentity,
|
|
17
|
-
isAuthError
|
|
18
|
-
} from "./chunk-FID757D3.js";
|
|
19
|
-
|
|
20
|
-
// src/auth/resolver.ts
|
|
21
|
-
var ENV_CREDENTIAL_VAR = {
|
|
22
|
-
env: "HEYGEN_API_KEY",
|
|
23
|
-
env_alias: "HYPERFRAMES_API_KEY",
|
|
24
|
-
env_oauth: "HEYGEN_ACCESS_TOKEN"
|
|
25
|
-
};
|
|
26
|
-
var envCredentialVar = (source) => source in ENV_CREDENTIAL_VAR ? ENV_CREDENTIAL_VAR[source] : void 0;
|
|
27
|
-
var EXPIRY_SKEW_MS = 60 * 1e3;
|
|
28
|
-
async function resolveCredential(opts = {}) {
|
|
29
|
-
const now = (opts.now ?? (() => /* @__PURE__ */ new Date()))();
|
|
30
|
-
const envKey = envApiKey();
|
|
31
|
-
if (envKey && !heygenApiHost()) return envKey;
|
|
32
|
-
const accessToken = headerSafeEnv(ENV_CREDENTIAL_VAR.env_oauth);
|
|
33
|
-
if (accessToken) {
|
|
34
|
-
return { type: "oauth", access_token: accessToken, source: "env_oauth", refreshable: false };
|
|
35
|
-
}
|
|
36
|
-
if (envKey && loginRefreshFailed) return envKey;
|
|
37
|
-
return await fromStore(now, envKey);
|
|
38
|
-
}
|
|
39
|
-
async function fromStore(now, envKey) {
|
|
40
|
-
const store = await readStore().catch((err) => {
|
|
41
|
-
if (envKey) return null;
|
|
42
|
-
throw err;
|
|
43
|
-
});
|
|
44
|
-
if (!store || store.source === "absent") {
|
|
45
|
-
if (envKey) return envKey;
|
|
46
|
-
throw ErrNotConfigured();
|
|
47
|
-
}
|
|
48
|
-
const { credentials, source } = store;
|
|
49
|
-
const fileSource = source === "file_legacy" ? "file_legacy" : "file_json";
|
|
50
|
-
const login = credentials.oauth && boundToThisClient(credentials.oauth) ? pickOAuth(credentials.oauth, now, fileSource) : null;
|
|
51
|
-
return login ?? envKey ?? storedApiKey(credentials, fileSource);
|
|
52
|
-
}
|
|
53
|
-
function storedApiKey(credentials, source) {
|
|
54
|
-
if (credentials.oauth) {
|
|
55
|
-
assertOAuthIdentity(credentials.oauth);
|
|
56
|
-
throw ErrLoginExpired();
|
|
57
|
-
}
|
|
58
|
-
if (credentials.api_key) return { type: "api_key", key: credentials.api_key, source };
|
|
59
|
-
throw ErrNotConfigured();
|
|
60
|
-
}
|
|
61
|
-
function envApiKey() {
|
|
62
|
-
const heygenEnv = headerSafeEnv(ENV_CREDENTIAL_VAR.env);
|
|
63
|
-
if (heygenEnv) return { type: "api_key", key: heygenEnv, source: "env" };
|
|
64
|
-
const hfEnv = headerSafeEnv(ENV_CREDENTIAL_VAR.env_alias);
|
|
65
|
-
if (hfEnv) return { type: "api_key", key: hfEnv, source: "env_alias" };
|
|
66
|
-
return void 0;
|
|
67
|
-
}
|
|
68
|
-
function heygenApiHost() {
|
|
69
|
-
const mediaBase = process.env["HEYGEN_API_BASE"]?.trim();
|
|
70
|
-
return [apiBaseUrl(), ...mediaBase ? [mediaBase] : []].every((base) => {
|
|
71
|
-
try {
|
|
72
|
-
const host = new URL(base).hostname;
|
|
73
|
-
return host === "heygen.com" || host.endsWith(".heygen.com");
|
|
74
|
-
} catch {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
function boundToThisClient(tokens) {
|
|
80
|
-
try {
|
|
81
|
-
assertOAuthIdentity(tokens);
|
|
82
|
-
return true;
|
|
83
|
-
} catch {
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
var loginRefreshFailed = false;
|
|
88
|
-
async function afterRefreshFailure(err, refreshToken) {
|
|
89
|
-
if (!isAuthError(err)) throw err;
|
|
90
|
-
if (err.code === "LOGIN_CHANGED" || err.code === "REFRESH_FAILED") {
|
|
91
|
-
const stored = await readStore().catch(() => null);
|
|
92
|
-
const current = stored?.credentials.oauth?.refresh_token;
|
|
93
|
-
if (current && current !== refreshToken) {
|
|
94
|
-
const next = await resolveCredential();
|
|
95
|
-
if (next.type !== "oauth" || !next.refreshable) return next;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (!err.refused && err.code !== "LOGIN_EXPIRED") throw err;
|
|
99
|
-
const key = envApiKey();
|
|
100
|
-
if (!key) throw err;
|
|
101
|
-
loginRefreshFailed = true;
|
|
102
|
-
return key;
|
|
103
|
-
}
|
|
104
|
-
function headerSafeEnv(name) {
|
|
105
|
-
const value = process.env[name];
|
|
106
|
-
if (value && !isHeaderSafe(value)) {
|
|
107
|
-
throw ErrInvalidStore(`${name} contains control characters`);
|
|
108
|
-
}
|
|
109
|
-
return value;
|
|
110
|
-
}
|
|
111
|
-
async function tryResolveCredential(opts = {}) {
|
|
112
|
-
try {
|
|
113
|
-
return await resolveCredential(opts);
|
|
114
|
-
} catch (err) {
|
|
115
|
-
if (isAuthError(err) && err.code === "NOT_CONFIGURED") {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
throw err;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function pickOAuth(tokens, now, source) {
|
|
122
|
-
const expiresAt = parseDate(tokens.expires_at);
|
|
123
|
-
const expired = isTokenExpired(expiresAt, now);
|
|
124
|
-
if (expired && !tokens.refresh_token) return null;
|
|
125
|
-
const out = {
|
|
126
|
-
type: "oauth",
|
|
127
|
-
access_token: tokens.access_token,
|
|
128
|
-
source,
|
|
129
|
-
refreshable: expired && tokens.refresh_token !== void 0
|
|
130
|
-
};
|
|
131
|
-
if (tokens.refresh_token) out.refresh_token = tokens.refresh_token;
|
|
132
|
-
if (expiresAt) out.expires_at = expiresAt;
|
|
133
|
-
if (tokens.scope) out.scope = tokens.scope;
|
|
134
|
-
return out;
|
|
135
|
-
}
|
|
136
|
-
function isTokenExpired(expiresAt, now) {
|
|
137
|
-
return expiresAt !== void 0 && expiresAt.getTime() - EXPIRY_SKEW_MS < now.getTime();
|
|
138
|
-
}
|
|
139
|
-
function parseDate(s) {
|
|
140
|
-
if (!s) return void 0;
|
|
141
|
-
const d = new Date(s);
|
|
142
|
-
return Number.isNaN(d.getTime()) ? void 0 : d;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export {
|
|
146
|
-
ENV_CREDENTIAL_VAR,
|
|
147
|
-
envCredentialVar,
|
|
148
|
-
resolveCredential,
|
|
149
|
-
afterRefreshFailure,
|
|
150
|
-
tryResolveCredential,
|
|
151
|
-
isTokenExpired
|
|
152
|
-
};
|