hyperframes 0.8.169 → 0.8.171

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 (181) hide show
  1. package/dist/{add-7GLP4BPM.js → add-VMMGTSGT.js} +12 -11
  2. package/dist/{animatedGifPrep-NEBEGVSO.js → animatedGifPrep-MVP5LCEM.js} +5 -5
  3. package/dist/api.js +11 -11
  4. package/dist/{asset-RORTT5HS.js → asset-ZERIT5FT.js} +2 -2
  5. package/dist/{assetCataloger-RLJ6MDGF.js → assetCataloger-RN5A2SVA.js} +5 -5
  6. package/dist/{audio-OKDGU7TY.js → audio-RQUGFWYT.js} +11 -11
  7. package/dist/{auth-QWYNCU5U.js → auth-I3FNB6N2.js} +1 -1
  8. package/dist/{autoUpdate-EDJJPWAU.js → autoUpdate-IBAS4JVK.js} +2 -2
  9. package/dist/{backgroundChecks-KQR6FGVU.js → backgroundChecks-7UQBIPQC.js} +3 -3
  10. package/dist/backgroundChecksWorker.js +3 -3
  11. package/dist/{batchRender-YKTTAIHH.js → batchRender-KWBVAUE3.js} +3 -3
  12. package/dist/{beats-I6AGLTLW.js → beats-F2GFGFCV.js} +4 -4
  13. package/dist/{benchmark-NBSV7PNB.js → benchmark-XPQYX3OX.js} +8 -8
  14. package/dist/{browser-FPEL5FGW.js → browser-QCV62F7R.js} +3 -3
  15. package/dist/{bundleWithLocalizedFonts-TYQXMNSU.js → bundleWithLocalizedFonts-42V34HJF.js} +2 -2
  16. package/dist/{capture-FXGOI23U.js → capture-OKPMCIAC.js} +8 -8
  17. package/dist/{capture-5BRJJMZB.js → capture-WE32B5UZ.js} +2 -2
  18. package/dist/{catalog-SG3ZIS45.js → catalog-2LWFMJM3.js} +12 -11
  19. package/dist/{catch-up-ETXUT6Q5.js → catch-up-OWUGMOBS.js} +4 -4
  20. package/dist/{check-KXNNIEUR.js → check-7BK6UM3M.js} +35 -34
  21. package/dist/{checkBrowser-546UMI3N.js → checkBrowser-VG745SEX.js} +32 -31
  22. package/dist/{chunk-YZRS3COO.js → chunk-4QIJFIR5.js} +1 -1
  23. package/dist/{chunk-UCNQE52B.js → chunk-4RXJG3SY.js} +197 -26
  24. package/dist/{chunk-JPN7SVWC.js → chunk-5GQB63WX.js} +7 -7
  25. package/dist/{chunk-FSX7GTBB.js → chunk-5HLJ4JMB.js} +1 -1
  26. package/dist/{chunk-FQJDV2RI.js → chunk-6I24ZSCR.js} +1 -1
  27. package/dist/chunk-6M3IPJS6.js +3803 -0
  28. package/dist/{chunk-7635SDI5.js → chunk-77QCYRQH.js} +2 -2
  29. package/dist/{chunk-TJSTGSAW.js → chunk-7FMUTGOH.js} +2 -77
  30. package/dist/{chunk-QD5VJOQK.js → chunk-7YZSOHSC.js} +3 -3
  31. package/dist/{chunk-AP5AVVAB.js → chunk-A3SQJCPU.js} +1 -1
  32. package/dist/{chunk-XK5SZNYE.js → chunk-AAYNQ7WL.js} +9 -9
  33. package/dist/{chunk-T4HL3SZH.js → chunk-AGHHZIZN.js} +1 -1
  34. package/dist/{chunk-A6K7M46D.js → chunk-AWSVUIWG.js} +1 -1
  35. package/dist/{chunk-RUYYAL3T.js → chunk-BMPNGUYD.js} +2 -2
  36. package/dist/{chunk-BNEKKUPG.js → chunk-BYFG74OA.js} +2 -2
  37. package/dist/{chunk-VCXVZRR2.js → chunk-CO6V4KXX.js} +1 -1
  38. package/dist/{chunk-5ETJPA5Z.js → chunk-CSABTZ6S.js} +9 -9
  39. package/dist/{chunk-DCG22HKT.js → chunk-D2QELIQB.js} +72 -22
  40. package/dist/{chunk-J5Z56PU3.js → chunk-EDGJ2OMH.js} +1 -1
  41. package/dist/{chunk-SJPNVLYS.js → chunk-ERJHLFPD.js} +2 -2
  42. package/dist/{chunk-P24X6CGY.js → chunk-FAORS3UR.js} +28 -13
  43. package/dist/{chunk-EEP5Y5IE.js → chunk-FE2XTCTM.js} +18 -1
  44. package/dist/{chunk-TVDXMJ43.js → chunk-GBWSBTEE.js} +1 -1
  45. package/dist/{chunk-JGYHWVXQ.js → chunk-GMJ3ILLW.js} +34 -13
  46. package/dist/{chunk-K5PU5ISL.js → chunk-GSABLXZV.js} +1 -1
  47. package/dist/{chunk-KA4LSAD5.js → chunk-GU5FLCZV.js} +1 -1
  48. package/dist/{chunk-YT6TFGIS.js → chunk-IWLOARQZ.js} +2 -2
  49. package/dist/{chunk-EFP25BUY.js → chunk-JAERN4RH.js} +1 -1
  50. package/dist/chunk-JHOCK3DG.js +27 -0
  51. package/dist/{chunk-5SQHHBAR.js → chunk-JMJTXBVF.js} +22 -12
  52. package/dist/{chunk-NKG3LTPI.js → chunk-KQCWIE76.js} +2 -2
  53. package/dist/{chunk-S6U7YLPJ.js → chunk-KUW4LWY6.js} +1 -1
  54. package/dist/{chunk-PVTHDNDZ.js → chunk-L32QQH2K.js} +1 -1
  55. package/dist/{chunk-TEFHMDVR.js → chunk-LMMFO5UV.js} +2 -2
  56. package/dist/{chunk-CESKA6VO.js → chunk-NSJLCWLG.js} +1 -1
  57. package/dist/{chunk-MCPDZWZY.js → chunk-NYCJCQNY.js} +4 -4
  58. package/dist/{chunk-2F4HJFGW.js → chunk-PAFCKH3S.js} +2 -2
  59. package/dist/{chunk-U7P2XTRY.js → chunk-PECICVTJ.js} +2 -2
  60. package/dist/{chunk-GVX2443P.js → chunk-PH3RS5X4.js} +2 -2
  61. package/dist/{chunk-Q5K73VW3.js → chunk-PXA4S6OE.js} +2 -2
  62. package/dist/{chunk-O3J7BHBU.js → chunk-QZUVPWC4.js} +1 -1
  63. package/dist/{chunk-ZFJ5RI7A.js → chunk-RSW6LGGW.js} +3 -3
  64. package/dist/{chunk-EELTMBCC.js → chunk-RTW6WSC7.js} +4 -3
  65. package/dist/{chunk-CNP6AMFM.js → chunk-SLTUINB4.js} +2 -2
  66. package/dist/{chunk-RZKQ3G6B.js → chunk-T5LGOTQR.js} +1 -1
  67. package/dist/{chunk-WAVFNZB7.js → chunk-TZ3I23TZ.js} +21 -7
  68. package/dist/{chunk-QLHXC4E6.js → chunk-UJQQITCY.js} +1 -1
  69. package/dist/{chunk-XZNHVWDD.js → chunk-UUP4KOMD.js} +4 -4
  70. package/dist/{chunk-UISU4SYG.js → chunk-V2T7FFPB.js} +1 -1
  71. package/dist/{chunk-7FHFPHEM.js → chunk-VKFYI7AQ.js} +182 -77
  72. package/dist/{chunk-QABAVWEX.js → chunk-W47D3KOB.js} +1 -1
  73. package/dist/{chunk-YLAREDAU.js → chunk-X3U6KEID.js} +1 -1
  74. package/dist/{chunk-5FWVFCQM.js → chunk-XGFYN53T.js} +2 -2
  75. package/dist/{chunk-M4N6IHCQ.js → chunk-XRQBHOBT.js} +7 -1
  76. package/dist/{chunk-XJQ6NN2L.js → chunk-ZBUGFQ7Y.js} +51 -25
  77. package/dist/{clean-ARH23EGW.js → clean-FCBNQ3W2.js} +13 -13
  78. package/dist/cli.js +53 -53
  79. package/dist/{cloud-GBY7MRZM.js → cloud-3FZBQBOM.js} +4 -4
  80. package/dist/{cloudrun-HBVA5UZB.js → cloudrun-CDFL5JBL.js} +9 -11
  81. package/dist/{compare-Z4YNESYN.js → compare-E4332OOZ.js} +26 -25
  82. package/dist/{compiler-6WJ5SVTD.js → compiler-GU5GPO5A.js} +2 -2
  83. package/dist/{component-AR4MS4R7.js → component-VKSV3OKW.js} +3 -3
  84. package/dist/{compositions-ERZVZBYW.js → compositions-GOVXHFXC.js} +9 -9
  85. package/dist/{delete-NWSW3BET.js → delete-JYZTEBLQ.js} +2 -2
  86. package/dist/{deterministicFonts-KXVO7QEL.js → deterministicFonts-RWGQPEZU.js} +2 -2
  87. package/dist/{dist-VKLSNKRZ.js → dist-IDZRZHGE.js} +2 -2
  88. package/dist/{doctor-P4QZQRCB.js → doctor-ND3FZM6S.js} +7 -7
  89. package/dist/{events-F2UVJQIC.js → events-27JU7QRQ.js} +2 -2
  90. package/dist/{events-SV46AWMI.js → events-VL2JIO4R.js} +3 -3
  91. package/dist/{feedback-XS4IK6SW.js → feedback-PKVQWCVT.js} +6 -6
  92. package/dist/{figma-DELISEUP.js → figma-FZ4T4SE3.js} +3 -3
  93. package/dist/fontLocalizeCli.js +9 -9
  94. package/dist/{get-DNGXCEFB.js → get-HUAIHWXR.js} +2 -2
  95. package/dist/{gpuPolicy-JG5PUOJP.js → gpuPolicy-QWJYZLVJ.js} +5 -5
  96. package/dist/{grade-compare-F46JWE4O.js → grade-compare-CJ2ROYD6.js} +26 -25
  97. package/dist/{help-XVEBMX3U.js → help-OJ3QDJYS.js} +1 -1
  98. package/dist/{history-NS4PKG4S.js → history-P4LA65T5.js} +7 -7
  99. package/dist/hyperframe-runtime.js +58 -57
  100. package/dist/hyperframe.manifest.json +1 -1
  101. package/dist/hyperframe.runtime.iife.js +58 -57
  102. package/dist/hyperframes-player.global.js +3 -3
  103. package/dist/{info-DJ6VNESS.js → info-QHRJW6Y3.js} +7 -7
  104. package/dist/{init-TSRTMVRN.js → init-AG6YVVJN.js} +21 -20
  105. package/dist/{inspect-VTZXXDJ4.js → inspect-TT66DYEC.js} +27 -26
  106. package/dist/{installer-3ERHU4CD.js → installer-5ZKUQBWW.js} +4 -4
  107. package/dist/{keyframes-6DN7BOYJ.js → keyframes-CJJGCW3R.js} +6 -6
  108. package/dist/{lambda-RCOIEGL6.js → lambda-3BMEOSP7.js} +10 -12
  109. package/dist/{layout-FFGRLVK4.js → layout-BSDCTMJK.js} +27 -26
  110. package/dist/{lint-MBYIDFKS.js → lint-6CL2R2FK.js} +6 -6
  111. package/dist/{list-KEZDFW5R.js → list-5VYOLEFN.js} +2 -2
  112. package/dist/{login-7ZV374QL.js → login-PNRREAOC.js} +4 -4
  113. package/dist/{media-treatment-LGWWRXAX.js → media-treatment-KHJX73WZ.js} +8 -8
  114. package/dist/{models-TC4K6UQP.js → models-INX67ETR.js} +8 -8
  115. package/dist/{motionShot-4E3RTV5O.js → motionShot-VIUXVMTV.js} +12 -12
  116. package/dist/{normalize-audio-XCGB2IQP.js → normalize-audio-T5QMN476.js} +4 -4
  117. package/dist/{open-JNNJSNTH.js → open-T57KLGFX.js} +4 -4
  118. package/dist/{parakeetRunner-S3DG4BJB.js → parakeetRunner-PCCBODBS.js} +8 -8
  119. package/dist/{pipeline-3SIYCBLU.js → pipeline-GDC7SL5N.js} +5 -5
  120. package/dist/{play-LBPOOD3V.js → play-TQWHYMAT.js} +19 -18
  121. package/dist/{present-PWEN5SDL.js → present-U5OFT6IF.js} +14 -14
  122. package/dist/{preview-IS32RLKM.js → preview-WWTDQQSB.js} +20 -16
  123. package/dist/{producer-4UUUEPPS.js → producer-23NJEJRO.js} +1 -1
  124. package/dist/{projectConfig-K347VIO3.js → projectConfig-OXNA35QN.js} +7 -6
  125. package/dist/{publication-4CQS532O.js → publication-GY3OJ6VH.js} +2 -2
  126. package/dist/{publish-OJYF37FY.js → publish-WZD4NLWM.js} +8 -7
  127. package/dist/{remove-background-HO6YL2HU.js → remove-background-Q7CQ3PJF.js} +6 -6
  128. package/dist/{render-L76SEAMC.js → render-24JWWXMA.js} +3 -3
  129. package/dist/{render-QBQYF2NC.js → render-FTVXKXSQ.js} +24 -23
  130. package/dist/{render-Q6QAXJCN.js → render-RZUU76V5.js} +8 -8
  131. package/dist/{render-batch-JLANN5Y2.js → render-batch-FCR7RX6U.js} +7 -20
  132. package/dist/renderSetupWorker.js +9 -1
  133. package/dist/{resolver-EDUM4DHG.js → resolver-4SPHOGY7.js} +5 -4
  134. package/dist/{sherpa-QEM5XYHD.js → sherpa-VMADZBF7.js} +7 -7
  135. package/dist/skills/media-use/SKILL.md +3 -3
  136. package/dist/skills/media-use/audio/references/requirements.md +7 -7
  137. package/dist/skills/media-use/audio/references/sfx.md +19 -13
  138. package/dist/skills/media-use/audio/scripts/audio.mjs +9 -9
  139. package/dist/skills/media-use/audio/scripts/audio.test.mjs +17 -10
  140. package/dist/skills/media-use/audio/scripts/lib/media-record.mjs +7 -3
  141. package/dist/skills/media-use/audio/scripts/lib/media-record.test.mjs +22 -3
  142. package/dist/skills/media-use/audio/scripts/lib/openverse.mjs +134 -0
  143. package/dist/skills/media-use/audio/scripts/lib/sfx.mjs +120 -89
  144. package/dist/skills/media-use/audio/scripts/lib/sfx.test.mjs +222 -12
  145. package/dist/skills/media-use/references/audio.md +1 -1
  146. package/dist/skills/media-use/references/resolve.md +1 -1
  147. package/dist/skills/media-use/references/setup-providers.md +13 -12
  148. package/dist/skills/media-use/scripts/lib/heygen-cli.mjs +4 -7
  149. package/dist/skills/media-use/scripts/lib/heygen-cli.test.mjs +5 -5
  150. package/dist/skills/media-use/scripts/lib/manifest.d.mts +1 -0
  151. package/dist/skills/media-use/scripts/lib/manifest.mjs +9 -6
  152. package/dist/skills/media-use/scripts/lib/openverse.mjs +134 -0
  153. package/dist/skills/media-use/scripts/lib/openverse.test.mjs +219 -0
  154. package/dist/skills/media-use/scripts/lib/registry.mjs +4 -2
  155. package/dist/skills/media-use/scripts/lib/registry.test.mjs +13 -13
  156. package/dist/skills/media-use/scripts/lib/sfx-provider.mjs +23 -13
  157. package/dist/skills/media-use/scripts/resolve.mjs +45 -55
  158. package/dist/{skills-FSZK6FIG.js → skills-7LBLAEH4.js} +5 -5
  159. package/dist/{skillsUpdateCheck-3354HXDJ.js → skillsUpdateCheck-AHK7CQUP.js} +3 -3
  160. package/dist/{snapshot-5VVMFEMM.js → snapshot-DOS6NQXM.js} +29 -28
  161. package/dist/{src-RYILCNU7.js → src-J6KABXGZ.js} +8 -8
  162. package/dist/{src-ZGMLMQ3B.js → src-VFTQPSQD.js} +4 -4
  163. package/dist/{staticProjectServer-PIVSGEAO.js → staticProjectServer-2YNWMUSU.js} +15 -14
  164. package/dist/studio/assets/{hyperframes-player-B04Yx96S.js → hyperframes-player-DohJxMIU.js} +2 -2
  165. package/dist/studio/assets/{index-D2e0J6kh.js → index-BOkm4Ooc.js} +101 -101
  166. package/dist/studio/assets/{index-D9CDX_Rr.js → index-DfwtrPPt.js} +1 -1
  167. package/dist/studio/index.html +1 -1
  168. package/dist/{studio-api-PHADR6VB.js → studio-api-NEBM56HH.js} +8 -8
  169. package/dist/{studioServer-5AVDKN5V.js → studioServer-LYDRHW7D.js} +45 -39
  170. package/dist/{telemetry-JCTHMPSB.js → telemetry-FAYON6XS.js} +3 -3
  171. package/dist/{timeline-QU2F6R2M.js → timeline-UKJ53XLC.js} +16 -16
  172. package/dist/{tokens-YYK4G36C.js → tokens-SO3ZXEFM.js} +2 -2
  173. package/dist/{transcribe-7ORH7R6O.js → transcribe-IM5UNBSH.js} +6 -6
  174. package/dist/{transcribe-PRG4FLLA.js → transcribe-PS5XSTXN.js} +12 -12
  175. package/dist/{updateCheck-NV7QNANK.js → updateCheck-ZV422M72.js} +2 -2
  176. package/dist/{upgrade-UZXN36J2.js → upgrade-GHG5FWZJ.js} +2 -2
  177. package/dist/{urlDownloader-AW57H722.js → urlDownloader-BOLOMGC7.js} +4 -4
  178. package/dist/{validate-QD53ABUM.js → validate-K4ZGXH2M.js} +20 -20
  179. package/dist/{video-VLVPYQQR.js → video-HUNOZDLT.js} +5 -5
  180. package/package.json +1 -1
  181. package/dist/chunk-BIV5HVTQ.js +0 -3803
