deepline 0.3.407 → 0.3.408
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/client.ts +2 -0
- package/dist/bundling-sources/sdk/src/play.ts +13 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +23 -0
- package/dist/bundling-sources/shared_libs/play-runtime/admission-timings.ts +64 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +11 -1
- package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +1 -4
- 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/local-process.ts +15 -6
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +188 -45
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +22 -4
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +10 -4
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +72 -0
- package/dist/bundling-sources/shared_libs/play-runtime/webhook-receipt-source-commit-retry.ts +90 -0
- package/dist/bundling-sources/shared_libs/play-runtime/worker-api-types.ts +5 -0
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +6 -0
- package/dist/cli/auth-3GB2K636.js +40 -0
- package/dist/cli/{auth-WURWNNLE.mjs → auth-UVD3CUBB.mjs} +4 -4
- package/dist/cli/{billing-BP3E6WIM.mjs → billing-BZVTXXLM.mjs} +23 -16
- package/dist/cli/{billing-2QJGXGJX.js → billing-BZVYAF6T.js} +92 -85
- package/dist/cli/{chunk-Y6CX4QPR.js → chunk-2XXXFPTD.js} +67 -67
- package/dist/cli/{chunk-RZLXVHNO.js → chunk-3ZB6IIA7.js} +26 -26
- package/dist/cli/{chunk-BKC6VMYZ.mjs → chunk-4CFULMRB.mjs} +73 -4
- package/dist/cli/{chunk-6JZZNP5G.mjs → chunk-4QFT5LGV.mjs} +2 -2
- package/dist/cli/{chunk-H6EWQFPQ.js → chunk-4RNDKFNQ.js} +2 -2
- package/dist/cli/{chunk-GAMFK2ZP.mjs → chunk-67RWR34T.mjs} +10 -3
- package/dist/cli/{chunk-KUQAU5MG.js → chunk-AUMD2VXP.js} +6 -6
- package/dist/cli/{chunk-IY6GKJ4O.js → chunk-BRJUESQV.js} +50 -50
- package/dist/cli/{chunk-7LKYHZVB.js → chunk-D6FFBSM5.js} +1 -1
- package/dist/cli/{chunk-AYHLUHE5.js → chunk-E3PJF6YP.js} +6 -2
- package/dist/cli/{chunk-G6U74WNM.js → chunk-ECVLPS67.js} +15 -15
- package/dist/cli/{chunk-QJBJZVG6.js → chunk-HQY2SG3K.js} +15 -8
- package/dist/cli/{chunk-P7HOTKOK.mjs → chunk-I3DHIXVJ.mjs} +4 -4
- package/dist/cli/{chunk-L25GBGQU.mjs → chunk-IOHRWLQE.mjs} +6 -6
- package/dist/cli/{chunk-UFFSOV6I.mjs → chunk-IWBXJDZA.mjs} +2 -2
- package/dist/cli/{chunk-URWF7NGQ.js → chunk-J5PTX66Y.js} +28 -14
- package/dist/cli/{chunk-J67NU4MQ.mjs → chunk-LOYISF7S.mjs} +1 -1
- package/dist/cli/{chunk-4TV43THC.mjs → chunk-MJELBQBU.mjs} +4 -4
- package/dist/cli/{chunk-WJYPBHTE.js → chunk-OSFWFV72.js} +11 -4
- package/dist/cli/{chunk-ZI2ZNDJK.mjs → chunk-PYZZMAJQ.mjs} +28 -14
- package/dist/cli/{chunk-G4LJS2RE.js → chunk-Q3LFI3VH.js} +8 -8
- package/dist/cli/{chunk-D2ZRMZKF.js → chunk-Q3PUHXOY.js} +99 -30
- package/dist/cli/{chunk-THHM4DPE.js → chunk-QUAQX3FQ.js} +4 -4
- package/dist/cli/{chunk-RMZAOYDN.js → chunk-RWCY6YI2.js} +53 -53
- package/dist/cli/{chunk-ZBCTXQ3P.mjs → chunk-SD7MXAJA.mjs} +1 -1
- package/dist/cli/{chunk-UFS752TU.mjs → chunk-SJVVBWRL.mjs} +5 -1
- package/dist/cli/{chunk-QJAX7QN7.mjs → chunk-URACNNLO.mjs} +2 -2
- package/dist/cli/{chunk-WXLOW623.mjs → chunk-WPAB4DCU.mjs} +14 -7
- package/dist/cli/{chunk-UPEOEYZ3.mjs → chunk-WTT6CLED.mjs} +1 -1
- package/dist/cli/{chunk-N6OAMAO5.mjs → chunk-XXLXOUUU.mjs} +1 -1
- package/dist/cli/{chunk-XT6GG3QO.mjs → chunk-YMOFWHGO.mjs} +3 -3
- package/dist/cli/{chunk-SOQIPKF2.js → chunk-ZBABPK6Y.js} +8 -8
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-N6KYTG7L.mjs → csv-WPSXG6ZZ.mjs} +3 -3
- package/dist/cli/{csv-7E5BE23B.js → csv-XLGLHJ6P.js} +12 -12
- package/dist/cli/{db-4VLZP33O.js → db-5PTNJG4X.js} +25 -25
- package/dist/cli/{db-XMBJNVBD.mjs → db-ABS57ABJ.mjs} +4 -4
- package/dist/cli/{describe-4I6EIVXD.js → describe-EZS6PQXA.js} +11 -11
- package/dist/cli/{describe-WERH4TD2.mjs → describe-PVWQJ2PB.mjs} +7 -7
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/{executions-W7TWJRBK.js → executions-FNTAFQ7Y.js} +6 -6
- package/dist/cli/{executions-JWQXE7G6.mjs → executions-OKJGATQZ.mjs} +4 -4
- package/dist/cli/{feedback-FMGRC6KO.js → feedback-6YBOMSUA.js} +7 -7
- package/dist/cli/{feedback-OEJFX4F7.mjs → feedback-W27HDMRR.mjs} +3 -3
- package/dist/cli/git-YKUXXJOR.js +24 -0
- package/dist/cli/{git-IVC4KHXX.mjs → git-YOOUEL6M.mjs} +4 -4
- package/dist/cli/index.js +204 -127
- package/dist/cli/index.mjs +124 -47
- package/dist/cli/{legacy-noops-X3BQ7MUK.js → legacy-noops-2VZ7XT6C.js} +7 -7
- package/dist/cli/{legacy-noops-LT36CLWZ.mjs → legacy-noops-V6OKW7VR.mjs} +4 -4
- package/dist/cli/{monitors-DLIIAVLW.js → monitors-FBWGVIUS.js} +84 -84
- package/dist/cli/{monitors-MNLCELF7.mjs → monitors-P2YYWTWT.mjs} +4 -4
- package/dist/cli/{org-CYHDEW7P.js → org-3XUSVX5T.js} +64 -64
- package/dist/cli/{org-QV5LMUPT.mjs → org-DVMG6H3C.mjs} +4 -4
- package/dist/cli/{play-5Z4ROZ3P.mjs → play-GNC5CQAS.mjs} +70 -18
- package/dist/cli/{play-MEFXC2QA.js → play-YG5L4BWQ.js} +345 -293
- package/dist/cli/{providers-2MKUNFBQ.js → providers-7PSWG2OV.js} +7 -7
- package/dist/cli/{providers-FJLYSHB3.mjs → providers-JR33SLWL.mjs} +4 -4
- package/dist/cli/{quickstart-ULWXKAOT.js → quickstart-FDVZ5BL3.js} +5 -5
- package/dist/cli/{quickstart-PQO3OQRT.mjs → quickstart-VUOBQYIQ.mjs} +3 -3
- package/dist/cli/{search-KGAAXMDG.mjs → search-JZYLO33K.mjs} +5 -5
- package/dist/cli/search-PPPYC5OZ.js +30 -0
- package/dist/cli/{secrets-PD5I3KAF.mjs → secrets-3MCYBT4I.mjs} +4 -4
- package/dist/cli/{secrets-X2VGG2PO.js → secrets-VS266FVA.js} +13 -13
- package/dist/cli/{sessions-3WVEU4PE.mjs → sessions-ELLLT23E.mjs} +4 -4
- package/dist/cli/{sessions-R3XAKTBQ.js → sessions-TEHEWW7O.js} +5 -5
- package/dist/cli/{settings-ZIDO3IP6.js → settings-7364NMMA.js} +75 -75
- package/dist/cli/{settings-645RSFQX.mjs → settings-PZCKAFII.mjs} +8 -8
- package/dist/cli/{setup-LISKIJKP.mjs → setup-A7GQ4KIA.mjs} +7 -7
- package/dist/cli/{setup-LH5HOZ3D.js → setup-PMWYLCT6.js} +42 -42
- package/dist/cli/skills-SYS7VRRK.js +29 -0
- package/dist/cli/{skills-VVQJHLSF.mjs → skills-WS6BIFPQ.mjs} +5 -5
- package/dist/cli/{tools-Y3LOMXFT.mjs → tools-BR4DOZA2.mjs} +7 -7
- package/dist/cli/{tools-FTPJCNAM.js → tools-KK4BKVQR.js} +8 -8
- package/dist/cli/update-2IV5JTX2.js +29 -0
- package/dist/cli/{update-DOBNQNJI.mjs → update-D2B7UNFT.mjs} +7 -7
- package/dist/cli/{workflow-LGENKZBV.js → workflow-6ODTCYXU.js} +15 -15
- package/dist/cli/{workflow-ZMAA5VCN.mjs → workflow-PQXC2R47.mjs} +5 -5
- package/dist/{client-IrPHUE5J.d.ts → client-BcvhDfJJ.d.ts} +26 -2
- package/dist/{client-6rEB46Lv.d.mts → client-Z9Pye1Wm.d.mts} +26 -2
- package/dist/{compiler-manifest-BHnXE43X.d.ts → compiler-manifest-Ycx-hoAr.d.mts} +2 -0
- package/dist/{compiler-manifest-BHnXE43X.d.mts → compiler-manifest-Ycx-hoAr.d.ts} +2 -0
- package/dist/{index-Da_Y8z5e.d.mts → index-CZXgiN3E.d.mts} +1 -1
- package/dist/{index-SODb2ROS.d.ts → index-NPG5pqxQ.d.ts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +26 -9
- package/dist/index.mjs +23 -6
- package/dist/install-integrity.json +86 -84
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-4JTX6AGM.js +0 -40
- package/dist/cli/git-OFXE7G4X.js +0 -24
- package/dist/cli/search-ANKSJ224.js +0 -30
- package/dist/cli/skills-WLHYSVQA.js +0 -29
- package/dist/cli/update-A622H2DZ.js +0 -29
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retries only the idempotent Play webhook source transaction under known
|
|
3
|
+
* Convex OCC or availability failures. Keep application errors loud: this
|
|
4
|
+
* operation creates the durable delivery identity and delayed recovery work
|
|
5
|
+
* atomically, so callers may replay only this narrow boundary.
|
|
6
|
+
*/
|
|
7
|
+
const MAX_RETRIES = 5;
|
|
8
|
+
const RETRY_BASE_MS = 25;
|
|
9
|
+
const RETRY_MAX_MS = 400;
|
|
10
|
+
|
|
11
|
+
function errorChainText(error: unknown): string {
|
|
12
|
+
const parts: string[] = [];
|
|
13
|
+
let current = error;
|
|
14
|
+
for (let depth = 0; depth < 4 && current instanceof Error; depth += 1) {
|
|
15
|
+
parts.push(`${current.name}: ${current.message}`);
|
|
16
|
+
current = current.cause;
|
|
17
|
+
}
|
|
18
|
+
return parts.join('\n');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function retryClass(error: unknown): 'occ' | 'service_unavailable' | null {
|
|
22
|
+
const message = errorChainText(error);
|
|
23
|
+
if (
|
|
24
|
+
/OptimisticConcurrencyControlFailure|write conflict|changed while this mutation was being run/i.test(
|
|
25
|
+
message,
|
|
26
|
+
)
|
|
27
|
+
) {
|
|
28
|
+
return 'occ';
|
|
29
|
+
}
|
|
30
|
+
// Keep this narrow to Convex transport/outage/admission responses. A source
|
|
31
|
+
// commit is replay-safe, but an arbitrary application failure must stay loud.
|
|
32
|
+
if (
|
|
33
|
+
/TypeError:\s*fetch failed|ServiceUnavailable|Service temporarily unavailable|temporarily unavailable \(Code:\s*\d+\)|"code"\s*:\s*"(?:ExpiredInQueue|TooManyConcurrentRequests)"|"code"\s*:\s*"InternalServerError"[\s\S]*(?:Your request couldn't be completed\. Try again later\.|Your request timed out performing too many system operations\.)/i.test(
|
|
34
|
+
message,
|
|
35
|
+
)
|
|
36
|
+
) {
|
|
37
|
+
return 'service_unavailable';
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function retryDelayMs(attempt: number): number {
|
|
43
|
+
const ceiling = Math.min(RETRY_MAX_MS, RETRY_BASE_MS * 2 ** attempt);
|
|
44
|
+
return Math.floor(Math.random() * (ceiling + 1));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Replay the exact receipt mutation, not a broader provider or admission call. */
|
|
48
|
+
export async function retryPlayWebhookReceiptSourceCommit<T>(
|
|
49
|
+
operation: () => Promise<T>,
|
|
50
|
+
): Promise<T> {
|
|
51
|
+
const startedAt = Date.now();
|
|
52
|
+
let totalDelayMs = 0;
|
|
53
|
+
let failureClass: 'occ' | 'service_unavailable' | null = null;
|
|
54
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
55
|
+
try {
|
|
56
|
+
const result = await operation();
|
|
57
|
+
if (attempt > 0) {
|
|
58
|
+
console.info('[play.webhook_delivery.source_commit_retry_outcome]', {
|
|
59
|
+
attemptsTotal: attempt + 1,
|
|
60
|
+
retriesTotal: attempt,
|
|
61
|
+
retryClass: failureClass,
|
|
62
|
+
recovered: true,
|
|
63
|
+
exhausted: false,
|
|
64
|
+
totalDelayMs,
|
|
65
|
+
totalElapsedMs: Date.now() - startedAt,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
} catch (error) {
|
|
70
|
+
failureClass = retryClass(error);
|
|
71
|
+
if (failureClass === null || attempt >= MAX_RETRIES) {
|
|
72
|
+
if (failureClass !== null) {
|
|
73
|
+
console.warn('[play.webhook_delivery.source_commit_retry_outcome]', {
|
|
74
|
+
attemptsTotal: attempt + 1,
|
|
75
|
+
retriesTotal: attempt,
|
|
76
|
+
retryClass: failureClass,
|
|
77
|
+
recovered: false,
|
|
78
|
+
exhausted: attempt >= MAX_RETRIES,
|
|
79
|
+
totalDelayMs,
|
|
80
|
+
totalElapsedMs: Date.now() - startedAt,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
const delayMs = retryDelayMs(attempt);
|
|
86
|
+
totalDelayMs += delayMs;
|
|
87
|
+
await new Promise<void>((resolve) => setTimeout(resolve, delayMs));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -64,6 +64,11 @@ export const MODAL_SANDBOX_COMPUTE_PRICING_USD = {
|
|
|
64
64
|
memoryGiBSecond: 0.00000667,
|
|
65
65
|
} as const;
|
|
66
66
|
|
|
67
|
+
// Modal bills one physical core as two vCPUs. This matches Deepline's standard
|
|
68
|
+
// one-vCPU / one-GiB sandbox and stays beside the pure pricing contract so
|
|
69
|
+
// Convex billing can use it without importing Modal's Node runtime config.
|
|
70
|
+
export const MODAL_SANDBOX_CPU_CORES = 0.5;
|
|
71
|
+
|
|
67
72
|
const NEON_COMPUTE_PRICING_USD = {
|
|
68
73
|
cuHour: 0.106,
|
|
69
74
|
defaultCu: 1,
|
|
@@ -94,6 +94,8 @@ export type ToolResultMetadata = {
|
|
|
94
94
|
lists: Record<string, ToolResultListMetadata>;
|
|
95
95
|
/** Original declarations preserve semantic accessor names across replay. */
|
|
96
96
|
listExtractorPaths?: readonly string[];
|
|
97
|
+
/** Additional semantic names for another declared list; original names win. */
|
|
98
|
+
listExtractorAliases?: Readonly<Record<string, string>>;
|
|
97
99
|
extractors?: Record<string, ToolResultExtractorDescriptor>;
|
|
98
100
|
};
|
|
99
101
|
|
|
@@ -164,6 +166,8 @@ export type ToolResultMetadataInput = {
|
|
|
164
166
|
extractors?: Record<string, ToolResultExtractorDescriptor>;
|
|
165
167
|
targetGetters?: Record<string, readonly string[]>;
|
|
166
168
|
listExtractorPaths?: readonly string[];
|
|
169
|
+
/** Additional semantic names for another declared list; original names win. */
|
|
170
|
+
listExtractorAliases?: Readonly<Record<string, string>>;
|
|
167
171
|
listIdentityGetters?: Record<string, readonly string[]>;
|
|
168
172
|
};
|
|
169
173
|
|
|
@@ -269,6 +273,8 @@ export type ToolExecuteResultBase<
|
|
|
269
273
|
>;
|
|
270
274
|
/** Original declarations preserve semantic accessor names across replay. */
|
|
271
275
|
listExtractorPaths?: readonly string[];
|
|
276
|
+
/** Additional semantic names for another declared list; original names win. */
|
|
277
|
+
listExtractorAliases?: Readonly<Record<string, string>>;
|
|
272
278
|
};
|
|
273
279
|
};
|
|
274
280
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunkBRJUESQVjs = require('./chunk-BRJUESQV.js');
|
|
17
|
+
require('./chunk-Q3PUHXOY.js');
|
|
18
|
+
require('./chunk-QUAQX3FQ.js');
|
|
19
|
+
require('./chunk-Q2E4E4FJ.js');
|
|
20
|
+
require('./chunk-XNYIZMNQ.js');
|
|
21
|
+
require('./chunk-7P5AA3SN.js');
|
|
22
|
+
require('./chunk-D6FFBSM5.js');
|
|
23
|
+
require('./chunk-OG64RBAC.js');
|
|
24
|
+
require('./chunk-COGTRVWW.js');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunkBRJUESQVjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkBRJUESQVjs.authStatusLine; exports.clearPendingClaim = _chunkBRJUESQVjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkBRJUESQVjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkBRJUESQVjs.handleRegister; exports.handleStatus = _chunkBRJUESQVjs.handleStatus; exports.handleWait = _chunkBRJUESQVjs.handleWait; exports.httpJson = _chunkBRJUESQVjs.httpJson; exports.readPendingAuthClaim = _chunkBRJUESQVjs.readPendingAuthClaim; exports.readStatusBanner = _chunkBRJUESQVjs.readStatusBanner; exports.registerAuthCommands = _chunkBRJUESQVjs.registerAuthCommands; exports.reportSetupCompleted = _chunkBRJUESQVjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkBRJUESQVjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkBRJUESQVjs.statusBannerLine;
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
reportSetupCompleted,
|
|
14
14
|
resolvePendingAuthClaimForResume,
|
|
15
15
|
statusBannerLine
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-IWBXJDZA.mjs";
|
|
17
|
+
import "./chunk-4CFULMRB.mjs";
|
|
18
|
+
import "./chunk-SD7MXAJA.mjs";
|
|
19
19
|
import "./chunk-YHPYUZZX.mjs";
|
|
20
20
|
import "./chunk-DLIRSHV6.mjs";
|
|
21
21
|
import "./chunk-NXGCO4JB.mjs";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-WTT6CLED.mjs";
|
|
23
23
|
import "./chunk-WZYKRD7T.mjs";
|
|
24
24
|
import "./chunk-KRD6H754.mjs";
|
|
25
25
|
export {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DeeplineClient,
|
|
3
3
|
iterateCursorPages,
|
|
4
4
|
requireBillingIdempotencyKey
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LOYISF7S.mjs";
|
|
6
6
|
import "./chunk-6IKARAYD.mjs";
|
|
7
7
|
import "./chunk-JI2B4RZP.mjs";
|
|
8
8
|
import "./chunk-EIMG75BT.mjs";
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
openInBrowser,
|
|
14
14
|
printCommandEnvelope,
|
|
15
15
|
shouldEmitJson
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-4CFULMRB.mjs";
|
|
17
|
+
import "./chunk-SD7MXAJA.mjs";
|
|
18
18
|
import {
|
|
19
19
|
AuthError,
|
|
20
20
|
ConfigError
|
|
@@ -23,7 +23,7 @@ import "./chunk-DLIRSHV6.mjs";
|
|
|
23
23
|
import {
|
|
24
24
|
DeeplineError
|
|
25
25
|
} from "./chunk-NXGCO4JB.mjs";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-WTT6CLED.mjs";
|
|
27
27
|
import "./chunk-WZYKRD7T.mjs";
|
|
28
28
|
import "./chunk-KRD6H754.mjs";
|
|
29
29
|
|
|
@@ -307,6 +307,22 @@ async function handleBalance(options) {
|
|
|
307
307
|
const needsCredits = status === "no_billing" || status === "zero_balance" || status === "payment_method_only";
|
|
308
308
|
const recovery = needsCredits ? balanceRecoveryForCredits() : null;
|
|
309
309
|
const lines = [`Balance: ${payload.balance ?? "(unknown)"} credits`];
|
|
310
|
+
const spendable = payload.spendable_balance_credits;
|
|
311
|
+
if (payload.spendable_balance_status === "complete" && typeof spendable === "number") {
|
|
312
|
+
if (typeof payload.posted_balance_credits === "number") {
|
|
313
|
+
lines.push(`Posted wallet: ${payload.posted_balance_credits} credits.`);
|
|
314
|
+
}
|
|
315
|
+
lines.push(`Spendable: ${spendable} credits.`);
|
|
316
|
+
if (typeof payload.pending_spend_credits === "number") {
|
|
317
|
+
lines.push(
|
|
318
|
+
`Pending spending: ${payload.pending_spend_credits} credits \u2014 already committed, not yet debited.`
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
} else if (payload.spendable_balance_status !== void 0 || payload.exposure_status === "partial" || options.verbose) {
|
|
322
|
+
lines.push(
|
|
323
|
+
"Spendable balance is unavailable; the posted balance does not establish capacity for another call."
|
|
324
|
+
);
|
|
325
|
+
}
|
|
310
326
|
const detail = [];
|
|
311
327
|
const temporaryHolds = payload.temporary_hold_credits;
|
|
312
328
|
if (typeof temporaryHolds === "number" && temporaryHolds > 0) {
|
|
@@ -1598,10 +1614,7 @@ Examples:
|
|
|
1598
1614
|
).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(
|
|
1599
1615
|
"--since <timestamp>",
|
|
1600
1616
|
"Only export rows since ISO-8601 time or Unix milliseconds."
|
|
1601
|
-
).option(
|
|
1602
|
-
"--json",
|
|
1603
|
-
"Emit JSON output"
|
|
1604
|
-
).action(handleLedgerExportAll)
|
|
1617
|
+
).option("--json", "Emit JSON output").action(handleLedgerExportAll)
|
|
1605
1618
|
)
|
|
1606
1619
|
);
|
|
1607
1620
|
billing.command("history").description("Export billing ledger history to CSV.").addHelpText(
|
|
@@ -1771,10 +1784,7 @@ Examples:
|
|
|
1771
1784
|
deepline billing subscription status
|
|
1772
1785
|
deepline billing subscription status
|
|
1773
1786
|
`
|
|
1774
|
-
).option(
|
|
1775
|
-
"--json",
|
|
1776
|
-
"Emit JSON output"
|
|
1777
|
-
).action(handleSubscriptionStatus)
|
|
1787
|
+
).option("--json", "Emit JSON output").action(handleSubscriptionStatus)
|
|
1778
1788
|
).addCommand(
|
|
1779
1789
|
new Command("cancel").description("Cancel the subscription at period end. Credits are kept.").addHelpText(
|
|
1780
1790
|
"after",
|
|
@@ -1802,10 +1812,7 @@ Examples:
|
|
|
1802
1812
|
).option("--undo", "Reverse a pending cancellation before period end").option(
|
|
1803
1813
|
"--dry-run",
|
|
1804
1814
|
"Print the planned cancellation without calling the cancel endpoint"
|
|
1805
|
-
).option(
|
|
1806
|
-
"--json",
|
|
1807
|
-
"Emit JSON output"
|
|
1808
|
-
).action(handleSubscriptionCancel)
|
|
1815
|
+
).option("--json", "Emit JSON output").action(handleSubscriptionCancel)
|
|
1809
1816
|
);
|
|
1810
1817
|
billing.command("invoices").description("List subscription invoices and credit purchase receipts.").addHelpText(
|
|
1811
1818
|
"after",
|