hyperframes 0.8.151 → 0.8.152

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 (165) hide show
  1. package/dist/{add-QKZZG7A2.js → add-SA33REHW.js} +14 -14
  2. package/dist/{animatedGifPrep-YQDPYGOD.js → animatedGifPrep-3YXJQZ7L.js} +9 -9
  3. package/dist/api.js +15 -15
  4. package/dist/{asset-3Q737Y4H.js → asset-PUVPTWPD.js} +2 -2
  5. package/dist/{assetCataloger-BTHEBJJB.js → assetCataloger-VWE2PLBX.js} +4 -4
  6. package/dist/{auth-XL7EU3SO.js → auth-PS3M6AI7.js} +1 -1
  7. package/dist/{autoUpdate-PJFLTQ3U.js → autoUpdate-CMO4SHWU.js} +2 -2
  8. package/dist/{backgroundChecks-T5TIR5WK.js → backgroundChecks-EDZ2A55J.js} +3 -3
  9. package/dist/backgroundChecksWorker.js +3 -3
  10. package/dist/{batchRender-NFLVIDB4.js → batchRender-7PLJISCN.js} +5 -5
  11. package/dist/{beats-JU4GZ26R.js → beats-2MDSIOE7.js} +14 -14
  12. package/dist/{benchmark-7U2YWLTW.js → benchmark-KBBXAPI4.js} +10 -10
  13. package/dist/{browser-D57UPYDA.js → browser-OMWKZRSW.js} +3 -3
  14. package/dist/{bundleWithLocalizedFonts-26MXQOZG.js → bundleWithLocalizedFonts-76DMCRIW.js} +2 -2
  15. package/dist/{capture-47BV25G3.js → capture-LRUUXH5Q.js} +2 -2
  16. package/dist/{capture-LT252COQ.js → capture-YGDC7GN3.js} +12 -12
  17. package/dist/{catalog-BEZXOV4O.js → catalog-SMEBKEVO.js} +14 -14
  18. package/dist/{catch-up-KVV5X6BF.js → catch-up-OMILX3WE.js} +4 -4
  19. package/dist/{check-6KQ433E6.js → check-NUZ62LIW.js} +131 -43
  20. package/dist/{checkBrowser-PRDR6XBY.js → checkBrowser-MSTVEL4V.js} +39 -38
  21. package/dist/{chunk-L6RIMCMG.js → chunk-3DZBQ7MH.js} +3 -3
  22. package/dist/{chunk-POEEDPJI.js → chunk-3E4OCOC5.js} +1 -1
  23. package/dist/{chunk-YZTVHRJ2.js → chunk-3HPJM5IQ.js} +1 -1
  24. package/dist/{chunk-OZ4K46OV.js → chunk-3LO7BBJX.js} +2 -2
  25. package/dist/{chunk-APDLWWFG.js → chunk-3VGU2SH7.js} +1 -1
  26. package/dist/{chunk-RRBKEHST.js → chunk-4UMKAUZI.js} +1 -1
  27. package/dist/{chunk-DHPFXAUF.js → chunk-57GN6KWT.js} +17 -3
  28. package/dist/{chunk-374QQGBQ.js → chunk-5CS4T6C6.js} +63 -12
  29. package/dist/{chunk-XQKVEQNY.js → chunk-5ERVRJMV.js} +2 -2
  30. package/dist/{chunk-S22FKF6G.js → chunk-5VMSUW4Z.js} +2 -2
  31. package/dist/{chunk-N4IXP3MY.js → chunk-6Z4YJ5Q3.js} +3 -3
  32. package/dist/{chunk-FJWEYVEM.js → chunk-7FYFEXD2.js} +658 -198
  33. package/dist/{chunk-4LE27ST4.js → chunk-7NPSXBIN.js} +2 -2
  34. package/dist/chunk-7TASSBN2.js +215 -0
  35. package/dist/{chunk-IP73NMQT.js → chunk-ANS56TPS.js} +10 -10
  36. package/dist/{chunk-PUIELIFA.js → chunk-BQK3J7XO.js} +1 -1
  37. package/dist/{chunk-RJRGR5KF.js → chunk-BYJYQWEX.js} +9 -9
  38. package/dist/{chunk-XXPYZBZ3.js → chunk-C6TPGUWD.js} +2 -2
  39. package/dist/{chunk-FAIYEIZ4.js → chunk-D6RJXQLD.js} +1 -1
  40. package/dist/{chunk-N3I6RAOR.js → chunk-DFXK7KUO.js} +11 -11
  41. package/dist/{chunk-DIOBKUBV.js → chunk-E6EYZ33P.js} +2 -2
  42. package/dist/{chunk-ZGCRVM5M.js → chunk-EVTHG34H.js} +2 -2
  43. package/dist/{chunk-IZPN423R.js → chunk-EXH6L2XZ.js} +2 -2
  44. package/dist/{chunk-AIJS74LG.js → chunk-FFDC5OWV.js} +8 -2
  45. package/dist/{chunk-KQGWP4KH.js → chunk-FNN5QINS.js} +1 -1
  46. package/dist/{chunk-DMKI64EZ.js → chunk-FSZAFCU7.js} +1 -1
  47. package/dist/{chunk-L3N7RJHS.js → chunk-GQETH4PE.js} +3 -3
  48. package/dist/{chunk-ZD3RDNZI.js → chunk-H2SGM2V2.js} +1 -1
  49. package/dist/{chunk-OSAH7S5M.js → chunk-H7FXBK3Q.js} +1 -1
  50. package/dist/{chunk-BRF3O35X.js → chunk-HBCRRCTX.js} +109 -31
  51. package/dist/{chunk-KXX6NLOT.js → chunk-IBYC3VUA.js} +1 -1
  52. package/dist/{chunk-IPDS2SWI.js → chunk-IEDT4EXE.js} +1 -1
  53. package/dist/{chunk-TCWMDCBX.js → chunk-IZIRIDJH.js} +2 -2
  54. package/dist/{chunk-4PKQEKAI.js → chunk-IZKXUYZE.js} +2 -2
  55. package/dist/chunk-KCFF4ENE.js +24 -0
  56. package/dist/{chunk-IZ7L6V76.js → chunk-KZ3L3W4Q.js} +1 -1
  57. package/dist/{chunk-YEBKEWKB.js → chunk-LECTCGGS.js} +1 -1
  58. package/dist/{chunk-O3DUX6P2.js → chunk-LVPSWUS6.js} +4 -4
  59. package/dist/{chunk-LKQS72D5.js → chunk-MNHPG2UO.js} +1 -1
  60. package/dist/{chunk-XKKBIFE5.js → chunk-NHAG2KCE.js} +7 -7
  61. package/dist/{chunk-HVXRYMGQ.js → chunk-PKO2EWO7.js} +1 -1
  62. package/dist/{chunk-XNDXENJQ.js → chunk-PRXAOZWZ.js} +3 -3
  63. package/dist/{chunk-4YZYYP7V.js → chunk-PTXZDSW5.js} +3 -3
  64. package/dist/{chunk-QF7AE3DB.js → chunk-QECEOV6W.js} +1 -1
  65. package/dist/{chunk-XGLNQDLN.js → chunk-QESSGUKX.js} +1 -1
  66. package/dist/{chunk-3SVC7SW4.js → chunk-RN5I2DP5.js} +3 -3
  67. package/dist/{chunk-QBYHNRHU.js → chunk-S3RCK56N.js} +1 -1
  68. package/dist/{chunk-RYL6ZIJP.js → chunk-SWCSL6WS.js} +5 -5
  69. package/dist/{chunk-2PSPARWP.js → chunk-TYXH3EKP.js} +4 -0
  70. package/dist/{chunk-FMNVTKX2.js → chunk-U3BCDVZO.js} +1 -1
  71. package/dist/{chunk-FLVI7FHU.js → chunk-VS732BUG.js} +1 -1
  72. package/dist/{chunk-LFNQDTSH.js → chunk-VYKPBRCB.js} +63 -12
  73. package/dist/{chunk-QLGBNGXC.js → chunk-XEFFJRYX.js} +2 -2
  74. package/dist/{chunk-3ZPFRDEJ.js → chunk-XINGD6MS.js} +4 -4
  75. package/dist/chunk-XSEGMQYA.js +30 -0
  76. package/dist/{chunk-GNTVYF7E.js → chunk-YOEGUBBY.js} +5 -5
  77. package/dist/{chunk-35PWWBGZ.js → chunk-YYEYOFHW.js} +1 -1
  78. package/dist/{chunk-XYHBVSWD.js → chunk-ZTM3RMAD.js} +2 -2
  79. package/dist/{clean-RLTHFTQA.js → clean-F75G45BI.js} +52 -31
  80. package/dist/cli.js +53 -53
  81. package/dist/{cloud-Q5TGBTW3.js → cloud-KVJAOUWH.js} +4 -4
  82. package/dist/{cloudrun-4UZF74MV.js → cloudrun-Q7Q7O4GY.js} +6 -6
  83. package/dist/{compare-Q5UNR2V4.js → compare-DGUJ4QWU.js} +30 -30
  84. package/dist/{compiler-ZXT27Z62.js → compiler-NCN6PTVH.js} +6 -6
  85. package/dist/{component-H734P32V.js → component-PSYGT3JV.js} +3 -3
  86. package/dist/{compositions-YEHDSTDR.js → compositions-J3GAETIC.js} +13 -13
  87. package/dist/{delete-LDBMPWRT.js → delete-MR7LRGRP.js} +2 -2
  88. package/dist/{deterministicFonts-C5JQLCTS.js → deterministicFonts-EOMDR6ZF.js} +3 -3
  89. package/dist/{dist-RGE4QASU.js → dist-2YYJYYPY.js} +3 -3
  90. package/dist/{dist-7JXLFD6U.js → dist-3MHXG6EJ.js} +4 -4
  91. package/dist/{doctor-XNJFIWJ7.js → doctor-JOUGR5UK.js} +11 -11
  92. package/dist/{events-UKCPUWMH.js → events-63BKDWVO.js} +3 -3
  93. package/dist/{events-G6UFLNXR.js → events-FZFBJCIH.js} +2 -2
  94. package/dist/{feedback-CK3KZ7DE.js → feedback-QLKWUDXR.js} +8 -8
  95. package/dist/{figma-3D5C737B.js → figma-YJ7HGVQC.js} +3 -3
  96. package/dist/fontLocalizeCli.js +12 -12
  97. package/dist/{get-QGTQUWFT.js → get-54MUUXMR.js} +2 -2
  98. package/dist/{gpuPolicy-G5QAQDYF.js → gpuPolicy-5OVNR75D.js} +9 -9
  99. package/dist/{grade-compare-XIHOM62P.js → grade-compare-7IDUF673.js} +30 -30
  100. package/dist/{gsapParserAcorn-VXZ3ZIF2.js → gsapParserAcorn-7NCK2LVT.js} +2 -2
  101. package/dist/{help-U5UBXT52.js → help-GQFYO5LU.js} +1 -1
  102. package/dist/{history-5J73QZSA.js → history-UI3O7CSO.js} +77 -205
  103. package/dist/hyperframes-player.global.js +1 -1
  104. package/dist/{info-RJHQQQUP.js → info-VQV3APEX.js} +9 -9
  105. package/dist/{init-M6UQOYYC.js → init-2UBFV5D7.js} +24 -24
  106. package/dist/{inspect-PRQWDBTP.js → inspect-36ACJ3CO.js} +31 -31
  107. package/dist/{installer-ZL7UKYK5.js → installer-GDUZDJG4.js} +7 -7
  108. package/dist/{keyframes-VMUJYTCQ.js → keyframes-GPBU34BG.js} +227 -82
  109. package/dist/{lambda-ON42DRQD.js → lambda-CBJVLTHY.js} +7 -7
  110. package/dist/{layout-QKBFVDVY.js → layout-2IHFV6EI.js} +31 -31
  111. package/dist/{lint-ZQHHL2SV.js → lint-IR6IYCEO.js} +9 -9
  112. package/dist/{lintProject-3Z6OJCSO.js → lintProject-XQWXJYSC.js} +3 -3
  113. package/dist/{list-YBRKIWGF.js → list-UAGKWARH.js} +2 -2
  114. package/dist/{login-4B2YXGLB.js → login-2GYCNCZF.js} +4 -4
  115. package/dist/{media-treatment-5C5EJAAP.js → media-treatment-Z553F7XI.js} +12 -12
  116. package/dist/{models-R7ZDWBJ6.js → models-6AZTNNSO.js} +12 -12
  117. package/dist/{motionShot-ZHESZNUL.js → motionShot-ARRL7WXT.js} +28 -15
  118. package/dist/{normalize-audio-EVWZVTBM.js → normalize-audio-CME4NUB6.js} +6 -6
  119. package/dist/{open-TV6HT4UT.js → open-HU2VXUFD.js} +4 -4
  120. package/dist/{parakeetRunner-YVVF4CG6.js → parakeetRunner-X5MKFMCB.js} +12 -12
  121. package/dist/{pipeline-ETR5SEBS.js → pipeline-MNFTEBJU.js} +9 -9
  122. package/dist/{play-C6WONRZV.js → play-2BBJDDAZ.js} +24 -24
  123. package/dist/{present-RANXTVPA.js → present-OE2WL2NY.js} +20 -20
  124. package/dist/{preview-KF6UMBT2.js → preview-RYSCCAWJ.js} +19 -19
  125. package/dist/{producer-CY2GXBWN.js → producer-SQWNRO66.js} +1 -1
  126. package/dist/{projectConfig-KPXCNMBM.js → projectConfig-B55Z7YKQ.js} +9 -9
  127. package/dist/{publication-Y36N4A7E.js → publication-MDZCOBJP.js} +4 -4
  128. package/dist/{publish-RCQJO35C.js → publish-AILV36BO.js} +12 -12
  129. package/dist/{remove-background-3ZMXVWLB.js → remove-background-6F72LKHG.js} +10 -10
  130. package/dist/{render-PTNEFO5U.js → render-2MZKU3L5.js} +10 -10
  131. package/dist/{render-FKVRCDT2.js → render-5EREH6YD.js} +57 -22
  132. package/dist/{render-WUSTRMUD.js → render-6GH5FSXU.js} +5 -5
  133. package/dist/{render-batch-AQHU2JWZ.js → render-batch-UMBUQWWS.js} +5 -5
  134. package/dist/renderSetupWorker.js +3 -3
  135. package/dist/{resolver-L5BDZJKU.js → resolver-KO6WWO5P.js} +6 -6
  136. package/dist/{sherpa-3S3ISG7G.js → sherpa-DADGYWNR.js} +11 -11
  137. package/dist/skills/hyperframes-cli/SKILL.md +3 -0
  138. package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +5 -1
  139. package/dist/{skills-X4WQEKNF.js → skills-QLKSNU4Y.js} +5 -5
  140. package/dist/{skillsUpdateCheck-UYCVHDZ6.js → skillsUpdateCheck-Z2QQGF2W.js} +3 -3
  141. package/dist/{snapshot-YEYHQEZQ.js → snapshot-D5BBFXOS.js} +118 -41
  142. package/dist/{src-2NN2WB6X.js → src-AVQBAECC.js} +8 -8
  143. package/dist/{src-OLBDPEG6.js → src-V7263E47.js} +11 -11
  144. package/dist/{staticProjectServer-7H35NMWB.js → staticProjectServer-HNWSVEWN.js} +20 -20
  145. package/dist/studio/assets/{hyperframes-player-DJt8E7k4.js → hyperframes-player-0BY7-PK7.js} +1 -1
  146. package/dist/studio/assets/{index-DWIHrAY2.js → index-COrWdzlj.js} +1 -1
  147. package/dist/studio/assets/{index-BGks9KLI.js → index-p-VXwuJ2.js} +132 -132
  148. package/dist/studio/assets/{index-DgbLblGR.js → index-rmD5k_ES.js} +1 -1
  149. package/dist/studio/index.html +1 -1
  150. package/dist/{studio-api-HGM2A5I3.js → studio-api-UXKTDWLT.js} +30 -16
  151. package/dist/{studioServer-M6XFL7N6.js → studioServer-JOVR24O3.js} +43 -43
  152. package/dist/{synthesize-22B7L5GX.js → synthesize-MBDVUSH3.js} +2 -1
  153. package/dist/{telemetry-KVCZKVTE.js → telemetry-UW7XAM5W.js} +3 -3
  154. package/dist/{timeline-VYYKZR4V.js → timeline-JSGTZ3AN.js} +20 -20
  155. package/dist/{tokens-B5NFFL55.js → tokens-ADDBGTQ7.js} +2 -2
  156. package/dist/{transcribe-SBETOIWI.js → transcribe-FEHOK626.js} +10 -10
  157. package/dist/{transcribe-WNFRYZAC.js → transcribe-P6MJGSZJ.js} +16 -16
  158. package/dist/{tts-QSAQZVEZ.js → tts-POI553RG.js} +1 -1
  159. package/dist/{updateCheck-5MM2DFUC.js → updateCheck-IBWMLXQ4.js} +2 -2
  160. package/dist/{upgrade-LWID54R3.js → upgrade-NHZ7AYPO.js} +2 -2
  161. package/dist/{urlDownloader-CVLNXFDG.js → urlDownloader-ULDRBWS5.js} +8 -8
  162. package/dist/{validate-V4CGQ6OF.js → validate-NVWNXNBV.js} +25 -25
  163. package/dist/{video-VJB2KRSS.js → video-74DRD2DN.js} +9 -9
  164. package/package.json +1 -1
  165. package/dist/chunk-WBLXWOYK.js +0 -15
