hyperframes 0.8.149 → 0.8.151

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 (176) hide show
  1. package/dist/{add-MG53577L.js → add-QKZZG7A2.js} +12 -12
  2. package/dist/{animatedGifPrep-HV4ZFVPV.js → animatedGifPrep-YQDPYGOD.js} +7 -7
  3. package/dist/api.js +17 -17
  4. package/dist/{asset-3GIBXLLL.js → asset-3Q737Y4H.js} +2 -2
  5. package/dist/{assetCataloger-JJQ4JW2P.js → assetCataloger-BTHEBJJB.js} +3 -3
  6. package/dist/{auth-XQMT727H.js → auth-XL7EU3SO.js} +1 -1
  7. package/dist/{autoUpdate-CREZJGMU.js → autoUpdate-PJFLTQ3U.js} +2 -2
  8. package/dist/{backgroundChecks-K3S5QKR3.js → backgroundChecks-T5TIR5WK.js} +3 -3
  9. package/dist/backgroundChecksWorker.js +3 -3
  10. package/dist/{batchRender-42AKNX73.js → batchRender-NFLVIDB4.js} +4 -4
  11. package/dist/{beats-Y7IKETUS.js → beats-JU4GZ26R.js} +13 -13
  12. package/dist/{benchmark-22SAXSO5.js → benchmark-7U2YWLTW.js} +9 -9
  13. package/dist/{browser-ABNISCC3.js → browser-D57UPYDA.js} +5 -5
  14. package/dist/{bundleWithLocalizedFonts-OE5ZI4JE.js → bundleWithLocalizedFonts-26MXQOZG.js} +2 -2
  15. package/dist/{capture-DBNHO4WJ.js → capture-47BV25G3.js} +2 -2
  16. package/dist/{capture-HQG5W42I.js → capture-LT252COQ.js} +11 -11
  17. package/dist/{catalog-KICZFIDX.js → catalog-BEZXOV4O.js} +12 -12
  18. package/dist/{catch-up-ZCQUCI45.js → catch-up-KVV5X6BF.js} +4 -4
  19. package/dist/{check-TGXIICEF.js → check-6KQ433E6.js} +191 -55
  20. package/dist/{checkBrowser-3N23I56J.js → checkBrowser-PRDR6XBY.js} +172 -30
  21. package/dist/{chunk-GESJSXFH.js → chunk-35PWWBGZ.js} +1 -1
  22. package/dist/{chunk-62RUQJ5J.js → chunk-3SVC7SW4.js} +47 -21
  23. package/dist/{chunk-KMJLHHBF.js → chunk-3ZPFRDEJ.js} +1 -1
  24. package/dist/{chunk-XHBX7QN6.js → chunk-4LE27ST4.js} +1 -1
  25. package/dist/{chunk-DUUFDLC4.js → chunk-4MLYMDQ4.js} +1 -1
  26. package/dist/{chunk-WX7VCRM7.js → chunk-4PKQEKAI.js} +2 -2
  27. package/dist/{chunk-ZKDKFJCK.js → chunk-4YZYYP7V.js} +5 -5
  28. package/dist/{chunk-XPQSL5VS.js → chunk-54DMWFQZ.js} +8 -1
  29. package/dist/{chunk-NKM53WMI.js → chunk-BRF3O35X.js} +7 -7
  30. package/dist/chunk-DHPFXAUF.js +165 -0
  31. package/dist/{chunk-CT6ZQRLD.js → chunk-DIOBKUBV.js} +2 -2
  32. package/dist/{chunk-SP6XL3NP.js → chunk-FAIYEIZ4.js} +1 -1
  33. package/dist/{chunk-CYFFYK2F.js → chunk-FLVI7FHU.js} +1 -1
  34. package/dist/{chunk-JDB65PPT.js → chunk-GNTVYF7E.js} +8 -7
  35. package/dist/{chunk-KQHJKJ3V.js → chunk-HVXRYMGQ.js} +1 -1
  36. package/dist/{chunk-CNPJHUOX.js → chunk-IP73NMQT.js} +11 -11
  37. package/dist/{chunk-VX4AL2FQ.js → chunk-IPDS2SWI.js} +1 -1
  38. package/dist/{chunk-LACFOFWX.js → chunk-IZ7L6V76.js} +1 -1
  39. package/dist/{chunk-VC7JBNPS.js → chunk-IZPN423R.js} +481 -68
  40. package/dist/{chunk-P7NTODQE.js → chunk-KQGWP4KH.js} +2 -2
  41. package/dist/{chunk-SFUBSJFP.js → chunk-KXX6NLOT.js} +1 -1
  42. package/dist/{chunk-K44HCHZN.js → chunk-L3N7RJHS.js} +3 -3
  43. package/dist/{chunk-MI6U3OIN.js → chunk-L6RIMCMG.js} +3 -3
  44. package/dist/{chunk-7IEGPJ4P.js → chunk-LBT4AMSF.js} +1 -1
  45. package/dist/{chunk-AY2BONTF.js → chunk-LKQS72D5.js} +1 -1
  46. package/dist/{chunk-VXM4BH23.js → chunk-N3I6RAOR.js} +136 -54
  47. package/dist/{chunk-Q2Y5OZCY.js → chunk-N4IXP3MY.js} +2 -2
  48. package/dist/{chunk-LCILS4AF.js → chunk-O3DUX6P2.js} +5 -5
  49. package/dist/{chunk-MXB6CWVH.js → chunk-OSAH7S5M.js} +1 -1
  50. package/dist/{chunk-YDRX42P3.js → chunk-OZ4K46OV.js} +3 -3
  51. package/dist/{chunk-ZK3BQXHC.js → chunk-POEEDPJI.js} +1 -1
  52. package/dist/{chunk-LTJDUBSQ.js → chunk-PUIELIFA.js} +1 -1
  53. package/dist/chunk-QBYHNRHU.js +3795 -0
  54. package/dist/{chunk-KUTT3JXL.js → chunk-QF7AE3DB.js} +3 -3
  55. package/dist/{chunk-BNYRD7PQ.js → chunk-QLGBNGXC.js} +2 -2
  56. package/dist/{chunk-U7SASZC5.js → chunk-RJRGR5KF.js} +10 -10
  57. package/dist/{chunk-4S4VUXW3.js → chunk-RRBKEHST.js} +1 -1
  58. package/dist/{chunk-TPIG7ZBX.js → chunk-RYL6ZIJP.js} +6 -6
  59. package/dist/{chunk-L274XRWA.js → chunk-S22FKF6G.js} +6 -3
  60. package/dist/{chunk-OMBSUO4T.js → chunk-TCWMDCBX.js} +2 -2
  61. package/dist/{chunk-YA62XGXS.js → chunk-UJKQWGFF.js} +1 -1
  62. package/dist/{chunk-M5B42RL5.js → chunk-WUUOFMHU.js} +3 -3
  63. package/dist/{chunk-PR7QQBSC.js → chunk-XGLNQDLN.js} +1 -1
  64. package/dist/{chunk-VGCEMOQA.js → chunk-XKKBIFE5.js} +7 -7
  65. package/dist/{chunk-2HWB4TCI.js → chunk-XNDXENJQ.js} +27 -12
  66. package/dist/{chunk-AHBYQRGI.js → chunk-XQKVEQNY.js} +2 -2
  67. package/dist/{chunk-ZFN6GQU4.js → chunk-XXPYZBZ3.js} +1 -1
  68. package/dist/{chunk-K4RIT6PX.js → chunk-XYHBVSWD.js} +2 -2
  69. package/dist/{chunk-RMIFSBRV.js → chunk-YEBKEWKB.js} +1 -1
  70. package/dist/{chunk-CZQLCBWY.js → chunk-YG2Y55KF.js} +1 -1
  71. package/dist/{chunk-B3XLIBFL.js → chunk-YIJMVFEJ.js} +1 -1
  72. package/dist/{chunk-K35E45SI.js → chunk-YZTVHRJ2.js} +1 -1
  73. package/dist/{chunk-Y475GD4L.js → chunk-ZD3RDNZI.js} +1 -1
  74. package/dist/{chunk-QIJLIULK.js → chunk-ZGCRVM5M.js} +2 -2
  75. package/dist/{clean-6QP7VAV4.js → clean-RLTHFTQA.js} +18 -18
  76. package/dist/cli.js +52 -52
  77. package/dist/{cloud-5TME5ROM.js → cloud-Q5TGBTW3.js} +4 -4
  78. package/dist/{cloudrun-F5VVCVF5.js → cloudrun-4UZF74MV.js} +4 -4
  79. package/dist/{compare-XPY2EXX6.js → compare-Q5UNR2V4.js} +25 -25
  80. package/dist/{compiler-NPD3MYMO.js → compiler-ZXT27Z62.js} +4 -4
  81. package/dist/{component-OPVL3PUX.js → component-H734P32V.js} +3 -3
  82. package/dist/{compositions-WSEOI454.js → compositions-YEHDSTDR.js} +11 -11
  83. package/dist/{delete-SLMH57VH.js → delete-LDBMPWRT.js} +2 -2
  84. package/dist/{dist-CUIR3GFX.js → dist-7JXLFD6U.js} +3 -3
  85. package/dist/{dist-HUMFCJ6T.js → dist-RGE4QASU.js} +1 -1
  86. package/dist/{doctor-QZW3EKIH.js → doctor-XNJFIWJ7.js} +13 -13
  87. package/dist/{events-FIFWFRGC.js → events-G6UFLNXR.js} +2 -2
  88. package/dist/{events-6C3ZG7LS.js → events-UKCPUWMH.js} +3 -3
  89. package/dist/{feedback-VKXM7YJ5.js → feedback-CK3KZ7DE.js} +7 -7
  90. package/dist/{ffmpeg-TZB5WAYE.js → ffmpeg-MJFMBBSF.js} +2 -2
  91. package/dist/{figma-3UYNADNA.js → figma-3D5C737B.js} +3 -3
  92. package/dist/fontLocalizeCli.js +9 -9
  93. package/dist/{get-VH7VMRVX.js → get-QGTQUWFT.js} +2 -2
  94. package/dist/{gpuPolicy-M2JZGGVW.js → gpuPolicy-G5QAQDYF.js} +7 -7
  95. package/dist/{grade-compare-OSC2YQWN.js → grade-compare-XIHOM62P.js} +27 -27
  96. package/dist/{help-DCBFEZPT.js → help-U5UBXT52.js} +1 -1
  97. package/dist/{history-XYJMQE26.js → history-5J73QZSA.js} +5 -5
  98. package/dist/hyperframe-runtime.js +65 -58
  99. package/dist/hyperframe.manifest.json +1 -1
  100. package/dist/hyperframe.runtime.iife.js +65 -58
  101. package/dist/hyperframes-player.global.js +3 -3
  102. package/dist/{info-YEHGENAH.js → info-RJHQQQUP.js} +8 -8
  103. package/dist/{init-64SML7PY.js → init-M6UQOYYC.js} +29 -29
  104. package/dist/{inspect-GFOQKRJI.js → inspect-PRQWDBTP.js} +26 -26
  105. package/dist/{installer-Q4MMZKLA.js → installer-ZL7UKYK5.js} +5 -5
  106. package/dist/{keyframes-ORYFWKBZ.js → keyframes-VMUJYTCQ.js} +6 -6
  107. package/dist/{lambda-DRMOJGTC.js → lambda-ON42DRQD.js} +5 -5
  108. package/dist/{layout-ZEQBE6UQ.js → layout-QKBFVDVY.js} +26 -26
  109. package/dist/{lint-67KGFY63.js → lint-ZQHHL2SV.js} +7 -7
  110. package/dist/{lintProject-SSEXWCH6.js → lintProject-3Z6OJCSO.js} +1 -1
  111. package/dist/{list-T6OU5ARJ.js → list-YBRKIWGF.js} +2 -2
  112. package/dist/{login-2PXIGDP7.js → login-4B2YXGLB.js} +4 -4
  113. package/dist/{manager-ES2UFT4X.js → manager-X44GKUEL.js} +3 -3
  114. package/dist/{manager-GWU5J6RJ.js → manager-ZLJD3EAY.js} +2 -2
  115. package/dist/{media-treatment-NAAHID6M.js → media-treatment-5C5EJAAP.js} +12 -12
  116. package/dist/{models-P6XB6RWK.js → models-R7ZDWBJ6.js} +13 -13
  117. package/dist/{motionShot-7MHRIV6V.js → motionShot-ZHESZNUL.js} +14 -14
  118. package/dist/{normalize-audio-LWNFYR2F.js → normalize-audio-EVWZVTBM.js} +6 -6
  119. package/dist/{open-DAP5C7UD.js → open-TV6HT4UT.js} +4 -4
  120. package/dist/{parakeetRunner-3ZVFPOD4.js → parakeetRunner-YVVF4CG6.js} +14 -14
  121. package/dist/{pipeline-V4YJCPUX.js → pipeline-ETR5SEBS.js} +9 -9
  122. package/dist/{play-UDCESJO3.js → play-C6WONRZV.js} +19 -19
  123. package/dist/{preflight-JOD4OXGC.js → preflight-JYOX64YP.js} +4 -4
  124. package/dist/{present-DXTHBH3F.js → present-RANXTVPA.js} +15 -15
  125. package/dist/{preview-YHXKRXKB.js → preview-KF6UMBT2.js} +19 -19
  126. package/dist/{producer-343ENLAM.js → producer-CY2GXBWN.js} +1 -1
  127. package/dist/{projectConfig-YXKU3CTB.js → projectConfig-KPXCNMBM.js} +7 -7
  128. package/dist/{publication-ODXP3JI7.js → publication-Y36N4A7E.js} +3 -3
  129. package/dist/{publish-UEFBFGV3.js → publish-RCQJO35C.js} +9 -9
  130. package/dist/{remove-background-FMV6IDOH.js → remove-background-3ZMXVWLB.js} +10 -10
  131. package/dist/{render-ZTXNPRGF.js → render-FKVRCDT2.js} +58 -35
  132. package/dist/{render-N7QGX6RJ.js → render-PTNEFO5U.js} +9 -9
  133. package/dist/{render-SYC4RPGT.js → render-WUSTRMUD.js} +4 -4
  134. package/dist/{render-batch-SZRPCRUJ.js → render-batch-AQHU2JWZ.js} +4 -4
  135. package/dist/renderSetupWorker.js +4 -4
  136. package/dist/{resolver-7MYXNEAX.js → resolver-L5BDZJKU.js} +5 -5
  137. package/dist/{sherpa-M4Z2Q5Y2.js → sherpa-3S3ISG7G.js} +13 -13
  138. package/dist/skills/hyperframes/references/frame-worker-core.md +11 -9
  139. package/dist/skills/hyperframes/references/subagent-dispatch.md +1 -1
  140. package/dist/skills/media-use/audio/scripts/lib/tts.cleanup.test.mjs +175 -0
  141. package/dist/skills/media-use/audio/scripts/lib/tts.mjs +24 -19
  142. package/dist/skills/media-use/references/grading.md +1 -2
  143. package/dist/skills/media-use/references/meta.md +17 -17
  144. package/dist/skills/media-use/references/operations.md +6 -6
  145. package/dist/skills/media-use/references/setup-providers.md +3 -4
  146. package/dist/skills/media-use/scripts/lib/cutlist.mjs +9 -2
  147. package/dist/skills/media-use/scripts/lib/cutlist.test.mjs +12 -0
  148. package/dist/skills/media-use/scripts/lib/telemetry.mjs +4 -1
  149. package/dist/skills/media-use/scripts/lib/telemetry.test.mjs +20 -0
  150. package/dist/skills/media-use/scripts/transcript-cut.mjs +23 -4
  151. package/dist/skills/media-use/scripts/transcript-cut.test.mjs +224 -0
  152. package/dist/{skills-NEHNSHZK.js → skills-X4WQEKNF.js} +5 -5
  153. package/dist/{skillsUpdateCheck-O77QR72A.js → skillsUpdateCheck-UYCVHDZ6.js} +3 -3
  154. package/dist/{snapshot-GDVXFBVY.js → snapshot-YEYHQEZQ.js} +252 -141
  155. package/dist/{src-VMTHSARJ.js → src-2NN2WB6X.js} +10 -6
  156. package/dist/{src-PTIV7IVV.js → src-OLBDPEG6.js} +8 -8
  157. package/dist/{staticProjectServer-3D2NXQ6W.js → staticProjectServer-7H35NMWB.js} +15 -15
  158. package/dist/studio/assets/{hyperframes-player-C-2YwYre.js → hyperframes-player-DJt8E7k4.js} +1 -1
  159. package/dist/studio/assets/{index-ByJU5J6n.js → index-BGks9KLI.js} +131 -131
  160. package/dist/studio/assets/{index-BybGk67U.js → index-DWIHrAY2.js} +1 -1
  161. package/dist/studio/assets/{index-Cfs2r3fz.js → index-DgbLblGR.js} +1 -1
  162. package/dist/studio/index.html +1 -1
  163. package/dist/{studio-api-XIBDLRHB.js → studio-api-HGM2A5I3.js} +9 -9
  164. package/dist/{studioServer-QIQK47UN.js → studioServer-M6XFL7N6.js} +45 -45
  165. package/dist/{telemetry-565KDZUW.js → telemetry-KVCZKVTE.js} +3 -3
  166. package/dist/{timeline-E6XB7I6W.js → timeline-VYYKZR4V.js} +68 -15
  167. package/dist/{tokens-3ZAJENSE.js → tokens-B5NFFL55.js} +2 -2
  168. package/dist/{transcribe-XWQQCCBG.js → transcribe-SBETOIWI.js} +12 -12
  169. package/dist/{transcribe-WODP3T77.js → transcribe-WNFRYZAC.js} +18 -18
  170. package/dist/{updateCheck-QPYU4GRL.js → updateCheck-5MM2DFUC.js} +2 -2
  171. package/dist/{upgrade-2FJ5ZEN6.js → upgrade-LWID54R3.js} +2 -2
  172. package/dist/{urlDownloader-352AY25I.js → urlDownloader-CVLNXFDG.js} +6 -6
  173. package/dist/{validate-SP2VGNEI.js → validate-V4CGQ6OF.js} +20 -20
  174. package/dist/{video-RVNPFEA6.js → video-VJB2KRSS.js} +7 -7
  175. package/package.json +1 -1
  176. package/dist/chunk-3WD4JNMU.js +0 -3795
