hyperframes 0.9.28 → 0.9.29

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 (192) hide show
  1. package/dist/{add-XQCABYNY.js → add-BRXFSBYO.js} +5 -5
  2. package/dist/{agentPromptGenerator-S2SYZY3A.js → agentPromptGenerator-NJL6ZJQA.js} +2 -2
  3. package/dist/{animatedGifPrep-SACSOT4A.js → animatedGifPrep-AVZAMI2D.js} +2 -2
  4. package/dist/api.js +19 -19
  5. package/dist/{asset-JPI3LFG4.js → asset-FEAC2U74.js} +2 -2
  6. package/dist/{assetCataloger-TJQ5OLMV.js → assetCataloger-WGNEAI5A.js} +3 -3
  7. package/dist/{audio-RG6NXOMI.js → audio-PBKCPYW2.js} +7 -7
  8. package/dist/{auth-7G2OCS7L.js → auth-IPHKPGNV.js} +2 -2
  9. package/dist/{autoUpdate-7RS75ENY.js → autoUpdate-4HUTYRYX.js} +2 -2
  10. package/dist/{avatars-KWPVXWXC.js → avatars-U2XLC3OS.js} +6 -6
  11. package/dist/{backgroundChecks-5HHWQH5H.js → backgroundChecks-4Q4R56DT.js} +3 -3
  12. package/dist/backgroundChecksWorker.js +3 -3
  13. package/dist/{beats-XHKWF5KT.js → beats-VS4P6KKZ.js} +4 -4
  14. package/dist/{benchmark-57RNYMON.js → benchmark-MGDPACXB.js} +6 -6
  15. package/dist/{billing-FXAMQKDS.js → billing-JLASHFQM.js} +4 -4
  16. package/dist/{browser-TV2VPWQJ.js → browser-FU4TZSMT.js} +3 -3
  17. package/dist/{bundleWithLocalizedFonts-YGHFRVJW.js → bundleWithLocalizedFonts-B2XFORNZ.js} +1 -1
  18. package/dist/{capture-GPT5V4ND.js → capture-CFESIHJR.js} +8 -8
  19. package/dist/{capture-LHPSRQ4R.js → capture-LL7WE2S7.js} +3 -3
  20. package/dist/{captureCompositionFrame-TLV2WC4Q.js → captureCompositionFrame-DABFEOQO.js} +5 -5
  21. package/dist/{catalog-7A3MMFTN.js → catalog-U6CHLXTI.js} +5 -5
  22. package/dist/{catch-up-SEGXPPOX.js → catch-up-DMREF334.js} +4 -4
  23. package/dist/{check-OP5AR33W.js → check-ILJC6WYD.js} +23 -23
  24. package/dist/{checkAudio-QDAUXX7W.js → checkAudio-MWSP2436.js} +4 -4
  25. package/dist/{checkBrowser-OGE3A52R.js → checkBrowser-HC3LYH6H.js} +17 -17
  26. package/dist/{chunk-MMCMEW7K.js → chunk-2YZ6GA4E.js} +1 -1
  27. package/dist/{chunk-VOVC3QCN.js → chunk-42MHKDVP.js} +1 -1
  28. package/dist/{chunk-YU2KLER7.js → chunk-47JZ2UQC.js} +1 -1
  29. package/dist/{chunk-7M26J4R3.js → chunk-4TCEF2I7.js} +1 -1
  30. package/dist/{chunk-UAEL2JEL.js → chunk-4TPTB6PY.js} +2 -2
  31. package/dist/{chunk-EOJ2PMOV.js → chunk-5QGDLMU3.js} +2 -2
  32. package/dist/{chunk-257XUBNU.js → chunk-5RLMHG3E.js} +1 -1
  33. package/dist/{chunk-AA2DNXEJ.js → chunk-6JAB5BHX.js} +7 -7
  34. package/dist/{chunk-LPB7T67S.js → chunk-72LMHSPL.js} +2 -2
  35. package/dist/{chunk-W7TS3CZA.js → chunk-74PW4UVC.js} +1 -1
  36. package/dist/{chunk-RFLV3WR5.js → chunk-76MHB2H6.js} +1 -1
  37. package/dist/{chunk-PL5C5FKM.js → chunk-77B6C7CU.js} +2 -2
  38. package/dist/{chunk-QT766HQV.js → chunk-7GJKUOPX.js} +14 -17
  39. package/dist/{chunk-VCMPKZFN.js → chunk-7TION72L.js} +11 -11
  40. package/dist/{chunk-SDYZOTB7.js → chunk-AOPNJEQC.js} +2 -2
  41. package/dist/{chunk-TTKJF3LI.js → chunk-BX2BIU6Z.js} +1 -1
  42. package/dist/{chunk-K77GTFH3.js → chunk-BYJEUZNT.js} +1 -1
  43. package/dist/{chunk-SJOA2RCP.js → chunk-C25RSEQN.js} +8 -8
  44. package/dist/{chunk-D5HNV6G6.js → chunk-DYKBB5HB.js} +1 -1
  45. package/dist/{chunk-W4EAYORI.js → chunk-EIVSIGS2.js} +3 -3
  46. package/dist/{chunk-PEJQV2RL.js → chunk-FJPHKCWU.js} +9 -9
  47. package/dist/{chunk-SQRI67KR.js → chunk-FNC3JNO7.js} +1 -1
  48. package/dist/{chunk-BF6RWOUF.js → chunk-FXPDWYD7.js} +100 -50
  49. package/dist/{chunk-L5KXLXFY.js → chunk-GISQ7VOP.js} +8 -8
  50. package/dist/{chunk-55ZEUSPW.js → chunk-GQNV4DG6.js} +1 -1
  51. package/dist/{chunk-5E6Y7CW3.js → chunk-GTUTZIRR.js} +1 -1
  52. package/dist/{chunk-MPKBIC4Z.js → chunk-H5BHEZ4B.js} +2 -2
  53. package/dist/{chunk-UVF4HXPW.js → chunk-HCC7XLD7.js} +2 -2
  54. package/dist/{chunk-ZWJ7PWTY.js → chunk-HLRYLZFX.js} +2 -2
  55. package/dist/{chunk-LXAJQXHM.js → chunk-ITWIFUDS.js} +1 -1
  56. package/dist/{chunk-E54N6IPY.js → chunk-IXMO4RXK.js} +2 -2
  57. package/dist/{chunk-GUHCMOE2.js → chunk-J7PDBGQM.js} +1 -1
  58. package/dist/{chunk-CSCK6RGC.js → chunk-JVAD6LD7.js} +31 -14
  59. package/dist/{chunk-V4M7PKBM.js → chunk-L6OXEDJQ.js} +2 -2
  60. package/dist/{chunk-CINCDA5M.js → chunk-LDTJCZZ2.js} +2 -2
  61. package/dist/{chunk-7FYGCIHK.js → chunk-MKZ34726.js} +2 -2
  62. package/dist/{chunk-O5P75JID.js → chunk-MTJ46TG7.js} +2 -2
  63. package/dist/{chunk-NXVDTRXA.js → chunk-NSQLSL42.js} +1 -1
  64. package/dist/{chunk-FBLCK3YJ.js → chunk-NXFUEPWT.js} +31 -17
  65. package/dist/{chunk-WMZDESYF.js → chunk-NZUUKNNZ.js} +1 -1
  66. package/dist/{chunk-EENM7GX3.js → chunk-OY4YSQBK.js} +1 -1
  67. package/dist/{chunk-IX22RYJO.js → chunk-PGZSYDLZ.js} +1 -1
  68. package/dist/{chunk-XPGH4KBU.js → chunk-PVRJKEU5.js} +1 -1
  69. package/dist/{chunk-P2A6MYSQ.js → chunk-Q7FX7HOX.js} +1 -1
  70. package/dist/{chunk-E3UFWFZZ.js → chunk-QBRBXVCE.js} +1 -1
  71. package/dist/{chunk-P5USY2GC.js → chunk-RYFVUPXH.js} +1 -1
  72. package/dist/{chunk-6UMISKCG.js → chunk-RZK5ZGVX.js} +4 -4
  73. package/dist/{chunk-XLERIR2V.js → chunk-S3S3IHCR.js} +1 -1
  74. package/dist/{chunk-UZGRZRD6.js → chunk-SBYFFP7R.js} +1 -1
  75. package/dist/{chunk-6WCOY6MS.js → chunk-SCUKEERJ.js} +4 -4
  76. package/dist/{chunk-AVXIDAFJ.js → chunk-SS7OEJGR.js} +28 -9
  77. package/dist/{chunk-J237HI2F.js → chunk-TIWO5QKS.js} +26 -24
  78. package/dist/{chunk-E53UDY74.js → chunk-TM5H5ZY3.js} +2 -2
  79. package/dist/{chunk-5RUGBDAC.js → chunk-UCCD6SY7.js} +1 -1
  80. package/dist/{chunk-PF23WT5C.js → chunk-UKAZEO7A.js} +5 -5
  81. package/dist/{chunk-TMYY4DV4.js → chunk-USOP5XTT.js} +1 -1
  82. package/dist/{chunk-G4D7EBDQ.js → chunk-V4ZFL2E2.js} +2 -2
  83. package/dist/{chunk-NUUN7XB4.js → chunk-VWEELCAJ.js} +2 -2
  84. package/dist/{chunk-SWEC6N6N.js → chunk-XGGEOBH2.js} +2 -2
  85. package/dist/{chunk-X2YNB244.js → chunk-XKSHWUIF.js} +3 -3
  86. package/dist/{chunk-A7HPQVS5.js → chunk-XVDXYUQJ.js} +1 -1
  87. package/dist/{chunk-LAI7UTBM.js → chunk-YXNRWPF5.js} +19 -19
  88. package/dist/{chunk-JMPTLXJQ.js → chunk-ZCRATF6D.js} +2 -2
  89. package/dist/{chunk-DKSCZYFP.js → chunk-ZGQZTSP2.js} +1 -1
  90. package/dist/{chunk-Z677PTBA.js → chunk-ZQXK4L4G.js} +2 -2
  91. package/dist/{chunk-YSAK7PJZ.js → chunk-ZY3N64NC.js} +1 -1
  92. package/dist/{clean-UGV3DTVQ.js → clean-YU7AM7DC.js} +9 -9
  93. package/dist/cli.js +59 -59
  94. package/dist/{cloud-SDC56AHY.js → cloud-U7RRT2TA.js} +4 -4
  95. package/dist/{compare-LG42JVYH.js → compare-USGR7PZL.js} +13 -13
  96. package/dist/{component-OPAFYBPO.js → component-RIFXLYK3.js} +3 -3
  97. package/dist/{compositions-JP655NT3.js → compositions-QHRNVZ2K.js} +6 -6
  98. package/dist/{curve-RN7HDXOS.js → curve-BX46Q4OW.js} +6 -6
  99. package/dist/{cuts-ET7N7IBU.js → cuts-JRLHBLOX.js} +7 -7
  100. package/dist/{delete-5552CGT5.js → delete-SE7ABVTH.js} +2 -2
  101. package/dist/{deploy-NMFEPGRQ.js → deploy-AQUEV6ND.js} +1 -1
  102. package/dist/{describeProject-CWLV5OAT.js → describeProject-XBT7PHZD.js} +2 -2
  103. package/dist/{diff-HZX2TISC.js → diff-6TZLA6KU.js} +19 -19
  104. package/dist/{dist-O45G7NET.js → dist-ALNMJZ7K.js} +2 -2
  105. package/dist/{doctor-IYEYULPD.js → doctor-DDKKCJMO.js} +6 -6
  106. package/dist/{energy-YXEPVRKW.js → energy-HC7BNZ5E.js} +7 -7
  107. package/dist/{events-JAY5YNEU.js → events-EETQNKK2.js} +8 -8
  108. package/dist/{events-KYCNM6C3.js → events-KNH677YB.js} +2 -2
  109. package/dist/{events-GA24CH3D.js → events-ZRVQOB4Y.js} +3 -3
  110. package/dist/{extract-TFEVGLLS.js → extract-I3J3ZK55.js} +7 -7
  111. package/dist/{face-NP7JGAE7.js → face-HJUZ2OXQ.js} +7 -7
  112. package/dist/{feedback-UPYWXKHN.js → feedback-M6I5AVZ5.js} +4 -4
  113. package/dist/{ffmpeg-RYNM3JM2.js → ffmpeg-OAKTUK5S.js} +2 -2
  114. package/dist/{figma-PL4YF6AD.js → figma-RFAPGGBF.js} +3 -3
  115. package/dist/fontLocalizeCli.js +5 -5
  116. package/dist/{frames-7CHO3XUP.js → frames-FOAWRBW4.js} +8 -8
  117. package/dist/{generate-I3UK6VFX.js → generate-FLG6B7RX.js} +12 -12
  118. package/dist/{get-DRFSJ333.js → get-I5JCIGPW.js} +2 -2
  119. package/dist/{gpuPolicy-OAUKEMJC.js → gpuPolicy-SLVPAQK2.js} +2 -2
  120. package/dist/{grade-compare-PYDF6Y6J.js → grade-compare-R3UOE4WI.js} +14 -14
  121. package/dist/{heifImagePrep-23E67GBA.js → heifImagePrep-BOIWW7FW.js} +3 -3
  122. package/dist/{help-N2SPZK4D.js → help-NVQZEN6A.js} +1 -1
  123. package/dist/{history-LXYOTFY7.js → history-AGNMVDRQ.js} +7 -7
  124. package/dist/hyperframes-player.global.js +1 -1
  125. package/dist/{info-ENAE5IAD.js → info-EXAJSKZP.js} +8 -8
  126. package/dist/{init-DMKB6PK6.js → init-Z7FZ7U5J.js} +18 -18
  127. package/dist/{ink-ANDD7W6Y.js → ink-QYCQXNUY.js} +7 -7
  128. package/dist/{inspect-2XZYCFMK.js → inspect-ZJNHBIJI.js} +15 -15
  129. package/dist/{keyframes-UKUFE6ZF.js → keyframes-QYRES5IL.js} +6 -6
  130. package/dist/{lambda-T4WMAZZV.js → lambda-3I4IV63E.js} +3 -3
  131. package/dist/{layout-FX2Q65LB.js → layout-J33Y6DD7.js} +15 -15
  132. package/dist/{lint-AHORS3BL.js → lint-JT74BZWJ.js} +6 -6
  133. package/dist/{list-H7F3WXD4.js → list-NOWT754O.js} +2 -2
  134. package/dist/{localPage-UUSOCL7L.js → localPage-66UVNGQR.js} +2 -2
  135. package/dist/{login-6ORXT7JS.js → login-3JR3HXS6.js} +4 -4
  136. package/dist/{look-XFA3GQDV.js → look-NKCQENM7.js} +7 -7
  137. package/dist/{manager-ZGVNWYBK.js → manager-ML4OLLSM.js} +3 -3
  138. package/dist/{measure-WIARVYP6.js → measure-VSZBVJJZ.js} +11 -11
  139. package/dist/{media-treatment-L2OD4GAB.js → media-treatment-733EANTU.js} +7 -7
  140. package/dist/{media-use-SYSDJH23.js → media-use-IUN5ATZQ.js} +3 -3
  141. package/dist/{models-YOGYUKBX.js → models-A6FBCVFA.js} +6 -6
  142. package/dist/{motionShot-II6JZGTO.js → motionShot-PVWZLEMB.js} +7 -7
  143. package/dist/{normalize-audio-L6V6T2XW.js → normalize-audio-XD4QE5NE.js} +4 -4
  144. package/dist/{open-BPGKTYYV.js → open-TWEEOMZA.js} +4 -4
  145. package/dist/{parakeetRunner-BWX3UQH4.js → parakeetRunner-GP47AAVT.js} +7 -7
  146. package/dist/{pipeline-O3VKDLBZ.js → pipeline-5HUQFOCY.js} +5 -5
  147. package/dist/{play-NLZ4D4VN.js → play-ZOZRB5OG.js} +8 -8
  148. package/dist/{preflight-HEAPQ7N7.js → preflight-NTJMXUS2.js} +3 -3
  149. package/dist/{present-XPLUCZ5Z.js → present-IMQS3KJ7.js} +8 -8
  150. package/dist/{preview-JAWCYDZP.js → preview-JSK5IKSR.js} +8 -8
  151. package/dist/{probe-3AL2MBSY.js → probe-ZLRD2TRZ.js} +7 -7
  152. package/dist/{producer-OQETVMJH.js → producer-ZZROH3WZ.js} +1 -1
  153. package/dist/{remove-background-2SNU7KAA.js → remove-background-VDTWA7BL.js} +6 -6
  154. package/dist/{render-IKHZUOCM.js → render-P27DEH4H.js} +11 -11
  155. package/dist/{render-FFA55SPM.js → render-UF5XKGO5.js} +20 -20
  156. package/dist/{reverse-74KYO2KF.js → reverse-J4CLVRPY.js} +1 -1
  157. package/dist/{screenshotCapture-HBOH5VXI.js → screenshotCapture-ZZE3GMOF.js} +2 -2
  158. package/dist/{sherpa-DBCTQWM3.js → sherpa-7ISRANWA.js} +6 -6
  159. package/dist/skills/media-use/SKILL.md +1 -1
  160. package/dist/skills/media-use/references/heygen.md +2 -2
  161. package/dist/{skills-YYOPM674.js → skills-AAETAWZH.js} +6 -6
  162. package/dist/{skillsUpdateCheck-2G4HUWXT.js → skillsUpdateCheck-KCP2EYKX.js} +3 -3
  163. package/dist/{snapshot-FSN6MIFT.js → snapshot-5PMHOVPR.js} +21 -21
  164. package/dist/{src-PZKWEQB3.js → src-CHPZUZZ3.js} +4 -4
  165. package/dist/{src-W2OMGCC2.js → src-NIMSUB4P.js} +1 -1
  166. package/dist/{start-BC3LQ6XM.js → start-6D25MEIJ.js} +10 -10
  167. package/dist/{staticProjectServer-NOC42RG6.js → staticProjectServer-LM3YLJ6K.js} +5 -5
  168. package/dist/{status-GAMGQR6J.js → status-22TRM6DI.js} +4 -4
  169. package/dist/studio/assets/{codec-DqZyhFXM.js → codec-D84nARi6.js} +1 -1
  170. package/dist/studio/assets/{hyperframes-player-aBBb_UoJ.js → hyperframes-player-C2-hh0bR.js} +1 -1
  171. package/dist/studio/assets/{index-CceqlOsz.js → index-B0rj7KmJ.js} +1 -1
  172. package/dist/studio/assets/{index-nztwvLTw.js → index-D3lR9-ik.js} +5 -5
  173. package/dist/studio/assets/{pausedVideoDecoder-CwC0h32O.js → pausedVideoDecoder-D8vnt-Wd.js} +1 -1
  174. package/dist/studio/index.html +1 -1
  175. package/dist/{studio-api-2I44WB4P.js → studio-api-LSWAJEK4.js} +2 -2
  176. package/dist/{studioServer-YOES7J26.js → studioServer-MC57HJAV.js} +25 -25
  177. package/dist/{sync-SAFSREBK.js → sync-SEN3M7GA.js} +7 -7
  178. package/dist/{telemetry-JKUAFRWX.js → telemetry-NP2FXZQL.js} +3 -3
  179. package/dist/{templates-T63OMFEN.js → templates-QN7ZUHHZ.js} +4 -4
  180. package/dist/{timeline-4WIGTZRE.js → timeline-V43AACFE.js} +9 -9
  181. package/dist/{tokens-JK3XREP4.js → tokens-NOFZVX4P.js} +2 -2
  182. package/dist/{transcribe-APCPBJXE.js → transcribe-FGVGCTEU.js} +5 -5
  183. package/dist/{transcribe-DWCOZPAN.js → transcribe-IVZ4OASF.js} +14 -14
  184. package/dist/{update-I3DN6NUV.js → update-LML5YVLT.js} +7 -7
  185. package/dist/{updateCheck-5C2PHZ24.js → updateCheck-FFHCGLRU.js} +2 -2
  186. package/dist/{upgrade-KBMPHPSY.js → upgrade-UWT2FB5Y.js} +3 -3
  187. package/dist/{urlDownloader-T5UKNPTJ.js → urlDownloader-4RWM3UH2.js} +1 -1
  188. package/dist/{validate-YNITWYCF.js → validate-ZNK2THUV.js} +13 -13
  189. package/dist/{video-JRQOXAZ2.js → video-QXVXG7PW.js} +3 -3
  190. package/dist/{voices-7QS4D5EP.js → voices-JI7QOSLT.js} +10 -10
  191. package/dist/warmCheck.js +23 -23
  192. package/package.json +1 -1
