hyperframes 0.8.159 → 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.
Files changed (171) hide show
  1. package/README.md +10 -0
  2. package/dist/{add-7UMRT6IJ.js → add-OGBTJCU4.js} +11 -11
  3. package/dist/{animatedGifPrep-COFZMEVD.js → animatedGifPrep-YAJTDXB7.js} +6 -6
  4. package/dist/api.js +16 -16
  5. package/dist/{asset-N37XIJTB.js → asset-DKQFFGPP.js} +2 -2
  6. package/dist/{assetCataloger-ZOQ67MGR.js → assetCataloger-BIDQA34M.js} +2 -2
  7. package/dist/audio-GK4OVVTH.js +2086 -0
  8. package/dist/{auth-GKFS2PL6.js → auth-AQMRAFXN.js} +1 -1
  9. package/dist/{autoUpdate-V4PLREDQ.js → autoUpdate-NFQB7V2X.js} +2 -2
  10. package/dist/{backgroundChecks-TVOKARY2.js → backgroundChecks-7JKE2FIU.js} +3 -3
  11. package/dist/backgroundChecksWorker.js +3 -3
  12. package/dist/{batchRender-IARQXQHN.js → batchRender-C2JCG5EK.js} +3 -3
  13. package/dist/{beats-FY4UDXBL.js → beats-C3ZSK2R2.js} +12 -12
  14. package/dist/{benchmark-ZJYFRFYF.js → benchmark-RRU67WEY.js} +8 -8
  15. package/dist/{browser-WRZOH4PD.js → browser-K4TP4ZM2.js} +5 -5
  16. package/dist/{bundleWithLocalizedFonts-SFHKZZAX.js → bundleWithLocalizedFonts-SLBVWQ7O.js} +2 -2
  17. package/dist/{capture-LLLIHYEF.js → capture-T2TBROMS.js} +2 -2
  18. package/dist/{capture-KFYPMVTT.js → capture-ZPRK3TOZ.js} +10 -10
  19. package/dist/{catalog-QO762U7V.js → catalog-IMIHQ4KX.js} +11 -11
  20. package/dist/{catch-up-MELHNTGB.js → catch-up-UY5MJWOG.js} +4 -4
  21. package/dist/{check-RX3LTKYB.js → check-6NAJSJHQ.js} +129 -118
  22. package/dist/{checkBrowser-EUUMEILI.js → checkBrowser-JWNQFYTY.js} +32 -30
  23. package/dist/{chunk-YIJMVFEJ.js → chunk-22QHO26F.js} +1 -1
  24. package/dist/{chunk-7F3B5YYT.js → chunk-2742O5DO.js} +178 -23
  25. package/dist/{chunk-HEEN6X6O.js → chunk-2ZLYSXZC.js} +8 -8
  26. package/dist/{chunk-5HNZQSO4.js → chunk-37LNY2EC.js} +1 -1
  27. package/dist/{chunk-6TDZJ43G.js → chunk-3XPVZLAR.js} +1 -1
  28. package/dist/{chunk-5RSV6DWB.js → chunk-4ID635FL.js} +1 -1
  29. package/dist/{chunk-4IKI2RYR.js → chunk-4VYNMVMC.js} +10 -10
  30. package/dist/chunk-6JR2XUEE.js +127 -0
  31. package/dist/{chunk-4D5RBIX6.js → chunk-6MCASYIS.js} +7 -7
  32. package/dist/{chunk-7XEVZDKU.js → chunk-7OFNPEKR.js} +7 -7
  33. package/dist/{chunk-BB2SFTMY.js → chunk-A2DMF2Q6.js} +6 -5
  34. package/dist/{chunk-MMYY4KV3.js → chunk-B5FZ2CQM.js} +1 -1
  35. package/dist/{chunk-IWOEAWIP.js → chunk-B7RUGHBT.js} +1 -1
  36. package/dist/{chunk-IJ7JPX4W.js → chunk-D2WGLWIK.js} +3 -3
  37. package/dist/{chunk-7RTTPSXG.js → chunk-D33YJZOH.js} +1 -1
  38. package/dist/{chunk-54DMWFQZ.js → chunk-D3ZWBHZP.js} +2 -15
  39. package/dist/{chunk-K5BMHQOU.js → chunk-D46G5IQH.js} +11 -11
  40. package/dist/{chunk-WWMFR4SH.js → chunk-DJZEIVAP.js} +3 -3
  41. package/dist/{chunk-EGJVFPUX.js → chunk-ERTJPFCH.js} +1 -1
  42. package/dist/{chunk-FEKRMXT6.js → chunk-EVRUR7DW.js} +1 -1
  43. package/dist/{chunk-DLQQA25O.js → chunk-FRGYHRP6.js} +1 -1
  44. package/dist/{chunk-UK4KRTIX.js → chunk-G642IIVK.js} +2 -2
  45. package/dist/{chunk-AEQWF7PE.js → chunk-GG37I7B3.js} +1 -1
  46. package/dist/chunk-GJQHHAAX.js +336 -0
  47. package/dist/{chunk-BEW7RCCW.js → chunk-GOASXWDD.js} +2 -2
  48. package/dist/{chunk-IKDBT5WT.js → chunk-GOTCGKX6.js} +3 -3
  49. package/dist/{chunk-HO3SITVT.js → chunk-ICZVCVD3.js} +1 -1
  50. package/dist/{chunk-5GPX4X4L.js → chunk-IGTGLGML.js} +2 -2
  51. package/dist/{chunk-KEGTYA7V.js → chunk-IK3SOMZ4.js} +5 -3
  52. package/dist/{chunk-6PIGOKTE.js → chunk-JGYHWVXQ.js} +339 -67
  53. package/dist/{chunk-NCVGBBWC.js → chunk-KRE55WLI.js} +1 -1
  54. package/dist/{chunk-JZLFHF2M.js → chunk-KWRBEDJI.js} +3 -3
  55. package/dist/{chunk-INNBWSZK.js → chunk-LYIG2GZ5.js} +2 -2
  56. package/dist/{chunk-ESOAYGIT.js → chunk-MMV6IY6U.js} +2 -2
  57. package/dist/{chunk-4DEBDQD4.js → chunk-MP676E4B.js} +2 -2
  58. package/dist/{chunk-24N3BB5M.js → chunk-MYGXKD7A.js} +5 -5
  59. package/dist/{chunk-3W3MOLRL.js → chunk-N2NDDTYW.js} +2 -2
  60. package/dist/{chunk-GGDCBVXK.js → chunk-OMJA7JP6.js} +5 -5
  61. package/dist/chunk-P47XYVEQ.js +3795 -0
  62. package/dist/{chunk-NIGOOCVS.js → chunk-P4QE7SSN.js} +1 -1
  63. package/dist/{chunk-AQXJC64X.js → chunk-PBNV5V5G.js} +1 -1
  64. package/dist/{chunk-A5RDOXZE.js → chunk-PINFPWRV.js} +5 -119
  65. package/dist/{chunk-2CEH75X3.js → chunk-PLEMSN3E.js} +2 -2
  66. package/dist/{chunk-DVAEX52Q.js → chunk-PPF65XAF.js} +1 -1
  67. package/dist/{chunk-V5J4XEBG.js → chunk-Q3TFX4OZ.js} +1 -1
  68. package/dist/{chunk-XSEGMQYA.js → chunk-QABAVWEX.js} +26 -3
  69. package/dist/{chunk-76NO4ZRM.js → chunk-RTS7BGEC.js} +1 -1
  70. package/dist/{chunk-H6BKVVU4.js → chunk-SB5DX6AD.js} +2 -2
  71. package/dist/{chunk-5YCFHCD4.js → chunk-SHVDJON6.js} +2 -2
  72. package/dist/{chunk-EWAAH7AU.js → chunk-TTFDAWCS.js} +1 -1
  73. package/dist/{chunk-MTUC2Z32.js → chunk-TU2CQJO3.js} +2 -2
  74. package/dist/{chunk-AFYZWHR7.js → chunk-V2FQQILJ.js} +2 -2
  75. package/dist/{chunk-ODE7HHNN.js → chunk-VD7WQYTO.js} +11 -9
  76. package/dist/{chunk-YITZFHRJ.js → chunk-VZ6LCTOZ.js} +1 -1
  77. package/dist/{chunk-SQHWDFTV.js → chunk-X3SCQP2A.js} +1 -1
  78. package/dist/{chunk-LBT4AMSF.js → chunk-XRKMITSS.js} +1 -1
  79. package/dist/{chunk-5O6I5ZV7.js → chunk-XTLV6UVP.js} +3 -3
  80. package/dist/{clean-RW7Z4XM6.js → clean-RRE6PMKZ.js} +18 -17
  81. package/dist/cli.js +54 -53
  82. package/dist/{cloud-EEOV7JKB.js → cloud-OIR6K7TS.js} +4 -4
  83. package/dist/{cloudrun-EZAXYVXG.js → cloudrun-BIQXBUDO.js} +3 -3
  84. package/dist/{compare-5UARQFXX.js → compare-E57W737I.js} +25 -24
  85. package/dist/{compiler-THI7BXZU.js → compiler-57M6W5WY.js} +3 -3
  86. package/dist/{component-AYOFPL33.js → component-I2O4AX56.js} +3 -3
  87. package/dist/{compositions-XJNJBOMG.js → compositions-B6NKZHIN.js} +10 -10
  88. package/dist/{delete-653AOR25.js → delete-DTUNBC6K.js} +2 -2
  89. package/dist/{dist-DLR4X3KN.js → dist-4JFB3WAR.js} +2 -2
  90. package/dist/{dist-2VXSQLXO.js → dist-ROVMAL74.js} +1 -1
  91. package/dist/{doctor-WA6VRRE7.js → doctor-SCNB73Z3.js} +12 -12
  92. package/dist/{events-XXBCP2I4.js → events-6LQNRKHZ.js} +3 -3
  93. package/dist/{events-U5COLUWT.js → events-Q37UJL36.js} +2 -2
  94. package/dist/{feedback-DX6Q3LN7.js → feedback-FOEBE2OW.js} +7 -7
  95. package/dist/{ffmpeg-2ROTISBL.js → ffmpeg-7BYARPLM.js} +4 -2
  96. package/dist/{figma-LCQVLBXF.js → figma-54MRTBKH.js} +3 -3
  97. package/dist/fontLocalizeCli.js +8 -8
  98. package/dist/{get-UYNPFMHX.js → get-EPGHM2SA.js} +2 -2
  99. package/dist/{gpuPolicy-YIW3HL3B.js → gpuPolicy-VGE3I5J4.js} +6 -6
  100. package/dist/{grade-compare-YQEYATJV.js → grade-compare-LOJWX6SK.js} +27 -26
  101. package/dist/{help-FDURC7WR.js → help-6FPZI3WP.js} +2 -1
  102. package/dist/{history-EU5UZLHT.js → history-GRXSUA5R.js} +8 -7
  103. package/dist/hyperframe-runtime.js +55 -55
  104. package/dist/hyperframe.manifest.json +1 -1
  105. package/dist/hyperframe.runtime.iife.js +55 -55
  106. package/dist/hyperframes-player.global.js +3 -3
  107. package/dist/{info-7T6CK6CL.js → info-LV7DFCLD.js} +7 -7
  108. package/dist/{init-KQYSKFVU.js → init-3J7BSAC3.js} +28 -28
  109. package/dist/{inspect-HQBV7VHS.js → inspect-5RON554C.js} +26 -25
  110. package/dist/{installer-OKKPQNKS.js → installer-T3STEB4U.js} +4 -4
  111. package/dist/{keyframes-SK74JHOA.js → keyframes-KHXTHI5C.js} +6 -6
  112. package/dist/{lambda-S2N4VTRO.js → lambda-4KCSMIM6.js} +4 -4
  113. package/dist/{layout-MTE5Y6DE.js → layout-DVWWT2TR.js} +26 -25
  114. package/dist/{lint-FJGGJYB7.js → lint-Q5WFB5ST.js} +7 -7
  115. package/dist/{lintProject-JGHKRO5L.js → lintProject-BGDYHF3F.js} +1 -1
  116. package/dist/{list-MBPALK5U.js → list-RFEUTW6N.js} +2 -2
  117. package/dist/{login-HDN4T5E4.js → login-WBHWA4M2.js} +4 -4
  118. package/dist/{manager-JNJE54OQ.js → manager-B6MVBM2E.js} +3 -3
  119. package/dist/{manager-ZLJD3EAY.js → manager-HEUPD2YB.js} +2 -2
  120. package/dist/{media-treatment-IP34DXWN.js → media-treatment-WRHVNWLS.js} +12 -11
  121. package/dist/{models-W5TASRHD.js → models-OA4MXEYG.js} +12 -12
  122. package/dist/{motionShot-2WYEMOPJ.js → motionShot-BZLRN3SS.js} +13 -13
  123. package/dist/{normalize-audio-F4NQPXII.js → normalize-audio-4YXE3RIF.js} +4 -4
  124. package/dist/{open-DRXNALDE.js → open-MCGYEFML.js} +4 -4
  125. package/dist/{parakeetRunner-VISBF2EA.js → parakeetRunner-DBLHMD5T.js} +13 -13
  126. package/dist/{pipeline-A2XOVZOM.js → pipeline-FSY65OQ4.js} +8 -8
  127. package/dist/{play-W2QELQX7.js → play-WXOV3BD7.js} +19 -18
  128. package/dist/{preflight-BH2XUQBS.js → preflight-G5KP7ZKA.js} +4 -4
  129. package/dist/{present-NHYRS4F4.js → present-RVG4J6CJ.js} +15 -14
  130. package/dist/{preview-SMJVUPXE.js → preview-PDUQR2JQ.js} +18 -18
  131. package/dist/{producer-276O3CKW.js → producer-C5V2A3YL.js} +1 -1
  132. package/dist/{projectConfig-FXFUHFPZ.js → projectConfig-X2IEHCSK.js} +6 -6
  133. package/dist/{publication-SSQO6ECV.js → publication-JEANCWBW.js} +2 -2
  134. package/dist/{publish-UHDKDXZI.js → publish-VX5OH4ST.js} +9 -9
  135. package/dist/{remove-background-IG6U56HC.js → remove-background-IXCISD26.js} +9 -9
  136. package/dist/{render-ZJPSLTKV.js → render-5BGU3FXU.js} +29 -28
  137. package/dist/{render-XQONIJEJ.js → render-ISUT7Q3X.js} +3 -3
  138. package/dist/{render-6P5RSFS3.js → render-JNJVFBFF.js} +9 -9
  139. package/dist/{render-batch-MH3Z6IPT.js → render-batch-2C6RUP3F.js} +3 -3
  140. package/dist/renderSetupWorker.js +4 -4
  141. package/dist/{resolver-JMSGO2JF.js → resolver-KTNKZVIB.js} +4 -4
  142. package/dist/{sherpa-64JLV4YM.js → sherpa-GFRG3TMM.js} +12 -12
  143. package/dist/skills/hyperframes-cli/SKILL.md +5 -4
  144. package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +8 -0
  145. package/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +1 -1
  146. package/dist/{skills-UXOL62PY.js → skills-LKJA27ZN.js} +5 -5
  147. package/dist/{skillsUpdateCheck-5Y6676K6.js → skillsUpdateCheck-RFZJKZC4.js} +3 -3
  148. package/dist/{snapshot-SQBPCXOV.js → snapshot-EOYA4MLG.js} +40 -30
  149. package/dist/{src-N42CT3YR.js → src-GPUDUKY6.js} +5 -5
  150. package/dist/{src-RQMK5INS.js → src-IMCQRH4P.js} +7 -7
  151. package/dist/{staticProjectServer-AQXVWMLU.js → staticProjectServer-S3NK3V4S.js} +15 -14
  152. package/dist/studio/assets/{hyperframes-player-kqB1psAJ.js → hyperframes-player-CXL23NEv.js} +1 -1
  153. package/dist/studio/assets/{index-C3AZLr-0.js → index-Bl_xrA5T.js} +1 -1
  154. package/dist/studio/assets/{index-BrViH8hj.js → index-CejKvBNw.js} +1 -1
  155. package/dist/studio/assets/{index-X_d1b5vz.js → index-D7BvLHtZ.js} +7 -7
  156. package/dist/studio/index.html +1 -1
  157. package/dist/{studio-api-GY5D7RAP.js → studio-api-YM5HLXUS.js} +13 -8
  158. package/dist/{studioServer-O3VONODG.js → studioServer-CEXJK5TC.js} +45 -44
  159. package/dist/{telemetry-V2K5P7CI.js → telemetry-7AWYECPL.js} +3 -3
  160. package/dist/{timeline-YU3YPLKB.js → timeline-G7H373XX.js} +42 -347
  161. package/dist/{tokens-NPSSSG2A.js → tokens-GYH7NXXA.js} +2 -2
  162. package/dist/{transcribe-FNBDG24U.js → transcribe-CIC7WAT5.js} +17 -17
  163. package/dist/{transcribe-BXJNS3RZ.js → transcribe-FL6NGWHF.js} +11 -11
  164. package/dist/{updateCheck-MB3RHSVK.js → updateCheck-MQ44KGUR.js} +2 -2
  165. package/dist/{upgrade-5VNRUR37.js → upgrade-OL47SID3.js} +2 -2
  166. package/dist/{urlDownloader-WCT7FMLA.js → urlDownloader-KDJGLR2Y.js} +5 -5
  167. package/dist/{usage-EC3KFUIJ.js → usage-HG4WMM7A.js} +33 -5
  168. package/dist/{validate-UXSXRCE6.js → validate-TDCH6X3C.js} +20 -19
  169. package/dist/{video-NRNQBZMV.js → video-AHO4CDCK.js} +6 -6
  170. package/package.json +1 -1
  171. package/dist/chunk-TWBTXEDZ.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-AFYZWHR7.js";
