deepline 0.3.477 → 0.3.478
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-core.ts +5 -4
- package/dist/bundling-sources/sdk/src/http-core.ts +84 -3
- package/dist/bundling-sources/sdk/src/http.ts +2 -0
- package/dist/bundling-sources/sdk/src/play.ts +8 -2
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +18 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +10 -2
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +11 -1
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +77 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +83 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +60 -27
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +13 -12
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +5 -2
- package/dist/bundling-sources/shared_libs/plays/sandbox-runtime-limits.ts +37 -12
- package/dist/bundling-sources/shared_libs/product-notifications/billing-sales.ts +1 -0
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +29 -0
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +15 -0
- package/dist/cli/{auth-XVXRRWIQ.mjs → auth-SA4DJCSO.mjs} +5 -5
- package/dist/cli/auth-U5SNVC5F.js +41 -0
- package/dist/cli/{billing-2H7GFJDT.js → billing-462SAHWX.js} +107 -87
- package/dist/cli/{billing-EOPUJ4JI.mjs → billing-Z4D35MV5.mjs} +34 -14
- package/dist/cli/{chunk-SG2SZQ4K.mjs → chunk-2FTUPGTN.mjs} +2 -2
- package/dist/cli/{chunk-NO7ZC2GV.mjs → chunk-2JS5DNVX.mjs} +5 -5
- package/dist/cli/{chunk-3UKKM6OS.js → chunk-2MSKG4ER.js} +7 -6
- package/dist/cli/{chunk-ISEUOYCB.mjs → chunk-3LTLQAU4.mjs} +4 -4
- package/dist/cli/{chunk-C2V2HQDW.mjs → chunk-3V7INABZ.mjs} +2 -2
- package/dist/cli/{chunk-C2AN2HTB.mjs → chunk-4C3TMIF3.mjs} +4 -4
- package/dist/cli/{chunk-2YNLW43I.mjs → chunk-4RJRGQ5Y.mjs} +2 -2
- package/dist/cli/{chunk-M2UL4ZS5.js → chunk-4RV7U3RP.js} +7 -7
- package/dist/cli/{chunk-PQQNMMWM.mjs → chunk-645RNF2Y.mjs} +1 -1
- package/dist/cli/{chunk-THMGJOR4.js → chunk-6EEMW7YP.js} +8 -8
- package/dist/cli/{chunk-YZA5UJXM.mjs → chunk-75DAGCEX.mjs} +1 -1
- package/dist/cli/{chunk-QODW5ILA.mjs → chunk-7HTWT3Z4.mjs} +2 -2
- package/dist/cli/chunk-7I4B6V2S.mjs +127 -0
- package/dist/cli/{chunk-MZSLFWOT.js → chunk-7UFFWPQ2.js} +13 -9
- package/dist/cli/{chunk-23EEVP5W.js → chunk-A5LPDB6N.js} +6 -6
- package/dist/cli/{chunk-NJMYX2TP.mjs → chunk-ABBP5ZCI.mjs} +3 -3
- package/dist/cli/{chunk-347EE4YE.js → chunk-AQYSZYNE.js} +8 -8
- package/dist/cli/{chunk-RGNMMDSJ.js → chunk-AYW242XF.js} +37 -37
- package/dist/cli/{chunk-6IJJCRE5.mjs → chunk-BLAZVZVD.mjs} +23 -5
- package/dist/cli/{chunk-ZDPL5AIK.js → chunk-D2LKEQKI.js} +5 -5
- package/dist/cli/{chunk-RLCAECZH.mjs → chunk-F2SJYUBW.mjs} +5 -5
- package/dist/cli/{chunk-XQLYPHYW.mjs → chunk-F44O4PEP.mjs} +1 -1
- package/dist/cli/{chunk-7CILZKLE.js → chunk-HMUBLAT4.js} +5 -5
- package/dist/cli/{chunk-UYA7LJGC.mjs → chunk-IL5AF6AR.mjs} +4 -2
- package/dist/cli/{chunk-4RAENEAX.js → chunk-IWYWZXCA.js} +53 -53
- package/dist/cli/{chunk-2QT6KN54.js → chunk-J3ZYRN5L.js} +10 -10
- package/dist/cli/{chunk-RHIFH3GD.mjs → chunk-JH775FF6.mjs} +1 -1
- package/dist/cli/{chunk-ACDXGOXE.js → chunk-KBBZXWXF.js} +63 -11
- package/dist/cli/{chunk-LJYTYNQZ.mjs → chunk-M5USVQ33.mjs} +55 -3
- package/dist/cli/{chunk-2GZFIWSA.mjs → chunk-N573OK4W.mjs} +4 -4
- package/dist/cli/{chunk-WFVEMDQL.js → chunk-OKAZHDYN.js} +4 -2
- package/dist/cli/{chunk-DFKHXZQ7.mjs → chunk-PHBOI24Y.mjs} +10 -10
- package/dist/cli/{chunk-WRHLAAGN.mjs → chunk-PLJV6SX4.mjs} +1 -1
- package/dist/cli/{chunk-C46DWB56.mjs → chunk-PPHHPAQV.mjs} +1 -1
- package/dist/cli/{chunk-UBNS6GSV.js → chunk-PZHRNSMU.js} +21 -21
- package/dist/cli/{chunk-KMXBZIKO.mjs → chunk-QB3Q73LP.mjs} +2 -2
- package/dist/cli/{chunk-255O6APS.js → chunk-QVZNUQAP.js} +2 -2
- package/dist/cli/{chunk-6KKDIISC.js → chunk-S3BKOCVB.js} +1 -1
- package/dist/cli/{chunk-JS4UO6G4.mjs → chunk-S7UEKKOX.mjs} +2 -1
- package/dist/cli/{chunk-KWQNNPMH.js → chunk-SCHE5QRN.js} +3 -3
- package/dist/cli/{chunk-E2CUSH56.js → chunk-SXY4DOVA.js} +16 -16
- package/dist/cli/{chunk-SVU2VR6Q.mjs → chunk-TLF3KGWG.mjs} +2 -2
- package/dist/cli/{chunk-LXKGZKTL.js → chunk-TQWI7LJX.js} +26 -26
- package/dist/cli/{chunk-NC52JG66.js → chunk-TW3TTKW5.js} +3 -3
- package/dist/cli/{chunk-R5FNCFEK.js → chunk-UXQVSDFP.js} +3 -3
- package/dist/cli/{chunk-DMWHEYZM.js → chunk-V7I65ME7.js} +2 -2
- package/dist/cli/{chunk-CH4VMDB5.js → chunk-VE25VUTE.js} +70 -52
- package/dist/cli/{chunk-3W6E3WVU.js → chunk-XFY3JOP2.js} +9 -9
- package/dist/cli/{chunk-75NLWBYQ.js → chunk-XOORR6P3.js} +93 -93
- package/dist/cli/chunk-YGCKMI5P.js +127 -0
- package/dist/cli/{chunk-3A7TDUZV.mjs → chunk-ZBSUXXZS.mjs} +13 -9
- package/dist/cli/{chunk-DS3DZUES.mjs → chunk-ZSU3C4ST.mjs} +2 -2
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-IDRPTSSC.mjs → csv-3SNWBO5F.mjs} +4 -4
- package/dist/cli/{csv-ECB7TYR2.js → csv-LAYTDYIF.js} +13 -13
- package/dist/cli/{db-FOBZD44N.mjs → db-72JKGQSK.mjs} +6 -6
- package/dist/cli/{db-S74XZZ77.js → db-OOUOSURL.js} +27 -27
- package/dist/cli/describe-7HYV44MO.js +48 -0
- package/dist/cli/{describe-KMTPPI2J.mjs → describe-KDPNOEUJ.mjs} +17 -17
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/{executions-4JAIVE2E.mjs → executions-O6JS3UKX.mjs} +6 -6
- package/dist/cli/{executions-ZE3JMNA4.js → executions-RJNMGJEE.js} +8 -8
- package/dist/cli/{feedback-W6VA47A3.js → feedback-FXB6NV3Y.js} +8 -8
- package/dist/cli/{feedback-EUX5PDBA.mjs → feedback-T3JH3CWC.mjs} +4 -4
- package/dist/cli/git-5LTKPXGN.js +25 -0
- package/dist/cli/{git-UOVG4PLH.mjs → git-6KAQSH5J.mjs} +5 -5
- package/dist/cli/index.js +161 -142
- package/dist/cli/index.mjs +65 -46
- package/dist/cli/{legacy-noops-ZBWUNFWV.mjs → legacy-noops-7HDGEGTK.mjs} +5 -5
- package/dist/cli/{legacy-noops-3H35EH5Y.js → legacy-noops-PAOGRKUK.js} +8 -8
- package/dist/cli/{monitors-PI3KPLR2.js → monitors-KQFI7TVJ.js} +91 -91
- package/dist/cli/{monitors-AYSGSUAK.mjs → monitors-LE2AYK3Z.mjs} +7 -7
- package/dist/cli/{org-MVS3Y6BK.js → org-J6XFHDJE.js} +72 -72
- package/dist/cli/{org-2BIG7U4V.mjs → org-Z4DMJ72I.mjs} +6 -6
- package/dist/cli/{pages-4TRRL24G.mjs → pages-5LYS6Y4I.mjs} +6 -6
- package/dist/cli/{pages-VB6FOVDE.js → pages-FIXBZQJG.js} +17 -17
- package/dist/cli/{play-BLT6IT2O.js → play-D7WPXADH.js} +585 -678
- package/dist/cli/{play-JR3VUOZM.mjs → play-GILXXIN7.mjs} +26 -119
- package/dist/cli/{providers-BBXIAGW4.js → providers-KN7YACT6.js} +9 -9
- package/dist/cli/{providers-547DPK4S.mjs → providers-OQWL4Q4W.mjs} +6 -6
- package/dist/cli/{quickstart-NTLXD7HS.mjs → quickstart-2LRIORFM.mjs} +4 -4
- package/dist/cli/{quickstart-RNPI5B6J.js → quickstart-M2OBP3W3.js} +6 -6
- package/dist/cli/{run-BCCEXBOG.js → run-6YZZO7VM.js} +36 -36
- package/dist/cli/{run-QZ4SFECD.mjs → run-GYRBKQZT.mjs} +22 -22
- package/dist/cli/search-OVKWA4AV.js +32 -0
- package/dist/cli/{search-PYNELH4C.mjs → search-VUPK6BNU.mjs} +7 -7
- package/dist/cli/{secrets-VD35LMYJ.js → secrets-RE3UMZB7.js} +15 -15
- package/dist/cli/{secrets-O5WGREQ7.mjs → secrets-ULRGU7NM.mjs} +6 -6
- package/dist/cli/{sessions-2TL6Z5J5.mjs → sessions-2ZZVJ3P2.mjs} +5 -5
- package/dist/cli/{sessions-NGGIBYXF.js → sessions-T4UMHNDW.js} +6 -6
- package/dist/cli/{settings-ERFNZRHO.js → settings-BRV6AYFM.js} +78 -78
- package/dist/cli/{settings-6KM74AJT.mjs → settings-PDY4TJU6.mjs} +11 -11
- package/dist/cli/{setup-Y3BN6XRS.mjs → setup-CXL6C5Z5.mjs} +9 -9
- package/dist/cli/{setup-6X7EJ6RG.js → setup-JONYJYBK.js} +44 -44
- package/dist/cli/{skills-OUBQASHI.mjs → skills-TOMVQD5O.mjs} +7 -7
- package/dist/cli/skills-UK5AK35I.js +33 -0
- package/dist/cli/{tools-EELZ5FF5.mjs → tools-B2LJK4MM.mjs} +16 -16
- package/dist/cli/tools-HH6E5G7J.js +55 -0
- package/dist/cli/{update-TX7SW32Y.mjs → update-CD6T2REC.mjs} +9 -9
- package/dist/cli/update-EGXT3EIJ.js +33 -0
- package/dist/cli/{workflow-5AI2BJA7.js → workflow-PZML43E2.js} +17 -17
- package/dist/cli/{workflow-PUNQG7LG.mjs → workflow-ZAOBP6I7.mjs} +7 -7
- package/dist/{client-AjmfA5nR.d.mts → client-B1s1yJdT.d.mts} +1 -1
- package/dist/{client-DMyY-QL8.d.ts → client-DqUseRzd.d.ts} +1 -1
- package/dist/{client-core-C705vFyV.d.ts → client-core-Bd7tP9Uz.d.ts} +45 -6
- package/dist/{client-core-CpBbvLEX.d.mts → client-core-BijQEQ70.d.mts} +45 -6
- package/dist/{compiler-manifest-hqIAukR0.d.mts → compiler-manifest-B1m5tRzz.d.mts} +23 -17
- package/dist/{compiler-manifest-hqIAukR0.d.ts → compiler-manifest-B1m5tRzz.d.ts} +23 -17
- package/dist/{errors-CRO2qQ6k.d.ts → errors-3g71OMXy.d.ts} +1 -1
- package/dist/{errors-DIHVetNY.d.mts → errors-QiC6am-q.d.mts} +1 -1
- package/dist/{index-DVZ_X4Gb.d.mts → index-Biz5toO4.d.mts} +1 -1
- package/dist/{index-B8DVoeYt.d.ts → index-CIBiwzhK.d.ts} +1 -1
- package/dist/index.d.mts +15 -9
- package/dist/index.d.ts +15 -9
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +112 -110
- 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 +2 -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-QITP34OX.js +0 -41
- package/dist/cli/describe-PI7HCT7K.js +0 -48
- package/dist/cli/git-NDOGCQZY.js +0 -25
- package/dist/cli/search-YHEICYQL.js +0 -32
- package/dist/cli/skills-F7MPYC4P.js +0 -33
- package/dist/cli/tools-MCWDAK53.js +0 -55
- package/dist/cli/update-G5BRJOVT.js +0 -33
|
@@ -1,10 +1,13 @@
|
|
|
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 _chunkYGCKMI5Pjs = require('./chunk-YGCKMI5P.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunkHMUBLAT4js = require('./chunk-HMUBLAT4.js');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunk2MSKG4ERjs = require('./chunk-2MSKG4ER.js');
|
|
8
11
|
require('./chunk-E4CABWXL.js');
|
|
9
12
|
require('./chunk-JDMR33HS.js');
|
|
10
13
|
require('./chunk-NMU3VR5U.js');
|
|
@@ -15,9 +18,9 @@ require('./chunk-XDVT3GOM.js');
|
|
|
15
18
|
|
|
16
19
|
|
|
17
20
|
|
|
18
|
-
var
|
|
19
|
-
require('./chunk-
|
|
20
|
-
require('./chunk-
|
|
21
|
+
var _chunk4RV7U3RPjs = require('./chunk-4RV7U3RP.js');
|
|
22
|
+
require('./chunk-TW3TTKW5.js');
|
|
23
|
+
require('./chunk-KBBZXWXF.js');
|
|
21
24
|
|
|
22
25
|
|
|
23
26
|
|
|
@@ -26,7 +29,7 @@ require('./chunk-XNYIZMNQ.js');
|
|
|
26
29
|
|
|
27
30
|
|
|
28
31
|
var _chunkDIAWYWT5js = require('./chunk-DIAWYWT5.js');
|
|
29
|
-
require('./chunk-
|
|
32
|
+
require('./chunk-S3BKOCVB.js');
|
|
30
33
|
require('./chunk-OG64RBAC.js');
|
|
31
34
|
require('./chunk-COGTRVWW.js');
|
|
32
35
|
|
|
@@ -75,7 +78,7 @@ function reportBillingFailure(failure, options) {
|
|
|
75
78
|
if (failure.next) {
|
|
76
79
|
textLines.push(`Next: ${failure.next}`);
|
|
77
80
|
}
|
|
78
|
-
|
|
81
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
79
82
|
{
|
|
80
83
|
ok: false,
|
|
81
84
|
exitCode: failure.exitCode,
|
|
@@ -96,7 +99,7 @@ function parseTopUpCredits(raw) {
|
|
|
96
99
|
return parsed;
|
|
97
100
|
}
|
|
98
101
|
function topUpIdempotencyKey(raw) {
|
|
99
|
-
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` :
|
|
102
|
+
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` : _chunk2MSKG4ERjs.requireBillingIdempotencyKey.call(void 0, raw);
|
|
100
103
|
}
|
|
101
104
|
function targetBillingIdempotencyKey(raw) {
|
|
102
105
|
return typeof raw === "string" ? raw : `cli_target_billing:${Date.now()}:${_crypto.randomUUID.call(void 0, )}`;
|
|
@@ -315,7 +318,7 @@ function defaultLedgerExportPath() {
|
|
|
315
318
|
);
|
|
316
319
|
}
|
|
317
320
|
async function handleBalance(options) {
|
|
318
|
-
const { http } =
|
|
321
|
+
const { http } = _chunk4RV7U3RPjs.getAuthedHttpClient.call(void 0, );
|
|
319
322
|
const payload = await http.get(
|
|
320
323
|
"/api/v2/billing/balance"
|
|
321
324
|
);
|
|
@@ -399,7 +402,7 @@ async function handleBalance(options) {
|
|
|
399
402
|
...options.verbose ? detail : [],
|
|
400
403
|
...lines.slice(1)
|
|
401
404
|
];
|
|
402
|
-
|
|
405
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
403
406
|
{
|
|
404
407
|
...payload,
|
|
405
408
|
...recovery ? { recovery } : {},
|
|
@@ -435,7 +438,7 @@ async function handleUsageEvents(options) {
|
|
|
435
438
|
);
|
|
436
439
|
return;
|
|
437
440
|
}
|
|
438
|
-
const client = new (0,
|
|
441
|
+
const client = new (0, _chunkHMUBLAT4js.DeeplineClient)();
|
|
439
442
|
let payload;
|
|
440
443
|
try {
|
|
441
444
|
payload = await client.billing.usageEvents({
|
|
@@ -466,7 +469,7 @@ async function handleUsageEvents(options) {
|
|
|
466
469
|
),
|
|
467
470
|
...nextPage ? [`Next page: ${nextPage}`] : []
|
|
468
471
|
];
|
|
469
|
-
|
|
472
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
470
473
|
{
|
|
471
474
|
...payload,
|
|
472
475
|
next: { page: nextPage },
|
|
@@ -476,8 +479,19 @@ async function handleUsageEvents(options) {
|
|
|
476
479
|
);
|
|
477
480
|
}
|
|
478
481
|
async function handleUsage(options) {
|
|
482
|
+
if (options.events && options.recentOnly) {
|
|
483
|
+
reportBillingFailure(
|
|
484
|
+
{
|
|
485
|
+
exitCode: 2,
|
|
486
|
+
code: "CONFLICTING_USAGE_FILTERS",
|
|
487
|
+
message: "--recent-only cannot be combined with --events."
|
|
488
|
+
},
|
|
489
|
+
options
|
|
490
|
+
);
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
479
493
|
if (options.events) return handleUsageEvents(options);
|
|
480
|
-
const { http } =
|
|
494
|
+
const { http } = _chunk4RV7U3RPjs.getAuthedHttpClient.call(void 0, );
|
|
481
495
|
const params = new URLSearchParams();
|
|
482
496
|
if (options.requestId !== void 0) {
|
|
483
497
|
const requestId = options.requestId.trim();
|
|
@@ -505,6 +519,7 @@ async function handleUsage(options) {
|
|
|
505
519
|
}
|
|
506
520
|
params.set("request_id", requestId);
|
|
507
521
|
} else {
|
|
522
|
+
if (options.recentOnly) params.set("recent_only", "true");
|
|
508
523
|
if (options.limit) params.set("recent_limit", options.limit);
|
|
509
524
|
if (options.offset) params.set("recent_offset", options.offset);
|
|
510
525
|
if (options.cursor) params.set("recent_cursor", options.cursor);
|
|
@@ -536,18 +551,20 @@ async function handleUsage(options) {
|
|
|
536
551
|
const recent = _nullishCoalesce(payload.recent, () => ( {}));
|
|
537
552
|
const last30Usage = _nullishCoalesce(usage.last_30_days_usage_credits, () => ( usage.month_spent_credits));
|
|
538
553
|
const temporaryHolds = Number(_nullishCoalesce(usage.temporary_hold_credits, () => ( 0)));
|
|
539
|
-
const nextPage = typeof recent.next_cursor === "string" && recent.next_cursor.length > 0 ? `deepline billing usage --cursor ${quoteShellArgument(recent.next_cursor)}${options.limit ? ` --limit ${options.limit}` : ""}${options.runId ? ` --run-id ${quoteShellArgument(options.runId)}` : ""}` : null;
|
|
554
|
+
const nextPage = typeof recent.next_cursor === "string" && recent.next_cursor.length > 0 ? `deepline billing usage${options.recentOnly ? " --recent-only" : ""} --cursor ${quoteShellArgument(recent.next_cursor)}${options.limit ? ` --limit ${options.limit}` : ""}${options.runId ? ` --run-id ${quoteShellArgument(options.runId)}` : ""}` : null;
|
|
540
555
|
const recentLines = recentUsageLines(
|
|
541
556
|
Array.isArray(recent.entries) ? recent.entries : []
|
|
542
557
|
);
|
|
543
558
|
const matchingActivity = typeof recent.total === "number" && Number.isFinite(recent.total) && recent.total >= 0 && typeof recent.total_is_exact === "boolean" ? recent.total_is_exact ? `Matching activity: ${recent.total}` : typeof recent.total_lower_bound === "number" && Number.isFinite(recent.total_lower_bound) && recent.total_lower_bound >= 0 ? `Matching activity: at least ${recent.total_lower_bound}` : `Matching activity: count not exact (reported ${recent.total})` : null;
|
|
544
559
|
const lines = options.requestId ? [`Charge lookup: ${options.requestId}`, ...recentLines] : [
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
560
|
+
...!options.recentOnly ? [
|
|
561
|
+
`Balance: ${_nullishCoalesce(payload.balance, () => ( "(unknown)"))}`,
|
|
562
|
+
`Last 30 days usage: ${_nullishCoalesce(last30Usage, () => ( "(unknown)"))}`,
|
|
563
|
+
...Number.isFinite(temporaryHolds) && temporaryHolds > 0 ? [`Temporary holds: ${temporaryHolds}`] : [],
|
|
564
|
+
`Monthly usage cap: ${quota.enabled ? _nullishCoalesce(quota.monthly_credits_limit, () => ( "(unknown)")) : "off"}`,
|
|
565
|
+
...options.runId && recent.run_id ? [
|
|
566
|
+
`Run spend: ${_nullishCoalesce((_nullishCoalesce(payload.run, () => ( {}))).spent_credits, () => ( "(unknown)"))} Deepline Credits`
|
|
567
|
+
] : []
|
|
551
568
|
] : [],
|
|
552
569
|
...matchingActivity ? [matchingActivity] : [],
|
|
553
570
|
...recentLines,
|
|
@@ -558,7 +575,7 @@ async function handleUsage(options) {
|
|
|
558
575
|
"No continuation is available for this view. Use deepline billing ledger export all for the full ledger."
|
|
559
576
|
] : []
|
|
560
577
|
];
|
|
561
|
-
|
|
578
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
562
579
|
{
|
|
563
580
|
...payload,
|
|
564
581
|
recent: {
|
|
@@ -572,7 +589,7 @@ async function handleUsage(options) {
|
|
|
572
589
|
);
|
|
573
590
|
}
|
|
574
591
|
async function handleLimit(options) {
|
|
575
|
-
const { http } =
|
|
592
|
+
const { http } = _chunk4RV7U3RPjs.getAuthedHttpClient.call(void 0, );
|
|
576
593
|
const payload = await http.get(
|
|
577
594
|
"/api/v2/billing/limit"
|
|
578
595
|
);
|
|
@@ -580,7 +597,7 @@ async function handleLimit(options) {
|
|
|
580
597
|
`Monthly usage cap: ${_nullishCoalesce(payload.monthly_credits_limit, () => ( "(unknown)"))}`,
|
|
581
598
|
"Enforcement: checked before new calls; in-flight work can exceed the cap."
|
|
582
599
|
] : ["Monthly usage cap: off"];
|
|
583
|
-
|
|
600
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
584
601
|
{
|
|
585
602
|
...payload,
|
|
586
603
|
render: { sections: [{ title: "billing limit", lines }] }
|
|
@@ -589,12 +606,12 @@ async function handleLimit(options) {
|
|
|
589
606
|
);
|
|
590
607
|
}
|
|
591
608
|
async function handleSetLimit(credits, options) {
|
|
592
|
-
const { http } =
|
|
609
|
+
const { http } = _chunk4RV7U3RPjs.getAuthedHttpClient.call(void 0, );
|
|
593
610
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
594
611
|
method: "PUT",
|
|
595
612
|
body: { monthly_credits_limit: Number.parseInt(credits, 10) }
|
|
596
613
|
});
|
|
597
|
-
|
|
614
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
598
615
|
{
|
|
599
616
|
...payload,
|
|
600
617
|
render: {
|
|
@@ -610,11 +627,11 @@ async function handleSetLimit(credits, options) {
|
|
|
610
627
|
);
|
|
611
628
|
}
|
|
612
629
|
async function handleLimitOff(options) {
|
|
613
|
-
const { http } =
|
|
630
|
+
const { http } = _chunk4RV7U3RPjs.getAuthedHttpClient.call(void 0, );
|
|
614
631
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
615
632
|
method: "DELETE"
|
|
616
633
|
});
|
|
617
|
-
|
|
634
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
618
635
|
{
|
|
619
636
|
...payload,
|
|
620
637
|
render: {
|
|
@@ -634,7 +651,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
634
651
|
let initialized = false;
|
|
635
652
|
let pageNumber = 0;
|
|
636
653
|
console.error(`Exporting billing ledger to ${outputPath}`);
|
|
637
|
-
for await (const entries of
|
|
654
|
+
for await (const entries of _chunk2MSKG4ERjs.iterateCursorPages.call(void 0, async (cursor) => {
|
|
638
655
|
pageNumber += 1;
|
|
639
656
|
console.error(
|
|
640
657
|
`Fetching page ${pageNumber}; ${summary.row_count} rows written.`
|
|
@@ -673,7 +690,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
673
690
|
return summary;
|
|
674
691
|
}
|
|
675
692
|
async function handleHistory(options) {
|
|
676
|
-
const { http } =
|
|
693
|
+
const { http } = _chunk4RV7U3RPjs.getAuthedHttpClient.call(void 0, );
|
|
677
694
|
const windows = {
|
|
678
695
|
"1d": 86400,
|
|
679
696
|
"1w": 604800,
|
|
@@ -685,10 +702,10 @@ async function handleHistory(options) {
|
|
|
685
702
|
process.cwd(),
|
|
686
703
|
"deepline",
|
|
687
704
|
"data",
|
|
688
|
-
|
|
705
|
+
_chunk4RV7U3RPjs.createTimestampedName.call(void 0, `billing-history-${options.time}`, "csv")
|
|
689
706
|
);
|
|
690
707
|
const summary = await exportLedger(http, outputPath, { sinceAt });
|
|
691
|
-
|
|
708
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
692
709
|
{
|
|
693
710
|
output_path: outputPath,
|
|
694
711
|
row_count: summary.row_count,
|
|
@@ -725,14 +742,14 @@ async function handleLedgerExportAll(options) {
|
|
|
725
742
|
);
|
|
726
743
|
return;
|
|
727
744
|
}
|
|
728
|
-
const { http } =
|
|
745
|
+
const { http } = _chunk4RV7U3RPjs.getAuthedHttpClient.call(void 0, );
|
|
729
746
|
const outputPath = options.output ? _path.resolve.call(void 0, String(options.output)) : defaultLedgerExportPath();
|
|
730
747
|
const summary = await exportLedger(http, outputPath, {
|
|
731
748
|
sinceAt,
|
|
732
749
|
runId: options.runId,
|
|
733
750
|
operation: options.operation
|
|
734
751
|
});
|
|
735
|
-
|
|
752
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
736
753
|
{
|
|
737
754
|
output_path: outputPath,
|
|
738
755
|
row_count: summary.row_count,
|
|
@@ -772,7 +789,7 @@ function targetPlanLine(plan) {
|
|
|
772
789
|
return `${plan.name} (${plan.sku}) | ${planPriceText(plan.recurring_price_usd, plan.interval)}${firstMonth} | ${plan.included_credits} included credits/month | $${plan.purchased_credit_price_usd}/purchased credit | ${plan.acquisition_enabled ? "available" : "unavailable"}`;
|
|
773
790
|
}
|
|
774
791
|
async function handlePlans(options) {
|
|
775
|
-
const client = new (0,
|
|
792
|
+
const client = new (0, _chunkHMUBLAT4js.DeeplineClient)();
|
|
776
793
|
const payload = await client.billing.targetPlans();
|
|
777
794
|
const listedCurrentPlan = payload.plans.find(
|
|
778
795
|
(plan) => plan.sku === payload.current_plan_sku
|
|
@@ -785,8 +802,8 @@ async function handlePlans(options) {
|
|
|
785
802
|
...payload.plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...payload.plans.map(targetPlanLine)],
|
|
786
803
|
"Change plan: deepline billing change-plan <plan_sku>"
|
|
787
804
|
];
|
|
788
|
-
const legacyPayload =
|
|
789
|
-
|
|
805
|
+
const legacyPayload = _chunk4RV7U3RPjs.shouldEmitJson.call(void 0, options.json) ? await client.billing.plans() : null;
|
|
806
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
790
807
|
{
|
|
791
808
|
..._nullishCoalesce(legacyPayload, () => ( payload)),
|
|
792
809
|
...legacyPayload ? { target_billing: payload } : {},
|
|
@@ -796,7 +813,7 @@ async function handlePlans(options) {
|
|
|
796
813
|
);
|
|
797
814
|
}
|
|
798
815
|
async function handleSubscribe(planVersionId, options) {
|
|
799
|
-
const { http } =
|
|
816
|
+
const { http } = _chunk4RV7U3RPjs.getAuthedHttpClient.call(void 0, );
|
|
800
817
|
const payload = await http.request(
|
|
801
818
|
"/api/v2/billing/subscription/checkout",
|
|
802
819
|
{
|
|
@@ -805,8 +822,8 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
805
822
|
}
|
|
806
823
|
);
|
|
807
824
|
const url = String(payload.checkout_url || "");
|
|
808
|
-
if (!options.json && options.open !== false && url)
|
|
809
|
-
|
|
825
|
+
if (!options.json && options.open !== false && url) _chunk4RV7U3RPjs.openInBrowser.call(void 0, url);
|
|
826
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
810
827
|
{
|
|
811
828
|
...payload,
|
|
812
829
|
render: {
|
|
@@ -822,7 +839,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
822
839
|
);
|
|
823
840
|
}
|
|
824
841
|
async function handleSubscriptionStatus(options) {
|
|
825
|
-
const client = new (0,
|
|
842
|
+
const client = new (0, _chunkHMUBLAT4js.DeeplineClient)();
|
|
826
843
|
const payload = await client.billing.subscription.status();
|
|
827
844
|
const pools = _nullishCoalesce(payload.credit_pools, () => ( []));
|
|
828
845
|
const lines = [
|
|
@@ -842,7 +859,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
842
859
|
],
|
|
843
860
|
`Assigned by: ${_nullishCoalesce(payload.assigned_by, () => ( "default"))}`
|
|
844
861
|
];
|
|
845
|
-
|
|
862
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
846
863
|
{
|
|
847
864
|
...payload,
|
|
848
865
|
render: { sections: [{ title: "billing subscription", lines }] }
|
|
@@ -851,7 +868,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
851
868
|
);
|
|
852
869
|
}
|
|
853
870
|
async function handleSubscriptionCancel(options) {
|
|
854
|
-
const client = new (0,
|
|
871
|
+
const client = new (0, _chunkHMUBLAT4js.DeeplineClient)();
|
|
855
872
|
const action = options.undo ? "undo_cancel" : "cancel";
|
|
856
873
|
if (options.dryRun) {
|
|
857
874
|
const status = await client.billing.subscription.status();
|
|
@@ -868,7 +885,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
868
885
|
return;
|
|
869
886
|
}
|
|
870
887
|
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.";
|
|
871
|
-
|
|
888
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
872
889
|
{
|
|
873
890
|
ok: true,
|
|
874
891
|
dry_run: true,
|
|
@@ -923,7 +940,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
923
940
|
"Remaining credits are yours to keep \u2014 cancellation never removes credits.",
|
|
924
941
|
"Undo with: deepline billing subscription cancel --undo"
|
|
925
942
|
];
|
|
926
|
-
|
|
943
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
927
944
|
{
|
|
928
945
|
ok: true,
|
|
929
946
|
...result,
|
|
@@ -977,7 +994,7 @@ async function handleInvoices(options) {
|
|
|
977
994
|
return;
|
|
978
995
|
}
|
|
979
996
|
}
|
|
980
|
-
const client = new (0,
|
|
997
|
+
const client = new (0, _chunkHMUBLAT4js.DeeplineClient)();
|
|
981
998
|
let payload;
|
|
982
999
|
try {
|
|
983
1000
|
payload = await client.billing.invoices.list(
|
|
@@ -1006,7 +1023,7 @@ async function handleInvoices(options) {
|
|
|
1006
1023
|
url: entry.url
|
|
1007
1024
|
}))
|
|
1008
1025
|
} : { ...payload, count: entries.length };
|
|
1009
|
-
|
|
1026
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1010
1027
|
{
|
|
1011
1028
|
...envelope,
|
|
1012
1029
|
render: { sections: [{ title: "billing invoices", lines }] }
|
|
@@ -1015,7 +1032,7 @@ async function handleInvoices(options) {
|
|
|
1015
1032
|
);
|
|
1016
1033
|
}
|
|
1017
1034
|
async function handleCheckout(options) {
|
|
1018
|
-
const { http } =
|
|
1035
|
+
const { http } = _chunk4RV7U3RPjs.getAuthedHttpClient.call(void 0, );
|
|
1019
1036
|
const payload = await http.post(
|
|
1020
1037
|
"/api/v2/billing/checkout",
|
|
1021
1038
|
{
|
|
@@ -1025,8 +1042,8 @@ async function handleCheckout(options) {
|
|
|
1025
1042
|
}
|
|
1026
1043
|
);
|
|
1027
1044
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1028
|
-
if (!options.json && !options.noOpen && url)
|
|
1029
|
-
|
|
1045
|
+
if (!options.json && !options.noOpen && url) _chunk4RV7U3RPjs.openInBrowser.call(void 0, url);
|
|
1046
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1030
1047
|
{
|
|
1031
1048
|
...payload,
|
|
1032
1049
|
render: {
|
|
@@ -1071,7 +1088,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1071
1088
|
return;
|
|
1072
1089
|
}
|
|
1073
1090
|
if (options.dryRun) {
|
|
1074
|
-
|
|
1091
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1075
1092
|
{
|
|
1076
1093
|
ok: true,
|
|
1077
1094
|
dry_run: true,
|
|
@@ -1101,7 +1118,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1101
1118
|
);
|
|
1102
1119
|
return;
|
|
1103
1120
|
}
|
|
1104
|
-
const client = new (0,
|
|
1121
|
+
const client = new (0, _chunkHMUBLAT4js.DeeplineClient)();
|
|
1105
1122
|
let payload;
|
|
1106
1123
|
try {
|
|
1107
1124
|
payload = await client.billing.topUpWithReceipt({
|
|
@@ -1118,7 +1135,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1118
1135
|
return;
|
|
1119
1136
|
}
|
|
1120
1137
|
if (payload.status === "pending") {
|
|
1121
|
-
|
|
1138
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1122
1139
|
{
|
|
1123
1140
|
ok: true,
|
|
1124
1141
|
...payload,
|
|
@@ -1182,17 +1199,17 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1182
1199
|
]
|
|
1183
1200
|
}
|
|
1184
1201
|
};
|
|
1185
|
-
|
|
1202
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0, options.compact ? compactEnvelope : fullEnvelope, {
|
|
1186
1203
|
json: options.json
|
|
1187
1204
|
});
|
|
1188
1205
|
}
|
|
1189
1206
|
async function handleTargetStatus(options) {
|
|
1190
|
-
const client = new (0,
|
|
1207
|
+
const client = new (0, _chunkHMUBLAT4js.DeeplineClient)();
|
|
1191
1208
|
const payload = await client.billing.targetStatus();
|
|
1192
1209
|
const balanceCommand = "deepline billing balance";
|
|
1193
1210
|
const recentChargesCommand = "deepline billing usage --limit 5";
|
|
1194
1211
|
const exactChargeCommand = "deepline billing usage --request-id <job_id>";
|
|
1195
|
-
|
|
1212
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1196
1213
|
{
|
|
1197
1214
|
ok: true,
|
|
1198
1215
|
...payload,
|
|
@@ -1228,10 +1245,10 @@ function formatComputeMinutes(minutes) {
|
|
|
1228
1245
|
return minutes < 120 ? `${Number(minutes.toFixed(1)).toLocaleString("en-US")} minutes` : `${Number((minutes / 60).toFixed(1)).toLocaleString("en-US")} hours`;
|
|
1229
1246
|
}
|
|
1230
1247
|
async function handleIncludedCompute(options) {
|
|
1231
|
-
const client = new (0,
|
|
1248
|
+
const client = new (0, _chunkHMUBLAT4js.DeeplineClient)();
|
|
1232
1249
|
const payload = options.enable ? await client.billing.enableIncludedCompute() : await client.billing.includedCompute();
|
|
1233
1250
|
const plan = `${formatComputeMinutes(payload.plan.included_minutes)} standard-equivalent compute included per month, then ${Math.round(payload.plan.credits_per_minute * 60)} credits/standard hour`;
|
|
1234
|
-
|
|
1251
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1235
1252
|
{
|
|
1236
1253
|
ok: true,
|
|
1237
1254
|
...payload,
|
|
@@ -1257,8 +1274,8 @@ async function handleIncludedCompute(options) {
|
|
|
1257
1274
|
);
|
|
1258
1275
|
}
|
|
1259
1276
|
async function handleEntitlements(options) {
|
|
1260
|
-
const payload = await new (0,
|
|
1261
|
-
|
|
1277
|
+
const payload = await new (0, _chunkHMUBLAT4js.DeeplineClient)().billing.entitlements();
|
|
1278
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1262
1279
|
{
|
|
1263
1280
|
ok: true,
|
|
1264
1281
|
...payload,
|
|
@@ -1291,7 +1308,7 @@ async function handleEntitlements(options) {
|
|
|
1291
1308
|
);
|
|
1292
1309
|
}
|
|
1293
1310
|
async function handleAutoRechargeStatus(options) {
|
|
1294
|
-
const payload = await new (0,
|
|
1311
|
+
const payload = await new (0, _chunkHMUBLAT4js.DeeplineClient)().billing.autoRecharge.get();
|
|
1295
1312
|
const state = payload.available ? payload.enabled ? "on" : "off" : "unavailable";
|
|
1296
1313
|
const lines = [
|
|
1297
1314
|
`State: ${state}`,
|
|
@@ -1301,7 +1318,7 @@ async function handleAutoRechargeStatus(options) {
|
|
|
1301
1318
|
`Automatic credit purchase cap: ${payload.purchase_limit_credits} credits per rolling 30 days`
|
|
1302
1319
|
] : []
|
|
1303
1320
|
];
|
|
1304
|
-
|
|
1321
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1305
1322
|
{
|
|
1306
1323
|
ok: true,
|
|
1307
1324
|
...payload,
|
|
@@ -1350,7 +1367,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1350
1367
|
}
|
|
1351
1368
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1352
1369
|
if (options.dryRun) {
|
|
1353
|
-
|
|
1370
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1354
1371
|
{
|
|
1355
1372
|
ok: true,
|
|
1356
1373
|
dry_run: true,
|
|
@@ -1371,7 +1388,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1371
1388
|
);
|
|
1372
1389
|
return;
|
|
1373
1390
|
}
|
|
1374
|
-
const payload = await new (0,
|
|
1391
|
+
const payload = await new (0, _chunkHMUBLAT4js.DeeplineClient)().billing.autoRecharge.update({
|
|
1375
1392
|
enabled: true,
|
|
1376
1393
|
thresholdCredits,
|
|
1377
1394
|
refillToCredits,
|
|
@@ -1379,7 +1396,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1379
1396
|
...rollingLimitCredits !== void 0 ? { purchaseLimitCredits: rollingLimitCredits } : {},
|
|
1380
1397
|
idempotencyKey
|
|
1381
1398
|
});
|
|
1382
|
-
|
|
1399
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1383
1400
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1384
1401
|
{ json: options.json }
|
|
1385
1402
|
);
|
|
@@ -1387,7 +1404,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1387
1404
|
async function handleAutoRechargeOff(options) {
|
|
1388
1405
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1389
1406
|
if (options.dryRun) {
|
|
1390
|
-
|
|
1407
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1391
1408
|
{
|
|
1392
1409
|
ok: true,
|
|
1393
1410
|
dry_run: true,
|
|
@@ -1402,11 +1419,11 @@ async function handleAutoRechargeOff(options) {
|
|
|
1402
1419
|
);
|
|
1403
1420
|
return;
|
|
1404
1421
|
}
|
|
1405
|
-
const payload = await new (0,
|
|
1422
|
+
const payload = await new (0, _chunkHMUBLAT4js.DeeplineClient)().billing.autoRecharge.update({
|
|
1406
1423
|
enabled: false,
|
|
1407
1424
|
idempotencyKey
|
|
1408
1425
|
});
|
|
1409
|
-
|
|
1426
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1410
1427
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1411
1428
|
{ json: options.json }
|
|
1412
1429
|
);
|
|
@@ -1425,11 +1442,11 @@ async function handleBuyCredits(creditsRaw, options) {
|
|
|
1425
1442
|
return;
|
|
1426
1443
|
}
|
|
1427
1444
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1428
|
-
const payload = await new (0,
|
|
1445
|
+
const payload = await new (0, _chunkHMUBLAT4js.DeeplineClient)().billing.purchaseCredits({
|
|
1429
1446
|
credits,
|
|
1430
1447
|
idempotencyKey
|
|
1431
1448
|
});
|
|
1432
|
-
|
|
1449
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1433
1450
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1434
1451
|
{ json: options.json }
|
|
1435
1452
|
);
|
|
@@ -1465,7 +1482,7 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1465
1482
|
return;
|
|
1466
1483
|
}
|
|
1467
1484
|
if (options.dryRun) {
|
|
1468
|
-
|
|
1485
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1469
1486
|
{
|
|
1470
1487
|
ok: true,
|
|
1471
1488
|
dry_run: true,
|
|
@@ -1478,12 +1495,12 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1478
1495
|
);
|
|
1479
1496
|
return;
|
|
1480
1497
|
}
|
|
1481
|
-
const payload = await new (0,
|
|
1498
|
+
const payload = await new (0, _chunkHMUBLAT4js.DeeplineClient)().billing.recoverCreditPurchase({
|
|
1482
1499
|
credits,
|
|
1483
1500
|
orgId: options.orgId,
|
|
1484
1501
|
idempotencyKey: options.idempotencyKey
|
|
1485
1502
|
});
|
|
1486
|
-
|
|
1503
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1487
1504
|
{ ok: true, idempotency_key: options.idempotencyKey, ...payload },
|
|
1488
1505
|
{ json: options.json }
|
|
1489
1506
|
);
|
|
@@ -1503,37 +1520,37 @@ async function handleTargetPlan(planSku, options) {
|
|
|
1503
1520
|
return;
|
|
1504
1521
|
}
|
|
1505
1522
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1506
|
-
const payload = await new (0,
|
|
1523
|
+
const payload = await new (0, _chunkHMUBLAT4js.DeeplineClient)().billing.transitionPlan({
|
|
1507
1524
|
action: "start_or_change",
|
|
1508
1525
|
targetPlanSku: planSku,
|
|
1509
1526
|
...options.billingEmail ? { billingEmail: options.billingEmail } : {},
|
|
1510
1527
|
idempotencyKey
|
|
1511
1528
|
});
|
|
1512
|
-
|
|
1529
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1513
1530
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1514
1531
|
{ json: options.json }
|
|
1515
1532
|
);
|
|
1516
1533
|
}
|
|
1517
1534
|
async function handleTargetPlanCancellation(options) {
|
|
1518
1535
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1519
|
-
const payload = await new (0,
|
|
1536
|
+
const payload = await new (0, _chunkHMUBLAT4js.DeeplineClient)().billing.transitionPlan({
|
|
1520
1537
|
action: options.undo ? "undo_cancel" : "cancel",
|
|
1521
1538
|
idempotencyKey
|
|
1522
1539
|
});
|
|
1523
|
-
|
|
1540
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1524
1541
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1525
1542
|
{ json: options.json }
|
|
1526
1543
|
);
|
|
1527
1544
|
}
|
|
1528
1545
|
async function handleTargetPortal(options) {
|
|
1529
|
-
const payload = await new (0,
|
|
1546
|
+
const payload = await new (0, _chunkHMUBLAT4js.DeeplineClient)().billing.portalSession(
|
|
1530
1547
|
options.billingAddress ? { flow: "customer_update" } : void 0
|
|
1531
1548
|
);
|
|
1532
|
-
if (!options.json && !options.noOpen)
|
|
1533
|
-
|
|
1549
|
+
if (!options.json && !options.noOpen) _chunk4RV7U3RPjs.openInBrowser.call(void 0, payload.url);
|
|
1550
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1534
1551
|
}
|
|
1535
1552
|
async function handleRedeemCode(code, options) {
|
|
1536
|
-
const { http } =
|
|
1553
|
+
const { http } = _chunk4RV7U3RPjs.getAuthedHttpClient.call(void 0, );
|
|
1537
1554
|
const payload = await http.post(
|
|
1538
1555
|
"/api/v2/billing/checkout",
|
|
1539
1556
|
{
|
|
@@ -1541,8 +1558,8 @@ async function handleRedeemCode(code, options) {
|
|
|
1541
1558
|
}
|
|
1542
1559
|
);
|
|
1543
1560
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1544
|
-
if (!options.json && !options.noOpen && url)
|
|
1545
|
-
|
|
1561
|
+
if (!options.json && !options.noOpen && url) _chunk4RV7U3RPjs.openInBrowser.call(void 0, url);
|
|
1562
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0,
|
|
1546
1563
|
{
|
|
1547
1564
|
...payload,
|
|
1548
1565
|
render: {
|
|
@@ -1595,21 +1612,21 @@ Examples:
|
|
|
1595
1612
|
"--sandbox-timeout <duration>",
|
|
1596
1613
|
"Runtime timeout, such as 30m or 2h"
|
|
1597
1614
|
).addOption(
|
|
1598
|
-
new (0, _commander.Option)("--sandbox-size <size>", "Runtime memory profile").choices([
|
|
1615
|
+
new (0, _commander.Option)("--sandbox-size <size>", "Runtime memory profile").choices([..._chunkYGCKMI5Pjs.PLAY_SANDBOX_SIZE_INPUTS]).default("standard")
|
|
1599
1616
|
).option("--quantity <sessions>", "Number of sandbox sessions", "1").option("--json", "Emit the bounded component quotation as JSON").action(
|
|
1600
1617
|
async (options) => {
|
|
1601
1618
|
const quantity = Number(options.quantity);
|
|
1602
1619
|
if (!Number.isSafeInteger(quantity) || quantity <= 0) {
|
|
1603
1620
|
throw new Error("--quantity must be a positive safe integer.");
|
|
1604
1621
|
}
|
|
1605
|
-
const quote = await new (0,
|
|
1622
|
+
const quote = await new (0, _chunkHMUBLAT4js.DeeplineClient)().billing.quote({
|
|
1606
1623
|
quantity,
|
|
1607
1624
|
sandbox_runtime: {
|
|
1608
1625
|
timeout: options.sandboxTimeout,
|
|
1609
1626
|
size: options.sandboxSize
|
|
1610
1627
|
}
|
|
1611
1628
|
});
|
|
1612
|
-
|
|
1629
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0, quote, {
|
|
1613
1630
|
json: options.json,
|
|
1614
1631
|
text: `Sandbox session ceiling: ${quote.maximum_credits} Deepline credits (${quote.quantity} session${quote.quantity === 1 ? "" : "s"}).
|
|
1615
1632
|
${quote.explanation}
|
|
@@ -1660,6 +1677,9 @@ Examples:
|
|
|
1660
1677
|
).option(
|
|
1661
1678
|
"--events",
|
|
1662
1679
|
"Read a raw usage-event page instead of the billing summary"
|
|
1680
|
+
).option(
|
|
1681
|
+
"--recent-only",
|
|
1682
|
+
"Read recent billing activity without spend totals"
|
|
1663
1683
|
).option("--limit <n>", "Page size (1\u2013500 with --events)").option("--offset <n>", "Recent-call offset").option(
|
|
1664
1684
|
"--cursor <cursor>",
|
|
1665
1685
|
"Recent-call cursor from the previous response"
|
|
@@ -1854,8 +1874,8 @@ Examples:
|
|
|
1854
1874
|
new (0, _commander.Command)("trigger").description(
|
|
1855
1875
|
"Evaluate capped automatic recharge and resume any pending purchase."
|
|
1856
1876
|
).option("--json", "Emit JSON output").action(async (options) => {
|
|
1857
|
-
const result = await new (0,
|
|
1858
|
-
|
|
1877
|
+
const result = await new (0, _chunkHMUBLAT4js.DeeplineClient)().billing.autoRecharge.trigger();
|
|
1878
|
+
_chunk4RV7U3RPjs.printCommandEnvelope.call(void 0, { ok: true, ...result }, { json: options.json });
|
|
1859
1879
|
})
|
|
1860
1880
|
);
|
|
1861
1881
|
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(
|