@@ -16,12 +16,12 @@ import {
16
16
  Semaphore,
17
17
  prepareHeifImageInputs,
18
18
  withMediaProbeSlot
19
- } from "./chunk-UVF4HXPW.js";
19
+ } from "./chunk-HCC7XLD7.js";
20
20
  import {
21
21
  EncoderInterruptedError,
22
22
  encoderFailureError,
23
23
  prepareAnimatedGifInputs
24
- } from "./chunk-GUHCMOE2.js";
24
+ } from "./chunk-J7PDBGQM.js";
25
25
  import {
26
26
  openRangeEnd,
27
27
  parseEncoderOptions
@@ -186,7 +186,7 @@ import {
186
186
  videoAudioId,
187
187
  videoStartOnMediaTimeline,
188
188
  writeCapturedFrame
189
- } from "./chunk-QT766HQV.js";
189
+ } from "./chunk-7GJKUOPX.js";
190
190
  import {
191
191
  assignBundledRuntimeCompositionIds,
192
192
  emitMountedModuleScripts,
@@ -5121,7 +5121,7 @@ async function runCaptureSegmentedStage(input) {
5121
5121
 
5122
5122
  // ../producer/src/services/render/renderEtaGuard.ts
5123
5123
  var RENDER_TOO_SLOW = "RENDER_TOO_SLOW";
5124
- var ETA_MARGIN = 1.2;
5124
+ var ETA_MARGIN = 2;
5125
5125
  var MIN_SAMPLE_MS = 6e4;
5126
5126
  var MIN_SAMPLE_FRAMES = 3;
5127
5127
  var POLL_MS = 5e3;
@@ -5149,6 +5149,15 @@ function checkRenderEta(stage, input) {
5149
5149
  if (etaMs <= maxRenderMs * ETA_MARGIN) return void 0;
5150
5150
  return new RenderTooSlowError(stage, { ...input, maxRenderMs, etaMs });
5151
5151
  }
5152
+ function checkCalibratedRenderEta(input) {
5153
+ return checkRenderEta("capture_calibration", {
5154
+ maxRenderMs: input.maxRenderMs,
5155
+ elapsedMs: input.elapsedMs,
5156
+ framesCompleted: 0,
5157
+ totalFrames: input.totalFrames,
5158
+ msPerFrame: (input.estimate?.medianMs ?? 0) / input.workerCount
5159
+ });
5160
+ }
5152
5161
  function createRateSampler() {
5153
5162
  let base;
5154
5163
  let lastFrames = 0;
@@ -5224,13 +5233,15 @@ function combineCaptureCostEstimates(staticCost, measuredCost) {
5224
5233
  return {
5225
5234
  multiplier: staticCost.multiplier,
5226
5235
  reasons: [...staticCost.reasons, ...measuredCost.reasons],
5227
- p95Ms: measuredCost.p95Ms
5236
+ p95Ms: measuredCost.p95Ms,
5237
+ medianMs: measuredCost.medianMs
5228
5238
  };
5229
5239
  }
5230
5240
  return {
5231
5241
  multiplier: measuredCost.multiplier,
5232
5242
  reasons: [...measuredCost.reasons, ...staticCost.reasons],
5233
- p95Ms: measuredCost.p95Ms
5243
+ p95Ms: measuredCost.p95Ms,
5244
+ medianMs: measuredCost.medianMs
5234
5245
  };
5235
5246
  }
5236
5247
  function buildHeapAdvisoryWarning(sizing, requestedWorkers) {
@@ -5296,6 +5307,10 @@ function estimateMeasuredCaptureCostMultiplier(samples) {
5296
5307
  return { multiplier: 1, reasons: [] };
5297
5308
  }
5298
5309
  const p95Ms = Math.round(p95Sample.captureTimeMs);
5310
+ const mid = sorted.length / 2;
5311
+ const medianMs = Math.round(
5312
+ sorted.length % 2 === 1 ? sorted[Math.floor(mid)].captureTimeMs : (sorted[mid - 1].captureTimeMs + sorted[mid].captureTimeMs) / 2
5313
+ );
5299
5314
  const multiplier = Math.min(
5300
5315
  MAX_MEASURED_CAPTURE_COST_MULTIPLIER,
5301
5316
  Math.max(1, Math.round(p95Ms / CAPTURE_CALIBRATION_TARGET_MS * 100) / 100)
@@ -5303,7 +5318,8 @@ function estimateMeasuredCaptureCostMultiplier(samples) {
5303
5318
  return {
5304
5319
  multiplier,
5305
5320
  reasons: multiplier > 1 ? [`calibration-p95=${p95Ms}ms`] : [],
5306
- p95Ms
5321
+ p95Ms,
5322
+ medianMs
5307
5323
  };
5308
5324
  }
5309
5325
  function selectCaptureCalibrationFrames(totalFrames) {
@@ -6363,7 +6379,7 @@ function isToleratedShortClipBoundaryMiss(report, threshold) {
6363
6379
  return threshold < 1 && report.capturedFrames > 0 && report.expectedFrames >= SHORT_CLIP_ONE_FRAME_TOLERANCE_MIN_EXPECTED_FRAMES && report.expectedFrames <= SHORT_CLIP_ONE_FRAME_TOLERANCE_MAX_EXPECTED_FRAMES && report.expectedFrames - report.capturedFrames === 1;
6364
6380
  }
6365
6381
  function expectedFramesForVideo(video, entry, fps) {
6366
- const rounding = entry && !entry.metadata.isVFR ? "nearest" : "ceil";
6382
+ const rounding = entry && !entry.metadata.isVFR ? "slots" : "ceil";
6367
6383
  const slotSourceDuration = sourceTimeAt(
6368
6384
  normalizeRateSpec(video.playbackRate),
6369
6385
  Math.max(0, video.end - video.start)
@@ -14110,7 +14126,8 @@ async function executeRenderPipeline(input) {
14110
14126
  observability.checkpoint("capture_calibration", "resolved", {
14111
14127
  forceScreenshot: captureForceScreenshot,
14112
14128
  multiplier: outcome.calibration?.estimate.multiplier ?? null,
14113
- p95Ms: outcome.calibration?.estimate.p95Ms ?? null
14129
+ p95Ms: outcome.calibration?.estimate.p95Ms ?? null,
14130
+ medianMs: outcome.calibration?.estimate.medianMs ?? null
14114
14131
  });
14115
14132
  } else {
14116
14133
  observability.checkpoint("capture_calibration", "skipped", {
@@ -14215,12 +14232,12 @@ async function executeRenderPipeline(input) {
14215
14232
  deWorkerInversion: deWorkerInversion ?? "none",
14216
14233
  deParallelRouter: deParallelRouter ?? "none"
14217
14234
  });
14218
- const calibratedTooSlow = checkRenderEta("capture_calibration", {
14235
+ const calibratedTooSlow = checkCalibratedRenderEta({
14219
14236
  maxRenderMs: job.config.maxRenderMs,
14220
14237
  elapsedMs: Date.now() - pipelineStart,
14221
- framesCompleted: 0,
14222
14238
  totalFrames,
14223
- msPerFrame: (captureCalibration?.estimate.p95Ms ?? 0) / workerCount
14239
+ estimate: captureCalibration?.estimate,
14240
+ workerCount
14224
14241
  });
14225
14242
  if (calibratedTooSlow) throw calibratedTooSlow;
14226
14243
  execution.defer(
@@ -17603,7 +17620,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
17603
17620
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
17604
17621
  if (probeResult.probeSession) {
17605
17622
  try {
17606
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-W2OMGCC2.js");
17623
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-NIMSUB4P.js");
17607
17624
  await closeCaptureSession2(probeResult.probeSession);
17608
17625
  } catch (err) {
17609
17626
  log.warn("[plan] probe session close failed", {
@@ -21018,7 +21035,7 @@ function startServer(options = {}) {
21018
21035
  });
21019
21036
  async function shutdown(signal) {
21020
21037
  log.info(`Received ${signal}, shutting down`);
21021
- const { drainBrowserPool } = await import("./src-W2OMGCC2.js");
21038
+ const { drainBrowserPool } = await import("./src-NIMSUB4P.js");
21022
21039
  await drainBrowserPool().catch(() => {
21023
21040
  });
21024
21041
  const handle = await Promise.race([
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  RegistryCompatibilityError,
9
9
  gateRegistryItemsCompatibility
10
- } from "./chunk-5RUGBDAC.js";
10
+ } from "./chunk-UCCD6SY7.js";
11
11
  import {
12
12
  readJsonFlag
13
13
  } from "./chunk-EHZESMRB.js";
@@ -32,7 +32,7 @@ import {
32
32
  } from "./chunk-MVJ7AX6W.js";
33
33
  import {
34
34
  trackRegistryItemAdded
35
- } from "./chunk-5E6Y7CW3.js";
35
+ } from "./chunk-GTUTZIRR.js";
36
36
  import {
37
37
  defineCommand
38
38
  } from "./chunk-DL4OD7IA.js";
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveConfig,
9
9
  usesSoftwareWebGpu
10
- } from "./chunk-QT766HQV.js";
10
+ } from "./chunk-7GJKUOPX.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, probeLifecycle) {
20
- const { resolveBrowserGpuMode } = await import("./src-W2OMGCC2.js");
20
+ const { resolveBrowserGpuMode } = await import("./src-NIMSUB4P.js");
21
21
  return resolveBrowserGpuMode(requestedMode, { chromePath, probeLifecycle });
22
22
  }
23
23
  function resolveLocalWebGpu(browserGpuMode, requiresWebGpu) {
@@ -6,14 +6,14 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  findCuts
9
- } from "./chunk-XPGH4KBU.js";
9
+ } from "./chunk-PVRJKEU5.js";
10
10
  import {
11
11
  grey,
12
12
  readClip,
13
13
  round,
14
14
  videoClip,
15
15
  writeImage
16
- } from "./chunk-MMCMEW7K.js";
16
+ } from "./chunk-2YZ6GA4E.js";
17
17
 
18
18
  // src/measure/events.ts
19
19
  var EVENT_W = 160;
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  getMimeType,
12
12
  injectMediaCodecMapIntoHtml
13
- } from "./chunk-J237HI2F.js";
13
+ } from "./chunk-TIWO5QKS.js";
14
14
  import {
15
15
  PROXY_VARIANT_CONFIG,
16
16
  ProxyCapacityError,
@@ -30,7 +30,7 @@ import {
30
30
  } from "./chunk-VEIGTKYZ.js";
31
31
  import {
32
32
  listenOnBrowserSafePort
33
- } from "./chunk-QT766HQV.js";
33
+ } from "./chunk-7GJKUOPX.js";
34
34
  import {
35
35
  stripSdrPngColourTags
36
36
  } from "./chunk-NHJ5YUBZ.js";
@@ -19,7 +19,7 @@ import {
19
19
  HF_AUDIO_GROUP_ATTR,
20
20
  extractAudioMetadata,
21
21
  extractMediaMetadata
22
- } from "./chunk-QT766HQV.js";
22
+ } from "./chunk-7GJKUOPX.js";
23
23
  import {
24
24
  byStart,
25
25
  fpsToNumber,
@@ -7,23 +7,25 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  findCuts,
9
9
  signatures
10
- } from "./chunk-XPGH4KBU.js";
10
+ } from "./chunk-PVRJKEU5.js";
11
11
  import {
12
12
  jsonArg,
13
13
  num,
14
14
  runMeasure
15
- } from "./chunk-MPKBIC4Z.js";
15
+ } from "./chunk-H5BHEZ4B.js";
16
16
  import {
17
17
  makeOutputFolder
18
18
  } from "./chunk-3S27CPV7.js";
19
19
  import {
20
+ chargedCredits,
20
21
  idempotencyKey,
21
22
  keepVoice,
22
23
  keptVoice,
24
+ limitCheck,
23
25
  publicVoices,
24
26
  runJob,
25
27
  senderScope
26
- } from "./chunk-AVXIDAFJ.js";
28
+ } from "./chunk-SS7OEJGR.js";
27
29
  import {
28
30
  Fix,
29
31
  probeSeconds,
@@ -32,7 +34,7 @@ import {
32
34
  round,
33
35
  runFfmpeg,
34
36
  videoClip
35
- } from "./chunk-MMCMEW7K.js";
37
+ } from "./chunk-2YZ6GA4E.js";
36
38
  import {
37
39
  loadSharp
38
40
  } from "./chunk-NL4RCLQF.js";
@@ -103,6 +105,12 @@ function structureRatio(gray, width, box) {
103
105
  return { inside: sum[0] / (n[0] || 1), ring: sum[1] / (n[1] || 1) };
104
106
  }
105
107
  var DEFAULTS = { image: "nano-banana-2", video: "heygen-video-1", music: "lyria-3-pro" };
108
+ var VENDOR_PRICED_IMAGES = /* @__PURE__ */ new Set([
109
+ "gpt-image-2.5",
110
+ "gpt-image-2.6",
111
+ "gpt-image-2.6-flare"
112
+ ]);
113
+ var isVendorPriced = (r) => r.type === "image" && VENDOR_PRICED_IMAGES.has(r.model ?? "");
106
114
  var VIDEO_RESOLUTION = "768p";
107
115
  var GUIDE_MAX_S = 15;
108
116
  var MUSIC_LENGTHS = [30, 60, 120, 180];
@@ -313,7 +321,7 @@ async function uploaded(paths) {
313
321
  if (!paths.length) return ids;
314
322
  const { createCloudClient } = await import("./cloud-QJMPTQ3N.js");
315
323
  const { uploadAssetViaDirectUpload } = await import("./upload-PEY7EYFV.js");
316
- const { getMimeType } = await import("./dist-O45G7NET.js");
324
+ const { getMimeType } = await import("./dist-ALNMJZ7K.js");
317
325
  const client = await createCloudClient();
318
326
  for (const path of paths) {
319
327
  const asset = await uploadAssetViaDirectUpload({
@@ -530,7 +538,8 @@ async function generate(r, onWait, credits) {
530
538
  },
531
539
  onWait: (j) => onWait?.(j.status),
532
540
  timeoutMs: 30 * 6e4,
533
- credits
541
+ credits,
542
+ vendorPriced: isVendorPriced(r)
534
543
  });
535
544
  const url = urlOf(job, route.urls);
536
545
  if (!url)
@@ -545,6 +554,7 @@ async function generate(r, onWait, credits) {
545
554
  "run the same command again; it re-reads the job"
546
555
  );
547
556
  writeFileSync(out, Buffer.from(await res.arrayBuffer()));
557
+ const charged2 = chargedCredits(job);
548
558
  let cuts;
549
559
  if (r.type === "video")
550
560
  try {
@@ -594,7 +604,8 @@ async function generate(r, onWait, credits) {
594
604
  ...r.motion ? { motion: describe(r.motion) } : {},
595
605
  ...r.masks?.length ? { motion_masks: r.masks.map((m) => [...m.box, ...m.window ?? []]) } : {},
596
606
  ...r.voice ? { voice: r.voice } : {},
597
- ...cuts !== void 0 ? { cuts_inside: cuts } : {}
607
+ ...cuts !== void 0 ? { cuts_inside: cuts } : {},
608
+ ...charged2 !== void 0 ? { charged_credits: charged2 } : {}
598
609
  }
599
610
  }).id;
600
611
  regenerateIndex(project);
@@ -606,7 +617,8 @@ async function generate(r, onWait, credits) {
606
617
  route: route.path,
607
618
  ...ledger ? { ledger } : {},
608
619
  ...cuts !== void 0 ? { cuts_inside: cuts } : {},
609
- ...notes.length ? { notes } : {}
620
+ ...notes.length ? { notes } : {},
621
+ ...charged2 !== void 0 ? { charged_credits: charged2 } : {}
610
622
  };
611
623
  } finally {
612
624
  rmSync(work, { recursive: true, force: true });
@@ -632,7 +644,6 @@ var GPT_IMAGE = {
632
644
  "3:4": 0.03612
633
645
  };
634
646
  var GPT_REFERENCE = 0.0125;
635
- var GPT_MODELS = /* @__PURE__ */ new Set(["gpt-image-2.5", "gpt-image-2.6", "gpt-image-2.6-flare"]);
636
647
  var NANO_IMAGE = 0.067;
637
648
  var NANO_2_1_IMAGE = 0.0336;
638
649
  var NANO_2_1_REFERENCE = 168e-5;
@@ -662,12 +673,14 @@ function priceOf(r) {
662
673
  NANO_2_1_IMAGE + refs * NANO_2_1_REFERENCE,
663
674
  "nano-banana-2.1, $0.0336 an image and $0.00168 a reference"
664
675
  );
665
- if (!GPT_MODELS.has(model))
676
+ if (!VENDOR_PRICED_IMAGES.has(model))
666
677
  return { usd: null, list: null, credits: null, basis: `${model}, not priced ahead` };
667
678
  const each = GPT_IMAGE[r.aspect ?? "16:9"] ?? GPT_IMAGE["16:9"];
679
+ const list = each + refs * GPT_REFERENCE;
680
+ const about = Math.ceil(list * HF_CREDITS_PER_USD - 1e-9);
668
681
  return at(
669
- each + refs * GPT_REFERENCE,
670
- `${model} at ${r.aspect ?? "16:9"}, about $0.0125 a reference`
682
+ list,
683
+ `${model} at ${r.aspect ?? "16:9"}, about ${about} credits (charged at vendor cost), with about $0.0125 a reference`
671
684
  );
672
685
  }
673
686
  case "video": {
@@ -729,7 +742,7 @@ function priceOf(r) {
729
742
  }
730
743
  }
731
744
  var creditsOf = (p) => p.credits === null ? null : Math.ceil(p.credits - 1e-9);
732
- function checkLimit(credits, limit) {
745
+ function checkLimit(credits, limit, vendorPriced = false) {
733
746
  if (limit === void 0) return;
734
747
  const fix = "tell the person what their limit leaves out, then ask whether to raise it or make the video without this piece";
735
748
  if (credits === null)
@@ -737,9 +750,10 @@ function checkLimit(credits, limit) {
737
750
  `this call cannot be priced ahead, so it cannot be kept under --max-credits ${limit}; nothing was made`,
738
751
  fix
739
752
  );
740
- if (credits > limit)
753
+ const { checked, about } = limitCheck(credits, vendorPriced);
754
+ if (checked > limit)
741
755
  throw new Fix(
742
- `this call is about ${credits} credits, over --max-credits ${limit}; nothing was made or charged`,
756
+ `this call is ${about}, over --max-credits ${limit}; nothing was made or charged`,
743
757
  fix
744
758
  );
745
759
  }
@@ -857,7 +871,7 @@ var generate_default = defineCommand({
857
871
  },
858
872
  "max-credits": {
859
873
  type: "string",
860
- description: "The person's credit limit, less what earlier calls used: make nothing when this call would cost more"
874
+ description: "The person's credit limit, less what earlier calls used: make nothing when this call would cost more. A gpt-image call is charged at the vendor's cost, so it is checked against its estimate plus 10%; that is not a hard ceiling, and an edit with many references can still go over. The project's credit-limit.json follows the same rule"
861
875
  },
862
876
  plan: {
863
877
  type: "boolean",
@@ -908,7 +922,7 @@ var generate_default = defineCommand({
908
922
  next: "run the same command without --plan to make it"
909
923
  };
910
924
  }
911
- checkLimit(credits, num(args["max-credits"], "--max-credits"));
925
+ checkLimit(credits, num(args["max-credits"], "--max-credits"), isVendorPriced(request));
912
926
  const made = await generate(
913
927
  request,
914
928
  (status) => console.error(`generate: ${status}\u2026`),
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  sherpaParakeetInstalled,
9
9
  sherpaUnsupportedReason
10
- } from "./chunk-ZWJ7PWTY.js";
10
+ } from "./chunk-HLRYLZFX.js";
11
11
  import {
12
12
  findParakeet
13
13
  } from "./chunk-JZIEZCQM.js";
@@ -43,7 +43,7 @@ import {
43
43
  } from "./chunk-F5QBIIFT.js";
44
44
  import {
45
45
  VERSION
46
- } from "./chunk-E53UDY74.js";
46
+ } from "./chunk-TM5H5ZY3.js";
47
47
 
48
48
  // src/telemetry/transport.ts
49
49
  import { spawn } from "child_process";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-SWOAB4GM.js";
10
10
  import {
11
11
  listenOnBrowserSafePort
12
- } from "./chunk-QT766HQV.js";
12
+ } from "./chunk-7GJKUOPX.js";
13
13
 
14
14
  // src/capture/localPage.ts
15
15
  import {
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  decode,
9
9
  meanAbsDiff
10
- } from "./chunk-MMCMEW7K.js";
10
+ } from "./chunk-2YZ6GA4E.js";
11
11
 
12
12
  // src/measure/cuts.ts
13
13
  var SIG_W = 64;
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  getCachedGpuEncoder
9
- } from "./chunk-QT766HQV.js";
9
+ } from "./chunk-7GJKUOPX.js";
10
10
  import {
11
11
  runCancellableProcess
12
12
  } from "./chunk-X6JUUQCM.js";
@@ -8,7 +8,7 @@ import {
8
8
  ratioOf,
9
9
  readClip,
10
10
  round
11
- } from "./chunk-MMCMEW7K.js";
11
+ } from "./chunk-2YZ6GA4E.js";
12
12
 
