hyperframes 0.8.173 → 0.8.174

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 (184) hide show
  1. package/dist/{add-V7VBTFNG.js → add-XANMFNIP.js} +14 -15
  2. package/dist/{animatedGifPrep-62S72ZY6.js → animatedGifPrep-OUQ4M2T3.js} +9 -11
  3. package/dist/api.js +19 -21
  4. package/dist/{asset-Z4JI2F6V.js → asset-SVONSQ67.js} +2 -2
  5. package/dist/{assetCataloger-Q7LE7BCC.js → assetCataloger-AG77T6SF.js} +9 -11
  6. package/dist/{audio-HIHNLQJ7.js → audio-DMQOTXKL.js} +16 -18
  7. package/dist/{auth-4K6DSZCD.js → auth-ED7SPBS6.js} +2 -2
  8. package/dist/{autoUpdate-DXZDD5VT.js → autoUpdate-4QQYZOVT.js} +2 -2
  9. package/dist/{backgroundChecks-ODMKKJ4S.js → backgroundChecks-2VT46P5S.js} +3 -3
  10. package/dist/backgroundChecksWorker.js +3 -3
  11. package/dist/{batchRender-I4BFJGPA.js → batchRender-KIYAPCTG.js} +4 -4
  12. package/dist/{beats-7QCA6GDR.js → beats-OE7M5BEE.js} +6 -7
  13. package/dist/{benchmark-IT4WTSMZ.js → benchmark-2ZQP2RNF.js} +11 -12
  14. package/dist/{browser-5VHM72PM.js → browser-CSSJ3VWW.js} +5 -6
  15. package/dist/{bundleWithLocalizedFonts-MKTQCB2Y.js → bundleWithLocalizedFonts-ZUC4MLSO.js} +2 -2
  16. package/dist/{capture-CMNNIMIL.js → capture-3NXAHID3.js} +2 -2
  17. package/dist/{capture-B5Y45EWD.js → capture-APNSW4ZT.js} +22 -18
  18. package/dist/{catalog-AKPJ65GY.js → catalog-CFDBIVSC.js} +15 -16
  19. package/dist/{catch-up-2SVYRMD3.js → catch-up-OUK522JT.js} +6 -7
  20. package/dist/{check-Q7AX6K7O.js → check-PUDEOXGP.js} +37 -39
  21. package/dist/{checkBrowser-CPXD5BZY.js → checkBrowser-PMRJSTFJ.js} +34 -36
  22. package/dist/chunk-2CDBTQKS.js +113 -0
  23. package/dist/{chunk-KR5ZHRF2.js → chunk-2XSAYE7U.js} +2 -2
  24. package/dist/{chunk-QVPOR7WE.js → chunk-32GKETR7.js} +22 -1
  25. package/dist/{chunk-BTPZ74Z3.js → chunk-3MDO2Q4F.js} +1 -1
  26. package/dist/{chunk-3O45NOL7.js → chunk-4PX47Z65.js} +1 -1
  27. package/dist/{chunk-IK3SOMZ4.js → chunk-4VTUDCHM.js} +19 -22
  28. package/dist/{chunk-NOMPG5HQ.js → chunk-4WQUBVDO.js} +3 -3
  29. package/dist/{chunk-HCOL75LA.js → chunk-55LJK3H2.js} +3 -3
  30. package/dist/{chunk-H5C375DW.js → chunk-6HF2WFPV.js} +5 -5
  31. package/dist/{chunk-BCPJSBCS.js → chunk-ALCCEHX2.js} +7 -3
  32. package/dist/{chunk-XDPXSQJO.js → chunk-APMA7XXB.js} +1 -1
  33. package/dist/{chunk-L4SFGSSQ.js → chunk-AR2SEGPZ.js} +1 -1
  34. package/dist/{chunk-ETPPGNJB.js → chunk-B23GBPCW.js} +2 -2
  35. package/dist/{chunk-4RDDUBOC.js → chunk-CI7ZHFSV.js} +11 -11
  36. package/dist/chunk-CIWX5UKC.js +16 -0
  37. package/dist/{chunk-4D2T6Y5Y.js → chunk-CSMKMVGG.js} +6 -6
  38. package/dist/{chunk-BYRHCRU3.js → chunk-D2YN4FNH.js} +2 -2
  39. package/dist/{chunk-PBVUVNWP.js → chunk-DRR3UMIY.js} +1 -1
  40. package/dist/{chunk-TNHRCZT3.js → chunk-EAR5LFOH.js} +42 -2
  41. package/dist/{chunk-5JTRGGTX.js → chunk-EJZJ5AY7.js} +1 -1
  42. package/dist/{chunk-ODR7V2JL.js → chunk-G4UUEQDT.js} +1 -1
  43. package/dist/{chunk-2TNPXPI5.js → chunk-GK2FIKIQ.js} +10 -8
  44. package/dist/{chunk-CBOYQOLY.js → chunk-GXWV4FNV.js} +1 -1
  45. package/dist/{chunk-QURKHVV5.js → chunk-H2BPHBDY.js} +1 -1
  46. package/dist/{chunk-X3SCQP2A.js → chunk-HB2UP4V7.js} +1 -1
  47. package/dist/chunk-HIP62XAW.js +36 -0
  48. package/dist/{chunk-6JQDH4O6.js → chunk-HIYAJFRH.js} +1 -1
  49. package/dist/{chunk-45IAFBUP.js → chunk-HZZYJV7K.js} +14 -14
  50. package/dist/{chunk-A2DMF2Q6.js → chunk-HZZZ6C6Z.js} +2 -2
  51. package/dist/{chunk-XZNKIYIG.js → chunk-JKPI7VLI.js} +1 -1
  52. package/dist/{chunk-TWZRU64W.js → chunk-JL76Y45C.js} +7 -7
  53. package/dist/{chunk-KRWEUM4R.js → chunk-LR72ON5B.js} +1 -1
  54. package/dist/{chunk-C4QGOXO2.js → chunk-LUKY7253.js} +491 -133
  55. package/dist/{chunk-2QJDC4NT.js → chunk-MXNPYP5F.js} +1 -1
  56. package/dist/{chunk-VFCKXTBB.js → chunk-NL5F3AD4.js} +27 -38
  57. package/dist/{chunk-WIAO42MD.js → chunk-ONXTLGJB.js} +5 -5
  58. package/dist/{chunk-N7RTLKMM.js → chunk-PLYTTPVE.js} +2 -2
  59. package/dist/{chunk-PCLYCYBK.js → chunk-QJCVK7CI.js} +4 -4
  60. package/dist/{chunk-6HKO6VWS.js → chunk-QRO2UBWS.js} +1 -1
  61. package/dist/{chunk-ROQBQHBK.js → chunk-QUK2IZKI.js} +1 -1
  62. package/dist/{chunk-2DWYRHJS.js → chunk-RLBLLBLL.js} +2 -2
  63. package/dist/{chunk-U7EGMXQR.js → chunk-RMKL5FVH.js} +4 -17
  64. package/dist/{chunk-2BL7BJ22.js → chunk-RNKNDYBN.js} +1 -1
  65. package/dist/{chunk-SOAXQ7Q7.js → chunk-RYR3LTZR.js} +2 -2
  66. package/dist/{chunk-5E43335V.js → chunk-RZ2FMZ5U.js} +1 -1
  67. package/dist/{chunk-L3RCYYON.js → chunk-S5D4Q74P.js} +2 -2
  68. package/dist/{chunk-V2D4QZBC.js → chunk-SEHRMJTO.js} +3 -3
  69. package/dist/{chunk-X2ALZSKK.js → chunk-SEXAKOK3.js} +3 -3
  70. package/dist/{chunk-6RIH2NDU.js → chunk-SH43VDEF.js} +9 -9
  71. package/dist/{chunk-YOOW26KG.js → chunk-SI76MFBF.js} +2 -2
  72. package/dist/{chunk-QWQ6GQTI.js → chunk-T6AGUTZJ.js} +2 -4
  73. package/dist/{chunk-LN4SZS7W.js → chunk-TI3HKGQC.js} +3 -3
  74. package/dist/{chunk-CHALU2TF.js → chunk-UDJHYQSZ.js} +1 -1
  75. package/dist/{chunk-MWNSVO4P.js → chunk-UKAOWORD.js} +8 -8
  76. package/dist/chunk-UKJECUDK.js +3805 -0
  77. package/dist/{chunk-OFFNB2SU.js → chunk-UQLXFITA.js} +241 -6
  78. package/dist/{chunk-JYVGYKXG.js → chunk-W2LGJSEN.js} +73 -1
  79. package/dist/{chunk-BYVBP3U5.js → chunk-W3YVQ6VI.js} +9 -9
  80. package/dist/{chunk-FDWTZVA6.js → chunk-W4AECR7V.js} +1 -1
  81. package/dist/{chunk-2YTOJ447.js → chunk-X3BE2HX4.js} +3 -3
  82. package/dist/{chunk-TDPVEMBS.js → chunk-XFCLWWL3.js} +1 -1
  83. package/dist/{chunk-O433SZAJ.js → chunk-XVIFWEPR.js} +35 -16
  84. package/dist/{clean-SBFI3ZKR.js → clean-6SVCU47L.js} +18 -20
  85. package/dist/cli.js +53 -53
  86. package/dist/{cloud-IRE4HLEK.js → cloud-TIISRMZV.js} +4 -4
  87. package/dist/{cloudrun-GIHWEBGM.js → cloudrun-4TMBWELQ.js} +5 -5
  88. package/dist/{compare-S6NM2FSV.js → compare-YV2XTKYX.js} +28 -30
  89. package/dist/{compiler-WCWRB2LZ.js → compiler-O5R3ZZDV.js} +5 -6
  90. package/dist/{component-WDFZQ2HN.js → component-7LWSMRKZ.js} +3 -3
  91. package/dist/{compositions-RMUBDPD4.js → compositions-5VTSC4M3.js} +14 -16
  92. package/dist/{delete-SDNARGJ4.js → delete-AV2SKLZW.js} +4 -4
  93. package/dist/{deploy-4MK3Y67M.js → deploy-NKWMPAMH.js} +19 -5
  94. package/dist/{destroy-GFQLTIY3.js → destroy-UKP522AE.js} +4 -2
  95. package/dist/{dist-FAN2FFAV.js → dist-2FMTAVGL.js} +3 -3
  96. package/dist/{dist-65ELHZOF.js → dist-4FY5EEH5.js} +3 -3
  97. package/dist/{doctor-YPCZILXV.js → doctor-XOCYSEAZ.js} +14 -16
  98. package/dist/{events-INXDJ44V.js → events-6QPRKX45.js} +4 -5
  99. package/dist/{events-Q2K7SNEZ.js → events-MAZUZI43.js} +5 -6
  100. package/dist/{feedback-FRGRCTIX.js → feedback-MGRILBMP.js} +10 -11
  101. package/dist/{ffmpeg-7BYARPLM.js → ffmpeg-YCULCUB2.js} +24 -4
  102. package/dist/{figma-C262EFOC.js → figma-UMBACTCG.js} +3 -3
  103. package/dist/fontLocalizeCli.js +11 -13
  104. package/dist/{get-ZIUUGSVI.js → get-LWEOLWYN.js} +4 -4
  105. package/dist/{gpuPolicy-FRLW63IY.js → gpuPolicy-MCIQK5Z7.js} +9 -11
  106. package/dist/{grade-compare-DN342HJC.js → grade-compare-MZQOTX3F.js} +29 -31
  107. package/dist/{help-XQPBPSBP.js → help-THPG2NRP.js} +1 -1
  108. package/dist/{history-PF5FUC6M.js → history-2IQYTDU5.js} +8 -9
  109. package/dist/hyperframe-runtime.js +55 -55
  110. package/dist/hyperframe.manifest.json +1 -1
  111. package/dist/hyperframe.runtime.iife.js +55 -55
  112. package/dist/hyperframes-player.global.js +3 -3
  113. package/dist/{info-PC7IKGVB.js → info-CXMADV6K.js} +10 -11
  114. package/dist/{init-ORZX3PSQ.js → init-Y5GU454D.js} +34 -34
  115. package/dist/{inspect-L5GRL6SP.js → inspect-S7JDKEMJ.js} +29 -31
  116. package/dist/{installer-KXS557O7.js → installer-AY23RPEZ.js} +5 -5
  117. package/dist/{keyframes-EIZDSXUH.js → keyframes-FKYT6QAJ.js} +8 -9
  118. package/dist/{lambda-U3N7MRD7.js → lambda-7WMZGRH5.js} +16 -12
  119. package/dist/{layout-WHAVE2H5.js → layout-LL4GOS6G.js} +29 -31
  120. package/dist/{lint-I7PYIW56.js → lint-2M7FY4ZT.js} +11 -12
  121. package/dist/{lintProject-7IEOAXJY.js → lintProject-ARKJXDQF.js} +3 -3
  122. package/dist/{list-XXQM3WDO.js → list-SZBMUHBW.js} +4 -4
  123. package/dist/{login-64NUUDYU.js → login-QRACITGK.js} +4 -4
  124. package/dist/{manager-B6MVBM2E.js → manager-W2BTPAVT.js} +25 -3
  125. package/dist/{media-treatment-5XIM4A3F.js → media-treatment-E4VJETTT.js} +23 -18
  126. package/dist/{models-WRB3S67Z.js → models-AHO3MYE7.js} +13 -15
  127. package/dist/{motionShot-BOFBL73C.js → motionShot-LMMYPGPT.js} +19 -21
  128. package/dist/{normalize-audio-PP4BSZSU.js → normalize-audio-RDWIWZOO.js} +6 -7
  129. package/dist/{open-F4CUWMZF.js → open-WOKRHFDH.js} +14 -15
  130. package/dist/{parakeetRunner-O7QYJ7V7.js → parakeetRunner-RY2KIE63.js} +16 -18
  131. package/dist/{pipeline-BCHSFFT3.js → pipeline-LEA32KLW.js} +11 -13
  132. package/dist/{play-PPBR2GJK.js → play-3S46XG66.js} +21 -23
  133. package/dist/{policies-DCSIM4AB.js → policies-5NTZOHJA.js} +2 -0
  134. package/dist/preflight-MCOFNWFQ.js +52 -0
  135. package/dist/{present-Y7VTCZRZ.js → present-GR7F4CTI.js} +17 -19
  136. package/dist/{preview-53AD4OME.js → preview-TKEAF3KR.js} +34 -25
  137. package/dist/{producer-WBJDNLBF.js → producer-BJ5SUPVD.js} +1 -1
  138. package/dist/{progress-5AM2MZ7V.js → progress-I37JB7R4.js} +1 -0
  139. package/dist/{projectConfig-4KUGQ4P6.js → projectConfig-YJBYWSNK.js} +7 -7
  140. package/dist/{publication-OFDIFS4R.js → publication-2HXIW4LS.js} +3 -3
  141. package/dist/{publish-RWWTY743.js → publish-LHJFEKEI.js} +11 -11
  142. package/dist/{remove-background-G7VK3VKP.js → remove-background-AQUUVAPD.js} +12 -14
  143. package/dist/{render-7PPMS4P6.js → render-AOHXNGIM.js} +40 -38
  144. package/dist/{render-6CXZNXXZ.js → render-AXTGGHVZ.js} +9 -4
  145. package/dist/{render-52W63I3Y.js → render-B5S7FLLS.js} +14 -15
  146. package/dist/{render-batch-2EJVUVVN.js → render-batch-DMQG3QWK.js} +4 -4
  147. package/dist/renderSetupWorker.js +3 -3
  148. package/dist/{resolver-FF5GV6IA.js → resolver-FV54X3T2.js} +5 -5
  149. package/dist/sam-IKPEJRRO.js +21 -0
  150. package/dist/{screenshotCapture-XAYELJK7.js → screenshotCapture-HXEZ3TNJ.js} +20 -3
  151. package/dist/{sherpa-QJPI6B5S.js → sherpa-RKURBTUM.js} +15 -17
  152. package/dist/skills/hyperframes/SKILL.md +42 -0
  153. package/dist/skills/hyperframes-cli/references/cloud.md +1 -1
  154. package/dist/skills/media-use/scripts/lib/recipe-store.mjs +5 -2
  155. package/dist/{skills-H6ZJNOLH.js → skills-YUXI4IRF.js} +11 -10
  156. package/dist/{skillsUpdateCheck-4EBGMO2A.js → skillsUpdateCheck-HK3GDYD6.js} +3 -3
  157. package/dist/{snapshot-DZRUBWRH.js → snapshot-D6Q52Z4X.js} +32 -34
  158. package/dist/{src-ZL7ACIZ3.js → src-DPR7JBU3.js} +10 -12
  159. package/dist/{src-WD5GOYON.js → src-MRYINZ62.js} +8 -10
  160. package/dist/{staticProjectServer-72JF5PPO.js → staticProjectServer-RT7JATD2.js} +15 -16
  161. package/dist/{status-RGHSK3DJ.js → status-BV7QAUQD.js} +2 -3
  162. package/dist/studio/assets/{hyperframes-player-B-wEZiX3.js → hyperframes-player-B4KfQdfl.js} +1 -1
  163. package/dist/studio/assets/{index-DPugLDRK.js → index-Bsc8xBh9.js} +1 -1
  164. package/dist/studio/assets/{index-Bvkb0Zxy.js → index-DGl_Zvb3.js} +97 -97
  165. package/dist/studio/index.html +1 -1
  166. package/dist/{studio-api-BL6CLOA6.js → studio-api-NL2RMVB5.js} +9 -10
  167. package/dist/{studioServer-TRWCZZXP.js → studioServer-VL2GUVCR.js} +47 -49
  168. package/dist/{system-VRXC6S4A.js → system-7F3UEHQT.js} +2 -3
  169. package/dist/{telemetry-FDSW3ZOZ.js → telemetry-5PJWDFSZ.js} +5 -6
  170. package/dist/{timeline-ZRN336EA.js → timeline-OH35TN25.js} +124 -51
  171. package/dist/{tokens-RMLNQHIB.js → tokens-YISVK7W2.js} +2 -2
  172. package/dist/{transcribe-SOODKU6H.js → transcribe-6KBSE76Q.js} +12 -14
  173. package/dist/{transcribe-AEHHCYAL.js → transcribe-KRPN2FWA.js} +22 -24
  174. package/dist/{updateCheck-OSPEYRBY.js → updateCheck-QCZTFFSQ.js} +2 -2
  175. package/dist/{upgrade-AK4S7DMX.js → upgrade-DRFQISI6.js} +2 -2
  176. package/dist/{urlDownloader-FSCMLFG7.js → urlDownloader-CJDXTKMC.js} +8 -10
  177. package/dist/{validate-JJTCKZIV.js → validate-BKY3FIJC.js} +23 -25
  178. package/dist/{video-ZDM5CFI2.js → video-3UEJ57Q7.js} +9 -11
  179. package/package.json +1 -1
  180. package/dist/chunk-7JDEZNBY.js +0 -3805
  181. package/dist/chunk-7KDQAD2W.js +0 -81
  182. package/dist/chunk-BXCMXMJQ.js +0 -73
  183. package/dist/chunk-KCF6GHJP.js +0 -250
  184. package/dist/preflight-G5KP7ZKA.js +0 -32