@@ -19,10 +19,10 @@ import {
19
19
  import {
20
20
  formatVariableValidationIssue,
21
21
  validateVariables
22
- } from "./chunk-XQKVEQNY.js";
22
+ } from "./chunk-5ERVRJMV.js";
23
23
  import {
24
24
  extractCompositionMetadata
25
- } from "./chunk-LFNQDTSH.js";
25
+ } from "./chunk-VYKPBRCB.js";
26
26
 
27
27
  // src/utils/variables.ts
28
28
  import { readFileSync } from "fs";
@@ -0,0 +1,215 @@
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
+ DEFAULT_HISTORY_ROOT,
9
+ HistoryBusyError,
10
+ MAX_WINDOW_IDLE_MS,
11
+ openProjectHistory,
12
+ readProjectHistory
13
+ } from "./chunk-7FYFEXD2.js";
14
+ import {
15
+ resolveProject
16
+ } from "./chunk-IBYC3VUA.js";
17
+ import {
18
+ findPreviewServerForProject,
19
+ studioApiUrl
20
+ } from "./chunk-DQBY7FRR.js";
21
+
22
+ // src/utils/historyOwner.ts
23
+ import { randomUUID } from "crypto";
24
+ import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "fs";
25
+ import { dirname, join, resolve } from "path";
26
+ var historyDeps = {
27
+ historyRoot: resolve(process.env.HYPERFRAMES_HISTORY_ROOT || DEFAULT_HISTORY_ROOT),
28
+ findServer: (projectDir) => findPreviewServerForProject(projectDir),
29
+ /** A turn with no write for this long has ended, through a preview or not. */
30
+ turnIdleMs: MAX_WINDOW_IDLE_MS,
31
+ ownerWaitMs: void 0,
32
+ now: () => Date.now()
33
+ };
34
+ var Refusal = class extends Error {
35
+ };
36
+ var turnFile = (dir) => join(dir, ".hyperframes", "history-turn.json");
37
+ function readTurn(dir) {
38
+ try {
39
+ const turn = JSON.parse(readFileSync(turnFile(dir), "utf-8"));
40
+ return typeof turn.lastWriteAt === "number" ? { ...turn, parts: turn.parts ?? [] } : null;
41
+ } catch {
42
+ return null;
43
+ }
44
+ }
45
+ function writeTurn(dir, turn) {
46
+ if (!turn) return rmSync(turnFile(dir), { force: true });
47
+ mkdirSync(dirname(turnFile(dir)), { recursive: true });
48
+ writeFileSync(turnFile(dir), JSON.stringify(turn));
49
+ }
50
+ var lastTurnsFile = (dir) => join(dir, ".hyperframes", "history-turns.json");
51
+ function readLastTurns(dir) {
52
+ try {
53
+ const turns = JSON.parse(readFileSync(lastTurnsFile(dir), "utf-8"));
54
+ return turns && typeof turns === "object" ? turns : {};
55
+ } catch {
56
+ return {};
57
+ }
58
+ }
59
+ function lastTurnParts(dir, name) {
60
+ return readLastTurns(dir)[name] ?? null;
61
+ }
62
+ var samePart = (a, b) => a.who.kind === b.who.kind && a.who.name === b.who.name && a.label === b.label && a.startedAt === b.startedAt;
63
+ async function endTurn(owner, turn, dir) {
64
+ const entry = await owner.end(turn.id);
65
+ const cut = (await owner.list()).filter((other) => samePart(other, entry ?? turn));
66
+ const own = entry ? [entry.id] : [];
67
+ const parts = [.../* @__PURE__ */ new Set([...turn.parts, ...cut.map((part) => part.id), ...own])];
68
+ const draft = `${lastTurnsFile(dir)}.${process.pid}.tmp`;
69
+ mkdirSync(dirname(draft), { recursive: true });
70
+ writeFileSync(draft, JSON.stringify({ ...readLastTurns(dir), [turn.who.name]: parts }));
71
+ renameSync(draft, lastTurnsFile(dir));
72
+ writeTurn(dir, null);
73
+ return { entry, parts };
74
+ }
75
+ function previewOwner(route) {
76
+ const call = async (path, body, signal) => {
77
+ const init = {
78
+ ...body && {
79
+ method: "POST",
80
+ headers: { "content-type": "application/json" },
81
+ body: JSON.stringify(body)
82
+ },
83
+ ...signal && { signal }
84
+ };
85
+ const response = await fetch(route(path), init);
86
+ if (response.ok) return response;
87
+ const error = await response.json().catch(() => null);
88
+ throw new Refusal(error?.error ?? `The preview answered ${response.status}.`);
89
+ };
90
+ const json = async (path, body, signal) => (await call(path, body, signal)).json();
91
+ const list = async () => (await json("")).entries;
92
+ return {
93
+ via: "preview",
94
+ list,
95
+ peek: async (point) => (await json(`/peek/${encodeURIComponent(point)}`)).files,
96
+ blob: async (hash) => Buffer.from(await (await call(`/blob/${hash}`)).arrayBuffer()),
97
+ undo: (id, who, mode) => json("/undo", { entryId: id, who, mode }),
98
+ restore: (point, who) => json("/restore", { point, who }),
99
+ pin: async (id, pinned) => void await json("/pin", { entryId: id, pinned }),
100
+ begin: async (who, label, exclusive) => {
101
+ const opened = await json("/window", {
102
+ who,
103
+ label,
104
+ idleMs: historyDeps.turnIdleMs,
105
+ ...exclusive && { exclusive: true }
106
+ });
107
+ return { id: opened.windowId, startedAt: opened.startedAt ?? historyDeps.now() };
108
+ },
109
+ // A preview restarted since begin committed the window on its way down.
110
+ end: (id) => json(`/window/${id}/close`, {}).then((closed) => closed.entry).catch(async () => (await list()).find((entry) => entry.id === id) ?? null),
111
+ checkpoint: async () => void await json("/checkpoint", {}, AbortSignal.timeout(5e3)),
112
+ close: async () => {
113
+ }
114
+ };
115
+ }
116
+ async function directOwner(projectDir) {
117
+ let turn = null;
118
+ const history = await openProjectHistory({
119
+ projectDir,
120
+ historyRoot: historyDeps.historyRoot,
121
+ now: () => historyDeps.now(),
122
+ pruneGoneProjectsBudgetMs: 1e3,
123
+ ownerWaitMs: historyDeps.ownerWaitMs,
124
+ closedWindowAfterOwnership: () => {
125
+ turn = readTurn(projectDir);
126
+ return turn ? {
127
+ id: turn.id,
128
+ who: turn.who,
129
+ label: turn.label,
130
+ startedAt: turn.startedAt,
131
+ lastWriteAt: turn.lastWriteAt,
132
+ idleMs: historyDeps.turnIdleMs
133
+ } : void 0;
134
+ }
135
+ });
136
+ return {
137
+ turn,
138
+ owner: {
139
+ via: "direct",
140
+ list: async () => history.list(),
141
+ peek: async (point) => history.peek(point),
142
+ blob: (hash) => history.readBlob(hash),
143
+ undo: (id, who, mode) => history.undo(id, { who, ...mode && { mode } }),
144
+ restore: (point, who) => history.restore(point, who),
145
+ pin: async (id, pinned) => history.pin(id, pinned),
146
+ // Opening filed every earlier write; the turn's own writes are filed to it when the next open passes it.
147
+ begin: async () => ({ id: randomUUID(), startedAt: historyDeps.now() }),
148
+ end: async (id) => history.list().find((entry) => entry.id === id) ?? null,
149
+ checkpoint: () => history.checkpoint(),
150
+ close: () => history.close()
151
+ }
152
+ };
153
+ }
154
+ async function connect(projectDir) {
155
+ const server = await historyDeps.findServer(projectDir);
156
+ if (server) {
157
+ const route = (path) => studioApiUrl(server, `history${path}`);
158
+ const status = await fetch(route("")).then(
159
+ (response) => response.status,
160
+ () => 404
161
+ );
162
+ if (status !== 404) return { owner: previewOwner(route), turn: readTurn(projectDir) };
163
+ }
164
+ return directOwner(projectDir);
165
+ }
166
+ async function withOwner(dir, task) {
167
+ const { dir: projectDir } = resolveProject(dir);
168
+ const { owner, turn } = await connect(projectDir);
169
+ try {
170
+ return await task(owner, turn, projectDir);
171
+ } finally {
172
+ try {
173
+ if (owner.via === "direct" && turn) {
174
+ const kept = (await owner.list()).find((entry) => entry.id === turn.id);
175
+ if (readTurn(projectDir)?.id === turn.id) {
176
+ const lastWriteAt = kept ? kept.endedAt : turn.lastWriteAt;
177
+ const parts = kept ? [...turn.parts, kept.id] : turn.parts;
178
+ writeTurn(projectDir, { ...turn, via: "direct", id: randomUUID(), lastWriteAt, parts });
179
+ }
180
+ }
181
+ } finally {
182
+ await owner.close();
183
+ }
184
+ }
185
+ }
186
+ async function withReader(dir, task) {
187
+ try {
188
+ return await withOwner(dir, (owner) => task(owner));
189
+ } catch (error) {
190
+ if (!(error instanceof HistoryBusyError)) throw error;
191
+ }
192
+ const view = readProjectHistory({
193
+ projectDir: resolveProject(dir).dir,
194
+ historyRoot: historyDeps.historyRoot
195
+ });
196
+ return task({
197
+ via: "direct",
198
+ list: async () => view.list(),
199
+ peek: async (point) => view.peek(point),
200
+ // The owner may have pruned a blob since its log was read.
201
+ blob: (hash) => view.readBlob(hash).catch((error) => {
202
+ throw error.code === "ENOENT" ? new Refusal("That point is no longer kept") : error;
203
+ })
204
+ });
205
+ }
206
+
207
+ export {
208
+ historyDeps,
209
+ Refusal,
210
+ writeTurn,
211
+ lastTurnParts,
212
+ endTurn,
213
+ withOwner,
214
+ withReader
215
+ };
@@ -9,17 +9,17 @@ import {
9
9
  resolveCliChromeGpuMode,
10
10
  seekCompositionTimeline,
11
11
  waitForRuntimeReady
12
- } from "./chunk-RYL6ZIJP.js";
12
+ } from "./chunk-SWCSL6WS.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-RRBKEHST.js";
19
+ } from "./chunk-4UMKAUZI.js";
20
20
  import {
21
21
  resolveProject
22
- } from "./chunk-KXX6NLOT.js";
22
+ } from "./chunk-IBYC3VUA.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-35PWWBGZ.js";
36
+ } from "./chunk-YYEYOFHW.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-CY2GXBWN.js");
231
+ const { loadProducer } = await import("./producer-SQWNRO66.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-ZXT27Z62.js");
252
+ const { bundleToSingleHtml } = await import("./compiler-NCN6PTVH.js");
253
253
  const { ensureBrowser } = await import("./manager-ZLJD3EAY.js");
