hyperframes 0.9.9 → 0.9.11

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 (187) hide show
  1. package/README.md +9 -0
  2. package/dist/{add-FQX5F6PC.js → add-IAFJH5RC.js} +6 -6
  3. package/dist/{agentPromptGenerator-XNGPKVEX.js → agentPromptGenerator-S3GWYMVC.js} +1 -1
  4. package/dist/{animatedGifPrep-E3PYKFJ3.js → animatedGifPrep-YU7IOD5D.js} +1 -1
  5. package/dist/api.js +10 -10
  6. package/dist/{asset-X5GG5TTP.js → asset-UR4PH6KJ.js} +2 -2
  7. package/dist/{assetCataloger-SDFP4DWL.js → assetCataloger-VKJIQCYP.js} +1 -1
  8. package/dist/{audio-DDTYFS23.js → audio-HZJ7QZQR.js} +9 -9
  9. package/dist/{auth-OAWLDT3A.js → auth-UBNAW62X.js} +2 -2
  10. package/dist/{autoUpdate-BWIPXW2W.js → autoUpdate-DDFTFHRP.js} +3 -3
  11. package/dist/{backgroundChecks-YJ5NRMBA.js → backgroundChecks-H3TNVYJV.js} +4 -4
  12. package/dist/backgroundChecksWorker.js +4 -4
  13. package/dist/{beats-Q2TIAA7S.js → beats-HOIQSFFP.js} +6 -6
  14. package/dist/{benchmark-I3GRHFIN.js → benchmark-ZYOQV7DK.js} +7 -7
  15. package/dist/billing-5YSYJJ2V.js +142 -0
  16. package/dist/{browser-F24WMZ52.js → browser-PLFK53IZ.js} +4 -4
  17. package/dist/{bundleWithLocalizedFonts-K5CQPNIZ.js → bundleWithLocalizedFonts-TH5SLG6O.js} +2 -2
  18. package/dist/{capture-UKWY3SZQ.js → capture-MICLAF6V.js} +13 -13
  19. package/dist/{capture-HLC6I4RE.js → capture-R77HOGLQ.js} +3 -3
  20. package/dist/{captureCompositionFrame-YMB3CKSP.js → captureCompositionFrame-WBMFZHEF.js} +4 -4
  21. package/dist/{catalog-H7SOITD6.js → catalog-CGT32566.js} +6 -6
  22. package/dist/{catch-up-YRGPVEM6.js → catch-up-TMYPXRKC.js} +5 -5
  23. package/dist/{check-BPQZZ2MO.js → check-4O5J4OWS.js} +23 -23
  24. package/dist/{checkAudio-4NRQ3WGS.js → checkAudio-AAVDZFIQ.js} +3 -3
  25. package/dist/{checkBrowser-S66AHKW3.js → checkBrowser-3OCZBJC7.js} +19 -17
  26. package/dist/{chunk-BYC4C4YY.js → chunk-2VYAX3ZD.js} +2 -2
  27. package/dist/{chunk-GIYZMGYT.js → chunk-2VZVMCV6.js} +1 -1
  28. package/dist/{chunk-322AG75G.js → chunk-33K2UZBX.js} +2 -2
  29. package/dist/{chunk-5YIZRU2L.js → chunk-37537KOL.js} +4 -4
  30. package/dist/{chunk-NX2X326Z.js → chunk-4ILKN2MX.js} +8 -8
  31. package/dist/{chunk-NCP3JQ6S.js → chunk-4J4EGANW.js} +2 -2
  32. package/dist/{chunk-TZBJEKKU.js → chunk-4YCNVKJX.js} +194 -17
  33. package/dist/{chunk-2ROPUTCS.js → chunk-6DHC3MVK.js} +2 -2
  34. package/dist/{chunk-BX2JB24X.js → chunk-6JDNEQV5.js} +1 -1
  35. package/dist/{chunk-6HO6QKYG.js → chunk-6R2PED3X.js} +6 -6
  36. package/dist/{chunk-DIKIN4BA.js → chunk-6Y7WZTHJ.js} +54 -38
  37. package/dist/{chunk-HBHLCMOQ.js → chunk-7ZBMUKHY.js} +2 -2
  38. package/dist/chunk-AHLDGEH5.js +158 -0
  39. package/dist/{chunk-6DKWOG7L.js → chunk-BBMMVLA3.js} +1 -1
  40. package/dist/{chunk-BLBMPEBX.js → chunk-BONBJJ35.js} +1 -0
  41. package/dist/{chunk-63GTSNMY.js → chunk-CD65TPHT.js} +1 -1
  42. package/dist/{chunk-HUJMTTKR.js → chunk-CN3Q4CDK.js} +43 -27
  43. package/dist/{chunk-2Y575PWJ.js → chunk-DI3ZFBZ3.js} +1 -1
  44. package/dist/{chunk-NNF6G2UH.js → chunk-EL2DMHA5.js} +1 -1
  45. package/dist/{chunk-B5GWDPUO.js → chunk-EPCVE3OX.js} +2 -2
  46. package/dist/{chunk-6UZLHLFP.js → chunk-FC4WF2VQ.js} +1 -1
  47. package/dist/{chunk-4W5X4S47.js → chunk-H7H7XNYY.js} +88 -28
  48. package/dist/{chunk-JZPUXDQE.js → chunk-HY64QA63.js} +1 -1
  49. package/dist/{chunk-AH6MUQQC.js → chunk-I4XTKG2B.js} +2 -2
  50. package/dist/{skills-EBVQSIK4.js → chunk-IMK55N3Z.js} +46 -38
  51. package/dist/{chunk-VNR7LSN4.js → chunk-IQ5OMRLK.js} +39 -41
  52. package/dist/{chunk-PPMCILED.js → chunk-JS6ZTPYC.js} +4 -4
  53. package/dist/{chunk-V74HSKGY.js → chunk-JT2ZGKKB.js} +2 -2
  54. package/dist/{chunk-2NGBIAUF.js → chunk-KNOIX2U5.js} +220 -177
  55. package/dist/{chunk-MY4PAH7C.js → chunk-LWFXO732.js} +1 -1
  56. package/dist/{upgrade-ZUWFB2QM.js → chunk-MZHCA5KY.js} +65 -27
  57. package/dist/{chunk-EN6MPNZT.js → chunk-NQYW4IYN.js} +2 -2
  58. package/dist/{chunk-H534266X.js → chunk-OKD2LP73.js} +1 -1
  59. package/dist/{chunk-A2NFFVWH.js → chunk-OQGA4QBD.js} +18 -6
  60. package/dist/{chunk-UWYHZCEQ.js → chunk-OQHC5YIB.js} +2 -2
  61. package/dist/{chunk-BHL4KN3H.js → chunk-PKLZ5PV2.js} +1 -1
  62. package/dist/{chunk-OYAZODSP.js → chunk-QM4OL5MZ.js} +16 -11
  63. package/dist/{chunk-BBP5KGYS.js → chunk-SUM3VFPQ.js} +2 -2
  64. package/dist/{chunk-CNX3WKQ5.js → chunk-T4ELNOK6.js} +1 -1
  65. package/dist/{chunk-VZ5O7A77.js → chunk-V6HV2IDT.js} +5 -2
  66. package/dist/{chunk-BXYB5NGT.js → chunk-VWUUNGSV.js} +1 -1
  67. package/dist/{chunk-CBPBTQBH.js → chunk-WJ7E5J77.js} +11 -10
  68. package/dist/{chunk-62ATHBDS.js → chunk-YJZYUXHQ.js} +1 -1
  69. package/dist/{chunk-TJ2USKCK.js → chunk-ZUACTOAB.js} +1 -1
  70. package/dist/{clean-RCXKQNFM.js → clean-2FWZPS4J.js} +9 -9
  71. package/dist/cli.js +61 -60
  72. package/dist/{cloud-TQPQZRC5.js → cloud-2UFI7NLD.js} +4 -4
  73. package/dist/cloud-Z3FNCC4T.js +1 -1
  74. package/dist/{compare-EO32AASM.js → compare-HKRLSFTU.js} +15 -15
  75. package/dist/{compiler-NAIDMQFU.js → compiler-KKIYPREA.js} +1 -1
  76. package/dist/{component-S3TYNVCR.js → component-F43F3363.js} +3 -3
  77. package/dist/{compositions-4TXRLZ3M.js → compositions-FFXCISLD.js} +7 -7
  78. package/dist/{curve-HGLOP2GY.js → curve-RHSJUG5P.js} +5 -5
  79. package/dist/{cuts-VNFIISLL.js → cuts-KVFY3U6C.js} +5 -5
  80. package/dist/{delete-TIWI3G7X.js → delete-O7IZKKUN.js} +4 -4
  81. package/dist/{deploy-EHPNOGSY.js → deploy-PZAAUW75.js} +8 -8
  82. package/dist/{describeProject-DN6YQU3X.js → describeProject-E44RWBJL.js} +1 -1
  83. package/dist/{diff-46JK5ZCL.js → diff-OMNILRNN.js} +21 -19
  84. package/dist/{dist-CCPYPKOC.js → dist-PUHEYGA5.js} +3 -3
  85. package/dist/{doctor-LD23DW4N.js → doctor-4HZN7ZVI.js} +10 -6
  86. package/dist/{energy-YZ3DB6AI.js → energy-N3ZIPHTP.js} +5 -5
  87. package/dist/{events-3OWNDNJX.js → events-56A5D6DK.js} +4 -4
  88. package/dist/{events-MQIKCKA5.js → events-TUTAERAN.js} +6 -6
  89. package/dist/{events-DRTMYSQ6.js → events-VAJ4Y6XF.js} +3 -3
  90. package/dist/{extract-F3NBE3X5.js → extract-NJMZEOLG.js} +6 -6
  91. package/dist/{face-ZU7ZDYGO.js → face-KLV4W6CP.js} +5 -5
  92. package/dist/{feedback-37M37Y4F.js → feedback-4VEKGVLN.js} +5 -5
  93. package/dist/{ffmpeg-PERZ6YHQ.js → ffmpeg-A2O4HSRD.js} +1 -1
  94. package/dist/{figma-55AG42NN.js → figma-6XDKKOA6.js} +3 -3
  95. package/dist/fontLocalizeCli.js +3 -3
  96. package/dist/{frames-DJA3CFSY.js → frames-IAMGMNCA.js} +5 -5
  97. package/dist/{generate-BVJ5XNWP.js → generate-FMATRA3L.js} +11 -9
  98. package/dist/{get-PGLCWEBG.js → get-JKA3APWR.js} +4 -4
  99. package/dist/{gpuPolicy-DUNSQM6M.js → gpuPolicy-TKHFDEH2.js} +2 -2
  100. package/dist/{grade-compare-R6Q6G6WP.js → grade-compare-TCLCDUG5.js} +14 -14
  101. package/dist/{heifImagePrep-YNPHFR6W.js → heifImagePrep-L2EY67F2.js} +1 -1
  102. package/dist/{help-4SNDXHWQ.js → help-TWDOQJDN.js} +3 -2
  103. package/dist/{history-NKRHKIE2.js → history-SOWVZUAB.js} +7 -7
  104. package/dist/hyperframes-player.global.js +1 -1
  105. package/dist/{info-U4VDKU2Y.js → info-JDINBZLH.js} +6 -6
  106. package/dist/{init-2RUVBHQO.js → init-ACNL6AFC.js} +15 -15
  107. package/dist/{ink-TX3USU7X.js → ink-WNEJROFH.js} +5 -5
  108. package/dist/{inspect-MAGHXEWS.js → inspect-37AMWUW3.js} +15 -15
  109. package/dist/{keyframes-2TDECIQZ.js → keyframes-LMUFQW4Z.js} +7 -7
  110. package/dist/{lambda-CRVYDETX.js → lambda-DRGDNEW6.js} +3 -3
  111. package/dist/{layout-I3VNHWJH.js → layout-E63HPSXW.js} +15 -15
  112. package/dist/{lint-MCVWXDJX.js → lint-HNZPRCXH.js} +7 -7
  113. package/dist/{list-FJJNWPM6.js → list-UMR5VN2M.js} +4 -4
  114. package/dist/{localPage-6MQ6YFER.js → localPage-KIFKMB2B.js} +1 -1
  115. package/dist/{login-YAZZWYFK.js → login-OXOPCSUY.js} +4 -4
  116. package/dist/{look-U5UHXPUQ.js → look-DFQJP2LY.js} +5 -5
  117. package/dist/{manager-ARXEX6OP.js → manager-T633Z2L4.js} +1 -1
  118. package/dist/{measure-JAPDVQ5X.js → measure-Y2VXF6LJ.js} +11 -11
  119. package/dist/{media-treatment-A4Z32NGP.js → media-treatment-U2PDH4P3.js} +8 -8
  120. package/dist/{media-use-6HX7JHRD.js → media-use-KGNGAQQP.js} +2 -1
  121. package/dist/{models-GMJODMZ5.js → models-HATSG3VK.js} +5 -5
  122. package/dist/{motionShot-Z63I3GO7.js → motionShot-45M7MSFQ.js} +7 -7
  123. package/dist/{normalize-audio-45CHOWKY.js → normalize-audio-SOXEVIKM.js} +5 -5
  124. package/dist/{open-RSTNLDYI.js → open-LRPNBFRW.js} +5 -5
  125. package/dist/{parakeetRunner-K4EGDDVH.js → parakeetRunner-A7Z6CQOT.js} +1 -1
  126. package/dist/{pipeline-EKLTELWF.js → pipeline-N3M6VXBC.js} +4 -4
  127. package/dist/{play-BYIEIRQQ.js → play-HTHDFMOU.js} +10 -10
  128. package/dist/{preflight-TC6ZW3GB.js → preflight-XZZXHV42.js} +2 -2
  129. package/dist/{present-5B5VQKT5.js → present-LQ4PJTP4.js} +10 -10
  130. package/dist/{preview-5O2HT2WF.js → preview-CTEDNFN3.js} +9 -9
  131. package/dist/{probe-ZGK6DBAR.js → probe-6IZD5TPR.js} +6 -6
  132. package/dist/{producer-RFTB2APL.js → producer-4CR46ON4.js} +1 -1
  133. package/dist/{remove-background-LURZDSDJ.js → remove-background-SYHNGASQ.js} +5 -5
  134. package/dist/{render-ETZ3WAJO.js → render-JHSMAWED.js} +9 -9
  135. package/dist/{render-7HIEI7QP.js → render-VZLEKSHR.js} +19 -19
  136. package/dist/{reverse-VPBNBP2Q.js → reverse-SCXEQVRH.js} +1 -1
  137. package/dist/{run-XER4YJY5.js → run-GRCZ6JO5.js} +2 -2
  138. package/dist/{sherpa-D6FQ3CHN.js → sherpa-EENLR3RM.js} +1 -1
  139. package/dist/skills/hyperframes-cli/SKILL.md +2 -0
  140. package/dist/skills/media-use/SKILL.md +1 -1
  141. package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +1 -1
  142. package/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +1 -1
  143. package/dist/skills/media-use/audio/scripts/lib/tts.mjs +2 -0
  144. package/dist/skills/media-use/audio/scripts/lib/tts.test.mjs +14 -0
  145. package/dist/skills/media-use/references/heygen.md +2 -2
  146. package/dist/skills/media-use/scripts/lib/credit-limit.d.mts +3 -0
  147. package/dist/skills/media-use/scripts/lib/credit-limit.mjs +41 -0
  148. package/dist/skills/media-use/scripts/lib/credit-limit.test.mjs +39 -0
  149. package/dist/skills/media-use/scripts/lib/heygen-video-provider.mjs +2 -0
  150. package/dist/skills/media-use/scripts/lib/voice-provider.mjs +2 -0
  151. package/dist/skills-4TSYBAGW.js +49 -0
  152. package/dist/{skillsUpdateCheck-7VXK4R4J.js → skillsUpdateCheck-MGXL5VXL.js} +6 -4
  153. package/dist/{snapshot-PJUNSMDS.js → snapshot-P27Y3NJE.js} +18 -18
  154. package/dist/{src-RL6YEPTD.js → src-L7UBHHKB.js} +1 -1
  155. package/dist/{src-SMIMKSHZ.js → src-MWO2XBSA.js} +2 -2
  156. package/dist/{start-5ZDH643Z.js → start-L5M26YD5.js} +31 -19
  157. package/dist/{staticProjectServer-BX4RWEY5.js → staticProjectServer-2JYB7RLI.js} +5 -5
  158. package/dist/{status-4LLUW5YT.js → status-SUK4I7TS.js} +8 -5
  159. package/dist/studio/assets/{hyperframes-player-CcNGHTev.js → hyperframes-player-BbRz52ui.js} +1 -1
  160. package/dist/studio/assets/{index-D9uDed3x.js → index-CCSgOq2L.js} +1 -1
  161. package/dist/studio/assets/{index-DSRgrCDX.js → index-D3y5mWmH.js} +22 -22
  162. package/dist/studio/index.html +1 -1
  163. package/dist/{studio-api-PEUXVD7P.js → studio-api-MEZKFJBY.js} +3 -3
  164. package/dist/{studioServer-2WIQBEQC.js → studioServer-J5RPUMHP.js} +25 -25
  165. package/dist/{sync-P3O3WZWT.js → sync-FHT2CHKU.js} +5 -5
  166. package/dist/{telemetry-267LV4SC.js → telemetry-JWEOBK3Q.js} +4 -4
  167. package/dist/{telemetry-T73TKZOL.js → telemetry-WGNNQUSF.js} +1 -1
  168. package/dist/{templates-MQ742KVZ.js → templates-7DIQ52Y4.js} +40 -11
  169. package/dist/{timeline-WP7AZAQC.js → timeline-ZO3PNIET.js} +9 -9
  170. package/dist/{tokens-ROFKR7AE.js → tokens-X6OTCQCV.js} +2 -2
  171. package/dist/{transcribe-WS2STSCJ.js → transcribe-KNO3BK5S.js} +9 -9
  172. package/dist/{transcribe-N66QUYCS.js → transcribe-QIZGXMR5.js} +1 -1
  173. package/dist/{tts-HIQMJU6O.js → tts-JHGGL7GL.js} +1 -1
  174. package/dist/update-WXGSPMEG.js +280 -0
  175. package/dist/{updateCheck-M2SMSDIO.js → updateCheck-OBYSCTWV.js} +7 -3
  176. package/dist/upgrade-YCCIVSI6.js +40 -0
  177. package/dist/{urlDownloader-YNI3Y3IE.js → urlDownloader-FOXK4FYP.js} +1 -1
  178. package/dist/{validate-M2M37G47.js → validate-TDVQ2B6Y.js} +13 -13
  179. package/dist/{video-2OEOTSPQ.js → video-AVEGMBDM.js} +1 -1
  180. package/dist/voices-2LIY4CYK.js +97 -0
  181. package/dist/warmCheck.js +23 -23
  182. package/package.json +1 -1
  183. package/dist/billing-W224NIAM.js +0 -96
  184. package/dist/chunk-ASGRVFQ3.js +0 -59
  185. package/dist/{chunk-QUBVGS27.js → chunk-LNTUFRZD.js} +3 -3
  186. package/dist/{destroy-C5GQLZVZ.js → destroy-IQLGADZM.js} +4 -4
  187. package/dist/{synthesize-YK3WLOEQ.js → synthesize-YYT7UON6.js} +5 -5