13
13
  // src/measure/look.ts
14
14
  var LOOK_FLOOR = { luma: 1, contrast: 1, saturation: 0.01 };
@@ -11,7 +11,7 @@ import {
11
11
  PRORES_PROFILE_NAMES,
12
12
  appendRateCapArgs,
13
13
  isProresProfile
14
- } from "./chunk-QT766HQV.js";
14
+ } from "./chunk-7GJKUOPX.js";
15
15
  import {
16
16
  failUsage
17
17
  } from "./chunk-66W5IWLO.js";
@@ -15,16 +15,16 @@ import {
15
15
  findFFmpeg,
16
16
  findFFprobe,
17
17
  getFFmpegInstallHint
18
- } from "./chunk-P2A6MYSQ.js";
18
+ } from "./chunk-Q7FX7HOX.js";
19
19
  import {
20
20
  registerBrowserSessionCleanup
21
- } from "./chunk-SDYZOTB7.js";
21
+ } from "./chunk-AOPNJEQC.js";
22
22
  import {
23
23
  DEFAULT_VP9_CPU_USED,
24
24
  SDR_RGB_TO_BT709_FILTER,
25
25
  SDR_RGB_TO_TAGGED_BT709_FILTER,
26
26
  renderProvenanceArgs
27
- } from "./chunk-QT766HQV.js";
27
+ } from "./chunk-7GJKUOPX.js";
28
28
  import {
29
29
  runCancellableProcess
30
30
  } from "./chunk-X6JUUQCM.js";