@@ -17,12 +17,12 @@ import {
17
17
  iterateFontFamilyDeclarations,
18
18
  normalizeSystemFontPrimaryFamilies,
19
19
  resolveFontFamilyDeclarationFamilies
20
- } from "./chunk-M4N6IHCQ.js";
20
+ } from "./chunk-XRQBHOBT.js";
21
21
  import {
22
22
  EncoderInterruptedError,
23
23
  encoderFailureError,
24
24
  prepareAnimatedGifInputs
25
- } from "./chunk-GVX2443P.js";
25
+ } from "./chunk-PH3RS5X4.js";
26
26
  import {
27
27
  BROWSER_GPU_NOT_SOFTWARE,
28
28
  CaptureFailure,
@@ -151,7 +151,7 @@ import {
151
151
  validateEngineConfigSnapshot,
152
152
  verifyDiskDrawElementSamples,
153
153
  writeCapturedFrame
154
- } from "./chunk-7FHFPHEM.js";
154
+ } from "./chunk-VKFYI7AQ.js";
155
155
  import {
156
156
  assignBundledRuntimeCompositionIds,
157
157
  buildVariablesByCompScript,
@@ -164,7 +164,7 @@ import {
164
164
  isTemplateEntry,
165
165
  parsesAsScript,
166
166
  prepareFlattenedInnerRoot
167
- } from "./chunk-P24X6CGY.js";
167
+ } from "./chunk-FAORS3UR.js";
168
168
  import {
169
169
  LOW_MEMORY_TOTAL_MB_THRESHOLD,
170
170
  getCgroupMemoryLimitMb,
@@ -190,7 +190,7 @@ import {
190
190
  resolveAbsoluteMediaStartSeconds,
191
191
  resolveAuthoredTimingWindow,
192
192
  toFps
193
- } from "./chunk-O3J7BHBU.js";
193
+ } from "./chunk-QZUVPWC4.js";
194
194
  import {
195
195
  COMPOSITION_SOURCE_URL,
196
196
  HF_COLOR_GRADING_ATTR,
@@ -218,7 +218,7 @@ import {
218
218
  shouldClampResolvedMediaDuration,
219
219
  sourceTimeAt,
220
220
  styleElementsFor
221
- } from "./chunk-BIV5HVTQ.js";
221
+ } from "./chunk-6M3IPJS6.js";
222
222
  import {
223
223
  MAX_AUDIO_GAIN
224
224
  } from "./chunk-UJKQWGFF.js";