@@ -21,7 +21,7 @@ import {
21
21
  splitElementInHtml,
22
22
  unwrapElementsFromHtml,
23
23
  wrapElementsInHtml
24
- } from "./chunk-2HWB4TCI.js";
24
+ } from "./chunk-XNDXENJQ.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-ZFN6GQU4.js";
46
+ } from "./chunk-XXPYZBZ3.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-KMJLHHBF.js";
68
+ } from "./chunk-3ZPFRDEJ.js";
69
69
  import {
70
70
  STUDIO_MOTION_PATH,
71
71
  createStudioMotionRenderBodyScript,
@@ -98,7 +98,7 @@ import {
98
98
  } from "./chunk-EOVYQ3IG.js";
99
99
  import {
100
100
  addScenePartsManifest
101
- } from "./chunk-62RUQJ5J.js";
101
+ } from "./chunk-3SVC7SW4.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-AHBYQRGI.js";
114
+ } from "./chunk-XQKVEQNY.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-3WD4JNMU.js";
128
+ } from "./chunk-QBYHNRHU.js";
129
129
  import {
130
130
  HTML_ATTRIBUTE_ENTITIES,
131
131
  MagicString,
@@ -5446,7 +5446,7 @@ async function prepareGsapMutationScript(c, res, firstMutation) {
5446
5446
  let block = extractGsapScriptBlock(html);
5447
5447
  if (!block && (firstMutation.type === "add" || firstMutation.type === "add-with-keyframes")) {
5448
5448
  const compId = html.match(/data-composition-id="([^"]+)"/)?.[1] ?? "main";
5449
- const { GSAP_CDN } = await import("./dist-CUIR3GFX.js");
5449
+ const { GSAP_CDN } = await import("./dist-7JXLFD6U.js");
5450
5450
  const bootstrap = [
5451
5451
  `<script src="${GSAP_CDN}"></script>`,
5452
5452
  "<script>",
@@ -0,0 +1,165 @@
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/utils/toolContext.ts
9
+ import { appendFileSync } from "fs";
10
+ import { extname, isAbsolute, resolve } from "path";
11
+ var TOOL_CONTEXT_VERSION = 1;
12
+ var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
13
+ function parseEvents(value) {
14
+ if (!isRecord(value) || !isRecord(value.transport)) return void 0;
15
+ const { type, path } = value.transport;
16
+ if (type !== "ndjson-file" || typeof path !== "string" || !isAbsolute(path)) return void 0;
17
+ return { path };
18
+ }
19
+ function parseProjectLock(value) {
20
+ if (!isRecord(value)) return void 0;
21
+ const { waitMs } = value;
22
+ if (typeof waitMs !== "number" || !Number.isFinite(waitMs) || waitMs < 0) return void 0;
23
+ return { waitMs };
24
+ }
25
+ function readToolContext(raw = process.env.HF_TOOL_CONTEXT) {
26
+ if (!raw) return {};
27
+ let value;
28
+ try {
29
+ value = JSON.parse(raw);
30
+ } catch {
31
+ return {};
32
+ }
33
+ if (!isRecord(value) || value.version !== TOOL_CONTEXT_VERSION || !isRecord(value.capabilities))
34
+ return {};
35
+ const events = parseEvents(value.capabilities.events);
36
+ const projectLock = parseProjectLock(value.capabilities["project-lock"]);
37
+ return { ...events && { events }, ...projectLock && { projectLock } };
38
+ }
39
+ var MEDIA_TYPES = {
40
+ ".png": "image/png",
41
+ ".jpg": "image/jpeg",
42
+ ".jpeg": "image/jpeg"
43
+ };
44
+ function reportArtifacts(command, role, paths, context = readToolContext()) {
45
+ if (!context.events || paths.length === 0) return;
46
+ const lines = paths.map((path) => {
47
+ const absolute = resolve(path);
48
+ const event = {
49
+ version: TOOL_CONTEXT_VERSION,
50
+ type: "artifact.created",
51
+ command,
52
+ artifact: {
53
+ role,
54
+ path: absolute,
55
+ mediaType: MEDIA_TYPES[extname(absolute).toLowerCase()] ?? "application/octet-stream"
56
+ }
57
+ };
58
+ return JSON.stringify(event) + "\n";
59
+ });
60
+ try {
61
+ appendFileSync(context.events.path, lines.join(""));
62
+ } catch (error) {
63
+ console.error(`HF_TOOL_CONTEXT events could not be written: ${error.message}`);
64
+ }
65
+ }
66
+
67
+ // src/utils/projectLock.ts
68
+ import { linkSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "fs";
69
+ import { dirname, join } from "path";
70
+ import { setTimeout as sleep } from "timers/promises";
71
+ var ProjectLockTimeout = class extends Error {
72
+ };
73
+ var POLL_MS = 250;
74
+ var projectLockPath = (projectDir) => join(projectDir, ".hyperframes", "project.lock");
75
+ function readHolder(path) {
76
+ try {
77
+ return JSON.parse(readFileSync(path, "utf8"));
78
+ } catch {
79
+ return null;
80
+ }
81
+ }
82
+ function alive(pid) {
83
+ try {
84
+ process.kill(pid, 0);
85
+ return true;
86
+ } catch (error) {
87
+ return error.code === "EPERM";
88
+ }
89
+ }
90
+ var sameHolder = (a, b) => a?.pid === b.pid && a.startedAt === b.startedAt && a.command === b.command;
91
+ function breakStaleHolder(path, current, holder) {
92
+ const breakPath = `${path}.break`;
93
+ const breakDraft = `${breakPath}.${holder.pid}.${holder.startedAt}`;
94
+ let acquired = false;
95
+ writeFileSync(breakDraft, JSON.stringify(holder), { flag: "wx" });
96
+ try {
97
+ try {
98
+ linkSync(breakDraft, breakPath);
99
+ } catch (error) {
100
+ if (error.code === "EEXIST") return false;
101
+ throw error;
102
+ }
103
+ if (sameHolder(readHolder(path), current)) {
104
+ try {
105
+ unlinkSync(path);
106
+ } catch (error) {
107
+ if (error.code !== "ENOENT") throw error;
108
+ }
109
+ }
110
+ acquired = tryAcquire(path, holder);
111
+ } finally {
112
+ unlinkSync(breakDraft);
113
+ if (sameHolder(readHolder(breakPath), holder)) unlinkSync(breakPath);
114
+ }
115
+ return acquired;
116
+ }
117
+ function tryAcquire(path, holder) {
118
+ const draft = `${path}.${holder.pid}.${holder.startedAt}`;
119
+ writeFileSync(draft, JSON.stringify(holder), { flag: "wx" });
120
+ try {
121
+ linkSync(draft, path);
122
+ return true;
123
+ } catch (error) {
124
+ if (error.code !== "EEXIST") throw error;
125
+ } finally {
126
+ unlinkSync(draft);
127
+ }
128
+ const current = readHolder(path);
129
+ if (current && !alive(current.pid)) return breakStaleHolder(path, current, holder);
130
+ return false;
131
+ }
132
+ async function withProjectLock(projectDir, command, run, context = readToolContext()) {
133
+ if (!context.projectLock) return run();
134
+ const path = projectLockPath(projectDir);
135
+ mkdirSync(dirname(path), { recursive: true });
136
+ const holder = { pid: process.pid, command, startedAt: Date.now() };
137
+ const deadline = holder.startedAt + context.projectLock.waitMs;
138
+ while (!tryAcquire(path, holder)) {
139
+ const remaining = deadline - Date.now();
140
+ if (remaining <= 0) {
141
+ const current = readHolder(path);
142
+ const breakPath = `${path}.break`;
143
+ const breaker = readHolder(breakPath);
144
+ if ((!current || !alive(current.pid)) && breaker && !alive(breaker.pid)) {
145
+ throw new ProjectLockTimeout(
146
+ `hyperframes left ${breakPath} (pid ${breaker.pid}); delete it to continue`
147
+ );
148
+ }
149
+ throw new ProjectLockTimeout(
150
+ `hyperframes ${current?.command ?? "another command"} (pid ${current?.pid ?? "unknown"}) is still using this project after ${Math.round(context.projectLock.waitMs / 1e3)}s`
151
+ );
152
+ }
153
+ await sleep(Math.min(POLL_MS, remaining));
154
+ }
155
+ try {
156
+ return await run();
157
+ } finally {
158
+ if (sameHolder(readHolder(path), holder)) unlinkSync(path);
159
+ }
160
+ }
161
+
162
+ export {
163
+ reportArtifacts,
164
+ withProjectLock
165
+ };
@@ -21,10 +21,10 @@ import {
21
21
  emitWords,
22
22
  getPreparedWavDurationSeconds,
23
23
  prepareWav
24
- } from "./chunk-KUTT3JXL.js";
24
+ } from "./chunk-QF7AE3DB.js";
25
25
  import {
26
26
  stoppedByCancelSignal
27
- } from "./chunk-P7NTODQE.js";
27
+ } from "./chunk-KQGWP4KH.js";
28
28
  import {
29
29
  PARAKEET_MODEL_LABEL,
30
30
  SHERPA_ERROR_PREFIX,
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-HVW7ABXD.js";
13
13
  import {
14
14
  DEFAULT_REGISTRY_URL
15
- } from "./chunk-K35E45SI.js";
15
+ } from "./chunk-YZTVHRJ2.js";
16
16
 
17
17
  // src/utils/projectConfig.ts
18
18
  import { readFileSync, writeFileSync } from "fs";
@@ -10,7 +10,7 @@ import {
10
10
  isDevice,
11
11
  isQuality,
12
12
  render
13
- } from "./chunk-L274XRWA.js";
13
+ } from "./chunk-S22FKF6G.js";
14
14
 
15
15
  // src/api/removeBackground.ts
16
16
  import { resolve } from "path";
@@ -10390,6 +10390,9 @@ var MASK_IMAGE_URL_RE = /\b(?:-webkit-)?mask-image\s*:\s*[^;{}]*url\(\s*(?:"([^"
10390
10390
  function isLocalStylesheetHref(href) {
10391
10391
  return !!href && !/^(https?:|data:|blob:|\/\/)/i.test(href);
10392
10392
  }
10393
+ function staysInsideProjectRoot(href) {
10394
+ return !href.startsWith("/") && !href.split("/").includes("..");
10395
+ }
10393
10396
  function collectLocalStylesheets(projectDir, document, compSrcPath) {
10394
10397
  const styles = [];
10395
10398
  for (const link of querySelectorAllIncludingTemplates(document, "link")) {
@@ -10397,14 +10400,12 @@ function collectLocalStylesheets(projectDir, document, compSrcPath) {
10397
10400
  if (!rel.split(/\s+/).some((part) => part.toLowerCase() === "stylesheet")) continue;
10398
10401
  const href = link.getAttribute("href") ?? "";
10399
10402
  if (!isLocalStylesheetHref(href)) continue;
10400
- const rootRelative = compSrcPath ? join2(dirname(compSrcPath), href) : href;
10401
- const stylesheet = resolveExistingLocalAsset(projectDir, rootRelative);
10403
+ const besideFile = compSrcPath ? join2(dirname(compSrcPath), href) : href;
10404
+ const stylesheet = resolveExistingLocalAsset(projectDir, besideFile) ?? (compSrcPath && staysInsideProjectRoot(href) ? resolveExistingLocalAsset(projectDir, href) : null);
10402
10405
  if (!stylesheet) continue;
10403
- styles.push({
10404
- href,
10405
- content: readFileSync(stylesheet.resolved, "utf-8"),
10406
- rootRelativePath: stylesheet.rootRelativePath
10407
- });
10406
+ const read = readProjectFile(stylesheet.resolved);
10407
+ if (read.kind !== "file") continue;
10408
+ styles.push({ href, content: read.text, rootRelativePath: stylesheet.rootRelativePath });
10408
10409
  }
10409
10410
  return styles;
10410
10411
  }
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-PBN6GBJE.js";
16
16
  import {
17
17
  parseFps
18
- } from "./chunk-AHBYQRGI.js";
18
+ } from "./chunk-XQKVEQNY.js";
19
19
 
20
20
  // src/browser/windowsCrash.ts
21
21
  var STATUS_STACK_BUFFER_OVERRUN_DEC = "3221225595";
@@ -9,17 +9,17 @@ import {
9
9
  resolveCliChromeGpuMode,
10
10
  seekCompositionTimeline,
11
11
  waitForRuntimeReady
12
- } from "./chunk-TPIG7ZBX.js";
12
+ } from "./chunk-RYL6ZIJP.js";
13
13
  import {
14
14
  resolveCompositionViewportFromHtml
15
15
  } from "./chunk-FH7WODJH.js";
16
16
  import {
17
17
  launchManagedBrowser,
18
18
  resolveManagedGpuMode
19
- } from "./chunk-4S4VUXW3.js";
19
+ } from "./chunk-RRBKEHST.js";
20
20
  import {
21
21
  resolveProject
22
- } from "./chunk-SFUBSJFP.js";
22
+ } from "./chunk-KXX6NLOT.js";
23
23
  import {
24
24
  defineCommand
25
25
  } from "./chunk-S3S4TGEH.js";
