deepline 0.3.393 → 0.3.394
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/context.ts +477 -10
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +5 -1
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-policy.ts +28 -0
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +251 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +12 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +25 -16
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +1 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +69 -22
- package/dist/bundling-sources/shared_libs/plays/core.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +18 -0
- package/dist/cli/auth-IHKISLJQ.js +39 -0
- package/dist/cli/{auth-5PXHA232.mjs → auth-OSXDAVCF.mjs} +4 -4
- package/dist/cli/{billing-JFB2XLSO.js → billing-EKLYOXUY.js} +75 -75
- package/dist/cli/{billing-Z2N7ZAGM.mjs → billing-ZNNKX3UR.mjs} +4 -4
- package/dist/cli/{chunk-OXNOAD6Y.js → chunk-2MDDA7A4.js} +26 -26
- package/dist/cli/{chunk-PTDECJGP.js → chunk-354JCXA2.js} +50 -50
- package/dist/cli/{chunk-RKMB3N7K.mjs → chunk-3HU47EGZ.mjs} +48 -9
- package/dist/cli/{chunk-6I73X254.mjs → chunk-3HWALOL2.mjs} +1 -1
- package/dist/cli/{chunk-VIQJIX2P.js → chunk-4P27AXEA.js} +65 -65
- package/dist/cli/{chunk-UOGZUA24.mjs → chunk-5BB2RGAX.mjs} +18 -8
- package/dist/cli/{chunk-RWHWF5ZJ.js → chunk-6YAUMG27.js} +1 -1
- package/dist/cli/{chunk-HLEESTCH.mjs → chunk-BP33SIZF.mjs} +1 -1
- package/dist/cli/{chunk-CDFH2DYL.js → chunk-CS6RAIVY.js} +4 -4
- package/dist/cli/{chunk-2HAD745V.js → chunk-E23BQ5SC.js} +9 -9
- package/dist/cli/{chunk-LMMEAMA7.mjs → chunk-FJGW5GXU.mjs} +1 -1
- package/dist/cli/{chunk-Q26LUSQ2.mjs → chunk-JHIJIHFB.mjs} +1 -1
- package/dist/cli/{chunk-PWSWAN7Q.js → chunk-KB4SDX5S.js} +48 -9
- package/dist/cli/{chunk-M7Y7JYZX.js → chunk-KGNTKMRG.js} +6 -6
- package/dist/cli/{chunk-4XX6443T.js → chunk-KI635JN4.js} +59 -59
- package/dist/cli/{chunk-Z3OOZM5L.js → chunk-KIUMEOM5.js} +8 -8
- package/dist/cli/{chunk-KIYU2TGL.mjs → chunk-M57J2SK4.mjs} +2 -2
- package/dist/cli/{chunk-FQ6VHPW4.mjs → chunk-MFB2VKBO.mjs} +2 -2
- package/dist/cli/{chunk-MS6GUPBB.js → chunk-MH73HMPV.js} +3 -3
- package/dist/cli/{chunk-AARX5L4B.js → chunk-MLPU5SMZ.js} +2 -2
- package/dist/cli/{chunk-5PRVMXKB.mjs → chunk-NR3DFKNF.mjs} +1 -1
- package/dist/cli/{chunk-W4WOMXR3.js → chunk-QIQBYKLB.js} +15 -15
- package/dist/cli/{chunk-VIWE6WRK.js → chunk-RBJYWRCF.js} +260 -250
- package/dist/cli/{chunk-LZPCDB7U.mjs → chunk-TJI2EN6K.mjs} +1 -1
- package/dist/cli/{chunk-4TCT77UF.js → chunk-URWF7NGQ.js} +6 -1
- package/dist/cli/{chunk-5KWKZIQR.mjs → chunk-UXFSWG3Q.mjs} +4 -4
- package/dist/cli/{chunk-L2SYLGRP.js → chunk-VK6FYZLP.js} +8 -8
- package/dist/cli/{chunk-7HR7BGZL.mjs → chunk-X63FDZJZ.mjs} +3 -3
- package/dist/cli/{chunk-4PT2VA3A.mjs → chunk-XRQ2AQL7.mjs} +2 -2
- package/dist/cli/{chunk-STNYIMIV.mjs → chunk-XXUDVEXK.mjs} +6 -6
- package/dist/cli/{chunk-PQSA443V.mjs → chunk-ZI2ZNDJK.mjs} +6 -1
- package/dist/cli/{chunk-2LGC4EFT.mjs → chunk-ZYBGA4AR.mjs} +3 -3
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-KJWZHKCH.mjs → csv-5AXRB35H.mjs} +3 -3
- package/dist/cli/{csv-P3Z3YE7H.js → csv-LU7O75WE.js} +12 -12
- package/dist/cli/{db-NCM4CQIS.mjs → db-7XP5UWEW.mjs} +4 -4
- package/dist/cli/{db-NUZGJNQC.js → db-F7YTFKVM.js} +29 -29
- package/dist/cli/{describe-YGSEN5WC.js → describe-FRH32RDV.js} +20 -20
- package/dist/cli/{describe-WT6MM2GO.mjs → describe-K4ES5LIL.mjs} +10 -10
- package/dist/cli/{executions-XS2IPJ4W.mjs → executions-IEHEHJUO.mjs} +4 -4
- package/dist/cli/{executions-PCOLHN7Q.js → executions-RZV5XPT2.js} +6 -6
- package/dist/cli/{feedback-4MSH7TFU.js → feedback-3P65QTX3.js} +7 -7
- package/dist/cli/{feedback-CCLTS5SV.mjs → feedback-FPUVZBAN.mjs} +3 -3
- package/dist/cli/{git-K2DHPMPC.mjs → git-GLVVP7TY.mjs} +4 -4
- package/dist/cli/git-MFFAWVVX.js +23 -0
- package/dist/cli/index.js +95 -95
- package/dist/cli/index.mjs +33 -33
- package/dist/cli/{legacy-noops-B5S4AR3P.mjs → legacy-noops-3MOI6NBM.mjs} +4 -4
- package/dist/cli/{legacy-noops-GPNOPFXV.js → legacy-noops-XKSGZR7Q.js} +7 -7
- package/dist/cli/{monitors-JLMAIPRG.mjs → monitors-FTBGNEFG.mjs} +4 -4
- package/dist/cli/{monitors-ZAWD7NSN.js → monitors-NZ2DYNST.js} +85 -85
- package/dist/cli/{org-P2KN4CES.js → org-MCKDQXIV.js} +64 -64
- package/dist/cli/{org-T3JTHP4G.mjs → org-V2J5RBCN.mjs} +4 -4
- package/dist/cli/{play-NK6BLRGL.mjs → play-AJFGME3B.mjs} +9 -9
- package/dist/cli/play-WLSN2EO2.js +158 -0
- package/dist/cli/{providers-5QRZN3DT.js → providers-2JEZ2264.js} +7 -7
- package/dist/cli/{providers-3NQRA7IT.mjs → providers-I6RQJZFZ.mjs} +4 -4
- package/dist/cli/{quickstart-PIA2JGPV.mjs → quickstart-BIDQDMO4.mjs} +3 -3
- package/dist/cli/{quickstart-R7NUZGNW.js → quickstart-GJ2RPDU3.js} +5 -5
- package/dist/cli/search-5VN4YD4I.js +27 -0
- package/dist/cli/{search-AIDIIGLY.mjs → search-ELRXFWG5.mjs} +5 -5
- package/dist/cli/{secrets-BT3PGMWN.js → secrets-53IT6VXD.js} +13 -13
- package/dist/cli/{secrets-OQNHL45O.mjs → secrets-SQXGZXIC.mjs} +4 -4
- package/dist/cli/{sessions-SF7WJPJP.mjs → sessions-2X5QF7SL.mjs} +4 -4
- package/dist/cli/{sessions-EYXWOSWK.js → sessions-CAV5M77Y.js} +5 -5
- package/dist/cli/{settings-BA3GHBOD.js → settings-532WNAZO.js} +74 -74
- package/dist/cli/{settings-Y57JTFDD.mjs → settings-7P67VGCJ.mjs} +7 -7
- package/dist/cli/{setup-RERXYC66.js → setup-6L2VSUWJ.js} +41 -41
- package/dist/cli/{setup-7GR5GBHA.mjs → setup-QGGBV2LE.mjs} +6 -6
- package/dist/cli/{skills-SJWIQAV5.mjs → skills-3FE62WBG.mjs} +4 -4
- package/dist/cli/skills-S6NPZAN7.js +28 -0
- package/dist/cli/tools-647RLXQS.js +41 -0
- package/dist/cli/{tools-ZF3JXPNL.mjs → tools-DMR25DEF.mjs} +7 -7
- package/dist/cli/{update-FFFYQAOJ.mjs → update-6RZMHJZP.mjs} +6 -6
- package/dist/cli/update-WVTSC3EM.js +28 -0
- package/dist/cli/{workflow-XVFEEGAS.mjs → workflow-L2DQRE6R.mjs} +5 -5
- package/dist/cli/{workflow-SZJVQH4T.js → workflow-TX4F2PIX.js} +15 -15
- package/dist/{client-DU5dtHDy.d.mts → client-BktIPdIj.d.mts} +1 -1
- package/dist/{client-mCE88hC4.d.ts → client-C3O1Ipf3.d.ts} +1 -1
- package/dist/{compiler-manifest-DE4RdAiY.d.ts → compiler-manifest-DLxUY5kI.d.mts} +65 -11
- package/dist/{compiler-manifest-DE4RdAiY.d.mts → compiler-manifest-DLxUY5kI.d.ts} +65 -11
- package/dist/{index-Bi-f7HFT.d.ts → index-B_GM9E3q.d.ts} +1 -1
- package/dist/{index-BI6nWgaV.d.mts → index-SCb0NvDb.d.mts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +7 -7
- package/dist/index.mjs +4 -4
- package/dist/install-integrity.json +85 -84
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-P3MVDTXM.js +0 -39
- package/dist/cli/git-RNM45FX4.js +0 -23
- package/dist/cli/play-PDXR6JFB.js +0 -158
- package/dist/cli/search-QRWL7MFM.js +0 -27
- package/dist/cli/skills-V7EY75HB.js +0 -28
- package/dist/cli/tools-H5HLBCHH.js +0 -41
- package/dist/cli/update-472HA3LT.js +0 -28
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkE23BQ5SCjs = require('./chunk-E23BQ5SC.js');
|
|
6
6
|
require('./chunk-S6R3OX7B.js');
|
|
7
7
|
require('./chunk-UHNDVD3P.js');
|
|
8
8
|
require('./chunk-XDVT3GOM.js');
|
|
@@ -12,16 +12,16 @@ require('./chunk-XDVT3GOM.js');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkKGNTKMRGjs = require('./chunk-KGNTKMRG.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkCS6RAIVYjs = require('./chunk-CS6RAIVY.js');
|
|
20
20
|
require('./chunk-XNYIZMNQ.js');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
24
|
-
require('./chunk-
|
|
24
|
+
require('./chunk-6YAUMG27.js');
|
|
25
25
|
require('./chunk-OG64RBAC.js');
|
|
26
26
|
require('./chunk-COGTRVWW.js');
|
|
27
27
|
|
|
@@ -36,7 +36,7 @@ var SUBSCRIPTION_CANCEL_PATH = "/api/v2/billing/subscription/cancel";
|
|
|
36
36
|
var BILLING_TOP_UP_PATH = "/api/v2/billing/top-up";
|
|
37
37
|
var DEFAULT_BALANCE_RECOVERY_CREDITS = 100;
|
|
38
38
|
function billingFailureFromError(error, options) {
|
|
39
|
-
if (error instanceof
|
|
39
|
+
if (error instanceof _chunkCS6RAIVYjs.AuthError) {
|
|
40
40
|
return {
|
|
41
41
|
exitCode: 3,
|
|
42
42
|
code: "AUTH_ERROR",
|
|
@@ -70,7 +70,7 @@ function reportBillingFailure(failure, options) {
|
|
|
70
70
|
if (failure.next) {
|
|
71
71
|
textLines.push(`Next: ${failure.next}`);
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
74
74
|
{
|
|
75
75
|
ok: false,
|
|
76
76
|
exitCode: failure.exitCode,
|
|
@@ -91,7 +91,7 @@ function parseTopUpCredits(raw) {
|
|
|
91
91
|
return parsed;
|
|
92
92
|
}
|
|
93
93
|
function topUpIdempotencyKey(raw) {
|
|
94
|
-
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` :
|
|
94
|
+
return raw === void 0 ? `cli_topup:${Date.now()}:${_crypto.randomUUID.call(void 0, )}` : _chunkE23BQ5SCjs.requireBillingIdempotencyKey.call(void 0, raw);
|
|
95
95
|
}
|
|
96
96
|
function targetBillingIdempotencyKey(raw) {
|
|
97
97
|
return typeof raw === "string" ? raw : `cli_target_billing:${Date.now()}:${_crypto.randomUUID.call(void 0, )}`;
|
|
@@ -128,7 +128,7 @@ function apiErrorCode(error) {
|
|
|
128
128
|
return _nullishCoalesce(error.code, () => ( "BILLING_API_ERROR"));
|
|
129
129
|
}
|
|
130
130
|
function billingTopUpFailureFromError(error, input) {
|
|
131
|
-
if (error instanceof
|
|
131
|
+
if (error instanceof _chunkCS6RAIVYjs.AuthError || error instanceof _chunkCS6RAIVYjs.ConfigError) {
|
|
132
132
|
return {
|
|
133
133
|
exitCode: 3,
|
|
134
134
|
code: "AUTH_ERROR",
|
|
@@ -297,7 +297,7 @@ function defaultLedgerExportPath() {
|
|
|
297
297
|
);
|
|
298
298
|
}
|
|
299
299
|
async function handleBalance(options) {
|
|
300
|
-
const { http } =
|
|
300
|
+
const { http } = _chunkKGNTKMRGjs.getAuthedHttpClient.call(void 0, );
|
|
301
301
|
const payload = await http.get(
|
|
302
302
|
"/api/v2/billing/balance"
|
|
303
303
|
);
|
|
@@ -365,7 +365,7 @@ async function handleBalance(options) {
|
|
|
365
365
|
...options.verbose ? detail : [],
|
|
366
366
|
...lines.slice(1)
|
|
367
367
|
];
|
|
368
|
-
|
|
368
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
369
369
|
{
|
|
370
370
|
...payload,
|
|
371
371
|
...recovery ? { recovery } : {},
|
|
@@ -389,7 +389,7 @@ function quoteShellArgument(value) {
|
|
|
389
389
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
390
390
|
}
|
|
391
391
|
async function handleUsage(options) {
|
|
392
|
-
const { http } =
|
|
392
|
+
const { http } = _chunkKGNTKMRGjs.getAuthedHttpClient.call(void 0, );
|
|
393
393
|
const params = new URLSearchParams();
|
|
394
394
|
if (options.requestId !== void 0) {
|
|
395
395
|
const requestId = options.requestId.trim();
|
|
@@ -470,7 +470,7 @@ async function handleUsage(options) {
|
|
|
470
470
|
"No continuation is available for this view. Use deepline billing ledger export all for the full ledger."
|
|
471
471
|
] : []
|
|
472
472
|
];
|
|
473
|
-
|
|
473
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
474
474
|
{
|
|
475
475
|
...payload,
|
|
476
476
|
recent: {
|
|
@@ -484,7 +484,7 @@ async function handleUsage(options) {
|
|
|
484
484
|
);
|
|
485
485
|
}
|
|
486
486
|
async function handleLimit(options) {
|
|
487
|
-
const { http } =
|
|
487
|
+
const { http } = _chunkKGNTKMRGjs.getAuthedHttpClient.call(void 0, );
|
|
488
488
|
const payload = await http.get(
|
|
489
489
|
"/api/v2/billing/limit"
|
|
490
490
|
);
|
|
@@ -492,7 +492,7 @@ async function handleLimit(options) {
|
|
|
492
492
|
`Monthly usage cap: ${_nullishCoalesce(payload.monthly_credits_limit, () => ( "(unknown)"))}`,
|
|
493
493
|
"Enforcement: checked before new calls; in-flight work can exceed the cap."
|
|
494
494
|
] : ["Monthly usage cap: off"];
|
|
495
|
-
|
|
495
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
496
496
|
{
|
|
497
497
|
...payload,
|
|
498
498
|
render: { sections: [{ title: "billing limit", lines }] }
|
|
@@ -501,12 +501,12 @@ async function handleLimit(options) {
|
|
|
501
501
|
);
|
|
502
502
|
}
|
|
503
503
|
async function handleSetLimit(credits, options) {
|
|
504
|
-
const { http } =
|
|
504
|
+
const { http } = _chunkKGNTKMRGjs.getAuthedHttpClient.call(void 0, );
|
|
505
505
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
506
506
|
method: "PUT",
|
|
507
507
|
body: { monthly_credits_limit: Number.parseInt(credits, 10) }
|
|
508
508
|
});
|
|
509
|
-
|
|
509
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
510
510
|
{
|
|
511
511
|
...payload,
|
|
512
512
|
render: {
|
|
@@ -522,11 +522,11 @@ async function handleSetLimit(credits, options) {
|
|
|
522
522
|
);
|
|
523
523
|
}
|
|
524
524
|
async function handleLimitOff(options) {
|
|
525
|
-
const { http } =
|
|
525
|
+
const { http } = _chunkKGNTKMRGjs.getAuthedHttpClient.call(void 0, );
|
|
526
526
|
const payload = await http.request("/api/v2/billing/limit", {
|
|
527
527
|
method: "DELETE"
|
|
528
528
|
});
|
|
529
|
-
|
|
529
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
530
530
|
{
|
|
531
531
|
...payload,
|
|
532
532
|
render: {
|
|
@@ -546,7 +546,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
546
546
|
let initialized = false;
|
|
547
547
|
let pageNumber = 0;
|
|
548
548
|
console.error(`Exporting billing ledger to ${outputPath}`);
|
|
549
|
-
for await (const entries of
|
|
549
|
+
for await (const entries of _chunkE23BQ5SCjs.iterateCursorPages.call(void 0, async (cursor) => {
|
|
550
550
|
pageNumber += 1;
|
|
551
551
|
console.error(
|
|
552
552
|
`Fetching page ${pageNumber}; ${summary.row_count} rows written.`
|
|
@@ -585,7 +585,7 @@ async function exportLedger(http, outputPath, options) {
|
|
|
585
585
|
return summary;
|
|
586
586
|
}
|
|
587
587
|
async function handleHistory(options) {
|
|
588
|
-
const { http } =
|
|
588
|
+
const { http } = _chunkKGNTKMRGjs.getAuthedHttpClient.call(void 0, );
|
|
589
589
|
const windows = {
|
|
590
590
|
"1d": 86400,
|
|
591
591
|
"1w": 604800,
|
|
@@ -597,10 +597,10 @@ async function handleHistory(options) {
|
|
|
597
597
|
process.cwd(),
|
|
598
598
|
"deepline",
|
|
599
599
|
"data",
|
|
600
|
-
|
|
600
|
+
_chunkKGNTKMRGjs.createTimestampedName.call(void 0, `billing-history-${options.time}`, "csv")
|
|
601
601
|
);
|
|
602
602
|
const summary = await exportLedger(http, outputPath, { sinceAt });
|
|
603
|
-
|
|
603
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
604
604
|
{
|
|
605
605
|
output_path: outputPath,
|
|
606
606
|
row_count: summary.row_count,
|
|
@@ -637,14 +637,14 @@ async function handleLedgerExportAll(options) {
|
|
|
637
637
|
);
|
|
638
638
|
return;
|
|
639
639
|
}
|
|
640
|
-
const { http } =
|
|
640
|
+
const { http } = _chunkKGNTKMRGjs.getAuthedHttpClient.call(void 0, );
|
|
641
641
|
const outputPath = options.output ? _path.resolve.call(void 0, String(options.output)) : defaultLedgerExportPath();
|
|
642
642
|
const summary = await exportLedger(http, outputPath, {
|
|
643
643
|
sinceAt,
|
|
644
644
|
runId: options.runId,
|
|
645
645
|
operation: options.operation
|
|
646
646
|
});
|
|
647
|
-
|
|
647
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
648
648
|
{
|
|
649
649
|
output_path: outputPath,
|
|
650
650
|
row_count: summary.row_count,
|
|
@@ -683,7 +683,7 @@ function targetPlanLine(plan) {
|
|
|
683
683
|
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"}`;
|
|
684
684
|
}
|
|
685
685
|
async function handlePlans(options) {
|
|
686
|
-
const client = new (0,
|
|
686
|
+
const client = new (0, _chunkE23BQ5SCjs.DeeplineClient)();
|
|
687
687
|
const payload = await client.billing.targetPlans();
|
|
688
688
|
const listedCurrentPlan = payload.plans.find(
|
|
689
689
|
(plan) => plan.sku === payload.current_plan_sku
|
|
@@ -696,8 +696,8 @@ async function handlePlans(options) {
|
|
|
696
696
|
...payload.plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...payload.plans.map(targetPlanLine)],
|
|
697
697
|
"Change plan: deepline billing change-plan <plan_sku>"
|
|
698
698
|
];
|
|
699
|
-
const legacyPayload =
|
|
700
|
-
|
|
699
|
+
const legacyPayload = _chunkKGNTKMRGjs.shouldEmitJson.call(void 0, options.json) ? await client.billing.plans() : null;
|
|
700
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
701
701
|
{
|
|
702
702
|
..._nullishCoalesce(legacyPayload, () => ( payload)),
|
|
703
703
|
...legacyPayload ? { target_billing: payload } : {},
|
|
@@ -707,7 +707,7 @@ async function handlePlans(options) {
|
|
|
707
707
|
);
|
|
708
708
|
}
|
|
709
709
|
async function handleSubscribe(planVersionId, options) {
|
|
710
|
-
const { http } =
|
|
710
|
+
const { http } = _chunkKGNTKMRGjs.getAuthedHttpClient.call(void 0, );
|
|
711
711
|
const payload = await http.request(
|
|
712
712
|
"/api/v2/billing/subscription/checkout",
|
|
713
713
|
{
|
|
@@ -716,8 +716,8 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
716
716
|
}
|
|
717
717
|
);
|
|
718
718
|
const url = String(payload.checkout_url || "");
|
|
719
|
-
if (!options.json && options.open !== false && url)
|
|
720
|
-
|
|
719
|
+
if (!options.json && options.open !== false && url) _chunkKGNTKMRGjs.openInBrowser.call(void 0, url);
|
|
720
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
721
721
|
{
|
|
722
722
|
...payload,
|
|
723
723
|
render: {
|
|
@@ -733,7 +733,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
733
733
|
);
|
|
734
734
|
}
|
|
735
735
|
async function handleSubscriptionStatus(options) {
|
|
736
|
-
const client = new (0,
|
|
736
|
+
const client = new (0, _chunkE23BQ5SCjs.DeeplineClient)();
|
|
737
737
|
const payload = await client.billing.subscription.status();
|
|
738
738
|
const pools = _nullishCoalesce(payload.credit_pools, () => ( []));
|
|
739
739
|
const lines = [
|
|
@@ -753,7 +753,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
753
753
|
],
|
|
754
754
|
`Assigned by: ${_nullishCoalesce(payload.assigned_by, () => ( "default"))}`
|
|
755
755
|
];
|
|
756
|
-
|
|
756
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
757
757
|
{
|
|
758
758
|
...payload,
|
|
759
759
|
render: { sections: [{ title: "billing subscription", lines }] }
|
|
@@ -762,7 +762,7 @@ async function handleSubscriptionStatus(options) {
|
|
|
762
762
|
);
|
|
763
763
|
}
|
|
764
764
|
async function handleSubscriptionCancel(options) {
|
|
765
|
-
const client = new (0,
|
|
765
|
+
const client = new (0, _chunkE23BQ5SCjs.DeeplineClient)();
|
|
766
766
|
const action = options.undo ? "undo_cancel" : "cancel";
|
|
767
767
|
if (options.dryRun) {
|
|
768
768
|
const status = await client.billing.subscription.status();
|
|
@@ -779,7 +779,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
779
779
|
return;
|
|
780
780
|
}
|
|
781
781
|
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.";
|
|
782
|
-
|
|
782
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
783
783
|
{
|
|
784
784
|
ok: true,
|
|
785
785
|
dry_run: true,
|
|
@@ -834,7 +834,7 @@ async function handleSubscriptionCancel(options) {
|
|
|
834
834
|
"Remaining credits are yours to keep \u2014 cancellation never removes credits.",
|
|
835
835
|
"Undo with: deepline billing subscription cancel --undo"
|
|
836
836
|
];
|
|
837
|
-
|
|
837
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
838
838
|
{
|
|
839
839
|
ok: true,
|
|
840
840
|
...result,
|
|
@@ -888,7 +888,7 @@ async function handleInvoices(options) {
|
|
|
888
888
|
return;
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
const client = new (0,
|
|
891
|
+
const client = new (0, _chunkE23BQ5SCjs.DeeplineClient)();
|
|
892
892
|
let payload;
|
|
893
893
|
try {
|
|
894
894
|
payload = await client.billing.invoices.list(
|
|
@@ -917,7 +917,7 @@ async function handleInvoices(options) {
|
|
|
917
917
|
url: entry.url
|
|
918
918
|
}))
|
|
919
919
|
} : { ...payload, count: entries.length };
|
|
920
|
-
|
|
920
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
921
921
|
{
|
|
922
922
|
...envelope,
|
|
923
923
|
render: { sections: [{ title: "billing invoices", lines }] }
|
|
@@ -926,7 +926,7 @@ async function handleInvoices(options) {
|
|
|
926
926
|
);
|
|
927
927
|
}
|
|
928
928
|
async function handleCheckout(options) {
|
|
929
|
-
const { http } =
|
|
929
|
+
const { http } = _chunkKGNTKMRGjs.getAuthedHttpClient.call(void 0, );
|
|
930
930
|
const payload = await http.post(
|
|
931
931
|
"/api/v2/billing/checkout",
|
|
932
932
|
{
|
|
@@ -936,8 +936,8 @@ async function handleCheckout(options) {
|
|
|
936
936
|
}
|
|
937
937
|
);
|
|
938
938
|
const url = String(payload.url || payload.checkout_url || "");
|
|
939
|
-
if (!options.json && !options.noOpen && url)
|
|
940
|
-
|
|
939
|
+
if (!options.json && !options.noOpen && url) _chunkKGNTKMRGjs.openInBrowser.call(void 0, url);
|
|
940
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
941
941
|
{
|
|
942
942
|
...payload,
|
|
943
943
|
render: {
|
|
@@ -982,7 +982,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
982
982
|
return;
|
|
983
983
|
}
|
|
984
984
|
if (options.dryRun) {
|
|
985
|
-
|
|
985
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
986
986
|
{
|
|
987
987
|
ok: true,
|
|
988
988
|
dry_run: true,
|
|
@@ -1012,7 +1012,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1012
1012
|
);
|
|
1013
1013
|
return;
|
|
1014
1014
|
}
|
|
1015
|
-
const client = new (0,
|
|
1015
|
+
const client = new (0, _chunkE23BQ5SCjs.DeeplineClient)();
|
|
1016
1016
|
let payload;
|
|
1017
1017
|
try {
|
|
1018
1018
|
payload = await client.billing.topUpWithReceipt({
|
|
@@ -1029,7 +1029,7 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1029
1029
|
return;
|
|
1030
1030
|
}
|
|
1031
1031
|
if (payload.status === "pending") {
|
|
1032
|
-
|
|
1032
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1033
1033
|
{
|
|
1034
1034
|
ok: true,
|
|
1035
1035
|
...payload,
|
|
@@ -1093,17 +1093,17 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
1093
1093
|
]
|
|
1094
1094
|
}
|
|
1095
1095
|
};
|
|
1096
|
-
|
|
1096
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0, options.compact ? compactEnvelope : fullEnvelope, {
|
|
1097
1097
|
json: options.json
|
|
1098
1098
|
});
|
|
1099
1099
|
}
|
|
1100
1100
|
async function handleTargetStatus(options) {
|
|
1101
|
-
const client = new (0,
|
|
1101
|
+
const client = new (0, _chunkE23BQ5SCjs.DeeplineClient)();
|
|
1102
1102
|
const payload = await client.billing.targetStatus();
|
|
1103
1103
|
const balanceCommand = "deepline billing balance";
|
|
1104
1104
|
const recentChargesCommand = "deepline billing usage --limit 5";
|
|
1105
1105
|
const exactChargeCommand = "deepline billing usage --request-id <job_id>";
|
|
1106
|
-
|
|
1106
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1107
1107
|
{
|
|
1108
1108
|
ok: true,
|
|
1109
1109
|
...payload,
|
|
@@ -1133,8 +1133,8 @@ async function handleTargetStatus(options) {
|
|
|
1133
1133
|
);
|
|
1134
1134
|
}
|
|
1135
1135
|
async function handleEntitlements(options) {
|
|
1136
|
-
const payload = await new (0,
|
|
1137
|
-
|
|
1136
|
+
const payload = await new (0, _chunkE23BQ5SCjs.DeeplineClient)().billing.entitlements();
|
|
1137
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1138
1138
|
{
|
|
1139
1139
|
ok: true,
|
|
1140
1140
|
...payload,
|
|
@@ -1159,7 +1159,7 @@ async function handleEntitlements(options) {
|
|
|
1159
1159
|
);
|
|
1160
1160
|
}
|
|
1161
1161
|
async function handleAutoRechargeStatus(options) {
|
|
1162
|
-
const payload = await new (0,
|
|
1162
|
+
const payload = await new (0, _chunkE23BQ5SCjs.DeeplineClient)().billing.autoRecharge.get();
|
|
1163
1163
|
const state = payload.available ? payload.enabled ? "on" : "off" : "unavailable";
|
|
1164
1164
|
const lines = [
|
|
1165
1165
|
`State: ${state}`,
|
|
@@ -1169,7 +1169,7 @@ async function handleAutoRechargeStatus(options) {
|
|
|
1169
1169
|
`Automatic credit purchase cap: ${payload.purchase_limit_credits} credits per rolling 30 days`
|
|
1170
1170
|
] : []
|
|
1171
1171
|
];
|
|
1172
|
-
|
|
1172
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1173
1173
|
{
|
|
1174
1174
|
ok: true,
|
|
1175
1175
|
...payload,
|
|
@@ -1218,7 +1218,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1218
1218
|
}
|
|
1219
1219
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1220
1220
|
if (options.dryRun) {
|
|
1221
|
-
|
|
1221
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1222
1222
|
{
|
|
1223
1223
|
ok: true,
|
|
1224
1224
|
dry_run: true,
|
|
@@ -1239,7 +1239,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1239
1239
|
);
|
|
1240
1240
|
return;
|
|
1241
1241
|
}
|
|
1242
|
-
const payload = await new (0,
|
|
1242
|
+
const payload = await new (0, _chunkE23BQ5SCjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1243
1243
|
enabled: true,
|
|
1244
1244
|
thresholdCredits,
|
|
1245
1245
|
refillToCredits,
|
|
@@ -1247,7 +1247,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1247
1247
|
...rollingLimitCredits !== void 0 ? { purchaseLimitCredits: rollingLimitCredits } : {},
|
|
1248
1248
|
idempotencyKey
|
|
1249
1249
|
});
|
|
1250
|
-
|
|
1250
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1251
1251
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1252
1252
|
{ json: options.json }
|
|
1253
1253
|
);
|
|
@@ -1255,7 +1255,7 @@ async function handleAutoRechargeSet(options) {
|
|
|
1255
1255
|
async function handleAutoRechargeOff(options) {
|
|
1256
1256
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1257
1257
|
if (options.dryRun) {
|
|
1258
|
-
|
|
1258
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1259
1259
|
{
|
|
1260
1260
|
ok: true,
|
|
1261
1261
|
dry_run: true,
|
|
@@ -1270,11 +1270,11 @@ async function handleAutoRechargeOff(options) {
|
|
|
1270
1270
|
);
|
|
1271
1271
|
return;
|
|
1272
1272
|
}
|
|
1273
|
-
const payload = await new (0,
|
|
1273
|
+
const payload = await new (0, _chunkE23BQ5SCjs.DeeplineClient)().billing.autoRecharge.update({
|
|
1274
1274
|
enabled: false,
|
|
1275
1275
|
idempotencyKey
|
|
1276
1276
|
});
|
|
1277
|
-
|
|
1277
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1278
1278
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1279
1279
|
{ json: options.json }
|
|
1280
1280
|
);
|
|
@@ -1293,11 +1293,11 @@ async function handleBuyCredits(creditsRaw, options) {
|
|
|
1293
1293
|
return;
|
|
1294
1294
|
}
|
|
1295
1295
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1296
|
-
const payload = await new (0,
|
|
1296
|
+
const payload = await new (0, _chunkE23BQ5SCjs.DeeplineClient)().billing.purchaseCredits({
|
|
1297
1297
|
credits,
|
|
1298
1298
|
idempotencyKey
|
|
1299
1299
|
});
|
|
1300
|
-
|
|
1300
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1301
1301
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1302
1302
|
{ json: options.json }
|
|
1303
1303
|
);
|
|
@@ -1333,7 +1333,7 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1333
1333
|
return;
|
|
1334
1334
|
}
|
|
1335
1335
|
if (options.dryRun) {
|
|
1336
|
-
|
|
1336
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1337
1337
|
{
|
|
1338
1338
|
ok: true,
|
|
1339
1339
|
dry_run: true,
|
|
@@ -1346,12 +1346,12 @@ async function handleTopUpRecover(creditsRaw, options) {
|
|
|
1346
1346
|
);
|
|
1347
1347
|
return;
|
|
1348
1348
|
}
|
|
1349
|
-
const payload = await new (0,
|
|
1349
|
+
const payload = await new (0, _chunkE23BQ5SCjs.DeeplineClient)().billing.recoverCreditPurchase({
|
|
1350
1350
|
credits,
|
|
1351
1351
|
orgId: options.orgId,
|
|
1352
1352
|
idempotencyKey: options.idempotencyKey
|
|
1353
1353
|
});
|
|
1354
|
-
|
|
1354
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1355
1355
|
{ ok: true, idempotency_key: options.idempotencyKey, ...payload },
|
|
1356
1356
|
{ json: options.json }
|
|
1357
1357
|
);
|
|
@@ -1371,37 +1371,37 @@ async function handleTargetPlan(planSku, options) {
|
|
|
1371
1371
|
return;
|
|
1372
1372
|
}
|
|
1373
1373
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1374
|
-
const payload = await new (0,
|
|
1374
|
+
const payload = await new (0, _chunkE23BQ5SCjs.DeeplineClient)().billing.transitionPlan({
|
|
1375
1375
|
action: "start_or_change",
|
|
1376
1376
|
targetPlanSku: planSku,
|
|
1377
1377
|
...options.billingEmail ? { billingEmail: options.billingEmail } : {},
|
|
1378
1378
|
idempotencyKey
|
|
1379
1379
|
});
|
|
1380
|
-
|
|
1380
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1381
1381
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1382
1382
|
{ json: options.json }
|
|
1383
1383
|
);
|
|
1384
1384
|
}
|
|
1385
1385
|
async function handleTargetPlanCancellation(options) {
|
|
1386
1386
|
const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
|
|
1387
|
-
const payload = await new (0,
|
|
1387
|
+
const payload = await new (0, _chunkE23BQ5SCjs.DeeplineClient)().billing.transitionPlan({
|
|
1388
1388
|
action: options.undo ? "undo_cancel" : "cancel",
|
|
1389
1389
|
idempotencyKey
|
|
1390
1390
|
});
|
|
1391
|
-
|
|
1391
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1392
1392
|
{ ok: true, idempotency_key: idempotencyKey, ...payload },
|
|
1393
1393
|
{ json: options.json }
|
|
1394
1394
|
);
|
|
1395
1395
|
}
|
|
1396
1396
|
async function handleTargetPortal(options) {
|
|
1397
|
-
const payload = await new (0,
|
|
1397
|
+
const payload = await new (0, _chunkE23BQ5SCjs.DeeplineClient)().billing.portalSession(
|
|
1398
1398
|
options.billingAddress ? { flow: "customer_update" } : void 0
|
|
1399
1399
|
);
|
|
1400
|
-
if (!options.json && !options.noOpen)
|
|
1401
|
-
|
|
1400
|
+
if (!options.json && !options.noOpen) _chunkKGNTKMRGjs.openInBrowser.call(void 0, payload.url);
|
|
1401
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0, { ok: true, ...payload }, { json: options.json });
|
|
1402
1402
|
}
|
|
1403
1403
|
async function handleRedeemCode(code, options) {
|
|
1404
|
-
const { http } =
|
|
1404
|
+
const { http } = _chunkKGNTKMRGjs.getAuthedHttpClient.call(void 0, );
|
|
1405
1405
|
const payload = await http.post(
|
|
1406
1406
|
"/api/v2/billing/checkout",
|
|
1407
1407
|
{
|
|
@@ -1409,8 +1409,8 @@ async function handleRedeemCode(code, options) {
|
|
|
1409
1409
|
}
|
|
1410
1410
|
);
|
|
1411
1411
|
const url = String(payload.url || payload.checkout_url || "");
|
|
1412
|
-
if (!options.json && !options.noOpen && url)
|
|
1413
|
-
|
|
1412
|
+
if (!options.json && !options.noOpen && url) _chunkKGNTKMRGjs.openInBrowser.call(void 0, url);
|
|
1413
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0,
|
|
1414
1414
|
{
|
|
1415
1415
|
...payload,
|
|
1416
1416
|
render: {
|
|
@@ -1468,14 +1468,14 @@ Examples:
|
|
|
1468
1468
|
if (!Number.isSafeInteger(quantity) || quantity <= 0) {
|
|
1469
1469
|
throw new Error("--quantity must be a positive safe integer.");
|
|
1470
1470
|
}
|
|
1471
|
-
const quote = await new (0,
|
|
1471
|
+
const quote = await new (0, _chunkE23BQ5SCjs.DeeplineClient)().billing.quote({
|
|
1472
1472
|
quantity,
|
|
1473
1473
|
sandbox_runtime: {
|
|
1474
1474
|
timeout: options.sandboxTimeout,
|
|
1475
1475
|
size: "standard"
|
|
1476
1476
|
}
|
|
1477
1477
|
});
|
|
1478
|
-
|
|
1478
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0, quote, {
|
|
1479
1479
|
json: options.json,
|
|
1480
1480
|
text: `Sandbox session ceiling: ${quote.maximum_credits} Deepline credits (${quote.quantity} session${quote.quantity === 1 ? "" : "s"}).
|
|
1481
1481
|
${quote.explanation}
|
|
@@ -1706,8 +1706,8 @@ Examples:
|
|
|
1706
1706
|
new (0, _commander.Command)("trigger").description(
|
|
1707
1707
|
"Evaluate capped automatic recharge and resume any pending purchase."
|
|
1708
1708
|
).option("--json", "Emit JSON output").action(async (options) => {
|
|
1709
|
-
const result = await new (0,
|
|
1710
|
-
|
|
1709
|
+
const result = await new (0, _chunkE23BQ5SCjs.DeeplineClient)().billing.autoRecharge.trigger();
|
|
1710
|
+
_chunkKGNTKMRGjs.printCommandEnvelope.call(void 0, { ok: true, ...result }, { json: options.json });
|
|
1711
1711
|
})
|
|
1712
1712
|
);
|
|
1713
1713
|
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(
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DeeplineClient,
|
|
3
3
|
iterateCursorPages,
|
|
4
4
|
requireBillingIdempotencyKey
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JHIJIHFB.mjs";
|
|
6
6
|
import "./chunk-6IKARAYD.mjs";
|
|
7
7
|
import "./chunk-JI2B4RZP.mjs";
|
|
8
8
|
import "./chunk-UBKA33KY.mjs";
|
|
@@ -12,16 +12,16 @@ import {
|
|
|
12
12
|
openInBrowser,
|
|
13
13
|
printCommandEnvelope,
|
|
14
14
|
shouldEmitJson
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NR3DFKNF.mjs";
|
|
16
16
|
import {
|
|
17
17
|
AuthError,
|
|
18
18
|
ConfigError
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-FJGW5GXU.mjs";
|
|
20
20
|
import "./chunk-DLIRSHV6.mjs";
|
|
21
21
|
import {
|
|
22
22
|
DeeplineError
|
|
23
23
|
} from "./chunk-NXGCO4JB.mjs";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-TJI2EN6K.mjs";
|
|
25
25
|
import "./chunk-WZYKRD7T.mjs";
|
|
26
26
|
import "./chunk-KRD6H754.mjs";
|
|
27
27
|
|