hyperframes 0.8.143 → 0.8.145
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 +3 -2
- package/dist/{add-Q5EYDUAY.js → add-B6OUH46W.js} +12 -12
- package/dist/{animatedGifPrep-H2DUQEZ3.js → animatedGifPrep-MIWRDJIO.js} +7 -7
- package/dist/{asset-C7JBYYX4.js → asset-XJ2B2PU3.js} +2 -2
- package/dist/{assetCataloger-FRO4G6OU.js → assetCataloger-A5ZLSCMZ.js} +3 -3
- package/dist/{auth-FRWLCO36.js → auth-5HOVCZMV.js} +1 -1
- package/dist/{autoUpdate-E4OZXQK6.js → autoUpdate-WVNL5K3D.js} +2 -2
- package/dist/{backgroundChecks-FSUVHN5L.js → backgroundChecks-IGF54SFH.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-4U73BYTU.js → batchRender-T6JEGCQV.js} +4 -4
- package/dist/{beats-U6KJWF35.js → beats-37T6Y6QP.js} +13 -13
- package/dist/{benchmark-5ONT7V7B.js → benchmark-ZVVLOWPP.js} +9 -9
- package/dist/{browser-R4DU46IE.js → browser-4SSJOLH4.js} +39 -55
- package/dist/{bundleWithLocalizedFonts-VH55VOAL.js → bundleWithLocalizedFonts-XWK423QP.js} +2 -2
- package/dist/{capture-OGQAEYKO.js → capture-2SF7YP57.js} +2 -2
- package/dist/{capture-26G2DPSI.js → capture-KZXOPBMO.js} +18 -18
- package/dist/{catalog-RKORTIUE.js → catalog-NLD4A2C6.js} +12 -12
- package/dist/{catch-up-4OBERRQO.js → catch-up-4BSRN6IR.js} +4 -4
- package/dist/{check-P2XDN57S.js → check-IA44QQWM.js} +66 -55
- package/dist/{checkBrowser-NTGJGAEA.js → checkBrowser-VM35KZMW.js} +81 -30
- package/dist/{chunk-LVX6NK36.js → chunk-3IBMBNYY.js} +1 -1
- package/dist/{chunk-6XMFEICO.js → chunk-3KU3PFDW.js} +77 -92
- package/dist/{chunk-PJU63L6W.js → chunk-4ORLNTET.js} +1 -1
- package/dist/{chunk-DF2BHILQ.js → chunk-4QWD6JYN.js} +3 -3
- package/dist/{chunk-BT27OYYX.js → chunk-5NRXZGKK.js} +18 -12
- package/dist/{chunk-UM2GRYM3.js → chunk-5WVW7P23.js} +3 -3
- package/dist/{chunk-I7QGQAZM.js → chunk-6LGNTUZN.js} +7 -7
- package/dist/{chunk-LAOCA3MQ.js → chunk-A4Q7W4LV.js} +13 -8
- package/dist/{chunk-4PFZPP2N.js → chunk-A6S35NYA.js} +54 -16
- package/dist/{chunk-QRKLPWEX.js → chunk-ADF3X6GM.js} +11 -2
- package/dist/chunk-AUWHD7RA.js +3753 -0
- package/dist/{chunk-W35EKBS6.js → chunk-BFACGEII.js} +2 -2
- package/dist/{chunk-HW4AKJ5F.js → chunk-BIAC7IJT.js} +1 -1
- package/dist/{chunk-ZLW2V65P.js → chunk-BSQ7XANM.js} +3 -2
- package/dist/{chunk-LCSMOLGX.js → chunk-BYSBRF24.js} +69 -8
- package/dist/{chunk-2LBBHMKT.js → chunk-CFUXNBWH.js} +1 -1
- package/dist/{chunk-BFDJ63J5.js → chunk-DDIVWXN7.js} +1 -1
- package/dist/{chunk-KOEWEFHK.js → chunk-DIRJ322I.js} +10 -5
- package/dist/{chunk-FVYXDXEV.js → chunk-DWUKJQTO.js} +2 -2
- package/dist/{chunk-POLR33RB.js → chunk-EPE2HRJK.js} +15 -17
- package/dist/{chunk-UICWP23D.js → chunk-FBCULCAL.js} +3 -3
- package/dist/{chunk-F26LCYRY.js → chunk-FDT6KQV4.js} +142 -81
- package/dist/{chunk-P7THMINS.js → chunk-FXJJCPPB.js} +1 -1
- package/dist/{chunk-BYK73CR7.js → chunk-GBGJ7A3D.js} +5 -5
- package/dist/{sherpa-LVIUEAGF.js → chunk-GEMJYBRU.js} +11 -45
- package/dist/{chunk-KO5QBV73.js → chunk-GMAJB2P6.js} +1 -1
- package/dist/{chunk-KQLGTGE5.js → chunk-GRY3PN3K.js} +2 -2
- package/dist/{chunk-7UYBQ6NF.js → chunk-GXJEGZL2.js} +30 -20
- package/dist/{chunk-KJJLA674.js → chunk-GZVP4TWN.js} +1 -46
- package/dist/{chunk-QVYVUCWD.js → chunk-HB7FJOY4.js} +1 -1
- package/dist/{chunk-QFN7NVWM.js → chunk-ICKDMTLA.js} +1 -1
- package/dist/{chunk-XONFUK3M.js → chunk-IEIJRMLZ.js} +47 -35
- package/dist/{chunk-PAGIICKN.js → chunk-IHTRYDFN.js} +1 -1
- package/dist/chunk-IR35BCLK.js +13 -0
- package/dist/{chunk-KDPYVTEU.js → chunk-KBB4RG6F.js} +6 -1
- package/dist/{chunk-ZQQ3SEIE.js → chunk-KIFHYXPB.js} +99 -31
- package/dist/{chunk-TAMQYQGJ.js → chunk-LAFJSYDL.js} +1 -1
- package/dist/{chunk-U3X3TPBW.js → chunk-MAYCCGMQ.js} +11 -2
- package/dist/{chunk-HC7EVDEL.js → chunk-OB5MJR4W.js} +1 -1
- package/dist/{chunk-N3DQEVSI.js → chunk-OTHDVXOJ.js} +8 -5
- package/dist/{chunk-Y6QL2LGO.js → chunk-PLR7Z6TC.js} +1 -1
- package/dist/{chunk-OBXQRJWQ.js → chunk-QATWIE4K.js} +1 -1
- package/dist/{chunk-HLYOEIWM.js → chunk-QLSM7K5S.js} +2 -2
- package/dist/{chunk-LW6HO6U3.js → chunk-R42WWQVB.js} +1 -1
- package/dist/{chunk-HMT2RPZU.js → chunk-U5QY7KTN.js} +13 -9
- package/dist/chunk-UPFUC4DB.js +136 -0
- package/dist/{chunk-33RZPZ4K.js → chunk-UXO2L7HJ.js} +366 -156
- package/dist/{chunk-GNBGPUJ7.js → chunk-VHFEMFYL.js} +3 -3
- package/dist/{chunk-4M4EC7JX.js → chunk-VRW6EBHV.js} +12 -1
- package/dist/{chunk-VIVBA6E6.js → chunk-XBX4QJP7.js} +1 -1
- package/dist/{chunk-CLOH4LIB.js → chunk-XIHCMVMG.js} +2 -2
- package/dist/{chunk-TVCRUG2S.js → chunk-ZEUONDQG.js} +1 -1
- package/dist/{chunk-OSSHSIMD.js → chunk-ZF7SXQJ7.js} +1 -1
- package/dist/{chunk-5FISWJ37.js → chunk-ZIYZ77MR.js} +4 -4
- package/dist/{chunk-3NE7ZYU2.js → chunk-ZSVUAVMT.js} +3 -3
- package/dist/{clean-YHGPY33K.js → clean-RDKJB5FK.js} +18 -18
- package/dist/cli.js +68 -56
- package/dist/{cloud-DOFI5ISR.js → cloud-QVPVVNCW.js} +4 -4
- package/dist/{cloudrun-KTZ4XDHL.js → cloudrun-3RE2UCQG.js} +4 -4
- package/dist/{compare-SMMIZN2C.js → compare-LEDOY7MO.js} +25 -25
- package/dist/{compiler-TEXQWW6N.js → compiler-F54OZZPM.js} +10 -4
- package/dist/{component-B3GCNGSS.js → component-N42M67WY.js} +3 -3
- package/dist/{compositions-OQNZZTKF.js → compositions-VB2J2LZI.js} +11 -11
- package/dist/{delete-EL5LVSEP.js → delete-Q6RWMJ4Z.js} +2 -2
- package/dist/{dist-5UVIRMSM.js → dist-KDJTFJHA.js} +2 -2
- package/dist/{dist-XN234YFQ.js → dist-Q4BI5A73.js} +4 -4
- package/dist/{doctor-UOL3OI2A.js → doctor-JMMUHDRV.js} +13 -13
- package/dist/{events-K2DB2PBC.js → events-6ZBSIBE5.js} +2 -2
- package/dist/{events-NIZBS6S7.js → events-RGUAHIBW.js} +3 -3
- package/dist/{feedback-QMP4E6L7.js → feedback-FIID6MZW.js} +9 -9
- package/dist/{ffmpeg-QIUFEFTY.js → ffmpeg-T5SH2EFJ.js} +3 -2
- package/dist/{figma-2AUJRNVC.js → figma-BL3JJC36.js} +3 -3
- package/dist/fontLocalizeCli.js +9 -9
- package/dist/{get-P5NC7SRM.js → get-P46GS7S6.js} +2 -2
- package/dist/{gpuPolicy-7N5MCE2G.js → gpuPolicy-AQ2BPLBK.js} +11 -9
- package/dist/{grade-compare-HV5AFZ6P.js → grade-compare-GDCWU7ZZ.js} +27 -27
- package/dist/{help-3TSTXBLN.js → help-HJR3RWFG.js} +2 -2
- package/dist/{history-D65XFJ6D.js → history-GGO5AWJB.js} +5 -5
- package/dist/hyperframe-runtime.js +59 -59
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +59 -59
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/{info-TXV7MLFO.js → info-3GFWUBJC.js} +8 -8
- package/dist/{init-OSDMJZJV.js → init-36OPU2ZG.js} +35 -36
- package/dist/{inspect-RQQSAYIJ.js → inspect-F2HEL5ON.js} +26 -26
- package/dist/{installer-CDOB32HE.js → installer-NI6P6GC4.js} +5 -5
- package/dist/{keyframes-V75Q6GRM.js → keyframes-7OY3LMAZ.js} +6 -6
- package/dist/{lambda-RODV4RCX.js → lambda-6GJIWNJ3.js} +5 -5
- package/dist/{layout-IZAI5SFC.js → layout-FTMLNL5A.js} +26 -26
- package/dist/{lint-PLXOXY5R.js → lint-U6POHUON.js} +8 -8
- package/dist/{lintProject-OQ6H6XBR.js → lintProject-UBZ3TDHU.js} +2 -2
- package/dist/{list-BQBPNKDZ.js → list-IP5KI5Q2.js} +2 -2
- package/dist/{login-NP6F4FHC.js → login-4VWTVPHG.js} +4 -4
- package/dist/{manager-CT3D67CG.js → manager-BPSR6D3V.js} +2 -2
- package/dist/{manager-GXYF4AVO.js → manager-YKMHR6LN.js} +8 -5
- package/dist/{media-treatment-PXGMZ4A4.js → media-treatment-XGV44AGV.js} +16 -13
- package/dist/{models-CEZM6XZ7.js → models-UCXB6UR5.js} +59 -19
- package/dist/{motionShot-R4GHYWYM.js → motionShot-WPVNBXKA.js} +21 -22
- package/dist/{normalize-H6KUHHEI.js → normalize-U3SL5VG3.js} +2 -2
- package/dist/{normalize-audio-MQ7NFCOV.js → normalize-audio-TYJ3UEHO.js} +6 -6
- package/dist/{open-AKQTGNXF.js → open-HENOLVB2.js} +4 -4
- package/dist/parakeetRunner-VFQ6WFTD.js +67 -0
- package/dist/{pipeline-SYJYP2RM.js → pipeline-6WPSC3H4.js} +10 -9
- package/dist/{play-NBH4B7PL.js → play-OI53WNUM.js} +19 -19
- package/dist/{preflight-Y5DN5D37.js → preflight-B4AFK3RG.js} +4 -4
- package/dist/{present-XAX55CFS.js → present-NGMEQ4NO.js} +15 -15
- package/dist/{preview-OLANKNFA.js → preview-VT2HWRWZ.js} +19 -19
- package/dist/{producer-Q6YNZZUJ.js → producer-7TYEAUF7.js} +1 -1
- package/dist/{projectConfig-EM26P45P.js → projectConfig-B2AF5DXY.js} +7 -7
- package/dist/{publication-OXWJZKSX.js → publication-2PANQVC6.js} +3 -3
- package/dist/{publish-4VBWP2UB.js → publish-O5OL42BG.js} +11 -11
- package/dist/{remove-background-REB7427G.js → remove-background-T2JM6UVP.js} +11 -10
- package/dist/{render-K25YOG3M.js → render-OLPKOJRU.js} +11 -11
- package/dist/{render-3CVZ2SZG.js → render-W7OFXDOJ.js} +4 -4
- package/dist/{render-TSE75QUL.js → render-Z253WHBK.js} +26 -26
- package/dist/{render-batch-GGUOK3DS.js → render-batch-46IIBFKL.js} +4 -4
- package/dist/{renderCancellation-PZRWB53I.js → renderCancellation-QTZOCDJ2.js} +10 -9
- package/dist/renderSetupWorker.js +32 -44
- package/dist/{resolver-S5VK6UCB.js → resolver-J2PL5FVJ.js} +5 -5
- package/dist/sherpa-ZF42V3RN.js +75 -0
- package/dist/sherpaWorker.js +2 -1
- package/dist/skills/hyperframes/scripts/lib/frame-packets-core.mjs +2 -20
- package/dist/skills/hyperframes/scripts/lib/main-module.mjs +13 -0
- package/dist/skills/hyperframes/scripts/lib/main-module.test.mjs +51 -0
- package/dist/skills/hyperframes/scripts/plugin-cli.mjs +4 -3
- package/dist/skills/hyperframes/scripts/plugin-cli.test.mjs +5 -1
- package/dist/skills/hyperframes-cli/SKILL.md +2 -0
- package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +1 -1
- package/dist/skills/media-use/audio/scripts/heygen-voice.mjs +2 -2
- package/dist/skills/media-use/audio/scripts/lib/main-module.mjs +13 -0
- package/dist/skills/media-use/scripts/lib/cube-validate.mjs +2 -3
- package/dist/skills/media-use/scripts/lib/main-module.mjs +13 -0
- package/dist/{skills-I65FU5HD.js → skills-ACDOO3PX.js} +7 -7
- package/dist/{skillsUpdateCheck-J57RNNIV.js → skillsUpdateCheck-L5OXVVPU.js} +3 -3
- package/dist/{snapshot-YROOGY22.js → snapshot-UUVNZOW5.js} +28 -28
- package/dist/{src-JO5JOV7Y.js → src-BSLKXEGX.js} +10 -6
- package/dist/{src-X426BZAG.js → src-KS3AWFGT.js} +8 -8
- package/dist/{staticProjectServer-5VMBS262.js → staticProjectServer-2TTVGPQH.js} +15 -15
- package/dist/studio/assets/{hyperframes-player-BXSuksFh.js → hyperframes-player-DZ5JrMDg.js} +3 -3
- package/dist/studio/assets/{index-FgyO_5Kv.js → index-BOs6C0aZ.js} +1 -1
- package/dist/studio/assets/{index-BgOVCqjo.js → index-BqFRhNZa.js} +1 -1
- package/dist/studio/assets/{index-J7jpL4pj.js → index-D8W0a0Z9.js} +149 -149
- package/dist/studio/{chunk-TFLU2MGI.js → chunk-6JY3MTIX.js} +108 -2
- package/dist/studio/{chunk-H2DUOXTF.js → chunk-NZPJUZKT.js} +100 -4
- package/dist/studio/{chunk-UYWON5AX.js → chunk-TP6D3U37.js} +7 -100
- package/dist/studio/{chunk-LOVBLSMR.js → chunk-Y2OHHNM2.js} +35 -19
- package/dist/studio/{domEditingLayers-KBTPQKGA.js → domEditingLayers-PTP2ICGM.js} +3 -3
- package/dist/studio/index.d.ts +8 -5
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +545 -495
- package/dist/studio/player.js +3 -3
- package/dist/studio/ui.d.ts +4 -5
- package/dist/studio/ui.js +1 -1
- package/dist/{studio-api-VRBZUGAE.js → studio-api-WYWF7XRC.js} +9 -9
- package/dist/{studioServer-DBNKZ6I6.js → studioServer-3FG4YTP7.js} +72 -54
- package/dist/{telemetry-CXAX3TO3.js → telemetry-PAOOB4T4.js} +3 -3
- package/dist/{timeline-VQ34WH7J.js → timeline-JIIJKKPC.js} +69 -47
- package/dist/{tokens-62R7VFAZ.js → tokens-3QRAM75Z.js} +2 -2
- package/dist/{transcribe-XOHPPL2O.js → transcribe-QSBP5MUG.js} +115 -51
- package/dist/{transcribe-7KR7IPJA.js → transcribe-SZB6UMXE.js} +14 -12
- package/dist/{tts-MUV42JXT.js → tts-B6AHFQEO.js} +1 -1
- package/dist/{updateCheck-POYNH3B5.js → updateCheck-V3DSB26K.js} +2 -2
- package/dist/{upgrade-NBNOT7J2.js → upgrade-L5GISOEV.js} +2 -2
- package/dist/{urlDownloader-3NS63A7B.js → urlDownloader-52FERT4X.js} +6 -6
- package/dist/{validate-Y2QDHAEP.js → validate-HVVLX7KO.js} +20 -20
- package/dist/{video-SJDMTSTL.js → video-MEOWRMFG.js} +7 -7
- package/package.json +1 -1
- package/dist/chunk-6TPZSTCL.js +0 -3681
- package/dist/studio/chunk-EEXSYY5F.js.map +0 -1
- package/dist/studio/chunk-H2DUOXTF.js.map +0 -1
- package/dist/studio/chunk-LOVBLSMR.js.map +0 -1
- package/dist/studio/chunk-PZ5AY32C.js.map +0 -1
- package/dist/studio/chunk-TFLU2MGI.js.map +0 -1
- package/dist/studio/chunk-UYWON5AX.js.map +0 -1
- package/dist/studio/domEditingLayers-KBTPQKGA.js.map +0 -1
- package/dist/studio/index.css.map +0 -1
- package/dist/studio/index.js.map +0 -1
- package/dist/studio/player.js.map +0 -1
- package/dist/studio/styles/tailwind-preset.js.map +0 -1
- package/dist/studio/ui.js.map +0 -1
- package/dist/{screenshotCapture-TEUIWXWN.js → screenshotCapture-3JXXUZND.js} +3 -3
- package/dist/{synthesize-C3IWDAXF.js → synthesize-UCI4X5O7.js} +4 -4
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
splitElementInHtml,
|
|
22
22
|
unwrapElementsFromHtml,
|
|
23
23
|
wrapElementsInHtml
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-5WVW7P23.js";
|
|
25
25
|
import {
|
|
26
26
|
MAX_WINDOW_IDLE_MS,
|
|
27
27
|
STUDIO_SIGNATURE_MANIFEST_PATHS,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
requestedProjectPath,
|
|
44
44
|
requiredFfmpeg,
|
|
45
45
|
resolveLocalAudioPath
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-DDIVWXN7.js";
|
|
47
47
|
import {
|
|
48
48
|
PROXY_PARAMS_VERSION,
|
|
49
49
|
PROXY_PENDING_RETRY_AFTER_SECONDS,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
scanProjectMediaCodecMap,
|
|
66
66
|
shouldPrewarmProxy,
|
|
67
67
|
waitForProxy
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-KIFHYXPB.js";
|
|
69
69
|
import {
|
|
70
70
|
STUDIO_MOTION_PATH,
|
|
71
71
|
createStudioMotionRenderBodyScript,
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
} from "./chunk-TJSTGSAW.js";
|
|
99
99
|
import {
|
|
100
100
|
addScenePartsManifest
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-FDT6KQV4.js";
|
|
102
102
|
import {
|
|
103
103
|
ensureHfIds
|
|
104
104
|
} from "./chunk-NE55C6S5.js";
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
parseFps,
|
|
112
112
|
parsePreviewProxyBox,
|
|
113
113
|
sameInstant
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-VRW6EBHV.js";
|
|
115
115
|
import {
|
|
116
116
|
AFTER_FONTS_SCRIPT_TYPE,
|
|
117
117
|
RUNTIME_BOOTSTRAP_ATTR,
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
resolveRateSpec,
|
|
126
126
|
sourceTimeAt,
|
|
127
127
|
stripEmbeddedRuntimeScripts
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-AUWHD7RA.js";
|
|
129
129
|
import {
|
|
130
130
|
HTML_ATTRIBUTE_ENTITIES,
|
|
131
131
|
MagicString,
|
|
@@ -159,7 +159,7 @@ import {
|
|
|
159
159
|
rewriteAssetPaths,
|
|
160
160
|
rewriteCssAssetUrls,
|
|
161
161
|
rewriteInlineStyleAssetUrls
|
|
162
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-BSQ7XANM.js";
|
|
163
163
|
import {
|
|
164
164
|
parseHTML
|
|
165
165
|
} from "./chunk-SDYDNHEE.js";
|
|
@@ -300,7 +300,7 @@ function clearElementScreenshotIsolation() {
|
|
|
300
300
|
page.__hfThumbnailFaded = [];
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
// ../studio-server/dist/chunk-
|
|
303
|
+
// ../studio-server/dist/chunk-WE5JQ6V7.js
|
|
304
304
|
import { resolve } from "path";
|
|
305
305
|
function isAutoProxyEnabled(adapter) {
|
|
306
306
|
return adapter.autoProxy !== false;
|
|
@@ -4430,16 +4430,7 @@ function applyFileMutations(projectDir, mutations, requestToken, writeFile = (pa
|
|
|
4430
4430
|
}
|
|
4431
4431
|
return results;
|
|
4432
4432
|
} catch (error) {
|
|
4433
|
-
const rollbackErrors =
|
|
4434
|
-
for (const mutation of attempted.reverse()) {
|
|
4435
|
-
try {
|
|
4436
|
-
if (!mutation.written || readFileSync4(mutation.absPath, "utf-8") === mutation.after)
|
|
4437
|
-
writeFile(mutation.absPath, mutation.before, "utf-8");
|
|
4438
|
-
clearFileWriteReceipt(mutation.absPath, mutation.version, mutation.writeToken);
|
|
4439
|
-
} catch (rollbackError) {
|
|
4440
|
-
rollbackErrors.push(rollbackError);
|
|
4441
|
-
}
|
|
4442
|
-
}
|
|
4433
|
+
const rollbackErrors = rollBack(attempted, writeFile);
|
|
4443
4434
|
if (rollbackErrors.length > 0) {
|
|
4444
4435
|
throw new AggregateError(
|
|
4445
4436
|
[error, ...rollbackErrors],
|
|
@@ -4449,6 +4440,20 @@ function applyFileMutations(projectDir, mutations, requestToken, writeFile = (pa
|
|
|
4449
4440
|
throw error;
|
|
4450
4441
|
}
|
|
4451
4442
|
}
|
|
4443
|
+
function rollBack(attempted, writeFile) {
|
|
4444
|
+
const errors = [];
|
|
4445
|
+
for (const mutation of attempted.reverse()) {
|
|
4446
|
+
try {
|
|
4447
|
+
const current = readFileSync4(mutation.absPath, "utf-8");
|
|
4448
|
+
if (mutation.written ? current === mutation.after : current !== mutation.before)
|
|
4449
|
+
writeFile(mutation.absPath, mutation.before, "utf-8");
|
|
4450
|
+
clearFileWriteReceipt(mutation.absPath, mutation.version, mutation.writeToken);
|
|
4451
|
+
} catch (rollbackError) {
|
|
4452
|
+
errors.push(rollbackError);
|
|
4453
|
+
}
|
|
4454
|
+
}
|
|
4455
|
+
return errors;
|
|
4456
|
+
}
|
|
4452
4457
|
function applyOneMutation(projectDir, mutation, requestToken, writeFile, attempted) {
|
|
4453
4458
|
const current = readFileSync4(mutation.absPath, "utf-8");
|
|
4454
4459
|
assertExpectedVersion(mutation, current);
|
|
@@ -5441,7 +5446,7 @@ async function prepareGsapMutationScript(c, res, firstMutation) {
|
|
|
5441
5446
|
let block = extractGsapScriptBlock(html);
|
|
5442
5447
|
if (!block && (firstMutation.type === "add" || firstMutation.type === "add-with-keyframes")) {
|
|
5443
5448
|
const compId = html.match(/data-composition-id="([^"]+)"/)?.[1] ?? "main";
|
|
5444
|
-
const { GSAP_CDN } = await import("./dist-
|
|
5449
|
+
const { GSAP_CDN } = await import("./dist-Q4BI5A73.js");
|
|
5445
5450
|
const bootstrap = [
|
|
5446
5451
|
`<script src="${GSAP_CDN}"></script>`,
|
|
5447
5452
|
"<script>",
|
|
@@ -7838,7 +7843,11 @@ async function lintUncoveredHtml(adapter, projectDir, htmlFiles, coveredFiles) {
|
|
|
7838
7843
|
for (const file of htmlFiles) {
|
|
7839
7844
|
if (coveredFiles.has(file)) continue;
|
|
7840
7845
|
const content = readFileSync7(join9(projectDir, file), "utf-8");
|
|
7841
|
-
const result = await adapter.lint(content, {
|
|
7846
|
+
const result = await adapter.lint(content, {
|
|
7847
|
+
filePath: file,
|
|
7848
|
+
isSubComposition: true,
|
|
7849
|
+
compSrcPath: file
|
|
7850
|
+
});
|
|
7842
7851
|
for (const finding of result?.findings ?? []) {
|
|
7843
7852
|
findings.push({ ...finding, file });
|
|
7844
7853
|
}
|
|
@@ -7959,6 +7968,7 @@ function registerRenderRoutes(api, adapter) {
|
|
|
7959
7968
|
outputResolution,
|
|
7960
7969
|
composition,
|
|
7961
7970
|
variables,
|
|
7971
|
+
useGpu: body.gpu === true && format === "mp4",
|
|
7962
7972
|
distinctId: typeof body.telemetryDistinctId === "string" ? body.telemetryDistinctId : void 0,
|
|
7963
7973
|
telemetryOptOut: body.telemetryOptOut === true
|
|
7964
7974
|
});
|
|
@@ -71,51 +71,6 @@ ${EXTRA_POSITIONAL_HINTS[path]}` : "");
|
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
// src/utils/reject-unknown-flags.ts
|
|
75
|
-
var ALWAYS_KNOWN = /* @__PURE__ */ new Set(["help", "h", "version", "v", "json"]);
|
|
76
|
-
function nameVariants(name) {
|
|
77
|
-
const kebab = name.replace(/[A-Z]/g, (c) => "-" + c.toLowerCase());
|
|
78
|
-
const camel = name.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
79
|
-
return [name, kebab, camel];
|
|
80
|
-
}
|
|
81
|
-
function knownFlags(args) {
|
|
82
|
-
const known = new Set(ALWAYS_KNOWN);
|
|
83
|
-
for (const [name, def] of Object.entries(args ?? {})) {
|
|
84
|
-
for (const v of nameVariants(name)) known.add(v);
|
|
85
|
-
const alias = def?.alias;
|
|
86
|
-
if (typeof alias === "string") known.add(alias);
|
|
87
|
-
else if (Array.isArray(alias)) for (const a of alias) known.add(a);
|
|
88
|
-
}
|
|
89
|
-
return known;
|
|
90
|
-
}
|
|
91
|
-
function longFlagName(tok) {
|
|
92
|
-
const name = tok.slice(2).split("=")[0] ?? "";
|
|
93
|
-
return name.startsWith("no-") ? name.slice(3) : name;
|
|
94
|
-
}
|
|
95
|
-
function unknownFlagIn(tok, known) {
|
|
96
|
-
if (tok === "-" || !tok.startsWith("-")) return null;
|
|
97
|
-
if (tok.startsWith("--")) {
|
|
98
|
-
const name = longFlagName(tok);
|
|
99
|
-
return name && !known.has(name) ? `--${name}` : null;
|
|
100
|
-
}
|
|
101
|
-
for (const ch of tok.slice(1).split("=")[0] ?? "") {
|
|
102
|
-
if (!known.has(ch)) return `-${ch}`;
|
|
103
|
-
}
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
function assertKnownFlags(cmd, rawArgs) {
|
|
107
|
-
if (!Array.isArray(rawArgs)) return;
|
|
108
|
-
const rawDef = cmd.args;
|
|
109
|
-
const args = rawDef && typeof rawDef === "object" ? rawDef : void 0;
|
|
110
|
-
const known = knownFlags(args);
|
|
111
|
-
for (const tok of rawArgs) {
|
|
112
|
-
if (tok === "--") break;
|
|
113
|
-
const bad = unknownFlagIn(tok, known);
|
|
114
|
-
if (bad) throw new Error(`Unknown flag: ${bad}`);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
74
|
export {
|
|
119
|
-
resolveExtraPositionals
|
|
120
|
-
assertKnownFlags
|
|
75
|
+
resolveExtraPositionals
|
|
121
76
|
};
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
readDataDurationSeconds,
|
|
42
42
|
resolveMediaDuration,
|
|
43
43
|
rewriteAssetPath
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-BSQ7XANM.js";
|
|
45
45
|
import {
|
|
46
46
|
Parser,
|
|
47
47
|
parseHTML
|
|
@@ -3834,12 +3834,13 @@ function parseHtmlStructure(source) {
|
|
|
3834
3834
|
function findHtmlTag(tags) {
|
|
3835
3835
|
return tags.find((tag) => tag.name === "html") ?? null;
|
|
3836
3836
|
}
|
|
3837
|
+
var hasCompositionMarker = (tag) => Boolean(
|
|
3838
|
+
readDecodedAttr(tag.raw, "data-composition-id") || readAttr(tag.raw, "data-width") || readAttr(tag.raw, "data-height")
|
|
3839
|
+
);
|
|
3837
3840
|
function findRootTag(source, parsedTags) {
|
|
3838
3841
|
const tags = parsedTags ?? parseHtmlStructure(source).tags;
|
|
3839
3842
|
const bodyTag = tags.find((tag) => tag.name === "body");
|
|
3840
|
-
if (bodyTag && (
|
|
3841
|
-
return bodyTag;
|
|
3842
|
-
}
|
|
3843
|
+
if (bodyTag && hasCompositionMarker(bodyTag)) return bodyTag;
|
|
3843
3844
|
const bodyStart = bodyTag ? bodyTag.index + bodyTag.raw.length : 0;
|
|
3844
3845
|
const bodyEnd = bodyTag?.closeIndex ?? source.length;
|
|
3845
3846
|
const bodyTags = tags.filter((tag) => tag.index >= bodyStart && tag.index < bodyEnd);
|
|
@@ -3847,7 +3848,8 @@ function findRootTag(source, parsedTags) {
|
|
|
3847
3848
|
for (const tag of bodyTags) {
|
|
3848
3849
|
if (tag.index < skipBefore) continue;
|
|
3849
3850
|
if (["script", "style", "meta", "link", "title"].includes(tag.name)) continue;
|
|
3850
|
-
if (tag.name === "
|
|
3851
|
+
if ((tag.name === "html" || tag.name === "head") && !hasCompositionMarker(tag)) continue;
|
|
3852
|
+
if (tag.name === "svg" && !hasCompositionMarker(tag)) {
|
|
3851
3853
|
skipBefore = tag.endIndex ?? Infinity;
|
|
3852
3854
|
continue;
|
|
3853
3855
|
}
|
|
@@ -4469,7 +4471,8 @@ function buildLintContext(html, options = {}) {
|
|
|
4469
4471
|
content: style.content,
|
|
4470
4472
|
raw: style.content,
|
|
4471
4473
|
index: -1,
|
|
4472
|
-
file: style.file ?? style.href
|
|
4474
|
+
file: style.file ?? style.href,
|
|
4475
|
+
rootRelativePath: style.rootRelativePath
|
|
4473
4476
|
}))
|
|
4474
4477
|
];
|
|
4475
4478
|
const scripts = structure.scripts;
|
|
@@ -4858,7 +4861,7 @@ var coreRules = [
|
|
|
4858
4861
|
},
|
|
4859
4862
|
// root_missing_composition_id + root_missing_dimensions
|
|
4860
4863
|
// fallow-ignore-next-line complexity
|
|
4861
|
-
({ rootTag }) => {
|
|
4864
|
+
({ rootTag, options }) => {
|
|
4862
4865
|
const findings = [];
|
|
4863
4866
|
if (!rootTag || !readDecodedAttr(rootTag.raw, "data-composition-id")) {
|
|
4864
4867
|
findings.push({
|
|
@@ -4870,7 +4873,7 @@ var coreRules = [
|
|
|
4870
4873
|
snippet: truncateSnippet(rootTag?.raw || "")
|
|
4871
4874
|
});
|
|
4872
4875
|
}
|
|
4873
|
-
if (!rootTag || !readAttr(rootTag.raw, "data-width") || !readAttr(rootTag.raw, "data-height")) {
|
|
4876
|
+
if (!options.isSubComposition && (!rootTag || !readAttr(rootTag.raw, "data-width") || !readAttr(rootTag.raw, "data-height"))) {
|
|
4874
4877
|
findings.push({
|
|
4875
4878
|
code: "root_missing_dimensions",
|
|
4876
4879
|
severity: "error",
|
|
@@ -6331,6 +6334,24 @@ function extractCssUrlReferences(css) {
|
|
|
6331
6334
|
}
|
|
6332
6335
|
return out;
|
|
6333
6336
|
}
|
|
6337
|
+
function folderDepth(filePath) {
|
|
6338
|
+
if (/^(?:[a-z]:)?[\\/]/i.test(filePath)) return 0;
|
|
6339
|
+
let depth = 0;
|
|
6340
|
+
for (const segment of filePath.split(/[\\/]/).slice(0, -1)) {
|
|
6341
|
+
if (segment === "..") depth = Math.max(0, depth - 1);
|
|
6342
|
+
else if (segment && segment !== ".") depth += 1;
|
|
6343
|
+
}
|
|
6344
|
+
return depth;
|
|
6345
|
+
}
|
|
6346
|
+
function climbsAboveRoot(fileDepth, path) {
|
|
6347
|
+
let depth = fileDepth;
|
|
6348
|
+
for (const segment of path.split("/")) {
|
|
6349
|
+
if (segment === "..") depth -= 1;
|
|
6350
|
+
else if (segment && segment !== ".") depth += 1;
|
|
6351
|
+
if (depth < 0) return true;
|
|
6352
|
+
}
|
|
6353
|
+
return false;
|
|
6354
|
+
}
|
|
6334
6355
|
function extractCssSelectors(css) {
|
|
6335
6356
|
const out = [];
|
|
6336
6357
|
const noComments = css.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
@@ -6644,42 +6665,31 @@ var compositionRules = [
|
|
|
6644
6665
|
}
|
|
6645
6666
|
return findings;
|
|
6646
6667
|
},
|
|
6647
|
-
// invalid_parent_traversal_in_asset_path —
|
|
6648
|
-
//
|
|
6649
|
-
//
|
|
6650
|
-
// with the project root as their base URL, so any `../`-traversing path
|
|
6651
|
-
// climbs above the project root and 404s in Studio preview. Renders
|
|
6652
|
-
// tolerate it because the server-side bundler rewrites `../foo` against
|
|
6653
|
-
// each sub-composition's source path; the runtime now mirrors that fallback
|
|
6654
|
-
// (see rewriteSubCompositionAssetPaths in runtime/compositionLoader.ts), but
|
|
6655
|
-
// the authoring-time signal is still wrong — flag it at lint time so the
|
|
6656
|
-
// baked path is plain root-relative and matches what the bundler emits.
|
|
6657
|
-
//
|
|
6658
|
-
// Mirrors the runtime fallback's surface: `[src]` / `[href]` attribute
|
|
6659
|
-
// values, `[style]` inline url(), and `<style>` block url() references.
|
|
6660
|
-
// Skips absolute URLs (http(s)://, //, data:, /-prefixed root-relative),
|
|
6661
|
-
// hash anchors, and plain relative paths (`assets/x.mp4`) — only `../`
|
|
6662
|
-
// traversal is flagged. Subsumes the older `../capture/`-specific rule.
|
|
6668
|
+
// invalid_parent_traversal_in_asset_path — a `../` path in src, href or a CSS url() that leaves
|
|
6669
|
+
// the project once resolved from the file's own folder, as the bundler, producer and runtime
|
|
6670
|
+
// resolve it. "../assets/x" from compositions/ stays inside and passes.
|
|
6663
6671
|
// fallow-ignore-next-line complexity
|
|
6664
6672
|
({ tags, styles, rawSource, options }) => {
|
|
6665
6673
|
if (isRegistrySourceFile(options.filePath) || isRegistryInstalledFile(rawSource)) return [];
|
|
6666
6674
|
const offenders = [];
|
|
6667
|
-
const
|
|
6668
|
-
|
|
6669
|
-
const trimmed = value
|
|
6670
|
-
if (
|
|
6671
|
-
|
|
6675
|
+
const fileDepth = folderDepth(options.compSrcPath ?? "index.html");
|
|
6676
|
+
const collect = (value, depth = fileDepth) => {
|
|
6677
|
+
const trimmed = value?.trim() ?? "";
|
|
6678
|
+
if (/^(?:[a-z][a-z0-9+.-]*:|[\\/#])/i.test(trimmed)) return;
|
|
6679
|
+
const path = (trimmed.split(/[?#]/, 1)[0] ?? "").replace(/\\|%2f/gi, "/").replace(/%2e/gi, ".");
|
|
6680
|
+
if (climbsAboveRoot(depth, path)) offenders.push(trimmed);
|
|
6672
6681
|
};
|
|
6673
6682
|
for (const tag of tags) {
|
|
6674
|
-
collect(
|
|
6675
|
-
collect(
|
|
6683
|
+
collect(readDecodedAttr(tag.raw, "src"));
|
|
6684
|
+
collect(readDecodedAttr(tag.raw, "href"));
|
|
6676
6685
|
const styleAttr = readJsonAttr(tag.raw, "style");
|
|
6677
6686
|
if (styleAttr) {
|
|
6678
6687
|
for (const url of extractCssUrlReferences(styleAttr)) collect(url);
|
|
6679
6688
|
}
|
|
6680
6689
|
}
|
|
6681
6690
|
for (const style of styles) {
|
|
6682
|
-
|
|
6691
|
+
const depth = style.rootRelativePath ? folderDepth(style.rootRelativePath) : fileDepth;
|
|
6692
|
+
for (const url of extractCssUrlReferences(style.content)) collect(url, depth);
|
|
6683
6693
|
}
|
|
6684
6694
|
if (offenders.length === 0) return [];
|
|
6685
6695
|
const prefixCounts = /* @__PURE__ */ new Map();
|
|
@@ -6692,8 +6702,8 @@ var compositionRules = [
|
|
|
6692
6702
|
{
|
|
6693
6703
|
code: "invalid_parent_traversal_in_asset_path",
|
|
6694
6704
|
severity: "error",
|
|
6695
|
-
message: `Found ${offenders.length} asset path(s) traversing above the project root with "../" (${prefixSummary})
|
|
6696
|
-
fixHint:
|
|
6705
|
+
message: `Found ${offenders.length} asset path(s) traversing above the project root with "../" (${prefixSummary}), resolved from the folder of the file that holds them. Render and preview clamp them to the project root or resolve them outside it, so they load a different file than written, or none.`,
|
|
6706
|
+
fixHint: `Point the path at a file inside the project: from compositions/scene.html, "../assets/x.png" and "assets/x.png" both reach the project's assets folder.`
|
|
6697
6707
|
}
|
|
6698
6708
|
];
|
|
6699
6709
|
},
|
|
@@ -10403,7 +10413,7 @@ function collectExternalStyles(projectDir, html, compSrcPath) {
|
|
|
10403
10413
|
document,
|
|
10404
10414
|
compSrcPath
|
|
10405
10415
|
)) {
|
|
10406
|
-
styles.push({ href, content, file: join2(projectDir, rootRelativePath) });
|
|
10416
|
+
styles.push({ href, content, file: join2(projectDir, rootRelativePath), rootRelativePath });
|
|
10407
10417
|
}
|
|
10408
10418
|
return styles;
|
|
10409
10419
|
}
|
|
@@ -10455,6 +10465,7 @@ async function lintProject(projectDir, entryFile, hostOptions = {}) {
|
|
|
10455
10465
|
const rootResult = await lintHyperframeHtml(rootHtml, {
|
|
10456
10466
|
...hostOptions,
|
|
10457
10467
|
filePath: indexPath,
|
|
10468
|
+
compSrcPath: rootFile,
|
|
10458
10469
|
externalStyles: collectExternalStyles(projectDir, rootHtml, rootCompSrcPath)
|
|
10459
10470
|
});
|
|
10460
10471
|
results.push({ file: rootFile, result: rootResult, contentHash: contentDigest(rootHtml) });
|
|
@@ -10488,6 +10499,7 @@ async function lintProject(projectDir, entryFile, hostOptions = {}) {
|
|
|
10488
10499
|
...hostOptions,
|
|
10489
10500
|
filePath,
|
|
10490
10501
|
isSubComposition: true,
|
|
10502
|
+
compSrcPath,
|
|
10491
10503
|
externalStyles: collectExternalStyles(projectDir, html, compSrcPath)
|
|
10492
10504
|
});
|
|
10493
10505
|
results.push({
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
// src/whisper/transcriptFile.ts
|
|
9
|
+
var TRANSCRIPT_FILE = "transcript.json";
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
TRANSCRIPT_FILE
|
|
13
|
+
};
|
|
@@ -4,6 +4,9 @@ import { dirname as __hf_dirname } from "node:path";
|
|
|
4
4
|
var require = __hf_createRequire(import.meta.url);
|
|
5
5
|
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
TRANSCRIPT_FILE
|
|
9
|
+
} from "./chunk-IR35BCLK.js";
|
|
7
10
|
|
|
8
11
|
// src/whisper/parakeet.ts
|
|
9
12
|
import { execFileSync } from "child_process";
|
|
@@ -11,6 +14,7 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync
|
|
|
11
14
|
import { homedir, tmpdir } from "os";
|
|
12
15
|
import { basename, extname, join } from "path";
|
|
13
16
|
var PARAKEET_MODEL_LABEL = "parakeet-tdt-0.6b-v3";
|
|
17
|
+
var PARAKEET_INSTALL_COMMAND = "hyperframes models install parakeet";
|
|
14
18
|
var SHERPA_RESULT_PREFIX = "HYPERFRAMES_PARAKEET_RESULT:";
|
|
15
19
|
var SHERPA_ERROR_PREFIX = "HYPERFRAMES_PARAKEET_ERROR:";
|
|
16
20
|
var SHERPA_WINDOW_PREFIX = "HYPERFRAMES_PARAKEET_WINDOW:";
|
|
@@ -204,7 +208,7 @@ function transcribeWithParakeet(inputPath, dir, options) {
|
|
|
204
208
|
}
|
|
205
209
|
function writeParakeetTranscript(dir, words) {
|
|
206
210
|
mkdirSync(dir, { recursive: true });
|
|
207
|
-
const transcriptPath = join(dir,
|
|
211
|
+
const transcriptPath = join(dir, TRANSCRIPT_FILE);
|
|
208
212
|
writeFileSync(transcriptPath, JSON.stringify(words, null, 2));
|
|
209
213
|
const durationSeconds = words.length > 0 ? words[words.length - 1].end : 0;
|
|
210
214
|
return {
|
|
@@ -219,6 +223,7 @@ function writeParakeetTranscript(dir, words) {
|
|
|
219
223
|
|
|
220
224
|
export {
|
|
221
225
|
PARAKEET_MODEL_LABEL,
|
|
226
|
+
PARAKEET_INSTALL_COMMAND,
|
|
222
227
|
SHERPA_RESULT_PREFIX,
|
|
223
228
|
SHERPA_ERROR_PREFIX,
|
|
224
229
|
SHERPA_WINDOW_PREFIX,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
formatPreviewProxyBox,
|
|
10
10
|
hdrToSdrToneMapFilter,
|
|
11
11
|
parseFirstFrameColour
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VRW6EBHV.js";
|
|
13
13
|
import {
|
|
14
14
|
decodeAuthoredAttribute,
|
|
15
15
|
scanHtmlOpeningTags
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
} from "./chunk-PJ3HDUCY.js";
|
|
31
31
|
import {
|
|
32
32
|
rewriteAssetPath
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-BSQ7XANM.js";
|
|
34
34
|
|
|
35
35
|
// ../studio-server/dist/chunk-RN33UALN.js
|
|
36
36
|
import { statSync } from "fs";
|
|
@@ -336,7 +336,7 @@ async function scanProjectMediaCodecMap(projectDir, htmlSources, options = {}) {
|
|
|
336
336
|
return map;
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
// ../studio-server/dist/chunk-
|
|
339
|
+
// ../studio-server/dist/chunk-2VZGTTEG.js
|
|
340
340
|
import { spawn } from "child_process";
|
|
341
341
|
import { createHash, randomUUID } from "crypto";
|
|
342
342
|
import { existsSync as existsSync2, renameSync, statSync as statSync2, unlinkSync as unlinkSync2, utimesSync } from "fs";
|
|
@@ -547,31 +547,67 @@ function getCanonicalProxyCachePath(source, variant, box) {
|
|
|
547
547
|
`${key}${PROXY_VARIANT_CONFIG[variant].extension}`
|
|
548
548
|
);
|
|
549
549
|
}
|
|
550
|
+
var ProxyDroppedError = class extends ProxyTranscodeError {
|
|
551
|
+
constructor() {
|
|
552
|
+
super("media proxy copy dropped: every caller left before it started", null, "");
|
|
553
|
+
this.name = "ProxyDroppedError";
|
|
554
|
+
}
|
|
555
|
+
};
|
|
550
556
|
var activeTranscodes = 0;
|
|
551
557
|
var waitQueue = [];
|
|
552
|
-
function
|
|
558
|
+
function enqueue(job) {
|
|
559
|
+
const firstNormal = job.priority ? waitQueue.findIndex((queued) => !queued.priority) : -1;
|
|
560
|
+
if (firstNormal === -1) waitQueue.push(job);
|
|
561
|
+
else waitQueue.splice(firstNormal, 0, job);
|
|
562
|
+
}
|
|
563
|
+
function dequeue(job) {
|
|
564
|
+
const index = waitQueue.indexOf(job);
|
|
565
|
+
if (index !== -1) waitQueue.splice(index, 1);
|
|
566
|
+
}
|
|
567
|
+
function acquireSlot(job) {
|
|
568
|
+
if (activeTranscodes < MAX_CONCURRENT_TRANSCODES) {
|
|
569
|
+
activeTranscodes++;
|
|
570
|
+
return Promise.resolve();
|
|
571
|
+
}
|
|
553
572
|
return new Promise((resolveSlot, reject) => {
|
|
554
|
-
|
|
555
|
-
|
|
573
|
+
job.queued = {
|
|
574
|
+
start: () => {
|
|
575
|
+
job.queued = void 0;
|
|
556
576
|
activeTranscodes++;
|
|
557
577
|
resolveSlot();
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
578
|
+
},
|
|
579
|
+
drop: () => {
|
|
580
|
+
job.queued = void 0;
|
|
581
|
+
dequeue(job);
|
|
582
|
+
forget(job);
|
|
583
|
+
reject(new ProxyDroppedError());
|
|
564
584
|
}
|
|
565
585
|
};
|
|
566
|
-
|
|
586
|
+
enqueue(job);
|
|
567
587
|
});
|
|
568
588
|
}
|
|
589
|
+
function queueIsFull() {
|
|
590
|
+
return activeTranscodes >= MAX_CONCURRENT_TRANSCODES && waitQueue.length >= MAX_QUEUED_TRANSCODES;
|
|
591
|
+
}
|
|
569
592
|
function releaseSlot() {
|
|
570
593
|
activeTranscodes--;
|
|
571
|
-
|
|
572
|
-
|
|
594
|
+
waitQueue.shift()?.queued?.start();
|
|
595
|
+
}
|
|
596
|
+
function prioritize(job) {
|
|
597
|
+
if (job.priority) return;
|
|
598
|
+
job.priority = true;
|
|
599
|
+
if (!job.queued) return;
|
|
600
|
+
dequeue(job);
|
|
601
|
+
enqueue(job);
|
|
602
|
+
}
|
|
603
|
+
function leave(job) {
|
|
604
|
+
job.callers--;
|
|
605
|
+
if (job.callers === 0) job.queued?.drop();
|
|
573
606
|
}
|
|
574
607
|
var inFlight = /* @__PURE__ */ new Map();
|
|
608
|
+
function forget(job) {
|
|
609
|
+
if (inFlight.get(job.cachePath)?.job === job) inFlight.delete(job.cachePath);
|
|
610
|
+
}
|
|
575
611
|
function maintainProxyCache(cacheDir) {
|
|
576
612
|
try {
|
|
577
613
|
cleanupProxyCache(cacheDir, { protectedPaths: new Set(inFlight.keys()) });
|
|
@@ -730,8 +766,8 @@ async function runFfmpeg(sourcePath, outputPath, variant, box) {
|
|
|
730
766
|
});
|
|
731
767
|
});
|
|
732
768
|
}
|
|
733
|
-
async function transcodeToCache(projectDir, absoluteSourcePath, cachePath, variant, box) {
|
|
734
|
-
await acquireSlot();
|
|
769
|
+
async function transcodeToCache(job, projectDir, absoluteSourcePath, cachePath, variant, box) {
|
|
770
|
+
await acquireSlot(job);
|
|
735
771
|
try {
|
|
736
772
|
if (existsSync2(cachePath)) return cachePath;
|
|
737
773
|
const cacheDir = dirname(cachePath);
|
|
@@ -749,14 +785,15 @@ async function transcodeToCache(projectDir, absoluteSourcePath, cachePath, varia
|
|
|
749
785
|
releaseSlot();
|
|
750
786
|
}
|
|
751
787
|
}
|
|
752
|
-
var
|
|
788
|
+
var proxyActivity = 0;
|
|
753
789
|
function proxyActivityMark(projectDir) {
|
|
754
|
-
if (!existsSync2(projectDir)) return String(
|
|
790
|
+
if (!existsSync2(projectDir)) return String(proxyActivity);
|
|
755
791
|
const cacheDir = join2(realpath(projectDir), CACHE_DIR_NAME) + sep2;
|
|
756
792
|
for (const cachePath of inFlight.keys()) if (cachePath.startsWith(cacheDir)) return null;
|
|
757
|
-
return String(
|
|
793
|
+
return String(proxyActivity);
|
|
758
794
|
}
|
|
759
|
-
async function resolveProxy(projectDir, absoluteSourcePath, variant = "h264", box) {
|
|
795
|
+
async function resolveProxy(projectDir, absoluteSourcePath, variant = "h264", box, options = {}) {
|
|
796
|
+
options.signal?.throwIfAborted();
|
|
760
797
|
const source = canonicalizeProxySource(projectDir, absoluteSourcePath);
|
|
761
798
|
const cachePath = getCanonicalProxyCachePath(source, variant, box);
|
|
762
799
|
if (existsSync2(cachePath)) {
|
|
@@ -769,17 +806,48 @@ async function resolveProxy(projectDir, absoluteSourcePath, variant = "h264", bo
|
|
|
769
806
|
if (rememberedFailure.expiresAt > Date.now()) throw rememberedFailure.error;
|
|
770
807
|
failedTranscodes.delete(cachePath);
|
|
771
808
|
}
|
|
772
|
-
|
|
773
|
-
if (
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
809
|
+
let entry = inFlight.get(cachePath);
|
|
810
|
+
if (!entry) {
|
|
811
|
+
if (!options.priority && queueIsFull()) {
|
|
812
|
+
proxyActivity += 1;
|
|
813
|
+
throw new ProxyCapacityError();
|
|
814
|
+
}
|
|
815
|
+
const job = {
|
|
816
|
+
cachePath,
|
|
817
|
+
priority: options.priority === true,
|
|
818
|
+
callers: 0
|
|
819
|
+
};
|
|
820
|
+
const promise = transcodeToCache(
|
|
821
|
+
job,
|
|
822
|
+
source.projectDir,
|
|
823
|
+
source.sourcePath,
|
|
824
|
+
cachePath,
|
|
825
|
+
variant,
|
|
826
|
+
box
|
|
827
|
+
).catch((err) => {
|
|
828
|
+
if (!(err instanceof ProxyDroppedError)) rememberFailure(cachePath, err);
|
|
829
|
+
throw err;
|
|
830
|
+
}).finally(() => {
|
|
831
|
+
forget(job);
|
|
832
|
+
proxyActivity += 1;
|
|
833
|
+
});
|
|
834
|
+
entry = { promise, job };
|
|
835
|
+
inFlight.set(cachePath, entry);
|
|
836
|
+
}
|
|
837
|
+
if (options.priority) prioritize(entry.job);
|
|
838
|
+
return joinJob(entry.promise, entry.job, options.signal);
|
|
839
|
+
}
|
|
840
|
+
function joinJob(promise, job, signal) {
|
|
841
|
+
job.callers++;
|
|
842
|
+
if (!signal) return promise;
|
|
843
|
+
return new Promise((resolveJoin, rejectJoin) => {
|
|
844
|
+
const onAbort = () => {
|
|
845
|
+
leave(job);
|
|
846
|
+
rejectJoin(signal.reason);
|
|
847
|
+
};
|
|
848
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
849
|
+
promise.finally(() => signal.removeEventListener("abort", onAbort)).then(resolveJoin, rejectJoin);
|
|
780
850
|
});
|
|
781
|
-
inFlight.set(cachePath, promise);
|
|
782
|
-
return promise;
|
|
783
851
|
}
|
|
784
852
|
|
|
785
853
|
export {
|