254
- const { serveStaticProjectHtml } = await import("./staticProjectServer-7H35NMWB.js");
255
- const { lintProject } = await import("./lintProject-3Z6OJCSO.js");
254
+ const { serveStaticProjectHtml } = await import("./staticProjectServer-HNWSVEWN.js");
255
+ const { lintProject } = await import("./lintProject-XQWXJYSC.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-2NN2WB6X.js");
276
+ const { buildChromeArgs, analyzeClipMediaFit } = await import("./src-AVQBAECC.js");
277
277
  const requestedGpuMode = resolveCliChromeGpuMode();
278
- const { assertWebGpuAdapterAvailable, compositionRequiresWebGpu, resolveLocalWebGpu } = await import("./gpuPolicy-G5QAQDYF.js");
278
+ const { assertWebGpuAdapterAvailable, compositionRequiresWebGpu, resolveLocalWebGpu } = await import("./gpuPolicy-5OVNR75D.js");
279
279
  const resolvedGpuMode = await resolveManagedGpuMode(requestedGpuMode, browser.executablePath);
280
280
  const requiresWebGpu = compositionRequiresWebGpu(html);
281
281
  const { gpuConfig, softwareWebGpu } = resolveLocalWebGpu(resolvedGpuMode, requiresWebGpu);
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  VERSION
9
- } from "./chunk-TCWMDCBX.js";
9
+ } from "./chunk-IZIRIDJH.js";
10
10
 