@@ -0,0 +1,158 @@
1
+ import { createRequire as __hf_createRequire } from "node:module";
2
+ import { fileURLToPath as __hf_fileURLToPath } from "node:url";
3
+ import { dirname as __hf_dirname } from "node:path";
4
+ var require = __hf_createRequire(import.meta.url);
5
+ var __filename = __hf_fileURLToPath(import.meta.url);
6
+ var __dirname = __hf_dirname(__filename);
7
+ import {
8
+ resolveCloudAuthHeaders,
9
+ resolveCloudBaseUrl
10
+ } from "./chunk-TSQZ3DSC.js";
11
+
12
+ // src/heygen/plan.ts
13
+ import { randomUUID } from "crypto";
14
+ var UNPAID = /* @__PURE__ */ new Set(["incomplete", "incomplete_expired"]);
15
+ var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
16
+ function mockPlan() {
17
+ const raw = process.env["HYPERFRAMES_MOCK_PLAN"]?.trim();
18
+ if (!raw) return null;
19
+ const [plan = "none", credits = "0"] = raw.split(":");
20
+ return { plan, credits: Number(credits) || 0, mock: true };
21
+ }
22
+ var billingBaseUrl = () => resolveCloudBaseUrl().replace("://api.", "://api2.");
23
+ async function readPlan() {
24
+ try {
25
+ const res = await fetch(`${billingBaseUrl()}/v1/payment/hyperframes/subscription`, {
26
+ headers: { ...await resolveCloudAuthHeaders(), accept: "application/json" },
27
+ signal: AbortSignal.timeout(15e3)
28
+ });
29
+ const body = await res.json().catch(() => null);
30
+ const data = isRecord(body) && isRecord(body.data) ? body.data : body;
31
+ if (!res.ok || !isRecord(data)) return mockPlan();
32
+ const usage = isRecord(data.usage) ? data.usage : {};
33
+ const sub = isRecord(data.subscription) ? data.subscription : null;
34
+ const paid = !!sub && !UNPAID.has(String(sub.status));
35
+ return {
36
+ plan: paid ? String(sub.plan_name ?? "paid") : "none",
37
+ credits: Number(usage.remaining_units ?? 0) || 0
38
+ };
39
+ } catch {
40
+ return mockPlan();
41
+ }
42
+ }
43
+ var webBase = () => "https://hyperframes.studio";
44
+ var plansUrl = () => process.env["HYPERFRAMES_PLANS_URL"] || `${webBase()}/pricing`;
45
+ var creditsUrl = () => process.env["HYPERFRAMES_CREDITS_URL"] || `${webBase()}/pricing`;
46
+ async function signedInSpace() {
47
+ try {
48
+ const res = await fetch(`${billingBaseUrl()}/v1/pacific/account.get`, {
49
+ headers: { ...await resolveCloudAuthHeaders(), accept: "application/json" },
50
+ signal: AbortSignal.timeout(5e3)
51
+ });
52
+ const body = await res.json().catch(() => null);
53
+ const data = isRecord(body) && isRecord(body.data) ? body.data : null;
54
+ const id = data && isRecord(data.space_info) ? data.space_info.space_id : void 0;
55
+ return typeof id === "string" && /^[a-zA-Z0-9-]{1,64}$/.test(id) ? id : void 0;
56
+ } catch {
57
+ return void 0;
58
+ }
59
+ }
60
+ async function pageUrl(kind, fields = {}) {
61
+ const url = new URL(fields.base ?? (kind === "plans" ? plansUrl() : creditsUrl()));
62
+ url.searchParams.set("from", "cli");
63
+ if (fields.needed) url.searchParams.set("needed_credits", String(fields.needed));
64
+ if (fields.tool) url.searchParams.set("tool", fields.tool);
65
+ if (fields.feature) url.searchParams.set("feature", fields.feature);
66
+ if (fields.rs) url.searchParams.set("rs", fields.rs);
67
+ if (kind === "credits" && !fields.base) url.hash = "packs";
68
+ const space = await signedInSpace();
69
+ if (space) url.searchParams.set("workspace_hint", space);
70
+ return url.toString();
71
+ }
72
+ var int = (v) => Number.isSafeInteger(v) && v > 0 ? v : void 0;
73
+ async function readOffer() {
74
+ try {
75
+ const res = await fetch(`${billingBaseUrl()}/v1/payment/hyperframes/plans`, {
76
+ headers: { ...await resolveCloudAuthHeaders(), accept: "application/json" },
77
+ signal: AbortSignal.timeout(15e3)
78
+ });
79
+ const body = await res.json().catch(() => null);
80
+ const data = isRecord(body) && isRecord(body.data) ? body.data : body;
81
+ if (!res.ok || !isRecord(data)) return {};
82
+ const plans = Array.isArray(data.plans) ? data.plans.filter(isRecord) : [];
83
+ const pro = plans.find((p) => p.plan_name === "pro" && p.period === "month");
84
+ const a = isRecord(data.addon) && data.addons_enabled === true ? data.addon : null;
85
+ const offer = {};
86
+ if (pro && int(pro.amount) && typeof pro.currency === "string")
87
+ offer.pro = { amount: int(pro.amount), currency: pro.currency };
88
+ const [unitsPerBlock, unitAmount, min, max] = [
89
+ "units_per_block",
90
+ "unit_amount",
91
+ "min_quantity",
92
+ "max_quantity"
93
+ ].map((k) => int(a?.[k]));
94
+ if (a && unitsPerBlock && unitAmount && min && max && typeof a.currency === "string")
95
+ offer.addon = {
96
+ unitsPerBlock,
97
+ unitAmount,
98
+ currency: a.currency,
99
+ min,
100
+ max,
101
+ recommended: int(a.recommended) ?? min
102
+ };
103
+ return offer;
104
+ } catch {
105
+ return {};
106
+ }
107
+ }
108
+ function addonBlocks(offer, missing) {
109
+ const blocks = missing && missing > 0 ? Math.ceil(missing / offer.unitsPerBlock) : offer.recommended;
110
+ return Math.min(offer.max, Math.max(offer.min, blocks));
111
+ }
112
+ var money = (cents, currency) => new Intl.NumberFormat("en-US", { style: "currency", currency: currency.toUpperCase() }).format(
113
+ cents / 100
114
+ );
115
+ function stripeCheckoutUrl(value) {
116
+ if (typeof value !== "string" || !URL.canParse(value)) return void 0;
117
+ const url = new URL(value);
118
+ return url.protocol === "https:" && url.hostname === "checkout.stripe.com" ? url.toString() : void 0;
119
+ }
120
+ async function createCheckout(kind, offer, missing) {
121
+ const addon = kind === "credits" ? offer.addon : void 0;
122
+ if (kind === "credits" && !addon)
123
+ throw new Error("Credits are not on sale for this account right now.");
124
+ const body = addon ? {
125
+ quantity: addonBlocks(addon, missing),
126
+ currency: addon.currency,
127
+ unit_amount: addon.unitAmount
128
+ } : { plan_name: "pro", period: "month", request_id: randomUUID() };
129
+ const res = await fetch(
130
+ `${billingBaseUrl()}/v1/payment/hyperframes/${addon ? "addon.checkout" : "checkout"}`,
131
+ {
132
+ method: "POST",
133
+ headers: {
134
+ ...await resolveCloudAuthHeaders(),
135
+ accept: "application/json",
136
+ "content-type": "application/json"
137
+ },
138
+ body: JSON.stringify(body),
139
+ signal: AbortSignal.timeout(2e4)
140
+ }
141
+ );
142
+ const reply = await res.json().catch(() => null);
143
+ const data = isRecord(reply) && isRecord(reply.data) ? reply.data : reply;
144
+ const url = res.ok && isRecord(data) ? stripeCheckoutUrl(data.url) : void 0;
145
+ if (url) return url;
146
+ const why = isRecord(reply) && typeof reply.message === "string" ? reply.message.slice(0, 200) : `HTTP ${res.status}`;
147
+ throw new Error(`HeyGen would not open a checkout: ${why}`);
148
+ }
149
+
150
+ export {
151
+ billingBaseUrl,
152
+ readPlan,
153
+ pageUrl,
154
+ readOffer,
155
+ addonBlocks,
156
+ money,
157
+ createCheckout
158
+ };
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-5LOZWO2M.js";
10
10
  import {
11
11
  trackCommandFailure
12
- } from "./chunk-2ROPUTCS.js";
12
+ } from "./chunk-6DHC3MVK.js";
13
13
  import {
14
14
  failCommand
15
15
  } from "./chunk-66W5IWLO.js";
