hyperframes 0.8.112 → 0.8.114

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 (163) hide show
  1. package/dist/{add-NIVC2YMT.js → add-KCBOVKEU.js} +15 -15
  2. package/dist/{animatedGifPrep-NWAJKCHG.js → animatedGifPrep-U7FMC7DB.js} +6 -6
  3. package/dist/{asset-O6JJKF3Z.js → asset-AJ4ZZE3K.js} +2 -2
  4. package/dist/{assetCataloger-DJSPW3RL.js → assetCataloger-5LCGR5XU.js} +2 -2
  5. package/dist/{auth-6XRZQQQS.js → auth-PSEHAWSA.js} +2 -2
  6. package/dist/{autoUpdate-GZHLQBLS.js → autoUpdate-E32YLKFZ.js} +2 -2
  7. package/dist/{backgroundChecks-4QQRGJ5S.js → backgroundChecks-FNHBA7YI.js} +3 -3
  8. package/dist/backgroundChecksWorker.js +3 -3
  9. package/dist/{batchRender-PJGNXN7F.js → batchRender-QVJ7NEUH.js} +3 -3
  10. package/dist/{beats-VYR6B4UB.js → beats-F67KZC3V.js} +11 -11
  11. package/dist/{benchmark-CGP2NKIP.js → benchmark-CGD6CPRK.js} +12 -12
  12. package/dist/{browser-ZWD4ETXK.js → browser-FPX3Z2AR.js} +11 -11
  13. package/dist/{bundleWithLocalizedFonts-JWHKLSZM.js → bundleWithLocalizedFonts-4CVITCYK.js} +2 -2
  14. package/dist/{capture-C4MPRLJV.js → capture-F2Y7TIHU.js} +8 -8
  15. package/dist/{capture-IQ7AUK6M.js → capture-GLHK4ST7.js} +2 -2
  16. package/dist/{catalog-RZ7PWQMS.js → catalog-4BZX7MQQ.js} +15 -15
  17. package/dist/{check-7UU4SSO6.js → check-IO3HWLLU.js} +32 -32
  18. package/dist/{checkBrowser-6KYNYIU7.js → checkBrowser-JTQ7ABCL.js} +29 -29
  19. package/dist/{chunk-OWN3ZIIK.js → chunk-3IUSKIZW.js} +1 -1
  20. package/dist/{chunk-UTXMQVB2.js → chunk-3SH322X7.js} +10 -10
  21. package/dist/{chunk-YQ5MFXWG.js → chunk-4KGMIOMY.js} +5 -5
  22. package/dist/{chunk-N34BYX3E.js → chunk-4PFZPP2N.js} +54 -30
  23. package/dist/{chunk-2GXKCB7J.js → chunk-6U3K3U62.js} +1 -1
  24. package/dist/{chunk-7G25WGTA.js → chunk-752X6G7T.js} +2 -2
  25. package/dist/{chunk-KQ3VNA6R.js → chunk-7543YIMQ.js} +1 -1
  26. package/dist/{chunk-GODQ5XA4.js → chunk-7ZR25WGW.js} +8 -16
  27. package/dist/{chunk-OXZO4WQI.js → chunk-BORVRAHJ.js} +9 -9
  28. package/dist/{chunk-H3WFEPV2.js → chunk-BOUDTDBQ.js} +1 -1
  29. package/dist/chunk-C6AIZOQN.js +3541 -0
  30. package/dist/{chunk-QXERSWXX.js → chunk-DQBY7FRR.js} +123 -3
  31. package/dist/{chunk-36XLW2TP.js → chunk-DR7QW6C5.js} +2 -2
  32. package/dist/{chunk-VW6CVKVA.js → chunk-E52XEEAA.js} +2 -2
  33. package/dist/{chunk-5SDXALUQ.js → chunk-ENHAGQEP.js} +1 -1
  34. package/dist/{chunk-C4JINRJK.js → chunk-FCEFKWPM.js} +1 -1
  35. package/dist/{chunk-P74PW7KR.js → chunk-G2T2X6FZ.js} +3 -3
  36. package/dist/{chunk-CS4IE5G7.js → chunk-GDJ74GHW.js} +4 -3
  37. package/dist/{chunk-KS5HFREQ.js → chunk-HGMKPPGD.js} +4 -4
  38. package/dist/{chunk-VHRHI3CU.js → chunk-HTQR7SUZ.js} +1 -1
  39. package/dist/{chunk-M4RYK5OF.js → chunk-IP3XINRB.js} +1 -1
  40. package/dist/{chunk-E664L6K3.js → chunk-IPXPSCWV.js} +3 -3
  41. package/dist/{chunk-LYBFDHXD.js → chunk-JH7ZJRDL.js} +3 -3
  42. package/dist/chunk-K4WKGXRC.js +18 -0
  43. package/dist/{chunk-JRULOVZK.js → chunk-L5QASNBN.js} +1 -1
  44. package/dist/{chunk-NOOBRCMC.js → chunk-LDSWUYZB.js} +3 -3
  45. package/dist/{chunk-TSZU5JMC.js → chunk-LMC46FK5.js} +2 -2
  46. package/dist/{chunk-P3AQVFY2.js → chunk-LSSIYIXI.js} +3 -3
  47. package/dist/{chunk-TXVN43SX.js → chunk-LYNBNESS.js} +80 -13
  48. package/dist/{chunk-BD3MHTSR.js → chunk-MLLBZR2U.js} +2 -2
  49. package/dist/{chunk-Q7U7QRC7.js → chunk-MR6BQLGM.js} +2 -2
  50. package/dist/{chunk-POEGJGEA.js → chunk-MST5JBOR.js} +1 -1
  51. package/dist/{chunk-J2S4MY2M.js → chunk-OCNCK5FQ.js} +2 -2
  52. package/dist/{chunk-BSBIG74E.js → chunk-P3FGUSFK.js} +8 -8
  53. package/dist/{chunk-4BXTKKRD.js → chunk-QPR4N2D4.js} +1 -1
  54. package/dist/{chunk-EA4LCCJI.js → chunk-RKSRXPKV.js} +5 -5
  55. package/dist/{chunk-KIIKVKHB.js → chunk-SIN32SJB.js} +2 -2
  56. package/dist/{chunk-PRETPA7Z.js → chunk-SSM2TJYE.js} +1 -1
  57. package/dist/{chunk-BLI5XATY.js → chunk-SYQOD3W7.js} +1 -1
  58. package/dist/{chunk-KPSRL2NB.js → chunk-T3NMEYGM.js} +1 -1
  59. package/dist/{chunk-3Q7HXIXZ.js → chunk-VFCKXTBB.js} +5 -2
  60. package/dist/{chunk-7VIXEM6Q.js → chunk-VLC7JS4K.js} +1 -1
  61. package/dist/{chunk-A6GVXZZ3.js → chunk-WAS5VEA4.js} +1 -1
  62. package/dist/{chunk-BZGWHPRW.js → chunk-XFJXFNJF.js} +3 -3
  63. package/dist/{chunk-7OJSZTJK.js → chunk-XXKBPGPJ.js} +2 -2
  64. package/dist/{chunk-YAFO7V4A.js → chunk-YJEGT5L6.js} +1 -1
  65. package/dist/{chunk-2BEOCUAG.js → chunk-ZMMSMDCA.js} +1 -1
  66. package/dist/{clean-263PH5CR.js → clean-MCL76KQH.js} +16 -16
  67. package/dist/cli.js +122 -54
  68. package/dist/{cloud-STLYEQNN.js → cloud-444K6HIK.js} +4 -4
  69. package/dist/{cloudrun-7ZVNB6FY.js → cloudrun-BML6ZG7K.js} +3 -3
  70. package/dist/{compare-33JLJ52D.js → compare-CGNTCOR2.js} +24 -24
  71. package/dist/{compiler-H3QAMMC2.js → compiler-ZHVIEP26.js} +3 -3
  72. package/dist/{component-O5JLM26B.js → component-HTXLOIHR.js} +3 -3
  73. package/dist/{compositions-CN4ZVT5G.js → compositions-KK46F5AC.js} +11 -11
  74. package/dist/{delete-Z23A45R3.js → delete-SSRZKKWQ.js} +2 -2
  75. package/dist/{deploy-PJLSZMUH.js → deploy-MX76RZ36.js} +1 -1
  76. package/dist/{destroy-IPUDK6YN.js → destroy-H2TZBYHH.js} +1 -1
  77. package/dist/{dist-ICXYT7XK.js → dist-HRBNHR4M.js} +1 -1
  78. package/dist/{dist-7VEVT4NT.js → dist-OKRUIHYU.js} +2 -2
  79. package/dist/{doctor-6QLXSGPK.js → doctor-IIOX25KM.js} +11 -11
  80. package/dist/{events-UA4DJUO2.js → events-DCUZBRW6.js} +9 -9
  81. package/dist/{events-EAAIWITP.js → events-TYMMAKHX.js} +8 -8
  82. package/dist/{feedback-2CIRCBHY.js → feedback-RIAGW6LG.js} +10 -10
  83. package/dist/{figma-DFCCII66.js → figma-VBOUGJNX.js} +3 -3
  84. package/dist/fontLocalizeCli.js +8 -8
  85. package/dist/{get-UQ2AAXWM.js → get-LT6NUGNR.js} +2 -2
  86. package/dist/{gpuPolicy-CPCLBMS5.js → gpuPolicy-LRMOZXFU.js} +6 -6
  87. package/dist/{grade-compare-THUUFHO3.js → grade-compare-WWYQSQUM.js} +24 -24
  88. package/dist/{help-SR2MRL3U.js → help-55ZV2M5U.js} +1 -1
  89. package/dist/{history-WLI7KFXB.js → history-QCY7CO4P.js} +16 -17
  90. package/dist/hyperframe-runtime.js +52 -52
  91. package/dist/hyperframe.manifest.json +1 -1
  92. package/dist/hyperframe.runtime.iife.js +52 -52
  93. package/dist/hyperframes-player.global.js +1 -1
  94. package/dist/{info-DFJM3YRJ.js → info-ROTXHRAH.js} +11 -11
  95. package/dist/{init-HEAMOTGH.js → init-5XFOWGGN.js} +25 -24
  96. package/dist/{inspect-TO2EXJNK.js → inspect-3UF4VLTM.js} +25 -25
  97. package/dist/{installer-REA7ZASD.js → installer-DGYYDGWJ.js} +4 -4
  98. package/dist/{keyframes-XHEBAJY7.js → keyframes-OFZ6XNMC.js} +12 -12
  99. package/dist/{lambda-MSWYKDNT.js → lambda-OQBFCEFA.js} +6 -6
  100. package/dist/{layout-UQXCTFFV.js → layout-B4XF2734.js} +25 -25
  101. package/dist/{lint-BSMZ526C.js → lint-3YIJITTC.js} +12 -12
  102. package/dist/{lintProject-VNE322A7.js → lintProject-TOLC6HDS.js} +1 -1
  103. package/dist/{list-RNP5EMTX.js → list-276FF3QE.js} +2 -2
  104. package/dist/{login-S6V75HG5.js → login-SA3MCAIS.js} +4 -4
  105. package/dist/{manager-NEVLEZK3.js → manager-CT3D67CG.js} +1 -1
  106. package/dist/{media-treatment-IHEEEDUQ.js → media-treatment-ICA5DWHS.js} +12 -12
  107. package/dist/{models-OQEBKNJI.js → models-JF5OOZ5A.js} +7 -7
  108. package/dist/{motionShot-EAIFVJ2I.js → motionShot-TQBDZZ4M.js} +12 -12
  109. package/dist/{normalize-audio-4ACUR6W6.js → normalize-audio-URNASKUV.js} +11 -11
  110. package/dist/{pipeline-SOQHD5YN.js → pipeline-IWPF5ZMK.js} +6 -6
  111. package/dist/{play-3WJPS3FE.js → play-JYBAII35.js} +20 -20
  112. package/dist/{preflight-ZUADCOLZ.js → preflight-2GH2Z4GZ.js} +8 -8
  113. package/dist/{present-MU23WZZA.js → present-WIEZRZET.js} +16 -16
  114. package/dist/{preview-VOTNRX67.js → preview-YUPU646E.js} +171 -93
  115. package/dist/{producer-HKRMTCPU.js → producer-SL66UNEP.js} +1 -1
  116. package/dist/{projectConfig-H37MQGE6.js → projectConfig-7AKXZNNR.js} +6 -6
  117. package/dist/{publication-QVDKMAKD.js → publication-B2OERUY7.js} +2 -2
  118. package/dist/{publish-54IPKU5O.js → publish-ZGKT7KED.js} +8 -8
  119. package/dist/{remove-background-KQQ2WPKP.js → remove-background-4LRTT6YL.js} +7 -7
  120. package/dist/{render-HJQ44SEI.js → render-AX77WC3C.js} +12 -12
  121. package/dist/{render-P7727PLY.js → render-F3QVCKKA.js} +23 -23
  122. package/dist/{render-S2T3SLI4.js → render-TGCDBKMP.js} +3 -3
  123. package/dist/{render-batch-DUFAHD6F.js → render-batch-WRQFW4UC.js} +3 -3
  124. package/dist/{renderCancellation-BSVXXGZM.js → renderCancellation-BFCQYGVV.js} +6 -6
  125. package/dist/renderSetupWorker.js +2 -2
  126. package/dist/{resolver-PHWKDEH2.js → resolver-37UOGAMT.js} +4 -4
  127. package/dist/{sherpa-GHQOWXFV.js → sherpa-SDVKYXCX.js} +7 -7
  128. package/dist/{skills-SOCMD66Y.js → skills-M6ETUUH5.js} +11 -11
  129. package/dist/{skillsUpdateCheck-PONPICQM.js → skillsUpdateCheck-UTX5LT5C.js} +3 -3
  130. package/dist/{snapshot-ECXEZ4TY.js → snapshot-HMDAENTY.js} +143 -54
  131. package/dist/{src-LVBNYMJW.js → src-PJJ6NISA.js} +5 -5
  132. package/dist/{src-RQE5HXZK.js → src-PLWCT745.js} +7 -7
  133. package/dist/{staticProjectServer-TQYP44CW.js → staticProjectServer-XDH5SQV6.js} +14 -14
  134. package/dist/{status-HVI7QZHE.js → status-LENRPQS5.js} +6 -6
  135. package/dist/studio/assets/{hyperframes-player-CBpg41JM.js → hyperframes-player-aXNJKiIg.js} +1 -1
  136. package/dist/studio/assets/index-BYnsJnJV.css +1 -0
  137. package/dist/studio/assets/{index-BFitquwi.js → index-Bn2RJNTJ.js} +1 -1
  138. package/dist/studio/assets/{index-CZfrSyU9.js → index-C9N-DGjC.js} +1 -1
  139. package/dist/studio/assets/{index-BKy_birQ.js → index-Dz7doz9l.js} +199 -199
  140. package/dist/studio/index.d.ts +3 -3
  141. package/dist/studio/index.html +2 -2
  142. package/dist/studio/index.js +1605 -1536
  143. package/dist/studio/index.js.map +1 -1
  144. package/dist/studio/styles.css +1 -1
  145. package/dist/{studio-api-EKF6TFDB.js → studio-api-E5WFZ7YK.js} +8 -8
  146. package/dist/{studioSelectionClient-A6JCWRRW.js → studioSelectionClient-IUUPKUHZ.js} +1 -2
  147. package/dist/{studioServer-BSNDGK63.js → studioServer-C7GTHTRY.js} +43 -43
  148. package/dist/{system-NLNIE7PO.js → system-4KRSV2B7.js} +6 -6
  149. package/dist/{telemetry-XNDAM6JU.js → telemetry-XH6D37RL.js} +9 -9
  150. package/dist/{timeline-IKWTTCNY.js → timeline-4RR7O6QW.js} +15 -15
  151. package/dist/{tokens-KOTFKBAK.js → tokens-MVTK3RPO.js} +2 -2
  152. package/dist/{transcribe-ELJHKA5B.js → transcribe-3UXXEDXX.js} +7 -7
  153. package/dist/{transcribe-STEYOXIO.js → transcribe-I6WDPH7E.js} +12 -12
  154. package/dist/{tts-DO2W6NLB.js → tts-P3LIPIL5.js} +13 -6
  155. package/dist/{updateCheck-OJMEQUST.js → updateCheck-ELMPFCBF.js} +2 -2
  156. package/dist/{upgrade-NIS32YR6.js → upgrade-6UAOGP4D.js} +2 -2
  157. package/dist/{urlDownloader-KJSQAFN7.js → urlDownloader-4KNER64L.js} +5 -5
  158. package/dist/{validate-7MCKNH5K.js → validate-ZMMGUMBD.js} +15 -15
  159. package/dist/{video-TUXP3VGQ.js → video-GINAMW5I.js} +6 -6
  160. package/package.json +1 -1
  161. package/dist/chunk-S6TH5G6Z.js +0 -3541
  162. package/dist/chunk-VWA4HODG.js +0 -129
  163. package/dist/studio/assets/index-DbfKVTId.css +0 -1