11
11
  // src/registry/compatibility.ts
12
12
  import { compareVersions } from "compare-versions";
@@ -6,24 +6,24 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  serveStaticProjectHtml
9
- } from "./chunk-L3N7RJHS.js";
9
+ } from "./chunk-GQETH4PE.js";
10
10
  import {
11
11
  AUDIT_SEEK_OPTIONS,
12
12
  installPageFunctionGuard,
13
13
  seekCompositionTimeline,
14
14
  waitForCompositionFonts,
15
15
  waitForRuntimeReady
16
- } from "./chunk-RYL6ZIJP.js";
16
+ } from "./chunk-SWCSL6WS.js";
17
17
  import {
18
18
  launchManagedBrowser,
19
19
  resolveManagedGpuMode
20
- } from "./chunk-RRBKEHST.js";
20
+ } from "./chunk-4UMKAUZI.js";
21
21
  import {
22
22
  resolveDiagnosticNavigationTimeoutMs
23
- } from "./chunk-HVXRYMGQ.js";
23
+ } from "./chunk-PKO2EWO7.js";
24
24
  import {
25
25
  resolveProject
26
- } from "./chunk-KXX6NLOT.js";
26
+ } from "./chunk-IBYC3VUA.js";
27
27
  import {
28
28
  defineCommand
29
29
  } from "./chunk-S3S4TGEH.js";