@@ -432,7 +432,7 @@ async function decoderTransposesDimensions(inputPath) {
432
432
  }
433
433
  async function probeMedia(inputPath) {
434
434
  const isImage = inferInputKind(inputPath) === "image";
435
- const engine = await import("./src-W2OMGCC2.js");
435
+ const engine = await import("./src-NIMSUB4P.js");
436
436
  const meta = await engine.extractMediaMetadata(inputPath);
437
437
  if (isImage) {
438
438
  return { width: meta.width, height: meta.height, fps: 0, frameCount: 1 };
@@ -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-QT766HQV.js";
9
+ } from "./chunk-7GJKUOPX.js";
10
10
  import {
11
11
  processAncestorSnapshot,
12
12
  processIdentity,
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-GGDJLN5I.js";
12
12
  import {
13
13
  shouldTrack
14
- } from "./chunk-EENM7GX3.js";
14
+ } from "./chunk-OY4YSQBK.js";
15
15
  import {
16
16
  createFileAtomically
17
17
  } from "./chunk-IEXRKKHC.js";
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-JJ47LVJ7.js";
19
19
  import {
20
20
  trackSkillsInstallSkipped
21
- } from "./chunk-5E6Y7CW3.js";
21
+ } from "./chunk-GTUTZIRR.js";
22
22
  import {
23
23
  diag
24
24
  } from "./chunk-MCDNAIFF.js";