@@ -5,6 +5,10 @@ var require = __hf_createRequire(import.meta.url);
5
5
  var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
 
8
+ // src/utils/studioSelectionClient.ts
9
+ import { existsSync, realpathSync } from "fs";
10
+ import { resolve as resolve2 } from "path";
11
+
8
12
  // src/server/portUtils.ts
9
13
  import net from "net";
10
14
  import http from "http";
@@ -217,7 +221,7 @@ async function killActiveServers(startPort = 3002) {
217
221
  }
218
222
  return { killed, unverified };
219
223
  }
220
- async function findPortAndServe(fetch, startPort, projectDir, forceNew, expectedServerBuildSignature = null, bindHost, expectedBrowserGpuMode) {
224
+ async function findPortAndServe(fetch2, startPort, projectDir, forceNew, expectedServerBuildSignature = null, bindHost, expectedBrowserGpuMode) {
221
225
  const { createAdaptorServer } = await import("@hono/node-server");
222
226
  const host = bindHost ?? (process.env.HYPERFRAMES_PREVIEW_HOST?.trim() || "127.0.0.1");
223
227
  const normalizedDir = resolve(projectDir).replace(/\\/g, "/").toLowerCase();
@@ -226,7 +230,7 @@ async function findPortAndServe(fetch, startPort, projectDir, forceNew, expected
226
230
  for (let port = startPort; port <= endPort; port++) {
227
231
  const available = await testPortOnAllHosts(port);
228
232
  if (available) {
229
- if (!server) server = createAdaptorServer({ fetch });
233
+ if (!server) server = createAdaptorServer({ fetch: fetch2 });
230
234
  try {
231
235
  await new Promise((resolveListener, rejectListener) => {
232
236
  const onError = (err) => {
@@ -269,9 +273,125 @@ async function findPortAndServe(fetch, startPort, projectDir, forceNew, expected
269
273
  );
270
274
  }
271
275
 
276
+ // src/utils/studioSelectionClient.ts
277
+ var VITE_STUDIO_DISCOVERY_PORTS = [5190];
278
+ var AmbiguousPreviewServerError = class extends Error {
279
+ ports;
280
+ constructor(servers) {
281
+ const ports = servers.map((server) => server.port).sort((a, b) => a - b);
282
+ super(
283
+ `Multiple Studio preview servers match this project (${ports.join(", ")}). Pass --port <port> to choose one.`
284
+ );
285
+ this.name = "AmbiguousPreviewServerError";
286
+ this.ports = ports;
287
+ }
288
+ };
289
+ var PreviewServerPortMismatchError = class extends Error {
290
+ requestedPort;
291
+ ports;
292
+ constructor(requestedPort, servers, hint = "") {
293
+ const ports = servers.map((server) => server.port).sort((a, b) => a - b);
294
+ super(
295
+ `No Studio preview server for this project is running on port ${requestedPort}. Matching server port${ports.length === 1 ? "" : "s"}: ${ports.join(", ")}. Rerun with --port ${ports[0]}${ports.length > 1 ? " or omit --port to see all candidates" : ""}.${hint}`
296
+ );
297
+ this.name = "PreviewServerPortMismatchError";
298
+ this.requestedPort = requestedPort;
299
+ this.ports = ports;
300
+ }
301
+ };
302
+ function normalizePath(path) {
303
+ const resolved = resolve2(path);
304
+ try {
305
+ if (existsSync(resolved)) {
306
+ return realpathSync(resolved).replace(/\\/g, "/").toLowerCase();
307
+ }
308
+ } catch {
309
+ }
310
+ return resolved.replace(/\\/g, "/").toLowerCase();
311
+ }
312
+ async function findPreviewServerForProject(projectDir, startPort = 3002, scan = scanActiveServers, fetchImpl = fetch, options = {}) {
313
+ const normalizedProjectDir = normalizePath(projectDir);
314
+ const servers = await scan(startPort);
315
+ const embeddedServers = servers.filter(
316
+ (server) => normalizePath(server.projectDir) === normalizedProjectDir
317
+ );
318
+ if (options.preferredPort !== void 0) {
319
+ const preferred = embeddedServers.find((server) => server.port === options.preferredPort);
320
+ if (preferred) return preferred;
321
+ const viteServer = await findViteStudioServerForProject(normalizedProjectDir, fetchImpl, [
322
+ options.preferredPort
323
+ ]);
324
+ if (viteServer) return viteServer;
325
+ if (embeddedServers.length > 0) {
326
+ throw new PreviewServerPortMismatchError(options.preferredPort, embeddedServers);
327
+ }
328
+ return null;
329
+ }
330
+ if (embeddedServers.length === 1) return embeddedServers[0];
331
+ if (embeddedServers.length > 1) throw new AmbiguousPreviewServerError(embeddedServers);
332
+ return findViteStudioServerForProject(normalizedProjectDir, fetchImpl);
333
+ }
334
+ function studioSelectionUrl(server) {
335
+ return studioApiUrl(server, "selection");
336
+ }
337
+ function studioApiUrl(server, route) {
338
+ const host = server.host ?? "127.0.0.1";
339
+ return `http://${host}:${server.port}/api/projects/${encodeURIComponent(server.projectName)}/${route}`;
340
+ }
341
+ var LOOPBACK_HOSTS = ["127.0.0.1", "[::1]"];
342
+ async function findViteStudioServerForProject(normalizedProjectDir, fetchImpl, ports = VITE_STUDIO_DISCOVERY_PORTS) {
343
+ for (const port of ports) {
344
+ for (const host of LOOPBACK_HOSTS) {
345
+ try {
346
+ const response = await fetchImpl(`http://${host}:${port}/api/projects`);
347
+ if (!response.ok) continue;
348
+ const payload = await response.json();
349
+ const project = payload.projects?.find(
350
+ (candidate) => normalizePath(candidate.dir) === normalizedProjectDir
351
+ );
352
+ if (!project) continue;
353
+ return {
354
+ port,
355
+ host,
356
+ projectName: project.id,
357
+ projectDir: project.dir,
358
+ version: "studio-dev",
359
+ pid: null
360
+ };
361
+ } catch {
362
+ }
363
+ }
364
+ }
365
+ return null;
366
+ }
367
+ async function fetchStudioSelection(server, fetchImpl = fetch) {
368
+ const url = studioSelectionUrl(server);
369
+ const response = await fetchImpl(url);
370
+ if (!response.ok) {
371
+ throw new Error(`selection endpoint returned ${response.status}`);
372
+ }
373
+ return await response.json();
374
+ }
375
+ async function fetchStudioLint(server, fetchImpl = fetch) {
376
+ const url = studioApiUrl(server, "lint");
377
+ const response = await fetchImpl(url);
378
+ if (!response.ok) {
379
+ throw new Error(`lint endpoint returned ${response.status}`);
380
+ }
381
+ return await response.json();
382
+ }
383
+
272
384
  export {
385
+ MAX_PORT_SCAN,
273
386
  scanActiveServers,
274
387
  activeServerOnPort,
275
388
  killActiveServers,
276
- findPortAndServe
389
+ findPortAndServe,
390
+ AmbiguousPreviewServerError,
391
+ PreviewServerPortMismatchError,
392
+ findPreviewServerForProject,
393
+ studioSelectionUrl,
394
+ studioApiUrl,
395
+ fetchStudioSelection,
396
+ fetchStudioLint
277
397
  };
@@ -8,14 +8,14 @@ import {
8
8
  DEFAULT_REGISTRY_URL,
9
9
  fetchItemFile,
10
10
  validRegistryItem
11
- } from "./chunk-M4RYK5OF.js";
11
+ } from "./chunk-IP3XINRB.js";
12
12
  import {
13
13
  publishRegistryFile,
14
14
  registryTargetPath
15
15
  } from "./chunk-GMECXFAN.js";
16
16
  import {
17
17
  validateVariables
18
- } from "./chunk-C4JINRJK.js";
18
+ } from "./chunk-FCEFKWPM.js";
19
19
  import {
20
20
  realProjectRoot
21
21
  } from "./chunk-OFQWTKPW.js";
@@ -13,11 +13,11 @@ import {
13
13
  } from "./chunk-TVCRUG2S.js";
14
14
  import {
15
15
  getFreeDiskMb
16
- } from "./chunk-JRULOVZK.js";
16
+ } from "./chunk-L5QASNBN.js";
17
17
  import {
18
18
  ensureBrowser,
19
19
  findBrowser
20
- } from "./chunk-N34BYX3E.js";
20
+ } from "./chunk-4PFZPP2N.js";
21
21
  import {
22
22
  runCancellableProcess
23
23
  } from "./chunk-LCSMOLGX.js";
@@ -8,7 +8,7 @@ import {
8
8
  DEFAULT_REGISTRY_URL,
9
9
  fetchItemManifest,
10
10
  fetchRegistryManifest
11
- } from "./chunk-M4RYK5OF.js";
11
+ } from "./chunk-IP3XINRB.js";
12
12
 
13
13
  // src/registry/resolver.ts
14
14
  function defaultWarn(message) {
@@ -17,7 +17,7 @@ import {
17
17
  parseStrictFiniteTimingNumber,
18
18
  resolveNaturalMediaTimelineDuration,
19
19
  resolveTimedImageDurationSeconds
20
- } from "./chunk-S6TH5G6Z.js";
20
+ } from "./chunk-C6AIZOQN.js";
21
21
  import {
22
22
  COMPOSITION_ATTRIBUTES,
23
23
  parseStartExpression
@@ -22,7 +22,7 @@ import {
22
22
  renderFrameIdForRenderId,
23
23
  resolveAuthoredTimingWindow,
24
24
  toFps
25
- } from "./chunk-C4JINRJK.js";
25
+ } from "./chunk-FCEFKWPM.js";
26
26
  import {
27
27
  AUDIO_GROUP_RENDER_ID_ATTR,
28
28
  COLOR_GRADING_SOURCE_HIDDEN_ATTR,
@@ -52,7 +52,7 @@ import {
52
52
  shiftRateLane,
53
53
  sourceTimeAt,
54
54
  timeAtSourceTime
55
- } from "./chunk-S6TH5G6Z.js";
55
+ } from "./chunk-C6AIZOQN.js";
56
56
  import {
57
57
  chromeMajorCeiling,
58
58
  exceedsChromeCeiling
@@ -60,7 +60,7 @@ import {
60
60
  import {
61
61
  isWithinProjectRoot,
62
62
  resolveProjectRelativeSrc
63
- } from "./chunk-YAFO7V4A.js";
63
+ } from "./chunk-YJEGT5L6.js";
64
64
  import {
65
65
  FFMPEG_PATH_ENV,
66
66
  FFPROBE_PATH_ENV,
@@ -8,12 +8,12 @@ import {
8
8
  MAX_AUDIO_GAIN_DB,
9
9
  formatAudioGain,
10
10
  isAudibleVideoElement
11
- } from "./chunk-S6TH5G6Z.js";
11
+ } from "./chunk-C6AIZOQN.js";
12
12
  import {
13
13
  findFfBinary
14
14
  } from "./chunk-PJ3HDUCY.js";
15
15
 
16
- // ../studio-server/dist/chunk-TEYDBVSK.js
16
+ // ../studio-server/dist/chunk-DSVQ2U7J.js
17
17
  import { execFile } from "child_process";
18
18
  import { isAbsolute, relative, resolve } from "path";
19
19
  import { promisify } from "util";
@@ -315,7 +315,8 @@ async function measureAudio(ffmpegPath, file, tag) {
315
315
  const result = await execFileAsync(ffmpegPath, loudnessMeasureArgs(file, tag), {
316
316
  encoding: "utf8",
317
317
  maxBuffer: 16 * 1024 * 1024,
318
- timeout: FFMPEG_TIMEOUT_MS
318
+ timeout: FFMPEG_TIMEOUT_MS,
319
+ windowsHide: true
319
320
  });
320
321
  return parseEbur128Summary(result.stderr);
321
322
  }
@@ -7,16 +7,16 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  parseFeedbackRating,
9
9
  trackRenderFeedback
10
- } from "./chunk-LYBFDHXD.js";
10
+ } from "./chunk-JH7ZJRDL.js";
11
11
  import {
12
12
  shouldTrack
13
- } from "./chunk-E664L6K3.js";
13
+ } from "./chunk-IPXPSCWV.js";
14
14
  import {
15
15
  c
16
16
  } from "./chunk-ZTZA4UWZ.js";
17
17
  import {
18
18
  detectAgentRuntime
19
- } from "./chunk-JRULOVZK.js";
19
+ } from "./chunk-L5QASNBN.js";
20
20
  import {
21
21
  readConfig,
22
22
  writeConfig
@@ -83,7 +83,7 @@ async function maybePromptRenderFeedback(opts) {
83
83
  async function getDoctorSummary() {
84
84
  try {
85
85
  const [{ getSystemMeta }, { findFFmpeg }] = await Promise.all([
86
- import("./system-NLNIE7PO.js"),
86
+ import("./system-4KRSV2B7.js"),
87
87
  import("./ffmpeg-QIUFEFTY.js")
88
88
  ]);
89
89
  const sys = getSystemMeta();
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-TVCRUG2S.js";
18
18
  import {
19
19
  stoppedByCancelSignal
20
- } from "./chunk-KQ3VNA6R.js";
20
+ } from "./chunk-7543YIMQ.js";
21
21
 
22
22
  // src/whisper/transcribe.ts
23
23
  import { execFileSync } from "child_process";
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-GMECXFAN.js";
13
13
  import {
14
14
  ITEM_TYPE_DIRS
15
- } from "./chunk-C4JINRJK.js";
15
+ } from "./chunk-FCEFKWPM.js";
16
16
  import {
17
17
  realProjectRoot
18
18
  } from "./chunk-OFQWTKPW.js";
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-ZTZA4UWZ.js";
13
13
  import {
14
14
  getSystemMeta
15
- } from "./chunk-JRULOVZK.js";
15
+ } from "./chunk-L5QASNBN.js";
16
16
  import {
17
17
  getInvocationId
18
18
  } from "./chunk-54HJ63Q2.js";
@@ -23,7 +23,7 @@ import {
23
23
  evaluateCanary,
24
24
  findCanary,
25
25
  parseCanaryOverride
26
- } from "./chunk-C4JINRJK.js";
26
+ } from "./chunk-FCEFKWPM.js";
27
27
  import {
28
28
  hostAnswers
29
29
  } from "./chunk-K4WIOZFP.js";