@@ -37,7 +37,7 @@ import {
37
37
  import {
38
38
  printDeprecationNotice,
39
39
  withMeta
40
- } from "./chunk-35PWWBGZ.js";
40
+ } from "./chunk-YYEYOFHW.js";
41
41
  import {
42
42
  normalizeErrorMessage
43
43
  } from "./chunk-KNU5COPB.js";
@@ -707,7 +707,7 @@ async function collectTweenBoundaries(page) {
707
707
  });
708
708
  }
709
709
  async function bundleProjectHtml(projectDir) {
710
- const { bundleToSingleHtml } = await import("./compiler-ZXT27Z62.js");
710
+ const { bundleToSingleHtml } = await import("./compiler-NCN6PTVH.js");
711
711
  return bundleToSingleHtml(projectDir);
712
712
  }
713
713
  async function alignViewportToComposition(page, url) {
@@ -729,13 +729,13 @@ async function alignViewportToComposition(page, url) {
729
729
  async function runLayoutAudit(projectDir, opts) {
730
730
  const { ensureBrowser } = await import("./manager-ZLJD3EAY.js");
731
731
  const puppeteer = await import("puppeteer-core");
732
- const { buildChromeArgs } = await import("./src-2NN2WB6X.js");
732
+ const { buildChromeArgs } = await import("./src-AVQBAECC.js");
733
733
  const {
734
734
  assertWebGpuAdapterAvailable,
735
735
  compositionRequiresWebGpu,
736
736
  resolveLocalBrowserGpuMode,
737
737
  resolveLocalWebGpu
738
- } = await import("./gpuPolicy-G5QAQDYF.js");
738
+ } = await import("./gpuPolicy-5OVNR75D.js");
739
739
  const html = await bundleProjectHtml(projectDir);
740
740
  const server = await serveStaticProjectHtml(
741
741
  projectDir,
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveWithinProject
9
- } from "./chunk-AIJS74LG.js";
9
+ } from "./chunk-FFDC5OWV.js";
10
10
  import {
11
11
  MAX_AUDIO_GAIN_DB,
12
12
  formatAudioGain,
@@ -21,7 +21,7 @@ import {
21
21
  readMediaOffsetSeconds
22
22
  } from "./chunk-BSQ7XANM.js";
23
23
 
24
- // ../studio-server/dist/chunk-VMT4OC5B.js
24
+ // ../studio-server/dist/chunk-KR3B6IJC.js
25
25
  import { execFile } from "child_process";
26
26
  import { isAbsolute, relative, resolve } from "path";
27
27
  import { promisify } from "util";
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-HVW7ABXD.js";
13
13
  import {
14
14
  DEFAULT_REGISTRY_URL
15
- } from "./chunk-YZTVHRJ2.js";
15
+ } from "./chunk-3HPJM5IQ.js";
16
16
 
17
17
  // src/utils/projectConfig.ts
18
18
  import { readFileSync, writeFileSync } from "fs";
@@ -11,12 +11,12 @@ import {
11
11
  iterateFontFamilyDeclarations,
12
12
  normalizeSystemFontPrimaryFamilies,
13
13
  resolveFontFamilyDeclarationFamilies
14
- } from "./chunk-FMNVTKX2.js";
14
+ } from "./chunk-U3BCDVZO.js";
15
15
  import {
16
16
  EncoderInterruptedError,
17
17
  encoderFailureError,
18
18
  prepareAnimatedGifInputs
19
- } from "./chunk-XYHBVSWD.js";
19
+ } from "./chunk-ZTM3RMAD.js";
20
20
  import {
21
21
  createStudioPositionSeekReapplyScript
22
22
  } from "./chunk-EOOEC32M.js";