@@ -33,7 +33,7 @@ import {
33
33
  import {
34
34
  printDeprecationNotice,
35
35
  withMeta
36
- } from "./chunk-GESJSXFH.js";
36
+ } from "./chunk-35PWWBGZ.js";
37
37
  import {
38
38
  decodeWellFormedEscapes
39
39
  } from "./chunk-BSQ7XANM.js";
@@ -228,7 +228,7 @@ function extractCompositionErrorsFromLint(lintResult) {
228
228
  async function localizeRemoteAssets(html) {
229
229
  let dir;
230
230
  try {
231
- const { loadProducer } = await import("./producer-343ENLAM.js");
231
+ const { loadProducer } = await import("./producer-CY2GXBWN.js");
232
232
  const { localizeRemoteMediaSources, localizeRemoteImageSources, localizeRemoteFontFaces } = await loadProducer();
233
233
  dir = mkdtempSync(join(tmpdir(), "hf-validate-assets-"));
234
234
  const assetDir = dir;
@@ -249,10 +249,10 @@ async function localizeRemoteAssets(html) {
249
249
  }
250
250
  async function validateInBrowser(project, opts) {
251
251
  const projectDir = project.dir;
252
- const { bundleToSingleHtml } = await import("./compiler-NPD3MYMO.js");
253
- const { ensureBrowser } = await import("./manager-GWU5J6RJ.js");
254
- const { serveStaticProjectHtml } = await import("./staticProjectServer-3D2NXQ6W.js");
255
- const { lintProject } = await import("./lintProject-SSEXWCH6.js");
252
+ const { bundleToSingleHtml } = await import("./compiler-ZXT27Z62.js");
253
+ const { ensureBrowser } = await import("./manager-ZLJD3EAY.js");
254
+ const { serveStaticProjectHtml } = await import("./staticProjectServer-7H35NMWB.js");
255
+ const { lintProject } = await import("./lintProject-3Z6OJCSO.js");
256
256
  const lintResult = await lintProject(projectDir);
257
257
  const compositionErrors = extractCompositionErrorsFromLint(lintResult);
258
258
  const html = await bundleToSingleHtml(projectDir);
@@ -273,9 +273,9 @@ async function validateInBrowser(project, opts) {
273
273
  try {
274
274
  const browser = await ensureBrowser();
275
275
  const puppeteer = await import("puppeteer-core");
276
- const { buildChromeArgs, analyzeClipMediaFit } = await import("./src-VMTHSARJ.js");
276
+ const { buildChromeArgs, analyzeClipMediaFit } = await import("./src-2NN2WB6X.js");
277
277
  const requestedGpuMode = resolveCliChromeGpuMode();
278
- const { assertWebGpuAdapterAvailable, compositionRequiresWebGpu, resolveLocalWebGpu } = await import("./gpuPolicy-M2JZGGVW.js");
278
+ const { assertWebGpuAdapterAvailable, compositionRequiresWebGpu, resolveLocalWebGpu } = await import("./gpuPolicy-G5QAQDYF.js");
279
279
  const resolvedGpuMode = await resolveManagedGpuMode(requestedGpuMode, browser.executablePath);
280
280
  const requiresWebGpu = compositionRequiresWebGpu(html);
281
281
  const { gpuConfig, softwareWebGpu } = resolveLocalWebGpu(resolvedGpuMode, requiresWebGpu);
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  sherpaParakeetInstalled,
9
9
  sherpaUnsupportedReason
10
- } from "./chunk-CT6ZQRLD.js";
10
+ } from "./chunk-DIOBKUBV.js";
11
11
  import {
12
12
  findParakeet
13
13
  } from "./chunk-JZIEZCQM.js";
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-XUXGIA7H.js";
30
30
  import {
31
31
  VERSION
32
- } from "./chunk-OMBSUO4T.js";
32
+ } from "./chunk-TCWMDCBX.js";
33
33
  import {
34
34
  CANARIES,
35
35
  canaryEnvVar,