@@ -37,7 +37,7 @@ import {
37
37
  } from "./chunk-XUXGIA7H.js";
38
38
  import {
39
39
  VERSION
40
- } from "./chunk-BD3MHTSR.js";
40
+ } from "./chunk-MLLBZR2U.js";
41
41
 
42
42
  // src/telemetry/transport.ts
43
43
  import { spawn } from "child_process";
@@ -8,16 +8,16 @@ import {
8
8
  flush,
9
9
  shouldTrack,
10
10
  trackEvent
11
- } from "./chunk-E664L6K3.js";
11
+ } from "./chunk-IPXPSCWV.js";
12
12
  import {
13
13
  getPowerState
14
- } from "./chunk-JRULOVZK.js";
14
+ } from "./chunk-L5QASNBN.js";
15
15
  import {
16
16
  CliRuntimeError
17
17
  } from "./chunk-PBN6GBJE.js";
18
18
  import {
19
19
  redactTelemetryString
20
- } from "./chunk-C4JINRJK.js";
20
+ } from "./chunk-FCEFKWPM.js";
21
21
  import {
22
22
  readConfig
23
23
  } from "./chunk-XUXGIA7H.js";
@@ -0,0 +1,18 @@
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/textFile.ts
9
+ import { existsSync } from "fs";
10
+ import { extname, resolve } from "path";
11
+ function isTextFile(input) {
12
+ const path = resolve(input);
13
+ return existsSync(path) && extname(path).toLowerCase() === ".txt";
14
+ }
15
+
16
+ export {
17
+ isTextFile
18
+ };
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-AMKC3AXA.js";
10
10
  import {
11
11
  getSystemTotalMb
12
- } from "./chunk-P74PW7KR.js";
12
+ } from "./chunk-G2T2X6FZ.js";
13
13
 