@@ -6574,7 +6574,7 @@ async function readLocalFont(absPath) {
6574
6574
  return { kind: "inline", buffer: Buffer.concat(chunks, totalBytes) };
6575
6575
  }
6576
6576
  async function embedLocalFontFaces(html, projectDir) {
6577
- const { fontToDataUri: toDataUri } = await import("./deterministicFonts-KXVO7QEL.js");
6577
+ const { fontToDataUri: toDataUri } = await import("./deterministicFonts-RWGQPEZU.js");
6578
6578
  const styleBlockRe = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
6579
6579
  const fontFaceRe = /@font-face\s*\{([^}]*)\}/gi;
6580
6580
  let result = html;
@@ -13533,6 +13533,13 @@ var PLAN_AUDIO_LEGACY_RELATIVE_PATH = "audio.aac";
13533
13533
  function isPlanAudioArtifactPath(path) {
13534
13534
  return path === PLAN_AUDIO_RELATIVE_PATH || path === PLAN_AUDIO_LEGACY_RELATIVE_PATH;
13535
13535
  }
13536
+ function resolvePlanAudioPath(planDir) {
13537
+ for (const name of [PLAN_AUDIO_RELATIVE_PATH, PLAN_AUDIO_LEGACY_RELATIVE_PATH]) {
13538
+ const candidate = join27(planDir, name);
13539
+ if (existsSync17(candidate)) return candidate;
13540
+ }
13541
+ return null;
13542
+ }
13536
13543
  var INVALID_VIDEO_METADATA = "INVALID_VIDEO_METADATA";
