hyperframes 0.9.9 → 0.9.10
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.
- package/dist/{add-FQX5F6PC.js → add-AFD3HNXB.js} +5 -5
- package/dist/api.js +4 -4
- package/dist/{asset-X5GG5TTP.js → asset-P6SF46UX.js} +2 -2
- package/dist/{audio-DDTYFS23.js → audio-DFQXEAEE.js} +5 -5
- package/dist/{auth-OAWLDT3A.js → auth-T62ANGDQ.js} +2 -2
- package/dist/{autoUpdate-BWIPXW2W.js → autoUpdate-3IT56KGL.js} +2 -2
- package/dist/{backgroundChecks-YJ5NRMBA.js → backgroundChecks-UKBVUYML.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{beats-Q2TIAA7S.js → beats-7UFMDXBY.js} +4 -4
- package/dist/{benchmark-I3GRHFIN.js → benchmark-LCSHBJJF.js} +6 -6
- package/dist/billing-5YSYJJ2V.js +142 -0
- package/dist/{browser-F24WMZ52.js → browser-5DZHA4EW.js} +3 -3
- package/dist/{bundleWithLocalizedFonts-K5CQPNIZ.js → bundleWithLocalizedFonts-TJL2JWRD.js} +1 -1
- package/dist/{catalog-H7SOITD6.js → catalog-F2XB4VPP.js} +5 -5
- package/dist/{catch-up-YRGPVEM6.js → catch-up-HCBA3MIP.js} +4 -4
- package/dist/{check-BPQZZ2MO.js → check-E2RQCELF.js} +14 -14
- package/dist/{checkAudio-4NRQ3WGS.js → checkAudio-R4DRK3VG.js} +2 -2
- package/dist/{checkBrowser-S66AHKW3.js → checkBrowser-NGY225IO.js} +10 -8
- package/dist/{chunk-BBP5KGYS.js → chunk-2CKL2FUJ.js} +2 -2
- package/dist/{chunk-63GTSNMY.js → chunk-2WNIF4YT.js} +1 -1
- package/dist/{chunk-DIKIN4BA.js → chunk-3XHWHH5A.js} +44 -28
- package/dist/{chunk-2ROPUTCS.js → chunk-5CDTGHED.js} +1 -1
- package/dist/{chunk-CNX3WKQ5.js → chunk-6VKYITOR.js} +1 -1
- package/dist/{chunk-AH6MUQQC.js → chunk-7VGM5TLZ.js} +2 -2
- package/dist/{chunk-6DKWOG7L.js → chunk-7VOLQUA2.js} +1 -1
- package/dist/{chunk-CBPBTQBH.js → chunk-7VU4RBHC.js} +5 -4
- package/dist/chunk-AHLDGEH5.js +158 -0
- package/dist/{chunk-5YIZRU2L.js → chunk-CBTBVRXB.js} +2 -2
- package/dist/{chunk-NX2X326Z.js → chunk-CDSTLOB7.js} +2 -2
- package/dist/{chunk-4W5X4S47.js → chunk-DKROJ3GJ.js} +8 -8
- package/dist/{chunk-BXYB5NGT.js → chunk-GRUI2S2F.js} +1 -1
- package/dist/{chunk-BX2JB24X.js → chunk-MHZ7NSL5.js} +1 -1
- package/dist/{chunk-TZBJEKKU.js → chunk-NBWYATVA.js} +1 -1
- package/dist/{chunk-62ATHBDS.js → chunk-NVYVI4FR.js} +1 -1
- package/dist/{chunk-MY4PAH7C.js → chunk-P4WYY52Y.js} +1 -1
- package/dist/{chunk-V74HSKGY.js → chunk-PO7LSMN5.js} +1 -1
- package/dist/{chunk-UWYHZCEQ.js → chunk-PYUS627M.js} +1 -1
- package/dist/{chunk-2NGBIAUF.js → chunk-Q3W7TDQX.js} +217 -174
- package/dist/{chunk-H534266X.js → chunk-QBPZHOEJ.js} +1 -1
- package/dist/{chunk-2Y575PWJ.js → chunk-QPEDM2ZR.js} +1 -1
- package/dist/{chunk-322AG75G.js → chunk-RZFW7FBA.js} +2 -2
- package/dist/{chunk-NNF6G2UH.js → chunk-UDBNPVUR.js} +1 -1
- package/dist/{chunk-VZ5O7A77.js → chunk-V6HV2IDT.js} +5 -2
- package/dist/{chunk-HBHLCMOQ.js → chunk-W4Q6VYPZ.js} +2 -2
- package/dist/{chunk-VNR7LSN4.js → chunk-WCETVN3N.js} +17 -5
- package/dist/{chunk-A2NFFVWH.js → chunk-WP5QHNXN.js} +3 -3
- package/dist/{chunk-TJ2USKCK.js → chunk-WWPOGMNX.js} +1 -1
- package/dist/{chunk-OYAZODSP.js → chunk-YXSM33UC.js} +11 -6
- package/dist/{chunk-HUJMTTKR.js → chunk-ZMXFRRQR.js} +42 -26
- package/dist/{clean-RCXKQNFM.js → clean-BXHJEVVO.js} +5 -5
- package/dist/cli.js +54 -54
- package/dist/{cloud-TQPQZRC5.js → cloud-ISWLTHGP.js} +4 -4
- package/dist/{compare-EO32AASM.js → compare-MLZYDSZD.js} +4 -4
- package/dist/{component-S3TYNVCR.js → component-MMBTCMY3.js} +3 -3
- package/dist/{compositions-4TXRLZ3M.js → compositions-WT2577NJ.js} +5 -5
- package/dist/{curve-HGLOP2GY.js → curve-HHKVZ6LX.js} +3 -3
- package/dist/{cuts-VNFIISLL.js → cuts-66GBRT5P.js} +3 -3
- package/dist/{delete-TIWI3G7X.js → delete-P3WYOC7I.js} +2 -2
- package/dist/{deploy-EHPNOGSY.js → deploy-OJ3M7QJQ.js} +1 -1
- package/dist/{diff-46JK5ZCL.js → diff-R74KQXXN.js} +9 -7
- package/dist/{doctor-LD23DW4N.js → doctor-DT52W4UE.js} +4 -4
- package/dist/{energy-YZ3DB6AI.js → energy-WOMDOOLC.js} +3 -3
- package/dist/{events-DRTMYSQ6.js → events-PCK4AIN5.js} +2 -2
- package/dist/{events-MQIKCKA5.js → events-WEVZ2ELP.js} +3 -3
- package/dist/{events-3OWNDNJX.js → events-YVQJLQWG.js} +3 -3
- package/dist/{extract-F3NBE3X5.js → extract-CNXA3DWB.js} +4 -4
- package/dist/{face-ZU7ZDYGO.js → face-2WNBW74C.js} +3 -3
- package/dist/{feedback-37M37Y4F.js → feedback-ADMM2XDS.js} +4 -4
- package/dist/{figma-55AG42NN.js → figma-5MMN5JUU.js} +3 -3
- package/dist/fontLocalizeCli.js +2 -2
- package/dist/{frames-DJA3CFSY.js → frames-7CQGHRWT.js} +3 -3
- package/dist/{generate-BVJ5XNWP.js → generate-XOR4UJDW.js} +8 -6
- package/dist/{get-PGLCWEBG.js → get-5K6ALHBS.js} +2 -2
- package/dist/{grade-compare-R6Q6G6WP.js → grade-compare-DK63C776.js} +4 -4
- package/dist/{help-4SNDXHWQ.js → help-AUF2KA6D.js} +1 -1
- package/dist/{history-NKRHKIE2.js → history-G3FXVX4A.js} +6 -6
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/{info-U4VDKU2Y.js → info-DGU3CIU5.js} +5 -5
- package/dist/{init-2RUVBHQO.js → init-LYZI2WCS.js} +6 -6
- package/dist/{ink-TX3USU7X.js → ink-DYZG4BST.js} +3 -3
- package/dist/{inspect-MAGHXEWS.js → inspect-BYQSCRKT.js} +6 -6
- package/dist/{keyframes-2TDECIQZ.js → keyframes-XX2DIYPI.js} +5 -5
- package/dist/{lambda-CRVYDETX.js → lambda-RKI7KKWW.js} +1 -1
- package/dist/{layout-I3VNHWJH.js → layout-RQFOMQRO.js} +6 -6
- package/dist/{lint-MCVWXDJX.js → lint-LFCMCDEG.js} +6 -6
- package/dist/{list-FJJNWPM6.js → list-V4TGMQ3Y.js} +2 -2
- package/dist/{login-YAZZWYFK.js → login-EXCG7PEH.js} +4 -4
- package/dist/{look-U5UHXPUQ.js → look-RBHKHGMF.js} +3 -3
- package/dist/{measure-JAPDVQ5X.js → measure-SAV5K4WT.js} +11 -11
- package/dist/{media-treatment-A4Z32NGP.js → media-treatment-2BVHRXJS.js} +5 -5
- package/dist/{media-use-6HX7JHRD.js → media-use-YEBYLITF.js} +1 -1
- package/dist/{normalize-audio-45CHOWKY.js → normalize-audio-ILLUZPTO.js} +4 -4
- package/dist/{open-RSTNLDYI.js → open-GTNLU7UF.js} +4 -4
- package/dist/{play-BYIEIRQQ.js → play-F2HIXJKH.js} +4 -4
- package/dist/{preflight-TC6ZW3GB.js → preflight-QMXCKE5P.js} +1 -1
- package/dist/{present-5B5VQKT5.js → present-GDR6LCKE.js} +4 -4
- package/dist/{preview-5O2HT2WF.js → preview-4TV5426Q.js} +5 -5
- package/dist/{probe-ZGK6DBAR.js → probe-TYM7WKX2.js} +4 -4
- package/dist/{producer-RFTB2APL.js → producer-NHQXKH7Y.js} +1 -1
- package/dist/{render-ETZ3WAJO.js → render-GEAO2HAV.js} +6 -6
- package/dist/{render-7HIEI7QP.js → render-YLAS7GVD.js} +12 -12
- package/dist/{reverse-VPBNBP2Q.js → reverse-3KAZZXB2.js} +1 -1
- package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +1 -1
- package/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +1 -1
- package/dist/skills/media-use/references/heygen.md +1 -1
- package/dist/{skills-EBVQSIK4.js → skills-T5XCP3RC.js} +27 -12
- package/dist/{skillsUpdateCheck-7VXK4R4J.js → skillsUpdateCheck-IG7KLWIA.js} +3 -3
- package/dist/{snapshot-PJUNSMDS.js → snapshot-RULSIRM6.js} +8 -8
- package/dist/{src-SMIMKSHZ.js → src-DHBRQZFZ.js} +1 -1
- package/dist/{start-5ZDH643Z.js → start-GF3JCTGF.js} +29 -17
- package/dist/{status-4LLUW5YT.js → status-SUK4I7TS.js} +8 -5
- package/dist/studio/assets/{hyperframes-player-CcNGHTev.js → hyperframes-player-BcELSci_.js} +1 -1
- package/dist/studio/assets/{index-D9uDed3x.js → index-2SLNyxZG.js} +1 -1
- package/dist/studio/assets/{index-DSRgrCDX.js → index-DR2eua-L.js} +22 -22
- package/dist/studio/index.html +1 -1
- package/dist/{studioServer-2WIQBEQC.js → studioServer-DOTRPHS3.js} +9 -9
- package/dist/{sync-P3O3WZWT.js → sync-XQPBXGGX.js} +3 -3
- package/dist/{telemetry-267LV4SC.js → telemetry-7TIIOBVB.js} +3 -3
- package/dist/{templates-MQ742KVZ.js → templates-7DIQ52Y4.js} +40 -11
- package/dist/{timeline-WP7AZAQC.js → timeline-4JIUAUIP.js} +5 -5
- package/dist/{tokens-ROFKR7AE.js → tokens-4PQU4LVQ.js} +2 -2
- package/dist/{transcribe-WS2STSCJ.js → transcribe-IKUPC2R3.js} +6 -6
- package/dist/{updateCheck-M2SMSDIO.js → updateCheck-LBPTWEZV.js} +2 -2
- package/dist/{upgrade-ZUWFB2QM.js → upgrade-2FS4AMCA.js} +2 -2
- package/dist/{validate-M2M37G47.js → validate-MLVDUEK7.js} +6 -6
- package/dist/warmCheck.js +14 -14
- package/package.json +1 -1
- package/dist/billing-W224NIAM.js +0 -96
- package/dist/chunk-ASGRVFQ3.js +0 -59
package/dist/studio/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
document.documentElement.dataset.theme = "paper";
|
|
15
15
|
}
|
|
16
16
|
</script>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-DR2eua-L.js"></script>
|
|
18
18
|
<link rel="stylesheet" crossorigin href="/assets/index-RUPGNyct.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
renderJobObservabilityTelemetryPayload,
|
|
9
9
|
renderObservabilityTelemetryPayload,
|
|
10
10
|
startRenderCpuSampler
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-P4WYY52Y.js";
|
|
12
12
|
import {
|
|
13
13
|
HANDOFF_READY,
|
|
14
14
|
desktopDownloadUrl,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./chunk-7W5ZDOLW.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveRenderBrowser
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-V6HV2IDT.js";
|
|
22
22
|
import "./chunk-XQ26I3PL.js";
|
|
23
23
|
import {
|
|
24
24
|
loadSharpInBackground
|
|
@@ -99,12 +99,12 @@ import {
|
|
|
99
99
|
import {
|
|
100
100
|
trackRenderComplete,
|
|
101
101
|
trackRenderError
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-5CDTGHED.js";
|
|
103
103
|
import {
|
|
104
104
|
canaryDecisionsForStudio,
|
|
105
105
|
resetTelemetryPostureCache,
|
|
106
106
|
shouldTrack
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-PO7LSMN5.js";
|
|
108
108
|
import "./chunk-PXVQOMKL.js";
|
|
109
109
|
import "./chunk-MCDNAIFF.js";
|
|
110
110
|
import "./chunk-BVAPHHMQ.js";
|
|
@@ -183,7 +183,7 @@ import "./chunk-J3RXEDR2.js";
|
|
|
183
183
|
import "./chunk-QBXDU24O.js";
|
|
184
184
|
import {
|
|
185
185
|
VERSION
|
|
186
|
-
} from "./chunk-
|
|
186
|
+
} from "./chunk-7VGM5TLZ.js";
|
|
187
187
|
import "./chunk-E63BDV4Z.js";
|
|
188
188
|
import {
|
|
189
189
|
detectAgentRuntime
|
|
@@ -728,13 +728,13 @@ var RENDER_SHUTDOWN_WAIT_MS = 2e3;
|
|
|
728
728
|
var IMMUTABLE_CACHE_CONTROL = "public, max-age=31536000, immutable";
|
|
729
729
|
var REMOTE_GIF_IMG_SRC_RE = /<img\b[^>]*?\bsrc\s*=\s*["'](https?:\/\/[^"']+\.gif(?:[?#][^"']*)?)["'][^>]*>/gi;
|
|
730
730
|
async function loadStudioProducer() {
|
|
731
|
-
if (!isDevMode()) return await import("./src-
|
|
731
|
+
if (!isDevMode()) return await import("./src-DHBRQZFZ.js");
|
|
732
732
|
if (!process.versions.bun) {
|
|
733
733
|
throw new Error(
|
|
734
734
|
"Studio dev-mode rendering requires bun (the producer is loaded from TypeScript source, which Node cannot resolve). Restart the studio with `bun run studio`."
|
|
735
735
|
);
|
|
736
736
|
}
|
|
737
|
-
return await import("./src-
|
|
737
|
+
return await import("./src-DHBRQZFZ.js");
|
|
738
738
|
}
|
|
739
739
|
function resolveDistDir() {
|
|
740
740
|
return resolveStudioBundle().dir;
|
|
@@ -1293,7 +1293,7 @@ function createStudioServer(options) {
|
|
|
1293
1293
|
return loadAllItems(blockAndComponentEntries, registry);
|
|
1294
1294
|
},
|
|
1295
1295
|
async installRegistryBlock(opts) {
|
|
1296
|
-
const { addToProject, primaryInstalledTarget } = await import("./add-
|
|
1296
|
+
const { addToProject, primaryInstalledTarget } = await import("./add-AFD3HNXB.js");
|
|
1297
1297
|
const { recordRewrittenInstall } = await import("./installer-PUQYKLXZ.js");
|
|
1298
1298
|
const { registryTargetPath } = await import("./publication-K4XAMUI6.js");
|
|
1299
1299
|
const { result, item } = await addToProject({
|
|
@@ -1399,7 +1399,7 @@ function createStudioServer(options) {
|
|
|
1399
1399
|
app.get("/api/environment/ffmpeg", async (c) => {
|
|
1400
1400
|
if (ffmpegReady) return c.json({ ok: true });
|
|
1401
1401
|
const [{ runEnvironmentChecks }, { getFFmpegInstallCommand }] = await Promise.all([
|
|
1402
|
-
import("./preflight-
|
|
1402
|
+
import("./preflight-QMXCKE5P.js"),
|
|
1403
1403
|
import("./ffmpeg-PERZ6YHQ.js")
|
|
1404
1404
|
]);
|
|
1405
1405
|
const { outcomes } = await runEnvironmentChecks();
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
videoAndRoi,
|
|
16
16
|
videoArg,
|
|
17
17
|
window
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GRUI2S2F.js";
|
|
19
19
|
import {
|
|
20
20
|
Fix
|
|
21
21
|
} from "./chunk-A33GFLPY.js";
|
|
@@ -58,7 +58,7 @@ import "./chunk-EPQC3FGZ.js";
|
|
|
58
58
|
import "./chunk-WC4MTXGN.js";
|
|
59
59
|
import "./chunk-FBN2M2HK.js";
|
|
60
60
|
import "./chunk-766MOTIZ.js";
|
|
61
|
-
import "./chunk-
|
|
61
|
+
import "./chunk-NBWYATVA.js";
|
|
62
62
|
import "./chunk-BR2JQQC5.js";
|
|
63
63
|
import "./chunk-BLBMPEBX.js";
|
|
64
64
|
import "./chunk-ISN5GRYI.js";
|
|
@@ -66,7 +66,7 @@ import "./chunk-ADVVQX4I.js";
|
|
|
66
66
|
import "./chunk-66W5IWLO.js";
|
|
67
67
|
import "./chunk-J3RXEDR2.js";
|
|
68
68
|
import "./chunk-QBXDU24O.js";
|
|
69
|
-
import "./chunk-
|
|
69
|
+
import "./chunk-7VGM5TLZ.js";
|
|
70
70
|
import "./chunk-E63BDV4Z.js";
|
|
71
71
|
import "./chunk-G7VEYUZ2.js";
|
|
72
72
|
import "./chunk-XT6MXC7A.js";
|
|
@@ -17,14 +17,14 @@ import {
|
|
|
17
17
|
trackInitTemplate,
|
|
18
18
|
trackRenderComplete,
|
|
19
19
|
trackRenderError
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5CDTGHED.js";
|
|
21
21
|
import {
|
|
22
22
|
flush,
|
|
23
23
|
flushSync,
|
|
24
24
|
shouldTrack,
|
|
25
25
|
showTelemetryNotice,
|
|
26
26
|
trackEvent
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-PO7LSMN5.js";
|
|
28
28
|
import "./chunk-PXVQOMKL.js";
|
|
29
29
|
import "./chunk-MCDNAIFF.js";
|
|
30
30
|
import "./chunk-BVAPHHMQ.js";
|
|
@@ -51,7 +51,7 @@ import "./chunk-ADVVQX4I.js";
|
|
|
51
51
|
import "./chunk-66W5IWLO.js";
|
|
52
52
|
import "./chunk-J3RXEDR2.js";
|
|
53
53
|
import "./chunk-QBXDU24O.js";
|
|
54
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-7VGM5TLZ.js";
|
|
55
55
|
import "./chunk-E63BDV4Z.js";
|
|
56
56
|
import "./chunk-G7VEYUZ2.js";
|
|
57
57
|
import "./chunk-XT6MXC7A.js";
|
|
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
billingBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AHLDGEH5.js";
|
|
10
10
|
import {
|
|
11
11
|
resolveCloudAuthHeaders
|
|
12
12
|
} from "./chunk-TSQZ3DSC.js";
|
|
@@ -32,7 +32,18 @@ import "./chunk-M2WBOQ2Q.js";
|
|
|
32
32
|
// src/commands/templates.ts
|
|
33
33
|
import { execFileSync } from "child_process";
|
|
34
34
|
import { createHash } from "crypto";
|
|
35
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
existsSync,
|
|
37
|
+
mkdirSync,
|
|
38
|
+
mkdtempSync,
|
|
39
|
+
readFileSync,
|
|
40
|
+
readdirSync,
|
|
41
|
+
renameSync,
|
|
42
|
+
rmSync,
|
|
43
|
+
rmdirSync,
|
|
44
|
+
statSync,
|
|
45
|
+
writeFileSync
|
|
46
|
+
} from "fs";
|
|
36
47
|
import { dirname, join, resolve } from "path";
|
|
37
48
|
var TEMPLATES = {
|
|
38
49
|
"animated-science-explainer": {
|
|
@@ -97,8 +108,9 @@ async function download(url, pack) {
|
|
|
97
108
|
throw new PullRefused("The download does not match the template's hash; nothing was unpacked.");
|
|
98
109
|
return data;
|
|
99
110
|
}
|
|
100
|
-
function assertSafeEntries(
|
|
101
|
-
const names = execFileSync("tar", ["-tzf",
|
|
111
|
+
function assertSafeEntries(data) {
|
|
112
|
+
const names = execFileSync("tar", ["-tzf", "-"], {
|
|
113
|
+
input: data,
|
|
102
114
|
encoding: "utf8",
|
|
103
115
|
maxBuffer: 1 << 26
|
|
104
116
|
});
|
|
@@ -106,16 +118,17 @@ function assertSafeEntries(archive) {
|
|
|
106
118
|
if (name.startsWith("/") || name.split("/").includes(".."))
|
|
107
119
|
throw new PullRefused(`The template holds an unsafe path (${name}); nothing was unpacked.`);
|
|
108
120
|
}
|
|
109
|
-
|
|
121
|
+
var PULLED_HASH = ".template-sha256";
|
|
122
|
+
function unpack(data, dest, pack) {
|
|
110
123
|
mkdirSync(dirname(dest), { recursive: true });
|
|
111
124
|
const work = mkdtempSync(`${dest}.part-`);
|
|
112
125
|
try {
|
|
113
|
-
const archive = join(work, "template.tar.gz");
|
|
114
126
|
const out = join(work, "template");
|
|
115
|
-
|
|
116
|
-
assertSafeEntries(archive);
|
|
127
|
+
assertSafeEntries(data);
|
|
117
128
|
mkdirSync(out);
|
|
118
|
-
execFileSync("tar", ["-xzf",
|
|
129
|
+
execFileSync("tar", ["-xzf", "-", "-C", out, "--no-same-owner"], { input: data });
|
|
130
|
+
writeFileSync(join(out, PULLED_HASH), pack.sha256);
|
|
131
|
+
removeEmptyPlaceholder(dest);
|
|
119
132
|
renameSync(out, dest);
|
|
120
133
|
} finally {
|
|
121
134
|
rmSync(work, { recursive: true, force: true });
|
|
@@ -128,10 +141,26 @@ async function pullTemplate(slug, dir) {
|
|
|
128
141
|
`No template "${slug}". Templates: ${Object.keys(TEMPLATES).join(", ")}.`
|
|
129
142
|
);
|
|
130
143
|
const dest = resolve(dir, "templates", slug);
|
|
131
|
-
if (
|
|
132
|
-
unpack(await download(await bundleUrl(pack), pack), dest);
|
|
144
|
+
if (alreadyPulled(dest, pack)) return dest;
|
|
145
|
+
unpack(await download(await bundleUrl(pack), pack), dest, pack);
|
|
133
146
|
return dest;
|
|
134
147
|
}
|
|
148
|
+
var removeEmptyPlaceholder = (dest) => existsSync(dest) && rmdirSync(dest);
|
|
149
|
+
function alreadyPulled(dest, pack) {
|
|
150
|
+
if (!existsSync(dest)) return false;
|
|
151
|
+
const folder = statSync(dest).isDirectory();
|
|
152
|
+
const record = join(dest, PULLED_HASH);
|
|
153
|
+
const pulledHash = folder && existsSync(record) ? readFileSync(record, "utf8") : null;
|
|
154
|
+
if (pulledHash === pack.sha256) return true;
|
|
155
|
+
if (folder && readdirSync(dest).length === 0) return false;
|
|
156
|
+
if (pulledHash)
|
|
157
|
+
throw new PullRefused(
|
|
158
|
+
`${dest} holds an older pull of this template; nothing was downloaded. Move it aside and run the pull again to update.`
|
|
159
|
+
);
|
|
160
|
+
throw new PullRefused(
|
|
161
|
+
`${dest} is there but is not this template; nothing was downloaded. Move it aside and run the pull again.`
|
|
162
|
+
);
|
|
163
|
+
}
|
|
135
164
|
var templates_default = defineCommand({
|
|
136
165
|
meta: {
|
|
137
166
|
name: "templates",
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import "./chunk-K4WKGXRC.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveProject
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-7VOLQUA2.js";
|
|
22
22
|
import {
|
|
23
23
|
readCompositionFps
|
|
24
24
|
} from "./chunk-LR5NVYZT.js";
|
|
@@ -46,8 +46,8 @@ import {
|
|
|
46
46
|
readJsonStdinText
|
|
47
47
|
} from "./chunk-EHZESMRB.js";
|
|
48
48
|
import "./chunk-A4ZTSQLW.js";
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-5CDTGHED.js";
|
|
50
|
+
import "./chunk-PO7LSMN5.js";
|
|
51
51
|
import "./chunk-PXVQOMKL.js";
|
|
52
52
|
import "./chunk-MCDNAIFF.js";
|
|
53
53
|
import "./chunk-BVAPHHMQ.js";
|
|
@@ -107,7 +107,7 @@ import "./chunk-FBN2M2HK.js";
|
|
|
107
107
|
import "./chunk-766MOTIZ.js";
|
|
108
108
|
import {
|
|
109
109
|
withMeta
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-NBWYATVA.js";
|
|
111
111
|
import "./chunk-BR2JQQC5.js";
|
|
112
112
|
import "./chunk-BLBMPEBX.js";
|
|
113
113
|
import "./chunk-ISN5GRYI.js";
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
} from "./chunk-66W5IWLO.js";
|
|
120
120
|
import "./chunk-J3RXEDR2.js";
|
|
121
121
|
import "./chunk-QBXDU24O.js";
|
|
122
|
-
import "./chunk-
|
|
122
|
+
import "./chunk-7VGM5TLZ.js";
|
|
123
123
|
import "./chunk-E63BDV4Z.js";
|
|
124
124
|
import "./chunk-G7VEYUZ2.js";
|
|
125
125
|
import "./chunk-XT6MXC7A.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
tokensToVariables,
|
|
12
12
|
upsertBindings,
|
|
13
13
|
withFigmaErrors
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MHZ7NSL5.js";
|
|
15
15
|
import "./chunk-5LOZWO2M.js";
|
|
16
16
|
import {
|
|
17
17
|
defineCommand
|
|
@@ -83,7 +83,7 @@ var tokens_default = defineCommand({
|
|
|
83
83
|
console.log("add to data-composition-variables:");
|
|
84
84
|
console.log(JSON.stringify(result.entries, null, 2));
|
|
85
85
|
}
|
|
86
|
-
const { trackFigmaImport } = await import("./telemetry-
|
|
86
|
+
const { trackFigmaImport } = await import("./telemetry-7TIIOBVB.js");
|
|
87
87
|
trackFigmaImport({
|
|
88
88
|
phase: "tokens",
|
|
89
89
|
tokensMode: result.mode,
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
MIN_TIMEOUT_MS,
|
|
12
12
|
TranscribeError,
|
|
13
13
|
runTranscribe
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NVYVI4FR.js";
|
|
15
15
|
import "./chunk-XTYNW745.js";
|
|
16
16
|
import "./chunk-YTNHZT47.js";
|
|
17
17
|
import "./chunk-NO6F7CLR.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-DKROJ3GJ.js";
|
|
19
|
+
import "./chunk-AHLDGEH5.js";
|
|
20
20
|
import "./chunk-A33GFLPY.js";
|
|
21
21
|
import "./chunk-TSQZ3DSC.js";
|
|
22
22
|
import "./chunk-3XJM7XZN.js";
|
|
@@ -43,8 +43,8 @@ import "./chunk-EHZESMRB.js";
|
|
|
43
43
|
import "./chunk-A4ZTSQLW.js";
|
|
44
44
|
import {
|
|
45
45
|
trackTranscribeUnavailable
|
|
46
|
-
} from "./chunk-
|
|
47
|
-
import "./chunk-
|
|
46
|
+
} from "./chunk-5CDTGHED.js";
|
|
47
|
+
import "./chunk-PO7LSMN5.js";
|
|
48
48
|
import "./chunk-PXVQOMKL.js";
|
|
49
49
|
import "./chunk-MCDNAIFF.js";
|
|
50
50
|
import "./chunk-BVAPHHMQ.js";
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
} from "./chunk-66W5IWLO.js";
|
|
104
104
|
import "./chunk-J3RXEDR2.js";
|
|
105
105
|
import "./chunk-QBXDU24O.js";
|
|
106
|
-
import "./chunk-
|
|
106
|
+
import "./chunk-7VGM5TLZ.js";
|
|
107
107
|
import "./chunk-E63BDV4Z.js";
|
|
108
108
|
import "./chunk-G7VEYUZ2.js";
|
|
109
109
|
import "./chunk-XT6MXC7A.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
updateCheckDue,
|
|
17
17
|
updateNoticesSuppressed,
|
|
18
18
|
withMeta
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NBWYATVA.js";
|
|
20
20
|
import "./chunk-BR2JQQC5.js";
|
|
21
21
|
import "./chunk-BLBMPEBX.js";
|
|
22
22
|
import "./chunk-ISN5GRYI.js";
|
|
@@ -24,7 +24,7 @@ import "./chunk-ADVVQX4I.js";
|
|
|
24
24
|
import "./chunk-66W5IWLO.js";
|
|
25
25
|
import "./chunk-J3RXEDR2.js";
|
|
26
26
|
import "./chunk-QBXDU24O.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-7VGM5TLZ.js";
|
|
28
28
|
import "./chunk-E63BDV4Z.js";
|
|
29
29
|
import "./chunk-G7VEYUZ2.js";
|
|
30
30
|
import "./chunk-XT6MXC7A.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
rewritePinnedHyperframesText,
|
|
28
28
|
rewriteProjectPinnedScripts,
|
|
29
29
|
withMeta
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-NBWYATVA.js";
|
|
31
31
|
import "./chunk-BR2JQQC5.js";
|
|
32
32
|
import "./chunk-BLBMPEBX.js";
|
|
33
33
|
import "./chunk-ISN5GRYI.js";
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
import "./chunk-QBXDU24O.js";
|
|
42
42
|
import {
|
|
43
43
|
VERSION
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-7VGM5TLZ.js";
|
|
45
45
|
import "./chunk-E63BDV4Z.js";
|
|
46
46
|
import "./chunk-G7VEYUZ2.js";
|
|
47
47
|
import "./chunk-XT6MXC7A.js";
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
shouldIgnoreHttpError,
|
|
14
14
|
shouldIgnoreRequestFailure,
|
|
15
15
|
validate_default
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-7VU4RBHC.js";
|
|
17
|
+
import "./chunk-7VOLQUA2.js";
|
|
18
18
|
import "./chunk-6HO6QKYG.js";
|
|
19
19
|
import "./chunk-RXFKSZN2.js";
|
|
20
20
|
import "./chunk-262C25DQ.js";
|
|
@@ -35,8 +35,8 @@ import "./chunk-BHL4KN3H.js";
|
|
|
35
35
|
import "./chunk-5LOZWO2M.js";
|
|
36
36
|
import "./chunk-6UZLHLFP.js";
|
|
37
37
|
import "./chunk-A4ZTSQLW.js";
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-5CDTGHED.js";
|
|
39
|
+
import "./chunk-PO7LSMN5.js";
|
|
40
40
|
import "./chunk-PXVQOMKL.js";
|
|
41
41
|
import "./chunk-MCDNAIFF.js";
|
|
42
42
|
import "./chunk-BVAPHHMQ.js";
|
|
@@ -80,7 +80,7 @@ import "./chunk-EPQC3FGZ.js";
|
|
|
80
80
|
import "./chunk-WC4MTXGN.js";
|
|
81
81
|
import "./chunk-FBN2M2HK.js";
|
|
82
82
|
import "./chunk-766MOTIZ.js";
|
|
83
|
-
import "./chunk-
|
|
83
|
+
import "./chunk-NBWYATVA.js";
|
|
84
84
|
import "./chunk-BR2JQQC5.js";
|
|
85
85
|
import "./chunk-BLBMPEBX.js";
|
|
86
86
|
import "./chunk-ISN5GRYI.js";
|
|
@@ -88,7 +88,7 @@ import "./chunk-ADVVQX4I.js";
|
|
|
88
88
|
import "./chunk-66W5IWLO.js";
|
|
89
89
|
import "./chunk-J3RXEDR2.js";
|
|
90
90
|
import "./chunk-QBXDU24O.js";
|
|
91
|
-
import "./chunk-
|
|
91
|
+
import "./chunk-7VGM5TLZ.js";
|
|
92
92
|
import "./chunk-E63BDV4Z.js";
|
|
93
93
|
import "./chunk-G7VEYUZ2.js";
|
|
94
94
|
import "./chunk-XT6MXC7A.js";
|
package/dist/warmCheck.js
CHANGED
|
@@ -6,19 +6,19 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
prelaunchBrowserForCheck
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3XHWHH5A.js";
|
|
10
10
|
import "./chunk-KUXOAS4Z.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-PYUS627M.js";
|
|
12
|
+
import "./chunk-QBPZHOEJ.js";
|
|
13
|
+
import "./chunk-2WNIF4YT.js";
|
|
14
|
+
import "./chunk-WWPOGMNX.js";
|
|
15
|
+
import "./chunk-2CKL2FUJ.js";
|
|
16
|
+
import "./chunk-YXSM33UC.js";
|
|
17
17
|
import "./chunk-X7MTZ4T2.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-CDSTLOB7.js";
|
|
19
19
|
import "./chunk-TQBQYO4L.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-7VU4RBHC.js";
|
|
21
|
+
import "./chunk-7VOLQUA2.js";
|
|
22
22
|
import "./chunk-BYC4C4YY.js";
|
|
23
23
|
import "./chunk-B5GWDPUO.js";
|
|
24
24
|
import "./chunk-X7MTZ4T2.js";
|
|
@@ -56,8 +56,8 @@ import "./chunk-5LOZWO2M.js";
|
|
|
56
56
|
import "./chunk-6UZLHLFP.js";
|
|
57
57
|
import "./chunk-EHZESMRB.js";
|
|
58
58
|
import "./chunk-A4ZTSQLW.js";
|
|
59
|
-
import "./chunk-
|
|
60
|
-
import "./chunk-
|
|
59
|
+
import "./chunk-5CDTGHED.js";
|
|
60
|
+
import "./chunk-PO7LSMN5.js";
|
|
61
61
|
import "./chunk-PXVQOMKL.js";
|
|
62
62
|
import "./chunk-MCDNAIFF.js";
|
|
63
63
|
import "./chunk-BVAPHHMQ.js";
|
|
@@ -114,7 +114,7 @@ import "./chunk-EPQC3FGZ.js";
|
|
|
114
114
|
import "./chunk-WC4MTXGN.js";
|
|
115
115
|
import "./chunk-FBN2M2HK.js";
|
|
116
116
|
import "./chunk-766MOTIZ.js";
|
|
117
|
-
import "./chunk-
|
|
117
|
+
import "./chunk-NBWYATVA.js";
|
|
118
118
|
import "./chunk-BR2JQQC5.js";
|
|
119
119
|
import "./chunk-BLBMPEBX.js";
|
|
120
120
|
import "./chunk-ISN5GRYI.js";
|
|
@@ -124,7 +124,7 @@ import {
|
|
|
124
124
|
} from "./chunk-66W5IWLO.js";
|
|
125
125
|
import "./chunk-J3RXEDR2.js";
|
|
126
126
|
import "./chunk-QBXDU24O.js";
|
|
127
|
-
import "./chunk-
|
|
127
|
+
import "./chunk-7VGM5TLZ.js";
|
|
128
128
|
import "./chunk-E63BDV4Z.js";
|
|
129
129
|
import "./chunk-G7VEYUZ2.js";
|
|
130
130
|
import "./chunk-XT6MXC7A.js";
|
package/package.json
CHANGED
package/dist/billing-W224NIAM.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
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
|
-
pageUrl,
|
|
9
|
-
readPlan
|
|
10
|
-
} from "./chunk-ASGRVFQ3.js";
|
|
11
|
-
import "./chunk-TSQZ3DSC.js";
|
|
12
|
-
import {
|
|
13
|
-
openBrowser
|
|
14
|
-
} from "./chunk-ETYQYG6Q.js";
|
|
15
|
-
import "./chunk-BVAPHHMQ.js";
|
|
16
|
-
import {
|
|
17
|
-
defineCommand
|
|
18
|
-
} from "./chunk-DL4OD7IA.js";
|
|
19
|
-
import "./chunk-S3S4TGEH.js";
|
|
20
|
-
import {
|
|
21
|
-
c
|
|
22
|
-
} from "./chunk-2GICKZ3I.js";
|
|
23
|
-
import {
|
|
24
|
-
failCommand
|
|
25
|
-
} from "./chunk-66W5IWLO.js";
|
|
26
|
-
import "./chunk-J3RXEDR2.js";
|
|
27
|
-
import "./chunk-E63BDV4Z.js";
|
|
28
|
-
import "./chunk-G7VEYUZ2.js";
|
|
29
|
-
import "./chunk-XT6MXC7A.js";
|
|
30
|
-
import "./chunk-7KDQAD2W.js";
|
|
31
|
-
import "./chunk-M2WBOQ2Q.js";
|
|
32
|
-
|
|
33
|
-
// src/commands/billing.ts
|
|
34
|
-
var describe = (p) => p && p.plan !== "none" ? `${p.plan} plan, ${p.credits.toLocaleString("en-US")} credits` : "Free";
|
|
35
|
-
var billing_default = defineCommand({
|
|
36
|
-
meta: {
|
|
37
|
-
name: "billing",
|
|
38
|
-
description: "Open the HyperFrames plans or credits page and wait until the person is done (subscribe | top-up)"
|
|
39
|
-
},
|
|
40
|
-
args: {
|
|
41
|
-
action: { type: "positional", description: "subscribe | top-up", required: true },
|
|
42
|
-
needed: {
|
|
43
|
-
type: "string",
|
|
44
|
-
description: "Credits the waiting step needs (top-up waits until the balance covers it)"
|
|
45
|
-
},
|
|
46
|
-
tool: { type: "string", description: "The step that is waiting, shown on the page" },
|
|
47
|
-
feature: {
|
|
48
|
-
type: "string",
|
|
49
|
-
description: "The feature that sent the person here, so a purchase is credited to it"
|
|
50
|
-
},
|
|
51
|
-
session: { type: "string", description: "The run to credit the purchase to (with --feature)" },
|
|
52
|
-
timeout: { type: "string", description: "Seconds to wait (default 600)" }
|
|
53
|
-
},
|
|
54
|
-
// fallow-ignore-next-line complexity
|
|
55
|
-
async run({ args }) {
|
|
56
|
-
const action = String(args.action);
|
|
57
|
-
if (action !== "subscribe" && action !== "top-up") {
|
|
58
|
-
console.error(c.error("Use `billing subscribe` or `billing top-up`."));
|
|
59
|
-
failCommand();
|
|
60
|
-
}
|
|
61
|
-
const needed = Number(args.needed) || void 0;
|
|
62
|
-
const before = await readPlan();
|
|
63
|
-
const done = (p) => action === "subscribe" ? !!p && p.plan !== "none" : !!p && p.plan !== "none" && p.credits >= (needed ?? (before?.credits ?? 0) + 1);
|
|
64
|
-
if (done(before) && (action === "subscribe" || needed)) {
|
|
65
|
-
console.log(c.success(`\u2713 Already covered: ${describe(before)}.`));
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const url = pageUrl(action === "subscribe" ? "plans" : "credits", {
|
|
69
|
-
needed,
|
|
70
|
-
tool: args.tool,
|
|
71
|
-
feature: args.feature,
|
|
72
|
-
rs: args.session
|
|
73
|
-
});
|
|
74
|
-
console.log(`${action === "subscribe" ? "Plans" : "Credits"} page: ${c.accent(url)}`);
|
|
75
|
-
await openBrowser(url);
|
|
76
|
-
console.log("Waiting for the person to finish there ...");
|
|
77
|
-
const deadline = Date.now() + (Number(args.timeout) || 600) * 1e3;
|
|
78
|
-
while (Date.now() < deadline) {
|
|
79
|
-
await new Promise((r) => setTimeout(r, 2e3));
|
|
80
|
-
const now = await readPlan();
|
|
81
|
-
if (done(now)) {
|
|
82
|
-
console.log(c.success(`\u2713 Done: ${describe(now)}. Carry on.`));
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
console.error(
|
|
87
|
-
c.error(
|
|
88
|
-
`Still waiting on the ${action === "subscribe" ? "plans" : "credits"} page; run this again once it is done.`
|
|
89
|
-
)
|
|
90
|
-
);
|
|
91
|
-
failCommand();
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
export {
|
|
95
|
-
billing_default as default
|
|
96
|
-
};
|
package/dist/chunk-ASGRVFQ3.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
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
|
-
var UNPAID = /* @__PURE__ */ new Set(["incomplete", "incomplete_expired"]);
|
|
14
|
-
var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
15
|
-
function mockPlan() {
|
|
16
|
-
const raw = process.env["HYPERFRAMES_MOCK_PLAN"]?.trim();
|
|
17
|
-
if (!raw) return null;
|
|
18
|
-
const [plan = "none", credits = "0"] = raw.split(":");
|
|
19
|
-
return { plan, credits: Number(credits) || 0, mock: true };
|
|
20
|
-
}
|
|
21
|
-
var billingBaseUrl = () => resolveCloudBaseUrl().replace("://api.", "://api2.");
|
|
22
|
-
async function readPlan() {
|
|
23
|
-
try {
|
|
24
|
-
const res = await fetch(`${billingBaseUrl()}/v1/payment/hyperframes/subscription`, {
|
|
25
|
-
headers: { ...await resolveCloudAuthHeaders(), accept: "application/json" },
|
|
26
|
-
signal: AbortSignal.timeout(15e3)
|
|
27
|
-
});
|
|
28
|
-
const body = await res.json().catch(() => null);
|
|
29
|
-
const data = isRecord(body) && isRecord(body.data) ? body.data : body;
|
|
30
|
-
if (!res.ok || !isRecord(data)) return mockPlan();
|
|
31
|
-
const usage = isRecord(data.usage) ? data.usage : {};
|
|
32
|
-
const sub = isRecord(data.subscription) ? data.subscription : null;
|
|
33
|
-
const paid = !!sub && !UNPAID.has(String(sub.status));
|
|
34
|
-
return {
|
|
35
|
-
plan: paid ? String(sub.plan_name ?? "paid") : "none",
|
|
36
|
-
credits: Number(usage.remaining_units ?? 0) || 0
|
|
37
|
-
};
|
|
38
|
-
} catch {
|
|
39
|
-
return mockPlan();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
var webBase = () => "https://hyperframes.studio";
|
|
43
|
-
var plansUrl = () => process.env["HYPERFRAMES_PLANS_URL"] || `${webBase()}/pricing`;
|
|
44
|
-
var creditsUrl = () => process.env["HYPERFRAMES_CREDITS_URL"] || `${webBase()}/pricing`;
|
|
45
|
-
function pageUrl(kind, fields = {}) {
|
|
46
|
-
const url = new URL(fields.base ?? (kind === "plans" ? plansUrl() : creditsUrl()));
|
|
47
|
-
url.searchParams.set("from", "cli");
|
|
48
|
-
if (fields.needed) url.searchParams.set("needed_credits", String(fields.needed));
|
|
49
|
-
if (fields.tool) url.searchParams.set("tool", fields.tool);
|
|
50
|
-
if (fields.feature) url.searchParams.set("feature", fields.feature);
|
|
51
|
-
if (fields.rs) url.searchParams.set("rs", fields.rs);
|
|
52
|
-
return url.toString();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export {
|
|
56
|
-
billingBaseUrl,
|
|
57
|
-
readPlan,
|
|
58
|
-
pageUrl
|
|
59
|
-
};
|