@@ -1,81 +0,0 @@
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
- // ../engine/src/services/wslHost.ts
9
- import { accessSync, constants, existsSync, readFileSync, statSync } from "fs";
10
- import { platform, release } from "os";
11
- function groupName(gid) {
12
- try {
13
- const line = readFileSync("/etc/group", "utf-8").split("\n").find((entry) => entry.split(":")[2] === String(gid));
14
- return line?.split(":")[0] || String(gid);
15
- } catch {
16
- return String(gid);
17
- }
18
- }
19
- var realHost = {
20
- get platform() {
21
- return platform();
22
- },
23
- get release() {
24
- return release();
25
- },
26
- readProcVersion: () => readFileSync("/proc/version", "utf-8"),
27
- renderNodeAccess: (path) => {
28
- if (!existsSync(path)) return { state: "missing" };
29
- try {
30
- accessSync(path, constants.R_OK | constants.W_OK);
31
- return { state: "read-write" };
32
- } catch {
33
- const gid = statSync(path, { throwIfNoEntry: false })?.gid ?? -1;
34
- return {
35
- state: "denied",
36
- group: groupName(gid),
37
- userInGroup: process.getgroups?.().includes(gid) ?? false
38
- };
39
- }
40
- }
41
- };
42
- function detectWsl(host = realHost) {
43
- if (host.platform !== "linux") return false;
44
- try {
45
- const osRelease = host.release.toLowerCase();
46
- if (osRelease.includes("microsoft") || osRelease.includes("wsl")) return true;
47
- const procVersion = host.readProcVersion().toLowerCase();
48
- return procVersion.includes("microsoft") || procVersion.includes("wsl");
49
- } catch {
50
- return false;
51
- }
52
- }
53
- var RENDER_NODE = "/dev/dri/renderD128";
54
- var NATIVE_WINDOWS = "render from native Windows (project copied to a Windows drive, run from PowerShell), where Chrome uses the GPU through Direct3D.";
55
- function describeWslGpuAccess(host = realHost) {
56
- if (!detectWsl(host)) return null;
57
- const access = host.renderNodeAccess(RENDER_NODE);
58
- if (access.state === "denied" && !access.userInGroup) {
59
- return [
60
- ` Your Linux user cannot read and write ${RENDER_NODE} and is not in its group ("${access.group}"), which can stop Mesa from reaching the GPU.`,
61
- ` Fix: run \`sudo usermod -aG ${access.group} $USER\`, then \`wsl --shutdown\` from Windows, reopen WSL and render again.`,
62
- ` Or ${NATIVE_WINDOWS}`
63
- ];
64
- }
65
- if (access.state === "denied") {
66
- return [
67
- ` Your Linux user is in the "${access.group}" group but still cannot read and write ${RENDER_NODE}; check its permissions with \`ls -l ${RENDER_NODE}\`.`,
68
- ` Or ${NATIVE_WINDOWS}`
69
- ];
70
- }
71
- const seen = access.state === "missing" ? "does not exist" : "is readable and writable";
72
- return [
73
- ` ${RENDER_NODE} ${seen}, so file permissions are not the cause.`,
74
- ` To use the GPU, ${NATIVE_WINDOWS}`
75
- ];
76
- }
77
-
78
- export {
79
- detectWsl,
80
- describeWslGpuAccess
81
- };
@@ -1,73 +0,0 @@
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
- resolveWritePath
9
- } from "./chunk-EOVYQ3IG.js";
10
-
11
- // src/cloud/download.ts
12
- import {
13
- chmodSync,
14
- createWriteStream,
15
- mkdirSync,
16
- mkdtempSync,
17
- renameSync,
18
- rmSync,
19
- statSync
20
- } from "fs";
21
- import { dirname, join } from "path";
22
- import { pipeline } from "stream/promises";
23
- async function downloadToFile(url, destPath, options = {}) {
24
- const fetchImpl = options.fetchImpl ?? fetch;
25
- const res = await fetchImpl(url, { signal: options.signal });
26
- if (!res.ok) {
27
- throw new Error(`Failed to download ${url}: HTTP ${res.status} ${res.statusText}`);
28
- }
29
- if (!res.body) {
30
- throw new Error(`Failed to download ${url}: empty response body`);
31
- }
32
- mkdirSync(dirname(destPath), { recursive: true });
33
- const totalHeader = res.headers.get("content-length");
34
- const total = totalHeader ? Number.parseInt(totalHeader, 10) : void 0;
35
- const totalOpt = total !== void 0 && Number.isFinite(total) ? total : void 0;
36
- const destination = resolveWritePath(destPath);
37
- const previous = statSync(destination, { throwIfNoEntry: false });
38
- const stage = mkdtempSync(join(dirname(destination), ".hf-download-"));
39
- const stagedFile = join(stage, "download");
40
- let bytes = 0;
41
- try {
42
- await pipeline(
43
- async function* () {
44
- for await (const chunk of res.body) {
45
- bytes += chunk.byteLength;
46
- options.onProgress?.(bytes, totalOpt);
47
- yield chunk;
48
- }
49
- if (totalOpt !== void 0 && bytes !== totalOpt) {
50
- throw new Error(
51
- `Truncated download: got ${bytes} bytes, expected ${totalOpt} (content-length). The presigned URL may have expired mid-transfer \u2014 refetch via \`hyperframes cloud get\`.`
52
- );
53
- }
54
- },
55
- createWriteStream(stagedFile, { flags: "wx" }),
56
- { signal: options.signal }
57
- );
58
- options.signal?.throwIfAborted();
59
- if (previous?.isFile()) chmodSync(stagedFile, previous.mode & 511);
60
- renameSync(stagedFile, destination);
61
- } catch (error) {
62
- const reason = options.signal?.reason;
63
- if (options.signal?.aborted && reason instanceof Error) throw reason;
64
- throw error;
65
- } finally {
66
- rmSync(stage, { recursive: true, force: true });
67
- }
68
- return { path: destPath, bytes };
69
- }
70
-
71
- export {
72
- downloadToFile
73
- };
@@ -1,250 +0,0 @@
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
- parseHTML
9
- } from "./chunk-SDYDNHEE.js";
10
-
11
- // ../parsers/dist/hfIds.js
12
- var EXCLUDED_TAGS = /* @__PURE__ */ new Set([
13
- "script",
14
- "style",
15
- "template",
16
- "meta",
17
- "link",
18
- "noscript",
19
- "base"
20
- ]);
21
- function fnv1a(str) {
22
- let h = 2166136261;
23
- for (let i = 0; i < str.length; i++) {
24
- h ^= str.charCodeAt(i);
25
- h = Math.imul(h, 16777619);
26
- }
27
- return h >>> 0;
28
- }
29
- function toHfId(hash) {
30
- const s = (hash >>> 0).toString(36);
31
- const four = s.length >= 4 ? s.slice(-4) : s.padStart(4, "0");
32
- return `hf-${four}`;
33
- }
34
- function ownText(el) {
35
- let text = "";
36
- el.childNodes.forEach((n) => {
37
- if (n.nodeType === 3) text += n.nodeValue ?? "";
38
- });
39
- return text.trim();
40
- }
41
- function getContractAttribute(el, name) {
42
- return Array.from(el.attributes).find((attr) => attr.name.toLowerCase() === name)?.value ?? null;
43
- }
44
- function contentKey(el) {
45
- const attrs = Array.from(el.attributes).filter((a) => !a.name.toLowerCase().startsWith("data-hf-")).map((a) => `${a.name.toLowerCase()}\0${a.value}`).sort().join("");
46
- return `${el.tagName.toLowerCase()}|${attrs}|${ownText(el)}`;
47
- }
48
- function mintHfId(el, assigned) {
49
- const key = contentKey(el);
50
- let id = toHfId(fnv1a(key));
51
- let dup = 0;
52
- while (assigned.has(id)) {
53
- dup += 1;
54
- if (dup > 1e4) {
55
- id = `hf-${(fnv1a(key) >>> 0).toString(36)}-${dup}`;
56
- break;
57
- }
58
- id = toHfId(fnv1a(`${key}#${dup}`));
59
- }
60
- assigned.add(id);
61
- return id;
62
- }
63
- function getChildElements(parent) {
64
- const directChildren = Array.from(parent.children);
65
- if (directChildren.length || parent.tagName.toLowerCase() !== "template") return directChildren;
66
- const content = parent.content;
67
- if (content?.children.length) return Array.from(content.children);
68
- return directChildren;
69
- }
70
- function isCompositionTemplate(el) {
71
- if (el.tagName.toLowerCase() !== "template") return false;
72
- if (getContractAttribute(el, "data-composition-id") !== null) return true;
73
- for (const child of getChildElements(el)) {
74
- if (getContractAttribute(child, "data-composition-id") !== null) return true;
75
- }
76
- return false;
77
- }
78
- function walkCompositionDescendants(root, visit) {
79
- const rootElement = root.nodeType === 9 ? root.documentElement : root;
80
- if (!rootElement) return;
81
- const walk = (parent) => {
82
- for (const child of getChildElements(parent)) {
83
- const isTemplate = child.tagName.toLowerCase() === "template";
84
- if (isTemplate && !isCompositionTemplate(child)) continue;
85
- visit(child);
86
- walk(child);
87
- }
88
- };
89
- walk(rootElement);
90
- }
91
- function assignHfIds(body) {
92
- const assigned = /* @__PURE__ */ new Set();
93
- walkCompositionDescendants(body, (el) => {
94
- const existing = getContractAttribute(el, "data-hf-id");
95
- if (existing) assigned.add(existing);
96
- });
97
- walkCompositionDescendants(body, (el) => {
98
- if (EXCLUDED_TAGS.has(el.tagName.toLowerCase())) return;
99
- if (getContractAttribute(el, "data-hf-id")) return;
100
- el.setAttribute("data-hf-id", mintHfId(el, assigned));
101
- });
102
- }
103
- function ensureHfIds(html) {
104
- const { document, wrapped } = parseFragmentOrDocument(html);
105
- if (!document.body) return html;
106
- assignHfIds(document.body);
107
- return wrapped ? document.body.innerHTML || "" : document.toString();
108
- }
109
- function parseFragmentOrDocument(html) {
110
- const wrapped = !/^(?:<!doctype|<html[\s>/])/i.test(
111
- html.replace(/^(?:\s|<!--(?:>|->|[\s\S]*?-->))*/, "")
112
- );
113
- const { document } = wrapped ? parseHTML(`<!DOCTYPE html><html><head></head><body>${html}</body></html>`) : parseHTML(html);
114
- return { document, wrapped };
115
- }
116
- function stampHfIdsInPlace(html) {
117
- const { document, wrapped } = parseFragmentOrDocument(html);
118
- if (!document.body) return html;
119
- const elements = wrapped ? getChildElements(document.body).flatMap(inDocumentOrder) : inDocumentOrder(document.documentElement);
120
- const existing = elements.map((el) => el.getAttribute("data-hf-id"));
121
- const pinned = existing.map((id) => id !== null && id.length > 0);
122
- assignHfIds(document.body);
123
- const minted = elements.map((el, n) => pinned[n] ? null : el.getAttribute("data-hf-id"));
124
- const tags = startTags(html);
125
- const inserts = tags && alignInserts(html, tags, elements, minted, existing);
126
- return inserts ? spliceIds(html, inserts) : ensureHfIds(html);
127
- }
128
- function inDocumentOrder(el) {
129
- return [el, ...getChildElements(el).flatMap(inDocumentOrder)];
130
- }
131
- var RAW_TEXT = /* @__PURE__ */ new Set(["script", "style", "textarea", "title", "xmp", "noembed", "noframes"]);
132
- var IMPLIED = /* @__PURE__ */ new Set(["html", "head", "body", "tbody"]);
133
- function startTags(html) {
134
- const lower = html.toLowerCase();
135
- const tags = [];
136
- let i = html.indexOf("<");
137
- while (i >= 0) {
138
- const name = html.startsWith("<!--", i) ? null : /^<([a-zA-Z][^\s/>]*)/.exec(html.slice(i, i + 128));
139
- if (!name) {
140
- i = nextTagAfter(html, i);
141
- continue;
142
- }
143
- const end = closingBracket(html, i + name[0].length);
144
- if (end < 0) return null;
145
- const tag = name[1].toLowerCase();
146
- tags.push({ name: tag, nameEnd: i + name[0].length, bracket: end });
147
- const after = RAW_TEXT.has(tag) ? rawTextEnd(lower, tag, end) : end;
148
- i = after < 0 ? -1 : html.indexOf("<", after + 1);
149
- }
150
- return tags;
151
- }
152
- function rawTextEnd(lower, tag, from) {
153
- const marker = `</${tag}`;
154
- for (let at = lower.indexOf(marker, from); at >= 0; at = lower.indexOf(marker, at + marker.length)) {
155
- const next = lower[at + marker.length];
156
- if (next !== void 0 && /[\s/>]/.test(next)) return at;
157
- }
158
- return -1;
159
- }
160
- function nextTagAfter(html, lt) {
161
- const comment = html.startsWith("<!--", lt);
162
- const end = comment ? html.indexOf("-->", lt + 4) : html.indexOf(">", lt);
163
- return end < 0 ? -1 : html.indexOf("<", end + 1);
164
- }
165
- function closingBracket(html, from) {
166
- let quote = "";
167
- for (let i = from; i < html.length; i++) {
168
- const c = html[i];
169
- if (quote) quote = c === quote ? "" : quote;
170
- else if (c === '"' || c === "'") quote = c;
171
- else if (c === ">") return i;
172
- }
173
- return -1;
174
- }
175
- function alignInserts(html, tags, elements, minted, existing) {
176
- const walked = walkAlign(html, tags, elements, minted, existing);
177
- if (!walked) return null;
178
- return walked.next === tags.length ? walked.inserts : null;
179
- }
180
- function walkAlign(html, tags, elements, minted, existing) {
181
- const state = { inserts: [], next: 0 };
182
- for (const [n, el] of elements.entries()) {
183
- if (!take(state, html, tags, el, minted[n] ?? null, existing[n] === "")) return null;
184
- }
185
- return state;
186
- }
187
- function take(state, html, tags, el, id, fillEmpty) {
188
- const step = alignOne(html, tags[state.next], el, id, fillEmpty);
189
- if (!step) return false;
190
- if (step.insert) state.inserts.push(step.insert);
191
- if (step.next) state.next += 1;
192
- return true;
193
- }
194
- function alignOne(html, tag, el, id, fillEmpty) {
195
- if (tag?.name === el.tagName.toLowerCase()) return matched(html, tag, id, fillEmpty);
196
- if (IMPLIED.has(el.tagName.toLowerCase()) && !id) return { insert: null, next: false };
197
- return null;
198
- }
199
- function matched(html, tag, id, fillEmpty) {
200
- if (!id) return { insert: null, next: true };
201
- const placed = placeId(html, tag, id, fillEmpty);
202
- if (!placed) return null;
203
- return { insert: placed, next: true };
204
- }
205
- function placeId(html, tag, id, fillEmpty) {
206
- if (!fillEmpty) return { at: tag.nameEnd, text: ` data-hf-id="${id}"` };
207
- const emptyAt = emptyHfIdValue(html, tag);
208
- if (emptyAt === null) return null;
209
- return { at: emptyAt, text: id };
210
- }
211
- function emptyHfIdValue(html, tag) {
212
- const open = outsideQuotes(html.slice(tag.nameEnd, tag.bracket));
213
- const match = /\sdata-hf-id\s*=\s*(["'])\1/i.exec(open);
214
- if (!match) return null;
215
- return tag.nameEnd + match.index + match[0].length - 1;
216
- }
217
- function outsideQuotes(open) {
218
- let quote = "";
219
- let out = "";
220
- for (const c of open) {
221
- out += quotedChar(quote, c);
222
- quote = quoteOf(quote, c);
223
- }
224
- return out;
225
- }
226
- function quoteOf(quote, c) {
227
- if (quote) return c === quote ? "" : quote;
228
- return c === '"' || c === "'" ? c : "";
229
- }
230
- function quotedChar(quote, c) {
231
- if (!quote || c === quote) return c;
232
- return " ".repeat(c.length);
233
- }
234
- function spliceIds(html, inserts) {
235
- let out = "";
236
- let from = 0;
237
- for (const { at, text } of inserts) {
238
- out += html.slice(from, at) + text;
239
- from = at;
240
- }
241
- return out + html.slice(from);
242
- }
243
-
244
- export {
245
- EXCLUDED_TAGS,
246
- mintHfId,
247
- walkCompositionDescendants,
248
- ensureHfIds,
249
- stampHfIdsInPlace
250
- };
@@ -1,32 +0,0 @@
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
- checkDisk,
9
- extractMajorVersion,
10
- parseToolVersion,
11
- resolveRenderBrowser,
12
- runEnvironmentChecks
13
- } from "./chunk-A2DMF2Q6.js";
14
- import "./chunk-QWQ6GQTI.js";
15
- import "./chunk-XRKMITSS.js";
16
- import "./chunk-IK3SOMZ4.js";
17
- import "./chunk-XT6MXC7A.js";
18
- import "./chunk-JYVGYKXG.js";
19
- import "./chunk-7KDQAD2W.js";
20
- import "./chunk-D3ZWBHZP.js";
21
- import "./chunk-TWWSYAKJ.js";
22
- import "./chunk-VAS6HQX3.js";
23
- import "./chunk-KNU5COPB.js";
24
- import "./chunk-KGPLIH7B.js";
25
- import "./chunk-M2WBOQ2Q.js";
26
- export {
27
- checkDisk,
28
- extractMajorVersion,
29
- parseToolVersion,
30
- resolveRenderBrowser,
31
- runEnvironmentChecks
32
- };