hyperframes 0.8.181 → 0.8.184
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/bin/hyperframes.mjs +3 -1
- package/dist/{add-AWQ2EGBU.js → add-5ZTD3MUZ.js} +22 -22
- package/dist/{animatedGifPrep-SENXJ7TN.js → animatedGifPrep-AGASIWVA.js} +14 -13
- package/dist/api.js +29 -28
- package/dist/{asset-XBH3MN3Y.js → asset-LSTEMPIB.js} +3 -3
- package/dist/{assetCataloger-KH4X2CRO.js → assetCataloger-BKBMNL3A.js} +16 -13
- package/dist/{audio-Q7I473UN.js → audio-KGK44XE4.js} +31 -30
- package/dist/{auth-I7CBTEUS.js → auth-MJWKYK77.js} +4 -4
- package/dist/{autoUpdate-KY5TLSN7.js → autoUpdate-2GGDKYR2.js} +2 -2
- package/dist/{backgroundChecks-4Q3VVK5W.js → backgroundChecks-7GRX5VQY.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-3AYDQRBI.js → batchRender-BCV2LELR.js} +7 -7
- package/dist/{beats-P4LENNVT.js → beats-7BCFRBAL.js} +12 -12
- package/dist/{benchmark-AXOAECN3.js → benchmark-2R6CN5MQ.js} +24 -24
- package/dist/{browser-XZKB5HGJ.js → browser-6AFGOI7G.js} +20 -20
- package/dist/{bundleWithLocalizedFonts-2WCR57IN.js → bundleWithLocalizedFonts-2EGPA5ZO.js} +2 -2
- package/dist/{capture-NWARHRHR.js → capture-HA2UHLIU.js} +8 -5
- package/dist/{capture-4RN4APDF.js → capture-HOIAW6MO.js} +50 -41
- package/dist/{captureCompositionFrame-QOF5BRF4.js → captureCompositionFrame-4236FVWJ.js} +22 -20
- package/dist/{captureTimeout-K2JNVVCI.js → captureTimeout-RIMG6IYH.js} +1 -1
- package/dist/{catalog-CRPOPVD5.js → catalog-A6CZAWW4.js} +42 -42
- package/dist/{catch-up-MHWGUQ42.js → catch-up-TNA4DJOA.js} +15 -15
- package/dist/check-5E5U2EQZ.js +117 -0
- package/dist/checkBrowser-FNINXBMZ.js +118 -0
- package/dist/{chunk-OJTDUF4W.js → chunk-2PVE4WS2.js} +1 -1
- package/dist/{checkBrowser-VES2NF3K.js → chunk-2ULXZ4PG.js} +187 -114
- package/dist/{chunk-WITHUCCB.js → chunk-2XA7KXQO.js} +2 -2
- package/dist/{chunk-HODBPO4A.js → chunk-3MDJIWOV.js} +626 -328
- package/dist/{chunk-JBCU6NR5.js → chunk-3QVMJ7GX.js} +56 -55
- package/dist/{chunk-OR5WCFWZ.js → chunk-3TXNNBI2.js} +2 -2
- package/dist/{chunk-IZM562YJ.js → chunk-4KKKBEP3.js} +4 -4
- package/dist/{chunk-XEWHUPFS.js → chunk-4N4P3ZWL.js} +2 -2
- package/dist/{chunk-537IYAEE.js → chunk-4UMPIPCQ.js} +9 -1
- package/dist/{chunk-J4L5TPLS.js → chunk-5UDRPPN2.js} +48 -6
- package/dist/{chunk-L3YOGIPG.js → chunk-66LREXGS.js} +1 -1
- package/dist/{chunk-6I7V6Q7F.js → chunk-74JMKLVU.js} +103 -20
- package/dist/{chunk-3PULCIY5.js → chunk-7HJALUIO.js} +5 -5
- package/dist/{chunk-GZVP4TWN.js → chunk-7JAD4MEW.js} +1 -1
- package/dist/{chunk-NAMGMP3R.js → chunk-7KVVNF7B.js} +1 -1
- package/dist/{chunk-TO6JNTML.js → chunk-7MB2ZAQF.js} +13 -8
- package/dist/{chunk-55IG255C.js → chunk-7NRI7HYX.js} +1 -1
- package/dist/{chunk-VAJIPSN6.js → chunk-ABZYYUUH.js} +1 -1
- package/dist/{chunk-GK2FIKIQ.js → chunk-ADDHW2FS.js} +214 -37
- package/dist/{chunk-ZUOSILUE.js → chunk-BCHSTE7U.js} +1 -1
- package/dist/{chunk-AOWDVB2T.js → chunk-CXABAXB3.js} +1 -1
- package/dist/{chunk-E24HSMZV.js → chunk-CYBXXSC4.js} +65 -14
- package/dist/{chunk-NZZYJOMJ.js → chunk-CZUAX3BV.js} +6 -5
- package/dist/{chunk-GV5R5B7Q.js → chunk-DGECWPTL.js} +1 -1
- package/dist/{chunk-BRHI7EIA.js → chunk-DKPNNYBZ.js} +4 -0
- package/dist/{chunk-UIDZRCBG.js → chunk-DWUGKEHR.js} +1 -1
- package/dist/{chunk-D3ZWBHZP.js → chunk-DYAPHNV6.js} +3 -2
- package/dist/{chunk-T7UHTUUE.js → chunk-E32ZQ2WO.js} +9 -9
- package/dist/{chunk-RGHQID2E.js → chunk-EHSBBBR2.js} +5 -3
- package/dist/{chunk-DJJ7SK4F.js → chunk-EM7C7H7S.js} +8 -8
- package/dist/{chunk-XSRUVMXK.js → chunk-ES426XRJ.js} +4 -4
- package/dist/chunk-FG4BBFZI.js +122 -0
- package/dist/{chunk-JMFJI26U.js → chunk-FGJEUV4S.js} +2 -2
- package/dist/{check-DJCUOUDI.js → chunk-GDEV42FA.js} +198 -142
- package/dist/{chunk-RXQHSGAQ.js → chunk-HR23IKLZ.js} +2 -2
- package/dist/{chunk-KMAAOHLO.js → chunk-HRPWRZGF.js} +1 -1
- package/dist/{chunk-UPFUC4DB.js → chunk-HTIUNMTP.js} +1 -1
- package/dist/{chunk-V2UNZ7QP.js → chunk-ICJEAFPD.js} +25 -14
- package/dist/{chunk-EOADENKV.js → chunk-IWTNTUPQ.js} +16 -14
- package/dist/chunk-IZCW2NKT.js +29 -0
- package/dist/{chunk-XFCLWWL3.js → chunk-J36JVBLR.js} +11 -4
- package/dist/{chunk-LBQFLUIY.js → chunk-J3QM7AHP.js} +9 -49
- package/dist/{chunk-DUN63LHY.js → chunk-JB6ARMQS.js} +2 -2
- package/dist/{chunk-5E5EYPZO.js → chunk-JIUTXKWA.js} +7 -7
- package/dist/{chunk-YJDB4FLT.js → chunk-JQYJXUJW.js} +1 -1
- package/dist/{chunk-PBN6GBJE.js → chunk-JVBRJMOP.js} +14 -1
- package/dist/{chunk-RHWJKSGH.js → chunk-KANNRHY7.js} +1 -1
- package/dist/{chunk-IL3GTCQY.js → chunk-KN46TGHV.js} +72 -140
- package/dist/{chunk-OFY6JTZC.js → chunk-LLC4CS6I.js} +2 -2
- package/dist/{chunk-OJDXABUF.js → chunk-LRGYPXHF.js} +2 -2
- package/dist/{chunk-GNE57O7U.js → chunk-MFAETWIF.js} +1 -1
- package/dist/{chunk-32GKETR7.js → chunk-MMQ52NIZ.js} +74 -0
- package/dist/chunk-MOEGCMKI.js +180 -0
- package/dist/{chunk-E6RPWJVC.js → chunk-NAUKCKCJ.js} +5 -1
- package/dist/{chunk-B4VT6YU2.js → chunk-OLZENUPI.js} +50 -7
- package/dist/{chunk-H4YZZ2VQ.js → chunk-PFD25NAC.js} +1 -1
- package/dist/{chunk-XH262OWN.js → chunk-PFYWVUHA.js} +1 -1
- package/dist/{chunk-S3RYRF3W.js → chunk-PSKEKWVU.js} +1 -1
- package/dist/{chunk-N5SXQCJL.js → chunk-Q33P4EAC.js} +3 -3
- package/dist/{chunk-3DKN5WKL.js → chunk-QH3T4WI2.js} +77 -6
- package/dist/{chunk-O5AE7HOP.js → chunk-QL2PNIXC.js} +37 -33
- package/dist/{chunk-WUUCEFL5.js → chunk-R2BFTECP.js} +5 -5
- package/dist/chunk-R2SQBPMH.js +3805 -0
- package/dist/{chunk-YPBIAONI.js → chunk-RGXVEYHI.js} +230 -162
- package/dist/{chunk-YMS6CJCD.js → chunk-SAX7HQ5E.js} +1 -1
- package/dist/{chunk-KIO3R4QN.js → chunk-SN7KI5JA.js} +27 -14
- package/dist/{chunk-4USWWI2Y.js → chunk-TE427YID.js} +2 -2
- package/dist/{chunk-ICMXC3MI.js → chunk-U6RXZNZE.js} +31 -18
- package/dist/{chunk-X7CCSMRR.js → chunk-UJKUB2LH.js} +16 -16
- package/dist/{chunk-K26FR4SM.js → chunk-UKOTVJFV.js} +12 -12
- package/dist/{chunk-4OT3FWVV.js → chunk-UNNXFKVG.js} +2 -2
- package/dist/{chunk-PF7OWVTL.js → chunk-VDM3FEDP.js} +2 -2
- package/dist/{chunk-Y5GY6Y7A.js → chunk-VNVQGDPC.js} +2 -2
- package/dist/{chunk-22QHO26F.js → chunk-W64L7IFS.js} +1 -1
- package/dist/{chunk-Y2RXRPL2.js → chunk-WHPN2TIT.js} +5 -5
- package/dist/{chunk-65WIUIHL.js → chunk-WTFUDNW2.js} +7 -15
- package/dist/{chunk-3XDOGSRD.js → chunk-X3CG5YQA.js} +3 -3
- package/dist/{chunk-UZOZ2W2E.js → chunk-XGHHVYC7.js} +96 -34
- package/dist/{chunk-4IEH6EAC.js → chunk-YALM6XN4.js} +203 -58
- package/dist/{chunk-B6JLCPT3.js → chunk-YOZPQCSR.js} +6 -6
- package/dist/{chunk-5JMZLQT6.js → chunk-YWHCXIMD.js} +16 -16
- package/dist/{chunk-UVEQLDKB.js → chunk-YWNJTZGN.js} +3 -2
- package/dist/{chunk-WUQUR33W.js → chunk-ZOCHDXDG.js} +1 -1
- package/dist/{chunk-IWTRHPTP.js → chunk-ZRHO6YMM.js} +8 -8
- package/dist/{clean-GJNDVVDI.js → clean-HGASSMWI.js} +41 -40
- package/dist/cli.js +68 -64
- package/dist/{cloud-JCWNMKXC.js → cloud-JPDVNXHN.js} +4 -4
- package/dist/{cloudrun-2BKGY53X.js → cloudrun-AMMGSDRP.js} +8 -8
- package/dist/commands/layout-audit.browser.js +15 -4
- package/dist/commands/motion-signature.browser.js +52 -0
- package/dist/{compare-XWM7FAYM.js → compare-LHHVHUN3.js} +51 -47
- package/dist/{compiler-U3W6CJW7.js → compiler-Q3N6QXMT.js} +6 -6
- package/dist/{component-CBRAE325.js → component-D72J32Q7.js} +4 -4
- package/dist/{compositions-EZYJEHQ3.js → compositions-UQRJ5ROG.js} +29 -29
- package/dist/{contactSheet-27SRU7A4.js → contactSheet-CAGMKI3E.js} +3 -1
- package/dist/{delete-JWWMOITI.js → delete-P42VIDDA.js} +9 -9
- package/dist/{deploy-UGOV76OH.js → deploy-WZTH57O4.js} +11 -11
- package/dist/{destroy-QBLMYDBF.js → destroy-4B5HW5FH.js} +5 -5
- package/dist/{deterministicFonts-L7YEEFGI.js → deterministicFonts-VQ5UBMXY.js} +2 -2
- package/dist/{dist-VO7OXOFK.js → dist-DYS24AMA.js} +5 -5
- package/dist/{dist-2FMTAVGL.js → dist-SENYPQGW.js} +4 -4
- package/dist/{docs-MPOM3PHH.js → docs-UEWLIP6D.js} +1 -1
- package/dist/{doctor-XSKSZRR7.js → doctor-KEJIG2SK.js} +28 -27
- package/dist/{events-RGS4MAH4.js → events-CYKSNR7N.js} +6 -6
- package/dist/{events-AIZODZMP.js → events-UZXFQPMT.js} +9 -9
- package/dist/{feedback-GE3VDZOH.js → feedback-LXNQF7CA.js} +35 -35
- package/dist/{ffmpeg-SCXZTR6X.js → ffmpeg-BYHON577.js} +16 -15
- package/dist/{figma-3R4XST4Y.js → figma-EIQ35PS6.js} +3 -3
- package/dist/fontLocalizeCli.js +24 -23
- package/dist/{get-4FKJP6IM.js → get-CC2YL7QO.js} +9 -9
- package/dist/{gpuPolicy-4NNXESM7.js → gpuPolicy-VFSACUQV.js} +14 -13
- package/dist/{grade-compare-FAYVPXUR.js → grade-compare-TUQL7IV2.js} +56 -50
- package/dist/{help-C3UQMYXK.js → help-ROROO5K6.js} +1 -1
- package/dist/{history-LDGQ2IZJ.js → history-PNELYLXX.js} +15 -15
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +59 -59
- package/dist/hyperframes-player.global.js +8 -3
- package/dist/{info-KMXFLD3Q.js → info-4FZTH6AS.js} +20 -20
- package/dist/{init-D7GYHSX5.js → init-I43GHHVP.js} +69 -68
- package/dist/{inspect-CUKWHCGS.js → inspect-IT4TYIZ3.js} +46 -44
- package/dist/{installer-EPRSH6QI.js → installer-CWOJVK5K.js} +7 -7
- package/dist/{keyframes-XCUPHBW3.js → keyframes-3FBOGVD4.js} +16 -16
- package/dist/{lambda-IMORFJHN.js → lambda-H3V32I7M.js} +15 -15
- package/dist/{layout-JD2IOBMS.js → layout-BZ5LYJ5C.js} +46 -44
- package/dist/{lint-FHLER36Y.js → lint-ZTNSGP2S.js} +23 -23
- package/dist/{lintProject-ARKJXDQF.js → lintProject-C2ONSH2U.js} +4 -4
- package/dist/{list-MGCFG5MA.js → list-XM4GWJYY.js} +10 -10
- package/dist/{login-QX6M4UTR.js → login-H6HYKMWX.js} +7 -7
- package/dist/{logout-DKJANASY.js → logout-DDC4QLVK.js} +3 -3
- package/dist/{manager-IETAVBZS.js → manager-TWVDSJXO.js} +17 -16
- package/dist/{manager-V2QCCPOJ.js → manager-UHWEKPXC.js} +8 -3
- package/dist/{media-treatment-MDAQRITV.js → media-treatment-N7MY5NXB.js} +34 -33
- package/dist/{media-use-4XXGABIL.js → media-use-JBN57JE3.js} +1 -1
- package/dist/{models-NZAOSI5A.js → models-WEMIMYBD.js} +25 -24
- package/dist/{motionShot-6ZDUM2K4.js → motionShot-RHICTVPU.js} +29 -26
- package/dist/{normalize-audio-7PRYX6QM.js → normalize-audio-ZFUZCJE3.js} +12 -12
- package/dist/{open-I254NY5J.js → open-IBJ4FL3G.js} +24 -24
- package/dist/{parakeetRunner-TL3TOGUS.js → parakeetRunner-XXO4WSLR.js} +26 -25
- package/dist/{pipeline-YPERVOQM.js → pipeline-6ML3LUVK.js} +19 -18
- package/dist/{play-MYI7BYKS.js → play-RV4NAVF5.js} +40 -38
- package/dist/{policies-5NTZOHJA.js → policies-XXNGXWHV.js} +1 -1
- package/dist/{preflight-HRCSZ52D.js → preflight-R3DEFMLA.js} +19 -18
- package/dist/{present-WYXQDV4Q.js → present-5TBJGE6B.js} +34 -33
- package/dist/{preview-535HTWQO.js → preview-FLKZ5CXJ.js} +56 -55
- package/dist/{producer-C76CRJ5O.js → producer-7XYSPVKH.js} +1 -1
- package/dist/{progress-I37JB7R4.js → progress-NHJIHAAG.js} +2 -2
- package/dist/{projectConfig-5QCNTGQT.js → projectConfig-TBU2VWZX.js} +9 -9
- package/dist/{publication-2QT7VVE2.js → publication-CWWUJYJ5.js} +5 -5
- package/dist/{publish-53EBL7OO.js → publish-FSNE4FEB.js} +28 -27
- package/dist/{refresh-MGCVWX56.js → refresh-RXTOPRBB.js} +3 -3
- package/dist/{remove-background-OBYHMPD4.js → remove-background-MDFWRWCT.js} +32 -31
- package/dist/render-DBGQZAZT.js +1516 -0
- package/dist/{render-3MELF6Y3.js → render-F4JQ553X.js} +102 -96
- package/dist/{render-75CRB3BW.js → render-LWZKXCLY.js} +8 -8
- package/dist/{render-batch-CEVWUYBP.js → render-batch-PU7NMLIJ.js} +8 -8
- package/dist/renderSetupWorker.js +12 -9
- package/dist/{resolver-4ICE2AT6.js → resolver-RUBGFXPC.js} +7 -7
- package/dist/{screenshotCapture-HXEZ3TNJ.js → screenshotCapture-UBY6TT75.js} +33 -6
- package/dist/{sherpa-L4UACXT3.js → sherpa-X2TBNO6P.js} +25 -24
- package/dist/{sites-3ZBYB5X4.js → sites-MAVH57MO.js} +2 -2
- package/dist/skills/hyperframes/references/review-loop.md +1 -1
- package/dist/{skills-DXTQPCAO.js → skills-WHKMWO2D.js} +17 -17
- package/dist/{skillsUpdateCheck-ULXRGLDU.js → skillsUpdateCheck-XQGZGJJG.js} +3 -3
- package/dist/{snapshot-PWFHQU5E.js → snapshot-M4NUUSNU.js} +73 -71
- package/dist/{src-RDSWHMJS.js → src-4UYM2K3S.js} +34 -26
- package/dist/{src-S7NVL5VF.js → src-6MSC62U2.js} +23 -19
- package/dist/{state-KAXGHF77.js → state-ORRPOLMQ.js} +2 -2
- package/dist/{staticProjectServer-GYPUQGI7.js → staticProjectServer-ERDTFP45.js} +21 -20
- package/dist/{status-BV7QAUQD.js → status-CM7IQTU2.js} +6 -6
- package/dist/studio/assets/{hyperframes-player-DcD3NXpX.js → hyperframes-player-DEncBxR7.js} +7 -2
- package/dist/studio/assets/{index-CFrZAwKo.js → index-BABXr78Q.js} +4 -4
- package/dist/studio/assets/{index-BIDKYk0h.js → index-Cc22mgvY.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-IXGX5ZFI.js → studio-api-SAKD3VKC.js} +18 -17
- package/dist/{studioServer-LA5Z7RSS.js → studioServer-IRI7EVOM.js} +91 -84
- package/dist/{telemetry-STEMAMAX.js → telemetry-F4XADVAF.js} +10 -10
- package/dist/{telemetry-CQYHCCPL.js → telemetry-QG5AANZ4.js} +1 -1
- package/dist/{timeline-KLD24EN6.js → timeline-5I444RRE.js} +42 -41
- package/dist/{tokens-ICLORAA4.js → tokens-LRRYM35A.js} +3 -3
- package/dist/{transcribe-A6IKK7VS.js → transcribe-44XDFNVU.js} +48 -47
- package/dist/{transcribe-CTHZLRXF.js → transcribe-WHYHWAB2.js} +20 -19
- package/dist/{tts-EDK3QS7M.js → tts-A2WILYGN.js} +6 -6
- package/dist/{updateCheck-FHCAAAXA.js → updateCheck-7CPH3CAZ.js} +2 -2
- package/dist/{upgrade-7EV4F2R7.js → upgrade-WW4GQ2RI.js} +3 -3
- package/dist/{urlDownloader-MIMGVASJ.js → urlDownloader-OHLLP45A.js} +13 -12
- package/dist/{validate-LZF46W3V.js → validate-VNCDH2LW.js} +40 -38
- package/dist/{video-ZC47NFOL.js → video-5OHTLL2D.js} +17 -14
- package/dist/warmCheck.js +228 -0
- package/dist/warmCheckClient.js +139 -0
- package/package.json +4 -2
- package/dist/chunk-BAZ5LCR3.js +0 -3805
- package/dist/hyperframe-runtime.js +0 -1125
- package/dist/render-5BXTEEG7.js +0 -719
- package/dist/{synthesize-I2C24XJ5.js → synthesize-PKTB5ATG.js} +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
|
|
8
|
+
// ../parsers/dist/mediaAlpha.js
|
|
9
|
+
var ALPHA_PIX_FMT_RE = /^(?:yuva|rgba|argb|bgra|abgr|gbrap|ya|ayuv)/i;
|
|
10
|
+
function pixelFormatHasAlpha(pixFmt) {
|
|
11
|
+
return pixFmt !== void 0 && ALPHA_PIX_FMT_RE.test(pixFmt);
|
|
12
|
+
}
|
|
13
|
+
function videoStreamHasAlpha(stream) {
|
|
14
|
+
if (pixelFormatHasAlpha(stream.pix_fmt)) return true;
|
|
15
|
+
return Object.entries(stream.tags ?? {}).some(
|
|
16
|
+
([key, value]) => key.toLowerCase() === "alpha_mode" && value === "1"
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function alphaDecoderFor(codecName) {
|
|
20
|
+
const codec = codecName?.toLowerCase();
|
|
21
|
+
if (codec === "vp9") return "libvpx-vp9";
|
|
22
|
+
if (codec === "vp8") return "libvpx";
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
videoStreamHasAlpha,
|
|
28
|
+
alphaDecoderFor
|
|
29
|
+
};
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
forceRefreshCredentials,
|
|
13
13
|
resolveCloudAuthHeaders,
|
|
14
14
|
resolveCloudBaseUrl
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HRPWRZGF.js";
|
|
16
16
|
import {
|
|
17
17
|
errorBox
|
|
18
18
|
} from "./chunk-K2FLNJVB.js";
|
|
19
19
|
import {
|
|
20
20
|
failCommand
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JVBRJMOP.js";
|
|
22
22
|
|
|
23
23
|
// src/cloud/poll.ts
|
|
24
24
|
var DEFAULT_POLL_INTERVAL_MS = 2e3;
|
|
@@ -112,12 +112,18 @@ function wrapWith401Retry(client) {
|
|
|
112
112
|
|
|
113
113
|
// src/cloud/errors.ts
|
|
114
114
|
var ERROR_CODE_HINTS = {
|
|
115
|
-
hyperframes_project_too_large: "The zip exceeded the 200 MB limit. Run `hyperframes cloud render --dry-run
|
|
115
|
+
hyperframes_project_too_large: "The zip exceeded the 200 MB limit. Run `hyperframes cloud render --dry-run` to see what stays in it, then add only verified-unneeded paths to `.hyperframesignore`.",
|
|
116
116
|
hyperframes_render_not_found: "The render_id no longer exists \u2014 either soft-deleted or never created.",
|
|
117
117
|
invalid_parameter: "Check the listed parameter against `hyperframes cloud render --help` for the accepted values.",
|
|
118
118
|
authentication_failed: "Run `hyperframes auth status` to confirm your credential; `hyperframes auth login` to re-auth.",
|
|
119
119
|
rate_limit_exceeded: "Retry after the duration in the Retry-After header."
|
|
120
120
|
};
|
|
121
|
+
function hintCode(err) {
|
|
122
|
+
if (err.code === "invalid_parameter" && /^File too large\b/.test(err.message)) {
|
|
123
|
+
return "hyperframes_project_too_large";
|
|
124
|
+
}
|
|
125
|
+
return err.code;
|
|
126
|
+
}
|
|
121
127
|
function reportApiError(stage, err, options = {}) {
|
|
122
128
|
const hints = { ...ERROR_CODE_HINTS, ...options.extraHints };
|
|
123
129
|
if (err instanceof HyperframesApiError) {
|
|
@@ -125,7 +131,8 @@ function reportApiError(stage, err, options = {}) {
|
|
|
125
131
|
errorBox("Not found", options.notFound);
|
|
126
132
|
failCommand();
|
|
127
133
|
}
|
|
128
|
-
const
|
|
134
|
+
const code = hintCode(err);
|
|
135
|
+
const hint = code ? hints[code] : void 0;
|
|
129
136
|
const title = `${stage} (HTTP ${err.status})`;
|
|
130
137
|
if (hint) {
|
|
131
138
|
errorBox(title, err.message, hint);
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
parseStrictFiniteTimingNumber,
|
|
10
10
|
resolveNaturalMediaTimelineDuration,
|
|
11
11
|
resolveTimedImageDurationSeconds
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-R2SQBPMH.js";
|
|
13
13
|
import {
|
|
14
14
|
CANVAS_DIMENSIONS,
|
|
15
15
|
isCompositionElement,
|
|
@@ -20,12 +20,14 @@ import {
|
|
|
20
20
|
} from "./chunk-YMS5FOMC.js";
|
|
21
21
|
import {
|
|
22
22
|
COMPOSITION_ATTRIBUTES,
|
|
23
|
+
MEDIA_START_BASIS_ATTR,
|
|
24
|
+
compositionOriginSeconds,
|
|
25
|
+
hostInPointSeconds,
|
|
26
|
+
isRootGlobalMediaStart,
|
|
23
27
|
parseStartExpression,
|
|
28
|
+
resolveMediaStartSeconds,
|
|
24
29
|
sameInstant
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import {
|
|
27
|
-
readMediaOffsetSeconds
|
|
28
|
-
} from "./chunk-BSQ7XANM.js";
|
|
30
|
+
} from "./chunk-MMQ52NIZ.js";
|
|
29
31
|
import {
|
|
30
32
|
parseHTML
|
|
31
33
|
} from "./chunk-SDYDNHEE.js";
|
|
@@ -1199,8 +1201,8 @@ function parsePreviewProxyBox(raw) {
|
|
|
1199
1201
|
}
|
|
1200
1202
|
|
|
1201
1203
|
// ../core/dist/inline-scripts/hyperframesRuntime.engine.js
|
|
1202
|
-
import { buildSync } from "esbuild";
|
|
1203
1204
|
import { existsSync } from "fs";
|
|
1205
|
+
import { createRequire } from "module";
|
|
1204
1206
|
import { dirname, resolve } from "path";
|
|
1205
1207
|
import { fileURLToPath } from "url";
|
|
1206
1208
|
function applyDefaultParityMode(script, enabled) {
|
|
@@ -1213,6 +1215,7 @@ function buildHyperframesRuntimeScript(options = {}) {
|
|
|
1213
1215
|
const entryPath = resolve(dirname(fileURLToPath(import.meta.url)), "../runtime/entry.ts");
|
|
1214
1216
|
if (!existsSync(entryPath))
|
|
1215
1217
|
return null;
|
|
1218
|
+
const { buildSync } = createRequire(import.meta.url)("esbuild");
|
|
1216
1219
|
const result = buildSync({
|
|
1217
1220
|
entryPoints: [entryPath],
|
|
1218
1221
|
bundle: true,
|
|
@@ -4421,42 +4424,6 @@ function readTimelineDurationSeconds(timeline) {
|
|
|
4421
4424
|
}
|
|
4422
4425
|
}
|
|
4423
4426
|
|
|
4424
|
-
// ../core/dist/mediaTiming.js
|
|
4425
|
-
var MEDIA_START_BASIS_ATTR = "data-hf-media-start-basis";
|
|
4426
|
-
function readMediaStartBasis(value) {
|
|
4427
|
-
return value?.trim().toLowerCase() === "global" ? "global" : "local";
|
|
4428
|
-
}
|
|
4429
|
-
function resolveAbsoluteMediaStartSeconds(input) {
|
|
4430
|
-
return readMediaStartBasis(input.basis) === "global" ? input.authoredStart : input.hostStart + input.authoredStart;
|
|
4431
|
-
}
|
|
4432
|
-
function resolveMediaStartSeconds(input) {
|
|
4433
|
-
if (!hasLiteralNestedStart(input))
|
|
4434
|
-
return input.ordinaryStart();
|
|
4435
|
-
return resolveAbsoluteMediaStartSeconds({
|
|
4436
|
-
authoredStart: input.authoredStart,
|
|
4437
|
-
hostStart: input.hostStart,
|
|
4438
|
-
basis: input.basis
|
|
4439
|
-
});
|
|
4440
|
-
}
|
|
4441
|
-
function isRootGlobalMediaStart(input) {
|
|
4442
|
-
return hasLiteralNestedStart(input) && readMediaStartBasis(input.basis) === "global";
|
|
4443
|
-
}
|
|
4444
|
-
function hasLiteralNestedStart(input) {
|
|
4445
|
-
return !input.hasAutoStart && input.authoredStart != null && input.hostStart !== 0;
|
|
4446
|
-
}
|
|
4447
|
-
function hostInPointSeconds(host) {
|
|
4448
|
-
return readMediaOffsetSeconds((name) => host.getAttribute(name));
|
|
4449
|
-
}
|
|
4450
|
-
function compositionOriginSeconds(hostStart, host) {
|
|
4451
|
-
return hostStart - hostInPointSeconds(host);
|
|
4452
|
-
}
|
|
4453
|
-
function cutToHostSlots(span, hosts) {
|
|
4454
|
-
return hosts.reduce((kept, host) => {
|
|
4455
|
-
const start = Math.max(kept.start, host.start);
|
|
4456
|
-
return { start, end: Math.max(start, Math.min(kept.end, host.end)) };
|
|
4457
|
-
}, span);
|
|
4458
|
-
}
|
|
4459
|
-
|
|
4460
4427
|
// ../core/dist/runtime/startResolver.js
|
|
4461
4428
|
function createRuntimeStartTimeResolver(params) {
|
|
4462
4429
|
const timelineRegistry = params.timelineRegistry ?? {};
|
|
@@ -5595,13 +5562,6 @@ export {
|
|
|
5595
5562
|
createGSAPFrameAdapter,
|
|
5596
5563
|
fitTextFontSize,
|
|
5597
5564
|
formatRenderOutputTimestamp,
|
|
5598
|
-
MEDIA_START_BASIS_ATTR,
|
|
5599
|
-
readMediaStartBasis,
|
|
5600
|
-
resolveAbsoluteMediaStartSeconds,
|
|
5601
|
-
resolveMediaStartSeconds,
|
|
5602
|
-
hostInPointSeconds,
|
|
5603
|
-
compositionOriginSeconds,
|
|
5604
|
-
cutToHostSlots,
|
|
5605
5565
|
createRuntimeStartTimeResolver,
|
|
5606
5566
|
byStart,
|
|
5607
5567
|
hasClipStarted,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-K2FLNJVB.js";
|
|
10
10
|
import {
|
|
11
11
|
failCommand
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JVBRJMOP.js";
|
|
13
13
|
import {
|
|
14
14
|
cssVariableName,
|
|
15
15
|
slugify
|
|
@@ -1278,7 +1278,7 @@ async function withFigmaErrors(command, fn) {
|
|
|
1278
1278
|
} catch (err) {
|
|
1279
1279
|
if (err instanceof Error) {
|
|
1280
1280
|
try {
|
|
1281
|
-
const { trackCommandFailure } = await import("./events-
|
|
1281
|
+
const { trackCommandFailure } = await import("./events-UZXFQPMT.js");
|
|
1282
1282
|
trackCommandFailure(
|
|
1283
1283
|
command,
|
|
1284
1284
|
err,
|
|
@@ -8,19 +8,19 @@ import {
|
|
|
8
8
|
flush,
|
|
9
9
|
shouldTrack,
|
|
10
10
|
trackEvent
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UKOTVJFV.js";
|
|
12
|
+
import {
|
|
13
|
+
CliRuntimeError
|
|
14
|
+
} from "./chunk-JVBRJMOP.js";
|
|
15
|
+
import {
|
|
16
|
+
redactTelemetryString
|
|
17
|
+
} from "./chunk-634HSJ3J.js";
|
|
12
18
|
import {
|
|
13
19
|
getPowerState
|
|
14
20
|
} from "./chunk-T6AGUTZJ.js";
|
|
15
|
-
import {
|
|
16
|
-
CliRuntimeError
|
|
17
|
-
} from "./chunk-PBN6GBJE.js";
|
|
18
21
|
import {
|
|
19
22
|
readConfig
|
|
20
23
|
} from "./chunk-XUXGIA7H.js";
|
|
21
|
-
import {
|
|
22
|
-
redactTelemetryString
|
|
23
|
-
} from "./chunk-634HSJ3J.js";
|
|
24
24
|
|
|
25
25
|
// src/utils/feedbackRating.ts
|
|
26
26
|
var FEEDBACK_RATING_SCALE = 10;
|
|
@@ -80,6 +80,10 @@ function registerRootExitCodeSanitizer(sanitizer) {
|
|
|
80
80
|
function sanitizeSuccessfulExitCode() {
|
|
81
81
|
rootExitCodeSanitizer?.();
|
|
82
82
|
}
|
|
83
|
+
async function outputWritten() {
|
|
84
|
+
const written = (stream) => new Promise((resolve) => stream.write("", () => resolve()));
|
|
85
|
+
await Promise.all([written(process.stdout), written(process.stderr)]);
|
|
86
|
+
}
|
|
83
87
|
function requestCliExit(exitCode = 0) {
|
|
84
88
|
if (!rootExitRequester) {
|
|
85
89
|
setCommandResult({
|
|
@@ -91,6 +95,13 @@ function requestCliExit(exitCode = 0) {
|
|
|
91
95
|
}
|
|
92
96
|
rootExitRequester(exitCode);
|
|
93
97
|
}
|
|
98
|
+
function isUnrefableTimer(timer) {
|
|
99
|
+
return typeof timer === "object" && timer !== null && "unref" in timer && typeof timer.unref === "function";
|
|
100
|
+
}
|
|
101
|
+
function scheduleCliExit(exitCode = 0) {
|
|
102
|
+
const timer = setTimeout(() => requestCliExit(exitCode), 100);
|
|
103
|
+
if (isUnrefableTimer(timer)) timer.unref();
|
|
104
|
+
}
|
|
94
105
|
|
|
95
106
|
export {
|
|
96
107
|
CliUsageError,
|
|
@@ -104,5 +115,7 @@ export {
|
|
|
104
115
|
registerRootExitRequester,
|
|
105
116
|
registerRootExitCodeSanitizer,
|
|
106
117
|
sanitizeSuccessfulExitCode,
|
|
107
|
-
|
|
118
|
+
outputWritten,
|
|
119
|
+
requestCliExit,
|
|
120
|
+
scheduleCliExit
|
|
108
121
|
};
|
|
@@ -9,18 +9,15 @@ import {
|
|
|
9
9
|
isOneProcessOverPipe,
|
|
10
10
|
machServiceDenied,
|
|
11
11
|
oneProcessOverPipe,
|
|
12
|
+
pipeLaunchClosedOnMac,
|
|
12
13
|
sandboxDeniedRemediation
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DKPNNYBZ.js";
|
|
14
15
|
import {
|
|
15
16
|
resolveCaptureBrowserGpuMode
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import {
|
|
18
|
-
isNavigationTimeoutError,
|
|
19
|
-
withRemainingBudget
|
|
20
|
-
} from "./chunk-RGHQID2E.js";
|
|
17
|
+
} from "./chunk-UNNXFKVG.js";
|
|
21
18
|
import {
|
|
22
19
|
requestCliExit
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-JVBRJMOP.js";
|
|
24
21
|
import {
|
|
25
22
|
normalizeErrorMessage
|
|
26
23
|
} from "./chunk-KNU5COPB.js";
|
|
@@ -28,11 +25,61 @@ import {
|
|
|
28
25
|
processIsAlive
|
|
29
26
|
} from "./chunk-KGPLIH7B.js";
|
|
30
27
|
|
|
28
|
+
// src/browser/windowsChromeWatchdog.ts
|
|
29
|
+
import { spawn } from "child_process";
|
|
30
|
+
import { realpathSync } from "fs";
|
|
31
|
+
var SWEEP = `$b=[int]$env:HF_CHROME_PID; $x=$env:HF_CHROME_EXE; $t=[DateTimeOffset]::FromUnixTimeMilliseconds([int64]$env:HF_CHROME_SINCE).UtcDateTime; Get-CimInstance Win32_Process | Where-Object { ($_.ProcessId -eq $b -or $_.ParentProcessId -eq $b) -and $_.ExecutablePath -eq $x -and $_.CreationDate.ToUniversalTime() -ge $t } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }`;
|
|
32
|
+
var WATCHDOG = `let clean = false;
|
|
33
|
+
const done = () => {
|
|
34
|
+
if (!clean) require("node:child_process").spawnSync("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", ${JSON.stringify(SWEEP)}], { windowsHide: true, timeout: 20000 });
|
|
35
|
+
process.exit(0);
|
|
36
|
+
};
|
|
37
|
+
process.stdin.on("data", (data) => { clean ||= String(data).includes("clean"); });
|
|
38
|
+
process.stdin.on("end", done);
|
|
39
|
+
process.stdin.on("error", done);`;
|
|
40
|
+
function executableOf(chrome) {
|
|
41
|
+
try {
|
|
42
|
+
return realpathSync.native(chrome.spawnfile);
|
|
43
|
+
} catch {
|
|
44
|
+
return void 0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function watchChromeTree(chrome, launchedAt) {
|
|
48
|
+
const executable = process.platform === "win32" ? executableOf(chrome) : void 0;
|
|
49
|
+
if (!executable || chrome.pid === void 0) return void 0;
|
|
50
|
+
const watchdog = spawn(process.execPath, ["-e", WATCHDOG], {
|
|
51
|
+
detached: true,
|
|
52
|
+
env: {
|
|
53
|
+
...process.env,
|
|
54
|
+
HF_CHROME_PID: String(chrome.pid),
|
|
55
|
+
HF_CHROME_EXE: executable,
|
|
56
|
+
HF_CHROME_SINCE: String(launchedAt)
|
|
57
|
+
},
|
|
58
|
+
stdio: ["pipe", "ignore", "ignore"],
|
|
59
|
+
windowsHide: true
|
|
60
|
+
});
|
|
61
|
+
watchdog.on("error", () => {
|
|
62
|
+
});
|
|
63
|
+
watchdog.stdin?.on("error", () => {
|
|
64
|
+
});
|
|
65
|
+
watchdog.unref();
|
|
66
|
+
watchdog.stdin?.unref?.();
|
|
67
|
+
let released = false;
|
|
68
|
+
return {
|
|
69
|
+
release(clean) {
|
|
70
|
+
if (released) return;
|
|
71
|
+
released = true;
|
|
72
|
+
watchdog.stdin?.end(clean ? "clean" : "");
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
31
77
|
// src/browser/launch.ts
|
|
32
78
|
var BrowserCleanupError = class extends AggregateError {
|
|
33
79
|
};
|
|
34
80
|
var browsers = /* @__PURE__ */ new Set();
|
|
35
81
|
var closing = /* @__PURE__ */ new WeakMap();
|
|
82
|
+
var watchdogs = /* @__PURE__ */ new WeakMap();
|
|
36
83
|
var pending = /* @__PURE__ */ new Map();
|
|
37
84
|
var sessionCleanups = /* @__PURE__ */ new Set();
|
|
38
85
|
var CLOSE_GRACE_MS = 1e3;
|
|
@@ -83,7 +130,7 @@ async function launchManagedBrowser(puppeteer, options) {
|
|
|
83
130
|
try {
|
|
84
131
|
return await launchOwnedBrowser(puppeteer, sandboxed ? oneProcessOverPipe(options) : options);
|
|
85
132
|
} catch (error) {
|
|
86
|
-
const unnamedSeatbelt = !sandboxed && machServiceDenied(normalizeErrorMessage(error));
|
|
133
|
+
const unnamedSeatbelt = !sandboxed && (machServiceDenied(normalizeErrorMessage(error)) || pipeLaunchClosedOnMac(error));
|
|
87
134
|
if (!unnamedSeatbelt) throw withRemediation(error);
|
|
88
135
|
return launchOwnedBrowser(puppeteer, oneProcessOverPipe(options)).catch(
|
|
89
136
|
(retryError) => {
|
|
@@ -101,8 +148,9 @@ async function launchOwnedBrowser(puppeteer, options) {
|
|
|
101
148
|
ownSignals();
|
|
102
149
|
const abort = new AbortController();
|
|
103
150
|
const signal = options.signal ? AbortSignal.any([options.signal, abort.signal]) : abort.signal;
|
|
151
|
+
const launchedAt = Date.now();
|
|
104
152
|
const launch = untilLaunchOrAbort(
|
|
105
|
-
puppeteer.launch({ ...options, signal, handleSIGINT: false, handleSIGTERM: false }),
|
|
153
|
+
puppeteer.launch({ ...options, pipe: true, signal, handleSIGINT: false, handleSIGTERM: false }),
|
|
106
154
|
signal
|
|
107
155
|
);
|
|
108
156
|
const limit = options.timeout ?? LAUNCH_TIMEOUT_MS;
|
|
@@ -116,6 +164,8 @@ async function launchOwnedBrowser(puppeteer, options) {
|
|
|
116
164
|
const child = browser.process();
|
|
117
165
|
if (!child) throw new Error("A launched browser has no owned process.");
|
|
118
166
|
browsers.add(browser);
|
|
167
|
+
const watchdog = watchChromeTree(child, launchedAt);
|
|
168
|
+
if (watchdog) watchdogs.set(browser, watchdog);
|
|
119
169
|
child.once("exit", () => browsers.delete(browser));
|
|
120
170
|
return browser;
|
|
121
171
|
} finally {
|
|
@@ -166,9 +216,17 @@ async function rethrowAfterBrowserCleanup(browser, error) {
|
|
|
166
216
|
throw error;
|
|
167
217
|
}
|
|
168
218
|
async function closeBrowser(browser) {
|
|
219
|
+
let clean = false;
|
|
220
|
+
try {
|
|
221
|
+
clean = await closedWithoutKill(browser);
|
|
222
|
+
} finally {
|
|
223
|
+
watchdogs.get(browser)?.release(clean);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
async function closedWithoutKill(browser) {
|
|
169
227
|
const child = browser.process();
|
|
170
228
|
if (!child) throw new Error("A managed browser lost its owned process.");
|
|
171
|
-
if (child.exitCode !== null || child.signalCode !== null) return;
|
|
229
|
+
if (child.exitCode !== null || child.signalCode !== null) return false;
|
|
172
230
|
const exited = new Promise((resolve) => child.once("exit", () => resolve()));
|
|
173
231
|
let timer;
|
|
174
232
|
let poll;
|
|
@@ -180,7 +238,8 @@ async function closeBrowser(browser) {
|
|
|
180
238
|
browser.close().catch((error) => console.warn("Browser close failed:", error)),
|
|
181
239
|
grace
|
|
182
240
|
]);
|
|
183
|
-
|
|
241
|
+
const clean = child.exitCode !== null || child.signalCode !== null;
|
|
242
|
+
if (!clean) child.kill("SIGKILL");
|
|
184
243
|
clearTimeout(timer);
|
|
185
244
|
const exitLimit = new Promise((_, reject) => {
|
|
186
245
|
timer = setTimeout(
|
|
@@ -194,145 +253,18 @@ async function closeBrowser(browser) {
|
|
|
194
253
|
}, EXIT_POLL_MS);
|
|
195
254
|
});
|
|
196
255
|
await Promise.race([exited, goneBeforeExitEvent, exitLimit]);
|
|
256
|
+
return clean;
|
|
197
257
|
} finally {
|
|
198
258
|
clearTimeout(timer);
|
|
199
259
|
clearInterval(poll);
|
|
200
260
|
}
|
|
201
261
|
}
|
|
202
262
|
|
|
203
|
-
// src/capture/navigateForCapture.ts
|
|
204
|
-
import { TimeoutError } from "puppeteer-core";
|
|
205
|
-
var NETWORK_IDLE_ATTEMPT_MS = 3e4;
|
|
206
|
-
function networkIdleAttemptTimeoutMs(totalTimeoutMs) {
|
|
207
|
-
return Math.min(NETWORK_IDLE_ATTEMPT_MS, Math.max(0, totalTimeoutMs));
|
|
208
|
-
}
|
|
209
|
-
async function navigateForCapture(page, url, totalTimeoutMs) {
|
|
210
|
-
const networkIdleTimeoutMs = networkIdleAttemptTimeoutMs(totalTimeoutMs);
|
|
211
|
-
try {
|
|
212
|
-
const response2 = await page.goto(url, {
|
|
213
|
-
waitUntil: "networkidle2",
|
|
214
|
-
timeout: networkIdleTimeoutMs
|
|
215
|
-
});
|
|
216
|
-
return {
|
|
217
|
-
response: response2,
|
|
218
|
-
waitUntil: "networkidle2",
|
|
219
|
-
networkIdleTimeoutMs,
|
|
220
|
-
fellBackFromNetworkIdle: false
|
|
221
|
-
};
|
|
222
|
-
} catch (err) {
|
|
223
|
-
if (!isNavigationTimeoutError(err) || networkIdleTimeoutMs >= totalTimeoutMs) {
|
|
224
|
-
throw err;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
const fallbackTimeoutMs = totalTimeoutMs - networkIdleTimeoutMs;
|
|
228
|
-
const response = await page.goto(url, {
|
|
229
|
-
waitUntil: "domcontentloaded",
|
|
230
|
-
timeout: fallbackTimeoutMs
|
|
231
|
-
});
|
|
232
|
-
return {
|
|
233
|
-
response,
|
|
234
|
-
waitUntil: "domcontentloaded",
|
|
235
|
-
networkIdleTimeoutMs,
|
|
236
|
-
fellBackFromNetworkIdle: true
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
var PUPPETEER_LAUNCH_DEFAULT_TIMEOUT_MS = 3e4;
|
|
240
|
-
var PAGE_LOAD_BLOCKING_TYPES = /* @__PURE__ */ new Set(["Document", "Script", "Stylesheet"]);
|
|
241
|
-
var NAMED_BLOCKING_REQUESTS = 3;
|
|
242
|
-
var SENT_OR_ANSWERED_WITHOUT_NETWORK = [
|
|
243
|
-
"Network.requestWillBeSentExtraInfo",
|
|
244
|
-
"Network.responseReceived"
|
|
245
|
-
];
|
|
246
|
-
async function gotoWhenSent(page, url, timeoutMs, coldChromeFirstRequestTimeoutMs = PUPPETEER_LAUNCH_DEFAULT_TIMEOUT_MS) {
|
|
247
|
-
const cdp = await page.createCDPSession();
|
|
248
|
-
try {
|
|
249
|
-
await cdp.send("Network.enable");
|
|
250
|
-
const sent = documentRequestSent(cdp);
|
|
251
|
-
const unfinished = unfinishedPageLoadRequests(cdp);
|
|
252
|
-
const navigation = page.goto(url, { waitUntil: "domcontentloaded", timeout: 0 });
|
|
253
|
-
const navigationAwaitedBelow = navigation.catch(() => void 0);
|
|
254
|
-
await withRemainingBudget(
|
|
255
|
-
Promise.race([sent, navigationAwaitedBelow]),
|
|
256
|
-
coldChromeFirstRequestTimeoutMs,
|
|
257
|
-
"sending the page request",
|
|
258
|
-
() => new TimeoutError(
|
|
259
|
-
`Navigation timeout: Chrome did not send the page request within ${coldChromeFirstRequestTimeoutMs} ms`
|
|
260
|
-
)
|
|
261
|
-
);
|
|
262
|
-
return await withRemainingBudget(
|
|
263
|
-
navigation,
|
|
264
|
-
timeoutMs,
|
|
265
|
-
"loading the page",
|
|
266
|
-
() => new TimeoutError(pageLoadTimeoutMessage(timeoutMs, url, unfinished()))
|
|
267
|
-
);
|
|
268
|
-
} finally {
|
|
269
|
-
await cdp.detach().catch(() => void 0);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
function documentRequestSent(cdp) {
|
|
273
|
-
const documents = /* @__PURE__ */ new Set();
|
|
274
|
-
const sent = /* @__PURE__ */ new Set();
|
|
275
|
-
return new Promise((resolve) => {
|
|
276
|
-
const settle = (requestId) => {
|
|
277
|
-
if (documents.has(requestId) && sent.has(requestId)) resolve();
|
|
278
|
-
};
|
|
279
|
-
cdp.on("Network.requestWillBeSent", ({ requestId, type }) => {
|
|
280
|
-
if (type === "Document") documents.add(requestId);
|
|
281
|
-
settle(requestId);
|
|
282
|
-
});
|
|
283
|
-
for (const event of SENT_OR_ANSWERED_WITHOUT_NETWORK) {
|
|
284
|
-
cdp.on(event, ({ requestId }) => {
|
|
285
|
-
sent.add(requestId);
|
|
286
|
-
settle(requestId);
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
function unfinishedPageLoadRequests(cdp) {
|
|
292
|
-
const unfinished = /* @__PURE__ */ new Map();
|
|
293
|
-
cdp.on("Network.requestWillBeSent", ({ requestId, request, type }) => {
|
|
294
|
-
if (type && PAGE_LOAD_BLOCKING_TYPES.has(type)) unfinished.set(requestId, request.url);
|
|
295
|
-
});
|
|
296
|
-
for (const event of ["Network.loadingFinished", "Network.loadingFailed"]) {
|
|
297
|
-
cdp.on(event, ({ requestId }) => unfinished.delete(requestId));
|
|
298
|
-
}
|
|
299
|
-
return () => [...unfinished.values()];
|
|
300
|
-
}
|
|
301
|
-
function urlWithoutSecrets(raw) {
|
|
302
|
-
try {
|
|
303
|
-
const url = new URL(raw);
|
|
304
|
-
if (url.protocol !== "http:" && url.protocol !== "https:") return `${url.protocol}\u2026`;
|
|
305
|
-
return `${url.origin}${url.pathname}${url.search ? "?\u2026" : ""}`;
|
|
306
|
-
} catch {
|
|
307
|
-
return "(unreadable URL)";
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
function originOf(raw) {
|
|
311
|
-
try {
|
|
312
|
-
return new URL(raw).origin;
|
|
313
|
-
} catch {
|
|
314
|
-
return null;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
function pageLoadTimeoutMessage(timeoutMs, pageUrl, waitingOn) {
|
|
318
|
-
const exceeded = `Navigation timeout of ${timeoutMs} ms exceeded`;
|
|
319
|
-
if (waitingOn.length === 0) return exceeded;
|
|
320
|
-
const named = waitingOn.slice(0, NAMED_BLOCKING_REQUESTS).map(urlWithoutSecrets).join(", ");
|
|
321
|
-
const unnamed = waitingOn.length - NAMED_BLOCKING_REQUESTS;
|
|
322
|
-
const more = unnamed > 0 ? ` and ${unnamed} more` : "";
|
|
323
|
-
const pageOrigin = new URL(pageUrl).origin;
|
|
324
|
-
const fromAnotherServer = waitingOn.some((request) => originOf(request) !== pageOrigin);
|
|
325
|
-
const advice = fromAnotherServer ? " A <script> or stylesheet from another server holds the page until it arrives; serve it from the project instead." : "";
|
|
326
|
-
return `${exceeded} while the page was still loading ${named}${more}.${advice}`;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
263
|
export {
|
|
330
264
|
BrowserCleanupError,
|
|
331
265
|
resolveManagedGpuMode,
|
|
332
266
|
launchManagedBrowser,
|
|
333
267
|
registerBrowserSessionCleanup,
|
|
334
268
|
closeManagedBrowser,
|
|
335
|
-
rethrowAfterBrowserCleanup
|
|
336
|
-
navigateForCapture,
|
|
337
|
-
gotoWhenSent
|
|
269
|
+
rethrowAfterBrowserCleanup
|
|
338
270
|
};
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
DEFAULT_REGISTRY_URL,
|
|
9
9
|
fetchItemFile,
|
|
10
10
|
validRegistryItem
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7MB2ZAQF.js";
|
|
12
12
|
import {
|
|
13
13
|
publishRegistryFile,
|
|
14
14
|
registryTargetPath
|
|
15
15
|
} from "./chunk-GMECXFAN.js";
|
|
16
16
|
import {
|
|
17
17
|
validateVariables
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-J3QM7AHP.js";
|
|
19
19
|
import {
|
|
20
20
|
realProjectRoot
|
|
21
21
|
} from "./chunk-OFQWTKPW.js";
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
} from "./chunk-K2FLNJVB.js";
|
|
10
10
|
import {
|
|
11
11
|
trackCommandFailure
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JIUTXKWA.js";
|
|
13
13
|
import {
|
|
14
14
|
failCommand
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JVBRJMOP.js";
|
|
16
16
|
|
|
17
17
|
// src/utils/project.ts
|
|
18
18
|
import { existsSync, statSync } from "fs";
|