14
14
  // src/telemetry/system.ts
15
15
  import { cpus, freemem, platform as platform2, release as release2 } from "os";
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  getMimeType,
9
9
  injectMediaCodecMapIntoHtml
10
- } from "./chunk-TXVN43SX.js";
10
+ } from "./chunk-LYNBNESS.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-TSZU5JMC.js";
21
+ } from "./chunk-LMC46FK5.js";
22
22
  import {
23
23
  resolveAutoProxy
24
- } from "./chunk-H3WFEPV2.js";
24
+ } from "./chunk-BOUDTDBQ.js";
25
25
 
26
26
  // src/utils/staticProjectServer.ts
27
27
  import { createServer } from "http";
@@ -8,7 +8,7 @@ import {
8
8
  firstFrameColourArgs,
9
9
  hdrToSdrToneMapFilter,
10
10
  parseFirstFrameColour
11
- } from "./chunk-C4JINRJK.js";
11
+ } from "./chunk-FCEFKWPM.js";
12
12
  import {
13
13
  mkdirWithinProject,
14
14
  realProjectRoot,
@@ -21,7 +21,7 @@ import {
21
21
  isUnresolvedAssetPlaceholder,
22
22
  maskNonScannableRanges,
23
23
  resolveLocalAssetCandidates
24
- } from "./chunk-YAFO7V4A.js";
24
+ } from "./chunk-YJEGT5L6.js";
25
25
  import {
26
26
  findFfBinary
27
27
  } from "./chunk-PJ3HDUCY.js";