@@ -147,7 +147,7 @@ import {
147
147
  validateEngineConfigSnapshot,
148
148
  verifyDiskDrawElementSamples,
149
149
  writeCapturedFrame
150
- } from "./chunk-IZPN423R.js";
150
+ } from "./chunk-EXH6L2XZ.js";
151
151
  import {
152
152
  assignBundledRuntimeCompositionIds,
153
153
  buildVariablesByCompScript,
@@ -160,7 +160,7 @@ import {
160
160
  isTemplateEntry,
161
161
  parsesAsScript,
162
162
  prepareFlattenedInnerRoot
163
- } from "./chunk-3SVC7SW4.js";
163
+ } from "./chunk-RN5I2DP5.js";
164
164
  import {
165
165
  LOW_MEMORY_TOTAL_MB_THRESHOLD,
166
166
  getCgroupMemoryLimitMb,
@@ -184,7 +184,7 @@ import {
184
184
  resolveAbsoluteMediaStartSeconds,
185
185
  resolveAuthoredTimingWindow,
186
186
  toFps
187
- } from "./chunk-XQKVEQNY.js";
187
+ } from "./chunk-5ERVRJMV.js";
188
188
  import {
189
189
  COMPOSITION_SOURCE_URL,
190
190
  HF_COLOR_GRADING_ATTR,
@@ -212,7 +212,7 @@ import {
212
212
  shouldClampResolvedMediaDuration,
213
213
  sourceTimeAt,
214
214
  styleElementsFor
215
- } from "./chunk-QBYHNRHU.js";
215
+ } from "./chunk-S3RCK56N.js";
216
216
  import {
217
217
  MAX_AUDIO_GAIN
218
218
  } from "./chunk-UJKQWGFF.js";
