deepline 0.3.370 → 0.3.371
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/README.md +1 -1
- package/dist/bundling-sources/sdk/src/client.ts +8 -8
- package/dist/bundling-sources/sdk/src/release.ts +1 -7
- package/dist/bundling-sources/sdk/src/runs/overview.ts +7 -7
- package/dist/bundling-sources/sdk/src/tool-output.ts +5 -1
- package/dist/bundling-sources/sdk/src/types.ts +2 -2
- package/dist/bundling-sources/shared_libs/monitors/fleets/errors.ts +5 -5
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +18 -18
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/dataset-lifecycle-log.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/launch/input-contract.ts +34 -9
- package/dist/cli/auth-DQVK3ZI6.js +33 -0
- package/dist/cli/{auth-RIH4S7NC.mjs → auth-LCSEXQA2.mjs} +4 -4
- package/dist/cli/{billing-Q65H5GJM.js → billing-KISDL67A.js} +148 -148
- package/dist/cli/{billing-ERNGN6WK.mjs → billing-Z7PLJC5C.mjs} +79 -79
- package/dist/cli/{chunk-MX53GIOB.js → chunk-2JRRXXTA.js} +2 -2
- package/dist/cli/{chunk-BKHNCIQD.mjs → chunk-2L6LBJVC.mjs} +193 -187
- package/dist/cli/{chunk-IDBLJSLL.mjs → chunk-3FTYFVYN.mjs} +5 -5
- package/dist/cli/{chunk-Z6B4UPM4.mjs → chunk-3GK3SH3G.mjs} +2 -2
- package/dist/cli/{chunk-4Y5UDYQK.js → chunk-44SHFHA3.js} +17 -17
- package/dist/cli/{chunk-RLXMRC6P.mjs → chunk-46JCJ7FT.mjs} +49 -96
- package/dist/cli/{chunk-XTKVXHGD.js → chunk-5BCVKWLV.js} +17 -17
- package/dist/cli/{chunk-A5RFERJQ.mjs → chunk-5S525TQV.mjs} +2 -2
- package/dist/cli/{chunk-WQZ22EQU.js → chunk-5Z7JFUNX.js} +26 -26
- package/dist/cli/{chunk-T64NZ2A7.mjs → chunk-73NIXYKH.mjs} +46 -47
- package/dist/cli/{chunk-SFI7U6CA.js → chunk-A7X7KFXX.js} +4 -4
- package/dist/cli/{chunk-YQMUTC2H.mjs → chunk-AIZKDTFF.mjs} +11 -11
- package/dist/cli/{chunk-MKFHZDBO.js → chunk-BO3ADIBV.js} +8 -8
- package/dist/cli/{chunk-NHB3UWTZ.js → chunk-C3IPN4E6.js} +17 -17
- package/dist/cli/{chunk-A4OX52RV.js → chunk-C553OZGG.js} +10 -10
- package/dist/cli/{chunk-GGRVNAOH.mjs → chunk-DOXAN2I7.mjs} +3 -3
- package/dist/cli/{chunk-YEEESF2T.js → chunk-DPVBWLBF.js} +419 -413
- package/dist/cli/{chunk-R7AAYFDQ.js → chunk-DQMTJXLK.js} +102 -103
- package/dist/cli/{chunk-NXDRDJ4K.js → chunk-E5UD3JDQ.js} +3 -1
- package/dist/cli/{chunk-LNEBKWXM.mjs → chunk-IWY7T6MR.mjs} +1 -1
- package/dist/cli/{chunk-MIMASXO4.mjs → chunk-JB6ERQUV.mjs} +3 -1
- package/dist/cli/{chunk-CTMA3C3N.js → chunk-JSK6GUY6.js} +49 -96
- package/dist/cli/{chunk-H4IQJRFC.mjs → chunk-KBJO7HIF.mjs} +9 -9
- package/dist/cli/{chunk-HHH4MPFY.mjs → chunk-KGRAQ4OR.mjs} +6 -6
- package/dist/cli/{chunk-LJWOPNJJ.mjs → chunk-KKRRIFR3.mjs} +1 -1
- package/dist/cli/{chunk-DFJDVQMH.js → chunk-N34UX4TW.js} +2 -2
- package/dist/cli/{chunk-666HPUIZ.js → chunk-NMDNUOVI.js} +1 -6
- package/dist/cli/{chunk-5DUTNG37.mjs → chunk-SEDS6ZVR.mjs} +10 -10
- package/dist/cli/{chunk-BGXG3GEI.mjs → chunk-SENW5J4O.mjs} +5 -5
- package/dist/cli/{chunk-Y2B56VN7.js → chunk-TT2YWFYW.js} +53 -53
- package/dist/cli/{chunk-A6DJC2RC.js → chunk-YENBXYUH.js} +68 -68
- package/dist/cli/{chunk-NEY2M4EZ.mjs → chunk-YYFLULK7.mjs} +1 -6
- package/dist/cli/client-JFSRNUVD.js +20 -0
- package/dist/cli/{client-QXOERIFI.mjs → client-Z3Z5EDDJ.mjs} +3 -3
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-V7UKQ7AC.mjs → csv-TEVHLGGA.mjs} +3 -3
- package/dist/cli/{csv-ZKIUSDIV.js → csv-XGFXV7JE.js} +12 -12
- package/dist/cli/{db-GWKRVHKS.js → db-LLZJ7UH5.js} +42 -43
- package/dist/cli/{db-QQ4BYMPY.mjs → db-OB7PMWSZ.mjs} +17 -18
- package/dist/cli/{describe-XMWXEFMS.mjs → describe-GZIRANUZ.mjs} +12 -12
- package/dist/cli/{describe-3AJI2BOS.js → describe-NWU7LI3I.js} +28 -28
- package/dist/cli/{executions-2IMCCV34.js → executions-64YZGSOW.js} +6 -6
- package/dist/cli/{executions-QV7UE5YG.mjs → executions-7UZ3ZGJ3.mjs} +4 -4
- package/dist/cli/{feedback-K6WNXZDB.mjs → feedback-2WRQRW3U.mjs} +8 -8
- package/dist/cli/{feedback-7SSJ7VPF.js → feedback-MN5CXULH.js} +12 -12
- package/dist/cli/{git-UOE2K2XQ.mjs → git-BPYVLLTY.mjs} +4 -4
- package/dist/cli/git-TJIPVSAE.js +23 -0
- package/dist/cli/index.js +98 -109
- package/dist/cli/index.mjs +46 -57
- package/dist/cli/{legacy-noops-GC43OSXL.js → legacy-noops-VMXJPLMW.js} +9 -9
- package/dist/cli/{legacy-noops-SOYPIA2X.mjs → legacy-noops-ZRPWEPX6.mjs} +6 -6
- package/dist/cli/{monitors-FLCGMXVH.mjs → monitors-5BRTBL7E.mjs} +59 -59
- package/dist/cli/{monitors-AXANB6WK.js → monitors-OQSI2VOL.js} +140 -140
- package/dist/cli/{org-MXD4BTQI.js → org-F5QS3HG4.js} +88 -87
- package/dist/cli/{org-Q7EDNZMN.mjs → org-SMZ7AGR3.mjs} +28 -27
- package/dist/cli/{play-TZROCF7E.mjs → play-CJZNLQL7.mjs} +10 -8
- package/dist/cli/play-K7HE4LBB.js +155 -0
- package/dist/cli/{providers-JEY4FTWG.mjs → providers-CBWXJRDG.mjs} +7 -7
- package/dist/cli/{providers-LOS4MHAG.js → providers-SH2HYOVR.js} +10 -10
- package/dist/cli/{quickstart-WO5KVVER.mjs → quickstart-342ENF6Q.mjs} +4 -4
- package/dist/cli/{quickstart-27UQGHEH.js → quickstart-B6EL7WDG.js} +6 -6
- package/dist/cli/{search-LZHWXC2C.mjs → search-E7DKH3SI.mjs} +5 -5
- package/dist/cli/search-SEEYCQED.js +26 -0
- package/dist/cli/{secrets-AVJGZABR.mjs → secrets-FSYIPRVS.mjs} +5 -5
- package/dist/cli/{secrets-PE7P4L7N.js → secrets-M2AW5RGE.js} +14 -14
- package/dist/cli/{sessions-I6UDBN7M.js → sessions-AFE4C3FQ.js} +5 -5
- package/dist/cli/{sessions-ZDSZTYZV.mjs → sessions-DJPGWPNA.mjs} +4 -4
- package/dist/cli/{settings-SPWH3FET.mjs → settings-KLN2A3PQ.mjs} +10 -10
- package/dist/cli/{settings-3SLMJHJ2.js → settings-VUWBNATC.js} +77 -77
- package/dist/cli/{setup-Q3CJ4T2Q.mjs → setup-BE6N5YV6.mjs} +15 -15
- package/dist/cli/{setup-R4LUWQE4.js → setup-I5IMTQCX.js} +50 -50
- package/dist/cli/skills-7XH5GMZB.js +28 -0
- package/dist/cli/{skills-FGXH432G.mjs → skills-GSNPQDUG.mjs} +4 -4
- package/dist/cli/tools-JCL4ABAF.js +40 -0
- package/dist/cli/{tools-O7C6PFF2.mjs → tools-ORCGHV4P.mjs} +8 -8
- package/dist/cli/{update-PPCQV3CD.mjs → update-UXEUWVWS.mjs} +6 -6
- package/dist/cli/update-YNZOS77Z.js +28 -0
- package/dist/cli/{workflow-Z2KYQ2JE.mjs → workflow-JBQY7JJN.mjs} +7 -7
- package/dist/cli/{workflow-ALKU4ZFD.js → workflow-R7SDICTU.js} +17 -17
- package/dist/{client-CjHv4K6D.d.mts → client-CZFMQEgO.d.mts} +6 -6
- package/dist/{client-rTuhNN-x.d.ts → client-CgSwpnb-.d.ts} +6 -6
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -15
- package/dist/index.mjs +4 -4
- package/dist/install-integrity.json +82 -82
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/release.d.mts +1 -5
- package/dist/release.d.ts +1 -5
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-DD3PVIRQ.js +0 -33
- package/dist/cli/client-DNAFHKWV.js +0 -20
- package/dist/cli/git-EBSF3254.js +0 -23
- package/dist/cli/play-YWQXVOBT.js +0 -153
- package/dist/cli/search-OQ3OEFUA.js +0 -26
- package/dist/cli/skills-IDXBBOUW.js +0 -28
- package/dist/cli/tools-WHLD4Y4O.js +0 -40
- package/dist/cli/update-K6HE3XKO.js +0 -28
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk44SHFHA3js = require('./chunk-44SHFHA3.js');
|
|
6
6
|
require('./chunk-S6R3OX7B.js');
|
|
7
7
|
require('./chunk-LA46MMTL.js');
|
|
8
8
|
|
|
@@ -11,16 +11,16 @@ require('./chunk-LA46MMTL.js');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkBO3ADIBVjs = require('./chunk-BO3ADIBV.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkA7X7KFXXjs = require('./chunk-A7X7KFXX.js');
|
|
19
19
|
require('./chunk-XNYIZMNQ.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
23
|
-
require('./chunk-
|
|
23
|
+
require('./chunk-NMDNUOVI.js');
|
|
24
24
|
require('./chunk-OG64RBAC.js');
|
|
25
25
|
require('./chunk-COGTRVWW.js');
|
|
26
26
|
|
|
@@ -30,17 +30,17 @@ var _crypto = require('crypto');
|
|
|
30
30
|
var _promises = require('fs/promises');
|
|
31
31
|
var _path = require('path');
|
|
32
32
|
var _sync = require('csv-stringify/sync');
|
|
33
|
-
var SUBSCRIPTION_STATUS_NEXT_COMMAND = "deepline billing subscription status
|
|
33
|
+
var SUBSCRIPTION_STATUS_NEXT_COMMAND = "deepline billing subscription status";
|
|
34
34
|
var SUBSCRIPTION_CANCEL_PATH = "/api/v2/billing/subscription/cancel";
|
|
35
35
|
var BILLING_TOP_UP_PATH = "/api/v2/billing/top-up";
|
|
36
36
|
var DEFAULT_BALANCE_RECOVERY_CREDITS = 100;
|
|
37
37
|
function billingFailureFromError(error, options) {
|
|
38
|
-
if (error instanceof
|
|
38
|
+
if (error instanceof _chunkA7X7KFXXjs.AuthError) {
|
|
39
39
|
return {
|
|
40
40
|
exitCode: 3,
|
|
41
41
|
code: "AUTH_ERROR",
|
|
42
42
|
message: error.message,
|
|
43
|
-
next: "deepline auth status
|
|
43
|
+
next: "deepline auth status"
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
if (!(error instanceof _chunk7P5AA3SNjs.DeeplineError) || typeof error.statusCode !== "number") {
|
|
@@ -69,7 +69,7 @@ function reportBillingFailure(failure, options) {
|
|
|
69
69
|
if (failure.next) {
|
|
70
70
|
textLines.push(`Next: ${failure.next}`);
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
73
73
|
{
|
|
74
74
|
ok: false,
|
|
75
75
|
exitCode: failure.exitCode,
|
|
@@ -90,16 +90,16 @@ function parseTopUpCredits(raw) {
|
|
|
90
90
|
return parsed;
|
|
91
91
|
}
|
|
92
92
|
function topUpIdempotencyKey(raw) {
|
|
93
|
-
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` :
|
|
93
|
+
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` : _chunk44SHFHA3js.requireBillingIdempotencyKey.call(void 0, raw);
|
|
94
94
|
}
|
|
95
95
|
function targetBillingIdempotencyKey(raw) {
|
|
96
96
|
return typeof raw === "string" ? raw : `cli_target_billing:${Date.now()}:${_crypto.randomUUID.call(void 0, )}`;
|
|
97
97
|
}
|
|
98
98
|
function checkoutCommandForCredits(credits) {
|
|
99
|
-
return `deepline billing checkout --credits ${credits} --no-open
|
|
99
|
+
return `deepline billing checkout --credits ${credits} --no-open`;
|
|
100
100
|
}
|
|
101
101
|
function approvedTopUpCommandForCredits(credits) {
|
|
102
|
-
return `deepline billing top-up ${credits}
|
|
102
|
+
return `deepline billing top-up ${credits}`;
|
|
103
103
|
}
|
|
104
104
|
function balanceRecoveryForCredits(credits = DEFAULT_BALANCE_RECOVERY_CREDITS) {
|
|
105
105
|
return {
|
|
@@ -114,7 +114,7 @@ function shellQuote(value) {
|
|
|
114
114
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
115
115
|
}
|
|
116
116
|
function topUpRetryCommand(credits, idempotencyKey) {
|
|
117
|
-
return `deepline billing top-up ${credits} --idempotency-key ${shellQuote(idempotencyKey)}
|
|
117
|
+
return `deepline billing top-up ${credits} --idempotency-key ${shellQuote(idempotencyKey)}`;
|
|
118
118
|
}
|
|
119
119
|
function apiErrorCode(error) {
|
|
120
120
|
const response = _optionalChain([error, 'access', _ => _.details, 'optionalAccess', _2 => _2.response]);
|
|
@@ -127,12 +127,12 @@ function apiErrorCode(error) {
|
|
|
127
127
|
return _nullishCoalesce(error.code, () => ( "BILLING_API_ERROR"));
|
|
128
128
|
}
|
|
129
129
|
function billingTopUpFailureFromError(error, input) {
|
|
130
|
-
if (error instanceof
|
|
130
|
+
if (error instanceof _chunkA7X7KFXXjs.AuthError || error instanceof _chunkA7X7KFXXjs.ConfigError) {
|
|
131
131
|
return {
|
|
132
132
|
exitCode: 3,
|
|
133
133
|
code: "AUTH_ERROR",
|
|
134
134
|
message: error.message,
|
|
135
|
-
next: "deepline auth status
|
|
135
|
+
next: "deepline auth status"
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
if (!(error instanceof _chunk7P5AA3SNjs.DeeplineError) || typeof error.statusCode !== "number") {
|
|
@@ -152,7 +152,7 @@ function billingTopUpFailureFromError(error, input) {
|
|
|
152
152
|
exitCode: 2,
|
|
153
153
|
code: "INVALID_CREDITS",
|
|
154
154
|
message: error.message,
|
|
155
|
-
next: "deepline billing plans
|
|
155
|
+
next: "deepline billing plans"
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
if (error.statusCode === 409) {
|
|
@@ -296,7 +296,7 @@ function defaultLedgerExportPath() {
|
|
|
296
296
|
);
|
|
297
297
|
}
|
|
298
298
|
async function handleBalance(options) {
|
|
299
|
-
const { http } =
|
|
299
|
+
const { http } = _chunkBO3ADIBVjs.getAuthedHttpClient.call(void 0, );
|
|
300
300
|
const payload = await http.get(
|
|
301
301
|
"/api/v2/billing/balance"
|
|
302
302
|
);
|
|
@@ -364,7 +364,7 @@ async function handleBalance(options) {
|
|
|
364
364
|
...options.verbose ? detail : [],
|
|
365
365
|
...lines.slice(1)
|
|
366
366
|
];
|
|
367
|
-
|
|
367
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
368
368
|
{
|
|
369
369
|
...payload,
|
|
370
370
|
...recovery ? { recovery } : {},
|
|
@@ -388,7 +388,7 @@ function quoteShellArgument(value) {
|
|
|
388
388
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
389
389
|
}
|
|
390
390
|
async function handleUsage(options) {
|
|
391
|
-
const { http } =
|
|
391
|
+
const { http } = _chunkBO3ADIBVjs.getAuthedHttpClient.call(void 0, );
|
|
392
392
|
const params = new URLSearchParams();
|
|
393
393
|
if (options.requestId !== void 0) {
|
|
394
394
|
const requestId = options.requestId.trim();
|
|
@@ -434,7 +434,7 @@ async function handleUsage(options) {
|
|
|
434
434
|
exitCode: 4,
|
|
435
435
|
code: "USAGE_REQUEST_NOT_FOUND",
|
|
436
436
|
message: `No billing record for request_id ${options.requestId} in the active workspace.`,
|
|
437
|
-
next: "deepline billing usage
|
|
437
|
+
next: "deepline billing usage"
|
|
438
438
|
},
|
|
439
439
|
options
|
|
440
440
|
);
|
|
@@ -447,7 +447,7 @@ async function handleUsage(options) {
|
|
|
447
447
|
const recent = _nullishCoalesce(payload.recent, () => ( {}));
|
|
448
448
|
const last30Usage = _nullishCoalesce(usage.last_30_days_usage_credits, () => ( usage.month_spent_credits));
|
|
449
449
|
const temporaryHolds = Number(_nullishCoalesce(usage.temporary_hold_credits, () => ( 0)));
|
|
450
|
-
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)}` : ""}
|
|
450
|
+
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;
|
|
451
451
|
const recentLines = recentUsageLines(
|
|
452
452
|
Array.isArray(recent.entries) ? recent.entries : []
|
|
453
453
|
);
|
|
@@ -466,10 +466,10 @@ async function handleUsage(options) {
|
|
|
466
466
|
...recent.incomplete === true ? ["Recent activity is incomplete; the matching count may be higher."] : [],
|
|
467
467
|
...nextPage ? [`Next page: ${nextPage}`] : [],
|
|
468
468
|
...!nextPage && (recent.has_more === true || recent.incomplete === true) ? [
|
|
469
|
-
"No continuation is available for this view. Use deepline billing ledger export all
|
|
469
|
+
"No continuation is available for this view. Use deepline billing ledger export all for the full ledger."
|
|
470
470
|
] : []
|
|
471
471
|
];
|
|
472
|
-
|
|
472
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
473
473
|
{
|
|
474
474
|
...payload,
|
|
475
475
|
recent: {
|
|
@@ -483,7 +483,7 @@ async function handleUsage(options) {
|
|
|
483
483
|
);
|
|
484
484
|
}
|
|
485
485
|
async function handleLimit(options) {
|
|
486
|
-
const { http } =
|
|
486
|
+
const { http } = _chunkBO3ADIBVjs.getAuthedHttpClient.call(void 0, );
|
|
487
487
|
const payload = await http.get(
|
|
488
488
|
"/api/v2/billing/limit"
|
|
489
489
|
);
|
|
@@ -491,7 +491,7 @@ async function handleLimit(options) {
|
|
|
491
491
|
`Monthly usage cap: ${_nullishCoalesce(payload.monthly_credits_limit, () => ( "(unknown)"))}`,
|
|
492
492
|
"Enforcement: checked before new calls; in-flight work can exceed the cap."
|
|
493
493
|
] : ["Monthly usage cap: off"];
|
|
494
|
-
|
|
494
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
495
495
|
{
|
|
496
496
|
...payload,
|
|
497
497
|
render: { sections: [{ title: "billing limit", lines }] }
|
|
@@ -500,12 +500,12 @@ async function handleLimit(options) {
|
|
|
500
500
|
);
|
|
501
501
|
}
|
|
502
502
|
async function handleSetLimit(credits, options) {
|
|
503
|
-
const { http } =
|
|
503
|
+
const { http } = _chunkBO3ADIBVjs.getAuthedHttpClient.call(void 0, );
|
|
504
504
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
505
505
|
method: "PUT",
|
|
506
506
|
body: { monthly_credits_limit: Number.parseInt(credits, 10) }
|
|
507
507
|
});
|
|
508
|
-
|
|
508
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
509
509
|
{
|
|
510
510
|
...payload,
|
|
511
511
|
render: {
|
|
@@ -521,11 +521,11 @@ async function handleSetLimit(credits, options) {
|
|
|
521
521
|
);
|
|
522
522
|
}
|
|
523
523
|
async function handleLimitOff(options) {
|
|
524
|
-
const { http } =
|
|
524
|
+
const { http } = _chunkBO3ADIBVjs.getAuthedHttpClient.call(void 0, );
|
|
525
525
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
526
526
|
method: "DELETE"
|
|
527
527
|
});
|
|
528
|
-
|
|
528
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
529
529
|
{
|
|
530
530
|
...payload,
|
|
531
531
|
render: {
|
|
@@ -545,7 +545,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
545
545
|
let initialized = false;
|
|
546
546
|
let pageNumber = 0;
|
|
547
547
|
console.error(`Exporting billing ledger to ${outputPath}`);
|
|
548
|
-
for await (const entries of
|
|
548
|
+
for await (const entries of _chunk44SHFHA3js.iterateCursorPages.call(void 0, async (cursor) => {
|
|
549
549
|
pageNumber += 1;
|
|
550
550
|
console.error(
|
|
551
551
|
`Fetching page ${pageNumber}; ${summary.row_count} rows written.`
|
|
@@ -584,7 +584,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
584
584
|
return summary;
|
|
585
585
|
}
|
|
586
586
|
async function handleHistory(options) {
|
|
587
|
-
const { http } =
|
|
587
|
+
const { http } = _chunkBO3ADIBVjs.getAuthedHttpClient.call(void 0, );
|
|
588
588
|
const windows = {
|
|
589
589
|
"1d": 86400,
|
|
590
590
|
"1w": 604800,
|
|
@@ -596,10 +596,10 @@ async function handleHistory(options) {
|
|
|
596
596
|
process.cwd(),
|
|
597
597
|
"deepline",
|
|
598
598
|
"data",
|
|
599
|
-
|
|
599
|
+
_chunkBO3ADIBVjs.createTimestampedName.call(void 0, `billing-history-${options.time}`, "csv")
|
|
600
600
|
);
|
|
601
601
|
const summary = await exportLedger(http, outputPath, { sinceAt });
|
|
602
|
-
|
|
602
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
603
603
|
{
|
|
604
604
|
output_path: outputPath,
|
|
605
605
|
row_count: summary.row_count,
|
|
@@ -636,14 +636,14 @@ async function handleLedgerExportAll(options) {
|
|
|
636
636
|
);
|
|
637
637
|
return;
|
|
638
638
|
}
|
|
639
|
-
const { http } =
|
|
639
|
+
const { http } = _chunkBO3ADIBVjs.getAuthedHttpClient.call(void 0, );
|
|
640
640
|
const outputPath = options.output ? _path.resolve.call(void 0, String(options.output)) : defaultLedgerExportPath();
|
|
641
641
|
const summary = await exportLedger(http, outputPath, {
|
|
642
642
|
sinceAt,
|
|
643
643
|
runId: options.runId,
|
|
644
644
|
operation: options.operation
|
|
645
645
|
});
|
|
646
|
-
|
|
646
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
647
647
|
{
|
|
648
648
|
output_path: outputPath,
|
|
649
649
|
row_count: summary.row_count,
|
|
@@ -682,7 +682,7 @@ function targetPlanLine(plan) {
|
|
|
682
682
|
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"}`;
|
|
683
683
|
}
|
|
684
684
|
async function handlePlans(options) {
|
|
685
|
-
const client = new (0,
|
|
685
|
+
const client = new (0, _chunk44SHFHA3js.DeeplineClient)();
|
|
686
686
|
const payload = await client.billing.targetPlans();
|
|
687
687
|
const listedCurrentPlan = payload.plans.find(
|
|
688
688
|
(plan) => plan.sku === payload.current_plan_sku
|
|
@@ -693,10 +693,10 @@ async function handlePlans(options) {
|
|
|
693
693
|
`Pending plan: ${_nullishCoalesce(payload.pending_plan_sku, () => ( "none"))}`,
|
|
694
694
|
`Plan changes: ${payload.acquisition_enabled ? "enabled" : "disabled"}`,
|
|
695
695
|
...payload.plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...payload.plans.map(targetPlanLine)],
|
|
696
|
-
"Change plan: deepline billing change-plan <plan_sku>
|
|
696
|
+
"Change plan: deepline billing change-plan <plan_sku>"
|
|
697
697
|
];
|
|
698
|
-
const legacyPayload =
|
|
699
|
-
|
|
698
|
+
const legacyPayload = _chunkBO3ADIBVjs.shouldEmitJson.call(void 0, options.json) ? await client.billing.plans() : null;
|
|
699
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
700
700
|
{
|
|
701
701
|
..._nullishCoalesce(legacyPayload, () => ( payload)),
|
|
702
702
|
...legacyPayload ? { target_billing: payload } : {},
|
|
@@ -706,7 +706,7 @@ async function handlePlans(options) {
|
|
|
706
706
|
);
|
|
707
707
|
}
|
|
708
708
|
async function handleSubscribe(planVersionId, options) {
|
|
709
|
-
const { http } =
|
|
709
|
+
const { http } = _chunkBO3ADIBVjs.getAuthedHttpClient.call(void 0, );
|
|
710
710
|
const payload = await http.request(
|
|
711
711
|
"/api/v2/billing/subscription/checkout",
|
|
712
712
|
{
|
|
@@ -715,8 +715,8 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
715
715
|
}
|
|
716
716
|
);
|
|
717
717
|
const url = String(payload.checkout_url || "");
|
|
718
|
-
if (!options.json && options.open !== false && url)
|
|
719
|
-
|
|
718
|
+
if (!options.json && options.open !== false && url) _chunkBO3ADIBVjs.openInBrowser.call(void 0, url);
|
|
719
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
720
720
|
{
|
|
721
721
|
...payload,
|
|
722
722
|
render: {
|
|
@@ -732,7 +732,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
732
732
|
);
|
|
733
733
|
}
|
|
734
734
|
async function handleSubscriptionStatus(options) {
|
|
735
|
-
const client = new (0,
|
|
735
|
+
const client = new (0, _chunk44SHFHA3js.DeeplineClient)();
|
|
736
736
|
const payload = await client.billing.subscription.status();
|
|
737
737
|
const pools = _nullishCoalesce(payload.credit_pools, () => ( []));
|
|
738
738
|
const lines = [
|
|
@@ -752,7 +752,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
752
752
|
],
|
|
753
753
|
`Assigned by: ${_nullishCoalesce(payload.assigned_by, () => ( "default"))}`
|
|
754
754
|
];
|
|
755
|
-
|
|
755
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
756
756
|
{
|
|
757
757
|
...payload,
|
|
758
758
|
render: { sections: [{ title: "billing subscription", lines }] }
|
|
@@ -761,7 +761,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
761
761
|
);
|
|
762
762
|
}
|
|
763
763
|
async function handleSubscriptionCancel(options) {
|
|
764
|
-
const client = new (0,
|
|
764
|
+
const client = new (0, _chunk44SHFHA3js.DeeplineClient)();
|
|
765
765
|
const action = options.undo ? "undo_cancel" : "cancel";
|
|
766
766
|
if (options.dryRun) {
|
|
767
767
|
const status = await client.billing.subscription.status();
|
|
@@ -778,7 +778,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
780
780
|
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.";
|
|
781
|
-
|
|
781
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
782
782
|
{
|
|
783
783
|
ok: true,
|
|
784
784
|
dry_run: true,
|
|
@@ -833,7 +833,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
833
833
|
"Remaining credits are yours to keep \u2014 cancellation never removes credits.",
|
|
834
834
|
"Undo with: deepline billing subscription cancel --undo"
|
|
835
835
|
];
|
|
836
|
-
|
|
836
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
837
837
|
{
|
|
838
838
|
ok: true,
|
|
839
839
|
...result,
|
|
@@ -887,7 +887,7 @@ async function handleInvoices(options) {
|
|
|
887
887
|
return;
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
|
-
const client = new (0,
|
|
890
|
+
const client = new (0, _chunk44SHFHA3js.DeeplineClient)();
|
|
891
891
|
let payload;
|
|
892
892
|
try {
|
|
893
893
|
payload = await client.billing.invoices.list(
|
|
@@ -916,7 +916,7 @@ async function handleInvoices(options) {
|
|
|
916
916
|
url: entry.url
|
|
917
917
|
}))
|
|
918
918
|
} : { ...payload, count: entries.length };
|
|
919
|
-
|
|
919
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
920
920
|
{
|
|
921
921
|
...envelope,
|
|
922
922
|
render: { sections: [{ title: "billing invoices", lines }] }
|
|
@@ -925,7 +925,7 @@ async function handleInvoices(options) {
|
|
|
925
925
|
);
|
|
926
926
|
}
|
|
927
927
|
async function handleCheckout(options) {
|
|
928
|
-
const { http } =
|
|
928
|
+
const { http } = _chunkBO3ADIBVjs.getAuthedHttpClient.call(void 0, );
|
|
929
929
|
const payload = await http.post(
|
|
930
930
|
"/api/v2/billing/checkout",
|
|
931
931
|
{
|
|
@@ -935,8 +935,8 @@ async function handleCheckout(options) {
|
|
|
935
935
|
}
|
|
936
936
|
);
|
|
937
937
|
const url = String(payload.url || payload.checkout_url || "");
|
|
938
|
-
if (!options.json && !options.noOpen && url)
|
|
939
|
-
|
|
938
|
+
if (!options.json && !options.noOpen && url) _chunkBO3ADIBVjs.openInBrowser.call(void 0, url);
|
|
939
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
940
940
|
{
|
|
941
941
|
...payload,
|
|
942
942
|
render: {
|
|
@@ -959,7 +959,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
959
959
|
exitCode: 2,
|
|
960
960
|
code: "INVALID_CREDITS",
|
|
961
961
|
message: "<credits> must be a positive integer Deepline credit amount.",
|
|
962
|
-
next: "deepline billing plans
|
|
962
|
+
next: "deepline billing plans"
|
|
963
963
|
},
|
|
964
964
|
options
|
|
965
965
|
);
|
|
@@ -981,7 +981,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
981
981
|
return;
|
|
982
982
|
}
|
|
983
983
|
if (options.dryRun) {
|
|
984
|
-
|
|
984
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
985
985
|
{
|
|
986
986
|
ok: true,
|
|
987
987
|
dry_run: true,
|
|
@@ -1011,7 +1011,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1011
1011
|
);
|
|
1012
1012
|
return;
|
|
1013
1013
|
}
|
|
1014
|
-
const client = new (0,
|
|
1014
|
+
const client = new (0, _chunk44SHFHA3js.DeeplineClient)();
|
|
1015
1015
|
let payload;
|
|
1016
1016
|
try {
|
|
1017
1017
|
payload = await client.billing.topUpWithReceipt({
|
|
@@ -1028,7 +1028,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1028
1028
|
return;
|
|
1029
1029
|
}
|
|
1030
1030
|
if (payload.status === "pending") {
|
|
1031
|
-
|
|
1031
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1032
1032
|
{
|
|
1033
1033
|
ok: true,
|
|
1034
1034
|
...payload,
|
|
@@ -1092,17 +1092,17 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1092
1092
|
]
|
|
1093
1093
|
}
|
|
1094
1094
|
};
|
|
1095
|
-
|
|
1095
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0, options.compact ? compactEnvelope : fullEnvelope, {
|
|
1096
1096
|
json: options.json
|
|
1097
1097
|
});
|
|
1098
1098
|
}
|
|
1099
1099
|
async function handleTargetStatus(options) {
|
|
1100
|
-
const client = new (0,
|
|
1100
|
+
const client = new (0, _chunk44SHFHA3js.DeeplineClient)();
|
|
1101
1101
|
const payload = await client.billing.targetStatus();
|
|
1102
|
-
const balanceCommand = "deepline billing balance
|
|
1103
|
-
const recentChargesCommand = "deepline billing usage --limit 5
|
|
1104
|
-
const exactChargeCommand = "deepline billing usage --request-id <job_id>
|
|
1105
|
-
|
|
1102
|
+
const balanceCommand = "deepline billing balance";
|
|
1103
|
+
const recentChargesCommand = "deepline billing usage --limit 5";
|
|
1104
|
+
const exactChargeCommand = "deepline billing usage --request-id <job_id>";
|
|
1105
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1106
1106
|
{
|
|
1107
1107
|
ok: true,
|
|
1108
1108
|
...payload,
|
|
@@ -1132,8 +1132,8 @@ async function handleTargetStatus(options) {
|
|
|
1132
1132
|
);
|
|
1133
1133
|
}
|
|
1134
1134
|
async function handleEntitlements(options) {
|
|
1135
|
-
const payload = await new (0,
|
|
1136
|
-
|
|
1135
|
+
const payload = await new (0, _chunk44SHFHA3js.DeeplineClient)().billing.entitlements();
|
|
1136
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1137
1137
|
{
|
|
1138
1138
|
ok: true,
|
|
1139
1139
|
...payload,
|
|
@@ -1158,7 +1158,7 @@ async function handleEntitlements(options) {
|
|
|
1158
1158
|
);
|
|
1159
1159
|
}
|
|
1160
1160
|
async function handleAutoRechargeStatus(options) {
|
|
1161
|
-
const payload = await new (0,
|
|
1161
|
+
const payload = await new (0, _chunk44SHFHA3js.DeeplineClient)().billing.autoRecharge.get();
|
|
1162
1162
|
const state = payload.available ? payload.enabled ? "on" : "off" : "unavailable";
|
|
1163
1163
|
const lines = [
|
|
1164
1164
|
`State: ${state}`,
|
|
@@ -1168,7 +1168,7 @@ async function handleAutoRechargeStatus(options) {
|
|
|
1168
1168
|
`Automatic credit purchase cap: ${payload.purchase_limit_credits} credits per rolling 30 days`
|
|
1169
1169
|
] : []
|
|
1170
1170
|
];
|
|
1171
|
-
|
|
1171
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1172
1172
|
{
|
|
1173
1173
|
ok: true,
|
|
1174
1174
|
...payload,
|
|
@@ -1217,7 +1217,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1219
1219
|
if (options.dryRun) {
|
|
1220
|
-
|
|
1220
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1221
1221
|
{
|
|
1222
1222
|
ok: true,
|
|
1223
1223
|
dry_run: true,
|
|
@@ -1238,7 +1238,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1238
1238
|
);
|
|
1239
1239
|
return;
|
|
1240
1240
|
}
|
|
1241
|
-
const payload = await new (0,
|
|
1241
|
+
const payload = await new (0, _chunk44SHFHA3js.DeeplineClient)().billing.autoRecharge.update({
|
|
1242
1242
|
enabled: true,
|
|
1243
1243
|
thresholdCredits,
|
|
1244
1244
|
refillToCredits,
|
|
@@ -1246,7 +1246,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1246
1246
|
...rollingLimitCredits !== void 0 ? { purchaseLimitCredits: rollingLimitCredits } : {},
|
|
1247
1247
|
idempotencyKey
|
|
1248
1248
|
});
|
|
1249
|
-
|
|
1249
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1250
1250
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1251
1251
|
{ json: options.json }
|
|
1252
1252
|
);
|
|
@@ -1254,7 +1254,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1254
1254
|
async function handleAutoRechargeOff(options) {
|
|
1255
1255
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1256
1256
|
if (options.dryRun) {
|
|
1257
|
-
|
|
1257
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1258
1258
|
{
|
|
1259
1259
|
ok: true,
|
|
1260
1260
|
dry_run: true,
|
|
@@ -1269,11 +1269,11 @@ async function handleAutoRechargeOff(options) {
|
|
|
1269
1269
|
);
|
|
1270
1270
|
return;
|
|
1271
1271
|
}
|
|
1272
|
-
const payload = await new (0,
|
|
1272
|
+
const payload = await new (0, _chunk44SHFHA3js.DeeplineClient)().billing.autoRecharge.update({
|
|
1273
1273
|
enabled: false,
|
|
1274
1274
|
idempotencyKey
|
|
1275
1275
|
});
|
|
1276
|
-
|
|
1276
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1277
1277
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1278
1278
|
{ json: options.json }
|
|
1279
1279
|
);
|
|
@@ -1292,11 +1292,11 @@ async function handleBuyCredits(creditsRaw, options) {
|
|
|
1292
1292
|
return;
|
|
1293
1293
|
}
|
|
1294
1294
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1295
|
-
const payload = await new (0,
|
|
1295
|
+
const payload = await new (0, _chunk44SHFHA3js.DeeplineClient)().billing.purchaseCredits({
|
|
1296
1296
|
credits,
|
|
1297
1297
|
idempotencyKey
|
|
1298
1298
|
});
|
|
1299
|
-
|
|
1299
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1300
1300
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1301
1301
|
{ json: options.json }
|
|
1302
1302
|
);
|
|
@@ -1332,7 +1332,7 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1332
1332
|
return;
|
|
1333
1333
|
}
|
|
1334
1334
|
if (options.dryRun) {
|
|
1335
|
-
|
|
1335
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1336
1336
|
{
|
|
1337
1337
|
ok: true,
|
|
1338
1338
|
dry_run: true,
|
|
@@ -1345,12 +1345,12 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1345
1345
|
);
|
|
1346
1346
|
return;
|
|
1347
1347
|
}
|
|
1348
|
-
const payload = await new (0,
|
|
1348
|
+
const payload = await new (0, _chunk44SHFHA3js.DeeplineClient)().billing.recoverCreditPurchase({
|
|
1349
1349
|
credits,
|
|
1350
1350
|
orgId: options.orgId,
|
|
1351
1351
|
idempotencyKey: options.idempotencyKey
|
|
1352
1352
|
});
|
|
1353
|
-
|
|
1353
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1354
1354
|
{ ok: true, idempotency_key: options.idempotencyKey, ...payload },
|
|
1355
1355
|
{ json: options.json }
|
|
1356
1356
|
);
|
|
@@ -1370,37 +1370,37 @@ async function handleTargetPlan(planSku, options) {
|
|
|
1370
1370
|
return;
|
|
1371
1371
|
}
|
|
1372
1372
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1373
|
-
const payload = await new (0,
|
|
1373
|
+
const payload = await new (0, _chunk44SHFHA3js.DeeplineClient)().billing.transitionPlan({
|
|
1374
1374
|
action: "start_or_change",
|
|
1375
1375
|
targetPlanSku: planSku,
|
|
1376
1376
|
...options.billingEmail ? { billingEmail: options.billingEmail } : {},
|
|
1377
1377
|
idempotencyKey
|
|
1378
1378
|
});
|
|
1379
|
-
|
|
1379
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1380
1380
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1381
1381
|
{ json: options.json }
|
|
1382
1382
|
);
|
|
1383
1383
|
}
|
|
1384
1384
|
async function handleTargetPlanCancellation(options) {
|
|
1385
1385
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1386
|
-
const payload = await new (0,
|
|
1386
|
+
const payload = await new (0, _chunk44SHFHA3js.DeeplineClient)().billing.transitionPlan({
|
|
1387
1387
|
action: options.undo ? "undo_cancel" : "cancel",
|
|
1388
1388
|
idempotencyKey
|
|
1389
1389
|
});
|
|
1390
|
-
|
|
1390
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1391
1391
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1392
1392
|
{ json: options.json }
|
|
1393
1393
|
);
|
|
1394
1394
|
}
|
|
1395
1395
|
async function handleTargetPortal(options) {
|
|
1396
|
-
const payload = await new (0,
|
|
1396
|
+
const payload = await new (0, _chunk44SHFHA3js.DeeplineClient)().billing.portalSession(
|
|
1397
1397
|
options.billingAddress ? { flow: "customer_update" } : void 0
|
|
1398
1398
|
);
|
|
1399
|
-
if (!options.json && !options.noOpen)
|
|
1400
|
-
|
|
1399
|
+
if (!options.json && !options.noOpen) _chunkBO3ADIBVjs.openInBrowser.call(void 0, payload.url);
|
|
1400
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1401
1401
|
}
|
|
1402
1402
|
async function handleRedeemCode(code, options) {
|
|
1403
|
-
const { http } =
|
|
1403
|
+
const { http } = _chunkBO3ADIBVjs.getAuthedHttpClient.call(void 0, );
|
|
1404
1404
|
const payload = await http.post(
|
|
1405
1405
|
"/api/v2/billing/checkout",
|
|
1406
1406
|
{
|
|
@@ -1408,8 +1408,8 @@ async function handleRedeemCode(code, options) {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
);
|
|
1410
1410
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1411
|
-
if (!options.json && !options.noOpen && url)
|
|
1412
|
-
|
|
1411
|
+
if (!options.json && !options.noOpen && url) _chunkBO3ADIBVjs.openInBrowser.call(void 0, url);
|
|
1412
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0,
|
|
1413
1413
|
{
|
|
1414
1414
|
...payload,
|
|
1415
1415
|
render: {
|
|
@@ -1431,29 +1431,29 @@ Concepts:
|
|
|
1431
1431
|
|
|
1432
1432
|
Examples:
|
|
1433
1433
|
# See where you stand
|
|
1434
|
-
deepline billing balance
|
|
1435
|
-
deepline billing usage --limit 20
|
|
1436
|
-
deepline billing plans
|
|
1437
|
-
deepline billing subscription status
|
|
1434
|
+
deepline billing balance
|
|
1435
|
+
deepline billing usage --limit 20
|
|
1436
|
+
deepline billing plans
|
|
1437
|
+
deepline billing subscription status
|
|
1438
1438
|
|
|
1439
1439
|
# Price a tool before execution; look up its exact charge afterward
|
|
1440
1440
|
deepline describe <tool-id>
|
|
1441
|
-
deepline billing usage --request-id <job_id>
|
|
1441
|
+
deepline billing usage --request-id <job_id>
|
|
1442
1442
|
|
|
1443
1443
|
# Buy credits or a plan
|
|
1444
|
-
deepline billing top-up 1000
|
|
1445
|
-
deepline billing checkout --credits 1000 --no-open
|
|
1446
|
-
deepline billing subscribe runtime-395-2026-07-v1 --no-open
|
|
1447
|
-
deepline billing redeem-code --code ABC123 --no-open
|
|
1444
|
+
deepline billing top-up 1000
|
|
1445
|
+
deepline billing checkout --credits 1000 --no-open
|
|
1446
|
+
deepline billing subscribe runtime-395-2026-07-v1 --no-open
|
|
1447
|
+
deepline billing redeem-code --code ABC123 --no-open
|
|
1448
1448
|
|
|
1449
1449
|
# Manage
|
|
1450
|
-
deepline billing subscription cancel --dry-run
|
|
1451
|
-
deepline billing set-limit 500
|
|
1450
|
+
deepline billing subscription cancel --dry-run
|
|
1451
|
+
deepline billing set-limit 500
|
|
1452
1452
|
|
|
1453
1453
|
# Records
|
|
1454
|
-
deepline billing invoices --limit 12
|
|
1455
|
-
deepline billing history --time 1m
|
|
1456
|
-
deepline billing ledger export all
|
|
1454
|
+
deepline billing invoices --limit 12
|
|
1455
|
+
deepline billing history --time 1m
|
|
1456
|
+
deepline billing ledger export all
|
|
1457
1457
|
`
|
|
1458
1458
|
);
|
|
1459
1459
|
billing.command("balance").description("Show current billing balance.").addHelpText(
|
|
@@ -1462,16 +1462,16 @@ Examples:
|
|
|
1462
1462
|
Notes:
|
|
1463
1463
|
Read-only. Shows the current Deepline credit balance for the active workspace.
|
|
1464
1464
|
The balance includes concurrent workspace activity, so a before/after difference
|
|
1465
|
-
cannot isolate one command. Use billing usage --request-id <job_id
|
|
1465
|
+
cannot isolate one command. Use billing usage --request-id <job_id>.
|
|
1466
1466
|
|
|
1467
|
-
Prints one line, "Balance: N credits",
|
|
1467
|
+
Prints one line, "Balance: N credits", plus what to do when
|
|
1468
1468
|
the workspace has no credits. --verbose adds reservations and usage awaiting
|
|
1469
1469
|
settlement. --json returns the full record.
|
|
1470
1470
|
|
|
1471
1471
|
Examples:
|
|
1472
1472
|
deepline billing balance
|
|
1473
1473
|
deepline billing balance --verbose
|
|
1474
|
-
deepline billing balance
|
|
1474
|
+
deepline billing balance
|
|
1475
1475
|
`
|
|
1476
1476
|
).option("--json", "Emit the full balance record as JSON").option("--verbose", "Add reservations and usage awaiting settlement").action(handleBalance);
|
|
1477
1477
|
billing.command("usage").description("Show current usage plus recent calls.").addHelpText(
|
|
@@ -1486,9 +1486,9 @@ Notes:
|
|
|
1486
1486
|
|
|
1487
1487
|
Examples:
|
|
1488
1488
|
deepline billing usage
|
|
1489
|
-
deepline billing usage --limit 50 --cursor <next_cursor>
|
|
1490
|
-
deepline billing usage --run-id play/example/run/20260630t120000-000-abcdef
|
|
1491
|
-
deepline billing usage --request-id <job_id>
|
|
1489
|
+
deepline billing usage --limit 50 --cursor <next_cursor>
|
|
1490
|
+
deepline billing usage --run-id play/example/run/20260630t120000-000-abcdef
|
|
1491
|
+
deepline billing usage --request-id <job_id>
|
|
1492
1492
|
`
|
|
1493
1493
|
).option("--limit <n>", "Recent-call page size").option("--offset <n>", "Recent-call offset").option(
|
|
1494
1494
|
"--cursor <cursor>",
|
|
@@ -1496,7 +1496,7 @@ Examples:
|
|
|
1496
1496
|
).option("--run-id <run_id>", "Show recent usage for one play run").option(
|
|
1497
1497
|
"--request-id <job_id>",
|
|
1498
1498
|
"Show the exact Deepline charge for one execution job_id"
|
|
1499
|
-
).option("--json", "Emit JSON output
|
|
1499
|
+
).option("--json", "Emit JSON output").action(handleUsage);
|
|
1500
1500
|
billing.command("limit").description("Show configured monthly usage cap.").addHelpText(
|
|
1501
1501
|
"after",
|
|
1502
1502
|
`
|
|
@@ -1506,9 +1506,9 @@ Notes:
|
|
|
1506
1506
|
|
|
1507
1507
|
Examples:
|
|
1508
1508
|
deepline billing limit
|
|
1509
|
-
deepline billing limit
|
|
1509
|
+
deepline billing limit
|
|
1510
1510
|
`
|
|
1511
|
-
).option("--json", "Emit JSON output
|
|
1511
|
+
).option("--json", "Emit JSON output").action(handleLimit);
|
|
1512
1512
|
billing.command("set-limit").description("Set monthly usage cap.").addHelpText(
|
|
1513
1513
|
"after",
|
|
1514
1514
|
`
|
|
@@ -1519,9 +1519,9 @@ Notes:
|
|
|
1519
1519
|
|
|
1520
1520
|
Examples:
|
|
1521
1521
|
deepline billing set-limit 500
|
|
1522
|
-
deepline billing set-limit 500
|
|
1522
|
+
deepline billing set-limit 500
|
|
1523
1523
|
`
|
|
1524
|
-
).argument("<credits>", "Monthly credits limit").option("--json", "Emit JSON output
|
|
1524
|
+
).argument("<credits>", "Monthly credits limit").option("--json", "Emit JSON output").action(handleSetLimit);
|
|
1525
1525
|
billing.command("off").description("Disable monthly usage cap.").addHelpText(
|
|
1526
1526
|
"after",
|
|
1527
1527
|
`
|
|
@@ -1530,9 +1530,9 @@ Notes:
|
|
|
1530
1530
|
|
|
1531
1531
|
Examples:
|
|
1532
1532
|
deepline billing off
|
|
1533
|
-
deepline billing off
|
|
1533
|
+
deepline billing off
|
|
1534
1534
|
`
|
|
1535
|
-
).option("--json", "Emit JSON output
|
|
1535
|
+
).option("--json", "Emit JSON output").action(handleLimitOff);
|
|
1536
1536
|
billing.command("ledger").description("Inspect and export billing ledger rows.").addHelpText(
|
|
1537
1537
|
"after",
|
|
1538
1538
|
`
|
|
@@ -1545,7 +1545,7 @@ Examples:
|
|
|
1545
1545
|
deepline billing ledger export all --output ./ledger.csv
|
|
1546
1546
|
deepline billing ledger export all --run-id play/demo/run/abc123
|
|
1547
1547
|
deepline billing ledger export all --operation limadata_find_audience_identifiers --since 2026-09-01T00:00:00Z
|
|
1548
|
-
deepline billing ledger export all
|
|
1548
|
+
deepline billing ledger export all
|
|
1549
1549
|
`
|
|
1550
1550
|
).addCommand(
|
|
1551
1551
|
new (0, _commander.Command)("export").description("Export billing ledger rows.").addHelpText(
|
|
@@ -1564,14 +1564,14 @@ Notes:
|
|
|
1564
1564
|
|
|
1565
1565
|
Examples:
|
|
1566
1566
|
deepline billing ledger export all
|
|
1567
|
-
deepline billing ledger export all
|
|
1567
|
+
deepline billing ledger export all
|
|
1568
1568
|
`
|
|
1569
1569
|
).option("--output <path>", "Write CSV to an explicit path").option("--run-id <run_id>", "Export ledger rows for one play run.").option("--operation <id>", "Export rows for one tool operation.").option(
|
|
1570
1570
|
"--since <timestamp>",
|
|
1571
1571
|
"Only export rows since ISO-8601 time or Unix milliseconds."
|
|
1572
1572
|
).option(
|
|
1573
1573
|
"--json",
|
|
1574
|
-
"Emit JSON output
|
|
1574
|
+
"Emit JSON output"
|
|
1575
1575
|
).action(handleLedgerExportAll)
|
|
1576
1576
|
)
|
|
1577
1577
|
);
|
|
@@ -1582,13 +1582,13 @@ Notes:
|
|
|
1582
1582
|
Read-only server query that writes a local CSV file. With --json, stdout is a
|
|
1583
1583
|
summary containing the output path, row count, and completeness metadata.
|
|
1584
1584
|
Exports the complete window using bounded pages. For an exact start timestamp:
|
|
1585
|
-
deepline billing ledger export all --since <ISO-8601>
|
|
1585
|
+
deepline billing ledger export all --since <ISO-8601>
|
|
1586
1586
|
|
|
1587
1587
|
Examples:
|
|
1588
1588
|
deepline billing history --time 1m
|
|
1589
|
-
deepline billing history --time 1y
|
|
1589
|
+
deepline billing history --time 1y
|
|
1590
1590
|
`
|
|
1591
|
-
).requiredOption("--time <window>", "Rolling time window: 1d, 1w, 1m, or 1y").option("--json", "Emit JSON output
|
|
1591
|
+
).requiredOption("--time <window>", "Rolling time window: 1d, 1w, 1m, or 1y").option("--json", "Emit JSON output").action(handleHistory);
|
|
1592
1592
|
billing.command("checkout").description(
|
|
1593
1593
|
"Create a checkout session and optionally open it in your browser."
|
|
1594
1594
|
).addHelpText(
|
|
@@ -1600,10 +1600,10 @@ Notes:
|
|
|
1600
1600
|
|
|
1601
1601
|
Examples:
|
|
1602
1602
|
deepline billing checkout --tier pro
|
|
1603
|
-
deepline billing checkout --credits 1000 --no-open
|
|
1603
|
+
deepline billing checkout --credits 1000 --no-open
|
|
1604
1604
|
deepline billing checkout --credits 1000 --discount-code LAUNCH --no-open
|
|
1605
1605
|
`
|
|
1606
|
-
).option("--tier <tierId>", "Named pricing tier").option("--credits <credits>", "Custom credit amount").option("--discount-code <code>", "Apply a discount code").option("--no-open", "Print the checkout URL without opening a browser").option("--json", "Emit JSON output
|
|
1606
|
+
).option("--tier <tierId>", "Named pricing tier").option("--credits <credits>", "Custom credit amount").option("--discount-code <code>", "Apply a discount code").option("--no-open", "Print the checkout URL without opening a browser").option("--json", "Emit JSON output").action(handleCheckout);
|
|
1607
1607
|
billing.command("top-up").description("Charge the saved payment method and add Deepline credits.").addHelpText(
|
|
1608
1608
|
"after",
|
|
1609
1609
|
`
|
|
@@ -1618,14 +1618,14 @@ Notes:
|
|
|
1618
1618
|
|
|
1619
1619
|
Examples:
|
|
1620
1620
|
deepline billing top-up 1000
|
|
1621
|
-
deepline billing top-up 1000
|
|
1622
|
-
deepline billing top-up 1000 --dry-run
|
|
1623
|
-
deepline billing top-up 1000 --idempotency-key refill-2026-07-08
|
|
1621
|
+
deepline billing top-up 1000
|
|
1622
|
+
deepline billing top-up 1000 --dry-run
|
|
1623
|
+
deepline billing top-up 1000 --idempotency-key refill-2026-07-08
|
|
1624
1624
|
`
|
|
1625
1625
|
).argument("<credits>", "Positive integer Deepline credit amount").option(
|
|
1626
1626
|
"--idempotency-key <key>",
|
|
1627
1627
|
"Stable retry key for the same intended top-up (1\u2013200 characters, no padding, valid HTTP header text)"
|
|
1628
|
-
).option("--dry-run", "Print the planned top-up without charging").option("--compact", "Keep only high-signal fields in JSON output").option("--json", "Emit JSON output
|
|
1628
|
+
).option("--dry-run", "Print the planned top-up without charging").option("--compact", "Keep only high-signal fields in JSON output").option("--json", "Emit JSON output").action(handleTopUp);
|
|
1629
1629
|
billing.command("buy").description("Buy credits through the target billing contract.").argument("<credits>", "Positive integer Deepline credit amount").option("--idempotency-key <key>", "Stable retry key").option("--json", "Emit JSON output").action(handleBuyCredits);
|
|
1630
1630
|
billing.command("top-up-recover").description(
|
|
1631
1631
|
"Inspect or retire an original top-up intent without starting a payment."
|
|
@@ -1635,9 +1635,9 @@ Examples:
|
|
|
1635
1635
|
).requiredOption(
|
|
1636
1636
|
"--idempotency-key <original-key>",
|
|
1637
1637
|
"Original purchase key; never generates a new key"
|
|
1638
|
-
).option("--dry-run", "Print the recovery request without changing state").option("--json", "Emit JSON output
|
|
1638
|
+
).option("--dry-run", "Print the recovery request without changing state").option("--json", "Emit JSON output").addHelpText(
|
|
1639
1639
|
"after",
|
|
1640
|
-
"\nAn absent intent is durably retired; an existing operation is returned unchanged.\nThis command never starts a payment. Use the original amount, workspace, and key.\nExample:\n deepline billing top-up-recover 1000 --org-id org_original --idempotency-key original-purchase-key
|
|
1640
|
+
"\nAn absent intent is durably retired; an existing operation is returned unchanged.\nThis command never starts a payment. Use the original amount, workspace, and key.\nExample:\n deepline billing top-up-recover 1000 --org-id org_original --idempotency-key original-purchase-key\n"
|
|
1641
1641
|
).action(handleTopUpRecover);
|
|
1642
1642
|
billing.command("status").description(
|
|
1643
1643
|
"Show plan, payment, and recharge state; use usage for charges."
|
|
@@ -1647,9 +1647,9 @@ Examples:
|
|
|
1647
1647
|
"after",
|
|
1648
1648
|
`
|
|
1649
1649
|
Examples:
|
|
1650
|
-
deepline billing auto-recharge status
|
|
1651
|
-
deepline billing auto-recharge set --threshold-credits 1000 --refill-to-credits 3500 --dry-run
|
|
1652
|
-
deepline billing auto-recharge off --dry-run
|
|
1650
|
+
deepline billing auto-recharge status
|
|
1651
|
+
deepline billing auto-recharge set --threshold-credits 1000 --refill-to-credits 3500 --dry-run
|
|
1652
|
+
deepline billing auto-recharge off --dry-run
|
|
1653
1653
|
`
|
|
1654
1654
|
).addCommand(
|
|
1655
1655
|
new (0, _commander.Command)("status").description("Show the canonical automatic recharge configuration.").option("--json", "Emit JSON output").action(handleAutoRechargeStatus)
|
|
@@ -1679,8 +1679,8 @@ Examples:
|
|
|
1679
1679
|
new (0, _commander.Command)("trigger").description(
|
|
1680
1680
|
"Evaluate capped automatic recharge and resume any pending purchase."
|
|
1681
1681
|
).option("--json", "Emit JSON output").action(async (options) => {
|
|
1682
|
-
const result = await new (0,
|
|
1683
|
-
|
|
1682
|
+
const result = await new (0, _chunk44SHFHA3js.DeeplineClient)().billing.autoRecharge.trigger();
|
|
1683
|
+
_chunkBO3ADIBVjs.printCommandEnvelope.call(void 0, { ok: true, ...result }, { json: options.json });
|
|
1684
1684
|
})
|
|
1685
1685
|
);
|
|
1686
1686
|
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(
|
|
@@ -1701,9 +1701,9 @@ Notes:
|
|
|
1701
1701
|
|
|
1702
1702
|
Examples:
|
|
1703
1703
|
deepline billing plans
|
|
1704
|
-
deepline billing plans
|
|
1704
|
+
deepline billing plans
|
|
1705
1705
|
`
|
|
1706
|
-
).option("--json", "Emit JSON output
|
|
1706
|
+
).option("--json", "Emit JSON output").action(handlePlans);
|
|
1707
1707
|
billing.command("subscribe").description(
|
|
1708
1708
|
"Start a subscription checkout for a plan and optionally open it in your browser."
|
|
1709
1709
|
).addHelpText(
|
|
@@ -1717,18 +1717,18 @@ Notes:
|
|
|
1717
1717
|
|
|
1718
1718
|
Examples:
|
|
1719
1719
|
deepline billing subscribe runtime-395-2026-07-v1
|
|
1720
|
-
deepline billing subscribe runtime-395-2026-07-v1 --no-open
|
|
1720
|
+
deepline billing subscribe runtime-395-2026-07-v1 --no-open
|
|
1721
1721
|
`
|
|
1722
|
-
).argument("<plan_version_id>", "Legacy billing plan version id").option("--no-open", "Print the checkout URL without opening a browser").option("--json", "Emit JSON output
|
|
1722
|
+
).argument("<plan_version_id>", "Legacy billing plan version id").option("--no-open", "Print the checkout URL without opening a browser").option("--json", "Emit JSON output").action(handleSubscribe);
|
|
1723
1723
|
billing.command("subscription").description("Inspect and manage subscription state for the workspace.").addHelpText(
|
|
1724
1724
|
"after",
|
|
1725
1725
|
`
|
|
1726
1726
|
Examples:
|
|
1727
1727
|
deepline billing subscription status
|
|
1728
|
-
deepline billing subscription status
|
|
1728
|
+
deepline billing subscription status
|
|
1729
1729
|
deepline billing subscription cancel --dry-run
|
|
1730
|
-
deepline billing subscription cancel
|
|
1731
|
-
deepline billing subscription cancel --undo
|
|
1730
|
+
deepline billing subscription cancel
|
|
1731
|
+
deepline billing subscription cancel --undo
|
|
1732
1732
|
`
|
|
1733
1733
|
).addCommand(
|
|
1734
1734
|
new (0, _commander.Command)("status").description("Show active plan, subscription state, and credit pools.").addHelpText(
|
|
@@ -1740,11 +1740,11 @@ Notes:
|
|
|
1740
1740
|
|
|
1741
1741
|
Examples:
|
|
1742
1742
|
deepline billing subscription status
|
|
1743
|
-
deepline billing subscription status
|
|
1743
|
+
deepline billing subscription status
|
|
1744
1744
|
`
|
|
1745
1745
|
).option(
|
|
1746
1746
|
"--json",
|
|
1747
|
-
"Emit JSON output
|
|
1747
|
+
"Emit JSON output"
|
|
1748
1748
|
).action(handleSubscriptionStatus)
|
|
1749
1749
|
).addCommand(
|
|
1750
1750
|
new (0, _commander.Command)("cancel").description("Cancel the subscription at period end. Credits are kept.").addHelpText(
|
|
@@ -1768,14 +1768,14 @@ Examples:
|
|
|
1768
1768
|
deepline billing subscription cancel --dry-run
|
|
1769
1769
|
deepline billing subscription cancel
|
|
1770
1770
|
deepline billing subscription cancel --undo
|
|
1771
|
-
deepline billing subscription cancel
|
|
1771
|
+
deepline billing subscription cancel
|
|
1772
1772
|
`
|
|
1773
1773
|
).option("--undo", "Reverse a pending cancellation before period end").option(
|
|
1774
1774
|
"--dry-run",
|
|
1775
1775
|
"Print the planned cancellation without calling the cancel endpoint"
|
|
1776
1776
|
).option(
|
|
1777
1777
|
"--json",
|
|
1778
|
-
"Emit JSON output
|
|
1778
|
+
"Emit JSON output"
|
|
1779
1779
|
).action(handleSubscriptionCancel)
|
|
1780
1780
|
);
|
|
1781
1781
|
billing.command("invoices").description("List subscription invoices and credit purchase receipts.").addHelpText(
|
|
@@ -1789,10 +1789,10 @@ Notes:
|
|
|
1789
1789
|
|
|
1790
1790
|
Examples:
|
|
1791
1791
|
deepline billing invoices
|
|
1792
|
-
deepline billing invoices --limit 12
|
|
1793
|
-
deepline billing invoices --compact
|
|
1792
|
+
deepline billing invoices --limit 12
|
|
1793
|
+
deepline billing invoices --compact
|
|
1794
1794
|
`
|
|
1795
|
-
).option("--limit <n>", "Maximum entries to return (1-100, default 24)").option("--compact", "Keep only id, date, amount, status, and url").option("--json", "Emit JSON output
|
|
1795
|
+
).option("--limit <n>", "Maximum entries to return (1-100, default 24)").option("--compact", "Keep only id, date, amount, status, and url").option("--json", "Emit JSON output").action(handleInvoices);
|
|
1796
1796
|
billing.command("redeem-code").description("Redeem a billing code.").addHelpText(
|
|
1797
1797
|
"after",
|
|
1798
1798
|
`
|
|
@@ -1802,9 +1802,9 @@ Notes:
|
|
|
1802
1802
|
|
|
1803
1803
|
Examples:
|
|
1804
1804
|
deepline billing redeem-code --code ABC123
|
|
1805
|
-
deepline billing redeem-code --code ABC123 --no-open
|
|
1805
|
+
deepline billing redeem-code --code ABC123 --no-open
|
|
1806
1806
|
`
|
|
1807
|
-
).requiredOption("--code <code>", "Code to redeem").option("--no-open", "Do not open a browser").option("--json", "Emit JSON output
|
|
1807
|
+
).requiredOption("--code <code>", "Code to redeem").option("--no-open", "Do not open a browser").option("--json", "Emit JSON output").action(({ code, ...options }) => handleRedeemCode(code, options));
|
|
1808
1808
|
}
|
|
1809
1809
|
|
|
1810
1810
|
|