9
+ } from "./chunk-V2FQQILJ.js";
10
10
  import {
11
11
  beginArtifactCapture
12
- } from "./chunk-6PIGOKTE.js";
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-ODE7HHNN.js";
10
+ } from "./chunk-VD7WQYTO.js";
11
11
  import {
12
12
  PROXY_VARIANT_CONFIG,
13
13
  ProxyCapacityError,
@@ -18,10 +18,10 @@ import {
18
18
  recordProxyRequest,
19
19
  resolveProxy,
20
20
  resolveProxyVariantRequest
21
- } from "./chunk-5RSV6DWB.js";
21
+ } from "./chunk-4ID635FL.js";
22
22
  import {
23
23
  resolveAutoProxy
24
- } from "./chunk-AEQWF7PE.js";
24
+ } from "./chunk-GG37I7B3.js";
25
25
  import {
26
26
  decodeWellFormedEscapes
27
27
  } from "./chunk-BSQ7XANM.js";
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-XUXGIA7H.js";
30
30
  import {
31
31
  VERSION
32
- } from "./chunk-MTUC2Z32.js";
32
+ } from "./chunk-TU2CQJO3.js";
33
33
  import {
34
34
  CANARIES,
35
35
  canaryEnvVar,
@@ -20,7 +20,7 @@ import {
20
20
  typeDirPath,
21
21
  updateRecord,
22
22
  withFigmaErrors
23
- } from "./chunk-YITZFHRJ.js";
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-V2K5P7CI.js");
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-54DMWFQZ.js";
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: 5e3,
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: 5e3
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
  };