deepline 0.3.451 → 0.3.453
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/bundling-sources/sdk/src/client.ts +65 -0
- package/dist/bundling-sources/sdk/src/http.ts +2 -1
- package/dist/bundling-sources/sdk/src/index.ts +2 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +63 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +5 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +49 -11
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +17 -2
- package/dist/cli/{auth-YLBWEMRW.mjs → auth-6CXS55CN.mjs} +4 -4
- package/dist/cli/auth-AICIA232.js +40 -0
- package/dist/cli/{billing-GWG5D3P6.js → billing-QC52XTAD.js} +87 -74
- package/dist/cli/{billing-DUFOEOPT.mjs → billing-SWLTV6PV.mjs} +18 -5
- package/dist/cli/{chunk-37CPEQBE.mjs → chunk-2LDU5BMG.mjs} +3 -3
- package/dist/cli/{chunk-JUCEEIEC.mjs → chunk-43HOSM2F.mjs} +1 -1
- package/dist/cli/{chunk-E7V5CRA2.mjs → chunk-6CTVXF6X.mjs} +8 -8
- package/dist/cli/{chunk-BJOVX7EB.mjs → chunk-7557D4FM.mjs} +2 -2
- package/dist/cli/chunk-BX343KU7.mjs +155 -0
- package/dist/cli/{chunk-7VRWERTM.js → chunk-DMTAFWMS.js} +84 -50
- package/dist/cli/{chunk-XLOXUW5Y.mjs → chunk-FS2RMEJ7.mjs} +1 -1
- package/dist/cli/{chunk-EJ6YI46S.js → chunk-HUDUN4AR.js} +2 -2
- package/dist/cli/{chunk-OKTCLFKM.mjs → chunk-IFBLLSGH.mjs} +5 -5
- package/dist/cli/{chunk-33EM4SMH.mjs → chunk-IWFI6FTJ.mjs} +4 -153
- package/dist/cli/{chunk-ZPV7DMAA.mjs → chunk-IXVABCNA.mjs} +1 -1
- package/dist/cli/{chunk-O3KVUHCG.js → chunk-JOF3B22H.js} +20 -20
- package/dist/cli/{chunk-6TFACCXN.js → chunk-KFKM5J2N.js} +2 -2
- package/dist/cli/{chunk-WLVGRU5A.mjs → chunk-KQD6EFPD.mjs} +2 -2
- package/dist/cli/{chunk-HSKLAPMD.js → chunk-MP35NE55.js} +26 -26
- package/dist/cli/chunk-NOHA3SZJ.js +155 -0
- package/dist/cli/{chunk-Z3DBS4IB.js → chunk-NSQZUUYB.js} +81 -81
- package/dist/cli/{chunk-BQQLTSGC.mjs → chunk-P4UQCYKH.mjs} +4 -4
- package/dist/cli/{chunk-CH2WDSBC.js → chunk-PJWXEUUH.js} +8 -8
- package/dist/cli/{chunk-L2IUGWV5.js → chunk-RG644LJU.js} +1 -1
- package/dist/cli/{chunk-5DUMNKQG.js → chunk-RNCIPLU5.js} +50 -50
- package/dist/cli/{chunk-WDOWAOYB.js → chunk-RTR2KUU6.js} +10 -10
- package/dist/cli/{chunk-4C7HPD57.mjs → chunk-SQUJHT7O.mjs} +1 -1
- package/dist/cli/{chunk-ZNDE2BTH.js → chunk-V6AZQ4JH.js} +16 -16
- package/dist/cli/{chunk-F2DW7DFE.js → chunk-V7S2RUVE.js} +8 -8
- package/dist/cli/{chunk-C4NPWUZY.js → chunk-VG6WESY7.js} +73 -222
- package/dist/cli/{chunk-6G6KX7I7.js → chunk-WTTHH2K3.js} +6 -6
- package/dist/cli/{chunk-JRPNCMMN.js → chunk-WWZ4YJ6J.js} +35 -35
- package/dist/cli/{chunk-PJYTV24I.mjs → chunk-X2LUT22I.mjs} +2 -2
- package/dist/cli/{chunk-YXXIFMXI.mjs → chunk-XH4QC5ZX.mjs} +2 -2
- package/dist/cli/{chunk-3HT47QPJ.mjs → chunk-XNN3OTGT.mjs} +2 -2
- package/dist/cli/{chunk-LPPAJJJN.mjs → chunk-XV4463XW.mjs} +35 -1
- package/dist/cli/{chunk-TFCLUWDQ.js → chunk-YU6IE234.js} +6 -6
- package/dist/cli/{chunk-RFPP4Q66.mjs → chunk-ZVBLECZX.mjs} +3 -3
- package/dist/cli/{csv-RL7WQD6Y.mjs → csv-FON4ZQKC.mjs} +3 -3
- package/dist/cli/{csv-4CHXZQXO.js → csv-WIQB5XWZ.js} +12 -12
- package/dist/cli/{db-ZDBAWV7B.mjs → db-3KA62DOQ.mjs} +4 -4
- package/dist/cli/{db-MRI5IM2A.js → db-VMDDODCN.js} +25 -25
- package/dist/cli/{describe-RRQUUJQ3.mjs → describe-LGDK77QI.mjs} +13 -12
- package/dist/cli/{describe-2FYKXM5B.js → describe-NTAAHCCX.js} +17 -16
- package/dist/cli/describe-core.d.mts +1 -1
- package/dist/cli/describe-core.d.ts +1 -1
- package/dist/cli/{executions-KDBD47A5.js → executions-OT2KNJDO.js} +6 -6
- package/dist/cli/{executions-RJL76TJS.mjs → executions-TM6AMTQ7.mjs} +4 -4
- package/dist/cli/{feedback-2CE24NHD.js → feedback-4HQGY3TO.js} +7 -7
- package/dist/cli/{feedback-KOYLXHYE.mjs → feedback-HWLUVFE2.mjs} +3 -3
- package/dist/cli/git-QIZWO5BA.js +24 -0
- package/dist/cli/{git-RDUHU6L6.mjs → git-TDJVSPE6.mjs} +4 -4
- package/dist/cli/index.js +133 -131
- package/dist/cli/index.mjs +39 -37
- package/dist/cli/{legacy-noops-7FOMGBMN.js → legacy-noops-XH3FDLWT.js} +7 -7
- package/dist/cli/{legacy-noops-4HS2LYP6.mjs → legacy-noops-YB2PES43.mjs} +4 -4
- package/dist/cli/{monitors-IJXNK5BL.js → monitors-E3QFEJKF.js} +276 -124
- package/dist/cli/{monitors-JLBTNBVU.mjs → monitors-KQDDMSDR.mjs} +156 -4
- package/dist/cli/{org-OWP6K4AA.mjs → org-7X2C7YKA.mjs} +4 -4
- package/dist/cli/{org-JL7SW6VY.js → org-PMTLR7VP.js} +66 -66
- package/dist/cli/{play-FNOVKU74.mjs → play-7FNEPSVR.mjs} +11 -10
- package/dist/cli/{play-LLNZWHT6.js → play-RH22Z3D6.js} +284 -283
- package/dist/cli/{providers-WBOEOKE7.mjs → providers-HOEDJNUK.mjs} +4 -4
- package/dist/cli/{providers-E4XIEUC7.js → providers-X5NY5IQH.js} +7 -7
- package/dist/cli/{quickstart-3FUHKGEY.js → quickstart-FI4A6VTV.js} +5 -5
- package/dist/cli/{quickstart-6G5G3BVA.mjs → quickstart-NCL7P2US.mjs} +3 -3
- package/dist/cli/search-6FUMJBIY.js +30 -0
- package/dist/cli/{search-CNMB4Z6M.mjs → search-UHT7ZNPO.mjs} +5 -5
- package/dist/cli/{secrets-5FY5APVK.mjs → secrets-D4ZB5RKB.mjs} +4 -4
- package/dist/cli/{secrets-BDSWOYAT.js → secrets-TT6J3SZJ.js} +13 -13
- package/dist/cli/{sessions-PMIKVPQN.mjs → sessions-HRLJ6SLL.mjs} +4 -4
- package/dist/cli/{sessions-B7T2CHYK.js → sessions-SRQQZMM7.js} +5 -5
- package/dist/cli/{settings-RXQJRRLR.js → settings-EJIKXLC7.js} +76 -75
- package/dist/cli/{settings-4TAYLTPR.mjs → settings-PJJYPWU3.mjs} +9 -8
- package/dist/cli/{setup-ZTMETGSO.js → setup-3FL77Z33.js} +43 -42
- package/dist/cli/{setup-LVUISLVO.mjs → setup-DNI6ENFD.mjs} +8 -7
- package/dist/cli/skills-DEKOSL7F.js +30 -0
- package/dist/cli/{skills-NSJ43Z5Q.mjs → skills-FO7MY2OE.mjs} +6 -5
- package/dist/cli/tools-E6XRW6PW.js +45 -0
- package/dist/cli/{tools-CFCKIGDY.mjs → tools-F72WONN3.mjs} +13 -12
- package/dist/cli/update-6M3CAS4T.js +32 -0
- package/dist/cli/{update-HYOCBXJO.mjs → update-JZU33TC5.mjs} +8 -7
- package/dist/cli/{workflow-U6S4SWTF.js → workflow-BGKC73V2.js} +15 -15
- package/dist/cli/{workflow-RKX45RJ4.mjs → workflow-PQYQXQPH.mjs} +5 -5
- package/dist/{client-CPRaigLC.d.ts → client-D6XhrO0f.d.ts} +26 -1
- package/dist/{client-DstDI5TV.d.mts → client-mRA_esYI.d.mts} +26 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/dist/install-integrity.json +82 -80
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -1
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-WPQBEOES.js +0 -40
- package/dist/cli/git-DZ5GROPH.js +0 -24
- package/dist/cli/search-4ECC773X.js +0 -30
- package/dist/cli/skills-MIENPTOD.js +0 -29
- package/dist/cli/tools-CXJO5XSH.js +0 -44
- package/dist/cli/update-B2LQGEXF.js +0 -31
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkDMTAFWMSjs = require('./chunk-DMTAFWMS.js');
|
|
6
6
|
require('./chunk-E4CABWXL.js');
|
|
7
7
|
require('./chunk-JKVRBCZL.js');
|
|
8
8
|
require('./chunk-KXMNM4AQ.js');
|
|
@@ -13,8 +13,8 @@ require('./chunk-XDVT3GOM.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
require('./chunk-
|
|
16
|
+
var _chunkWTTHH2K3js = require('./chunk-WTTHH2K3.js');
|
|
17
|
+
require('./chunk-RTR2KUU6.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -23,7 +23,7 @@ require('./chunk-XNYIZMNQ.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
var _chunkDIAWYWT5js = require('./chunk-DIAWYWT5.js');
|
|
26
|
-
require('./chunk-
|
|
26
|
+
require('./chunk-RG644LJU.js');
|
|
27
27
|
require('./chunk-OG64RBAC.js');
|
|
28
28
|
require('./chunk-COGTRVWW.js');
|
|
29
29
|
|
|
@@ -72,7 +72,7 @@ function reportBillingFailure(failure, options) {
|
|
|
72
72
|
if (failure.next) {
|
|
73
73
|
textLines.push(`Next: ${failure.next}`);
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
76
76
|
{
|
|
77
77
|
ok: false,
|
|
78
78
|
exitCode: failure.exitCode,
|
|
@@ -93,7 +93,7 @@ function parseTopUpCredits(raw) {
|
|
|
93
93
|
return parsed;
|
|
94
94
|
}
|
|
95
95
|
function topUpIdempotencyKey(raw) {
|
|
96
|
-
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` :
|
|
96
|
+
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` : _chunkDMTAFWMSjs.requireBillingIdempotencyKey.call(void 0, raw);
|
|
97
97
|
}
|
|
98
98
|
function targetBillingIdempotencyKey(raw) {
|
|
99
99
|
return typeof raw === "string" ? raw : `cli_target_billing:${Date.now()}:${_crypto.randomUUID.call(void 0, )}`;
|
|
@@ -200,13 +200,26 @@ function parseSince(raw) {
|
|
|
200
200
|
function humanize(value) {
|
|
201
201
|
return String(value || "").split("_").filter(Boolean).map((token) => _optionalChain([token, 'access', _5 => _5[0], 'optionalAccess', _6 => _6.toUpperCase, 'call', _7 => _7()]) + token.slice(1)).join(" ") || "Unknown";
|
|
202
202
|
}
|
|
203
|
+
var MONITOR_CHARGE_LABELS = {
|
|
204
|
+
provider_execution: "preview",
|
|
205
|
+
webhook_event: "match",
|
|
206
|
+
create: "setup",
|
|
207
|
+
reactivate: "reactivation",
|
|
208
|
+
periodic_renewal: "renewal",
|
|
209
|
+
subscription_renewal: "renewal"
|
|
210
|
+
};
|
|
211
|
+
function usageOperationLabel(operation) {
|
|
212
|
+
const [prefix, phase, , tool] = String(operation || "").split(".");
|
|
213
|
+
const label = phase ? MONITOR_CHARGE_LABELS[phase] : void 0;
|
|
214
|
+
return prefix === "monitor" && label && tool ? `Monitor ${label}: ${humanize(tool)}` : humanize(operation);
|
|
215
|
+
}
|
|
203
216
|
function recentUsageLines(entries) {
|
|
204
217
|
if (entries.length === 0) {
|
|
205
218
|
return ["Recent activity: none yet"];
|
|
206
219
|
}
|
|
207
220
|
const lines = ["Recent activity:"];
|
|
208
221
|
for (const entry of entries) {
|
|
209
|
-
const op = `${humanize(entry.provider)} ${
|
|
222
|
+
const op = `${humanize(entry.provider)} ${usageOperationLabel(entry.operation)}`.trim();
|
|
210
223
|
const roughUsd = Number(entry.rough_usd_cost);
|
|
211
224
|
const credits = entry.credits !== null && entry.credits !== void 0 && String(entry.credits).trim().length > 0 && Number.isFinite(Number(entry.credits)) ? Number(entry.credits) : null;
|
|
212
225
|
const temporaryHold = entry.charge_state === "temporary_hold";
|
|
@@ -299,7 +312,7 @@ function defaultLedgerExportPath() {
|
|
|
299
312
|
);
|
|
300
313
|
}
|
|
301
314
|
async function handleBalance(options) {
|
|
302
|
-
const { http } =
|
|
315
|
+
const { http } = _chunkWTTHH2K3js.getAuthedHttpClient.call(void 0, );
|
|
303
316
|
const payload = await http.get(
|
|
304
317
|
"/api/v2/billing/balance"
|
|
305
318
|
);
|
|
@@ -383,7 +396,7 @@ async function handleBalance(options) {
|
|
|
383
396
|
...options.verbose ? detail : [],
|
|
384
397
|
...lines.slice(1)
|
|
385
398
|
];
|
|
386
|
-
|
|
399
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
387
400
|
{
|
|
388
401
|
...payload,
|
|
389
402
|
...recovery ? { recovery } : {},
|
|
@@ -407,7 +420,7 @@ function quoteShellArgument(value) {
|
|
|
407
420
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
408
421
|
}
|
|
409
422
|
async function handleUsage(options) {
|
|
410
|
-
const { http } =
|
|
423
|
+
const { http } = _chunkWTTHH2K3js.getAuthedHttpClient.call(void 0, );
|
|
411
424
|
const params = new URLSearchParams();
|
|
412
425
|
if (options.requestId !== void 0) {
|
|
413
426
|
const requestId = options.requestId.trim();
|
|
@@ -488,7 +501,7 @@ async function handleUsage(options) {
|
|
|
488
501
|
"No continuation is available for this view. Use deepline billing ledger export all for the full ledger."
|
|
489
502
|
] : []
|
|
490
503
|
];
|
|
491
|
-
|
|
504
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
492
505
|
{
|
|
493
506
|
...payload,
|
|
494
507
|
recent: {
|
|
@@ -502,7 +515,7 @@ async function handleUsage(options) {
|
|
|
502
515
|
);
|
|
503
516
|
}
|
|
504
517
|
async function handleLimit(options) {
|
|
505
|
-
const { http } =
|
|
518
|
+
const { http } = _chunkWTTHH2K3js.getAuthedHttpClient.call(void 0, );
|
|
506
519
|
const payload = await http.get(
|
|
507
520
|
"/api/v2/billing/limit"
|
|
508
521
|
);
|
|
@@ -510,7 +523,7 @@ async function handleLimit(options) {
|
|
|
510
523
|
`Monthly usage cap: ${_nullishCoalesce(payload.monthly_credits_limit, () => ( "(unknown)"))}`,
|
|
511
524
|
"Enforcement: checked before new calls; in-flight work can exceed the cap."
|
|
512
525
|
] : ["Monthly usage cap: off"];
|
|
513
|
-
|
|
526
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
514
527
|
{
|
|
515
528
|
...payload,
|
|
516
529
|
render: { sections: [{ title: "billing limit", lines }] }
|
|
@@ -519,12 +532,12 @@ async function handleLimit(options) {
|
|
|
519
532
|
);
|
|
520
533
|
}
|
|
521
534
|
async function handleSetLimit(credits, options) {
|
|
522
|
-
const { http } =
|
|
535
|
+
const { http } = _chunkWTTHH2K3js.getAuthedHttpClient.call(void 0, );
|
|
523
536
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
524
537
|
method: "PUT",
|
|
525
538
|
body: { monthly_credits_limit: Number.parseInt(credits, 10) }
|
|
526
539
|
});
|
|
527
|
-
|
|
540
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
528
541
|
{
|
|
529
542
|
...payload,
|
|
530
543
|
render: {
|
|
@@ -540,11 +553,11 @@ async function handleSetLimit(credits, options) {
|
|
|
540
553
|
);
|
|
541
554
|
}
|
|
542
555
|
async function handleLimitOff(options) {
|
|
543
|
-
const { http } =
|
|
556
|
+
const { http } = _chunkWTTHH2K3js.getAuthedHttpClient.call(void 0, );
|
|
544
557
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
545
558
|
method: "DELETE"
|
|
546
559
|
});
|
|
547
|
-
|
|
560
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
548
561
|
{
|
|
549
562
|
...payload,
|
|
550
563
|
render: {
|
|
@@ -564,7 +577,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
564
577
|
let initialized = false;
|
|
565
578
|
let pageNumber = 0;
|
|
566
579
|
console.error(`Exporting billing ledger to ${outputPath}`);
|
|
567
|
-
for await (const entries of
|
|
580
|
+
for await (const entries of _chunkDMTAFWMSjs.iterateCursorPages.call(void 0, async (cursor) => {
|
|
568
581
|
pageNumber += 1;
|
|
569
582
|
console.error(
|
|
570
583
|
`Fetching page ${pageNumber}; ${summary.row_count} rows written.`
|
|
@@ -603,7 +616,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
603
616
|
return summary;
|
|
604
617
|
}
|
|
605
618
|
async function handleHistory(options) {
|
|
606
|
-
const { http } =
|
|
619
|
+
const { http } = _chunkWTTHH2K3js.getAuthedHttpClient.call(void 0, );
|
|
607
620
|
const windows = {
|
|
608
621
|
"1d": 86400,
|
|
609
622
|
"1w": 604800,
|
|
@@ -615,10 +628,10 @@ async function handleHistory(options) {
|
|
|
615
628
|
process.cwd(),
|
|
616
629
|
"deepline",
|
|
617
630
|
"data",
|
|
618
|
-
|
|
631
|
+
_chunkWTTHH2K3js.createTimestampedName.call(void 0, `billing-history-${options.time}`, "csv")
|
|
619
632
|
);
|
|
620
633
|
const summary = await exportLedger(http, outputPath, { sinceAt });
|
|
621
|
-
|
|
634
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
622
635
|
{
|
|
623
636
|
output_path: outputPath,
|
|
624
637
|
row_count: summary.row_count,
|
|
@@ -655,14 +668,14 @@ async function handleLedgerExportAll(options) {
|
|
|
655
668
|
);
|
|
656
669
|
return;
|
|
657
670
|
}
|
|
658
|
-
const { http } =
|
|
671
|
+
const { http } = _chunkWTTHH2K3js.getAuthedHttpClient.call(void 0, );
|
|
659
672
|
const outputPath = options.output ? _path.resolve.call(void 0, String(options.output)) : defaultLedgerExportPath();
|
|
660
673
|
const summary = await exportLedger(http, outputPath, {
|
|
661
674
|
sinceAt,
|
|
662
675
|
runId: options.runId,
|
|
663
676
|
operation: options.operation
|
|
664
677
|
});
|
|
665
|
-
|
|
678
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
666
679
|
{
|
|
667
680
|
output_path: outputPath,
|
|
668
681
|
row_count: summary.row_count,
|
|
@@ -701,7 +714,7 @@ function targetPlanLine(plan) {
|
|
|
701
714
|
return `${plan.name} (${plan.sku}) | ${planPriceText(plan.recurring_price_usd, plan.interval)} | ${plan.included_credits} included credits/month | $${plan.purchased_credit_price_usd}/purchased credit | ${plan.acquisition_enabled ? "available" : "unavailable"}`;
|
|
702
715
|
}
|
|
703
716
|
async function handlePlans(options) {
|
|
704
|
-
const client = new (0,
|
|
717
|
+
const client = new (0, _chunkDMTAFWMSjs.DeeplineClient)();
|
|
705
718
|
const payload = await client.billing.targetPlans();
|
|
706
719
|
const listedCurrentPlan = payload.plans.find(
|
|
707
720
|
(plan) => plan.sku === payload.current_plan_sku
|
|
@@ -714,8 +727,8 @@ async function handlePlans(options) {
|
|
|
714
727
|
...payload.plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...payload.plans.map(targetPlanLine)],
|
|
715
728
|
"Change plan: deepline billing change-plan <plan_sku>"
|
|
716
729
|
];
|
|
717
|
-
const legacyPayload =
|
|
718
|
-
|
|
730
|
+
const legacyPayload = _chunkWTTHH2K3js.shouldEmitJson.call(void 0, options.json) ? await client.billing.plans() : null;
|
|
731
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
719
732
|
{
|
|
720
733
|
..._nullishCoalesce(legacyPayload, () => ( payload)),
|
|
721
734
|
...legacyPayload ? { target_billing: payload } : {},
|
|
@@ -725,7 +738,7 @@ async function handlePlans(options) {
|
|
|
725
738
|
);
|
|
726
739
|
}
|
|
727
740
|
async function handleSubscribe(planVersionId, options) {
|
|
728
|
-
const { http } =
|
|
741
|
+
const { http } = _chunkWTTHH2K3js.getAuthedHttpClient.call(void 0, );
|
|
729
742
|
const payload = await http.request(
|
|
730
743
|
"/api/v2/billing/subscription/checkout",
|
|
731
744
|
{
|
|
@@ -734,8 +747,8 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
734
747
|
}
|
|
735
748
|
);
|
|
736
749
|
const url = String(payload.checkout_url || "");
|
|
737
|
-
if (!options.json && options.open !== false && url)
|
|
738
|
-
|
|
750
|
+
if (!options.json && options.open !== false && url) _chunkWTTHH2K3js.openInBrowser.call(void 0, url);
|
|
751
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
739
752
|
{
|
|
740
753
|
...payload,
|
|
741
754
|
render: {
|
|
@@ -751,7 +764,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
751
764
|
);
|
|
752
765
|
}
|
|
753
766
|
async function handleSubscriptionStatus(options) {
|
|
754
|
-
const client = new (0,
|
|
767
|
+
const client = new (0, _chunkDMTAFWMSjs.DeeplineClient)();
|
|
755
768
|
const payload = await client.billing.subscription.status();
|
|
756
769
|
const pools = _nullishCoalesce(payload.credit_pools, () => ( []));
|
|
757
770
|
const lines = [
|
|
@@ -771,7 +784,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
771
784
|
],
|
|
772
785
|
`Assigned by: ${_nullishCoalesce(payload.assigned_by, () => ( "default"))}`
|
|
773
786
|
];
|
|
774
|
-
|
|
787
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
775
788
|
{
|
|
776
789
|
...payload,
|
|
777
790
|
render: { sections: [{ title: "billing subscription", lines }] }
|
|
@@ -780,7 +793,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
780
793
|
);
|
|
781
794
|
}
|
|
782
795
|
async function handleSubscriptionCancel(options) {
|
|
783
|
-
const client = new (0,
|
|
796
|
+
const client = new (0, _chunkDMTAFWMSjs.DeeplineClient)();
|
|
784
797
|
const action = options.undo ? "undo_cancel" : "cancel";
|
|
785
798
|
if (options.dryRun) {
|
|
786
799
|
const status = await client.billing.subscription.status();
|
|
@@ -797,7 +810,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
797
810
|
return;
|
|
798
811
|
}
|
|
799
812
|
const consequence = action === "cancel" ? `Would schedule cancellation at period end${status.current_period_end ? ` (${status.current_period_end})` : ""}. The subscription stays active until then and remaining credits are kept.` : "Would reverse the pending cancellation; the subscription would renew normally.";
|
|
800
|
-
|
|
813
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
801
814
|
{
|
|
802
815
|
ok: true,
|
|
803
816
|
dry_run: true,
|
|
@@ -852,7 +865,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
852
865
|
"Remaining credits are yours to keep \u2014 cancellation never removes credits.",
|
|
853
866
|
"Undo with: deepline billing subscription cancel --undo"
|
|
854
867
|
];
|
|
855
|
-
|
|
868
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
856
869
|
{
|
|
857
870
|
ok: true,
|
|
858
871
|
...result,
|
|
@@ -906,7 +919,7 @@ async function handleInvoices(options) {
|
|
|
906
919
|
return;
|
|
907
920
|
}
|
|
908
921
|
}
|
|
909
|
-
const client = new (0,
|
|
922
|
+
const client = new (0, _chunkDMTAFWMSjs.DeeplineClient)();
|
|
910
923
|
let payload;
|
|
911
924
|
try {
|
|
912
925
|
payload = await client.billing.invoices.list(
|
|
@@ -935,7 +948,7 @@ async function handleInvoices(options) {
|
|
|
935
948
|
url: entry.url
|
|
936
949
|
}))
|
|
937
950
|
} : { ...payload, count: entries.length };
|
|
938
|
-
|
|
951
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
939
952
|
{
|
|
940
953
|
...envelope,
|
|
941
954
|
render: { sections: [{ title: "billing invoices", lines }] }
|
|
@@ -944,7 +957,7 @@ async function handleInvoices(options) {
|
|
|
944
957
|
);
|
|
945
958
|
}
|
|
946
959
|
async function handleCheckout(options) {
|
|
947
|
-
const { http } =
|
|
960
|
+
const { http } = _chunkWTTHH2K3js.getAuthedHttpClient.call(void 0, );
|
|
948
961
|
const payload = await http.post(
|
|
949
962
|
"/api/v2/billing/checkout",
|
|
950
963
|
{
|
|
@@ -954,8 +967,8 @@ async function handleCheckout(options) {
|
|
|
954
967
|
}
|
|
955
968
|
);
|
|
956
969
|
const url = String(payload.url || payload.checkout_url || "");
|
|
957
|
-
if (!options.json && !options.noOpen && url)
|
|
958
|
-
|
|
970
|
+
if (!options.json && !options.noOpen && url) _chunkWTTHH2K3js.openInBrowser.call(void 0, url);
|
|
971
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
959
972
|
{
|
|
960
973
|
...payload,
|
|
961
974
|
render: {
|
|
@@ -1000,7 +1013,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1000
1013
|
return;
|
|
1001
1014
|
}
|
|
1002
1015
|
if (options.dryRun) {
|
|
1003
|
-
|
|
1016
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1004
1017
|
{
|
|
1005
1018
|
ok: true,
|
|
1006
1019
|
dry_run: true,
|
|
@@ -1030,7 +1043,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1030
1043
|
);
|
|
1031
1044
|
return;
|
|
1032
1045
|
}
|
|
1033
|
-
const client = new (0,
|
|
1046
|
+
const client = new (0, _chunkDMTAFWMSjs.DeeplineClient)();
|
|
1034
1047
|
let payload;
|
|
1035
1048
|
try {
|
|
1036
1049
|
payload = await client.billing.topUpWithReceipt({
|
|
@@ -1047,7 +1060,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1047
1060
|
return;
|
|
1048
1061
|
}
|
|
1049
1062
|
if (payload.status === "pending") {
|
|
1050
|
-
|
|
1063
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1051
1064
|
{
|
|
1052
1065
|
ok: true,
|
|
1053
1066
|
...payload,
|
|
@@ -1111,17 +1124,17 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1111
1124
|
]
|
|
1112
1125
|
}
|
|
1113
1126
|
};
|
|
1114
|
-
|
|
1127
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0, options.compact ? compactEnvelope : fullEnvelope, {
|
|
1115
1128
|
json: options.json
|
|
1116
1129
|
});
|
|
1117
1130
|
}
|
|
1118
1131
|
async function handleTargetStatus(options) {
|
|
1119
|
-
const client = new (0,
|
|
1132
|
+
const client = new (0, _chunkDMTAFWMSjs.DeeplineClient)();
|
|
1120
1133
|
const payload = await client.billing.targetStatus();
|
|
1121
1134
|
const balanceCommand = "deepline billing balance";
|
|
1122
1135
|
const recentChargesCommand = "deepline billing usage --limit 5";
|
|
1123
1136
|
const exactChargeCommand = "deepline billing usage --request-id <job_id>";
|
|
1124
|
-
|
|
1137
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1125
1138
|
{
|
|
1126
1139
|
ok: true,
|
|
1127
1140
|
...payload,
|
|
@@ -1151,8 +1164,8 @@ async function handleTargetStatus(options) {
|
|
|
1151
1164
|
);
|
|
1152
1165
|
}
|
|
1153
1166
|
async function handleEntitlements(options) {
|
|
1154
|
-
const payload = await new (0,
|
|
1155
|
-
|
|
1167
|
+
const payload = await new (0, _chunkDMTAFWMSjs.DeeplineClient)().billing.entitlements();
|
|
1168
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1156
1169
|
{
|
|
1157
1170
|
ok: true,
|
|
1158
1171
|
...payload,
|
|
@@ -1180,7 +1193,7 @@ async function handleEntitlements(options) {
|
|
|
1180
1193
|
);
|
|
1181
1194
|
}
|
|
1182
1195
|
async function handleAutoRechargeStatus(options) {
|
|
1183
|
-
const payload = await new (0,
|
|
1196
|
+
const payload = await new (0, _chunkDMTAFWMSjs.DeeplineClient)().billing.autoRecharge.get();
|
|
1184
1197
|
const state = payload.available ? payload.enabled ? "on" : "off" : "unavailable";
|
|
1185
1198
|
const lines = [
|
|
1186
1199
|
`State: ${state}`,
|
|
@@ -1190,7 +1203,7 @@ async function handleAutoRechargeStatus(options) {
|
|
|
1190
1203
|
`Automatic credit purchase cap: ${payload.purchase_limit_credits} credits per rolling 30 days`
|
|
1191
1204
|
] : []
|
|
1192
1205
|
];
|
|
1193
|
-
|
|
1206
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1194
1207
|
{
|
|
1195
1208
|
ok: true,
|
|
1196
1209
|
...payload,
|
|
@@ -1239,7 +1252,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1239
1252
|
}
|
|
1240
1253
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1241
1254
|
if (options.dryRun) {
|
|
1242
|
-
|
|
1255
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1243
1256
|
{
|
|
1244
1257
|
ok: true,
|
|
1245
1258
|
dry_run: true,
|
|
@@ -1260,7 +1273,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1260
1273
|
);
|
|
1261
1274
|
return;
|
|
1262
1275
|
}
|
|
1263
|
-
const payload = await new (0,
|
|
1276
|
+
const payload = await new (0, _chunkDMTAFWMSjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1264
1277
|
enabled: true,
|
|
1265
1278
|
thresholdCredits,
|
|
1266
1279
|
refillToCredits,
|
|
@@ -1268,7 +1281,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1268
1281
|
...rollingLimitCredits !== void 0 ? { purchaseLimitCredits: rollingLimitCredits } : {},
|
|
1269
1282
|
idempotencyKey
|
|
1270
1283
|
});
|
|
1271
|
-
|
|
1284
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1272
1285
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1273
1286
|
{ json: options.json }
|
|
1274
1287
|
);
|
|
@@ -1276,7 +1289,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1276
1289
|
async function handleAutoRechargeOff(options) {
|
|
1277
1290
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1278
1291
|
if (options.dryRun) {
|
|
1279
|
-
|
|
1292
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1280
1293
|
{
|
|
1281
1294
|
ok: true,
|
|
1282
1295
|
dry_run: true,
|
|
@@ -1291,11 +1304,11 @@ async function handleAutoRechargeOff(options) {
|
|
|
1291
1304
|
);
|
|
1292
1305
|
return;
|
|
1293
1306
|
}
|
|
1294
|
-
const payload = await new (0,
|
|
1307
|
+
const payload = await new (0, _chunkDMTAFWMSjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1295
1308
|
enabled: false,
|
|
1296
1309
|
idempotencyKey
|
|
1297
1310
|
});
|
|
1298
|
-
|
|
1311
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1299
1312
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1300
1313
|
{ json: options.json }
|
|
1301
1314
|
);
|
|
@@ -1314,11 +1327,11 @@ async function handleBuyCredits(creditsRaw, options) {
|
|
|
1314
1327
|
return;
|
|
1315
1328
|
}
|
|
1316
1329
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1317
|
-
const payload = await new (0,
|
|
1330
|
+
const payload = await new (0, _chunkDMTAFWMSjs.DeeplineClient)().billing.purchaseCredits({
|
|
1318
1331
|
credits,
|
|
1319
1332
|
idempotencyKey
|
|
1320
1333
|
});
|
|
1321
|
-
|
|
1334
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1322
1335
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1323
1336
|
{ json: options.json }
|
|
1324
1337
|
);
|
|
@@ -1354,7 +1367,7 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1354
1367
|
return;
|
|
1355
1368
|
}
|
|
1356
1369
|
if (options.dryRun) {
|
|
1357
|
-
|
|
1370
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1358
1371
|
{
|
|
1359
1372
|
ok: true,
|
|
1360
1373
|
dry_run: true,
|
|
@@ -1367,12 +1380,12 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1367
1380
|
);
|
|
1368
1381
|
return;
|
|
1369
1382
|
}
|
|
1370
|
-
const payload = await new (0,
|
|
1383
|
+
const payload = await new (0, _chunkDMTAFWMSjs.DeeplineClient)().billing.recoverCreditPurchase({
|
|
1371
1384
|
credits,
|
|
1372
1385
|
orgId: options.orgId,
|
|
1373
1386
|
idempotencyKey: options.idempotencyKey
|
|
1374
1387
|
});
|
|
1375
|
-
|
|
1388
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1376
1389
|
{ ok: true, idempotency_key: options.idempotencyKey, ...payload },
|
|
1377
1390
|
{ json: options.json }
|
|
1378
1391
|
);
|
|
@@ -1392,37 +1405,37 @@ async function handleTargetPlan(planSku, options) {
|
|
|
1392
1405
|
return;
|
|
1393
1406
|
}
|
|
1394
1407
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1395
|
-
const payload = await new (0,
|
|
1408
|
+
const payload = await new (0, _chunkDMTAFWMSjs.DeeplineClient)().billing.transitionPlan({
|
|
1396
1409
|
action: "start_or_change",
|
|
1397
1410
|
targetPlanSku: planSku,
|
|
1398
1411
|
...options.billingEmail ? { billingEmail: options.billingEmail } : {},
|
|
1399
1412
|
idempotencyKey
|
|
1400
1413
|
});
|
|
1401
|
-
|
|
1414
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1402
1415
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1403
1416
|
{ json: options.json }
|
|
1404
1417
|
);
|
|
1405
1418
|
}
|
|
1406
1419
|
async function handleTargetPlanCancellation(options) {
|
|
1407
1420
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1408
|
-
const payload = await new (0,
|
|
1421
|
+
const payload = await new (0, _chunkDMTAFWMSjs.DeeplineClient)().billing.transitionPlan({
|
|
1409
1422
|
action: options.undo ? "undo_cancel" : "cancel",
|
|
1410
1423
|
idempotencyKey
|
|
1411
1424
|
});
|
|
1412
|
-
|
|
1425
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1413
1426
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1414
1427
|
{ json: options.json }
|
|
1415
1428
|
);
|
|
1416
1429
|
}
|
|
1417
1430
|
async function handleTargetPortal(options) {
|
|
1418
|
-
const payload = await new (0,
|
|
1431
|
+
const payload = await new (0, _chunkDMTAFWMSjs.DeeplineClient)().billing.portalSession(
|
|
1419
1432
|
options.billingAddress ? { flow: "customer_update" } : void 0
|
|
1420
1433
|
);
|
|
1421
|
-
if (!options.json && !options.noOpen)
|
|
1422
|
-
|
|
1434
|
+
if (!options.json && !options.noOpen) _chunkWTTHH2K3js.openInBrowser.call(void 0, payload.url);
|
|
1435
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1423
1436
|
}
|
|
1424
1437
|
async function handleRedeemCode(code, options) {
|
|
1425
|
-
const { http } =
|
|
1438
|
+
const { http } = _chunkWTTHH2K3js.getAuthedHttpClient.call(void 0, );
|
|
1426
1439
|
const payload = await http.post(
|
|
1427
1440
|
"/api/v2/billing/checkout",
|
|
1428
1441
|
{
|
|
@@ -1430,8 +1443,8 @@ async function handleRedeemCode(code, options) {
|
|
|
1430
1443
|
}
|
|
1431
1444
|
);
|
|
1432
1445
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1433
|
-
if (!options.json && !options.noOpen && url)
|
|
1434
|
-
|
|
1446
|
+
if (!options.json && !options.noOpen && url) _chunkWTTHH2K3js.openInBrowser.call(void 0, url);
|
|
1447
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0,
|
|
1435
1448
|
{
|
|
1436
1449
|
...payload,
|
|
1437
1450
|
render: {
|
|
@@ -1489,14 +1502,14 @@ Examples:
|
|
|
1489
1502
|
if (!Number.isSafeInteger(quantity) || quantity <= 0) {
|
|
1490
1503
|
throw new Error("--quantity must be a positive safe integer.");
|
|
1491
1504
|
}
|
|
1492
|
-
const quote = await new (0,
|
|
1505
|
+
const quote = await new (0, _chunkDMTAFWMSjs.DeeplineClient)().billing.quote({
|
|
1493
1506
|
quantity,
|
|
1494
1507
|
sandbox_runtime: {
|
|
1495
1508
|
timeout: options.sandboxTimeout,
|
|
1496
1509
|
size: "standard"
|
|
1497
1510
|
}
|
|
1498
1511
|
});
|
|
1499
|
-
|
|
1512
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0, quote, {
|
|
1500
1513
|
json: options.json,
|
|
1501
1514
|
text: `Sandbox session ceiling: ${quote.maximum_credits} Deepline credits (${quote.quantity} session${quote.quantity === 1 ? "" : "s"}).
|
|
1502
1515
|
${quote.explanation}
|
|
@@ -1726,8 +1739,8 @@ Examples:
|
|
|
1726
1739
|
new (0, _commander.Command)("trigger").description(
|
|
1727
1740
|
"Evaluate capped automatic recharge and resume any pending purchase."
|
|
1728
1741
|
).option("--json", "Emit JSON output").action(async (options) => {
|
|
1729
|
-
const result = await new (0,
|
|
1730
|
-
|
|
1742
|
+
const result = await new (0, _chunkDMTAFWMSjs.DeeplineClient)().billing.autoRecharge.trigger();
|
|
1743
|
+
_chunkWTTHH2K3js.printCommandEnvelope.call(void 0, { ok: true, ...result }, { json: options.json });
|
|
1731
1744
|
})
|
|
1732
1745
|
);
|
|
1733
1746
|
billing.command("change-plan").description("Start or change the target billing plan.").argument("<plan_sku>", "payg-v1, builder-v1, growth-v1, or team-v1").option(
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DeeplineClient,
|
|
3
3
|
iterateCursorPages,
|
|
4
4
|
requireBillingIdempotencyKey
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XV4463XW.mjs";
|
|
6
6
|
import "./chunk-L2VKAASU.mjs";
|
|
7
7
|
import "./chunk-FAG4DFUC.mjs";
|
|
8
8
|
import "./chunk-EIMG75BT.mjs";
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
openInBrowser,
|
|
14
14
|
printCommandEnvelope,
|
|
15
15
|
shouldEmitJson
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-FS2RMEJ7.mjs";
|
|
17
|
+
import "./chunk-X2LUT22I.mjs";
|
|
18
18
|
import {
|
|
19
19
|
AuthError,
|
|
20
20
|
ConfigError
|
|
@@ -23,7 +23,7 @@ import "./chunk-DLIRSHV6.mjs";
|
|
|
23
23
|
import {
|
|
24
24
|
DeeplineError
|
|
25
25
|
} from "./chunk-HBL4PM5Q.mjs";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-IXVABCNA.mjs";
|
|
27
27
|
import "./chunk-WZYKRD7T.mjs";
|
|
28
28
|
import "./chunk-KRD6H754.mjs";
|
|
29
29
|
|
|
@@ -200,13 +200,26 @@ function parseSince(raw) {
|
|
|
200
200
|
function humanize(value) {
|
|
201
201
|
return String(value || "").split("_").filter(Boolean).map((token) => token[0]?.toUpperCase() + token.slice(1)).join(" ") || "Unknown";
|
|
202
202
|
}
|
|
203
|
+
var MONITOR_CHARGE_LABELS = {
|
|
204
|
+
provider_execution: "preview",
|
|
205
|
+
webhook_event: "match",
|
|
206
|
+
create: "setup",
|
|
207
|
+
reactivate: "reactivation",
|
|
208
|
+
periodic_renewal: "renewal",
|
|
209
|
+
subscription_renewal: "renewal"
|
|
210
|
+
};
|
|
211
|
+
function usageOperationLabel(operation) {
|
|
212
|
+
const [prefix, phase, , tool] = String(operation || "").split(".");
|
|
213
|
+
const label = phase ? MONITOR_CHARGE_LABELS[phase] : void 0;
|
|
214
|
+
return prefix === "monitor" && label && tool ? `Monitor ${label}: ${humanize(tool)}` : humanize(operation);
|
|
215
|
+
}
|
|
203
216
|
function recentUsageLines(entries) {
|
|
204
217
|
if (entries.length === 0) {
|
|
205
218
|
return ["Recent activity: none yet"];
|
|
206
219
|
}
|
|
207
220
|
const lines = ["Recent activity:"];
|
|
208
221
|
for (const entry of entries) {
|
|
209
|
-
const op = `${humanize(entry.provider)} ${
|
|
222
|
+
const op = `${humanize(entry.provider)} ${usageOperationLabel(entry.operation)}`.trim();
|
|
210
223
|
const roughUsd = Number(entry.rough_usd_cost);
|
|
211
224
|
const credits = entry.credits !== null && entry.credits !== void 0 && String(entry.credits).trim().length > 0 && Number.isFinite(Number(entry.credits)) ? Number(entry.credits) : null;
|
|
212
225
|
const temporaryHold = entry.charge_state === "temporary_hold";
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
skillsInstallLeasePath,
|
|
12
12
|
skillsSourceUrl,
|
|
13
13
|
syncSdkSkillsIfNeeded
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IWFI6FTJ.mjs";
|
|
15
15
|
import {
|
|
16
16
|
printCommandEnvelope
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FS2RMEJ7.mjs";
|
|
18
18
|
import {
|
|
19
19
|
SDK_VERSION,
|
|
20
20
|
autoDetectBaseUrl,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
ensureProjectPrivatePathsIgnored,
|
|
23
23
|
resolveProjectPinTarget,
|
|
24
24
|
sdkCliStateDirPath
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-X2LUT22I.mjs";
|
|
26
26
|
|
|
27
27
|
// src/cli/commands/skills.ts
|
|
28
28
|
import { spawn } from "child_process";
|