@@ -226,7 +226,7 @@ import {
226
226
  isAspectAgnosticResolutionAlias,
227
227
  normalizeResolutionFlag,
228
228
  suggestMatchingPreset
229
- } from "./chunk-LFNQDTSH.js";
229
+ } from "./chunk-VYKPBRCB.js";
230
230
  import {
231
231
  redactKnownPaths,
232
232
  redactTelemetryString
@@ -236,7 +236,7 @@ import {
236
236
  } from "./chunk-TWWSYAKJ.js";
237
237
  import {
238
238
  lintHyperframeHtml
239
- } from "./chunk-GNTVYF7E.js";
239
+ } from "./chunk-YOEGUBBY.js";
240
240
  import {
241
241
  isUnresolvedAssetPlaceholder,
242
242
  readProjectFile,
@@ -6563,7 +6563,7 @@ async function readLocalFont(absPath) {
6563
6563
  return { kind: "inline", buffer: Buffer.concat(chunks, totalBytes) };
6564
6564
  }
6565
6565
  async function embedLocalFontFaces(html, projectDir) {
6566
- const { fontToDataUri: toDataUri } = await import("./deterministicFonts-C5JQLCTS.js");
6566
+ const { fontToDataUri: toDataUri } = await import("./deterministicFonts-EOMDR6ZF.js");
6567
6567
  const styleBlockRe = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
6568
6568
  const fontFaceRe = /@font-face\s*\{([^}]*)\}/gi;
6569
6569
  let result = html;
@@ -14401,7 +14401,7 @@ function startServer(options = {}) {
14401
14401
  });
