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.
- package/dist/{add-MG53577L.js → add-QKZZG7A2.js} +12 -12
- package/dist/{animatedGifPrep-HV4ZFVPV.js → animatedGifPrep-YQDPYGOD.js} +7 -7
- package/dist/api.js +17 -17
- package/dist/{asset-3GIBXLLL.js → asset-3Q737Y4H.js} +2 -2
- package/dist/{assetCataloger-JJQ4JW2P.js → assetCataloger-BTHEBJJB.js} +3 -3
- package/dist/{auth-XQMT727H.js → auth-XL7EU3SO.js} +1 -1
- package/dist/{autoUpdate-CREZJGMU.js → autoUpdate-PJFLTQ3U.js} +2 -2
- package/dist/{backgroundChecks-K3S5QKR3.js → backgroundChecks-T5TIR5WK.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-42AKNX73.js → batchRender-NFLVIDB4.js} +4 -4
- package/dist/{beats-Y7IKETUS.js → beats-JU4GZ26R.js} +13 -13
- package/dist/{benchmark-22SAXSO5.js → benchmark-7U2YWLTW.js} +9 -9
- package/dist/{browser-ABNISCC3.js → browser-D57UPYDA.js} +5 -5
- package/dist/{bundleWithLocalizedFonts-OE5ZI4JE.js → bundleWithLocalizedFonts-26MXQOZG.js} +2 -2
- package/dist/{capture-DBNHO4WJ.js → capture-47BV25G3.js} +2 -2
- package/dist/{capture-HQG5W42I.js → capture-LT252COQ.js} +11 -11
- package/dist/{catalog-KICZFIDX.js → catalog-BEZXOV4O.js} +12 -12
- package/dist/{catch-up-ZCQUCI45.js → catch-up-KVV5X6BF.js} +4 -4
- package/dist/{check-TGXIICEF.js → check-6KQ433E6.js} +191 -55
- package/dist/{checkBrowser-3N23I56J.js → checkBrowser-PRDR6XBY.js} +172 -30
- package/dist/{chunk-GESJSXFH.js → chunk-35PWWBGZ.js} +1 -1
- package/dist/{chunk-62RUQJ5J.js → chunk-3SVC7SW4.js} +47 -21
- package/dist/{chunk-KMJLHHBF.js → chunk-3ZPFRDEJ.js} +1 -1
- package/dist/{chunk-XHBX7QN6.js → chunk-4LE27ST4.js} +1 -1
- package/dist/{chunk-DUUFDLC4.js → chunk-4MLYMDQ4.js} +1 -1
- package/dist/{chunk-WX7VCRM7.js → chunk-4PKQEKAI.js} +2 -2
- package/dist/{chunk-ZKDKFJCK.js → chunk-4YZYYP7V.js} +5 -5
- package/dist/{chunk-XPQSL5VS.js → chunk-54DMWFQZ.js} +8 -1
- package/dist/{chunk-NKM53WMI.js → chunk-BRF3O35X.js} +7 -7
- package/dist/chunk-DHPFXAUF.js +165 -0
- package/dist/{chunk-CT6ZQRLD.js → chunk-DIOBKUBV.js} +2 -2
- package/dist/{chunk-SP6XL3NP.js → chunk-FAIYEIZ4.js} +1 -1
- package/dist/{chunk-CYFFYK2F.js → chunk-FLVI7FHU.js} +1 -1
- package/dist/{chunk-JDB65PPT.js → chunk-GNTVYF7E.js} +8 -7
- package/dist/{chunk-KQHJKJ3V.js → chunk-HVXRYMGQ.js} +1 -1
- package/dist/{chunk-CNPJHUOX.js → chunk-IP73NMQT.js} +11 -11
- package/dist/{chunk-VX4AL2FQ.js → chunk-IPDS2SWI.js} +1 -1
- package/dist/{chunk-LACFOFWX.js → chunk-IZ7L6V76.js} +1 -1
- package/dist/{chunk-VC7JBNPS.js → chunk-IZPN423R.js} +481 -68
- package/dist/{chunk-P7NTODQE.js → chunk-KQGWP4KH.js} +2 -2
- package/dist/{chunk-SFUBSJFP.js → chunk-KXX6NLOT.js} +1 -1
- package/dist/{chunk-K44HCHZN.js → chunk-L3N7RJHS.js} +3 -3
- package/dist/{chunk-MI6U3OIN.js → chunk-L6RIMCMG.js} +3 -3
- package/dist/{chunk-7IEGPJ4P.js → chunk-LBT4AMSF.js} +1 -1
- package/dist/{chunk-AY2BONTF.js → chunk-LKQS72D5.js} +1 -1
- package/dist/{chunk-VXM4BH23.js → chunk-N3I6RAOR.js} +136 -54
- package/dist/{chunk-Q2Y5OZCY.js → chunk-N4IXP3MY.js} +2 -2
- package/dist/{chunk-LCILS4AF.js → chunk-O3DUX6P2.js} +5 -5
- package/dist/{chunk-MXB6CWVH.js → chunk-OSAH7S5M.js} +1 -1
- package/dist/{chunk-YDRX42P3.js → chunk-OZ4K46OV.js} +3 -3
- package/dist/{chunk-ZK3BQXHC.js → chunk-POEEDPJI.js} +1 -1
- package/dist/{chunk-LTJDUBSQ.js → chunk-PUIELIFA.js} +1 -1
- package/dist/chunk-QBYHNRHU.js +3795 -0
- package/dist/{chunk-KUTT3JXL.js → chunk-QF7AE3DB.js} +3 -3
- package/dist/{chunk-BNYRD7PQ.js → chunk-QLGBNGXC.js} +2 -2
- package/dist/{chunk-U7SASZC5.js → chunk-RJRGR5KF.js} +10 -10
- package/dist/{chunk-4S4VUXW3.js → chunk-RRBKEHST.js} +1 -1
- package/dist/{chunk-TPIG7ZBX.js → chunk-RYL6ZIJP.js} +6 -6
- package/dist/{chunk-L274XRWA.js → chunk-S22FKF6G.js} +6 -3
- package/dist/{chunk-OMBSUO4T.js → chunk-TCWMDCBX.js} +2 -2
- package/dist/{chunk-YA62XGXS.js → chunk-UJKQWGFF.js} +1 -1
- package/dist/{chunk-M5B42RL5.js → chunk-WUUOFMHU.js} +3 -3
- package/dist/{chunk-PR7QQBSC.js → chunk-XGLNQDLN.js} +1 -1
- package/dist/{chunk-VGCEMOQA.js → chunk-XKKBIFE5.js} +7 -7
- package/dist/{chunk-2HWB4TCI.js → chunk-XNDXENJQ.js} +27 -12
- package/dist/{chunk-AHBYQRGI.js → chunk-XQKVEQNY.js} +2 -2
- package/dist/{chunk-ZFN6GQU4.js → chunk-XXPYZBZ3.js} +1 -1
- package/dist/{chunk-K4RIT6PX.js → chunk-XYHBVSWD.js} +2 -2
- package/dist/{chunk-RMIFSBRV.js → chunk-YEBKEWKB.js} +1 -1
- package/dist/{chunk-CZQLCBWY.js → chunk-YG2Y55KF.js} +1 -1
- package/dist/{chunk-B3XLIBFL.js → chunk-YIJMVFEJ.js} +1 -1
- package/dist/{chunk-K35E45SI.js → chunk-YZTVHRJ2.js} +1 -1
- package/dist/{chunk-Y475GD4L.js → chunk-ZD3RDNZI.js} +1 -1
- package/dist/{chunk-QIJLIULK.js → chunk-ZGCRVM5M.js} +2 -2
- package/dist/{clean-6QP7VAV4.js → clean-RLTHFTQA.js} +18 -18
- package/dist/cli.js +52 -52
- package/dist/{cloud-5TME5ROM.js → cloud-Q5TGBTW3.js} +4 -4
- package/dist/{cloudrun-F5VVCVF5.js → cloudrun-4UZF74MV.js} +4 -4
- package/dist/{compare-XPY2EXX6.js → compare-Q5UNR2V4.js} +25 -25
- package/dist/{compiler-NPD3MYMO.js → compiler-ZXT27Z62.js} +4 -4
- package/dist/{component-OPVL3PUX.js → component-H734P32V.js} +3 -3
- package/dist/{compositions-WSEOI454.js → compositions-YEHDSTDR.js} +11 -11
- package/dist/{delete-SLMH57VH.js → delete-LDBMPWRT.js} +2 -2
- package/dist/{dist-CUIR3GFX.js → dist-7JXLFD6U.js} +3 -3
- package/dist/{dist-HUMFCJ6T.js → dist-RGE4QASU.js} +1 -1
- package/dist/{doctor-QZW3EKIH.js → doctor-XNJFIWJ7.js} +13 -13
- package/dist/{events-FIFWFRGC.js → events-G6UFLNXR.js} +2 -2
- package/dist/{events-6C3ZG7LS.js → events-UKCPUWMH.js} +3 -3
- package/dist/{feedback-VKXM7YJ5.js → feedback-CK3KZ7DE.js} +7 -7
- package/dist/{ffmpeg-TZB5WAYE.js → ffmpeg-MJFMBBSF.js} +2 -2
- package/dist/{figma-3UYNADNA.js → figma-3D5C737B.js} +3 -3
- package/dist/fontLocalizeCli.js +9 -9
- package/dist/{get-VH7VMRVX.js → get-QGTQUWFT.js} +2 -2
- package/dist/{gpuPolicy-M2JZGGVW.js → gpuPolicy-G5QAQDYF.js} +7 -7
- package/dist/{grade-compare-OSC2YQWN.js → grade-compare-XIHOM62P.js} +27 -27
- package/dist/{help-DCBFEZPT.js → help-U5UBXT52.js} +1 -1
- package/dist/{history-XYJMQE26.js → history-5J73QZSA.js} +5 -5
- package/dist/hyperframe-runtime.js +65 -58
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +65 -58
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/{info-YEHGENAH.js → info-RJHQQQUP.js} +8 -8
- package/dist/{init-64SML7PY.js → init-M6UQOYYC.js} +29 -29
- package/dist/{inspect-GFOQKRJI.js → inspect-PRQWDBTP.js} +26 -26
- package/dist/{installer-Q4MMZKLA.js → installer-ZL7UKYK5.js} +5 -5
- package/dist/{keyframes-ORYFWKBZ.js → keyframes-VMUJYTCQ.js} +6 -6
- package/dist/{lambda-DRMOJGTC.js → lambda-ON42DRQD.js} +5 -5
- package/dist/{layout-ZEQBE6UQ.js → layout-QKBFVDVY.js} +26 -26
- package/dist/{lint-67KGFY63.js → lint-ZQHHL2SV.js} +7 -7
- package/dist/{lintProject-SSEXWCH6.js → lintProject-3Z6OJCSO.js} +1 -1
- package/dist/{list-T6OU5ARJ.js → list-YBRKIWGF.js} +2 -2
- package/dist/{login-2PXIGDP7.js → login-4B2YXGLB.js} +4 -4
- package/dist/{manager-ES2UFT4X.js → manager-X44GKUEL.js} +3 -3
- package/dist/{manager-GWU5J6RJ.js → manager-ZLJD3EAY.js} +2 -2
- package/dist/{media-treatment-NAAHID6M.js → media-treatment-5C5EJAAP.js} +12 -12
- package/dist/{models-P6XB6RWK.js → models-R7ZDWBJ6.js} +13 -13
- package/dist/{motionShot-7MHRIV6V.js → motionShot-ZHESZNUL.js} +14 -14
- package/dist/{normalize-audio-LWNFYR2F.js → normalize-audio-EVWZVTBM.js} +6 -6
- package/dist/{open-DAP5C7UD.js → open-TV6HT4UT.js} +4 -4
- package/dist/{parakeetRunner-3ZVFPOD4.js → parakeetRunner-YVVF4CG6.js} +14 -14
- package/dist/{pipeline-V4YJCPUX.js → pipeline-ETR5SEBS.js} +9 -9
- package/dist/{play-UDCESJO3.js → play-C6WONRZV.js} +19 -19
- package/dist/{preflight-JOD4OXGC.js → preflight-JYOX64YP.js} +4 -4
- package/dist/{present-DXTHBH3F.js → present-RANXTVPA.js} +15 -15
- package/dist/{preview-YHXKRXKB.js → preview-KF6UMBT2.js} +19 -19
- package/dist/{producer-343ENLAM.js → producer-CY2GXBWN.js} +1 -1
- package/dist/{projectConfig-YXKU3CTB.js → projectConfig-KPXCNMBM.js} +7 -7
- package/dist/{publication-ODXP3JI7.js → publication-Y36N4A7E.js} +3 -3
- package/dist/{publish-UEFBFGV3.js → publish-RCQJO35C.js} +9 -9
- package/dist/{remove-background-FMV6IDOH.js → remove-background-3ZMXVWLB.js} +10 -10
- package/dist/{render-ZTXNPRGF.js → render-FKVRCDT2.js} +58 -35
- package/dist/{render-N7QGX6RJ.js → render-PTNEFO5U.js} +9 -9
- package/dist/{render-SYC4RPGT.js → render-WUSTRMUD.js} +4 -4
- package/dist/{render-batch-SZRPCRUJ.js → render-batch-AQHU2JWZ.js} +4 -4
- package/dist/renderSetupWorker.js +4 -4
- package/dist/{resolver-7MYXNEAX.js → resolver-L5BDZJKU.js} +5 -5
- package/dist/{sherpa-M4Z2Q5Y2.js → sherpa-3S3ISG7G.js} +13 -13
- package/dist/skills/hyperframes/references/frame-worker-core.md +11 -9
- package/dist/skills/hyperframes/references/subagent-dispatch.md +1 -1
- package/dist/skills/media-use/audio/scripts/lib/tts.cleanup.test.mjs +175 -0
- package/dist/skills/media-use/audio/scripts/lib/tts.mjs +24 -19
- package/dist/skills/media-use/references/grading.md +1 -2
- package/dist/skills/media-use/references/meta.md +17 -17
- package/dist/skills/media-use/references/operations.md +6 -6
- package/dist/skills/media-use/references/setup-providers.md +3 -4
- package/dist/skills/media-use/scripts/lib/cutlist.mjs +9 -2
- package/dist/skills/media-use/scripts/lib/cutlist.test.mjs +12 -0
- package/dist/skills/media-use/scripts/lib/telemetry.mjs +4 -1
- package/dist/skills/media-use/scripts/lib/telemetry.test.mjs +20 -0
- package/dist/skills/media-use/scripts/transcript-cut.mjs +23 -4
- package/dist/skills/media-use/scripts/transcript-cut.test.mjs +224 -0
- package/dist/{skills-NEHNSHZK.js → skills-X4WQEKNF.js} +5 -5
- package/dist/{skillsUpdateCheck-O77QR72A.js → skillsUpdateCheck-UYCVHDZ6.js} +3 -3
- package/dist/{snapshot-GDVXFBVY.js → snapshot-YEYHQEZQ.js} +252 -141
- package/dist/{src-VMTHSARJ.js → src-2NN2WB6X.js} +10 -6
- package/dist/{src-PTIV7IVV.js → src-OLBDPEG6.js} +8 -8
- package/dist/{staticProjectServer-3D2NXQ6W.js → staticProjectServer-7H35NMWB.js} +15 -15
- package/dist/studio/assets/{hyperframes-player-C-2YwYre.js → hyperframes-player-DJt8E7k4.js} +1 -1
- package/dist/studio/assets/{index-ByJU5J6n.js → index-BGks9KLI.js} +131 -131
- package/dist/studio/assets/{index-BybGk67U.js → index-DWIHrAY2.js} +1 -1
- package/dist/studio/assets/{index-Cfs2r3fz.js → index-DgbLblGR.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-XIBDLRHB.js → studio-api-HGM2A5I3.js} +9 -9
- package/dist/{studioServer-QIQK47UN.js → studioServer-M6XFL7N6.js} +45 -45
- package/dist/{telemetry-565KDZUW.js → telemetry-KVCZKVTE.js} +3 -3
- package/dist/{timeline-E6XB7I6W.js → timeline-VYYKZR4V.js} +68 -15
- package/dist/{tokens-3ZAJENSE.js → tokens-B5NFFL55.js} +2 -2
- package/dist/{transcribe-XWQQCCBG.js → transcribe-SBETOIWI.js} +12 -12
- package/dist/{transcribe-WODP3T77.js → transcribe-WNFRYZAC.js} +18 -18
- package/dist/{updateCheck-QPYU4GRL.js → updateCheck-5MM2DFUC.js} +2 -2
- package/dist/{upgrade-2FJ5ZEN6.js → upgrade-LWID54R3.js} +2 -2
- package/dist/{urlDownloader-352AY25I.js → urlDownloader-CVLNXFDG.js} +6 -6
- package/dist/{validate-SP2VGNEI.js → validate-V4CGQ6OF.js} +20 -20
- package/dist/{video-RVNPFEA6.js → video-VJB2KRSS.js} +7 -7
- package/package.json +1 -1
- package/dist/chunk-3WD4JNMU.js +0 -3795
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
splitElementInHtml,
|
|
22
22
|
unwrapElementsFromHtml,
|
|
23
23
|
wrapElementsInHtml
|
|
24
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
24
|
+
} from "./chunk-QF7AE3DB.js";
|
|
25
25
|
import {
|
|
26
26
|
stoppedByCancelSignal
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-KQGWP4KH.js";
|
|
28
28
|
import {
|
|
29
29
|
PARAKEET_MODEL_LABEL,
|
|
30
30
|
SHERPA_ERROR_PREFIX,
|
|
@@ -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
|
|
10401
|
-
const stylesheet = resolveExistingLocalAsset(projectDir,
|
|
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
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
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
|
}
|
|
@@ -9,17 +9,17 @@ import {
|
|
|
9
9
|
resolveCliChromeGpuMode,
|
|
10
10
|
seekCompositionTimeline,
|
|
11
11
|
waitForRuntimeReady
|
|
12
|
-
} from "./chunk-
|
|
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-
|
|
19
|
+
} from "./chunk-RRBKEHST.js";
|
|
20
20
|
import {
|
|
21
21
|
resolveProject
|
|
22
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
253
|
-
const { ensureBrowser } = await import("./manager-
|
|
254
|
-
const { serveStaticProjectHtml } = await import("./staticProjectServer-
|
|
255
|
-
const { lintProject } = await import("./lintProject-
|
|
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-
|
|
276
|
+
const { buildChromeArgs, analyzeClipMediaFit } = await import("./src-2NN2WB6X.js");
|
|
277
277
|
const requestedGpuMode = resolveCliChromeGpuMode();
|
|
278
|
-
const { assertWebGpuAdapterAvailable, compositionRequiresWebGpu, resolveLocalWebGpu } = await import("./gpuPolicy-
|
|
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);
|