@@ -7,14 +7,14 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  trackLintReport,
9
9
  trackLintRuleStreak
10
- } from "./chunk-LYBFDHXD.js";
10
+ } from "./chunk-JH7ZJRDL.js";
11
11
  import {
12
12
  shouldTrack
13
- } from "./chunk-E664L6K3.js";
13
+ } from "./chunk-IPXPSCWV.js";
14
14
  import {
15
15
  LINT_RULE_COUNT,
16
16
  LINT_RULE_GROUP_COUNTS
17
- } from "./chunk-YAFO7V4A.js";
17
+ } from "./chunk-YJEGT5L6.js";
18
18
 
19
19
  // src/telemetry/lintStreaks.ts
20
20
  import { createHash } from "crypto";
@@ -18,7 +18,7 @@ import {
18
18
  splitElementInHtml,
19
19
  unwrapElementsFromHtml,
20
20
  wrapElementsInHtml
21
- } from "./chunk-BZGWHPRW.js";
21
+ } from "./chunk-XFJXFNJF.js";
22
22
  import {
23
23
  atomicTempPath,
24
24
  createFileAtomically,
@@ -31,7 +31,7 @@ import {
31
31
  measureAudio,
32
32
  requiredFfmpeg,
33
33
  resolveLocalAudioPath
34
- } from "./chunk-CS4IE5G7.js";
34
+ } from "./chunk-GDJ74GHW.js";
35
35
  import {
36
36
  PROXY_PARAMS_VERSION,
37
37
  PROXY_PENDING_RETRY_AFTER_SECONDS,
@@ -57,7 +57,7 @@ import {
57
57
  shouldPrewarmProxy,
58
58
  waitForProxy,
59
59
  walkDir
60
- } from "./chunk-TSZU5JMC.js";
60
+ } from "./chunk-LMC46FK5.js";
61
61
  import {
62
62
  findTimelineScript,
63
63
  parseGsapScriptAcorn
@@ -76,7 +76,7 @@ import {
76
76
  formatRenderOutputTimestamp,
77
77
  parseFps,
78
78
  sameInstant
79
- } from "./chunk-C4JINRJK.js";
79
+ } from "./chunk-FCEFKWPM.js";
80
80
  import {
81
81
  MagicString,
82
82
  VALID_CANVAS_RESOLUTIONS,
@@ -85,7 +85,7 @@ import {
85
85
  import {
86
86
  addScenePartsManifest,
87
87
  ensureHfIds
88
- } from "./chunk-J2S4MY2M.js";
88
+ } from "./chunk-OCNCK5FQ.js";
89
89
  import {
90
90
  findStartTags,
91
91
  injectScriptsIntoHtml,
@@ -95,7 +95,7 @@ import {
95
95
  resolveRateSpec,
96
96
  sourceTimeAt,
97
97
  stripEmbeddedRuntimeScripts
98
- } from "./chunk-S6TH5G6Z.js";
98
+ } from "./chunk-C6AIZOQN.js";
99
99
  import {
100
100
  ProjectRootMissingError,
101
101
  folderGone,
@@ -108,7 +108,7 @@ import {
108
108
  import {
109
109
  isWithinProjectRoot,
110
110
  readProjectFile
111
- } from "./chunk-YAFO7V4A.js";
111
+ } from "./chunk-YJEGT5L6.js";
112
112
  import {
113
113
  FFPROBE_PATH_ENV,
114
114
  findFfBinary
@@ -2101,7 +2101,8 @@ import {
2101
2101
  statSync as statSync32,
2102
2102
  fstatSync as fstatSync2,
2103
2103
  renameSync as renameSync22,
2104
- readdirSync as readdirSync22
2104
+ readdirSync as readdirSync22,
2105
+ realpathSync as realpathSync2
2105
2106
  } from "fs";
2106
2107
  import { resolve as resolve22, dirname as dirname32, join as join52 } from "path";
2107
2108
  import { spawn } from "child_process";
@@ -6103,18 +6104,83 @@ function readableText(file) {
6103
6104
  throw error;
6104
6105
  }
6105
6106
  }
6106
- function updateReferences(projectDir, oldPath, newPath) {
6107
+ var escapeRegExp = (text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
6108
+ var SEPARATOR = String.raw`\\{0,2}[\\/]`;
6109
+ var REFERENCE_START = String.raw`(?<![\w./\\+-])`;
6110
+ var FILE_END = String.raw`(?![\w-]|\.\w)`;
6111
+ function referencePattern(oldPath, isDirectory) {
6112
+ const name = oldPath.split("/").map(escapeRegExp).join(SEPARATOR);
6113
+ const end = isDirectory ? `(?=${SEPARATOR})` : FILE_END;
6114
+ return new RegExp(
6115
+ String.raw`${REFERENCE_START}(?<lead>(?:\.{1,2}${SEPARATOR}|${SEPARATOR}){0,4})${name}${end}`,
6116
+ "g"
6117
+ );
6118
+ }
6119
+ function referenceRewriter(oldPath, newPath, isDirectory, existing = []) {
6120
+ const pattern = referencePattern(oldPath, isDirectory);
6121
+ const around = /* @__PURE__ */ new Map();
6122
+ const afterLengths = /* @__PURE__ */ new Set();
6123
+ let window2 = 0;
6124
+ for (const path of existing) {
6125
+ if (path.length <= oldPath.length) continue;
6126
+ for (const start of occurrences(path, oldPath)) {
6127
+ const [before, after] = [path.slice(0, start), path.slice(start + oldPath.length)];
6128
+ const befores = around.get(after) ?? around.set(after, /* @__PURE__ */ new Map()).get(after);
6129
+ (befores.get(before.length) ?? befores.set(before.length, /* @__PURE__ */ new Set()).get(before.length)).add(
6130
+ before
6131
+ );
6132
+ afterLengths.add(after.length);
6133
+ window2 = Math.max(window2, path.length * 3);
6134
+ }
6135
+ }
6136
+ const normalized = (text2) => text2.replace(/\\{0,2}[\\/]/g, "/");
6137
+ return (text2) => text2.replace(pattern, (...args) => {
6138
+ const [match, offset] = [args[0], args.at(-3)];
6139
+ const { lead } = args.at(-1);
6140
+ const at = offset + lead.length;
6141
+ const head = normalized(text2.slice(Math.max(0, at - window2), at));
6142
+ const tail = normalized(text2.slice(offset + match.length, offset + match.length + window2));
6143
+ const inLonger = [...afterLengths].some((after) => {
6144
+ const befores = tail.length >= after && around.get(tail.slice(0, after));
6145
+ return befores && [...befores].some(
6146
+ ([length, set]) => head.length >= length && set.has(head.slice(head.length - length))
6147
+ );
6148
+ });
6149
+ return inLonger ? match : `${lead}${newPath}`;
6150
+ });
6151
+ }
6152
+ function occurrences(text2, part) {
6153
+ const at = [];
6154
+ for (let i = text2.indexOf(part); i >= 0; i = text2.indexOf(part, i + 1)) at.push(i);
6155
+ return at;
6156
+ }
6157
+ function projectPaths(root, dir = root, prefix = "", ancestors = /* @__PURE__ */ new Set()) {
6158
+ return readableEntries(dir).flatMap((entry) => {
6159
+ const [path, full2] = [`${prefix}${entry.name}`, join52(dir, entry.name)];
6160
+ const real = entry.name === "node_modules" ? null : directoryReal(entry, full2);
6161
+ if (real === null || ancestors.has(real) || !isSafePath(root, full2)) return [path];
6162
+ return [path, ...projectPaths(root, full2, `${path}/`, /* @__PURE__ */ new Set([...ancestors, real]))];
6163
+ });
6164
+ }
6165
+ function directoryReal(entry, full2) {
6166
+ try {
6167
+ return entry.isDirectory() || entry.isSymbolicLink() && statSync32(full2).isDirectory() ? realpathSync2(full2) : null;
6168
+ } catch {
6169
+ return null;
6170
+ }
6171
+ }
6172
+ function updateReferences(projectDir, oldPath, newPath, isDirectory) {
6107
6173
  const textFiles = walkFiles(
6108
6174
  projectDir,
6109
6175
  (name) => /\.(html|css|js|jsx|ts|tsx|json|mjs|cjs|md|mdx)$/i.test(name)
6110
6176
  );
6177
+ const rewrite = referenceRewriter(oldPath, newPath, isDirectory, projectPaths(projectDir));
6111
6178
  let updatedCount = 0;
6112
6179
  for (const file of textFiles) {
6113
6180
  if (!isSafePath(projectDir, file)) continue;
6114
6181
  const content = readableText(file);
6115
6182
  if (content === null) continue;
6116
- if (!content.includes(oldPath)) continue;
6117
- const updated = content.split(oldPath).join(newPath);
6183
+ const updated = rewrite(content);
6118
6184
  if (updated !== content) {
6119
6185
  replaceFileAtomically(file, updated, statSync32(file).mode);
6120
6186
  updatedCount++;
@@ -6388,7 +6454,7 @@ async function prepareGsapMutationScript(c, res, firstMutation) {
6388
6454
  let block = extractGsapScriptBlock(html);
6389
6455
  if (!block && (firstMutation.type === "add" || firstMutation.type === "add-with-keyframes")) {
6390
6456
  const compId = html.match(/data-composition-id="([^"]+)"/)?.[1] ?? "main";
6391
- const { GSAP_CDN } = await import("./dist-7VEVT4NT.js");
6457
+ const { GSAP_CDN } = await import("./dist-OKRUIHYU.js");
6392
6458
  const bootstrap = [
6393
6459
  `<script src="${GSAP_CDN}"></script>`,
6394
6460
  "<script>",
@@ -7951,9 +8017,10 @@ function registerFileRoutes(api, adapter) {
7951
8017
  if (existsSync3(newAbs)) {
7952
8018
  return c.json({ error: "already exists" }, 409);
7953
8019
  }
8020
+ const isDirectory = statSync32(res.absPath, { throwIfNoEntry: false })?.isDirectory() ?? false;
7954
8021
  ensureDir(res.project.dir, newAbs);
7955
8022
  renameSync22(res.absPath, newAbs);
7956
- const updatedFiles = updateReferences(res.project.dir, res.filePath, body.newPath);
8023
+ const updatedFiles = updateReferences(res.project.dir, res.filePath, body.newPath, isDirectory);
7957
8024
  return c.json({ ok: true, path: body.newPath, updatedReferences: updatedFiles });
7958
8025
  });
7959
8026
  api.post("/projects/:id/duplicate-file", async (c) => {
@@ -6,8 +6,8 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
 
8
8
  // src/version.ts
9
- var VERSION = true ? "0.8.112" : "0.0.0-dev";
10
- var PRODUCER_VERSION = true ? "0.8.112" : "0.0.0-dev";
9
+ var VERSION = true ? "0.8.114" : "0.0.0-dev";
10
+ var PRODUCER_VERSION = true ? "0.8.114" : "0.0.0-dev";
11
11
 
12
12
  export {
13
13
  VERSION,
@@ -20,7 +20,7 @@ import {
20
20
  typeDirPath,
21
21
  updateRecord,
22
22
  withFigmaErrors
23
- } from "./chunk-PRETPA7Z.js";
23
+ } from "./chunk-SSM2TJYE.js";
24
24
  import {
25
25
  defineCommand
26
26
  } from "./chunk-S3S4TGEH.js";
@@ -221,7 +221,7 @@ var asset_default = defineCommand({
221
221
  rendered > 0 ? `(${results.length} nodes, ${rendered} rendered in 1 figma request)` : `(${results.length} nodes, all reused from cache \u2014 no figma request)`
222
222
  );
223
223
  }
224
- const { trackFigmaImport } = await import("./telemetry-XNDAM6JU.js");
224
+ const { trackFigmaImport } = await import("./telemetry-XH6D37RL.js");
225
225
  trackFigmaImport({
226
226
  phase: "asset",
227
227
  reused: results.every((r) => r.reused),
@@ -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-BD3MHTSR.js";
9
+ } from "./chunk-MLLBZR2U.js";
10
10
 
11
11
  // src/registry/compatibility.ts
12
12
  import { compareVersions } from "compare-versions";