13537
13544
  var PlanVideosMetadataError = class extends Error {
13538
13545
  // Read by cloud adapters across the package boundary to classify retries.
@@ -14185,9 +14192,28 @@ function buildLockedRenderConfig(input) {
14185
14192
  chunkSize: input.effectiveChunkSize,
14186
14193
  chunkCount: input.chunkCount,
14187
14194
  runtimeEnv: input.runtimeEnv,
14188
- variables: config.variables
14195
+ variables: config.variables,
14196
+ ...input.chunksCarryAudio ? { chunksCarryAudio: true } : {}
14189
14197
  };
14190
14198
  }
14199
+ function carriesChunkAudio(config, options) {
14200
+ return options.chunksCarryAudio === true && config.format === "mp4" && config.cfr !== true;
14201
+ }
14202
+ async function fitPlanAudioToFrames(audioPath, workDir, totalFrames, fps, run) {
14203
+ const fittedPath = join29(workDir, "audio-fitted.m4a");
14204
+ const result = await padOrTrimAudioToVideoFrameCount({
14205
+ videoPath: audioPath,
14206
+ probeVideoFrameInfo: async () => ({ frameCount: totalFrames, fpsNum: fps, fpsDen: 1 }),
14207
+ audioPath,
14208
+ outputPath: fittedPath,
14209
+ signal: run.signal,
14210
+ timeoutMs: run.timeoutMs
14211
+ });
14212
+ if (!result.success) {
14213
+ throw encoderFailureError("[plan] audio pad/trim failed", result);
14214
+ }
14215
+ renameSync4(fittedPath, audioPath);
14216
+ }
14191
14217
  function resolveEncoderTriple(config) {
14192
14218
  if (config.format === "mp4") {
14193
14219
  return resolveMp4EncoderTriple(config.codec);
@@ -14241,6 +14267,13 @@ function pathInside(root, path) {
14241
14267
  const rel = relative5(root, path);
14242
14268
  return rel === "" || rel.startsWith("..") || isAbsolute2(rel) ? null : rel;
14243
14269
  }
14270
+ function stableSourcePath(roots, srcPath) {
14271
+ for (const [root, prefix] of roots) {
14272
+ const rel = pathInside(root, srcPath);
14273
+ if (rel !== null) return [prefix, ...rel.split(sep2)].filter(Boolean).join("/");
14274
+ }
14275
+ return srcPath;
14276
+ }
14244
14277
  function createVideoSourceShipper(input) {
14245
14278
  const shipped = /* @__PURE__ */ new Map();
14246
14279
  return (srcPath) => {
@@ -14390,7 +14423,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
14390
14423
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
14391
14424
  if (probeResult.probeSession) {
14392
14425
  try {
14393
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-ZGMLMQ3B.js");
14426
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-VFTQPSQD.js");
14394
14427
  await closeCaptureSession2(probeResult.probeSession);
14395
14428
  } catch (err) {
14396
14429
  log.warn("[plan] probe session close failed", {
@@ -14453,12 +14486,17 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
14453
14486
  workCompiledDir: compiledDir,
14454
14487
  workVideoFramesDir: stagedVideoFrames
14455
14488
  });
14489
+ const sourceRoots = [
14490
+ [stagedVideoFrames, "video-frames"],
14491
+ [compiledDir, "compiled"],
14492
+ [projectDir, ""]
14493
+ ];
14456
14494
  const planVideosJson = buildPlanVideosJson({
14457
14495
  videos: composition.videos,
14458
14496
  compositionEnd: job.duration ?? Number.NaN,
14459
14497
  extracted: (extractResult.extractionResult?.extracted ?? []).map((ext) => ({
14460
14498
  videoId: ext.videoId,
14461
- srcPath: ext.srcPath,
14499
+ srcPath: stableSourcePath(sourceRoots, ext.srcPath),
14462
14500
  framePattern: ext.framePattern,
14463
14501
  fps: ext.fps,
14464
14502
  totalFrames: ext.totalFrames,
@@ -14509,6 +14547,13 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
14509
14547
  if (audioResult.hasAudio && existsSync18(audioResult.audioOutputPath)) {
14510
14548
  renameSync4(audioResult.audioOutputPath, planAudioPath);
14511
14549
  }
14550
+ const chunksCarryAudio2 = carriesChunkAudio(config, options);
14551
+ if (chunksCarryAudio2 && existsSync18(planAudioPath)) {
14552
+ await fitPlanAudioToFrames(planAudioPath, workDir, totalFrames, config.fps, {
14553
+ signal: abortSignal,
14554
+ timeoutMs: cfg.ffmpegProcessTimeout
14555
+ });
14556
+ }
14512
14557
  const ffmpegVersion = await readFfmpegVersion();
14513
14558
  const producerVersion = readProducerVersion();
14514
14559
  const fontSnapshotSha = await readFontSnapshotSha();
@@ -14521,7 +14566,8 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
14521
14566
  engineConfig: cfg,
14522
14567
  effectiveChunkSize,
14523
14568
  chunkCount,
14524
- runtimeEnv
14569
+ runtimeEnv,
14570
+ chunksCarryAudio: chunksCarryAudio2
14525
14571
  });
14526
14572
  const compositionJson = {
14527
14573
  durationSeconds: job.duration ?? 0,
@@ -15917,7 +15963,7 @@ function startServer(options = {}) {
15917
15963
  });
15918
15964
  async function shutdown(signal) {
15919
15965
  log.info(`Received ${signal}, shutting down`);
15920
- const { drainBrowserPool } = await import("./src-ZGMLMQ3B.js");
15966
+ const { drainBrowserPool } = await import("./src-VFTQPSQD.js");
15921
15967
  await drainBrowserPool().catch(() => {
15922
15968
  });
15923
15969
  const handle = await Promise.race([
@@ -16177,8 +16223,10 @@ function resolveExtractedVideoOutputDir(planDir, videoId) {
16177
16223
  }
16178
16224
  return outputDir;
16179
16225
  }
16180
- function artifactTargets(path, videoDependencies) {
16181
- if (isPlanAudioArtifactPath(path)) return { chunks: [], assembler: true };
16226
+ function artifactTargets(path, videoDependencies, chunksCarryAudio2) {
16227
+ if (isPlanAudioArtifactPath(path)) {
16228
+ return { chunks: chunksCarryAudio2 ? "all" : [], assembler: true };
16229
+ }
16182
16230
  if (path === "plan.json" || path === "meta/chunks.json" || path === "meta/encoder.json") {
16183
16231
  return { chunks: "all", assembler: true };
16184
16232
  }
@@ -16400,9 +16448,11 @@ function buildPlanV2Publication(executionPlanDir, digests) {
16400
16448
  }
16401
16449
  validateExtractionCacheCompleteSentinels(executionPlanDir);
16402
16450
  const videoDependencyPlan = buildVideoChunkDependencies(executionPlanDir, dimensions);
16451
+ const encoder = readJsonFile(join35(executionPlanDir, "meta", "encoder.json"), "meta/encoder.json");
16452
+ const chunksCarryAudio2 = isRecord3(encoder) && encoder.chunksCarryAudio === true;
16403
16453
  for (const file of listFiles(executionPlanDir)) {
16404
16454
  if (isExtractionCacheCompleteSentinelPath(file.path)) continue;
16405
- const targets = artifactTargets(file.path, videoDependencyPlan.dependencies);
16455
+ const targets = artifactTargets(file.path, videoDependencyPlan.dependencies, chunksCarryAudio2);
16406
16456
  if ((file.path.startsWith("video-frames/") || file.path.startsWith("video-sources/")) && targets.chunks !== "all" && targets.chunks.length === 0 && !targets.assembler) {
16407
16457
  continue;
16408
16458
  }
@@ -16505,7 +16555,8 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
16505
16555
  listFiles(join35(stagingRoot, "compiled")).map(
16506
16556
  (file) => publishBlobFor(file.absolutePath, digests)
16507
16557
  )
16508
- )
16558
+ ),
16559
+ chunksCarryAudio: options.chunksCarryAudio
16509
16560
  });
16510
16561
  return await publishExecutionPlan(stagingRoot, publisher, { digests, log: config.logger });
16511
16562
  } catch (error) {
@@ -16818,6 +16869,7 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
16818
16869
  format,
16819
16870
  fps,
16820
16871
  fpsArg: fpsToFfmpegArg(fps),
16872
+ chunkSeconds: chunksCarryAudio(planDir) ? plan2.chunks.map((chunk) => (chunk.endFrame - chunk.startFrame) * fps.den / fps.num) : null,
16821
16873
  signal: options?.abortSignal,
16822
16874
  timeout: resolveConfig().ffmpegProcessTimeout,
16823
16875
  log,
@@ -16880,10 +16932,10 @@ function readAssemblePlan(planDir, chunkPaths) {
16880
16932
  throw new Error(`[assemble] chunk path does not exist: ${path}`);
16881
16933
  }
16882
16934
  }
16883
- return plan2;
16935
+ return { ...plan2, chunks };
16884
16936
  }
16885
16937
  function videoInputArgs(ctx, videoSources) {
16886
- return videoSources.length === 1 ? ["-i", videoSources[0]] : concatDemuxerInput(videoSources, ctx.workDir, ctx.fpsArg);
16938
+ return videoSources.length === 1 ? ["-i", videoSources[0]] : concatDemuxerInput(videoSources, ctx.workDir, ctx.fpsArg, ctx.chunkSeconds);
16887
16939
  }
16888
16940
  async function reencodeCfr(ctx, chunkPaths, encoder) {
16889
16941
  const cfrOutputPath = join36(ctx.workDir, `cfr.${ctx.format}`);
@@ -16963,10 +17015,15 @@ async function writeJoined(ctx, videoSources, audioPath, finalPath) {
16963
17015
  throw encoderFailureError("[assemble] audio mux failed", muxResult);
16964
17016
  }
16965
17017
  }
16966
- function concatDemuxerInput(chunkPaths, workDir, fpsArg) {
17018
+ function concatDemuxerInput(chunkPaths, workDir, fpsArg, chunkSeconds) {
16967
17019
  const listPath = join36(workDir, "concat-list.txt");
16968
- const body = chunkPaths.map((path) => `file '${path.replace(/'/g, "'\\''")}'`).join("\n");
16969
- writeFileSync11(listPath, `${body}
17020
+ const head = chunkSeconds ? ["stream", "exact_stream_id 1"] : [];
17021
+ const body = chunkPaths.map((path, i) => {
17022
+ const line = `file '${path.replace(/'/g, "'\\''")}'`;
17023
+ return chunkSeconds ? `${line}
17024
+ duration ${chunkSeconds[i].toFixed(6)}` : line;
17025
+ });
17026
+ writeFileSync11(listPath, `${[...head, ...body].join("\n")}
16970
17027
  `, "utf-8");
16971
17028
  return ["-r", fpsArg, "-f", "concat", "-safe", "0", "-i", listPath];
16972
17029
  }
@@ -16989,6 +17046,11 @@ async function runAssembleFfmpeg(args, step, signal, timeout) {
16989
17046
  });
16990
17047
  }
16991
17048
  }
17049
+ function chunksCarryAudio(planDir) {
17050
+ const encoderJsonPath = join36(planDir, "meta", "encoder.json");
17051
+ if (!existsSync24(encoderJsonPath)) return false;
17052
+ return JSON.parse(readFileSync12(encoderJsonPath, "utf-8")).chunksCarryAudio === true;
17053
+ }
16992
17054
  function readCfrEncoder(planDir, format) {
16993
17055
  if (format !== "mp4") {
16994
17056
  throw new Error(
@@ -17055,6 +17117,103 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
17055
17117
  import { randomBytes } from "crypto";
17056
17118
  import { existsSync as existsSync25, mkdirSync as mkdirSync15, readFileSync as readFileSync13, readdirSync as readdirSync10, rmSync as rmSync14, writeFileSync as writeFileSync12 } from "fs";
17057
17119
  import { extname as extname6, join as join37 } from "path";
17120
+
17121
+ // ../producer/src/services/distributed/chunkAudio.ts
17122
+ function audioCutForChunk(grid, chunks, index, fps) {
17123
+ const firstPacketAt = (frame) => Math.min(
17124
+ grid.packetCount,
17125
+ Math.max(
17126
+ 0,
17127
+ Math.ceil(
17128
+ (frame * fps.den * grid.sampleRate - grid.firstStart * fps.num) / (grid.packetSamples * fps.num)
17129
+ )
17130
+ )
17131
+ );
17132
+ const first = index === 0 ? 0 : firstPacketAt(chunks[index].startFrame);
17133
+ const end = index === chunks.length - 1 ? grid.packetCount : firstPacketAt(chunks[index + 1].startFrame);
17134
+ if (end <= first) return null;
17135
+ const cutSeconds = (packet) => (grid.firstStart + packet * grid.packetSamples - grid.packetSamples / 2) / grid.sampleRate;
17136
+ const seekSeconds = index === 0 ? null : cutSeconds(first);
17137
+ const durationSeconds = end === grid.packetCount ? null : cutSeconds(end) - (seekSeconds ?? 0);
17138
+ return { seekSeconds, durationSeconds, firstPacket: first, packetCount: end - first };
17139
+ }
17140
+ async function probeAacPacketGrid(audioPath) {
17141
+ const probe = await runFfprobeJson([
17142
+ "-v",
17143
+ "error",
17144
+ "-select_streams",
17145
+ "a:0",
17146
+ "-show_entries",
17147
+ "stream=sample_rate,time_base,nb_frames:packet=pts,duration",
17148
+ "-read_intervals",
17149
+ "%+#1",
17150
+ "-of",
17151
+ "json",
17152
+ "--",
17153
+ audioPath
17154
+ ]);
17155
+ const stream = probe.streams?.[0] ?? {};
17156
+ const packet = probe.packets?.[0] ?? {};
17157
+ const sampleRate = Number(stream.sample_rate);
17158
+ const [tbNum = NaN, tbDen = NaN] = String(stream.time_base).split("/").map(Number);
17159
+ const toSamples = (ticks) => Number(ticks) * sampleRate * tbNum / tbDen;
17160
+ const grid = {
17161
+ sampleRate,
17162
+ firstStart: toSamples(packet.pts),
17163
+ packetSamples: toSamples(packet.duration),
17164
+ packetCount: Number(stream.nb_frames)
17165
+ };
17166
+ const counts = [grid.sampleRate, grid.packetSamples, grid.packetCount];
17167
+ if (!Number.isFinite(grid.firstStart) || !counts.every((n) => Number.isFinite(n) && n > 0)) {
17168
+ throw new Error(`[chunkAudio] could not read the AAC packet grid: ${JSON.stringify(probe)}`);
17169
+ }
17170
+ return grid;
17171
+ }
17172
+ function chunkMuxArgs(input, cut) {
17173
+ if (!cut) return ["-i", input.videoPath, "-map", "0:v:0"];
17174
+ const seek = cut.seekSeconds === null ? [] : ["-ss", cut.seekSeconds.toFixed(6)];
17175
+ const length = cut.durationSeconds === null ? [] : ["-t", cut.durationSeconds.toFixed(6)];
17176
+ const exact = seek.length ? ["-copypriorss", "0"] : [];
17177
+ return [
17178
+ ...["-i", input.videoPath, ...seek, ...length, "-i", input.audioPath],
17179
+ ...["-map", "0:v:0", "-map", "1:a:0", ...exact]
17180
+ ];
17181
+ }
17182
+ async function muxChunkWithAudio(input) {
17183
+ const grid = input.audioPath ? await probeAacPacketGrid(input.audioPath) : null;
17184
+ const cut = grid ? audioCutForChunk(grid, input.chunks, input.chunkIndex, input.fps) : null;
17185
+ const args = [...chunkMuxArgs(input, cut), "-c", "copy"];
17186
+ appendRenderProvenanceArgs(args, input.outputPath);
17187
+ args.push("-y", input.outputPath);
17188
+ const result = await runFfmpeg(args, { signal: input.signal, timeout: input.timeoutMs });
17189
+ if (!result.success) {
17190
+ throw new Error(
17191
+ `[chunkAudio] chunk mux failed: ${describeFfmpegFailure(result, input.timeoutMs)}`
17192
+ );
17193
+ }
17194
+ const slice = input.chunks[input.chunkIndex];
17195
+ const expected = { video: slice.endFrame - slice.startFrame };
17196
+ if (cut) expected.audio = cut.packetCount;
17197
+ const probe = await runFfprobeJson([
17198
+ "-v",
17199
+ "error",
17200
+ "-count_packets",
17201
+ "-show_entries",
17202
+ "stream=codec_type,nb_read_packets",
17203
+ "-of",
17204
+ "json",
17205
+ "--",
17206
+ input.outputPath
17207
+ ]);
17208
+ for (const [type, count] of Object.entries(expected)) {
17209
+ const packets = Number(probe.streams?.find((s) => s.codec_type === type)?.nb_read_packets ?? 0);
17210
+ if (packets !== count) {
17211
+ throw new Error(`[chunkAudio] ${type} packets in chunk ${packets}, expected ${count}`);
17212
+ }
17213
+ }
17214
+ }
17215
+
17216
+ // ../producer/src/services/distributed/renderChunk.ts
17058
17217
  var FFMPEG_VERSION_MISMATCH = "FFMPEG_VERSION_MISMATCH";
17059
17218
  var PLAN_HASH_MISMATCH = "PLAN_HASH_MISMATCH";
17060
17219
  var MISSING_PLAN_ARTIFACT = "MISSING_PLAN_ARTIFACT";
@@ -17603,7 +17762,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath) {
17603
17762
  const preset = resolvePresetForLockedEncoder(basePreset, encoder.encoder);
17604
17763
  const effectiveQuality = encoder.crf ?? preset.quality;
17605
17764
  const effectiveBitrate = encoder.crf != null ? void 0 : encoder.bitrate;
17606
- const videoOnlyPath = outputChunkPath;
17765
+ const videoOnlyPath = encoder.chunksCarryAudio ? `${outputChunkPath}.video.mp4` : outputChunkPath;
17607
17766
  if (isPngSequence) {
17608
17767
  if (!existsSync25(outputChunkPath)) mkdirSync15(outputChunkPath, { recursive: true });
17609
17768
  } else {
@@ -17614,16 +17773,16 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath) {
17614
17773
  await runEncodeStage({
17615
17774
  job,
17616
17775
  log,
17617
- outputPath: outputChunkPath,
17776
+ outputPath: videoOnlyPath,
17618
17777
  framesDir,
17619
17778
  videoOnlyPath,
17620
17779
  width: Math.round(plan2.dimensions.width * encoder.deviceScaleFactor),
17621
17780
  height: Math.round(plan2.dimensions.height * encoder.deviceScaleFactor),
17622
17781
  needsAlpha: plan2.dimensions.format !== "mp4",
17623
17782
  captureImageFormat: captureOptions.format ?? "jpeg",
17624
- // Each chunk produces video only — audio is muxed once at assemble
17625
- // time. Suppressing `hasAudio` skips the png-sequence audio sidecar
17626
- // AND the mp4 audio mux.
17783
+ // The encoder writes video only; audio joins at assemble time or in the
17784
+ // chunk that carries audio. Suppressing `hasAudio` skips the png-sequence audio
17785
+ // sidecar AND the mp4 audio mux.
17627
17786
  hasAudio: false,
17628
17787
  isPngSequence,
17629
17788
  // `DistributedFormat` has no "gif" member — distributed chunks are
@@ -17650,6 +17809,18 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath) {
17650
17809
  lockGopForChunkConcat: !isPngSequence,
17651
17810
  gopSize: framesInChunk
17652
17811
  });
17812
+ if (encoder.chunksCarryAudio) {
17813
+ await muxChunkWithAudio({
17814
+ videoPath: videoOnlyPath,
17815
+ audioPath: resolvePlanAudioPath(planDir),
17816
+ outputPath: outputChunkPath,
17817
+ chunks,
17818
+ chunkIndex,
17819
+ fps: { num: plan2.dimensions.fpsNum, den: plan2.dimensions.fpsDen },
17820
+ timeoutMs: cfg.ffmpegProcessTimeout
17821
+ });
17822
+ rmSync14(videoOnlyPath, { force: true });
17823
+ }
17653
17824
  encodeStageMs = Date.now() - encodeStarted;
17654
17825
  } finally {
17655
17826
  if (session) {
@@ -7,29 +7,29 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  RegistryCompatibilityError,
9
9
  gateRegistryItemsCompatibility
10
- } from "./chunk-YZRS3COO.js";
10
+ } from "./chunk-4QIJFIR5.js";
11
11
  import {
12
12
  DEFAULT_PROJECT_CONFIG,
13
13
  createProjectConfig,
14
14
  loadProjectConfig,
15
15
  projectConfigPath,
16
16
  recordProjectRegistryItems
17
- } from "./chunk-J5Z56PU3.js";
17
+ } from "./chunk-EDGJ2OMH.js";
18
18
  import {
19
19
  resolveItemWithDependencies,
20
20
  resolveItemsByTag
21
- } from "./chunk-5SQHHBAR.js";
21
+ } from "./chunk-JMJTXBVF.js";
22
22
  import {
23
23
  InvalidVariableValuesError,
24
24
  prepareItem,
25
25
  publishItem
26
- } from "./chunk-5FWVFCQM.js";
26
+ } from "./chunk-XGFYN53T.js";
27
27
  import {
28
28
  DEFAULT_REGISTRY_URL
29
- } from "./chunk-EELTMBCC.js";
29
+ } from "./chunk-RTW6WSC7.js";
30
30
  import {
31
31
  trackRegistryItemAdded
32
- } from "./chunk-FQJDV2RI.js";
32
+ } from "./chunk-6I24ZSCR.js";
33
33
  import {
34
34
  defineCommand
35
35
  } from "./chunk-S3S4TGEH.js";
@@ -41,7 +41,7 @@ import {
41
41
  } from "./chunk-ZTZA4UWZ.js";
42
42
  import {
43
43
  ITEM_TYPE_DIRS
44
- } from "./chunk-O3J7BHBU.js";
44
+ } from "./chunk-QZUVPWC4.js";
45
45
  import {
46
46
  isProjectRootMissing,
47
47
  realpath
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-XUXGIA7H.js";
30
30
  import {
31
31
  VERSION
32
- } from "./chunk-BNEKKUPG.js";
32
+ } from "./chunk-BYFG74OA.js";
33
33
  import {
34
34
  CANARIES,
35
35
  canaryEnvVar,
@@ -8,7 +8,7 @@ import {
8
8
  flush,
9
9
  shouldTrack,
10
10
  trackEvent
11
- } from "./chunk-FSX7GTBB.js";
11
+ } from "./chunk-5HLJ4JMB.js";
12
12
  import {
13
13
  getPowerState
14
14
  } from "./chunk-QWQ6GQTI.js";