deepline 0.3.326 → 0.3.328
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/play-runtime/projection.ts +11 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +14 -1
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +4 -0
- package/dist/cli/{auth-VON5FFUK.mjs → auth-ANHHABWT.mjs} +4 -4
- package/dist/cli/auth-EKRB4GMP.js +31 -0
- package/dist/cli/{billing-YI4RZI2O.js → billing-GGVKLFE6.js} +96 -82
- package/dist/cli/{billing-X6JUEFRE.mjs → billing-R6NYYO6G.mjs} +30 -16
- package/dist/cli/{chunk-TZQMFWLF.js → chunk-2FPVWL4W.js} +47 -47
- package/dist/cli/{chunk-VKXGOQG5.mjs → chunk-6ENR652E.mjs} +6 -6
- package/dist/cli/{chunk-3NGWGFVL.js → chunk-7DDNACAQ.js} +26 -26
- package/dist/cli/{chunk-VGKVLADU.mjs → chunk-7MABE3ZK.mjs} +3 -3
- package/dist/cli/{chunk-KLWBAQ5A.mjs → chunk-7R6KQSFA.mjs} +1 -1
- package/dist/cli/{chunk-4AB4Y6FF.mjs → chunk-AKKQ26RX.mjs} +1 -1
- package/dist/cli/{chunk-M7CPVMDB.mjs → chunk-B2R66UTW.mjs} +1 -1
- package/dist/cli/{chunk-MOBZS4F3.mjs → chunk-BC7FMQ2G.mjs} +1 -1
- package/dist/cli/{chunk-CUUHQ3AO.js → chunk-DNMV2L7Q.js} +6 -6
- package/dist/cli/{chunk-MKHSZA2X.js → chunk-DNYRAZSK.js} +48 -48
- package/dist/cli/{chunk-DFDXKOLR.mjs → chunk-GZV5F6CL.mjs} +5 -5
- package/dist/cli/{chunk-GVYKY6T6.js → chunk-ITFUZEHE.js} +9 -9
- package/dist/cli/{chunk-5NXHSRRE.js → chunk-LEEXRXQQ.js} +6 -6
- package/dist/cli/{chunk-KZ4PCK4O.js → chunk-LJWC5HSO.js} +15 -15
- package/dist/cli/{chunk-TXVOB5J2.js → chunk-O5GPNPOC.js} +4 -4
- package/dist/cli/{chunk-W74E5ETE.mjs → chunk-OOLIEDIJ.mjs} +2 -2
- package/dist/cli/{chunk-ZRN6YOF2.mjs → chunk-SMGNDW7O.mjs} +2 -2
- package/dist/cli/{chunk-T33W6JUJ.js → chunk-UDIPEHNJ.js} +6 -6
- package/dist/cli/{chunk-TDSNAC3C.mjs → chunk-UM4ZE3P7.mjs} +2 -2
- package/dist/cli/{chunk-4LNBSQM4.js → chunk-W6WV6UME.js} +224 -224
- package/dist/cli/{chunk-BR7GGTAE.mjs → chunk-WWVE4HFN.mjs} +1 -1
- package/dist/cli/{chunk-MDQZQ3NY.js → chunk-XVKQ6D4K.js} +2 -2
- package/dist/cli/{chunk-BUYZEUY4.js → chunk-Y4LXIUHX.js} +1 -1
- package/dist/cli/{chunk-BQJVMKWL.mjs → chunk-YFCHBN3C.mjs} +1 -1
- package/dist/cli/{chunk-EMZ7Y5SW.js → chunk-ZFKUVDOM.js} +60 -60
- package/dist/cli/{chunk-IQCCGOQH.mjs → chunk-ZND34HL7.mjs} +4 -4
- package/dist/cli/client-55BDB4LE.js +20 -0
- package/dist/cli/{client-ZMOKUNL2.mjs → client-ZABA5NMD.mjs} +3 -3
- package/dist/cli/{csv-HZRKEI7J.js → csv-4ZK5ZJAJ.js} +12 -12
- package/dist/cli/{csv-IICJHJZ4.mjs → csv-VECE3PWX.mjs} +3 -3
- package/dist/cli/{db-X4B7YFNY.mjs → db-6VE4OEWW.mjs} +4 -4
- package/dist/cli/{db-TM5NZF73.js → db-UJPCDBV7.js} +29 -29
- package/dist/cli/{describe-BDBARWZJ.js → describe-CFUZZ326.js} +15 -15
- package/dist/cli/{describe-GMVS3LFC.mjs → describe-W6X5G4JR.mjs} +8 -8
- package/dist/cli/{executions-QX25UOQM.js → executions-AI4DTQQL.js} +6 -6
- package/dist/cli/{executions-447ZJMN4.mjs → executions-ZZWB75DF.mjs} +4 -4
- package/dist/cli/{feedback-4IXUTBX7.js → feedback-FYSNSYUU.js} +6 -6
- package/dist/cli/{feedback-JB7HHIC6.mjs → feedback-IM5Z6T5K.mjs} +3 -3
- package/dist/cli/git-VWXH6LCP.js +23 -0
- package/dist/cli/{git-VID6KGAA.mjs → git-YNYTK3YW.mjs} +4 -4
- package/dist/cli/index.js +95 -80
- package/dist/cli/index.mjs +54 -39
- package/dist/cli/{legacy-noops-SGR3G5WS.mjs → legacy-noops-4DTMYYUY.mjs} +4 -4
- package/dist/cli/{legacy-noops-3FYTCOZO.js → legacy-noops-PHJE2XFK.js} +7 -7
- package/dist/cli/{monitors-SP52UHS4.js → monitors-27JP76WE.js} +85 -85
- package/dist/cli/{monitors-SH4FOMBM.mjs → monitors-HUP4MVWJ.mjs} +4 -4
- package/dist/cli/{org-B32MMIQT.mjs → org-L3B2RR4U.mjs} +4 -4
- package/dist/cli/{org-UQMX7JOR.js → org-RHVDMUKN.js} +60 -60
- package/dist/cli/play-UKH4VFPF.js +153 -0
- package/dist/cli/{play-XTE4LUP7.mjs → play-UXIJVYNF.mjs} +7 -7
- package/dist/cli/{providers-RWLN6FUR.mjs → providers-FABWTNKR.mjs} +4 -4
- package/dist/cli/{providers-JNMJJ2OH.js → providers-VL6VY56M.js} +7 -7
- package/dist/cli/{quickstart-HK6WZ342.js → quickstart-IIPZ6DSY.js} +5 -5
- package/dist/cli/{quickstart-IDB3Y375.mjs → quickstart-OA54A4IE.mjs} +3 -3
- package/dist/cli/search-JD2VTR4A.js +26 -0
- package/dist/cli/{search-6D3IFNPT.mjs → search-YDK4V2EW.mjs} +5 -5
- package/dist/cli/{secrets-TZ53CQ3D.mjs → secrets-4MQF6RF6.mjs} +4 -4
- package/dist/cli/{secrets-JOQB57IE.js → secrets-JGU7ZRUW.js} +13 -13
- package/dist/cli/{sessions-QSAICDXX.js → sessions-I7ZZYSYW.js} +5 -5
- package/dist/cli/{sessions-4MBDC4EK.mjs → sessions-PTHOMSZ5.mjs} +4 -4
- package/dist/cli/{settings-RKQFMLDU.mjs → settings-X4ENSGNK.mjs} +7 -7
- package/dist/cli/{settings-OTOCW7L7.js → settings-ZUUBKIG6.js} +74 -74
- package/dist/cli/{setup-2S5TNTUB.mjs → setup-4UM6FCZL.mjs} +6 -6
- package/dist/cli/{setup-AKZUDVYY.js → setup-6L576TQE.js} +41 -41
- package/dist/cli/skills-TLPNCERR.js +28 -0
- package/dist/cli/{skills-AGZXDLSA.mjs → skills-U3BS5KUI.mjs} +4 -4
- package/dist/cli/tools-26JTFFU4.js +39 -0
- package/dist/cli/{tools-7Y6RD6FY.mjs → tools-O4PX6UVB.mjs} +6 -6
- package/dist/cli/update-35RRCU2G.js +28 -0
- package/dist/cli/{update-M7YGF67I.mjs → update-OHWSK2WN.mjs} +6 -6
- package/dist/cli/{workflow-NGMY425T.js → workflow-QWTZBLT3.js} +15 -15
- package/dist/cli/{workflow-CTVE7S7W.mjs → workflow-RVMGBMLX.mjs} +5 -5
- package/dist/index.js +57 -47
- package/dist/index.mjs +14 -4
- package/dist/install-integrity.json +74 -74
- 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-6STWK6UK.js +0 -31
- package/dist/cli/client-TEBW2P24.js +0 -20
- package/dist/cli/git-C7C7DTEH.js +0 -23
- package/dist/cli/play-UCIWBN7U.js +0 -153
- package/dist/cli/search-LUZ2S7DH.js +0 -26
- package/dist/cli/skills-26LASHZF.js +0 -28
- package/dist/cli/tools-L5VIJQWX.js +0 -39
- package/dist/cli/update-MNHF6M2F.js +0 -28
|
@@ -1,7 +1,7 @@
|
|
|
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
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkITFUZEHEjs = require('./chunk-ITFUZEHE.js');
|
|
5
5
|
require('./chunk-LA46MMTL.js');
|
|
6
6
|
|
|
7
7
|
|
|
@@ -9,13 +9,13 @@ require('./chunk-LA46MMTL.js');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkDNMV2L7Qjs = require('./chunk-DNMV2L7Q.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkO5GPNPOCjs = require('./chunk-O5GPNPOC.js');
|
|
17
17
|
require('./chunk-XNYIZMNQ.js');
|
|
18
|
-
require('./chunk-
|
|
18
|
+
require('./chunk-Y4LXIUHX.js');
|
|
19
19
|
require('./chunk-S6R3OX7B.js');
|
|
20
20
|
|
|
21
21
|
|
|
@@ -34,7 +34,7 @@ var SUBSCRIPTION_CANCEL_PATH = "/api/v2/billing/subscription/cancel";
|
|
|
34
34
|
var BILLING_TOP_UP_PATH = "/api/v2/billing/top-up";
|
|
35
35
|
var DEFAULT_BALANCE_RECOVERY_CREDITS = 100;
|
|
36
36
|
function billingFailureFromError(error, options) {
|
|
37
|
-
if (error instanceof
|
|
37
|
+
if (error instanceof _chunkO5GPNPOCjs.AuthError) {
|
|
38
38
|
return {
|
|
39
39
|
exitCode: 3,
|
|
40
40
|
code: "AUTH_ERROR",
|
|
@@ -68,7 +68,7 @@ function reportBillingFailure(failure, options) {
|
|
|
68
68
|
if (failure.next) {
|
|
69
69
|
textLines.push(`Next: ${failure.next}`);
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
72
72
|
{
|
|
73
73
|
ok: false,
|
|
74
74
|
exitCode: failure.exitCode,
|
|
@@ -130,7 +130,7 @@ function apiErrorCode(error) {
|
|
|
130
130
|
return _nullishCoalesce(error.code, () => ( "BILLING_API_ERROR"));
|
|
131
131
|
}
|
|
132
132
|
function billingTopUpFailureFromError(error, input) {
|
|
133
|
-
if (error instanceof
|
|
133
|
+
if (error instanceof _chunkO5GPNPOCjs.AuthError || error instanceof _chunkO5GPNPOCjs.ConfigError) {
|
|
134
134
|
return {
|
|
135
135
|
exitCode: 3,
|
|
136
136
|
code: "AUTH_ERROR",
|
|
@@ -299,7 +299,7 @@ function defaultLedgerExportPath() {
|
|
|
299
299
|
);
|
|
300
300
|
}
|
|
301
301
|
async function handleBalance(options) {
|
|
302
|
-
const { http } =
|
|
302
|
+
const { http } = _chunkDNMV2L7Qjs.getAuthedHttpClient.call(void 0, );
|
|
303
303
|
const payload = await http.get(
|
|
304
304
|
"/api/v2/billing/balance"
|
|
305
305
|
);
|
|
@@ -307,41 +307,42 @@ async function handleBalance(options) {
|
|
|
307
307
|
const needsCredits = status === "no_billing" || status === "zero_balance" || status === "payment_method_only";
|
|
308
308
|
const recovery = needsCredits ? balanceRecoveryForCredits() : null;
|
|
309
309
|
const lines = [`Balance: ${_nullishCoalesce(payload.balance, () => ( "(unknown)"))} credits`];
|
|
310
|
+
const detail = [];
|
|
310
311
|
const temporaryHolds = payload.temporary_hold_credits;
|
|
311
312
|
if (typeof temporaryHolds === "number" && temporaryHolds > 0) {
|
|
312
|
-
|
|
313
|
+
detail.push(`Open reservation exposure: ${temporaryHolds} credits.`);
|
|
313
314
|
} else if (temporaryHolds === null) {
|
|
314
|
-
|
|
315
|
+
detail.push("Temporary reservation status is temporarily unavailable.");
|
|
315
316
|
}
|
|
316
317
|
if (payload.temporary_hold_credits_truncated === true) {
|
|
317
|
-
|
|
318
|
+
detail.push("Temporary reservation total may be incomplete.");
|
|
318
319
|
}
|
|
319
320
|
if (typeof payload.estimated_hold_credits === "number") {
|
|
320
|
-
|
|
321
|
+
detail.push(
|
|
321
322
|
`Estimated holds: ${payload.estimated_hold_credits} credits \u2014 final usage is not recorded yet.`
|
|
322
323
|
);
|
|
323
324
|
}
|
|
324
325
|
if (typeof payload.incurred_unsettled_credits === "number") {
|
|
325
|
-
|
|
326
|
+
detail.push(
|
|
326
327
|
`Incurred, awaiting settlement: ${payload.incurred_unsettled_credits} credits.`
|
|
327
328
|
);
|
|
328
329
|
}
|
|
329
330
|
if (typeof payload.pending_wallet_debit_credits === "number") {
|
|
330
|
-
|
|
331
|
+
detail.push(
|
|
331
332
|
`Pending wallet debit: ${payload.pending_wallet_debit_credits} credits \u2014 excludes amounts already debited for funded holds.`
|
|
332
333
|
);
|
|
333
334
|
}
|
|
334
335
|
if (typeof payload.pending_wallet_refund_credits === "number" && payload.pending_wallet_refund_credits > 0) {
|
|
335
|
-
|
|
336
|
+
detail.push(
|
|
336
337
|
`Pending wallet refund: ${payload.pending_wallet_refund_credits} credits.`
|
|
337
338
|
);
|
|
338
339
|
}
|
|
339
340
|
if (payload.exposure_status === "partial") {
|
|
340
|
-
|
|
341
|
+
detail.push(
|
|
341
342
|
"Exposure amounts are lower bounds: some reservations are unpriced or the scan is incomplete."
|
|
342
343
|
);
|
|
343
344
|
} else if (payload.exposure_status !== "complete") {
|
|
344
|
-
|
|
345
|
+
detail.push(
|
|
345
346
|
"The estimated and incurred usage breakdown is temporarily unavailable."
|
|
346
347
|
);
|
|
347
348
|
}
|
|
@@ -361,13 +362,21 @@ async function handleBalance(options) {
|
|
|
361
362
|
lines.push(`If the user approves, run: ${recovery.top_up_command}`);
|
|
362
363
|
lines.push(`If checkout is required, run: ${recovery.checkout_command}`);
|
|
363
364
|
}
|
|
364
|
-
|
|
365
|
+
const text = [lines[0], ...options.verbose ? detail : [], ...lines.slice(1)];
|
|
366
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
365
367
|
{
|
|
366
368
|
...payload,
|
|
367
369
|
...recovery ? { recovery } : {},
|
|
368
|
-
render: {
|
|
370
|
+
render: {
|
|
371
|
+
sections: [
|
|
372
|
+
{ title: "billing balance", lines: [lines[0], ...detail, ...lines.slice(1)] }
|
|
373
|
+
]
|
|
374
|
+
}
|
|
369
375
|
},
|
|
370
|
-
|
|
376
|
+
// Short text unless JSON is asked for by name: piping no longer switches
|
|
377
|
+
// this command to JSON.
|
|
378
|
+
options.json ? { json: true } : { json: false, text: `${text.join("\n")}
|
|
379
|
+
` }
|
|
371
380
|
);
|
|
372
381
|
return;
|
|
373
382
|
}
|
|
@@ -375,7 +384,7 @@ function quoteShellArgument(value) {
|
|
|
375
384
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
376
385
|
}
|
|
377
386
|
async function handleUsage(options) {
|
|
378
|
-
const { http } =
|
|
387
|
+
const { http } = _chunkDNMV2L7Qjs.getAuthedHttpClient.call(void 0, );
|
|
379
388
|
const params = new URLSearchParams();
|
|
380
389
|
if (options.requestId !== void 0) {
|
|
381
390
|
const requestId = options.requestId.trim();
|
|
@@ -456,7 +465,7 @@ async function handleUsage(options) {
|
|
|
456
465
|
"No continuation is available for this view. Use deepline billing ledger export all --json for the full ledger."
|
|
457
466
|
] : []
|
|
458
467
|
];
|
|
459
|
-
|
|
468
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
460
469
|
{
|
|
461
470
|
...payload,
|
|
462
471
|
recent: {
|
|
@@ -470,7 +479,7 @@ async function handleUsage(options) {
|
|
|
470
479
|
);
|
|
471
480
|
}
|
|
472
481
|
async function handleLimit(options) {
|
|
473
|
-
const { http } =
|
|
482
|
+
const { http } = _chunkDNMV2L7Qjs.getAuthedHttpClient.call(void 0, );
|
|
474
483
|
const payload = await http.get(
|
|
475
484
|
"/api/v2/billing/limit"
|
|
476
485
|
);
|
|
@@ -478,7 +487,7 @@ async function handleLimit(options) {
|
|
|
478
487
|
`Monthly usage cap: ${_nullishCoalesce(payload.monthly_credits_limit, () => ( "(unknown)"))}`,
|
|
479
488
|
"Enforcement: checked before new calls; in-flight work can exceed the cap."
|
|
480
489
|
] : ["Monthly usage cap: off"];
|
|
481
|
-
|
|
490
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
482
491
|
{
|
|
483
492
|
...payload,
|
|
484
493
|
render: { sections: [{ title: "billing limit", lines }] }
|
|
@@ -487,12 +496,12 @@ async function handleLimit(options) {
|
|
|
487
496
|
);
|
|
488
497
|
}
|
|
489
498
|
async function handleSetLimit(credits, options) {
|
|
490
|
-
const { http } =
|
|
499
|
+
const { http } = _chunkDNMV2L7Qjs.getAuthedHttpClient.call(void 0, );
|
|
491
500
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
492
501
|
method: "PUT",
|
|
493
502
|
body: { monthly_credits_limit: Number.parseInt(credits, 10) }
|
|
494
503
|
});
|
|
495
|
-
|
|
504
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
496
505
|
{
|
|
497
506
|
...payload,
|
|
498
507
|
render: {
|
|
@@ -508,11 +517,11 @@ async function handleSetLimit(credits, options) {
|
|
|
508
517
|
);
|
|
509
518
|
}
|
|
510
519
|
async function handleLimitOff(options) {
|
|
511
|
-
const { http } =
|
|
520
|
+
const { http } = _chunkDNMV2L7Qjs.getAuthedHttpClient.call(void 0, );
|
|
512
521
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
513
522
|
method: "DELETE"
|
|
514
523
|
});
|
|
515
|
-
|
|
524
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
516
525
|
{
|
|
517
526
|
...payload,
|
|
518
527
|
render: {
|
|
@@ -532,7 +541,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
532
541
|
let initialized = false;
|
|
533
542
|
let pageNumber = 0;
|
|
534
543
|
console.error(`Exporting billing ledger to ${outputPath}`);
|
|
535
|
-
for await (const entries of
|
|
544
|
+
for await (const entries of _chunkITFUZEHEjs.iterateCursorPages.call(void 0, async (cursor) => {
|
|
536
545
|
pageNumber += 1;
|
|
537
546
|
console.error(
|
|
538
547
|
`Fetching page ${pageNumber}; ${summary.row_count} rows written.`
|
|
@@ -571,7 +580,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
571
580
|
return summary;
|
|
572
581
|
}
|
|
573
582
|
async function handleHistory(options) {
|
|
574
|
-
const { http } =
|
|
583
|
+
const { http } = _chunkDNMV2L7Qjs.getAuthedHttpClient.call(void 0, );
|
|
575
584
|
const windows = {
|
|
576
585
|
"1d": 86400,
|
|
577
586
|
"1w": 604800,
|
|
@@ -583,10 +592,10 @@ async function handleHistory(options) {
|
|
|
583
592
|
process.cwd(),
|
|
584
593
|
"deepline",
|
|
585
594
|
"data",
|
|
586
|
-
|
|
595
|
+
_chunkDNMV2L7Qjs.createTimestampedName.call(void 0, `billing-history-${options.time}`, "csv")
|
|
587
596
|
);
|
|
588
597
|
const summary = await exportLedger(http, outputPath, { sinceAt });
|
|
589
|
-
|
|
598
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
590
599
|
{
|
|
591
600
|
output_path: outputPath,
|
|
592
601
|
row_count: summary.row_count,
|
|
@@ -623,14 +632,14 @@ async function handleLedgerExportAll(options) {
|
|
|
623
632
|
);
|
|
624
633
|
return;
|
|
625
634
|
}
|
|
626
|
-
const { http } =
|
|
635
|
+
const { http } = _chunkDNMV2L7Qjs.getAuthedHttpClient.call(void 0, );
|
|
627
636
|
const outputPath = options.output ? _path.resolve.call(void 0, String(options.output)) : defaultLedgerExportPath();
|
|
628
637
|
const summary = await exportLedger(http, outputPath, {
|
|
629
638
|
sinceAt,
|
|
630
639
|
runId: options.runId,
|
|
631
640
|
operation: options.operation
|
|
632
641
|
});
|
|
633
|
-
|
|
642
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
634
643
|
{
|
|
635
644
|
output_path: outputPath,
|
|
636
645
|
row_count: summary.row_count,
|
|
@@ -669,7 +678,7 @@ function targetPlanLine(plan) {
|
|
|
669
678
|
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"}`;
|
|
670
679
|
}
|
|
671
680
|
async function handlePlans(options) {
|
|
672
|
-
const client = new (0,
|
|
681
|
+
const client = new (0, _chunkITFUZEHEjs.DeeplineClient)();
|
|
673
682
|
const payload = await client.billing.targetPlans();
|
|
674
683
|
const listedCurrentPlan = payload.plans.find(
|
|
675
684
|
(plan) => plan.sku === payload.current_plan_sku
|
|
@@ -682,8 +691,8 @@ async function handlePlans(options) {
|
|
|
682
691
|
...payload.plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...payload.plans.map(targetPlanLine)],
|
|
683
692
|
"Change plan: deepline billing change-plan <plan_sku> --json"
|
|
684
693
|
];
|
|
685
|
-
const legacyPayload =
|
|
686
|
-
|
|
694
|
+
const legacyPayload = _chunkDNMV2L7Qjs.shouldEmitJson.call(void 0, options.json) ? await client.billing.plans() : null;
|
|
695
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
687
696
|
{
|
|
688
697
|
..._nullishCoalesce(legacyPayload, () => ( payload)),
|
|
689
698
|
...legacyPayload ? { target_billing: payload } : {},
|
|
@@ -693,7 +702,7 @@ async function handlePlans(options) {
|
|
|
693
702
|
);
|
|
694
703
|
}
|
|
695
704
|
async function handleSubscribe(planVersionId, options) {
|
|
696
|
-
const { http } =
|
|
705
|
+
const { http } = _chunkDNMV2L7Qjs.getAuthedHttpClient.call(void 0, );
|
|
697
706
|
const payload = await http.request(
|
|
698
707
|
"/api/v2/billing/subscription/checkout",
|
|
699
708
|
{
|
|
@@ -702,8 +711,8 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
702
711
|
}
|
|
703
712
|
);
|
|
704
713
|
const url = String(payload.checkout_url || "");
|
|
705
|
-
if (!options.json && options.open !== false && url)
|
|
706
|
-
|
|
714
|
+
if (!options.json && options.open !== false && url) _chunkDNMV2L7Qjs.openInBrowser.call(void 0, url);
|
|
715
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
707
716
|
{
|
|
708
717
|
...payload,
|
|
709
718
|
render: {
|
|
@@ -719,7 +728,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
719
728
|
);
|
|
720
729
|
}
|
|
721
730
|
async function handleSubscriptionStatus(options) {
|
|
722
|
-
const client = new (0,
|
|
731
|
+
const client = new (0, _chunkITFUZEHEjs.DeeplineClient)();
|
|
723
732
|
const payload = await client.billing.subscription.status();
|
|
724
733
|
const pools = _nullishCoalesce(payload.credit_pools, () => ( []));
|
|
725
734
|
const lines = [
|
|
@@ -739,7 +748,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
739
748
|
],
|
|
740
749
|
`Assigned by: ${_nullishCoalesce(payload.assigned_by, () => ( "default"))}`
|
|
741
750
|
];
|
|
742
|
-
|
|
751
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
743
752
|
{
|
|
744
753
|
...payload,
|
|
745
754
|
render: { sections: [{ title: "billing subscription", lines }] }
|
|
@@ -748,7 +757,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
748
757
|
);
|
|
749
758
|
}
|
|
750
759
|
async function handleSubscriptionCancel(options) {
|
|
751
|
-
const client = new (0,
|
|
760
|
+
const client = new (0, _chunkITFUZEHEjs.DeeplineClient)();
|
|
752
761
|
const action = options.undo ? "undo_cancel" : "cancel";
|
|
753
762
|
if (options.dryRun) {
|
|
754
763
|
const status = await client.billing.subscription.status();
|
|
@@ -765,7 +774,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
765
774
|
return;
|
|
766
775
|
}
|
|
767
776
|
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.";
|
|
768
|
-
|
|
777
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
769
778
|
{
|
|
770
779
|
ok: true,
|
|
771
780
|
dry_run: true,
|
|
@@ -820,7 +829,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
820
829
|
"Remaining credits are yours to keep \u2014 cancellation never removes credits.",
|
|
821
830
|
"Undo with: deepline billing subscription cancel --undo"
|
|
822
831
|
];
|
|
823
|
-
|
|
832
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
824
833
|
{
|
|
825
834
|
ok: true,
|
|
826
835
|
...result,
|
|
@@ -874,7 +883,7 @@ async function handleInvoices(options) {
|
|
|
874
883
|
return;
|
|
875
884
|
}
|
|
876
885
|
}
|
|
877
|
-
const client = new (0,
|
|
886
|
+
const client = new (0, _chunkITFUZEHEjs.DeeplineClient)();
|
|
878
887
|
let payload;
|
|
879
888
|
try {
|
|
880
889
|
payload = await client.billing.invoices.list(
|
|
@@ -903,7 +912,7 @@ async function handleInvoices(options) {
|
|
|
903
912
|
url: entry.url
|
|
904
913
|
}))
|
|
905
914
|
} : { ...payload, count: entries.length };
|
|
906
|
-
|
|
915
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
907
916
|
{
|
|
908
917
|
...envelope,
|
|
909
918
|
render: { sections: [{ title: "billing invoices", lines }] }
|
|
@@ -912,7 +921,7 @@ async function handleInvoices(options) {
|
|
|
912
921
|
);
|
|
913
922
|
}
|
|
914
923
|
async function handleCheckout(options) {
|
|
915
|
-
const { http } =
|
|
924
|
+
const { http } = _chunkDNMV2L7Qjs.getAuthedHttpClient.call(void 0, );
|
|
916
925
|
const payload = await http.post(
|
|
917
926
|
"/api/v2/billing/checkout",
|
|
918
927
|
{
|
|
@@ -922,8 +931,8 @@ async function handleCheckout(options) {
|
|
|
922
931
|
}
|
|
923
932
|
);
|
|
924
933
|
const url = String(payload.url || payload.checkout_url || "");
|
|
925
|
-
if (!options.json && !options.noOpen && url)
|
|
926
|
-
|
|
934
|
+
if (!options.json && !options.noOpen && url) _chunkDNMV2L7Qjs.openInBrowser.call(void 0, url);
|
|
935
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
927
936
|
{
|
|
928
937
|
...payload,
|
|
929
938
|
render: {
|
|
@@ -954,7 +963,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
954
963
|
}
|
|
955
964
|
const idempotencyKey = topUpIdempotencyKey(options.idempotencyKey);
|
|
956
965
|
if (options.dryRun) {
|
|
957
|
-
|
|
966
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
958
967
|
{
|
|
959
968
|
ok: true,
|
|
960
969
|
dry_run: true,
|
|
@@ -983,7 +992,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
983
992
|
);
|
|
984
993
|
return;
|
|
985
994
|
}
|
|
986
|
-
const client = new (0,
|
|
995
|
+
const client = new (0, _chunkITFUZEHEjs.DeeplineClient)();
|
|
987
996
|
let payload;
|
|
988
997
|
try {
|
|
989
998
|
payload = await client.billing.topUpWithReceipt({
|
|
@@ -1000,7 +1009,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1000
1009
|
return;
|
|
1001
1010
|
}
|
|
1002
1011
|
if (payload.status === "pending") {
|
|
1003
|
-
|
|
1012
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1004
1013
|
{
|
|
1005
1014
|
ok: true,
|
|
1006
1015
|
...payload,
|
|
@@ -1064,17 +1073,17 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1064
1073
|
]
|
|
1065
1074
|
}
|
|
1066
1075
|
};
|
|
1067
|
-
|
|
1076
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0, options.compact ? compactEnvelope : fullEnvelope, {
|
|
1068
1077
|
json: options.json
|
|
1069
1078
|
});
|
|
1070
1079
|
}
|
|
1071
1080
|
async function handleTargetStatus(options) {
|
|
1072
|
-
const client = new (0,
|
|
1081
|
+
const client = new (0, _chunkITFUZEHEjs.DeeplineClient)();
|
|
1073
1082
|
const payload = await client.billing.targetStatus();
|
|
1074
1083
|
const balanceCommand = "deepline billing balance --json";
|
|
1075
1084
|
const recentChargesCommand = "deepline billing usage --limit 5 --json";
|
|
1076
1085
|
const exactChargeCommand = "deepline billing usage --request-id <job_id> --json";
|
|
1077
|
-
|
|
1086
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1078
1087
|
{
|
|
1079
1088
|
ok: true,
|
|
1080
1089
|
...payload,
|
|
@@ -1104,7 +1113,7 @@ async function handleTargetStatus(options) {
|
|
|
1104
1113
|
);
|
|
1105
1114
|
}
|
|
1106
1115
|
async function handleAutoRechargeStatus(options) {
|
|
1107
|
-
const payload = await new (0,
|
|
1116
|
+
const payload = await new (0, _chunkITFUZEHEjs.DeeplineClient)().billing.autoRecharge.get();
|
|
1108
1117
|
const state = payload.available ? payload.enabled ? "on" : "off" : "unavailable";
|
|
1109
1118
|
const lines = [
|
|
1110
1119
|
`State: ${state}`,
|
|
@@ -1114,7 +1123,7 @@ async function handleAutoRechargeStatus(options) {
|
|
|
1114
1123
|
`Automatic credit purchase cap: ${payload.purchase_limit_credits} credits per rolling 30 days`
|
|
1115
1124
|
] : []
|
|
1116
1125
|
];
|
|
1117
|
-
|
|
1126
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1118
1127
|
{
|
|
1119
1128
|
ok: true,
|
|
1120
1129
|
...payload,
|
|
@@ -1163,7 +1172,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1163
1172
|
}
|
|
1164
1173
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1165
1174
|
if (options.dryRun) {
|
|
1166
|
-
|
|
1175
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1167
1176
|
{
|
|
1168
1177
|
ok: true,
|
|
1169
1178
|
dry_run: true,
|
|
@@ -1184,7 +1193,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1184
1193
|
);
|
|
1185
1194
|
return;
|
|
1186
1195
|
}
|
|
1187
|
-
const payload = await new (0,
|
|
1196
|
+
const payload = await new (0, _chunkITFUZEHEjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1188
1197
|
enabled: true,
|
|
1189
1198
|
thresholdCredits,
|
|
1190
1199
|
refillToCredits,
|
|
@@ -1192,7 +1201,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1192
1201
|
...rollingLimitCredits !== void 0 ? { purchaseLimitCredits: rollingLimitCredits } : {},
|
|
1193
1202
|
idempotencyKey
|
|
1194
1203
|
});
|
|
1195
|
-
|
|
1204
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1196
1205
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1197
1206
|
{ json: options.json }
|
|
1198
1207
|
);
|
|
@@ -1200,7 +1209,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1200
1209
|
async function handleAutoRechargeOff(options) {
|
|
1201
1210
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1202
1211
|
if (options.dryRun) {
|
|
1203
|
-
|
|
1212
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1204
1213
|
{
|
|
1205
1214
|
ok: true,
|
|
1206
1215
|
dry_run: true,
|
|
@@ -1215,11 +1224,11 @@ async function handleAutoRechargeOff(options) {
|
|
|
1215
1224
|
);
|
|
1216
1225
|
return;
|
|
1217
1226
|
}
|
|
1218
|
-
const payload = await new (0,
|
|
1227
|
+
const payload = await new (0, _chunkITFUZEHEjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1219
1228
|
enabled: false,
|
|
1220
1229
|
idempotencyKey
|
|
1221
1230
|
});
|
|
1222
|
-
|
|
1231
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1223
1232
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1224
1233
|
{ json: options.json }
|
|
1225
1234
|
);
|
|
@@ -1238,11 +1247,11 @@ async function handleBuyCredits(creditsRaw, options) {
|
|
|
1238
1247
|
return;
|
|
1239
1248
|
}
|
|
1240
1249
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1241
|
-
const payload = await new (0,
|
|
1250
|
+
const payload = await new (0, _chunkITFUZEHEjs.DeeplineClient)().billing.purchaseCredits({
|
|
1242
1251
|
credits,
|
|
1243
1252
|
idempotencyKey
|
|
1244
1253
|
});
|
|
1245
|
-
|
|
1254
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1246
1255
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1247
1256
|
{ json: options.json }
|
|
1248
1257
|
);
|
|
@@ -1278,7 +1287,7 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1278
1287
|
return;
|
|
1279
1288
|
}
|
|
1280
1289
|
if (options.dryRun) {
|
|
1281
|
-
|
|
1290
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1282
1291
|
{
|
|
1283
1292
|
ok: true,
|
|
1284
1293
|
dry_run: true,
|
|
@@ -1291,12 +1300,12 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1291
1300
|
);
|
|
1292
1301
|
return;
|
|
1293
1302
|
}
|
|
1294
|
-
const payload = await new (0,
|
|
1303
|
+
const payload = await new (0, _chunkITFUZEHEjs.DeeplineClient)().billing.recoverCreditPurchase({
|
|
1295
1304
|
credits,
|
|
1296
1305
|
orgId: options.orgId,
|
|
1297
1306
|
idempotencyKey: options.idempotencyKey
|
|
1298
1307
|
});
|
|
1299
|
-
|
|
1308
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1300
1309
|
{ ok: true, idempotency_key: options.idempotencyKey, ...payload },
|
|
1301
1310
|
{ json: options.json }
|
|
1302
1311
|
);
|
|
@@ -1316,37 +1325,37 @@ async function handleTargetPlan(planSku, options) {
|
|
|
1316
1325
|
return;
|
|
1317
1326
|
}
|
|
1318
1327
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1319
|
-
const payload = await new (0,
|
|
1328
|
+
const payload = await new (0, _chunkITFUZEHEjs.DeeplineClient)().billing.transitionPlan({
|
|
1320
1329
|
action: "start_or_change",
|
|
1321
1330
|
targetPlanSku: planSku,
|
|
1322
1331
|
...options.billingEmail ? { billingEmail: options.billingEmail } : {},
|
|
1323
1332
|
idempotencyKey
|
|
1324
1333
|
});
|
|
1325
|
-
|
|
1334
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1326
1335
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1327
1336
|
{ json: options.json }
|
|
1328
1337
|
);
|
|
1329
1338
|
}
|
|
1330
1339
|
async function handleTargetPlanCancellation(options) {
|
|
1331
1340
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1332
|
-
const payload = await new (0,
|
|
1341
|
+
const payload = await new (0, _chunkITFUZEHEjs.DeeplineClient)().billing.transitionPlan({
|
|
1333
1342
|
action: options.undo ? "undo_cancel" : "cancel",
|
|
1334
1343
|
idempotencyKey
|
|
1335
1344
|
});
|
|
1336
|
-
|
|
1345
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1337
1346
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1338
1347
|
{ json: options.json }
|
|
1339
1348
|
);
|
|
1340
1349
|
}
|
|
1341
1350
|
async function handleTargetPortal(options) {
|
|
1342
|
-
const payload = await new (0,
|
|
1351
|
+
const payload = await new (0, _chunkITFUZEHEjs.DeeplineClient)().billing.portalSession(
|
|
1343
1352
|
options.billingAddress ? { flow: "customer_update" } : void 0
|
|
1344
1353
|
);
|
|
1345
|
-
if (!options.json && !options.noOpen)
|
|
1346
|
-
|
|
1354
|
+
if (!options.json && !options.noOpen) _chunkDNMV2L7Qjs.openInBrowser.call(void 0, payload.url);
|
|
1355
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1347
1356
|
}
|
|
1348
1357
|
async function handleRedeemCode(code, options) {
|
|
1349
|
-
const { http } =
|
|
1358
|
+
const { http } = _chunkDNMV2L7Qjs.getAuthedHttpClient.call(void 0, );
|
|
1350
1359
|
const payload = await http.post(
|
|
1351
1360
|
"/api/v2/billing/checkout",
|
|
1352
1361
|
{
|
|
@@ -1354,8 +1363,8 @@ async function handleRedeemCode(code, options) {
|
|
|
1354
1363
|
}
|
|
1355
1364
|
);
|
|
1356
1365
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1357
|
-
if (!options.json && !options.noOpen && url)
|
|
1358
|
-
|
|
1366
|
+
if (!options.json && !options.noOpen && url) _chunkDNMV2L7Qjs.openInBrowser.call(void 0, url);
|
|
1367
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0,
|
|
1359
1368
|
{
|
|
1360
1369
|
...payload,
|
|
1361
1370
|
render: {
|
|
@@ -1410,11 +1419,16 @@ Notes:
|
|
|
1410
1419
|
The balance includes concurrent workspace activity, so a before/after difference
|
|
1411
1420
|
cannot isolate one command. Use billing usage --request-id <job_id> --json.
|
|
1412
1421
|
|
|
1422
|
+
Prints one line, "Balance: N credits", piped or not, plus what to do when
|
|
1423
|
+
the workspace has no credits. --verbose adds reservations and usage awaiting
|
|
1424
|
+
settlement. --json returns the full record.
|
|
1425
|
+
|
|
1413
1426
|
Examples:
|
|
1414
1427
|
deepline billing balance
|
|
1428
|
+
deepline billing balance --verbose
|
|
1415
1429
|
deepline billing balance --json
|
|
1416
1430
|
`
|
|
1417
|
-
).option("--json", "Emit JSON
|
|
1431
|
+
).option("--json", "Emit the full balance record as JSON").option("--verbose", "Add reservations and usage awaiting settlement").action(handleBalance);
|
|
1418
1432
|
billing.command("usage").description("Show current usage plus recent calls.").addHelpText(
|
|
1419
1433
|
"after",
|
|
1420
1434
|
`
|
|
@@ -1616,8 +1630,8 @@ Examples:
|
|
|
1616
1630
|
new (0, _commander.Command)("trigger").description(
|
|
1617
1631
|
"Evaluate capped automatic recharge and resume any pending purchase."
|
|
1618
1632
|
).option("--json", "Emit JSON output").action(async (options) => {
|
|
1619
|
-
const result = await new (0,
|
|
1620
|
-
|
|
1633
|
+
const result = await new (0, _chunkITFUZEHEjs.DeeplineClient)().billing.autoRecharge.trigger();
|
|
1634
|
+
_chunkDNMV2L7Qjs.printCommandEnvelope.call(void 0, { ok: true, ...result }, { json: options.json });
|
|
1621
1635
|
})
|
|
1622
1636
|
);
|
|
1623
1637
|
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(
|