deepline 0.3.539 → 0.3.540
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/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +8 -4
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-execution-queries.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +20 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +30 -11
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +1 -1
- package/dist/cli/{auth-QD7QGD3B.mjs → auth-32TURPHH.mjs} +5 -5
- package/dist/cli/auth-XA3K5LH2.js +43 -0
- package/dist/cli/{billing-KOQAF6WS.js → billing-6433M4BX.js} +105 -94
- package/dist/cli/{billing-FIZXMHBW.mjs → billing-NSH3NOHV.mjs} +21 -10
- package/dist/cli/{chunk-FH3P3E4S.js → chunk-2U4VACUA.js} +2 -2
- package/dist/cli/{chunk-GLKUC5PO.mjs → chunk-37VFUQMU.mjs} +2 -2
- package/dist/cli/chunk-3GVIVIER.js +54 -0
- package/dist/cli/{chunk-55ITVU2V.mjs → chunk-AB6DFHGL.mjs} +2 -2
- package/dist/cli/{chunk-V7DEGIYO.js → chunk-AJVK4XC5.js} +4 -4
- package/dist/cli/{chunk-K5MZHTK7.js → chunk-AOYW62XO.js} +3 -3
- package/dist/cli/{chunk-GEO2EMM7.mjs → chunk-B6UZUQ2O.mjs} +1 -1
- package/dist/cli/{chunk-JHEZQMOM.mjs → chunk-BD3VAPB4.mjs} +1 -1
- package/dist/cli/{chunk-XZBXQCRJ.js → chunk-BGBRA2S6.js} +22 -22
- package/dist/cli/{chunk-EAZS52DL.js → chunk-BNNGM2E5.js} +15 -15
- package/dist/cli/{chunk-6NZBLFL4.mjs → chunk-BZVVSUE2.mjs} +1 -1
- package/dist/cli/{chunk-TZBCJHV6.js → chunk-DV3ESQ4X.js} +1 -1
- package/dist/cli/{chunk-FIRV7BXJ.mjs → chunk-DWE2VE5I.mjs} +1 -1
- package/dist/cli/{chunk-KQTX545E.js → chunk-EXAXDEIF.js} +13 -13
- package/dist/cli/chunk-FANIRW74.mjs +9 -0
- package/dist/cli/{chunk-F43MXIN3.mjs → chunk-FR3AII3W.mjs} +2 -2
- package/dist/cli/chunk-GWHA4DAC.js +9 -0
- package/dist/cli/{chunk-FSQCB5SJ.js → chunk-H6IA6XRE.js} +2 -2
- package/dist/cli/{chunk-K22EKW6L.js → chunk-HKWJD45V.js} +5 -5
- package/dist/cli/{chunk-APKZGUTU.mjs → chunk-HLHDCFKL.mjs} +4 -4
- package/dist/cli/{chunk-E7D37PLM.mjs → chunk-IDDKNMFX.mjs} +36 -0
- package/dist/cli/{chunk-RULRGMMM.mjs → chunk-IYQZVEV4.mjs} +5 -5
- package/dist/cli/{chunk-5RUB53KG.js → chunk-J3TAEPFA.js} +26 -26
- package/dist/cli/{chunk-GNCIMHO2.mjs → chunk-JGFGWWOF.mjs} +10 -10
- package/dist/cli/{chunk-Y66ZMOJI.mjs → chunk-JPU5YLQG.mjs} +1 -1
- package/dist/cli/{chunk-JBCQFG7G.mjs → chunk-KFAJYK2N.mjs} +3 -3
- package/dist/cli/chunk-KN6ELDPL.mjs +54 -0
- package/dist/cli/{chunk-NR5PLMNG.js → chunk-LPMI4CYW.js} +107 -107
- package/dist/cli/{chunk-YMQFQO3K.js → chunk-LXLCQP4A.js} +16 -16
- package/dist/cli/{chunk-KAEVL62Q.js → chunk-M4DB6BBP.js} +44 -44
- package/dist/cli/{chunk-GLEGINSP.mjs → chunk-MH22LQKZ.mjs} +2 -2
- package/dist/cli/{chunk-MI53W4DN.js → chunk-MLDLN6WG.js} +53 -53
- package/dist/cli/{chunk-ISXX5DUD.js → chunk-MVIVF4BW.js} +3 -3
- package/dist/cli/{chunk-3YDI2PTN.js → chunk-N6DMKVKO.js} +10 -10
- package/dist/cli/{chunk-ADV2IB2C.mjs → chunk-PJOMRUFP.mjs} +5 -5
- package/dist/cli/{chunk-6V3LNYK5.mjs → chunk-S3ULSGFH.mjs} +2 -2
- package/dist/cli/{chunk-2XMFT44N.mjs → chunk-SGMDRYAD.mjs} +1 -1
- package/dist/cli/{chunk-MKESK3SW.mjs → chunk-SINNEITW.mjs} +4 -4
- package/dist/cli/{chunk-LE5KN7CZ.mjs → chunk-SXVYFOBG.mjs} +3 -3
- package/dist/cli/{chunk-FTBWFDF3.js → chunk-TNUM4DFA.js} +7 -7
- package/dist/cli/{chunk-E4QHTDPF.mjs → chunk-TZVW5JH3.mjs} +1 -1
- package/dist/cli/{chunk-W32KT6LM.js → chunk-UJYX4VLX.js} +5 -5
- package/dist/cli/{chunk-XTYHZEJ2.js → chunk-V4EYJKGJ.js} +36 -0
- package/dist/cli/{chunk-LEREPTAE.js → chunk-VAOGM5VS.js} +19 -19
- package/dist/cli/{chunk-6KG4KVTH.mjs → chunk-WCM64BRH.mjs} +5 -5
- package/dist/cli/{chunk-CQJCLHBE.js → chunk-WDHHQEWQ.js} +41 -41
- package/dist/cli/{chunk-5YF35HAV.js → chunk-WHYNYL3M.js} +6 -6
- package/dist/cli/{chunk-Q4HNK7JX.js → chunk-XIIQNSWA.js} +8 -8
- package/dist/cli/{chunk-VK5UTS5B.js → chunk-XL3CEPZA.js} +9 -9
- package/dist/cli/{chunk-G3UFDUYU.mjs → chunk-XYM3SQZN.mjs} +1 -1
- package/dist/cli/{chunk-SDAP5MCO.mjs → chunk-Y6647AIY.mjs} +2 -2
- package/dist/cli/{chunk-N3LPGGWD.mjs → chunk-Z2OYTXLK.mjs} +1 -1
- package/dist/cli/{chunk-DZFVVP3S.mjs → chunk-ZJFU2COM.mjs} +5 -5
- package/dist/cli/{chunk-5QL4GJB2.js → chunk-ZTJQKHLM.js} +2 -2
- package/dist/cli/command-docs.js +3 -2
- package/dist/cli/command-docs.mjs +2 -1
- package/dist/cli/concurrent-runs-help-DU5STFGB.mjs +21 -0
- package/dist/cli/concurrent-runs-help-HIPM5BBV.js +21 -0
- package/dist/cli/{csv-BWWJYV2C.js → csv-FBNS6SM3.js} +13 -13
- package/dist/cli/{csv-G5RQQ74W.mjs → csv-OJCMBODT.mjs} +4 -4
- package/dist/cli/{db-AJZHWB3V.mjs → db-43RQRF64.mjs} +6 -6
- package/dist/cli/{db-5KNDLADE.js → db-XRGJJ2KA.js} +27 -27
- package/dist/cli/{describe-QY5TKWVD.mjs → describe-I42Y3PWR.mjs} +17 -17
- package/dist/cli/describe-LWZCGAXU.js +49 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/{executions-BCCW76BI.js → executions-LH46O4PG.js} +8 -8
- package/dist/cli/{executions-SJPH3MZT.mjs → executions-QXGVQHQF.mjs} +6 -6
- package/dist/cli/{feedback-S6SZOFGK.mjs → feedback-ELFINGTM.mjs} +6 -6
- package/dist/cli/{feedback-GF65JKK6.js → feedback-ERYIV6MT.js} +14 -14
- package/dist/cli/git-OV2TGYVE.js +25 -0
- package/dist/cli/{git-F5FT5YVB.mjs → git-V2XWB6LN.mjs} +5 -5
- package/dist/cli/index.js +153 -143
- package/dist/cli/index.mjs +53 -43
- package/dist/cli/{legacy-noops-NOA4P5NE.mjs → legacy-noops-ULL2EA37.mjs} +6 -6
- package/dist/cli/{legacy-noops-ECR6FS6U.js → legacy-noops-Y3OKNVWH.js} +9 -9
- package/dist/cli/{monitors-DEWBSURN.js → monitors-DNQXCRJZ.js} +100 -100
- package/dist/cli/{monitors-CTYSAGP4.mjs → monitors-L34NROM3.mjs} +7 -7
- package/dist/cli/{org-ZM2UUMZZ.js → org-JETA62CO.js} +86 -86
- package/dist/cli/{org-EKSKKT7H.mjs → org-L3HTEEXL.mjs} +6 -6
- package/dist/cli/{play-6JQOM6DE.js → play-GTGJRNWI.js} +473 -455
- package/dist/cli/{play-R2BH374J.mjs → play-JHGLSSJP.mjs} +35 -17
- package/dist/cli/{providers-CMIYHEMN.js → providers-7VH7PH2Q.js} +9 -9
- package/dist/cli/{providers-X7WMIWO4.mjs → providers-IQVHZJ27.mjs} +6 -6
- package/dist/cli/{quickstart-6HVPAMSW.js → quickstart-M25JNU3O.js} +6 -6
- package/dist/cli/{quickstart-ZZ7L6VZJ.mjs → quickstart-ZDBC45PM.mjs} +4 -4
- package/dist/cli/{run-OOHYH3GI.js → run-MPZGX3YD.js} +42 -42
- package/dist/cli/{run-FP32RKBU.mjs → run-NEEWZBTX.mjs} +22 -22
- package/dist/cli/search-HUN2YRQE.js +32 -0
- package/dist/cli/{search-BDDNC23Z.mjs → search-YXAFB4QQ.mjs} +7 -7
- package/dist/cli/{search-output-5VZIQQAM.js → search-output-4PH5HSJC.js} +6 -6
- package/dist/cli/{search-output-QXJ6CV5G.mjs → search-output-67BBIXIZ.mjs} +4 -4
- package/dist/cli/{secrets-Z7CQSQGC.mjs → secrets-445FER3C.mjs} +6 -6
- package/dist/cli/{secrets-EN2HQCO3.js → secrets-HLUBDN3H.js} +15 -15
- package/dist/cli/{sessions-I2H37OTJ.mjs → sessions-CCKXJNWT.mjs} +6 -6
- package/dist/cli/sessions-T2RNWC6B.js +22 -0
- package/dist/cli/{settings-IYSC5PPQ.mjs → settings-3XCZGGVF.mjs} +12 -12
- package/dist/cli/{settings-CTRAPFNZ.js → settings-WXJIQS5J.js} +85 -85
- package/dist/cli/{setup-XIN53GEW.js → setup-CKETRFFN.js} +49 -49
- package/dist/cli/{setup-PU3HOVI3.mjs → setup-TOSX6NER.mjs} +9 -9
- package/dist/cli/skills-FXM2RHHO.js +36 -0
- package/dist/cli/{skills-TYBML2ZO.mjs → skills-Q7NLCIJJ.mjs} +7 -7
- package/dist/cli/{tools-ZVNE6M6J.mjs → tools-GY6QMYTZ.mjs} +16 -16
- package/dist/cli/tools-XLVDZTWQ.js +56 -0
- package/dist/cli/{update-54WENBNT.mjs → update-A7JRUN4S.mjs} +9 -9
- package/dist/cli/update-AZINHILP.js +34 -0
- package/dist/cli/{views-7L75EZOJ.js → views-GUWC4SNI.js} +21 -21
- package/dist/cli/{views-EUBB4ONT.mjs → views-JG7FDEJR.mjs} +6 -6
- package/dist/cli/{workflow-EZVYCR6Y.js → workflow-CXNW7ICH.js} +17 -17
- package/dist/cli/{workflow-GUKGFJ72.mjs → workflow-QZCYSQ5G.mjs} +7 -7
- package/dist/{client-DZTnAv4B.d.ts → client-B1fixtK1.d.ts} +1 -1
- package/dist/{client-D0uDBybG.d.mts → client-CE4QBVbp.d.mts} +1 -1
- package/dist/{client-core-BhWf8Y1b.d.mts → client-core-2BkNBgrx.d.mts} +3 -1
- package/dist/{client-core-og3AP1LL.d.ts → client-core-C-3FVlVq.d.ts} +3 -1
- package/dist/{compiler-manifest-Bes3OVA3.d.ts → compiler-manifest-Cys06iYg.d.mts} +14 -0
- package/dist/{compiler-manifest-Bes3OVA3.d.mts → compiler-manifest-Cys06iYg.d.ts} +14 -0
- package/dist/{errors-Dc5r42ks.d.mts → errors-B6eMjKcr.d.mts} +1 -1
- package/dist/{errors-BJm4lLWc.d.ts → errors-rdOUqcU2.d.ts} +1 -1
- package/dist/{index-DTkiz_Ur.d.mts → index-CZdYO81A.d.mts} +1 -1
- package/dist/{index-BfV7mRPF.d.ts → index-ejWadAL5.d.ts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +118 -112
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +1 -1
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- 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/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-O5Y2VYXK.js +0 -43
- package/dist/cli/describe-B6CN6CFJ.js +0 -49
- package/dist/cli/git-DX6NB7VF.js +0 -25
- package/dist/cli/search-34C6LFOJ.js +0 -32
- package/dist/cli/sessions-RYQX3NDD.js +0 -22
- package/dist/cli/skills-576CX7DK.js +0 -36
- package/dist/cli/tools-EXMUWA3Z.js +0 -56
- package/dist/cli/update-RAHETNL2.js +0 -34
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3GVIVIERjs = require('./chunk-3GVIVIER.js');
|
|
4
|
+
require('./chunk-MLDLN6WG.js');
|
|
4
5
|
|
|
5
6
|
|
|
7
|
+
var _chunkUJYX4VLXjs = require('./chunk-UJYX4VLX.js');
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunkXIIQNSWAjs = require('./chunk-XIIQNSWA.js');
|
|
8
12
|
require('./chunk-E4CABWXL.js');
|
|
9
13
|
require('./chunk-CQDQNZGH.js');
|
|
10
14
|
require('./chunk-PMH4GLMD.js');
|
|
11
15
|
require('./chunk-XDVT3GOM.js');
|
|
12
16
|
|
|
13
17
|
|
|
14
|
-
var
|
|
18
|
+
var _chunkV4EYJKGJjs = require('./chunk-V4EYJKGJ.js');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var _chunkGWHA4DACjs = require('./chunk-GWHA4DAC.js');
|
|
15
22
|
require('./chunk-R7J7CJPZ.js');
|
|
16
23
|
|
|
17
24
|
|
|
@@ -22,9 +29,9 @@ var _chunkYGCKMI5Pjs = require('./chunk-YGCKMI5P.js');
|
|
|
22
29
|
|
|
23
30
|
|
|
24
31
|
|
|
25
|
-
var
|
|
26
|
-
require('./chunk-
|
|
27
|
-
require('./chunk-
|
|
32
|
+
var _chunkVAOGM5VSjs = require('./chunk-VAOGM5VS.js');
|
|
33
|
+
require('./chunk-MVIVF4BW.js');
|
|
34
|
+
require('./chunk-AJVK4XC5.js');
|
|
28
35
|
|
|
29
36
|
|
|
30
37
|
|
|
@@ -33,7 +40,7 @@ require('./chunk-XNYIZMNQ.js');
|
|
|
33
40
|
|
|
34
41
|
|
|
35
42
|
var _chunkBBTKAASQjs = require('./chunk-BBTKAASQ.js');
|
|
36
|
-
require('./chunk-
|
|
43
|
+
require('./chunk-DV3ESQ4X.js');
|
|
37
44
|
require('./chunk-OG64RBAC.js');
|
|
38
45
|
require('./chunk-COGTRVWW.js');
|
|
39
46
|
|
|
@@ -82,7 +89,7 @@ function reportBillingFailure(failure, options) {
|
|
|
82
89
|
if (failure.next) {
|
|
83
90
|
textLines.push(`Next: ${failure.next}`);
|
|
84
91
|
}
|
|
85
|
-
|
|
92
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
86
93
|
{
|
|
87
94
|
ok: false,
|
|
88
95
|
exitCode: failure.exitCode,
|
|
@@ -103,7 +110,7 @@ function parseTopUpCredits(raw) {
|
|
|
103
110
|
return parsed;
|
|
104
111
|
}
|
|
105
112
|
function topUpIdempotencyKey(raw) {
|
|
106
|
-
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` :
|
|
113
|
+
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` : _chunkXIIQNSWAjs.requireBillingIdempotencyKey.call(void 0, raw);
|
|
107
114
|
}
|
|
108
115
|
function targetBillingIdempotencyKey(raw) {
|
|
109
116
|
return typeof raw === "string" ? raw : `cli_target_billing:${Date.now()}:${_crypto.randomUUID.call(void 0, )}`;
|
|
@@ -322,7 +329,7 @@ function defaultLedgerExportPath() {
|
|
|
322
329
|
);
|
|
323
330
|
}
|
|
324
331
|
async function handleBalance(options) {
|
|
325
|
-
const { http } =
|
|
332
|
+
const { http } = _chunkVAOGM5VSjs.getAuthedHttpClient.call(void 0, );
|
|
326
333
|
const payload = await http.get(
|
|
327
334
|
"/api/v2/billing/balance"
|
|
328
335
|
);
|
|
@@ -406,7 +413,7 @@ async function handleBalance(options) {
|
|
|
406
413
|
...options.verbose ? detail : [],
|
|
407
414
|
...lines.slice(1)
|
|
408
415
|
];
|
|
409
|
-
|
|
416
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
410
417
|
{
|
|
411
418
|
...payload,
|
|
412
419
|
...recovery ? { recovery } : {},
|
|
@@ -442,7 +449,7 @@ async function handleUsageEvents(options) {
|
|
|
442
449
|
);
|
|
443
450
|
return;
|
|
444
451
|
}
|
|
445
|
-
const client = new (0,
|
|
452
|
+
const client = new (0, _chunkUJYX4VLXjs.DeeplineClient)();
|
|
446
453
|
let payload;
|
|
447
454
|
try {
|
|
448
455
|
payload = await client.billing.usageEvents({
|
|
@@ -473,7 +480,7 @@ async function handleUsageEvents(options) {
|
|
|
473
480
|
),
|
|
474
481
|
...nextPage ? [`Next page: ${nextPage}`] : []
|
|
475
482
|
];
|
|
476
|
-
|
|
483
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
477
484
|
{
|
|
478
485
|
...payload,
|
|
479
486
|
next: { page: nextPage },
|
|
@@ -495,7 +502,7 @@ async function handleUsage(options) {
|
|
|
495
502
|
return;
|
|
496
503
|
}
|
|
497
504
|
if (options.events) return handleUsageEvents(options);
|
|
498
|
-
const { http } =
|
|
505
|
+
const { http } = _chunkVAOGM5VSjs.getAuthedHttpClient.call(void 0, );
|
|
499
506
|
const params = new URLSearchParams();
|
|
500
507
|
if (options.requestId !== void 0) {
|
|
501
508
|
const requestId = options.requestId.trim();
|
|
@@ -579,7 +586,7 @@ async function handleUsage(options) {
|
|
|
579
586
|
"No continuation is available for this view. Use deepline billing ledger export all for the full ledger."
|
|
580
587
|
] : []
|
|
581
588
|
];
|
|
582
|
-
|
|
589
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
583
590
|
{
|
|
584
591
|
...payload,
|
|
585
592
|
recent: {
|
|
@@ -593,7 +600,7 @@ async function handleUsage(options) {
|
|
|
593
600
|
);
|
|
594
601
|
}
|
|
595
602
|
async function handleLimit(options) {
|
|
596
|
-
const { http } =
|
|
603
|
+
const { http } = _chunkVAOGM5VSjs.getAuthedHttpClient.call(void 0, );
|
|
597
604
|
const payload = await http.get(
|
|
598
605
|
"/api/v2/billing/limit"
|
|
599
606
|
);
|
|
@@ -601,7 +608,7 @@ async function handleLimit(options) {
|
|
|
601
608
|
`Monthly usage cap: ${_nullishCoalesce(payload.monthly_credits_limit, () => ( "(unknown)"))}`,
|
|
602
609
|
"Enforcement: checked before new calls; in-flight work can exceed the cap."
|
|
603
610
|
] : ["Monthly usage cap: off"];
|
|
604
|
-
|
|
611
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
605
612
|
{
|
|
606
613
|
...payload,
|
|
607
614
|
render: { sections: [{ title: "billing limit", lines }] }
|
|
@@ -610,12 +617,12 @@ async function handleLimit(options) {
|
|
|
610
617
|
);
|
|
611
618
|
}
|
|
612
619
|
async function handleSetLimit(credits, options) {
|
|
613
|
-
const { http } =
|
|
620
|
+
const { http } = _chunkVAOGM5VSjs.getAuthedHttpClient.call(void 0, );
|
|
614
621
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
615
622
|
method: "PUT",
|
|
616
623
|
body: { monthly_credits_limit: Number.parseInt(credits, 10) }
|
|
617
624
|
});
|
|
618
|
-
|
|
625
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
619
626
|
{
|
|
620
627
|
...payload,
|
|
621
628
|
render: {
|
|
@@ -631,11 +638,11 @@ async function handleSetLimit(credits, options) {
|
|
|
631
638
|
);
|
|
632
639
|
}
|
|
633
640
|
async function handleLimitOff(options) {
|
|
634
|
-
const { http } =
|
|
641
|
+
const { http } = _chunkVAOGM5VSjs.getAuthedHttpClient.call(void 0, );
|
|
635
642
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
636
643
|
method: "DELETE"
|
|
637
644
|
});
|
|
638
|
-
|
|
645
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
639
646
|
{
|
|
640
647
|
...payload,
|
|
641
648
|
render: {
|
|
@@ -655,7 +662,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
655
662
|
let initialized = false;
|
|
656
663
|
let pageNumber = 0;
|
|
657
664
|
console.error(`Exporting billing ledger to ${outputPath}`);
|
|
658
|
-
for await (const entries of
|
|
665
|
+
for await (const entries of _chunkXIIQNSWAjs.iterateCursorPages.call(void 0, async (cursor) => {
|
|
659
666
|
pageNumber += 1;
|
|
660
667
|
console.error(
|
|
661
668
|
`Fetching page ${pageNumber}; ${summary.row_count} rows written.`
|
|
@@ -694,7 +701,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
694
701
|
return summary;
|
|
695
702
|
}
|
|
696
703
|
async function handleHistory(options) {
|
|
697
|
-
const { http } =
|
|
704
|
+
const { http } = _chunkVAOGM5VSjs.getAuthedHttpClient.call(void 0, );
|
|
698
705
|
const windows = {
|
|
699
706
|
"1d": 86400,
|
|
700
707
|
"1w": 604800,
|
|
@@ -706,10 +713,10 @@ async function handleHistory(options) {
|
|
|
706
713
|
process.cwd(),
|
|
707
714
|
"deepline",
|
|
708
715
|
"data",
|
|
709
|
-
|
|
716
|
+
_chunkVAOGM5VSjs.createTimestampedName.call(void 0, `billing-history-${options.time}`, "csv")
|
|
710
717
|
);
|
|
711
718
|
const summary = await exportLedger(http, outputPath, { sinceAt });
|
|
712
|
-
|
|
719
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
713
720
|
{
|
|
714
721
|
output_path: outputPath,
|
|
715
722
|
row_count: summary.row_count,
|
|
@@ -746,14 +753,14 @@ async function handleLedgerExportAll(options) {
|
|
|
746
753
|
);
|
|
747
754
|
return;
|
|
748
755
|
}
|
|
749
|
-
const { http } =
|
|
756
|
+
const { http } = _chunkVAOGM5VSjs.getAuthedHttpClient.call(void 0, );
|
|
750
757
|
const outputPath = options.output ? _path.resolve.call(void 0, String(options.output)) : defaultLedgerExportPath();
|
|
751
758
|
const summary = await exportLedger(http, outputPath, {
|
|
752
759
|
sinceAt,
|
|
753
760
|
runId: options.runId,
|
|
754
761
|
operation: options.operation
|
|
755
762
|
});
|
|
756
|
-
|
|
763
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
757
764
|
{
|
|
758
765
|
output_path: outputPath,
|
|
759
766
|
row_count: summary.row_count,
|
|
@@ -794,7 +801,7 @@ function targetPlanLine(plan) {
|
|
|
794
801
|
return `${_nullishCoalesce(plan.display_name, () => ( plan.name))} (${plan.sku}) | ${planPriceText(plan.recurring_price_usd, plan.interval)}${firstMonth}${bonus} | ${plan.included_credits} included credits/month | $${plan.purchased_credit_price_usd}/purchased credit | ${plan.acquisition_enabled ? "available" : "unavailable"}`;
|
|
795
802
|
}
|
|
796
803
|
async function handlePlans(options) {
|
|
797
|
-
const client = new (0,
|
|
804
|
+
const client = new (0, _chunkUJYX4VLXjs.DeeplineClient)();
|
|
798
805
|
const payload = await client.billing.targetPlans(
|
|
799
806
|
options.promoCode ? { promoCode: options.promoCode } : void 0
|
|
800
807
|
);
|
|
@@ -814,8 +821,8 @@ async function handlePlans(options) {
|
|
|
814
821
|
...payload.plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...payload.plans.map(targetPlanLine)],
|
|
815
822
|
_optionalChain([promo, 'optionalAccess', _8 => _8.status]) === "applied" ? `Change plan: deepline billing change-plan <plan_sku> --promo-code ${promo.code}` : "Change plan: deepline billing change-plan <plan_sku>"
|
|
816
823
|
];
|
|
817
|
-
const legacyPayload =
|
|
818
|
-
|
|
824
|
+
const legacyPayload = _chunkVAOGM5VSjs.shouldEmitJson.call(void 0, options.json) ? await client.billing.plans() : null;
|
|
825
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
819
826
|
{
|
|
820
827
|
..._nullishCoalesce(legacyPayload, () => ( payload)),
|
|
821
828
|
...legacyPayload ? { target_billing: payload } : {},
|
|
@@ -825,7 +832,7 @@ async function handlePlans(options) {
|
|
|
825
832
|
);
|
|
826
833
|
}
|
|
827
834
|
async function handleSubscribe(planVersionId, options) {
|
|
828
|
-
const { http } =
|
|
835
|
+
const { http } = _chunkVAOGM5VSjs.getAuthedHttpClient.call(void 0, );
|
|
829
836
|
const payload = await http.request(
|
|
830
837
|
"/api/v2/billing/subscription/checkout",
|
|
831
838
|
{
|
|
@@ -834,8 +841,8 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
834
841
|
}
|
|
835
842
|
);
|
|
836
843
|
const url = String(payload.checkout_url || "");
|
|
837
|
-
if (!options.json && options.open !== false && url)
|
|
838
|
-
|
|
844
|
+
if (!options.json && options.open !== false && url) _chunkVAOGM5VSjs.openInBrowser.call(void 0, url);
|
|
845
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
839
846
|
{
|
|
840
847
|
...payload,
|
|
841
848
|
render: {
|
|
@@ -851,7 +858,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
851
858
|
);
|
|
852
859
|
}
|
|
853
860
|
async function handleSubscriptionStatus(options) {
|
|
854
|
-
const client = new (0,
|
|
861
|
+
const client = new (0, _chunkUJYX4VLXjs.DeeplineClient)();
|
|
855
862
|
const payload = await client.billing.subscription.status();
|
|
856
863
|
const pools = _nullishCoalesce(payload.credit_pools, () => ( []));
|
|
857
864
|
const lines = [
|
|
@@ -871,7 +878,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
871
878
|
],
|
|
872
879
|
`Assigned by: ${_nullishCoalesce(payload.assigned_by, () => ( "default"))}`
|
|
873
880
|
];
|
|
874
|
-
|
|
881
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
875
882
|
{
|
|
876
883
|
...payload,
|
|
877
884
|
render: { sections: [{ title: "billing subscription", lines }] }
|
|
@@ -880,7 +887,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
880
887
|
);
|
|
881
888
|
}
|
|
882
889
|
async function handleSubscriptionCancel(options) {
|
|
883
|
-
const client = new (0,
|
|
890
|
+
const client = new (0, _chunkUJYX4VLXjs.DeeplineClient)();
|
|
884
891
|
const action = options.undo ? "undo_cancel" : "cancel";
|
|
885
892
|
if (options.dryRun) {
|
|
886
893
|
const status = await client.billing.subscription.status();
|
|
@@ -897,7 +904,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
897
904
|
return;
|
|
898
905
|
}
|
|
899
906
|
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.";
|
|
900
|
-
|
|
907
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
901
908
|
{
|
|
902
909
|
ok: true,
|
|
903
910
|
dry_run: true,
|
|
@@ -953,7 +960,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
953
960
|
"Remaining credits are yours to keep \u2014 cancellation never removes credits.",
|
|
954
961
|
"Undo with: deepline billing subscription cancel --undo"
|
|
955
962
|
];
|
|
956
|
-
|
|
963
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
957
964
|
{
|
|
958
965
|
ok: true,
|
|
959
966
|
...result,
|
|
@@ -1007,7 +1014,7 @@ async function handleInvoices(options) {
|
|
|
1007
1014
|
return;
|
|
1008
1015
|
}
|
|
1009
1016
|
}
|
|
1010
|
-
const client = new (0,
|
|
1017
|
+
const client = new (0, _chunkUJYX4VLXjs.DeeplineClient)();
|
|
1011
1018
|
let payload;
|
|
1012
1019
|
try {
|
|
1013
1020
|
payload = await client.billing.invoices.list(
|
|
@@ -1036,7 +1043,7 @@ async function handleInvoices(options) {
|
|
|
1036
1043
|
url: entry.url
|
|
1037
1044
|
}))
|
|
1038
1045
|
} : { ...payload, count: entries.length };
|
|
1039
|
-
|
|
1046
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1040
1047
|
{
|
|
1041
1048
|
...envelope,
|
|
1042
1049
|
render: { sections: [{ title: "billing invoices", lines }] }
|
|
@@ -1045,7 +1052,7 @@ async function handleInvoices(options) {
|
|
|
1045
1052
|
);
|
|
1046
1053
|
}
|
|
1047
1054
|
async function handleCheckout(options) {
|
|
1048
|
-
const { http } =
|
|
1055
|
+
const { http } = _chunkVAOGM5VSjs.getAuthedHttpClient.call(void 0, );
|
|
1049
1056
|
const payload = await http.post(
|
|
1050
1057
|
"/api/v2/billing/checkout",
|
|
1051
1058
|
{
|
|
@@ -1055,8 +1062,8 @@ async function handleCheckout(options) {
|
|
|
1055
1062
|
}
|
|
1056
1063
|
);
|
|
1057
1064
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1058
|
-
if (!options.json && !options.noOpen && url)
|
|
1059
|
-
|
|
1065
|
+
if (!options.json && !options.noOpen && url) _chunkVAOGM5VSjs.openInBrowser.call(void 0, url);
|
|
1066
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1060
1067
|
{
|
|
1061
1068
|
...payload,
|
|
1062
1069
|
render: {
|
|
@@ -1101,7 +1108,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1101
1108
|
return;
|
|
1102
1109
|
}
|
|
1103
1110
|
if (options.dryRun) {
|
|
1104
|
-
|
|
1111
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1105
1112
|
{
|
|
1106
1113
|
ok: true,
|
|
1107
1114
|
dry_run: true,
|
|
@@ -1131,7 +1138,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1131
1138
|
);
|
|
1132
1139
|
return;
|
|
1133
1140
|
}
|
|
1134
|
-
const client = new (0,
|
|
1141
|
+
const client = new (0, _chunkUJYX4VLXjs.DeeplineClient)();
|
|
1135
1142
|
let payload;
|
|
1136
1143
|
try {
|
|
1137
1144
|
payload = await client.billing.topUpWithReceipt({
|
|
@@ -1148,7 +1155,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1148
1155
|
return;
|
|
1149
1156
|
}
|
|
1150
1157
|
if (payload.status === "pending") {
|
|
1151
|
-
|
|
1158
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1152
1159
|
{
|
|
1153
1160
|
ok: true,
|
|
1154
1161
|
...payload,
|
|
@@ -1212,17 +1219,17 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1212
1219
|
]
|
|
1213
1220
|
}
|
|
1214
1221
|
};
|
|
1215
|
-
|
|
1222
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0, options.compact ? compactEnvelope : fullEnvelope, {
|
|
1216
1223
|
json: options.json
|
|
1217
1224
|
});
|
|
1218
1225
|
}
|
|
1219
1226
|
async function handleTargetStatus(options) {
|
|
1220
|
-
const client = new (0,
|
|
1227
|
+
const client = new (0, _chunkUJYX4VLXjs.DeeplineClient)();
|
|
1221
1228
|
const payload = await client.billing.targetStatus();
|
|
1222
1229
|
const balanceCommand = "deepline billing balance";
|
|
1223
1230
|
const recentChargesCommand = "deepline billing usage --limit 5";
|
|
1224
1231
|
const exactChargeCommand = "deepline billing usage --request-id <job_id>";
|
|
1225
|
-
|
|
1232
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1226
1233
|
{
|
|
1227
1234
|
ok: true,
|
|
1228
1235
|
...payload,
|
|
@@ -1260,13 +1267,13 @@ function formatComputeAmount(minutes, credits) {
|
|
|
1260
1267
|
return `${time} ${minutes === 1 ? "minute" : "minutes"} (${cost} ${credits === 1 ? "credit" : "credits"})`;
|
|
1261
1268
|
}
|
|
1262
1269
|
async function handleIncludedCompute(options) {
|
|
1263
|
-
const client = new (0,
|
|
1270
|
+
const client = new (0, _chunkUJYX4VLXjs.DeeplineClient)();
|
|
1264
1271
|
const payload = options.enable ? await client.billing.enableIncludedCompute({ includeOverage: true }) : await client.billing.includedCompute({ includeOverage: true });
|
|
1265
1272
|
const rate = _nullishCoalesce(payload.credits_per_minute, () => ( 0));
|
|
1266
1273
|
const includedCredits = _nullishCoalesce(payload.included_credits_used, () => ( payload.included_minutes_used * rate));
|
|
1267
1274
|
const includedMinutes = payload.included_credits_used !== void 0 && rate > 0 ? includedCredits / rate : payload.included_minutes_used;
|
|
1268
1275
|
const overage = payload.overage_credits;
|
|
1269
|
-
|
|
1276
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1270
1277
|
{
|
|
1271
1278
|
ok: true,
|
|
1272
1279
|
...payload,
|
|
@@ -1281,13 +1288,15 @@ async function handleIncludedCompute(options) {
|
|
|
1281
1288
|
] : [],
|
|
1282
1289
|
`Standard sandbox price: ${formatComputeAmount(60, Math.round(rate * 60))}`,
|
|
1283
1290
|
`Allowance resets: ${payload.period_end_at.slice(0, 10)} (UTC)`,
|
|
1284
|
-
|
|
1291
|
+
_chunkV4EYJKGJjs.PLAY_RUNTIME_PRICING_NOTE,
|
|
1292
|
+
_chunkGWHA4DACjs.PRICING_PAGE_NOTE
|
|
1285
1293
|
] : payload.status === "off" ? [
|
|
1286
1294
|
"Included compute: off; Play compute is billed at provider cost.",
|
|
1287
1295
|
`Allowance if enabled: ${formatComputeAmount(payload.plan.included_minutes, payload.plan.included_minutes * payload.plan.credits_per_minute)} per month`,
|
|
1288
1296
|
`Standard sandbox price if enabled: ${formatComputeAmount(60, Math.round(payload.plan.credits_per_minute * 60))}`,
|
|
1289
|
-
|
|
1290
|
-
"Run deepline billing compute --enable to turn on included compute. It cannot be turned off again."
|
|
1297
|
+
_chunkV4EYJKGJjs.PLAY_RUNTIME_PRICING_NOTE,
|
|
1298
|
+
"Run deepline billing compute --enable to turn on included compute. It cannot be turned off again.",
|
|
1299
|
+
_chunkGWHA4DACjs.PRICING_PAGE_NOTE
|
|
1291
1300
|
] : [
|
|
1292
1301
|
"Included compute is not available for this workspace yet."
|
|
1293
1302
|
]
|
|
@@ -1299,8 +1308,8 @@ async function handleIncludedCompute(options) {
|
|
|
1299
1308
|
);
|
|
1300
1309
|
}
|
|
1301
1310
|
async function handleEntitlements(options) {
|
|
1302
|
-
const payload = await new (0,
|
|
1303
|
-
|
|
1311
|
+
const payload = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.entitlements();
|
|
1312
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1304
1313
|
{
|
|
1305
1314
|
ok: true,
|
|
1306
1315
|
...payload,
|
|
@@ -1310,6 +1319,7 @@ async function handleEntitlements(options) {
|
|
|
1310
1319
|
title: "billing entitlements",
|
|
1311
1320
|
lines: [
|
|
1312
1321
|
`Plan: ${_nullishCoalesce(_optionalChain([payload, 'access', _12 => _12.plan, 'optionalAccess', _13 => _13.name]), () => ( "Legacy billing"))}`,
|
|
1322
|
+
..._chunk3GVIVIERjs.concurrentRunsLine.call(void 0, payload) ? [`Concurrent runs: ${_chunk3GVIVIERjs.concurrentRunsLine.call(void 0, payload)}`] : [],
|
|
1313
1323
|
...Object.entries(payload.benefits).flatMap(
|
|
1314
1324
|
([key, grant]) => "value" in grant ? [
|
|
1315
1325
|
`${key}: ${grant.status}, ${JSON.stringify(grant.value)}${grant.expiresAt === void 0 ? "" : `, expires ${new Date(grant.expiresAt).toISOString()}`}`
|
|
@@ -1323,7 +1333,8 @@ async function handleEntitlements(options) {
|
|
|
1323
1333
|
] : [],
|
|
1324
1334
|
...Object.entries(payload.effective_limits).map(
|
|
1325
1335
|
([key, limit]) => `${key} rate: ${limit.effective}/minute (${limit.source}; plan baseline ${limit.baseline})`
|
|
1326
|
-
)
|
|
1336
|
+
),
|
|
1337
|
+
_chunkGWHA4DACjs.PRICING_PAGE_NOTE
|
|
1327
1338
|
]
|
|
1328
1339
|
}
|
|
1329
1340
|
]
|
|
@@ -1333,7 +1344,7 @@ async function handleEntitlements(options) {
|
|
|
1333
1344
|
);
|
|
1334
1345
|
}
|
|
1335
1346
|
async function handleAutoRechargeStatus(options) {
|
|
1336
|
-
const payload = await new (0,
|
|
1347
|
+
const payload = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.autoRecharge.get();
|
|
1337
1348
|
const state = payload.available ? payload.enabled ? "on" : "off" : "unavailable";
|
|
1338
1349
|
const lines = [
|
|
1339
1350
|
`State: ${state}`,
|
|
@@ -1343,7 +1354,7 @@ async function handleAutoRechargeStatus(options) {
|
|
|
1343
1354
|
`Automatic credit purchase cap: ${payload.purchase_limit_credits} credits per rolling 30 days`
|
|
1344
1355
|
] : []
|
|
1345
1356
|
];
|
|
1346
|
-
|
|
1357
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1347
1358
|
{
|
|
1348
1359
|
ok: true,
|
|
1349
1360
|
...payload,
|
|
@@ -1392,7 +1403,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1392
1403
|
}
|
|
1393
1404
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1394
1405
|
if (options.dryRun) {
|
|
1395
|
-
|
|
1406
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1396
1407
|
{
|
|
1397
1408
|
ok: true,
|
|
1398
1409
|
dry_run: true,
|
|
@@ -1413,7 +1424,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1413
1424
|
);
|
|
1414
1425
|
return;
|
|
1415
1426
|
}
|
|
1416
|
-
const payload = await new (0,
|
|
1427
|
+
const payload = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1417
1428
|
enabled: true,
|
|
1418
1429
|
thresholdCredits,
|
|
1419
1430
|
refillToCredits,
|
|
@@ -1421,7 +1432,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1421
1432
|
...rollingLimitCredits !== void 0 ? { purchaseLimitCredits: rollingLimitCredits } : {},
|
|
1422
1433
|
idempotencyKey
|
|
1423
1434
|
});
|
|
1424
|
-
|
|
1435
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1425
1436
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1426
1437
|
{ json: options.json }
|
|
1427
1438
|
);
|
|
@@ -1429,7 +1440,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1429
1440
|
async function handleAutoRechargeOff(options) {
|
|
1430
1441
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1431
1442
|
if (options.dryRun) {
|
|
1432
|
-
|
|
1443
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1433
1444
|
{
|
|
1434
1445
|
ok: true,
|
|
1435
1446
|
dry_run: true,
|
|
@@ -1444,11 +1455,11 @@ async function handleAutoRechargeOff(options) {
|
|
|
1444
1455
|
);
|
|
1445
1456
|
return;
|
|
1446
1457
|
}
|
|
1447
|
-
const payload = await new (0,
|
|
1458
|
+
const payload = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1448
1459
|
enabled: false,
|
|
1449
1460
|
idempotencyKey
|
|
1450
1461
|
});
|
|
1451
|
-
|
|
1462
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1452
1463
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1453
1464
|
{ json: options.json }
|
|
1454
1465
|
);
|
|
@@ -1474,18 +1485,18 @@ function savedCardLines(cards, hasMore) {
|
|
|
1474
1485
|
async function handleCardsList(options) {
|
|
1475
1486
|
const limit = options.limit === void 0 ? void 0 : Number(options.limit);
|
|
1476
1487
|
if (limit !== void 0 && (!Number.isInteger(limit) || limit < 1 || limit > 100)) {
|
|
1477
|
-
|
|
1488
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1478
1489
|
{ ok: false, error: "--limit must be a whole number from 1 to 100." },
|
|
1479
1490
|
{ json: options.json }
|
|
1480
1491
|
);
|
|
1481
1492
|
process.exitCode = 1;
|
|
1482
1493
|
return;
|
|
1483
1494
|
}
|
|
1484
|
-
const payload = await new (0,
|
|
1495
|
+
const payload = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.cards.list({
|
|
1485
1496
|
...limit !== void 0 ? { limit } : {},
|
|
1486
1497
|
...options.cursor ? { cursor: options.cursor } : {}
|
|
1487
1498
|
});
|
|
1488
|
-
|
|
1499
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1489
1500
|
{
|
|
1490
1501
|
ok: true,
|
|
1491
1502
|
...payload,
|
|
@@ -1503,8 +1514,8 @@ async function handleCardsList(options) {
|
|
|
1503
1514
|
}
|
|
1504
1515
|
async function handleCardsAdd(options) {
|
|
1505
1516
|
const makeDefault = options.makeDefault === true;
|
|
1506
|
-
const payload = await new (0,
|
|
1507
|
-
|
|
1517
|
+
const payload = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.cards.add({ makeDefault });
|
|
1518
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1508
1519
|
{
|
|
1509
1520
|
ok: true,
|
|
1510
1521
|
make_default: makeDefault,
|
|
@@ -1529,7 +1540,7 @@ async function handleCardChange(action, cardId, options) {
|
|
|
1529
1540
|
const changeId = _nullishCoalesce(options.changeId, () => ( _crypto.randomUUID.call(void 0, )));
|
|
1530
1541
|
const path = `/api/v2/billing/payment-methods/${action}`;
|
|
1531
1542
|
if (options.dryRun) {
|
|
1532
|
-
|
|
1543
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1533
1544
|
{
|
|
1534
1545
|
ok: true,
|
|
1535
1546
|
dry_run: true,
|
|
@@ -1544,9 +1555,9 @@ async function handleCardChange(action, cardId, options) {
|
|
|
1544
1555
|
);
|
|
1545
1556
|
return;
|
|
1546
1557
|
}
|
|
1547
|
-
const cards = new (0,
|
|
1558
|
+
const cards = new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.cards;
|
|
1548
1559
|
const payload = action === "default" ? await cards.setDefault({ cardId, changeId }) : await cards.remove({ cardId, changeId });
|
|
1549
|
-
|
|
1560
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1550
1561
|
{
|
|
1551
1562
|
...payload,
|
|
1552
1563
|
render: {
|
|
@@ -1580,11 +1591,11 @@ async function handleBuyCredits(creditsRaw, options) {
|
|
|
1580
1591
|
return;
|
|
1581
1592
|
}
|
|
1582
1593
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1583
|
-
const payload = await new (0,
|
|
1594
|
+
const payload = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.purchaseCredits({
|
|
1584
1595
|
credits,
|
|
1585
1596
|
idempotencyKey
|
|
1586
1597
|
});
|
|
1587
|
-
|
|
1598
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1588
1599
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1589
1600
|
{ json: options.json }
|
|
1590
1601
|
);
|
|
@@ -1620,7 +1631,7 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1620
1631
|
return;
|
|
1621
1632
|
}
|
|
1622
1633
|
if (options.dryRun) {
|
|
1623
|
-
|
|
1634
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1624
1635
|
{
|
|
1625
1636
|
ok: true,
|
|
1626
1637
|
dry_run: true,
|
|
@@ -1633,12 +1644,12 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1633
1644
|
);
|
|
1634
1645
|
return;
|
|
1635
1646
|
}
|
|
1636
|
-
const payload = await new (0,
|
|
1647
|
+
const payload = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.recoverCreditPurchase({
|
|
1637
1648
|
credits,
|
|
1638
1649
|
orgId: options.orgId,
|
|
1639
1650
|
idempotencyKey: options.idempotencyKey
|
|
1640
1651
|
});
|
|
1641
|
-
|
|
1652
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1642
1653
|
{ ok: true, idempotency_key: options.idempotencyKey, ...payload },
|
|
1643
1654
|
{ json: options.json }
|
|
1644
1655
|
);
|
|
@@ -1658,38 +1669,38 @@ async function handleTargetPlan(planSku, options) {
|
|
|
1658
1669
|
return;
|
|
1659
1670
|
}
|
|
1660
1671
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1661
|
-
const payload = await new (0,
|
|
1672
|
+
const payload = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.transitionPlan({
|
|
1662
1673
|
action: "start_or_change",
|
|
1663
1674
|
targetPlanSku: planSku,
|
|
1664
1675
|
...options.billingEmail ? { billingEmail: options.billingEmail } : {},
|
|
1665
1676
|
...options.promoCode ? { promoCode: options.promoCode } : {},
|
|
1666
1677
|
idempotencyKey
|
|
1667
1678
|
});
|
|
1668
|
-
|
|
1679
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1669
1680
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1670
1681
|
{ json: options.json }
|
|
1671
1682
|
);
|
|
1672
1683
|
}
|
|
1673
1684
|
async function handleTargetPlanCancellation(options) {
|
|
1674
1685
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1675
|
-
const payload = await new (0,
|
|
1686
|
+
const payload = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.transitionPlan({
|
|
1676
1687
|
action: options.undo ? "undo_cancel" : "cancel",
|
|
1677
1688
|
idempotencyKey
|
|
1678
1689
|
});
|
|
1679
|
-
|
|
1690
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1680
1691
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1681
1692
|
{ json: options.json }
|
|
1682
1693
|
);
|
|
1683
1694
|
}
|
|
1684
1695
|
async function handleTargetPortal(options) {
|
|
1685
|
-
const payload = await new (0,
|
|
1696
|
+
const payload = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.portalSession(
|
|
1686
1697
|
options.billingAddress ? { flow: "customer_update" } : void 0
|
|
1687
1698
|
);
|
|
1688
|
-
if (!options.json && !options.noOpen)
|
|
1689
|
-
|
|
1699
|
+
if (!options.json && !options.noOpen) _chunkVAOGM5VSjs.openInBrowser.call(void 0, payload.url);
|
|
1700
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1690
1701
|
}
|
|
1691
1702
|
async function handleRedeemCode(code, options) {
|
|
1692
|
-
const { http } =
|
|
1703
|
+
const { http } = _chunkVAOGM5VSjs.getAuthedHttpClient.call(void 0, );
|
|
1693
1704
|
const payload = await http.post(
|
|
1694
1705
|
"/api/v2/billing/checkout",
|
|
1695
1706
|
{
|
|
@@ -1697,8 +1708,8 @@ async function handleRedeemCode(code, options) {
|
|
|
1697
1708
|
}
|
|
1698
1709
|
);
|
|
1699
1710
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1700
|
-
if (!options.json && !options.noOpen && url)
|
|
1701
|
-
|
|
1711
|
+
if (!options.json && !options.noOpen && url) _chunkVAOGM5VSjs.openInBrowser.call(void 0, url);
|
|
1712
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1702
1713
|
{
|
|
1703
1714
|
...payload,
|
|
1704
1715
|
render: {
|
|
@@ -1759,14 +1770,14 @@ Examples:
|
|
|
1759
1770
|
if (!Number.isSafeInteger(quantity) || quantity <= 0) {
|
|
1760
1771
|
throw new Error("--quantity must be a positive safe integer.");
|
|
1761
1772
|
}
|
|
1762
|
-
const quote = await new (0,
|
|
1773
|
+
const quote = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.quote({
|
|
1763
1774
|
quantity,
|
|
1764
1775
|
sandbox_runtime: {
|
|
1765
1776
|
timeout: options.sandboxTimeout,
|
|
1766
1777
|
size: options.sandboxSize
|
|
1767
1778
|
}
|
|
1768
1779
|
});
|
|
1769
|
-
|
|
1780
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0, quote, {
|
|
1770
1781
|
json: options.json,
|
|
1771
1782
|
text: `Sandbox session ceiling: ${quote.maximum_credits} Deepline credits (${quote.quantity} session${quote.quantity === 1 ? "" : "s"}).
|
|
1772
1783
|
${quote.explanation}
|
|
@@ -1795,9 +1806,9 @@ Examples:
|
|
|
1795
1806
|
billing.command("reuse").description(
|
|
1796
1807
|
"Show recorded reused tool results for this workspace; no credit estimate."
|
|
1797
1808
|
).option("--json", "Return the workspace reuse summary as JSON").action(async (options) => {
|
|
1798
|
-
const { http } =
|
|
1809
|
+
const { http } = _chunkVAOGM5VSjs.getAuthedHttpClient.call(void 0, );
|
|
1799
1810
|
const payload = await http.get("/api/v2/usage/reuse");
|
|
1800
|
-
|
|
1811
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0,
|
|
1801
1812
|
{
|
|
1802
1813
|
status: "ok",
|
|
1803
1814
|
data: payload,
|
|
@@ -2038,8 +2049,8 @@ Examples:
|
|
|
2038
2049
|
new (0, _commander.Command)("trigger").description(
|
|
2039
2050
|
"Evaluate capped automatic recharge and resume any pending purchase."
|
|
2040
2051
|
).option("--json", "Emit JSON output").action(async (options) => {
|
|
2041
|
-
const result = await new (0,
|
|
2042
|
-
|
|
2052
|
+
const result = await new (0, _chunkUJYX4VLXjs.DeeplineClient)().billing.autoRecharge.trigger();
|
|
2053
|
+
_chunkVAOGM5VSjs.printCommandEnvelope.call(void 0, { ok: true, ...result }, { json: options.json });
|
|
2043
2054
|
})
|
|
2044
2055
|
);
|
|
2045
2056
|
billing.command("cards").description("List, add, choose the default of, and remove saved cards.").addHelpText(
|