hyperframes 0.8.158 → 0.8.160
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 +24 -0
- package/dist/{add-VBBOJ3RB.js → add-OGBTJCU4.js} +11 -11
- package/dist/{animatedGifPrep-MTJRHJ5G.js → animatedGifPrep-YAJTDXB7.js} +6 -6
- package/dist/api.js +16 -16
- package/dist/{asset-3MLXYJCT.js → asset-DKQFFGPP.js} +2 -2
- package/dist/{assetCataloger-DI7FC5KZ.js → assetCataloger-BIDQA34M.js} +2 -2
- package/dist/audio-GK4OVVTH.js +2086 -0
- package/dist/{auth-RJCTHSMH.js → auth-AQMRAFXN.js} +1 -1
- package/dist/{autoUpdate-VD6R34HF.js → autoUpdate-NFQB7V2X.js} +2 -2
- package/dist/{backgroundChecks-CWWIZDTW.js → backgroundChecks-7JKE2FIU.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-FTZ67377.js → batchRender-C2JCG5EK.js} +3 -3
- package/dist/{beats-6CN4BEXJ.js → beats-C3ZSK2R2.js} +12 -12
- package/dist/{benchmark-4QSNJZXI.js → benchmark-RRU67WEY.js} +8 -8
- package/dist/{browser-H7PRFBJV.js → browser-K4TP4ZM2.js} +5 -5
- package/dist/{bundleWithLocalizedFonts-IVO43QBQ.js → bundleWithLocalizedFonts-SLBVWQ7O.js} +2 -2
- package/dist/{capture-GZSY7LZJ.js → capture-T2TBROMS.js} +2 -2
- package/dist/{capture-IEEQTPAS.js → capture-ZPRK3TOZ.js} +10 -10
- package/dist/{catalog-PD25CVG3.js → catalog-IMIHQ4KX.js} +11 -11
- package/dist/{catch-up-2TGBK342.js → catch-up-UY5MJWOG.js} +4 -4
- package/dist/{check-HFNJEV3O.js → check-6NAJSJHQ.js} +135 -124
- package/dist/{checkBrowser-767LAZKF.js → checkBrowser-JWNQFYTY.js} +38 -36
- package/dist/{chunk-YIJMVFEJ.js → chunk-22QHO26F.js} +1 -1
- package/dist/{chunk-7F3B5YYT.js → chunk-2742O5DO.js} +178 -23
- package/dist/{chunk-EEEUI3ON.js → chunk-2ZLYSXZC.js} +16 -9
- package/dist/{chunk-L6AJC7UQ.js → chunk-37LNY2EC.js} +1 -1
- package/dist/{chunk-EY6ISRP3.js → chunk-3XPVZLAR.js} +1 -1
- package/dist/{chunk-DISITOR6.js → chunk-4ID635FL.js} +1 -1
- package/dist/{chunk-EDEFAJI5.js → chunk-4VYNMVMC.js} +12 -12
- package/dist/chunk-6JR2XUEE.js +127 -0
- package/dist/{chunk-7FGHFHWD.js → chunk-6MCASYIS.js} +31 -11
- package/dist/{chunk-3MQBIZHG.js → chunk-7OFNPEKR.js} +7 -7
- package/dist/{chunk-BB2SFTMY.js → chunk-A2DMF2Q6.js} +6 -5
- package/dist/{chunk-LAAGHMRC.js → chunk-B5FZ2CQM.js} +6 -2
- package/dist/{chunk-SLUFA6UM.js → chunk-B7RUGHBT.js} +1 -1
- package/dist/{chunk-3UMNI4XZ.js → chunk-D2WGLWIK.js} +3 -3
- package/dist/{chunk-3FRK53UC.js → chunk-D33YJZOH.js} +1 -1
- package/dist/{chunk-54DMWFQZ.js → chunk-D3ZWBHZP.js} +2 -15
- package/dist/{chunk-PKHDQELW.js → chunk-D46G5IQH.js} +11 -11
- package/dist/{chunk-ZZ3ZWTOI.js → chunk-DJZEIVAP.js} +3 -3
- package/dist/{chunk-J7WFHOCW.js → chunk-ERTJPFCH.js} +1 -1
- package/dist/{chunk-QRPYTJBW.js → chunk-EVRUR7DW.js} +1 -1
- package/dist/{chunk-QH2PL6J4.js → chunk-FRGYHRP6.js} +1 -1
- package/dist/{chunk-T243WV6D.js → chunk-G642IIVK.js} +2 -2
- package/dist/{chunk-GPUVPZRK.js → chunk-GG37I7B3.js} +1 -1
- package/dist/chunk-GJQHHAAX.js +336 -0
- package/dist/{chunk-Y6E2PW7Z.js → chunk-GOASXWDD.js} +2 -2
- package/dist/{chunk-4R6OZQGX.js → chunk-GOTCGKX6.js} +79 -4
- package/dist/{chunk-H6BWNY56.js → chunk-ICZVCVD3.js} +1 -1
- package/dist/{chunk-YVD5M26L.js → chunk-IGTGLGML.js} +2 -2
- package/dist/{chunk-KEGTYA7V.js → chunk-IK3SOMZ4.js} +5 -3
- package/dist/{chunk-6PIGOKTE.js → chunk-JGYHWVXQ.js} +339 -67
- package/dist/{chunk-2XUQPJ3W.js → chunk-KRE55WLI.js} +1 -1
- package/dist/{chunk-NNQP5TNO.js → chunk-KWRBEDJI.js} +3 -3
- package/dist/{chunk-FJT35XBA.js → chunk-LYIG2GZ5.js} +2 -2
- package/dist/{chunk-T76NSAXO.js → chunk-MMV6IY6U.js} +6 -4
- package/dist/{chunk-4YDQQQY6.js → chunk-MP676E4B.js} +2 -2
- package/dist/{chunk-LAPUMJOC.js → chunk-MYGXKD7A.js} +5 -5
- package/dist/{chunk-LQXHRO6F.js → chunk-N2NDDTYW.js} +2 -2
- package/dist/{chunk-J6SJCYAQ.js → chunk-OMJA7JP6.js} +5 -5
- package/dist/chunk-P47XYVEQ.js +3795 -0
- package/dist/{chunk-NFX4K6OW.js → chunk-P4QE7SSN.js} +1 -1
- package/dist/{chunk-EGKIQS5J.js → chunk-PBNV5V5G.js} +1 -1
- package/dist/{chunk-56QTFOWH.js → chunk-PINFPWRV.js} +5 -119
- package/dist/{chunk-IRRRH66M.js → chunk-PLEMSN3E.js} +115 -13
- package/dist/{chunk-23VDPRQ3.js → chunk-PPF65XAF.js} +1 -1
- package/dist/{chunk-SGIZMTWO.js → chunk-Q3TFX4OZ.js} +1 -1
- package/dist/{chunk-XSEGMQYA.js → chunk-QABAVWEX.js} +26 -3
- package/dist/{chunk-7ZWOLEGS.js → chunk-RTS7BGEC.js} +1 -1
- package/dist/{chunk-YB26LWR2.js → chunk-SB5DX6AD.js} +2 -2
- package/dist/{chunk-J4SSEVRU.js → chunk-SHVDJON6.js} +2 -2
- package/dist/{chunk-W2SNLHKF.js → chunk-TTFDAWCS.js} +1 -1
- package/dist/{chunk-RU6AIVON.js → chunk-TU2CQJO3.js} +2 -2
- package/dist/{chunk-Z347DFOL.js → chunk-V2FQQILJ.js} +8 -8
- package/dist/{chunk-DCQCGE2W.js → chunk-VD7WQYTO.js} +22 -20
- package/dist/{chunk-SHEVPNUR.js → chunk-VZ6LCTOZ.js} +1 -1
- package/dist/{chunk-SQHWDFTV.js → chunk-X3SCQP2A.js} +1 -1
- package/dist/{chunk-LBT4AMSF.js → chunk-XRKMITSS.js} +1 -1
- package/dist/{chunk-OTG5H2VM.js → chunk-XTLV6UVP.js} +3 -3
- package/dist/{clean-FQUVFH6H.js → clean-RRE6PMKZ.js} +24 -23
- package/dist/cli.js +54 -53
- package/dist/{cloud-BHAYVT6F.js → cloud-OIR6K7TS.js} +4 -4
- package/dist/{cloudrun-STLNWUBW.js → cloudrun-BIQXBUDO.js} +3 -3
- package/dist/{compare-2FRBIK5Z.js → compare-E57W737I.js} +31 -30
- package/dist/{compiler-VFJVUZWR.js → compiler-57M6W5WY.js} +3 -3
- package/dist/{component-DRKXJVXB.js → component-I2O4AX56.js} +3 -3
- package/dist/{compositions-D3SN64J3.js → compositions-B6NKZHIN.js} +10 -10
- package/dist/{delete-NA5WC2IR.js → delete-DTUNBC6K.js} +2 -2
- package/dist/{dist-SVTSOG4Q.js → dist-4JFB3WAR.js} +2 -2
- package/dist/{dist-2VXSQLXO.js → dist-ROVMAL74.js} +1 -1
- package/dist/{doctor-VXCMPOY3.js → doctor-SCNB73Z3.js} +12 -12
- package/dist/{events-ZJEPMUWT.js → events-6LQNRKHZ.js} +3 -3
- package/dist/{events-QAHWXFFG.js → events-Q37UJL36.js} +2 -2
- package/dist/{feedback-UGOQ57TU.js → feedback-FOEBE2OW.js} +9 -9
- package/dist/{ffmpeg-2ROTISBL.js → ffmpeg-7BYARPLM.js} +4 -2
- package/dist/{figma-YO2MJZDP.js → figma-54MRTBKH.js} +3 -3
- package/dist/fontLocalizeCli.js +9 -9
- package/dist/{get-WMJAYRNF.js → get-EPGHM2SA.js} +2 -2
- package/dist/{gpuPolicy-VXNJ4UBN.js → gpuPolicy-VGE3I5J4.js} +6 -6
- package/dist/{grade-compare-QZ7BG2AP.js → grade-compare-LOJWX6SK.js} +33 -32
- package/dist/{help-AR4MX2AH.js → help-6FPZI3WP.js} +2 -1
- package/dist/{history-NF764OFQ.js → history-GRXSUA5R.js} +12 -11
- package/dist/hyperframe-runtime.js +56 -56
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +56 -56
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/{info-476ERK4G.js → info-LV7DFCLD.js} +7 -7
- package/dist/{init-M6YUOBBZ.js → init-3J7BSAC3.js} +29 -29
- package/dist/{inspect-QYPUG3UZ.js → inspect-5RON554C.js} +30 -29
- package/dist/{installer-HF5BXXXM.js → installer-T3STEB4U.js} +4 -4
- package/dist/{keyframes-MTZRE34W.js → keyframes-KHXTHI5C.js} +6 -6
- package/dist/{lambda-ZCX7KGTY.js → lambda-4KCSMIM6.js} +4 -4
- package/dist/{layout-DLX4HQFL.js → layout-DVWWT2TR.js} +30 -29
- package/dist/{lint-OQ5QWCHZ.js → lint-Q5WFB5ST.js} +9 -9
- package/dist/{lintProject-JGHKRO5L.js → lintProject-BGDYHF3F.js} +1 -1
- package/dist/{list-AZ6OIOIK.js → list-RFEUTW6N.js} +2 -2
- package/dist/{login-DJPYT4YZ.js → login-WBHWA4M2.js} +4 -4
- package/dist/{manager-JNJE54OQ.js → manager-B6MVBM2E.js} +3 -3
- package/dist/{manager-ZLJD3EAY.js → manager-HEUPD2YB.js} +2 -2
- package/dist/{media-treatment-4YKC4LGB.js → media-treatment-WRHVNWLS.js} +15 -14
- package/dist/{models-WHDUQZQZ.js → models-OA4MXEYG.js} +12 -12
- package/dist/{motionShot-KEHC5AMK.js → motionShot-BZLRN3SS.js} +13 -13
- package/dist/{normalize-audio-ATAQGUPX.js → normalize-audio-4YXE3RIF.js} +7 -7
- package/dist/{open-4DXBEX2U.js → open-MCGYEFML.js} +7 -7
- package/dist/{parakeetRunner-5PNBGCGH.js → parakeetRunner-DBLHMD5T.js} +13 -13
- package/dist/{pipeline-QA2422UI.js → pipeline-FSY65OQ4.js} +8 -8
- package/dist/{play-SKTSHZM5.js → play-WXOV3BD7.js} +28 -27
- package/dist/{preflight-BH2XUQBS.js → preflight-G5KP7ZKA.js} +4 -4
- package/dist/{present-KSQ5GASH.js → present-RVG4J6CJ.js} +23 -22
- package/dist/{preview-TDD3QDR3.js → preview-PDUQR2JQ.js} +24 -24
- package/dist/{producer-PQMZ7OYH.js → producer-C5V2A3YL.js} +1 -1
- package/dist/{projectConfig-EYYDESVO.js → projectConfig-X2IEHCSK.js} +6 -6
- package/dist/{publication-MJY3XYYV.js → publication-JEANCWBW.js} +2 -2
- package/dist/{publish-5TZIKVLW.js → publish-VX5OH4ST.js} +12 -12
- package/dist/{remove-background-HT73ZUIG.js → remove-background-IXCISD26.js} +9 -9
- package/dist/{render-ADBL3C7S.js → render-5BGU3FXU.js} +57 -35
- package/dist/{render-YTJ3SMCD.js → render-ISUT7Q3X.js} +3 -3
- package/dist/{render-KJCDJEGI.js → render-JNJVFBFF.js} +13 -13
- package/dist/{render-batch-AFB2XK3I.js → render-batch-2C6RUP3F.js} +3 -3
- package/dist/renderSetupWorker.js +4 -4
- package/dist/{resolver-F2D2YCSQ.js → resolver-KTNKZVIB.js} +4 -4
- package/dist/{sherpa-IBKSF6GX.js → sherpa-GFRG3TMM.js} +12 -12
- package/dist/skills/hyperframes-cli/SKILL.md +5 -4
- package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +8 -0
- package/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +1 -1
- package/dist/{skills-E75DFHGG.js → skills-LKJA27ZN.js} +5 -5
- package/dist/{skillsUpdateCheck-EPTKOBR6.js → skillsUpdateCheck-RFZJKZC4.js} +3 -3
- package/dist/{snapshot-Z6T4I5TE.js → snapshot-EOYA4MLG.js} +86 -50
- package/dist/{src-NDI4KNT3.js → src-GPUDUKY6.js} +7 -5
- package/dist/{src-4GCHM2LX.js → src-IMCQRH4P.js} +8 -8
- package/dist/{staticProjectServer-ITNEQNQ7.js → staticProjectServer-S3NK3V4S.js} +18 -15
- package/dist/studio/assets/{hyperframes-player-DX8LgKgb.js → hyperframes-player-CXL23NEv.js} +1 -1
- package/dist/studio/assets/{index-BdnuQ7ta.js → index-Bl_xrA5T.js} +1 -1
- package/dist/studio/assets/{index-DB0YwjiT.js → index-CejKvBNw.js} +1 -1
- package/dist/studio/assets/{index-7Ljcoa9s.js → index-D7BvLHtZ.js} +7 -7
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-JMWUSAG7.js → studio-api-YM5HLXUS.js} +16 -11
- package/dist/{studioServer-MWZNMAVJ.js → studioServer-CEXJK5TC.js} +60 -59
- package/dist/{telemetry-D6A2TRK6.js → telemetry-7AWYECPL.js} +3 -3
- package/dist/{timeline-VIF4G3IT.js → timeline-G7H373XX.js} +48 -353
- package/dist/{tokens-ORS6MFMG.js → tokens-GYH7NXXA.js} +2 -2
- package/dist/{transcribe-DNRG7OGE.js → transcribe-CIC7WAT5.js} +17 -17
- package/dist/{transcribe-DZ6O6EG5.js → transcribe-FL6NGWHF.js} +11 -11
- package/dist/{updateCheck-YY4BPYNT.js → updateCheck-MQ44KGUR.js} +2 -2
- package/dist/{upgrade-CUDVTTF5.js → upgrade-OL47SID3.js} +2 -2
- package/dist/{urlDownloader-INLS5A6I.js → urlDownloader-KDJGLR2Y.js} +5 -5
- package/dist/{usage-EC3KFUIJ.js → usage-HG4WMM7A.js} +33 -5
- package/dist/{validate-CQCQVHUX.js → validate-TDCH6X3C.js} +22 -21
- package/dist/{video-3GLT6U6Z.js → video-AHO4CDCK.js} +6 -6
- package/package.json +1 -1
- package/dist/chunk-LPOTN5GW.js +0 -3795
|
@@ -0,0 +1,336 @@
|
|
|
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
|
+
readCompositionFps
|
|
9
|
+
} from "./chunk-WPNE5NEP.js";
|
|
10
|
+
import {
|
|
11
|
+
findSyncPartner,
|
|
12
|
+
readLinkTiming,
|
|
13
|
+
syncOffsetFrames
|
|
14
|
+
} from "./chunk-6JR2XUEE.js";
|
|
15
|
+
import {
|
|
16
|
+
HF_AUDIO_GROUP_ATTR,
|
|
17
|
+
extractAudioMetadata,
|
|
18
|
+
extractMediaMetadata,
|
|
19
|
+
resolveReferencedDuration,
|
|
20
|
+
resolveReferencedStart
|
|
21
|
+
} from "./chunk-PLEMSN3E.js";
|
|
22
|
+
import {
|
|
23
|
+
byStart,
|
|
24
|
+
compositionOriginSeconds,
|
|
25
|
+
cutToHostSlots,
|
|
26
|
+
fpsToNumber,
|
|
27
|
+
hostInPointSeconds,
|
|
28
|
+
parseFpsWithDefault,
|
|
29
|
+
resolveMediaStartSeconds
|
|
30
|
+
} from "./chunk-Q3TFX4OZ.js";
|
|
31
|
+
import {
|
|
32
|
+
HF_AUDIO_AUTOMATION_ATTR,
|
|
33
|
+
HF_AUDIO_FX_ATTR,
|
|
34
|
+
parseAudioFxChain,
|
|
35
|
+
parseAutomation,
|
|
36
|
+
resolveAutomation
|
|
37
|
+
} from "./chunk-P47XYVEQ.js";
|
|
38
|
+
import {
|
|
39
|
+
topLevelElements,
|
|
40
|
+
trackKindOf
|
|
41
|
+
} from "./chunk-ALLKNYC3.js";
|
|
42
|
+
import {
|
|
43
|
+
parseNumeric
|
|
44
|
+
} from "./chunk-3RM2ETQT.js";
|
|
45
|
+
import {
|
|
46
|
+
readMediaOffsetSeconds,
|
|
47
|
+
readPlaybackRate,
|
|
48
|
+
resolveMediaDuration
|
|
49
|
+
} from "./chunk-BSQ7XANM.js";
|
|
50
|
+
|
|
51
|
+
// src/timeline/describeProject.ts
|
|
52
|
+
import { readFileSync, realpathSync, statSync } from "fs";
|
|
53
|
+
import { basename, dirname, isAbsolute, relative, resolve, sep } from "path";
|
|
54
|
+
var TRACK_ORDER = ["video", "graphics", "captions", "audio"];
|
|
55
|
+
function toNode(el) {
|
|
56
|
+
const attrs = {};
|
|
57
|
+
for (const { name, value } of Array.from(el.attributes)) attrs[name] = value;
|
|
58
|
+
return { tag: el.tagName, attrs, children: Array.from(el.children).map(toNode), el };
|
|
59
|
+
}
|
|
60
|
+
function safeChain(raw) {
|
|
61
|
+
try {
|
|
62
|
+
return parseAudioFxChain(raw);
|
|
63
|
+
} catch {
|
|
64
|
+
return void 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function readLanes(el) {
|
|
68
|
+
const raw = el.getAttribute(HF_AUDIO_AUTOMATION_ATTR);
|
|
69
|
+
if (!raw) return { lanes: [], laneError: null };
|
|
70
|
+
try {
|
|
71
|
+
const fx = el.getAttribute(HF_AUDIO_FX_ATTR);
|
|
72
|
+
const chain = fx ? safeChain(fx) : void 0;
|
|
73
|
+
const lanes = resolveAutomation(parseAutomation(raw), chain).lanes.map((lane) => ({
|
|
74
|
+
target: lane.target,
|
|
75
|
+
points: lane.points.map(({ t, v }) => ({ t, v }))
|
|
76
|
+
}));
|
|
77
|
+
return { lanes, laneError: null };
|
|
78
|
+
} catch (err) {
|
|
79
|
+
return { lanes: [], laneError: err instanceof Error ? err.message : String(err) };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
var measureWithFfprobe = async (file, tag) => (tag === "audio" ? await extractAudioMetadata(file) : await extractMediaMetadata(file)).durationSeconds;
|
|
83
|
+
var MEDIA_TAG = /^(video|audio|img)$/;
|
|
84
|
+
var PROBE_CONCURRENCY = 4;
|
|
85
|
+
function createProbeGate(max) {
|
|
86
|
+
let active = 0;
|
|
87
|
+
const waiting = [];
|
|
88
|
+
return async function withProbeSlot(fn) {
|
|
89
|
+
if (active >= max) await new Promise((wake) => waiting.push(wake));
|
|
90
|
+
else active += 1;
|
|
91
|
+
try {
|
|
92
|
+
return await fn();
|
|
93
|
+
} finally {
|
|
94
|
+
const next = waiting.shift();
|
|
95
|
+
if (next) next();
|
|
96
|
+
else active -= 1;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
async function probeSource(scope, el, tag) {
|
|
101
|
+
const src = el.getAttribute("src");
|
|
102
|
+
if (!src) return { ok: false, reason: "no src attribute" };
|
|
103
|
+
if (/^https?:\/\//i.test(src)) return { ok: false, reason: "remote source not probed" };
|
|
104
|
+
const file = realFileInside(scope.projectDir, resolve(scope.dir, src));
|
|
105
|
+
if (!file) return { ok: false, reason: "source file not found" };
|
|
106
|
+
return scope.withProbeSlot(async () => {
|
|
107
|
+
try {
|
|
108
|
+
return { ok: true, seconds: await scope.measure(file, tag) };
|
|
109
|
+
} catch (err) {
|
|
110
|
+
return { ok: false, reason: err instanceof Error ? err.message : String(err) };
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function resolveContainerDuration(authored, children) {
|
|
115
|
+
if (authored !== null)
|
|
116
|
+
return { duration: authored, durationSource: "authored", pendingReason: null };
|
|
117
|
+
if (children.length === 0) return { duration: 0, durationSource: null, pendingReason: null };
|
|
118
|
+
const inner = children.reduce((max, c) => Math.max(max, c.end), 0);
|
|
119
|
+
return { duration: inner, durationSource: "inner", pendingReason: null };
|
|
120
|
+
}
|
|
121
|
+
async function resolveMediaRowDuration(scope, el, tag, authored) {
|
|
122
|
+
const getAttr = (name) => el.getAttribute(name);
|
|
123
|
+
const input = {
|
|
124
|
+
tag,
|
|
125
|
+
authoredDurationSeconds: authored,
|
|
126
|
+
mediaStartSeconds: readMediaOffsetSeconds(getAttr),
|
|
127
|
+
playbackRate: readPlaybackRate(getAttr)
|
|
128
|
+
};
|
|
129
|
+
const unprobed = resolveMediaDuration({ ...input, sourceDurationSeconds: null });
|
|
130
|
+
if (unprobed.source !== "pending") {
|
|
131
|
+
return {
|
|
132
|
+
duration: unprobed.seconds ?? 0,
|
|
133
|
+
durationSource: unprobed.source,
|
|
134
|
+
pendingReason: null
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
const probe = await probeSource(scope, el, tag);
|
|
138
|
+
const measured = probe.ok && probe.seconds > 0 ? probe.seconds : null;
|
|
139
|
+
const result = resolveMediaDuration({ ...input, sourceDurationSeconds: measured });
|
|
140
|
+
return {
|
|
141
|
+
duration: result.seconds ?? 0,
|
|
142
|
+
durationSource: result.source,
|
|
143
|
+
pendingReason: result.source === "pending" ? pendingReason(probe, result.reason) : null
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function pendingReason(probe, resolverReason) {
|
|
147
|
+
if (!probe.ok) return probe.reason;
|
|
148
|
+
return probe.seconds > 0 ? resolverReason ?? "source duration unavailable" : "source reports no duration";
|
|
149
|
+
}
|
|
150
|
+
var roundMs = (v) => Math.round(v * 1e3) / 1e3;
|
|
151
|
+
function mainTimelineStart(scope, el, start) {
|
|
152
|
+
const ordinaryStart = () => scope.origin + start;
|
|
153
|
+
if (!/^(video|audio)$/i.test(el.tagName)) return ordinaryStart();
|
|
154
|
+
return resolveMediaStartSeconds({
|
|
155
|
+
authoredStart: parseNumeric(el.getAttribute("data-start")),
|
|
156
|
+
hostStart: scope.origin,
|
|
157
|
+
hasAutoStart: el.hasAttribute("data-hf-auto-start"),
|
|
158
|
+
basis: el.getAttribute("data-hf-media-start-basis"),
|
|
159
|
+
ordinaryStart
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
async function resolveRowTiming(scope, node, depth) {
|
|
163
|
+
const { el } = node;
|
|
164
|
+
const start = resolveReferencedStart(scope.doc, el, scope.startCache, /* @__PURE__ */ new Set());
|
|
165
|
+
const authored = resolveReferencedDuration(scope.doc, el, scope.startCache, /* @__PURE__ */ new Set());
|
|
166
|
+
const host = el.getAttribute("data-composition-src");
|
|
167
|
+
const absStart = mainTimelineStart(scope, el, start);
|
|
168
|
+
const slots = hostInPointSeconds(el) > 0 ? [{ start: absStart, end: absStart + (authored ?? Infinity) }] : [];
|
|
169
|
+
const children = host && depth === 0 ? await readSubComposition(host, scope, compositionOriginSeconds(absStart, el), slots) : [];
|
|
170
|
+
const kind = el.tagName.toLowerCase();
|
|
171
|
+
const duration = MEDIA_TAG.test(kind) ? await resolveMediaRowDuration(scope, el, kind, authored) : resolveContainerDuration(authored, children);
|
|
172
|
+
return { start, authored, absStart, children, duration };
|
|
173
|
+
}
|
|
174
|
+
function describeRowFields(scope, node, timing) {
|
|
175
|
+
const { el } = node;
|
|
176
|
+
const kind = el.tagName.toLowerCase();
|
|
177
|
+
const host = el.getAttribute("data-composition-src");
|
|
178
|
+
const rate = parseNumeric(el.getAttribute("data-playback-rate"));
|
|
179
|
+
return {
|
|
180
|
+
id: el.id || el.getAttribute("data-composition-id") || kind,
|
|
181
|
+
label: null,
|
|
182
|
+
kind,
|
|
183
|
+
trackKind: trackKindOf(node).kind,
|
|
184
|
+
start: timing.start,
|
|
185
|
+
duration: timing.duration.duration,
|
|
186
|
+
end: timing.start + timing.duration.duration,
|
|
187
|
+
absStart: roundMs(timing.absStart),
|
|
188
|
+
absEnd: roundMs(timing.absStart + timing.duration.duration),
|
|
189
|
+
file: scope.file,
|
|
190
|
+
trackIndex: parseNumeric(el.getAttribute("data-track-index")) ?? 0,
|
|
191
|
+
src: el.getAttribute("src") ?? host,
|
|
192
|
+
sourceFile: host,
|
|
193
|
+
volume: parseNumeric(el.getAttribute("data-volume")),
|
|
194
|
+
...readLanes(el),
|
|
195
|
+
playbackRate: rate === 1 ? null : rate,
|
|
196
|
+
audioGroup: el.getAttribute(HF_AUDIO_GROUP_ATTR),
|
|
197
|
+
role: null,
|
|
198
|
+
durationAuthored: timing.authored !== null,
|
|
199
|
+
durationSource: timing.duration.durationSource,
|
|
200
|
+
pendingReason: timing.duration.pendingReason,
|
|
201
|
+
children: timing.children,
|
|
202
|
+
ref: "",
|
|
203
|
+
warnings: [],
|
|
204
|
+
elementId: el.id || null,
|
|
205
|
+
hfId: el.getAttribute("data-hf-id"),
|
|
206
|
+
syncOffsetFrames: syncOffsetOf(el, scope.fps),
|
|
207
|
+
mediaStart: /^(video|audio)$/.test(kind) ? readMediaOffsetSeconds((name) => el.getAttribute(name)) : null
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function syncOffsetOf(el, fps) {
|
|
211
|
+
const partner = findSyncPartner(el);
|
|
212
|
+
return partner ? syncOffsetFrames(readLinkTiming(el), readLinkTiming(partner), fps) : null;
|
|
213
|
+
}
|
|
214
|
+
async function describeRow(scope, node, depth) {
|
|
215
|
+
return describeRowFields(scope, node, await resolveRowTiming(scope, node, depth));
|
|
216
|
+
}
|
|
217
|
+
async function readSubComposition(src, parent, origin, slots) {
|
|
218
|
+
const authored = resolve(parent.dir, src);
|
|
219
|
+
const file = realFileInside(parent.projectDir, authored);
|
|
220
|
+
if (!file) return [];
|
|
221
|
+
const relativeFile = relative(parent.projectDir, authored).split(sep).join("/");
|
|
222
|
+
const source = parent.sourceOverrides.get(relativeFile) ?? readFileSync(file, "utf-8");
|
|
223
|
+
const doc = new DOMParser().parseFromString(source, "text/html");
|
|
224
|
+
const template = doc.querySelector("template");
|
|
225
|
+
const root = (template?.content ?? doc).querySelector("[data-composition-id]");
|
|
226
|
+
if (!root) return [];
|
|
227
|
+
const scope = {
|
|
228
|
+
doc,
|
|
229
|
+
dir: dirname(file),
|
|
230
|
+
startCache: /* @__PURE__ */ new Map(),
|
|
231
|
+
projectDir: parent.projectDir,
|
|
232
|
+
origin,
|
|
233
|
+
file: relative(parent.projectDir, authored).split(sep).join("/"),
|
|
234
|
+
withProbeSlot: parent.withProbeSlot,
|
|
235
|
+
measure: parent.measure,
|
|
236
|
+
sourceOverrides: parent.sourceOverrides,
|
|
237
|
+
fps: parent.fps
|
|
238
|
+
};
|
|
239
|
+
const rows = await Promise.all(
|
|
240
|
+
topLevelElements(toNode(root)).map((node) => describeRow(scope, node, 1))
|
|
241
|
+
);
|
|
242
|
+
return rows.flatMap((row) => cutRow(row, slots)).sort(byStart);
|
|
243
|
+
}
|
|
244
|
+
function cutRow(row, slots) {
|
|
245
|
+
const kept = cutToHostSlots({ start: row.absStart, end: row.absEnd }, slots);
|
|
246
|
+
if (kept.end === kept.start && row.absEnd > row.absStart) return [];
|
|
247
|
+
const skipped = (kept.start - row.absStart) * (row.playbackRate ?? 1);
|
|
248
|
+
const mediaStart = row.mediaStart === null ? null : roundMs(row.mediaStart + skipped);
|
|
249
|
+
return [{ ...row, absStart: roundMs(kept.start), absEnd: roundMs(kept.end), mediaStart }];
|
|
250
|
+
}
|
|
251
|
+
function realFileInside(projectDir, path) {
|
|
252
|
+
try {
|
|
253
|
+
const real = realpathSync(path);
|
|
254
|
+
const inside = relative(realpathSync(projectDir), real);
|
|
255
|
+
if (inside === ".." || inside.startsWith(`..${sep}`) || isAbsolute(inside)) return null;
|
|
256
|
+
return statSync(real).isFile() ? real : null;
|
|
257
|
+
} catch {
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
function flatten(top) {
|
|
262
|
+
const entries = [
|
|
263
|
+
...top.map((clip) => ({ clip, host: null })),
|
|
264
|
+
...top.flatMap((host) => host.children.map((clip) => ({ clip, host })))
|
|
265
|
+
];
|
|
266
|
+
const byKind = TRACK_ORDER.map((kind) => ({
|
|
267
|
+
kind,
|
|
268
|
+
entries: entries.filter((e) => e.clip.trackKind === kind).sort((a, b) => a.clip.absStart - b.clip.absStart)
|
|
269
|
+
})).filter((t) => t.entries.length > 0);
|
|
270
|
+
const pointers = new Map(
|
|
271
|
+
byKind.flatMap((t) => t.entries.map((e, index) => [e.clip, { kind: t.kind, index }]))
|
|
272
|
+
);
|
|
273
|
+
const at = (clip) => pointers.get(clip);
|
|
274
|
+
const fileIds = /* @__PURE__ */ new Map();
|
|
275
|
+
for (const { entries: entries2 } of byKind) {
|
|
276
|
+
for (const { clip } of entries2) {
|
|
277
|
+
if (!clip.elementId) continue;
|
|
278
|
+
const ids = fileIds.get(clip.file) ?? /* @__PURE__ */ new Map();
|
|
279
|
+
ids.set(clip.elementId, (ids.get(clip.elementId) ?? 0) + 1);
|
|
280
|
+
fileIds.set(clip.file, ids);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return byKind.map(({ kind, entries: kindEntries }) => ({
|
|
284
|
+
kind,
|
|
285
|
+
rows: kindEntries.map(({ clip, host }, index) => {
|
|
286
|
+
const uniqueId = clip.elementId && fileIds.get(clip.file)?.get(clip.elementId) === 1;
|
|
287
|
+
const ref = uniqueId ? `#${clip.elementId}` : clip.hfId ? `hf:${clip.hfId}` : `${kind}/${index}`;
|
|
288
|
+
const warnings = uniqueId || clip.hfId ? [] : [
|
|
289
|
+
'row has no stable name; add id="<name>" to the element in this file, then retry with #<name>'
|
|
290
|
+
];
|
|
291
|
+
return {
|
|
292
|
+
...clip,
|
|
293
|
+
index,
|
|
294
|
+
ref,
|
|
295
|
+
warnings,
|
|
296
|
+
nested: host !== null,
|
|
297
|
+
host: host && host.id,
|
|
298
|
+
hostRow: host && at(host),
|
|
299
|
+
children: clip.children.map(at)
|
|
300
|
+
};
|
|
301
|
+
})
|
|
302
|
+
}));
|
|
303
|
+
}
|
|
304
|
+
function projectFps(source) {
|
|
305
|
+
const parsed = parseFpsWithDefault(readCompositionFps(source) ?? void 0);
|
|
306
|
+
return fpsToNumber(parsed.ok ? parsed.value : { num: 30, den: 1 });
|
|
307
|
+
}
|
|
308
|
+
async function describeProject(indexPath, measure = measureWithFfprobe, sourceOverrides = /* @__PURE__ */ new Map()) {
|
|
309
|
+
const projectDir = dirname(indexPath);
|
|
310
|
+
const source = sourceOverrides.get(basename(indexPath)) ?? readFileSync(indexPath, "utf-8");
|
|
311
|
+
const doc = new DOMParser().parseFromString(source, "text/html");
|
|
312
|
+
const root = doc.querySelector("[data-composition-id]") ?? doc.body;
|
|
313
|
+
const dir = projectDir;
|
|
314
|
+
const scope = {
|
|
315
|
+
doc,
|
|
316
|
+
dir,
|
|
317
|
+
startCache: /* @__PURE__ */ new Map(),
|
|
318
|
+
projectDir: dir,
|
|
319
|
+
origin: 0,
|
|
320
|
+
file: basename(indexPath),
|
|
321
|
+
withProbeSlot: createProbeGate(PROBE_CONCURRENCY),
|
|
322
|
+
measure,
|
|
323
|
+
sourceOverrides,
|
|
324
|
+
fps: projectFps(source)
|
|
325
|
+
};
|
|
326
|
+
const rows = (await Promise.all(topLevelElements(toNode(root)).map((node) => describeRow(scope, node, 0)))).sort(byStart);
|
|
327
|
+
const declared = parseNumeric(root.getAttribute("data-duration"));
|
|
328
|
+
return {
|
|
329
|
+
duration: declared ?? rows.reduce((max, r) => Math.max(max, r.end), 0),
|
|
330
|
+
tracks: flatten(rows)
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export {
|
|
335
|
+
describeProject
|
|
336
|
+
};
|
|
@@ -6,10 +6,10 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
withOwner
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-V2FQQILJ.js";
|
|
10
10
|
import {
|
|
11
11
|
beginArtifactCapture
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JGYHWVXQ.js";
|
|
13
13
|
|
|
14
14
|
// src/utils/artifactCapture.ts
|
|
15
15
|
async function captureArtifactRevision(projectDir) {
|
|
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
getMimeType,
|
|
9
9
|
injectMediaCodecMapIntoHtml
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VD7WQYTO.js";
|
|
11
11
|
import {
|
|
12
12
|
PROXY_VARIANT_CONFIG,
|
|
13
13
|
ProxyCapacityError,
|
|
@@ -18,18 +18,75 @@ import {
|
|
|
18
18
|
recordProxyRequest,
|
|
19
19
|
resolveProxy,
|
|
20
20
|
resolveProxyVariantRequest
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-4ID635FL.js";
|
|
22
22
|
import {
|
|
23
23
|
resolveAutoProxy
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-GG37I7B3.js";
|
|
25
25
|
import {
|
|
26
26
|
decodeWellFormedEscapes
|
|
27
27
|
} from "./chunk-BSQ7XANM.js";
|
|
28
28
|
|
|
29
29
|
// src/utils/staticProjectServer.ts
|
|
30
|
-
import { createServer } from "http";
|
|
30
|
+
import { createServer, request as httpRequest } from "http";
|
|
31
|
+
import { Duplex } from "stream";
|
|
31
32
|
import { createReadStream, existsSync, statSync } from "fs";
|
|
32
33
|
import { isAbsolute, relative, resolve } from "path";
|
|
34
|
+
var REFUSED_LISTEN = /* @__PURE__ */ new Set(["EPERM", "EACCES"]);
|
|
35
|
+
function socketPair() {
|
|
36
|
+
const sides = [];
|
|
37
|
+
const side = (other) => new Duplex({
|
|
38
|
+
read() {
|
|
39
|
+
},
|
|
40
|
+
write(chunk, _encoding, done) {
|
|
41
|
+
other().push(chunk);
|
|
42
|
+
done();
|
|
43
|
+
},
|
|
44
|
+
final(done) {
|
|
45
|
+
other().push(null);
|
|
46
|
+
done();
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
sides.push(
|
|
50
|
+
side(() => sides[1]),
|
|
51
|
+
side(() => sides[0])
|
|
52
|
+
);
|
|
53
|
+
return [sides[0], sides[1]];
|
|
54
|
+
}
|
|
55
|
+
function answerInProcess(server, request) {
|
|
56
|
+
const [client, served] = socketPair();
|
|
57
|
+
server.emit("connection", served);
|
|
58
|
+
return new Promise((resolveAnswer, rejectAnswer) => {
|
|
59
|
+
const req = httpRequest(
|
|
60
|
+
{
|
|
61
|
+
method: request.method,
|
|
62
|
+
path: request.path,
|
|
63
|
+
headers: { ...request.headers, connection: "close" },
|
|
64
|
+
// No `agent`: Node uses createConnection only when no agent is given.
|
|
65
|
+
createConnection: () => client
|
|
66
|
+
},
|
|
67
|
+
(res) => {
|
|
68
|
+
const chunks = [];
|
|
69
|
+
res.on("data", (chunk) => chunks.push(chunk));
|
|
70
|
+
res.on("error", rejectAnswer);
|
|
71
|
+
res.on("end", () => {
|
|
72
|
+
const headers = {};
|
|
73
|
+
for (const [name, value] of Object.entries(res.headers)) {
|
|
74
|
+
if (value !== void 0 && name !== "connection" && name !== "transfer-encoding")
|
|
75
|
+
headers[name] = Array.isArray(value) ? value.join(", ") : value;
|
|
76
|
+
}
|
|
77
|
+
resolveAnswer({ status: res.statusCode ?? 500, headers, body: Buffer.concat(chunks) });
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
req.on("error", rejectAnswer);
|
|
82
|
+
req.end();
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
var inProcessServers = 0;
|
|
86
|
+
var inProcessAnswers = /* @__PURE__ */ new Map();
|
|
87
|
+
function inProcessAnswer(url) {
|
|
88
|
+
return inProcessAnswers.get(new URL(url).origin);
|
|
89
|
+
}
|
|
33
90
|
function serveFileWithRange(filePath, rangeHeader, res, contentType = getMimeType(filePath)) {
|
|
34
91
|
const size = statSync(filePath).size;
|
|
35
92
|
const headers = {
|
|
@@ -165,7 +222,24 @@ async function serveStaticProjectHtml(projectDir, html, bindErrorMessage = "Fail
|
|
|
165
222
|
if (!resolvedPort) rejectPort(new Error(bindErrorMessage));
|
|
166
223
|
else resolvePort(resolvedPort);
|
|
167
224
|
});
|
|
225
|
+
}).catch((error) => {
|
|
226
|
+
if (REFUSED_LISTEN.has(error.code ?? "")) return 0;
|
|
227
|
+
throw error;
|
|
168
228
|
});
|
|
229
|
+
if (port === 0) {
|
|
230
|
+
server.removeAllListeners("error");
|
|
231
|
+
const url = `http://hyperframes-${++inProcessServers}.localhost/`;
|
|
232
|
+
const answer = (request) => answerInProcess(server, request);
|
|
233
|
+
inProcessAnswers.set(new URL(url).origin, answer);
|
|
234
|
+
return {
|
|
235
|
+
url,
|
|
236
|
+
port: 0,
|
|
237
|
+
close: async () => {
|
|
238
|
+
inProcessAnswers.delete(new URL(url).origin);
|
|
239
|
+
},
|
|
240
|
+
answer
|
|
241
|
+
};
|
|
242
|
+
}
|
|
169
243
|
return {
|
|
170
244
|
url: `http://127.0.0.1:${port}/`,
|
|
171
245
|
port,
|
|
@@ -176,5 +250,6 @@ async function serveStaticProjectHtml(projectDir, html, bindErrorMessage = "Fail
|
|
|
176
250
|
}
|
|
177
251
|
|
|
178
252
|
export {
|
|
253
|
+
inProcessAnswer,
|
|
179
254
|
serveStaticProjectHtml
|
|
180
255
|
};
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
typeDirPath,
|
|
21
21
|
updateRecord,
|
|
22
22
|
withFigmaErrors
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-VZ6LCTOZ.js";
|
|
24
24
|
import {
|
|
25
25
|
defineCommand
|
|
26
26
|
} from "./chunk-S3S4TGEH.js";
|
|
@@ -229,7 +229,7 @@ var asset_default = defineCommand({
|
|
|
229
229
|
rendered > 0 ? `(${results.length} nodes, ${rendered} rendered in 1 figma request)` : `(${results.length} nodes, all reused from cache \u2014 no figma request)`
|
|
230
230
|
);
|
|
231
231
|
}
|
|
232
|
-
const { trackFigmaImport } = await import("./telemetry-
|
|
232
|
+
const { trackFigmaImport } = await import("./telemetry-7AWYECPL.js");
|
|
233
233
|
trackFigmaImport({
|
|
234
234
|
phase: "asset",
|
|
235
235
|
reused: results.every((r) => r.reused),
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-7KDQAD2W.js";
|
|
10
10
|
import {
|
|
11
11
|
runCancellableProcess
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-D3ZWBHZP.js";
|
|
13
13
|
import {
|
|
14
14
|
findFfBinary
|
|
15
15
|
} from "./chunk-VAS6HQX3.js";
|
|
@@ -202,7 +202,7 @@ function detectH264EncoderMode(ffmpegPath, gpuRequested) {
|
|
|
202
202
|
const encoders = execFileSync2(ffmpegPath, ["-hide_banner", "-encoders"], {
|
|
203
203
|
encoding: "utf-8",
|
|
204
204
|
stdio: ["ignore", "pipe", "pipe"],
|
|
205
|
-
timeout:
|
|
205
|
+
timeout: FIRST_LAUNCH_TIMEOUT_MS,
|
|
206
206
|
windowsHide: true
|
|
207
207
|
});
|
|
208
208
|
return resolveH264EncoderMode(encoders, gpuRequested);
|
|
@@ -210,7 +210,7 @@ function detectH264EncoderMode(ffmpegPath, gpuRequested) {
|
|
|
210
210
|
async function detectH264EncoderModeForRender(ffmpegPath, gpuRequested, signal) {
|
|
211
211
|
const result = await runCancellableProcess(ffmpegPath, ["-hide_banner", "-encoders"], {
|
|
212
212
|
signal,
|
|
213
|
-
timeoutMs:
|
|
213
|
+
timeoutMs: FIRST_LAUNCH_TIMEOUT_MS
|
|
214
214
|
});
|
|
215
215
|
return resolveH264EncoderMode(result.stdout, gpuRequested);
|
|
216
216
|
}
|
|
@@ -220,6 +220,7 @@ function findFFmpeg() {
|
|
|
220
220
|
function findFFprobe() {
|
|
221
221
|
return findFfBinary("ffprobe", { configuredMustExist: true });
|
|
222
222
|
}
|
|
223
|
+
var FIRST_LAUNCH_TIMEOUT_MS = 6e4;
|
|
223
224
|
var FFMPEG_DOWNLOAD_URL = "https://ffmpeg.org/download.html";
|
|
224
225
|
function getFFmpegInstallCommand() {
|
|
225
226
|
switch (process.platform) {
|
|
@@ -260,6 +261,7 @@ export {
|
|
|
260
261
|
detectH264EncoderModeForRender,
|
|
261
262
|
findFFmpeg,
|
|
262
263
|
findFFprobe,
|
|
264
|
+
FIRST_LAUNCH_TIMEOUT_MS,
|
|
263
265
|
getFFmpegInstallCommand,
|
|
264
266
|
getFFmpegInstallHint
|
|
265
267
|
};
|