deepline 0.3.569 → 0.3.571
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/app-runtime-api.ts +25 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +17 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-connection-probe.ts +199 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +43 -0
- package/dist/cli/{auth-VNJLXDGF.mjs → auth-ARGNQK7A.mjs} +5 -5
- package/dist/cli/auth-FKYYYCME.js +44 -0
- package/dist/cli/{billing-OTIIK5ZQ.js → billing-KAKODYTN.js} +99 -99
- package/dist/cli/{billing-6HD5LEI2.mjs → billing-QRZTHCBX.mjs} +8 -8
- package/dist/cli/{chunk-HLRSNCPM.js → chunk-2IZOCGOA.js} +53 -53
- package/dist/cli/{chunk-FPRLFIYT.mjs → chunk-336AHC7H.mjs} +4 -4
- package/dist/cli/{chunk-FSAOU4HA.js → chunk-6N3NTEJ6.js} +20 -20
- package/dist/cli/{chunk-H3SQMLHO.js → chunk-6OP5UW7C.js} +48 -48
- package/dist/cli/{chunk-MIGJHZ3P.js → chunk-73P76DCN.js} +20 -20
- package/dist/cli/{chunk-JXRWSBJZ.mjs → chunk-7HAYEKC4.mjs} +1 -1
- package/dist/cli/{chunk-H7DRZXYF.js → chunk-7JGHNZTD.js} +4 -4
- package/dist/cli/{chunk-7QH52S3E.mjs → chunk-A3B54QEW.mjs} +3 -3
- package/dist/cli/{chunk-IEOIGU5A.mjs → chunk-A3IVPA6Q.mjs} +1 -1
- package/dist/cli/{chunk-WVS2ITKP.js → chunk-A5HDA22N.js} +3 -3
- package/dist/cli/{chunk-6HEZRKAO.mjs → chunk-AD7BGMTL.mjs} +2 -2
- package/dist/cli/{chunk-N5ZOD3LA.js → chunk-AOMVAXGX.js} +10 -10
- package/dist/cli/{chunk-SWREMC6J.js → chunk-C27FK36H.js} +5 -5
- package/dist/cli/{chunk-6Z7B3IOW.js → chunk-C3FHMJ4A.js} +2 -2
- package/dist/cli/{chunk-X4WPW5O3.mjs → chunk-C6XV2DPY.mjs} +3 -3
- package/dist/cli/{chunk-OFBP336D.mjs → chunk-CF6CSAMJ.mjs} +4 -4
- package/dist/cli/{chunk-EDNWMQZQ.mjs → chunk-CFMIWRGD.mjs} +2 -2
- package/dist/cli/{chunk-YTOILYBU.js → chunk-CITDBSXI.js} +26 -26
- package/dist/cli/{chunk-D3BJ2KZX.mjs → chunk-CR6IPQBB.mjs} +1 -1
- package/dist/cli/{chunk-YTYDKSK7.mjs → chunk-ETGM6PIR.mjs} +5 -5
- package/dist/cli/{chunk-CK6U2NH2.mjs → chunk-FQP5VSVF.mjs} +1 -1
- package/dist/cli/{chunk-PAFSVZCZ.js → chunk-GACQOGRS.js} +15 -15
- package/dist/cli/{chunk-UOMMXLDU.mjs → chunk-GCE5KOJJ.mjs} +11 -11
- package/dist/cli/{chunk-ANXJNE2G.js → chunk-GOUKX6XD.js} +3 -3
- package/dist/cli/{chunk-45OTCUAC.mjs → chunk-GRD3DLH7.mjs} +2 -2
- package/dist/cli/{chunk-DG6ILAO7.mjs → chunk-H6QMUX7Y.mjs} +2 -2
- package/dist/cli/{chunk-S4MDYDCF.js → chunk-HGER4CJA.js} +5 -5
- package/dist/cli/{chunk-TZVKEUM6.js → chunk-IFKZQCPX.js} +1 -1
- package/dist/cli/{chunk-IGIUAHTR.js → chunk-ILKUKEWX.js} +41 -41
- package/dist/cli/{chunk-4CLEOTG6.js → chunk-IXFFOZZQ.js} +2 -2
- package/dist/cli/{chunk-YNSVWNRY.mjs → chunk-J5KW2ZDB.mjs} +1 -1
- package/dist/cli/{chunk-QLMMNBJW.js → chunk-MFBFQUQK.js} +6 -6
- package/dist/cli/{chunk-TH2GHSF6.js → chunk-NAGGCF6Y.js} +5 -5
- package/dist/cli/{chunk-AKNJDDSM.mjs → chunk-PO3NOBHU.mjs} +1 -1
- package/dist/cli/{chunk-LOF7H5V3.js → chunk-PTM5V5FV.js} +7 -7
- package/dist/cli/{chunk-P2LVKWU6.mjs → chunk-QRMTITKL.mjs} +2 -2
- package/dist/cli/{chunk-44HOKKIN.js → chunk-RBPR5ZNN.js} +100 -100
- package/dist/cli/{chunk-3WZ3X46C.js → chunk-SJYLLHHZ.js} +13 -13
- package/dist/cli/{chunk-7NP7WZV2.mjs → chunk-TJU2BECV.mjs} +3 -3
- package/dist/cli/{chunk-SRMDDVWK.mjs → chunk-UBNRPJKO.mjs} +5 -5
- package/dist/cli/{chunk-TRE5X6VQ.mjs → chunk-UTGHPC5D.mjs} +1 -1
- package/dist/cli/{chunk-S3VGWMFX.js → chunk-VLQB65HI.js} +9 -9
- package/dist/cli/{chunk-WPCY5PR3.mjs → chunk-VULSFPD4.mjs} +5 -5
- package/dist/cli/{chunk-7MZUSBSI.js → chunk-WOU2WS6S.js} +23 -23
- package/dist/cli/{chunk-6D4WBX7E.mjs → chunk-WZOUXILM.mjs} +1 -1
- package/dist/cli/{chunk-IS4NFIQY.js → chunk-XD4MT4BH.js} +8 -8
- package/dist/cli/{chunk-YLZ63U7S.mjs → chunk-YDM5WSXO.mjs} +5 -5
- package/dist/cli/{chunk-GSUHJUNZ.mjs → chunk-YDULFKDL.mjs} +2 -2
- package/dist/cli/{chunk-SMAXLMM3.js → chunk-YGGHPEWP.js} +15 -15
- package/dist/cli/{chunk-QKPKVLTG.js → chunk-YQ36Z23U.js} +2 -2
- package/dist/cli/{chunk-TALKTQK5.mjs → chunk-Z3DSCE5F.mjs} +1 -1
- package/dist/cli/{chunk-6SBGYX25.mjs → chunk-Z6OUUAIV.mjs} +2 -2
- package/dist/cli/{concurrent-runs-help-BVBGDMNV.mjs → concurrent-runs-help-VPYB4ODC.mjs} +6 -6
- package/dist/cli/concurrent-runs-help-VUMIMYO7.js +22 -0
- package/dist/cli/{csv-G25E43QV.js → csv-GHGDSFNV.js} +13 -13
- package/dist/cli/{csv-BUZIP2TV.mjs → csv-RALLG3MG.mjs} +4 -4
- package/dist/cli/{db-KYIDDEEE.js → db-722SKSIB.js} +27 -27
- package/dist/cli/{db-EUN7RRDX.mjs → db-HB65VYRR.mjs} +6 -6
- package/dist/cli/{describe-CTYSKRQB.mjs → describe-Q6M7PUBU.mjs} +18 -18
- package/dist/cli/describe-SG2N62VE.js +50 -0
- package/dist/cli/{executions-BRSOIIV7.mjs → executions-G3M75HW2.mjs} +6 -6
- package/dist/cli/{executions-LQA34Z76.js → executions-GQNV3LNU.js} +8 -8
- package/dist/cli/{feedback-RVYWQRSZ.js → feedback-B43F2FBL.js} +14 -14
- package/dist/cli/{feedback-JYL2FTWI.mjs → feedback-CSDBYSRS.mjs} +6 -6
- package/dist/cli/git-IJHKRWTR.js +26 -0
- package/dist/cli/{git-2Z2KYPCV.mjs → git-IZ4Y3RAW.mjs} +5 -5
- package/dist/cli/index.js +143 -143
- package/dist/cli/index.mjs +45 -45
- package/dist/cli/{integrations-QFS62VWE.mjs → integrations-DT7EGM2Y.mjs} +7 -7
- package/dist/cli/{integrations-JK3OT5BT.js → integrations-OLCUWZ6Z.js} +29 -29
- package/dist/cli/{legacy-noops-NBKBFVDO.mjs → legacy-noops-4TPT534L.mjs} +6 -6
- package/dist/cli/{legacy-noops-RYP5LN5D.js → legacy-noops-FTGNTO3U.js} +9 -9
- package/dist/cli/{mcp-KPY7NZPI.js → mcp-3IDWLBKK.js} +24 -24
- package/dist/cli/{mcp-KVGJK3SM.mjs → mcp-5KDJJT7M.mjs} +4 -4
- package/dist/cli/{monitors-DE5SX3CP.js → monitors-7GOZBKJR.js} +100 -100
- package/dist/cli/{monitors-H3UWQMMI.mjs → monitors-EOAA5RQO.mjs} +7 -7
- package/dist/cli/{org-N6I5K56T.mjs → org-H5I56A4F.mjs} +6 -6
- package/dist/cli/{org-CDCSMG3J.js → org-UJ5SWQJ5.js} +121 -121
- package/dist/cli/{outcomes-UNAOLWWO.js → outcomes-24KFY2X5.js} +14 -14
- package/dist/cli/{outcomes-EPEMTJVB.mjs → outcomes-MG57YXJX.mjs} +6 -6
- package/dist/cli/{play-VVM5XJFT.mjs → play-MXPXRAUM.mjs} +19 -19
- package/dist/cli/{play-7TVJ3DFQ.js → play-PPPACSQE.js} +324 -324
- package/dist/cli/{providers-47CT527B.mjs → providers-5ZN3MO6E.mjs} +6 -6
- package/dist/cli/{providers-ANYRJ56K.js → providers-LTYNEXLB.js} +9 -9
- package/dist/cli/{quickstart-QHMC5YCM.mjs → quickstart-ENDTTNLE.mjs} +4 -4
- package/dist/cli/{quickstart-H4MI6LVO.js → quickstart-UBDHX7PT.js} +6 -6
- package/dist/cli/{run-V4UAYPAX.js → run-6O6LQVWD.js} +44 -44
- package/dist/cli/{run-NXC5W5CW.mjs → run-QJJSP35C.mjs} +23 -23
- package/dist/cli/{search-BEU4VBY4.mjs → search-PXZPVXDK.mjs} +7 -7
- package/dist/cli/search-TYPJWK4I.js +32 -0
- package/dist/cli/{search-output-NUGUU7VJ.js → search-output-H3ZQLJUF.js} +6 -6
- package/dist/cli/{search-output-DUA3WDB7.mjs → search-output-KRR4YOJX.mjs} +4 -4
- package/dist/cli/{secrets-XQOOWTH2.mjs → secrets-HIGERL4N.mjs} +6 -6
- package/dist/cli/{secrets-PFDBC5KO.js → secrets-QZMXBI64.js} +15 -15
- package/dist/cli/{sessions-U2ZS5R42.mjs → sessions-4SGQAX3F.mjs} +6 -6
- package/dist/cli/sessions-OS4ZBU4K.js +23 -0
- package/dist/cli/{settings-ATYARYCR.js → settings-FFTTVDRV.js} +85 -85
- package/dist/cli/{settings-GPDE7DL2.mjs → settings-UQLHVBOP.mjs} +12 -12
- package/dist/cli/{setup-UDO6BY5A.mjs → setup-R5MBUG5M.mjs} +9 -9
- package/dist/cli/{setup-4AYMU7NK.js → setup-SS3MABJP.js} +49 -49
- package/dist/cli/skills-FVDSEEUL.js +37 -0
- package/dist/cli/{skills-RACTA7VV.mjs → skills-X6PNEVWX.mjs} +7 -7
- package/dist/cli/tools-ORTGWD63.js +57 -0
- package/dist/cli/{tools-TXI6XFHE.mjs → tools-YFW3FXAB.mjs} +17 -17
- package/dist/cli/{update-VHTKWNXO.mjs → update-HX5BNFLQ.mjs} +9 -9
- package/dist/cli/update-RWVNNNHN.js +37 -0
- package/dist/cli/{views-DVBO3L63.js → views-BGCRC22G.js} +21 -21
- package/dist/cli/{views-GCNEHB7D.mjs → views-FH5XL2PU.mjs} +6 -6
- package/dist/cli/{workflow-TFRJ5JKX.js → workflow-UY5PZBIK.js} +17 -17
- package/dist/cli/{workflow-R3A6EGB5.mjs → workflow-VLNDGNJI.mjs} +7 -7
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +113 -112
- 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.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-77NOPZ6A.js +0 -44
- package/dist/cli/concurrent-runs-help-QPUTOBFB.js +0 -22
- package/dist/cli/describe-PJIQSXJ4.js +0 -50
- package/dist/cli/git-MJRG55H7.js +0 -26
- package/dist/cli/search-TUK2STXB.js +0 -32
- package/dist/cli/sessions-5333FFSY.js +0 -23
- package/dist/cli/skills-LB56HJOY.js +0 -37
- package/dist/cli/tools-3Y7KCKZX.js +0 -57
- package/dist/cli/update-EWOLMH3E.js +0 -37
|
@@ -1,15 +1,15 @@
|
|
|
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
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkNAGGCF6Yjs = require('./chunk-NAGGCF6Y.js');
|
|
4
|
+
require('./chunk-2IZOCGOA.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkHGER4CJAjs = require('./chunk-HGER4CJA.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkXD4MT4BHjs = require('./chunk-XD4MT4BH.js');
|
|
13
13
|
require('./chunk-4WAM6TLD.js');
|
|
14
14
|
require('./chunk-MJTVX4QK.js');
|
|
15
15
|
require('./chunk-PMH4GLMD.js');
|
|
@@ -32,9 +32,9 @@ var _chunkYGCKMI5Pjs = require('./chunk-YGCKMI5P.js');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
36
|
-
require('./chunk-
|
|
37
|
-
require('./chunk-
|
|
35
|
+
var _chunk6N3NTEJ6js = require('./chunk-6N3NTEJ6.js');
|
|
36
|
+
require('./chunk-A5HDA22N.js');
|
|
37
|
+
require('./chunk-7JGHNZTD.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -44,7 +44,7 @@ require('./chunk-XNYIZMNQ.js');
|
|
|
44
44
|
|
|
45
45
|
var _chunkLFQJW4S2js = require('./chunk-LFQJW4S2.js');
|
|
46
46
|
require('./chunk-CFJFUVX2.js');
|
|
47
|
-
require('./chunk-
|
|
47
|
+
require('./chunk-IFKZQCPX.js');
|
|
48
48
|
require('./chunk-OG64RBAC.js');
|
|
49
49
|
require('./chunk-COGTRVWW.js');
|
|
50
50
|
|
|
@@ -140,7 +140,7 @@ function reportBillingFailure(failure, options) {
|
|
|
140
140
|
if (failure.next) {
|
|
141
141
|
textLines.push(`Next: ${failure.next}`);
|
|
142
142
|
}
|
|
143
|
-
|
|
143
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
144
144
|
{
|
|
145
145
|
ok: false,
|
|
146
146
|
exitCode: failure.exitCode,
|
|
@@ -161,7 +161,7 @@ function parseTopUpCredits(raw) {
|
|
|
161
161
|
return parsed;
|
|
162
162
|
}
|
|
163
163
|
function topUpIdempotencyKey(raw) {
|
|
164
|
-
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` :
|
|
164
|
+
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` : _chunkXD4MT4BHjs.requireBillingIdempotencyKey.call(void 0, raw);
|
|
165
165
|
}
|
|
166
166
|
function targetBillingIdempotencyKey(raw) {
|
|
167
167
|
return typeof raw === "string" ? raw : `cli_target_billing:${Date.now()}:${_crypto.randomUUID.call(void 0, )}`;
|
|
@@ -380,7 +380,7 @@ function defaultLedgerExportPath() {
|
|
|
380
380
|
);
|
|
381
381
|
}
|
|
382
382
|
async function handleBalance(options) {
|
|
383
|
-
const { http } =
|
|
383
|
+
const { http } = _chunk6N3NTEJ6js.getAuthedHttpClient.call(void 0, );
|
|
384
384
|
const payload = await http.get(
|
|
385
385
|
"/api/v2/billing/balance"
|
|
386
386
|
);
|
|
@@ -470,7 +470,7 @@ async function handleBalance(options) {
|
|
|
470
470
|
...options.verbose ? detail : [],
|
|
471
471
|
...lines.slice(1)
|
|
472
472
|
];
|
|
473
|
-
|
|
473
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
474
474
|
{
|
|
475
475
|
...payload,
|
|
476
476
|
...recovery ? { recovery } : {},
|
|
@@ -506,7 +506,7 @@ async function handleUsageEvents(options) {
|
|
|
506
506
|
);
|
|
507
507
|
return;
|
|
508
508
|
}
|
|
509
|
-
const client = new (0,
|
|
509
|
+
const client = new (0, _chunkHGER4CJAjs.DeeplineClient)();
|
|
510
510
|
let payload;
|
|
511
511
|
try {
|
|
512
512
|
payload = await client.billing.usageEvents({
|
|
@@ -537,7 +537,7 @@ async function handleUsageEvents(options) {
|
|
|
537
537
|
),
|
|
538
538
|
...nextPage ? [`Next page: ${nextPage}`] : []
|
|
539
539
|
];
|
|
540
|
-
|
|
540
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
541
541
|
{
|
|
542
542
|
...payload,
|
|
543
543
|
next: { page: nextPage },
|
|
@@ -559,7 +559,7 @@ async function handleUsage(options) {
|
|
|
559
559
|
return;
|
|
560
560
|
}
|
|
561
561
|
if (options.events) return handleUsageEvents(options);
|
|
562
|
-
const { http } =
|
|
562
|
+
const { http } = _chunk6N3NTEJ6js.getAuthedHttpClient.call(void 0, );
|
|
563
563
|
const params = new URLSearchParams();
|
|
564
564
|
if (options.requestId !== void 0) {
|
|
565
565
|
const requestId = options.requestId.trim();
|
|
@@ -643,7 +643,7 @@ async function handleUsage(options) {
|
|
|
643
643
|
"No continuation is available for this view. Use deepline billing ledger export all for the full ledger."
|
|
644
644
|
] : []
|
|
645
645
|
];
|
|
646
|
-
|
|
646
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
647
647
|
{
|
|
648
648
|
...payload,
|
|
649
649
|
recent: {
|
|
@@ -657,7 +657,7 @@ async function handleUsage(options) {
|
|
|
657
657
|
);
|
|
658
658
|
}
|
|
659
659
|
async function handleLimit(options) {
|
|
660
|
-
const { http } =
|
|
660
|
+
const { http } = _chunk6N3NTEJ6js.getAuthedHttpClient.call(void 0, );
|
|
661
661
|
const payload = await http.get(
|
|
662
662
|
"/api/v2/billing/limit"
|
|
663
663
|
);
|
|
@@ -665,7 +665,7 @@ async function handleLimit(options) {
|
|
|
665
665
|
`Monthly usage cap: ${_nullishCoalesce(payload.monthly_credits_limit, () => ( "(unknown)"))}`,
|
|
666
666
|
"Enforcement: checked before new calls; in-flight work can exceed the cap."
|
|
667
667
|
] : ["Monthly usage cap: off"];
|
|
668
|
-
|
|
668
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
669
669
|
{
|
|
670
670
|
...payload,
|
|
671
671
|
render: { sections: [{ title: "billing limit", lines }] }
|
|
@@ -674,12 +674,12 @@ async function handleLimit(options) {
|
|
|
674
674
|
);
|
|
675
675
|
}
|
|
676
676
|
async function handleSetLimit(credits, options) {
|
|
677
|
-
const { http } =
|
|
677
|
+
const { http } = _chunk6N3NTEJ6js.getAuthedHttpClient.call(void 0, );
|
|
678
678
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
679
679
|
method: "PUT",
|
|
680
680
|
body: { monthly_credits_limit: Number.parseInt(credits, 10) }
|
|
681
681
|
});
|
|
682
|
-
|
|
682
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
683
683
|
{
|
|
684
684
|
...payload,
|
|
685
685
|
render: {
|
|
@@ -695,11 +695,11 @@ async function handleSetLimit(credits, options) {
|
|
|
695
695
|
);
|
|
696
696
|
}
|
|
697
697
|
async function handleLimitOff(options) {
|
|
698
|
-
const { http } =
|
|
698
|
+
const { http } = _chunk6N3NTEJ6js.getAuthedHttpClient.call(void 0, );
|
|
699
699
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
700
700
|
method: "DELETE"
|
|
701
701
|
});
|
|
702
|
-
|
|
702
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
703
703
|
{
|
|
704
704
|
...payload,
|
|
705
705
|
render: {
|
|
@@ -719,7 +719,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
719
719
|
let initialized = false;
|
|
720
720
|
let pageNumber = 0;
|
|
721
721
|
console.error(`Exporting billing ledger to ${outputPath}`);
|
|
722
|
-
for await (const entries of
|
|
722
|
+
for await (const entries of _chunkXD4MT4BHjs.iterateCursorPages.call(void 0, async (cursor) => {
|
|
723
723
|
pageNumber += 1;
|
|
724
724
|
console.error(
|
|
725
725
|
`Fetching page ${pageNumber}; ${summary.row_count} rows written.`
|
|
@@ -758,7 +758,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
758
758
|
return summary;
|
|
759
759
|
}
|
|
760
760
|
async function handleHistory(options) {
|
|
761
|
-
const { http } =
|
|
761
|
+
const { http } = _chunk6N3NTEJ6js.getAuthedHttpClient.call(void 0, );
|
|
762
762
|
const windows = {
|
|
763
763
|
"1d": 86400,
|
|
764
764
|
"1w": 604800,
|
|
@@ -770,10 +770,10 @@ async function handleHistory(options) {
|
|
|
770
770
|
process.cwd(),
|
|
771
771
|
"deepline",
|
|
772
772
|
"data",
|
|
773
|
-
|
|
773
|
+
_chunk6N3NTEJ6js.createTimestampedName.call(void 0, `billing-history-${options.time}`, "csv")
|
|
774
774
|
);
|
|
775
775
|
const summary = await exportLedger(http, outputPath, { sinceAt });
|
|
776
|
-
|
|
776
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
777
777
|
{
|
|
778
778
|
output_path: outputPath,
|
|
779
779
|
row_count: summary.row_count,
|
|
@@ -810,14 +810,14 @@ async function handleLedgerExportAll(options) {
|
|
|
810
810
|
);
|
|
811
811
|
return;
|
|
812
812
|
}
|
|
813
|
-
const { http } =
|
|
813
|
+
const { http } = _chunk6N3NTEJ6js.getAuthedHttpClient.call(void 0, );
|
|
814
814
|
const outputPath = options.output ? _path.resolve.call(void 0, String(options.output)) : defaultLedgerExportPath();
|
|
815
815
|
const summary = await exportLedger(http, outputPath, {
|
|
816
816
|
sinceAt,
|
|
817
817
|
runId: options.runId,
|
|
818
818
|
operation: options.operation
|
|
819
819
|
});
|
|
820
|
-
|
|
820
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
821
821
|
{
|
|
822
822
|
output_path: outputPath,
|
|
823
823
|
row_count: summary.row_count,
|
|
@@ -859,7 +859,7 @@ function targetPlanLine(plan) {
|
|
|
859
859
|
return `${_nullishCoalesce(plan.display_name, () => ( plan.name))} (${_nullishCoalesce(plan.public_sku, () => ( plan.sku))}) | ${planPriceText(plan.recurring_price_usd, plan.interval)}${firstMonth}${bonus}${annual} | ${plan.included_credits} included credits/month | $${plan.purchased_credit_price_usd}/purchased credit | ${plan.acquisition_enabled ? "available" : "unavailable"}`;
|
|
860
860
|
}
|
|
861
861
|
async function handlePlans(options) {
|
|
862
|
-
const client = new (0,
|
|
862
|
+
const client = new (0, _chunkHGER4CJAjs.DeeplineClient)();
|
|
863
863
|
const payload = await client.billing.targetPlans(
|
|
864
864
|
options.promoCode ? { promoCode: options.promoCode } : void 0
|
|
865
865
|
);
|
|
@@ -885,8 +885,8 @@ async function handlePlans(options) {
|
|
|
885
885
|
...plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...plans.map(targetPlanLine)],
|
|
886
886
|
_optionalChain([promo, 'optionalAccess', _15 => _15.status]) === "applied" ? `Change plan: deepline billing change-plan <plan_sku> --promo-code ${promo.code}` : "Change plan: deepline billing change-plan <plan_sku>"
|
|
887
887
|
];
|
|
888
|
-
const legacyPayload =
|
|
889
|
-
|
|
888
|
+
const legacyPayload = _chunk6N3NTEJ6js.shouldEmitJson.call(void 0, options.json) ? await client.billing.plans() : null;
|
|
889
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
890
890
|
{
|
|
891
891
|
..._nullishCoalesce(legacyPayload, () => ( payload)),
|
|
892
892
|
...legacyPayload ? { target_billing: payload } : {},
|
|
@@ -896,7 +896,7 @@ async function handlePlans(options) {
|
|
|
896
896
|
);
|
|
897
897
|
}
|
|
898
898
|
async function handleSubscribe(planVersionId, options) {
|
|
899
|
-
const { http } =
|
|
899
|
+
const { http } = _chunk6N3NTEJ6js.getAuthedHttpClient.call(void 0, );
|
|
900
900
|
const payload = await http.request(
|
|
901
901
|
"/api/v2/billing/subscription/checkout",
|
|
902
902
|
{
|
|
@@ -905,8 +905,8 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
905
905
|
}
|
|
906
906
|
);
|
|
907
907
|
const url = String(payload.checkout_url || "");
|
|
908
|
-
if (!options.json && options.open !== false && url)
|
|
909
|
-
|
|
908
|
+
if (!options.json && options.open !== false && url) _chunk6N3NTEJ6js.openInBrowser.call(void 0, url);
|
|
909
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
910
910
|
{
|
|
911
911
|
...payload,
|
|
912
912
|
render: {
|
|
@@ -922,7 +922,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
922
922
|
);
|
|
923
923
|
}
|
|
924
924
|
async function handleSubscriptionStatus(options) {
|
|
925
|
-
const client = new (0,
|
|
925
|
+
const client = new (0, _chunkHGER4CJAjs.DeeplineClient)();
|
|
926
926
|
const payload = await client.billing.subscription.status();
|
|
927
927
|
const pools = _nullishCoalesce(payload.credit_pools, () => ( []));
|
|
928
928
|
const lines = [
|
|
@@ -942,7 +942,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
942
942
|
],
|
|
943
943
|
`Assigned by: ${_nullishCoalesce(payload.assigned_by, () => ( "default"))}`
|
|
944
944
|
];
|
|
945
|
-
|
|
945
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
946
946
|
{
|
|
947
947
|
...payload,
|
|
948
948
|
render: { sections: [{ title: "billing subscription", lines }] }
|
|
@@ -951,7 +951,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
951
951
|
);
|
|
952
952
|
}
|
|
953
953
|
async function handleSubscriptionCancel(options) {
|
|
954
|
-
const client = new (0,
|
|
954
|
+
const client = new (0, _chunkHGER4CJAjs.DeeplineClient)();
|
|
955
955
|
const action = options.undo ? "undo_cancel" : "cancel";
|
|
956
956
|
if (options.dryRun) {
|
|
957
957
|
const status = await client.billing.subscription.status();
|
|
@@ -968,7 +968,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
968
968
|
return;
|
|
969
969
|
}
|
|
970
970
|
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.";
|
|
971
|
-
|
|
971
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
972
972
|
{
|
|
973
973
|
ok: true,
|
|
974
974
|
dry_run: true,
|
|
@@ -1024,7 +1024,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
1024
1024
|
"Remaining credits are yours to keep \u2014 cancellation never removes credits.",
|
|
1025
1025
|
"Undo with: deepline billing subscription cancel --undo"
|
|
1026
1026
|
];
|
|
1027
|
-
|
|
1027
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1028
1028
|
{
|
|
1029
1029
|
ok: true,
|
|
1030
1030
|
...result,
|
|
@@ -1078,7 +1078,7 @@ async function handleInvoices(options) {
|
|
|
1078
1078
|
return;
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
|
-
const client = new (0,
|
|
1081
|
+
const client = new (0, _chunkHGER4CJAjs.DeeplineClient)();
|
|
1082
1082
|
let payload;
|
|
1083
1083
|
try {
|
|
1084
1084
|
payload = await client.billing.invoices.list(
|
|
@@ -1107,7 +1107,7 @@ async function handleInvoices(options) {
|
|
|
1107
1107
|
url: entry.url
|
|
1108
1108
|
}))
|
|
1109
1109
|
} : { ...payload, count: entries.length };
|
|
1110
|
-
|
|
1110
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1111
1111
|
{
|
|
1112
1112
|
...envelope,
|
|
1113
1113
|
render: { sections: [{ title: "billing invoices", lines }] }
|
|
@@ -1116,7 +1116,7 @@ async function handleInvoices(options) {
|
|
|
1116
1116
|
);
|
|
1117
1117
|
}
|
|
1118
1118
|
async function handleCheckout(options) {
|
|
1119
|
-
const { http } =
|
|
1119
|
+
const { http } = _chunk6N3NTEJ6js.getAuthedHttpClient.call(void 0, );
|
|
1120
1120
|
const payload = await http.post(
|
|
1121
1121
|
"/api/v2/billing/checkout",
|
|
1122
1122
|
{
|
|
@@ -1126,8 +1126,8 @@ async function handleCheckout(options) {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
);
|
|
1128
1128
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1129
|
-
if (!options.json && !options.noOpen && url)
|
|
1130
|
-
|
|
1129
|
+
if (!options.json && !options.noOpen && url) _chunk6N3NTEJ6js.openInBrowser.call(void 0, url);
|
|
1130
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1131
1131
|
{
|
|
1132
1132
|
...payload,
|
|
1133
1133
|
render: {
|
|
@@ -1172,7 +1172,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1172
1172
|
return;
|
|
1173
1173
|
}
|
|
1174
1174
|
if (options.dryRun) {
|
|
1175
|
-
|
|
1175
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1176
1176
|
{
|
|
1177
1177
|
ok: true,
|
|
1178
1178
|
dry_run: true,
|
|
@@ -1202,7 +1202,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1202
1202
|
);
|
|
1203
1203
|
return;
|
|
1204
1204
|
}
|
|
1205
|
-
const client = new (0,
|
|
1205
|
+
const client = new (0, _chunkHGER4CJAjs.DeeplineClient)();
|
|
1206
1206
|
let payload;
|
|
1207
1207
|
try {
|
|
1208
1208
|
payload = await client.billing.topUpWithReceipt({
|
|
@@ -1219,7 +1219,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1219
1219
|
return;
|
|
1220
1220
|
}
|
|
1221
1221
|
if (payload.status === "pending") {
|
|
1222
|
-
|
|
1222
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1223
1223
|
{
|
|
1224
1224
|
ok: true,
|
|
1225
1225
|
...payload,
|
|
@@ -1283,17 +1283,17 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1283
1283
|
]
|
|
1284
1284
|
}
|
|
1285
1285
|
};
|
|
1286
|
-
|
|
1286
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0, options.compact ? compactEnvelope : fullEnvelope, {
|
|
1287
1287
|
json: options.json
|
|
1288
1288
|
});
|
|
1289
1289
|
}
|
|
1290
1290
|
async function handleTargetStatus(options) {
|
|
1291
|
-
const client = new (0,
|
|
1291
|
+
const client = new (0, _chunkHGER4CJAjs.DeeplineClient)();
|
|
1292
1292
|
const payload = await client.billing.targetStatus();
|
|
1293
1293
|
const balanceCommand = "deepline billing balance";
|
|
1294
1294
|
const recentChargesCommand = "deepline billing usage --limit 5";
|
|
1295
1295
|
const exactChargeCommand = "deepline billing usage --request-id <job_id>";
|
|
1296
|
-
|
|
1296
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1297
1297
|
{
|
|
1298
1298
|
ok: true,
|
|
1299
1299
|
...payload,
|
|
@@ -1331,13 +1331,13 @@ function formatComputeAmount(minutes, credits) {
|
|
|
1331
1331
|
return `${time} ${minutes === 1 ? "minute" : "minutes"} (${cost} ${credits === 1 ? "credit" : "credits"})`;
|
|
1332
1332
|
}
|
|
1333
1333
|
async function handleIncludedCompute(options) {
|
|
1334
|
-
const client = new (0,
|
|
1334
|
+
const client = new (0, _chunkHGER4CJAjs.DeeplineClient)();
|
|
1335
1335
|
const payload = options.enable ? await client.billing.enableIncludedCompute({ includeOverage: true }) : await client.billing.includedCompute({ includeOverage: true });
|
|
1336
1336
|
const rate = _nullishCoalesce(payload.credits_per_minute, () => ( 0));
|
|
1337
1337
|
const includedCredits = _nullishCoalesce(payload.included_credits_used, () => ( payload.included_minutes_used * rate));
|
|
1338
1338
|
const includedMinutes = payload.included_credits_used !== void 0 && rate > 0 ? includedCredits / rate : payload.included_minutes_used;
|
|
1339
1339
|
const overage = payload.overage_credits;
|
|
1340
|
-
|
|
1340
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1341
1341
|
{
|
|
1342
1342
|
ok: true,
|
|
1343
1343
|
...payload,
|
|
@@ -1376,8 +1376,8 @@ async function handleIncludedCompute(options) {
|
|
|
1376
1376
|
);
|
|
1377
1377
|
}
|
|
1378
1378
|
async function handleEntitlements(options) {
|
|
1379
|
-
const payload = await new (0,
|
|
1380
|
-
|
|
1379
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.entitlements();
|
|
1380
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1381
1381
|
{
|
|
1382
1382
|
ok: true,
|
|
1383
1383
|
...payload,
|
|
@@ -1387,7 +1387,7 @@ async function handleEntitlements(options) {
|
|
|
1387
1387
|
title: "billing entitlements",
|
|
1388
1388
|
lines: [
|
|
1389
1389
|
`Plan: ${_nullishCoalesce(_optionalChain([payload, 'access', _23 => _23.plan, 'optionalAccess', _24 => _24.name]), () => ( "Legacy billing"))}`,
|
|
1390
|
-
...
|
|
1390
|
+
..._chunkNAGGCF6Yjs.concurrentRunsLine.call(void 0, payload) ? [`Concurrent runs: ${_chunkNAGGCF6Yjs.concurrentRunsLine.call(void 0, payload)}`] : [],
|
|
1391
1391
|
...Object.entries(payload.benefits).flatMap(
|
|
1392
1392
|
([key, grant]) => "value" in grant ? [
|
|
1393
1393
|
`${key}: ${grant.status}, ${JSON.stringify(grant.value)}${grant.expiresAt === void 0 ? "" : `, expires ${new Date(grant.expiresAt).toISOString()}`}`
|
|
@@ -1412,7 +1412,7 @@ async function handleEntitlements(options) {
|
|
|
1412
1412
|
);
|
|
1413
1413
|
}
|
|
1414
1414
|
async function handleAutoRechargeStatus(options) {
|
|
1415
|
-
const payload = await new (0,
|
|
1415
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.autoRecharge.get();
|
|
1416
1416
|
const state = payload.available ? payload.enabled ? "on" : "off" : "unavailable";
|
|
1417
1417
|
const lines = [
|
|
1418
1418
|
`State: ${state}`,
|
|
@@ -1422,7 +1422,7 @@ async function handleAutoRechargeStatus(options) {
|
|
|
1422
1422
|
`Automatic credit purchase cap: ${payload.purchase_limit_credits} credits per rolling 30 days`
|
|
1423
1423
|
] : []
|
|
1424
1424
|
];
|
|
1425
|
-
|
|
1425
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1426
1426
|
{
|
|
1427
1427
|
ok: true,
|
|
1428
1428
|
...payload,
|
|
@@ -1471,7 +1471,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1473
1473
|
if (options.dryRun) {
|
|
1474
|
-
|
|
1474
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1475
1475
|
{
|
|
1476
1476
|
ok: true,
|
|
1477
1477
|
dry_run: true,
|
|
@@ -1492,7 +1492,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1492
1492
|
);
|
|
1493
1493
|
return;
|
|
1494
1494
|
}
|
|
1495
|
-
const payload = await new (0,
|
|
1495
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1496
1496
|
enabled: true,
|
|
1497
1497
|
thresholdCredits,
|
|
1498
1498
|
refillToCredits,
|
|
@@ -1500,7 +1500,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1500
1500
|
...rollingLimitCredits !== void 0 ? { purchaseLimitCredits: rollingLimitCredits } : {},
|
|
1501
1501
|
idempotencyKey
|
|
1502
1502
|
});
|
|
1503
|
-
|
|
1503
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1504
1504
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1505
1505
|
{ json: options.json }
|
|
1506
1506
|
);
|
|
@@ -1508,7 +1508,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1508
1508
|
async function handleAutoRechargeOff(options) {
|
|
1509
1509
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1510
1510
|
if (options.dryRun) {
|
|
1511
|
-
|
|
1511
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1512
1512
|
{
|
|
1513
1513
|
ok: true,
|
|
1514
1514
|
dry_run: true,
|
|
@@ -1523,11 +1523,11 @@ async function handleAutoRechargeOff(options) {
|
|
|
1523
1523
|
);
|
|
1524
1524
|
return;
|
|
1525
1525
|
}
|
|
1526
|
-
const payload = await new (0,
|
|
1526
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1527
1527
|
enabled: false,
|
|
1528
1528
|
idempotencyKey
|
|
1529
1529
|
});
|
|
1530
|
-
|
|
1530
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1531
1531
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1532
1532
|
{ json: options.json }
|
|
1533
1533
|
);
|
|
@@ -1553,18 +1553,18 @@ function savedCardLines(cards, hasMore) {
|
|
|
1553
1553
|
async function handleCardsList(options) {
|
|
1554
1554
|
const limit = options.limit === void 0 ? void 0 : Number(options.limit);
|
|
1555
1555
|
if (limit !== void 0 && (!Number.isInteger(limit) || limit < 1 || limit > 100)) {
|
|
1556
|
-
|
|
1556
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1557
1557
|
{ ok: false, error: "--limit must be a whole number from 1 to 100." },
|
|
1558
1558
|
{ json: options.json }
|
|
1559
1559
|
);
|
|
1560
1560
|
process.exitCode = 1;
|
|
1561
1561
|
return;
|
|
1562
1562
|
}
|
|
1563
|
-
const payload = await new (0,
|
|
1563
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.cards.list({
|
|
1564
1564
|
...limit !== void 0 ? { limit } : {},
|
|
1565
1565
|
...options.cursor ? { cursor: options.cursor } : {}
|
|
1566
1566
|
});
|
|
1567
|
-
|
|
1567
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1568
1568
|
{
|
|
1569
1569
|
ok: true,
|
|
1570
1570
|
...payload,
|
|
@@ -1582,8 +1582,8 @@ async function handleCardsList(options) {
|
|
|
1582
1582
|
}
|
|
1583
1583
|
async function handleCardsAdd(options) {
|
|
1584
1584
|
const makeDefault = options.makeDefault === true;
|
|
1585
|
-
const payload = await new (0,
|
|
1586
|
-
|
|
1585
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.cards.add({ makeDefault });
|
|
1586
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1587
1587
|
{
|
|
1588
1588
|
ok: true,
|
|
1589
1589
|
make_default: makeDefault,
|
|
@@ -1608,7 +1608,7 @@ async function handleCardChange(action, cardId, options) {
|
|
|
1608
1608
|
const changeId = _nullishCoalesce(options.changeId, () => ( _crypto.randomUUID.call(void 0, )));
|
|
1609
1609
|
const path = `/api/v2/billing/payment-methods/${action}`;
|
|
1610
1610
|
if (options.dryRun) {
|
|
1611
|
-
|
|
1611
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1612
1612
|
{
|
|
1613
1613
|
ok: true,
|
|
1614
1614
|
dry_run: true,
|
|
@@ -1623,9 +1623,9 @@ async function handleCardChange(action, cardId, options) {
|
|
|
1623
1623
|
);
|
|
1624
1624
|
return;
|
|
1625
1625
|
}
|
|
1626
|
-
const cards = new (0,
|
|
1626
|
+
const cards = new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.cards;
|
|
1627
1627
|
const payload = action === "default" ? await cards.setDefault({ cardId, changeId }) : await cards.remove({ cardId, changeId });
|
|
1628
|
-
|
|
1628
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1629
1629
|
{
|
|
1630
1630
|
...payload,
|
|
1631
1631
|
render: {
|
|
@@ -1659,11 +1659,11 @@ async function handleBuyCredits(creditsRaw, options) {
|
|
|
1659
1659
|
return;
|
|
1660
1660
|
}
|
|
1661
1661
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1662
|
-
const payload = await new (0,
|
|
1662
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.purchaseCredits({
|
|
1663
1663
|
credits,
|
|
1664
1664
|
idempotencyKey
|
|
1665
1665
|
});
|
|
1666
|
-
|
|
1666
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1667
1667
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1668
1668
|
{ json: options.json }
|
|
1669
1669
|
);
|
|
@@ -1699,7 +1699,7 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1699
1699
|
return;
|
|
1700
1700
|
}
|
|
1701
1701
|
if (options.dryRun) {
|
|
1702
|
-
|
|
1702
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1703
1703
|
{
|
|
1704
1704
|
ok: true,
|
|
1705
1705
|
dry_run: true,
|
|
@@ -1712,12 +1712,12 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1712
1712
|
);
|
|
1713
1713
|
return;
|
|
1714
1714
|
}
|
|
1715
|
-
const payload = await new (0,
|
|
1715
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.recoverCreditPurchase({
|
|
1716
1716
|
credits,
|
|
1717
1717
|
orgId: options.orgId,
|
|
1718
1718
|
idempotencyKey: options.idempotencyKey
|
|
1719
1719
|
});
|
|
1720
|
-
|
|
1720
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1721
1721
|
{ ok: true, idempotency_key: options.idempotencyKey, ...payload },
|
|
1722
1722
|
{ json: options.json }
|
|
1723
1723
|
);
|
|
@@ -1734,7 +1734,7 @@ async function handleTargetPlan(planSku, options) {
|
|
|
1734
1734
|
);
|
|
1735
1735
|
return;
|
|
1736
1736
|
}
|
|
1737
|
-
const targetPlanSku = _nullishCoalesce([...
|
|
1737
|
+
const targetPlanSku = _nullishCoalesce([..._chunkXD4MT4BHjs.PUBLIC_PLAN_SKUS, ...COMPATIBLE_PLAN_SKUS].find(
|
|
1738
1738
|
(sku) => sku === planSku
|
|
1739
1739
|
), () => ( // Retained Canary requests may replay their original operation. The API
|
|
1740
1740
|
// rejects new acquisition even when a caller supplies an idempotency key.
|
|
@@ -1744,14 +1744,14 @@ async function handleTargetPlan(planSku, options) {
|
|
|
1744
1744
|
{
|
|
1745
1745
|
exitCode: 2,
|
|
1746
1746
|
code: "INVALID_PLAN",
|
|
1747
|
-
message: `Plan must be one of ${
|
|
1747
|
+
message: `Plan must be one of ${_chunkXD4MT4BHjs.PUBLIC_PLAN_SKUS.join(", ")}. Run deepline billing plans to see workspace availability.`
|
|
1748
1748
|
},
|
|
1749
1749
|
options
|
|
1750
1750
|
);
|
|
1751
1751
|
return;
|
|
1752
1752
|
}
|
|
1753
1753
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1754
|
-
const payload = await new (0,
|
|
1754
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.transitionPlan({
|
|
1755
1755
|
action: "start_or_change",
|
|
1756
1756
|
targetPlanSku,
|
|
1757
1757
|
...options.billingEmail ? { billingEmail: options.billingEmail } : {},
|
|
@@ -1760,14 +1760,14 @@ async function handleTargetPlan(planSku, options) {
|
|
|
1760
1760
|
...options.invoice ? { paymentMethod: "invoice" } : {},
|
|
1761
1761
|
idempotencyKey
|
|
1762
1762
|
});
|
|
1763
|
-
|
|
1763
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1764
1764
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1765
1765
|
{ json: options.json }
|
|
1766
1766
|
);
|
|
1767
1767
|
}
|
|
1768
1768
|
async function handleBillingDetailsShow(options) {
|
|
1769
|
-
const payload = await new (0,
|
|
1770
|
-
|
|
1769
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.getDetails();
|
|
1770
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1771
1771
|
}
|
|
1772
1772
|
async function handleBillingDetailsSet(options) {
|
|
1773
1773
|
const separator = _nullishCoalesce(_optionalChain([options, 'access', _28 => _28.taxId, 'optionalAccess', _29 => _29.indexOf, 'call', _30 => _30(":")]), () => ( -1));
|
|
@@ -1784,7 +1784,7 @@ async function handleBillingDetailsSet(options) {
|
|
|
1784
1784
|
);
|
|
1785
1785
|
return;
|
|
1786
1786
|
}
|
|
1787
|
-
const payload = await new (0,
|
|
1787
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.setDetails({
|
|
1788
1788
|
...options.name !== void 0 ? { name: options.name } : {},
|
|
1789
1789
|
...options.line1 !== void 0 ? {
|
|
1790
1790
|
address: {
|
|
@@ -1803,28 +1803,28 @@ async function handleBillingDetailsSet(options) {
|
|
|
1803
1803
|
}
|
|
1804
1804
|
} : {}
|
|
1805
1805
|
});
|
|
1806
|
-
|
|
1806
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1807
1807
|
}
|
|
1808
1808
|
async function handleTargetPlanCancellation(options) {
|
|
1809
1809
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1810
|
-
const payload = await new (0,
|
|
1810
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.transitionPlan({
|
|
1811
1811
|
action: options.undo ? "undo_cancel" : "cancel",
|
|
1812
1812
|
idempotencyKey
|
|
1813
1813
|
});
|
|
1814
|
-
|
|
1814
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1815
1815
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1816
1816
|
{ json: options.json }
|
|
1817
1817
|
);
|
|
1818
1818
|
}
|
|
1819
1819
|
async function handleTargetPortal(options) {
|
|
1820
|
-
const payload = await new (0,
|
|
1820
|
+
const payload = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.portalSession(
|
|
1821
1821
|
options.billingAddress ? { flow: "customer_update" } : void 0
|
|
1822
1822
|
);
|
|
1823
|
-
if (!options.json && !options.noOpen)
|
|
1824
|
-
|
|
1823
|
+
if (!options.json && !options.noOpen) _chunk6N3NTEJ6js.openInBrowser.call(void 0, payload.url);
|
|
1824
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1825
1825
|
}
|
|
1826
1826
|
async function handleRedeemCode(code, options) {
|
|
1827
|
-
const { http } =
|
|
1827
|
+
const { http } = _chunk6N3NTEJ6js.getAuthedHttpClient.call(void 0, );
|
|
1828
1828
|
const payload = await http.post(
|
|
1829
1829
|
"/api/v2/billing/checkout",
|
|
1830
1830
|
{
|
|
@@ -1832,8 +1832,8 @@ async function handleRedeemCode(code, options) {
|
|
|
1832
1832
|
}
|
|
1833
1833
|
);
|
|
1834
1834
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1835
|
-
if (!options.json && !options.noOpen && url)
|
|
1836
|
-
|
|
1835
|
+
if (!options.json && !options.noOpen && url) _chunk6N3NTEJ6js.openInBrowser.call(void 0, url);
|
|
1836
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1837
1837
|
{
|
|
1838
1838
|
...payload,
|
|
1839
1839
|
render: {
|
|
@@ -1894,14 +1894,14 @@ Examples:
|
|
|
1894
1894
|
if (!Number.isSafeInteger(quantity) || quantity <= 0) {
|
|
1895
1895
|
throw new Error("--quantity must be a positive safe integer.");
|
|
1896
1896
|
}
|
|
1897
|
-
const quote = await new (0,
|
|
1897
|
+
const quote = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.quote({
|
|
1898
1898
|
quantity,
|
|
1899
1899
|
sandbox_runtime: {
|
|
1900
1900
|
timeout: options.sandboxTimeout,
|
|
1901
1901
|
size: options.sandboxSize
|
|
1902
1902
|
}
|
|
1903
1903
|
});
|
|
1904
|
-
|
|
1904
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0, quote, {
|
|
1905
1905
|
json: options.json,
|
|
1906
1906
|
text: `Sandbox session ceiling: ${quote.maximum_credits} Deepline credits (${quote.quantity} session${quote.quantity === 1 ? "" : "s"}).
|
|
1907
1907
|
${quote.explanation}
|
|
@@ -1930,9 +1930,9 @@ Examples:
|
|
|
1930
1930
|
billing.command("reuse").description(
|
|
1931
1931
|
"Show recorded reused tool results for this org; no credit estimate."
|
|
1932
1932
|
).option("--json", "Return the org reuse summary as JSON").action(async (options) => {
|
|
1933
|
-
const { http } =
|
|
1933
|
+
const { http } = _chunk6N3NTEJ6js.getAuthedHttpClient.call(void 0, );
|
|
1934
1934
|
const payload = await http.get("/api/v2/usage/reuse");
|
|
1935
|
-
|
|
1935
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0,
|
|
1936
1936
|
{
|
|
1937
1937
|
status: "ok",
|
|
1938
1938
|
data: payload,
|
|
@@ -2173,8 +2173,8 @@ Examples:
|
|
|
2173
2173
|
new (0, _commander.Command)("trigger").description(
|
|
2174
2174
|
"Evaluate capped automatic recharge and resume any pending purchase."
|
|
2175
2175
|
).option("--json", "Emit JSON output").action(async (options) => {
|
|
2176
|
-
const result = await new (0,
|
|
2177
|
-
|
|
2176
|
+
const result = await new (0, _chunkHGER4CJAjs.DeeplineClient)().billing.autoRecharge.trigger();
|
|
2177
|
+
_chunk6N3NTEJ6js.printCommandEnvelope.call(void 0, { ok: true, ...result }, { json: options.json });
|
|
2178
2178
|
})
|
|
2179
2179
|
);
|
|
2180
2180
|
billing.command("cards").description("List, add, choose the default of, and remove saved cards.").addHelpText(
|
|
@@ -2208,7 +2208,7 @@ Examples:
|
|
|
2208
2208
|
);
|
|
2209
2209
|
billing.command("change-plan").description("Start or change the target billing plan.").argument(
|
|
2210
2210
|
"<plan_sku>",
|
|
2211
|
-
`${
|
|
2211
|
+
`${_chunkXD4MT4BHjs.PUBLIC_PLAN_SKUS.join(", ")}. Run deepline billing plans to see workspace availability.`
|
|
2212
2212
|
).option(
|
|
2213
2213
|
"--billing-email <email>",
|
|
2214
2214
|
"Invoice recipient: required with --invoice, otherwise used when the account has no billing email"
|