@@ -341,6 +341,7 @@ function passthroughFields(parsed) {
341
341
  pendingUpdate: parsed.pendingUpdate,
342
342
  completedUpdate: parsed.completedUpdate,
343
343
  lastSkillsCheck: parsed.lastSkillsCheck,
344
+ skillsCheckedVersion: parsed.skillsCheckedVersion,
344
345
  skillsUpdateAvailable: parsed.skillsUpdateAvailable,
345
346
  skillsOutdatedCount: parsed.skillsOutdatedCount,
346
347
  skillsMissingCount: parsed.skillsMissingCount,
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveProject
9
- } from "./chunk-6DKWOG7L.js";
9
+ } from "./chunk-BBMMVLA3.js";
10
10
  import {
11
11
  findPreviewServerForProject,
12
12
  studioApiUrl
@@ -12,7 +12,7 @@ import {
12
12
  jsonArg,
13
13
  num,
14
14
  runMeasure
15
- } from "./chunk-BXYB5NGT.js";
15
+ } from "./chunk-VWUUNGSV.js";
16
16
  import {
17
17
  idempotencyKey,
18
18
  keepVoice,
@@ -20,7 +20,7 @@ import {
20
20
  publicVoices,
21
21
  runJob,
22
22
  senderScope
23
- } from "./chunk-4W5X4S47.js";
23
+ } from "./chunk-H7H7XNYY.js";
24
24
  import {
25
25
  Fix,
26
26
  probeSeconds,
@@ -30,6 +30,9 @@ import {
30
30
  runFfmpeg,
31
31
  videoClip
32
32
  } from "./chunk-A33GFLPY.js";
33
+ import {
34
+ loadSharp
35
+ } from "./chunk-5UT3R43E.js";
33
36
  import {
34
37
  defineCommand
35
38
  } from "./chunk-DL4OD7IA.js";
@@ -256,29 +259,41 @@ function needFile(path) {
256
259
  if (!existsSync(path))
257
260
  throw new Fix(`no file at ${path}`, "pass a picture or sound from the project");
258
261
  }
259
- var shrink = (path, out) => runFfmpeg([
260
- "-y",
261
- "-i",
262
- path,
263
- "-vf",
264
- "scale='min(2048,iw)':'min(2048,ih)':force_original_aspect_ratio=decrease",
265
- "-q:v",
266
- "3",
267
- "-frames:v",
268
- "1",
269
- out
270
- ]);
271
- function inline(work, masks = []) {
262
+ var FIT_2048 = "scale='min(2048,iw)':'min(2048,ih)':force_original_aspect_ratio=decrease";
263
+ function picturesOf(route, r) {
264
+ const paths = [];
265
+ route.body(r, (path, kind) => {
266
+ if (kind === "image") paths.push(path);
267
+ return {};
268
+ });
269
+ return paths;
270
+ }
271
+ var sharpOrNone = () => loadSharp("media-use pictures").catch(() => null);
272
+ async function shrunk(paths, work) {
273
+ const out = /* @__PURE__ */ new Map();
274
+ if (!paths.length) return out;
275
+ const sharp = await sharpOrNone();
276
+ for (const path of new Set(paths)) {
277
+ needFile(path);
278
+ const to = join(work, `picture-${out.size}.jpg`);
279
+ const viaFfmpeg = () => runFfmpeg(["-y", "-i", path, "-vf", FIT_2048, "-q:v", "3", "-frames:v", "1", to]);
280
+ if (!sharp) viaFfmpeg();
281
+ else
282
+ await sharp(path).rotate().resize(2048, 2048, { fit: "inside", withoutEnlargement: true }).jpeg({ quality: 90 }).toFile(to).catch(viaFfmpeg);
283
+ out.set(path, to);
284
+ }
285
+ return out;
286
+ }
287
+ function inline(work, pictures, masks = []) {
272
288
  return (path, kind) => {
273
289
  needFile(path);
274
- const out = join(
290
+ const out = kind === "image" ? pictures.get(path) : join(
275
291
  work,
276
- `in-${Math.random().toString(36).slice(2)}.${{ image: "jpg", audio: "mp3", video: "mp4" }[kind]}`
292
+ `in-${Math.random().toString(36).slice(2)}.${{ audio: "mp3", video: "mp4" }[kind]}`
277
293
  );
278
- if (kind === "image") shrink(path, out);
279
- else if (kind === "audio")
294
+ if (kind === "audio")
280
295
  runFfmpeg(["-y", "-i", path, "-vn", "-ac", "1", "-c:a", "libmp3lame", "-b:a", "128k", out]);
281
- else {
296
+ else if (kind === "video") {
282
297
  const guide = masks.length ? fillMasks(path, masks, work) : path;
283
298
  const scale = "scale='if(gt(iw,ih),min(720,iw),-2)':'if(gt(iw,ih),-2,min(720,ih))'";
284
299
  runFfmpeg([
@@ -303,7 +318,7 @@ async function uploaded(paths) {
303
318
  if (!paths.length) return ids;
304
319
  const { createCloudClient } = await import("./cloud-Z3FNCC4T.js");
305
320
  const { uploadAssetViaDirectUpload } = await import("./upload-L5TSWWIU.js");
306
- const { getMimeType } = await import("./dist-CCPYPKOC.js");
321
+ const { getMimeType } = await import("./dist-PUHEYGA5.js");
307
322
  const client = await createCloudClient();
308
323
  for (const path of paths) {
309
324
  const asset = await uploadAssetViaDirectUpload({
@@ -405,11 +420,11 @@ function fitAspect(out, aspect) {
405
420
  renameSync(fitted, out);
406
421
  return `HeyGen returned ${width}x${height} for ${aspect}; cropped to ${w}x${h} (centre), not stretched`;
407
422
  }
408
- function aspectOf(r, work) {
423
+ async function aspectOf(r, pictures) {
409
424
  if (r.aspect || !r.firstFrame) return r.aspect ?? "16:9";
410
- const sent = join(work, "first-frame.jpg");
411
- shrink(r.firstFrame, sent);
412
- const { width, height } = probeVideo(sent);
425
+ const sent = pictures.get(r.firstFrame);
426
+ const sharp = await sharpOrNone();
427
+ const { width, height } = sharp ? await sharp(sent).metadata() : probeVideo(sent);
413
428
  return `${width}:${height}`;
414
429
  }
415
430
  var MIN_SHOT_S = 0.15;
@@ -492,7 +507,8 @@ async function generate(r, onWait, credits) {
492
507
  try {
493
508
  const sources = assetsOf(r);
494
509
  const ids = await uploaded(sources);
495
- const local = inline(work, r.masks);
510
+ const pictures = await shrunk(picturesOf(route, r), work);
511
+ const local = inline(work, pictures, r.masks);
496
512
  const body = route.body(
497
513
  r,
498
514
  (path, kind) => ids.has(path) ? { type: "asset_id", asset_id: ids.get(path) } : local(path, kind)
@@ -531,7 +547,7 @@ async function generate(r, onWait, credits) {
531
547
  const notes = [];
532
548
  if (r.type === "video")
533
549
  try {
534
- const note = fitAspect(out, aspectOf(r, work));
550
+ const note = fitAspect(out, await aspectOf(r, pictures));
535
551
  if (note) notes.push(note);
536
552
  } catch (e) {
537
553
  notes.push(`kept HeyGen's size, could not crop: ${e instanceof Error ? e.message : e}`);
@@ -8,7 +8,7 @@ import {
8
8
  jsonArg,
9
9
  runMeasure,
10
10
  videoArg
11
- } from "./chunk-BXYB5NGT.js";
11
+ } from "./chunk-VWUUNGSV.js";
12
12
  import {
13
13
  Fix,
14
14
  ffmpegBin,
@@ -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-AH6MUQQC.js";
9
+ } from "./chunk-I4XTKG2B.js";
10
10
 
11
11
  // src/registry/compatibility.ts
12
12
  import { compareVersions } from "compare-versions";
@@ -6,13 +6,13 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  getMimeType
9
- } from "./chunk-NCP3JQ6S.js";
9
+ } from "./chunk-4J4EGANW.js";
10
10
  import {
11
11
  openRangeEnd
12
12
  } from "./chunk-VEIGTKYZ.js";
13
13
  import {
14
14
  stripSdrPngColourTags
15
- } from "./chunk-PPMCILED.js";
15
+ } from "./chunk-JS6ZTPYC.js";
16
16
  import {
17
17
  injectTagsAtHeadStart
18
18
  } from "./chunk-Y3ICFPFK.js";
@@ -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-RL6YEPTD.js");
20
+ const { resolveBrowserGpuMode } = await import("./src-L7UBHHKB.js");
21
21
  return resolveBrowserGpuMode(requestedMode, { chromePath, probeLifecycle });
22
22
  }
23
23
  function resolveLocalWebGpu(browserGpuMode, requiresWebGpu) {
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  pageUrl
9
- } from "./chunk-ASGRVFQ3.js";
9
+ } from "./chunk-AHLDGEH5.js";
10
10
  import {
11
11
  Fix
12
12
  } from "./chunk-A33GFLPY.js";
@@ -15,23 +15,50 @@ import {
15
15
  resolveCloudAuthHeaders,
16
16
  resolveCloudBaseUrl
17
17
  } from "./chunk-TSQZ3DSC.js";
18
- import {
19
- HyperframesApiError,
20
- HyperframesCloudClient
21
- } from "./chunk-3XJM7XZN.js";
22
18
  import {
23
19
  AuthClient,
24
20
  buildAuthHeaders,
25
21
  resolveCredential
26
22
  } from "./chunk-ETYQYG6Q.js";
23
+ import {
24
+ HyperframesApiError,
25
+ HyperframesCloudClient
26
+ } from "./chunk-3XJM7XZN.js";
27
27
  import {
28
28
  configDir
29
29
  } from "./chunk-BVAPHHMQ.js";
30
30
 
31
31
  // src/heygen/v3.ts
32
32
  import { createHash } from "crypto";
33
- import { appendFileSync, existsSync, mkdirSync, readFileSync } from "fs";
34
- import { dirname, join } from "path";
33
+ import { appendFileSync, existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2 } from "fs";
34
+ import { dirname, join as join2 } from "path";
35
+
36
+ // src/media-use/lib/credit-limit.mjs
37
+ import { existsSync, readFileSync } from "fs";
38
+ import { join } from "path";
39
+ var read = (file) => existsSync(file) ? readFileSync(file, "utf8") : "";
40
+ function creditLimit(projectDir) {
41
+ const text = read(join(projectDir, ".hyperframes", "credit-limit.json"));
42
+ if (!text) return void 0;
43
+ const credits = Number(JSON.parse(text)?.credits);
44
+ if (!Number.isFinite(credits) || credits < 0)
45
+ throw new Error(`${projectDir}/.hyperframes/credit-limit.json needs {"credits": <number>}`);
46
+ return credits;
47
+ }
48
+ function creditsSpent(projectDir) {
49
+ const charged = /* @__PURE__ */ new Map();
50
+ for (const row of read(join(projectDir, ".hyperframes", "heygen-jobs.jsonl")).split("\n")) {
51
+ if (!row) continue;
52
+ const { key, credits } = JSON.parse(row);
53
+ if (key && typeof credits === "number") charged.set(key, credits);
54
+ }
55
+ return {
56
+ total: [...charged.values()].reduce((a, b) => a + b, 0),
57
+ keys: new Set([...charged].filter(([, c]) => c > 0).map(([k]) => k))
58
+ };
59
+ }
60
+
61
+ // src/heygen/v3.ts
35
62
  var RUNNING = /* @__PURE__ */ new Set(["pending", "processing", "queued", "running", "waiting", "in_progress"]);
36
63
  var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
37
64
  function idempotencyKey(route, parts) {
@@ -43,7 +70,7 @@ var Refused = class extends Fix {
43
70
  status = 0;
44
71
  };
45
72
  var KEEPS_KEY = /* @__PURE__ */ new Set([401, 403, 408, 409, 425, 429]);
46
- var failedKeysFile = () => join(configDir(), "heygen-failed-keys");
73
+ var failedKeysFile = () => join2(configDir(), "heygen-failed-keys");
47
74
  var noSignIn = () => {
48
75
  throw new Fix("no HeyGen sign-in on this machine", "npx hyperframes auth login");
49
76
  };
@@ -58,7 +85,7 @@ async function jobSender() {
58
85
  }
59
86
  function failedKeys(scope) {
60
87
  const file = failedKeysFile();
61
- const lines = existsSync(file) ? readFileSync(file, "utf8").split("\n") : [];
88
+ const lines = existsSync2(file) ? readFileSync2(file, "utf8").split("\n") : [];
62
89
  return new Set(
63
90
  lines.filter((l) => l.startsWith(`${scope} `)).map((l) => l.slice(scope.length + 1))
64
91
  );
@@ -75,7 +102,7 @@ function liveKey(key, scope) {
75
102
  for (let n = 1; failed.has(sent); n++) sent = `${key}-${n}`;
76
103
  return sent;
77
104
  }
78
- function refusal(status, body, estimate) {
105
+ async function refusal(status, body, estimate) {
79
106
  const err = isRecord(body) && isRecord(body.error) ? body.error : isRecord(body) ? body : {};
80
107
  const code = String(err.code ?? err.failure_code ?? "");
81
108
  const message = String(err.message ?? err.failure_message ?? "").slice(0, 300);
@@ -87,12 +114,12 @@ function refusal(status, body, estimate) {
87
114
  if (/hf_subscription_required/i.test(code))
88
115
  return new Refused(
89
116
  `this is a HyperFrames Pro feature; nothing was charged. Run \`npx hyperframes billing subscribe\`: it opens the page and waits`,
90
- `Subscribe: ${url ?? pageUrl("plans", { needed })}`
117
+ `Subscribe: ${url ?? await pageUrl("plans", { needed })}`
91
118
  );
92
119
  if (/hf_usage_exhausted/i.test(code))
93
120
  return new Refused(
94
- `out of HyperFrames credits (this step needs ${needs}${balance}); nothing was charged. Run \`npx hyperframes billing top-up${needed ? ` --needed ${needed}` : ""}\`: it opens the page and waits`,
95
- `Add credits: ${url ?? pageUrl("credits", { needed })}`
121
+ `out of HyperFrames credits (this step needs ${needs}${balance}); nothing was charged. Run \`npx hyperframes billing add-credits${needed ? ` --needed ${needed}` : ""}\`: it opens the page and waits`,
122
+ `Buy add-on credits: ${url ?? await pageUrl("credits", { needed })}`
96
123
  );
97
124
  if (/api_key_required/i.test(code))
98
125
  return new Refused(
@@ -107,7 +134,7 @@ function refusal(status, body, estimate) {
107
134
  if (status === 402 || /insufficient|credit|usage_exhausted|quota/i.test(code))
108
135
  return new Refused(
109
136
  `HeyGen says there is not enough credit (${code || status})`,
110
- "top up at https://app.heygen.com, or sign in with npx hyperframes auth login to use the plan's allowance"
137
+ "buy add-on credits at https://app.heygen.com, or sign in with npx hyperframes auth login to use the plan's allowance"
111
138
  );
112
139
  if (/content_policy/i.test(code))
113
140
  return new Refused(
@@ -134,7 +161,7 @@ async function call(route, send, timeoutMs, estimate, auth) {
134
161
  );
135
162
  if (err.status >= 500 || err.status < 300 || err.raw == null)
136
163
  throw new Fix(`HeyGen ${err.status} for ${route} with no readable answer`, resume);
137
- const refused = refusal(err.status, err.raw, estimate);
164
+ const refused = await refusal(err.status, err.raw, estimate);
138
165
  refused.status = err.status;
139
166
  throw refused;
140
167
  }
@@ -150,19 +177,41 @@ async function call(route, send, timeoutMs, estimate, auth) {
150
177
  }
151
178
  function log(entry, record) {
152
179
  if (!entry.projectDir) return;
153
- const dir = join(entry.projectDir, ".hyperframes");
180
+ const dir = join2(entry.projectDir, ".hyperframes");
154
181
  mkdirSync(dir, { recursive: true });
155
182
  appendFileSync(
156
- join(dir, "heygen-jobs.jsonl"),
183
+ join2(dir, "heygen-jobs.jsonl"),
157
184
  `${JSON.stringify({ at: (/* @__PURE__ */ new Date()).toISOString(), what: entry.what, ...record })}
158
185
  `
159
186
  );
160
187
  }
188
+ function withinLimit(limitLog, sent, credits) {
189
+ if (!limitLog?.projectDir) return false;
190
+ const limit = creditLimit(limitLog.projectDir);
191
+ if (limit === void 0) return false;
192
+ const spent = creditsSpent(limitLog.projectDir);
193
+ if (spent.keys.has(sent)) return false;
194
+ const left = limit - spent.total;
195
+ const fix = "tell the person what their limit leaves out, then ask whether to raise it or make the video without this piece";
196
+ if (credits === void 0)
197
+ throw new Fix(
198
+ `this call cannot be priced ahead, so it cannot be kept under the run's credit limit of ${limit}; nothing was made`,
199
+ fix
200
+ );
201
+ if (credits > left)
202
+ throw new Fix(
203
+ `this call is about ${credits} credits and the run's credit limit of ${limit} leaves ${Math.max(0, left)}; nothing was made or charged`,
204
+ fix
205
+ );
206
+ log(limitLog, { key: sent, status: "reserved", credits });
207
+ return true;
208
+ }
161
209
  async function runJob(jobRoute, body, key, opts = {}) {
162
210
  const started = Date.now();
163
211
  const route = jobRoute.path;
164
212
  const { auth, scope } = await jobSender();
165
213
  const sent = liveKey(key, scope);
214
+ const reserved = withinLimit(opts.log, sent, opts.credits);
166
215
  let job;
167
216
  try {
168
217
  job = await call(
@@ -173,11 +222,15 @@ async function runJob(jobRoute, body, key, opts = {}) {
173
222
  auth
174
223
  );
175
224
  } catch (err) {
176
- if (err instanceof Refused && !KEEPS_KEY.has(err.status)) markFailed(sent, scope);
225
+ if (err instanceof Refused && !KEEPS_KEY.has(err.status)) {
226
+ markFailed(sent, scope);
227
+ if (reserved && opts.log) log(opts.log, { key: sent, status: "refused", credits: 0 });
228
+ }
177
229
  throw err;
178
230
  }
179
231
  const waits = RUNNING.has(job.status.toLowerCase());
180
- if (opts.log && waits) log(opts.log, { route, id: job.id, key: sent, status: job.status });
232
+ if (opts.log && waits)
233
+ log(opts.log, { route, id: job.id, key: sent, status: job.status, credits: opts.credits });
181
234
  const status = jobRoute.status;
182
235
  while (status && RUNNING.has(job.status.toLowerCase())) {
183
236
  if (Date.now() - started > (opts.timeoutMs ?? 15 * 6e4))
@@ -194,21 +247,25 @@ async function runJob(jobRoute, body, key, opts = {}) {
194
247
  3e4
195
248
  );
196
249
  }
197
- if (opts.log) log(opts.log, { route, id: job.id, key: sent, status: job.status });
250
+ if (opts.log)
251
+ log(opts.log, { route, id: job.id, key: sent, status: job.status, credits: opts.credits });
198
252
  if (!/^(completed|succeeded|success|done)$/i.test(job.status)) {
199
253
  markFailed(sent, scope);
200
- throw refusal(422, {
254
+ throw await refusal(422, {
201
255
  error: { code: job.failure_code ?? job.status, message: job.failure_message ?? "" }
202
256
  });
203
257
  }
204
258
  return job;
205
259
  }
206
260
  var isVoice = (v) => isRecord(v) && typeof v.voice_id === "string" && typeof v.name === "string";
207
- async function publicVoices(language, limit) {
261
+ async function listVoices(query, limit) {
208
262
  const client = clientFor(await resolveCloudAuthHeaders().catch(noSignIn));
209
- const value = await client.listVoicesV3({ type: "public", language, limit, signal: AbortSignal.timeout(3e4) }).catch((err) => {
263
+ const value = await client.listVoicesV3({ ...query, limit, signal: AbortSignal.timeout(3e4) }).catch((err) => {
210
264
  if (err instanceof HyperframesApiError)
211
- throw new Fix(`HeyGen ${err.status} listing its voices`, "run the same command again");
265
+ throw new Fix(
266
+ `HeyGen ${err.status} listing its voices`,
267
+ err.status === 401 || err.status === 403 ? "npx hyperframes auth login" : "run the same command again"
268
+ );
212
269
  throw new Fix(
213
270
  `no answer from HeyGen for its voices (${err instanceof Error ? err.message : String(err)})`,
214
271
  "run the same command again"
@@ -216,16 +273,18 @@ async function publicVoices(language, limit) {
216
273
  });
217
274
  if (!isRecord(value) || !Array.isArray(value.data))
218
275
  throw new Fix("HeyGen answered its voices with no list", "run the same command again");
219
- return value.data.filter(isVoice).map(({ voice_id, name, language: language2, gender }) => ({ voice_id, name, language: language2, gender }));
276
+ return value.data.filter(isVoice).map(({ voice_id, name, language, gender }) => ({ voice_id, name, language, gender }));
220
277
  }
278
+ var publicVoices = (language, limit) => listVoices({ type: "public", language }, limit);
279
+ var ownVoices = (limit) => listVoices({ type: "private" }, limit);
221
280
  async function senderScope() {
222
281
  return (await jobSender()).scope;
223
282
  }
224
- var picksFile = (projectDir) => projectDir ? join(projectDir, ".hyperframes", "heygen-jobs.jsonl") : join(configDir(), "heygen-voice-picks.jsonl");
283
+ var picksFile = (projectDir) => projectDir ? join2(projectDir, ".hyperframes", "heygen-jobs.jsonl") : join2(configDir(), "heygen-voice-picks.jsonl");
225
284
  function keptVoice(projectDir, request) {
226
285
  const file = picksFile(projectDir);
227
- if (!existsSync(file)) return void 0;
228
- for (const line of readFileSync(file, "utf8").split("\n")) {
286
+ if (!existsSync2(file)) return void 0;
287
+ for (const line of readFileSync2(file, "utf8").split("\n")) {
229
288
  const entry = line ? JSON.parse(line) : null;
230
289
  if (isRecord(entry) && entry.voice_pick === request && isVoice(entry.voice)) return entry.voice;
231
290
  }
@@ -245,6 +304,7 @@ export {
245
304
  idempotencyKey,
246
305
  runJob,
247
306
  publicVoices,
307
+ ownVoices,
248
308
  senderScope,
249
309
  keptVoice,
250
310
  keepVoice
@@ -12,7 +12,7 @@ import {
12
12
  ensureHfIds,
13
13
  mintHfId,
14
14
  walkCompositionDescendants
15
- } from "./chunk-PPMCILED.js";
15
+ } from "./chunk-JS6ZTPYC.js";
16
16
  import {
17
17
  isAllowedHtmlAttribute,
18
18
  isSafeAttributeValue,
@@ -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.9.9" : "0.0.0-dev";
10
- var PRODUCER_VERSION = true ? "0.9.9" : "0.0.0-dev";
9
+ var VERSION = true ? "0.9.11" : "0.0.0-dev";
10
+ var PRODUCER_VERSION = true ? "0.9.11" : "0.0.0-dev";
11
11
 
12
12
  export {
13
13
  VERSION,