14402
14402
  async function shutdown(signal) {
14403
14403
  log.info(`Received ${signal}, shutting down`);
14404
- const { drainBrowserPool } = await import("./src-2NN2WB6X.js");
14404
+ const { drainBrowserPool } = await import("./src-AVQBAECC.js");
14405
14405
  await drainBrowserPool().catch(() => {
14406
14406
  });
14407
14407
  const handle = await Promise.race([
@@ -15587,7 +15587,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
15587
15587
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
15588
15588
  if (probeResult.probeSession) {
15589
15589
  try {
15590
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-2NN2WB6X.js");
15590
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-AVQBAECC.js");
15591
15591
  await closeCaptureSession2(probeResult.probeSession);
15592
15592
  } catch (err) {
15593
15593
  log.warn("[plan] probe session close failed", {
@@ -21,10 +21,10 @@ import {
21
21
  emitWords,
22
22
  getPreparedWavDurationSeconds,
23
23
  prepareWav
24
- } from "./chunk-QF7AE3DB.js";
24
+ } from "./chunk-QECEOV6W.js";
25
25
  import {
26
26
  stoppedByCancelSignal
27
- } from "./chunk-KQGWP4KH.js";
27
+ } from "./chunk-FNN5QINS.js";
28
28
  import {
29
29
  PARAKEET_MODEL_LABEL,
30
30
  SHERPA_ERROR_PREFIX,
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveConfig,
9
9
  usesSoftwareWebGpu
10
- } from "./chunk-IZPN423R.js";
10
+ } from "./chunk-EXH6L2XZ.js";
11
11
 
12
12
  // src/browser/gpuPolicy.ts
13
13
  function resolveLocalBrowserGpuMode(browserGpuArg, envMode = process.env.PRODUCER_BROWSER_GPU_MODE) {
@@ -17,7 +17,7 @@ function resolveLocalBrowserGpuMode(browserGpuArg, envMode = process.env.PRODUCE
17
17
  return "auto";
18
18
  }
19
19
  async function resolveCaptureBrowserGpuMode(requestedMode, chromePath) {
20
- const { resolveBrowserGpuMode } = await import("./src-2NN2WB6X.js");
20
+ const { resolveBrowserGpuMode } = await import("./src-AVQBAECC.js");
21
21
  return resolveBrowserGpuMode(requestedMode, { chromePath });
22
22
  }
23
23
  function resolveLocalWebGpu(browserGpuMode, requiresWebGpu) {
@@ -26,7 +26,7 @@ import {
26
26
  renderFrameIdForRenderId,
27
27
  resolveAuthoredTimingWindow,
28
28
  toFps
29
- } from "./chunk-XQKVEQNY.js";
29
+ } from "./chunk-5ERVRJMV.js";
30
30
  import {
31
31
  AUDIO_GROUP_RENDER_ID_ATTR,
32
32
  COLOR_GRADING_SOURCE_HIDDEN_ATTR,
@@ -55,7 +55,7 @@ import {
55
55
  shiftRateLane,
56
56
  sourceTimeAt,
57
57
  timeAtSourceTime
58
- } from "./chunk-QBYHNRHU.js";
58
+ } from "./chunk-S3RCK56N.js";
59
59
  import {
60
60
  clampAudioGain,
61
61
  isAudibleVideoElement
@@ -199,7 +199,7 @@ function studioMotionRenderRuntime(manifestContent, activeCompositionPath) {
199
199
  applyManifest();
200
200
  }
201
201
 
202
- // ../studio-server/dist/chunk-M62HDRLX.js
202
+ // ../studio-server/dist/chunk-K56J3CL7.js
203
203
  import { basename, dirname, isAbsolute, join, relative, sep } from "path";
204
204
  import { readdirSync } from "fs";
205
205
  function resolveWithinProject2(base, relativePath) {
@@ -227,7 +227,12 @@ function isPrivateProjectFile(projectDir, filePath) {
227
227
  );
228
228
  }
229
229
  function pinWithinProject(base, relativePath) {
230
- const checked = resolveWithinProject2(base, relativePath);
230
+ return pinResolved(base, resolveWithinProject2(base, relativePath));
231
+ }
232
+ function pinProjectRecord(base, relativePath) {
233
+ return pinResolved(base, resolveWithinProject(base, relativePath));
234
+ }
235
+ function pinResolved(base, checked) {
231
236
  if (!checked) return null;
232
237
  const inside = relative(realFilePath(base), realFilePath(checked));
233
238
  const escapes = inside === ".." || inside.startsWith(`..${sep}`) || isAbsolute(inside);
@@ -278,6 +283,7 @@ export {
278
283
  isPrivateProjectPath,
279
284
  isPrivateProjectFile,
280
285
  pinWithinProject,
286
+ pinProjectRecord,
281
287
  isInHiddenOrVendorDir,
282
288
  walkDir
283
289
  };
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  setHostHandlesSigint
9
- } from "./chunk-IZPN423R.js";
9
+ } from "./chunk-EXH6L2XZ.js";
10
10
  import {
11
11
  processAncestorSnapshot,
12
12
  processIdentity,
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  VALID_CANVAS_RESOLUTIONS,
9
9
  resolveResolutionFlagPair
10
- } from "./chunk-LFNQDTSH.js";
10
+ } from "./chunk-VYKPBRCB.js";
11
11
 
12
12
  // src/utils/parseOutputResolution.ts
13
13
  function parseOutputResolutionFlag(raw, options) {
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  getMimeType,
9
9
  injectMediaCodecMapIntoHtml
10
- } from "./chunk-BRF3O35X.js";
10
+ } from "./chunk-HBCRRCTX.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-3ZPFRDEJ.js";
21
+ } from "./chunk-XINGD6MS.js";
22
22
  import {
23
23
  resolveAutoProxy
24
- } from "./chunk-FAIYEIZ4.js";
24
+ } from "./chunk-D6RJXQLD.js";
25
25
  import {
26
26
  decodeWellFormedEscapes
27
27
  } from "./chunk-BSQ7XANM.js";
@@ -8,7 +8,7 @@ import {
8
8
  flush,
9
9
  shouldTrack,
10
10
  trackEvent
11
- } from "./chunk-IZ7L6V76.js";
11
+ } from "./chunk-KZ3L3W4Q.js";
12
12
  import {
13
13
  getPowerState
14
14
  } from "./chunk-XBSPQ52S.js";
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  updateNoticesSuppressed
9
- } from "./chunk-35PWWBGZ.js";
9
+ } from "./chunk-YYEYOFHW.js";
10
10
  import {
11
11
  hostAnswers
12
12
  } from "./chunk-K4WIOZFP.js";