@@ -39,11 +39,11 @@ import {
39
39
  isCoreSkill,
40
40
  presentSkills,
41
41
  retiredSkillNotice
42
- } from "./chunk-E54N6IPY.js";
42
+ } from "./chunk-IXMO4RXK.js";
43
43
  import {
44
44
  NO_UPDATE_NOTICE,
45
45
  withMeta
46
- } from "./chunk-TTKJF3LI.js";
46
+ } from "./chunk-BX2BIU6Z.js";
47
47
  import {
48
48
  failureMessage,
49
49
  jsonFailure
@@ -54,7 +54,7 @@ import {
54
54
  } from "./chunk-66W5IWLO.js";
55
55
  import {
56
56
  VERSION
57
- } from "./chunk-E53UDY74.js";
57
+ } from "./chunk-TM5H5ZY3.js";
58
58
 
59
59
  // src/commands/skills.ts
60
60
  import { execFileSync, spawn } from "child_process";
@@ -7,10 +7,10 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  cliCheckoutLink,
9
9
  pageUrl
10
- } from "./chunk-K77GTFH3.js";
10
+ } from "./chunk-BYJEUZNT.js";
11
11
  import {
12
12
  Fix
13
- } from "./chunk-MMCMEW7K.js";
13
+ } from "./chunk-2YZ6GA4E.js";
14
14
  import {
15
15
  refreshIfNeeded,
16
16
  resolveCloudAuthHeaders,
@@ -63,6 +63,15 @@ function creditsSpent(projectDir) {
63
63
  var MEDIA_USE_SKILL = "media-use";
64
64
  var RUNNING = /* @__PURE__ */ new Set(["pending", "processing", "queued", "running", "waiting", "in_progress"]);
65
65
  var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
66
+ var VENDOR_HEADROOM = 1.1;
67
+ var chargedCredits = (job) => isRecord(job.charged) && job.charged.pool === "hyperframes_credits" && typeof job.charged.amount === "number" ? job.charged.amount : void 0;
68
+ function limitCheck(credits, vendorPriced = false) {
69
+ const checked = vendorPriced ? Math.ceil(credits * VENDOR_HEADROOM - 1e-9) : credits;
70
+ return {
71
+ checked,
72
+ about: vendorPriced ? `about ${credits} credits, ${checked} with 10% headroom because it is charged at the vendor's cost` : `about ${credits} credits`
73
+ };
74
+ }
66
75
  function idempotencyKey(route, parts) {
67
76
  const h = createHash("sha256").update(route);
68
77
  for (const p of parts) h.update(p).update("\0");
@@ -204,7 +213,7 @@ function log(entry, record) {
204
213
  `
205
214
  );
206
215
  }
207
- function withinLimit(limitLog, sent, credits) {
216
+ function withinLimit(limitLog, sent, credits, vendorPriced) {
208
217
  if (!limitLog?.projectDir) return false;
209
218
  const limit = creditLimit(limitLog.projectDir);
210
219
  if (limit === void 0) return false;
@@ -217,12 +226,13 @@ function withinLimit(limitLog, sent, credits) {
217
226
  `this call cannot be priced ahead, so it cannot be kept under the run's credit limit of ${limit}; nothing was made`,
218
227
  fix
219
228
  );
220
- if (credits > left)
229
+ const { checked, about } = limitCheck(credits, vendorPriced);
230
+ if (checked > left)
221
231
  throw new Fix(
222
- `this call is about ${credits} credits and the run's credit limit of ${limit} leaves ${Math.max(0, left)}; nothing was made or charged`,
232
+ `this call is ${about} and the run's credit limit of ${limit} leaves ${Math.max(0, left)}; nothing was made or charged`,
223
233
  fix
224
234
  );
225
- log(limitLog, { key: sent, status: "reserved", credits });
235
+ log(limitLog, { key: sent, status: "reserved", credits: checked });
226
236
  return true;
227
237
  }
228
238
  async function runJob(jobRoute, body, key, opts = {}) {
@@ -230,7 +240,8 @@ async function runJob(jobRoute, body, key, opts = {}) {
230
240
  const route = jobRoute.path;
231
241
  const { auth, scope } = await jobSender();
232
242
  const sent = liveKey(key, scope);
233
- const reserved = withinLimit(opts.log, sent, opts.credits);
243
+ const reserved = withinLimit(opts.log, sent, opts.credits, opts.vendorPriced);
244
+ const held = opts.credits === void 0 ? void 0 : limitCheck(opts.credits, opts.vendorPriced).checked;
234
245
  let job;
235
246
  try {
236
247
  job = await call(
@@ -249,7 +260,7 @@ async function runJob(jobRoute, body, key, opts = {}) {
249
260
  }
250
261
  const waits = RUNNING.has(job.status.toLowerCase());
251
262
  if (opts.log && waits)
252
- log(opts.log, { route, id: job.id, key: sent, status: job.status, credits: opts.credits });
263
+ log(opts.log, { route, id: job.id, key: sent, status: job.status, credits: held });
253
264
  const status = jobRoute.status;
254
265
  while (status && RUNNING.has(job.status.toLowerCase())) {
255
266
  if (Date.now() - started > (opts.timeoutMs ?? 15 * 6e4))
@@ -267,7 +278,13 @@ async function runJob(jobRoute, body, key, opts = {}) {
267
278
  );
268
279
  }
269
280
  if (opts.log)
270
- log(opts.log, { route, id: job.id, key: sent, status: job.status, credits: opts.credits });
281
+ log(opts.log, {
282
+ route,
283
+ id: job.id,
284
+ key: sent,
285
+ status: job.status,
286
+ credits: chargedCredits(job) ?? opts.credits
287
+ });
271
288
  if (!/^(completed|succeeded|success|done)$/i.test(job.status)) {
272
289
  markFailed(sent, scope);
273
290
  throw await refusal(422, {
@@ -320,6 +337,8 @@ function keepVoice(projectDir, request, voice) {
320
337
  }
321
338
 
322
339
  export {
340
+ chargedCredits,
341
+ limitCheck,
323
342
  idempotencyKey,
324
343
  runJob,
325
344
  publicVoices,