deepline 0.3.492 → 0.3.493
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-core.ts +11 -5
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +1 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +6 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/verdict.ts +25 -9
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +36 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +5 -4
- package/dist/bundling-sources/shared_libs/play-runtime/crustdata-company-identify-batching.ts +162 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +19 -3
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/receipt-sql.ts +17 -23
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +28 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-placement-policy.ts +75 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +412 -59
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +38 -10
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +19 -11
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +165 -12
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-state-machine.ts +358 -0
- package/dist/cli/{auth-4I6QY5WX.mjs → auth-3NAY3AST.mjs} +5 -5
- package/dist/cli/auth-KYQLDI6V.js +43 -0
- package/dist/cli/{billing-2H4GOJZY.js → billing-FSB4BBBO.js} +80 -80
- package/dist/cli/{billing-4F6L4JSI.mjs → billing-SBWQCC7B.mjs} +7 -7
- package/dist/cli/{chunk-MQ2LQOAM.mjs → chunk-2BRTYIAH.mjs} +23 -9
- package/dist/cli/{chunk-E47VAVAR.js → chunk-2H4OFVR5.js} +5 -5
- package/dist/cli/{chunk-ZDTPSVGF.js → chunk-2I7VN65H.js} +10 -10
- package/dist/cli/{chunk-LCCFGSV7.mjs → chunk-2IHGVAGT.mjs} +2 -2
- package/dist/cli/{chunk-BDUFZSUL.js → chunk-2NGIBJM2.js} +8 -8
- package/dist/cli/{chunk-OTUT3XTX.mjs → chunk-3QGUWB6E.mjs} +4 -4
- package/dist/cli/{chunk-3BRDP4UP.mjs → chunk-4IJFQV3O.mjs} +1 -1
- package/dist/cli/{chunk-PIC6M4X3.mjs → chunk-4NIGNT7X.mjs} +1 -1
- package/dist/cli/{chunk-YVOYZPMY.mjs → chunk-5DIZ2G74.mjs} +2 -2
- package/dist/cli/{chunk-TKLDKIJU.mjs → chunk-5JPKRDFC.mjs} +7 -5
- package/dist/cli/{chunk-FTXIJTV2.mjs → chunk-5WOPBX3H.mjs} +1 -1
- package/dist/cli/{chunk-R5MP3CIY.mjs → chunk-67ZG7XZV.mjs} +3 -3
- package/dist/cli/{chunk-W4FEX5ZF.js → chunk-7HABWOMB.js} +261 -261
- package/dist/cli/{chunk-FPLN7PHP.js → chunk-AGTXL6LZ.js} +5 -5
- package/dist/cli/{chunk-SE23YSBK.js → chunk-AWMCZAUR.js} +3 -3
- package/dist/cli/{chunk-HHTVRICE.js → chunk-C2MRDPA5.js} +17 -17
- package/dist/cli/{chunk-ONONSV2Q.mjs → chunk-DVQHG6AM.mjs} +1 -0
- package/dist/cli/{chunk-O3K22ZC7.js → chunk-DWJ4RXSA.js} +34 -11
- package/dist/cli/{chunk-6YO4OJPM.mjs → chunk-DYP27IWC.mjs} +99 -24
- package/dist/cli/{chunk-EANFUHRM.mjs → chunk-E5ILCMKQ.mjs} +1 -1
- package/dist/cli/{chunk-Y7QCMOGZ.mjs → chunk-EBAS3UT2.mjs} +6 -6
- package/dist/cli/{chunk-DJOLMS2A.js → chunk-EFO5GVYS.js} +1 -1
- package/dist/cli/{chunk-NF7NUKWF.js → chunk-EYG336YV.js} +132 -57
- package/dist/cli/{chunk-OKHBAAJG.mjs → chunk-GSC35TPZ.mjs} +2 -2
- package/dist/cli/{chunk-MPITIXW4.mjs → chunk-HLM2UFQ5.mjs} +13 -5
- package/dist/cli/{chunk-TVUE4CPW.js → chunk-HTUSTPP4.js} +32 -32
- package/dist/cli/{chunk-GDSZWTJK.mjs → chunk-IJJ6D5WL.mjs} +12 -12
- package/dist/cli/{chunk-3TISK5RQ.js → chunk-IJOHWGPF.js} +6 -6
- package/dist/cli/{chunk-NBL6JMIY.js → chunk-IOBPR2VO.js} +17 -17
- package/dist/cli/{chunk-EFFHRXKB.js → chunk-IOMEJKGK.js} +2 -2
- package/dist/cli/{chunk-A7ZMG2QZ.mjs → chunk-IRDYBMA7.mjs} +34 -11
- package/dist/cli/{chunk-B2JE3HD6.js → chunk-JO2JZUBR.js} +3 -3
- package/dist/cli/{chunk-4IP5MLWU.js → chunk-JO5FFSR7.js} +6 -1
- package/dist/cli/{chunk-O2FB42N2.js → chunk-KCDZWS2B.js} +56 -56
- package/dist/cli/{chunk-CGDUFVNE.mjs → chunk-KGDDQMI7.mjs} +2 -2
- package/dist/cli/{chunk-UUH4GQRL.mjs → chunk-KKSKYZO4.mjs} +1 -1
- package/dist/cli/{chunk-OTDX4A4W.js → chunk-LGTZYI5B.js} +21 -21
- package/dist/cli/{chunk-JJAHWKJ2.js → chunk-MLEUOTEQ.js} +73 -59
- package/dist/cli/{chunk-YOCEY4EI.mjs → chunk-NALJJTPS.mjs} +5 -5
- package/dist/cli/{chunk-HFEJ7JJT.js → chunk-NPNAEPY4.js} +26 -26
- package/dist/cli/{chunk-3IBKEOL4.js → chunk-NWIDPT7H.js} +4 -4
- package/dist/cli/{chunk-AUQQVDAB.js → chunk-PKV5CD3W.js} +1 -0
- package/dist/cli/{chunk-4RB74KJX.js → chunk-QTPS5RLG.js} +15 -15
- package/dist/cli/{chunk-4OLXMJ2L.js → chunk-RLX5ZFNX.js} +8 -6
- package/dist/cli/{chunk-DEJIN4DF.mjs → chunk-SAW3FBCA.mjs} +5 -0
- package/dist/cli/{chunk-RC366IJS.mjs → chunk-SXD2EYAH.mjs} +6 -6
- package/dist/cli/{chunk-YNWET57Z.js → chunk-TIFRRLZT.js} +7 -7
- package/dist/cli/{chunk-ZCKUNXXR.mjs → chunk-TNQOR6XQ.mjs} +1 -1
- package/dist/cli/{chunk-OGNIB64W.js → chunk-UCMY2SO2.js} +23 -15
- package/dist/cli/{chunk-O65HDVA7.mjs → chunk-VFHIYWMC.mjs} +5 -5
- package/dist/cli/{chunk-JHBRJDUC.js → chunk-WCZFCOMZ.js} +7 -7
- package/dist/cli/{chunk-FFOJRD53.mjs → chunk-WTFI7BVH.mjs} +3 -3
- package/dist/cli/{chunk-42Z6VC2Q.js → chunk-XLE7KXE7.js} +2 -2
- package/dist/cli/{chunk-Q3CCCTRQ.js → chunk-XQX476QK.js} +14 -14
- package/dist/cli/{chunk-F6EQWY4E.mjs → chunk-Y3NN2UAF.mjs} +2 -2
- package/dist/cli/{chunk-MJFVF5AW.mjs → chunk-ZQH4TXM2.mjs} +2 -2
- package/dist/cli/{chunk-DVGCPOEA.mjs → chunk-ZVW7EWTC.mjs} +7 -7
- package/dist/cli/{chunk-4GJIJHRQ.mjs → chunk-ZVXB7OU7.mjs} +1 -1
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-JGJNDRSA.js → csv-DKYZE2KM.js} +13 -13
- package/dist/cli/{csv-VGXGV7YM.mjs → csv-XR22YQXT.mjs} +4 -4
- package/dist/cli/{db-OYG27ZBM.mjs → db-EOKG36YN.mjs} +7 -7
- package/dist/cli/{db-W52WJ6E5.js → db-RNYRTCMV.js} +28 -28
- package/dist/cli/describe-ICFXOQBW.mjs +50 -0
- package/dist/cli/describe-RS75I33X.js +50 -0
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/describe-core.js +4 -4
- package/dist/cli/describe-core.mjs +3 -3
- package/dist/cli/{executions-EVE4KUGL.mjs → executions-3RAOACNS.mjs} +7 -7
- package/dist/cli/{executions-LAJHZGPY.js → executions-OBWPSWH7.js} +9 -9
- package/dist/cli/{feedback-75QB7KVG.mjs → feedback-6EQRVBKF.mjs} +4 -4
- package/dist/cli/{feedback-ZABCN7RT.js → feedback-6GPEUBLF.js} +8 -8
- package/dist/cli/getting-started.d.mts +12 -10
- package/dist/cli/getting-started.d.ts +12 -10
- package/dist/cli/getting-started.js +4 -2
- package/dist/cli/getting-started.mjs +3 -1
- package/dist/cli/{git-QIFEYQGY.mjs → git-CVQ24DTR.mjs} +5 -5
- package/dist/cli/git-DEFE4SSB.js +25 -0
- package/dist/cli/index.js +143 -143
- package/dist/cli/index.mjs +43 -43
- package/dist/cli/{legacy-noops-PNTWBBGY.mjs → legacy-noops-QULJZYNH.mjs} +5 -5
- package/dist/cli/{legacy-noops-2TBIAMCM.js → legacy-noops-XPOATG5V.js} +8 -8
- package/dist/cli/{monitors-LOHUYJEI.mjs → monitors-AFT5YJPZ.mjs} +49 -9
- package/dist/cli/{monitors-UKBOEGBS.js → monitors-OJ4CMREE.js} +169 -129
- package/dist/cli/{org-E7A6QLBW.js → org-RKT52CSL.js} +73 -73
- package/dist/cli/{org-JRUKUOUF.mjs → org-WHKNXANG.mjs} +7 -7
- package/dist/cli/{pages-K76HA473.mjs → pages-EEAQFGVD.mjs} +7 -7
- package/dist/cli/{pages-EUDFFLLD.js → pages-SOE3R667.js} +18 -18
- package/dist/cli/{play-DG2N66SV.mjs → play-LXFWHUBP.mjs} +147 -52
- package/dist/cli/{play-UWHNUJRA.js → play-OTJJ4E4T.js} +661 -566
- package/dist/cli/{providers-DZX6TTC6.js → providers-RU4HIAT3.js} +10 -10
- package/dist/cli/{providers-RUTTPUZD.mjs → providers-U3CPKTMM.mjs} +7 -7
- package/dist/cli/{quickstart-RGZZN2YE.mjs → quickstart-75AO2AJC.mjs} +5 -5
- package/dist/cli/{quickstart-U4NMD7KX.js → quickstart-N72IVA2Y.js} +13 -13
- package/dist/cli/{run-MOJWQYFQ.mjs → run-IGWFL6WH.mjs} +29 -28
- package/dist/cli/{run-5UNF4FHG.js → run-MMYES3IW.js} +44 -43
- package/dist/cli/search-EQURI7SZ.js +32 -0
- package/dist/cli/{search-5B3ZDU7H.mjs → search-FIYESBLZ.mjs} +8 -8
- package/dist/cli/{search-output-VQWJS3FN.js → search-output-2FXN4ZWD.js} +9 -6
- package/dist/cli/{search-output-QS4IWWHA.mjs → search-output-3I5KSW36.mjs} +7 -4
- package/dist/cli/{secrets-S3PJMEAC.js → secrets-HCZQ6JNP.js} +16 -16
- package/dist/cli/{secrets-V5XVDBIS.mjs → secrets-O7IUQ3VT.mjs} +7 -7
- package/dist/cli/{sessions-Y5QMEZ3D.js → sessions-5AYTT4IW.js} +6 -6
- package/dist/cli/{sessions-5V3X24XI.mjs → sessions-KY7A3EZO.mjs} +5 -5
- package/dist/cli/{settings-3U6RRO5F.js → settings-P4VFYWJK.js} +80 -80
- package/dist/cli/{settings-LHZYY5PT.mjs → settings-WSMRR2GS.mjs} +13 -13
- package/dist/cli/{setup-MLLIGO2S.js → setup-J7CA3EJL.js} +57 -57
- package/dist/cli/{setup-AJLWXYAN.mjs → setup-YTVKVQC7.mjs} +13 -13
- package/dist/cli/skills-KKPEGLAR.js +36 -0
- package/dist/cli/{skills-5O2MUWKK.mjs → skills-W5WY764N.mjs} +10 -10
- package/dist/cli/tools-65Y4QTW6.js +57 -0
- package/dist/cli/{tools-PWNMI5CD.mjs → tools-YECI6N3N.mjs} +20 -20
- package/dist/cli/{update-SXT4QW7S.mjs → update-BIFBIEII.mjs} +10 -10
- package/dist/cli/update-WDG7VFOW.js +34 -0
- package/dist/cli/{workflow-3WTF5IYT.js → workflow-D2TUFFH6.js} +18 -18
- package/dist/cli/{workflow-KPRM6ARO.mjs → workflow-XZVDNARC.mjs} +8 -8
- package/dist/{client-Cb1ej1Vr.d.ts → client-BDB_VbE4.d.ts} +1 -1
- package/dist/{client-vWpbLNCB.d.mts → client-CNzJ1LTF.d.mts} +1 -1
- package/dist/{client-core-CoBTvsXG.d.mts → client-core-CSv3DlPD.d.mts} +10 -3
- package/dist/{client-core-BmVs6SP0.d.ts → client-core-xEa9x3pl.d.ts} +10 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -10
- package/dist/index.mjs +7 -7
- package/dist/install-integrity.json +115 -114
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -1
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/plays/run-request.js +2 -2
- package/dist/plays/run-request.mjs +1 -1
- 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.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +6 -6
- package/dist/server.mjs +4 -4
- package/package.json +1 -1
- package/dist/cli/auth-7BCLZU6K.js +0 -43
- package/dist/cli/describe-FIXCRO5N.mjs +0 -50
- package/dist/cli/describe-G3O6OUBG.js +0 -50
- package/dist/cli/git-QBAR46NW.js +0 -25
- package/dist/cli/search-3DAEJL6S.js +0 -32
- package/dist/cli/skills-BBLIML5M.js +0 -36
- package/dist/cli/tools-X5SQXUMM.js +0 -57
- package/dist/cli/update-AEJ2ZSZQ.js +0 -34
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return 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; } var _class; var _class2;require('./chunk-I5YZLGMG.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunk2H4OFVR5js = require('./chunk-2H4OFVR5.js');
|
|
5
|
+
require('./chunk-HTUSTPP4.js');
|
|
6
6
|
require('./chunk-E4CABWXL.js');
|
|
7
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-PKV5CD3W.js');
|
|
8
8
|
require('./chunk-NMU3VR5U.js');
|
|
9
9
|
require('./chunk-XDVT3GOM.js');
|
|
10
10
|
|
|
@@ -17,15 +17,15 @@ require('./chunk-UNEMDKXN.js');
|
|
|
17
17
|
var _chunkIF75RD6Ujs = require('./chunk-IF75RD6U.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkAWMCZAURjs = require('./chunk-AWMCZAUR.js');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
27
|
-
require('./chunk-
|
|
28
|
-
require('./chunk-
|
|
26
|
+
var _chunk2I7VN65Hjs = require('./chunk-2I7VN65H.js');
|
|
27
|
+
require('./chunk-JO2JZUBR.js');
|
|
28
|
+
require('./chunk-NWIDPT7H.js');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
var _chunkALJJRZNJjs = require('./chunk-ALJJRZNJ.js');
|
|
@@ -33,7 +33,7 @@ require('./chunk-XNYIZMNQ.js');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunkDIAWYWT5js = require('./chunk-DIAWYWT5.js');
|
|
36
|
-
require('./chunk-
|
|
36
|
+
require('./chunk-EFO5GVYS.js');
|
|
37
37
|
require('./chunk-OG64RBAC.js');
|
|
38
38
|
require('./chunk-COGTRVWW.js');
|
|
39
39
|
|
|
@@ -111,10 +111,10 @@ function reportMonitorsFailure(error, options) {
|
|
|
111
111
|
const exitCode = monitorsErrorExitCode(error);
|
|
112
112
|
const next = monitorsFailureNextCommand(error, exitCode, options);
|
|
113
113
|
const retrySafe = exitCode === 5 && _optionalChain([options, 'optionalAccess', _9 => _9.retryCommand]) !== void 0;
|
|
114
|
-
const wantsJson =
|
|
114
|
+
const wantsJson = _chunk2I7VN65Hjs.shouldEmitJson.call(void 0, process.argv.includes("--json"));
|
|
115
115
|
if (wantsJson) {
|
|
116
|
-
const payload =
|
|
117
|
-
|
|
116
|
+
const payload = _chunk2I7VN65Hjs.errorToJsonPayload.call(void 0, error);
|
|
117
|
+
_chunk2I7VN65Hjs.printJson.call(void 0, {
|
|
118
118
|
ok: false,
|
|
119
119
|
exitCode,
|
|
120
120
|
...next ? { next } : {},
|
|
@@ -529,14 +529,14 @@ Preview the plan first with:
|
|
|
529
529
|
);
|
|
530
530
|
}
|
|
531
531
|
async function handleMonitorsStatus(options) {
|
|
532
|
-
const payload = await new (0,
|
|
532
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.status();
|
|
533
533
|
const hasAccess = payload.has_access === true;
|
|
534
534
|
const reason = typeof payload.reason === "string" && payload.reason.trim() ? payload.reason.trim() : void 0;
|
|
535
535
|
const text = hasAccess ? `\u2713 You have access to Deepline Monitors${reason ? `
|
|
536
536
|
${reason}` : ""}
|
|
537
537
|
` : `\u2717 No access to Deepline Monitors${reason ? ` \u2014 ${reason}` : ""}
|
|
538
538
|
`;
|
|
539
|
-
|
|
539
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
540
540
|
{ has_access: hasAccess, ...reason ? { reason } : {} },
|
|
541
541
|
{ json: options.json, text }
|
|
542
542
|
);
|
|
@@ -602,14 +602,14 @@ async function handleMonitorsAvailable(toolId, options) {
|
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
const tool = _nullishCoalesce(toolId, () => ( options.tool));
|
|
605
|
-
const payload = await new (0,
|
|
605
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.available(tool, {
|
|
606
606
|
...options.provider ? { provider: options.provider } : {},
|
|
607
607
|
...options.search ? { search: options.search } : {},
|
|
608
608
|
...options.limit ? { limit: options.limit } : {},
|
|
609
609
|
...options.full ? { full: true } : {},
|
|
610
610
|
...options.compact ? { compact: true } : {}
|
|
611
611
|
});
|
|
612
|
-
|
|
612
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, {
|
|
613
613
|
json: options.json,
|
|
614
614
|
// Human list view shows id + name + deployed_count ("deployed: N") so
|
|
615
615
|
// can-deploy vs already-deployed is visible in one view. Describing a
|
|
@@ -712,14 +712,14 @@ async function handleMonitorsList(options) {
|
|
|
712
712
|
"`--compact` is deprecated and now does nothing; returning the complete monitor records.\n"
|
|
713
713
|
);
|
|
714
714
|
}
|
|
715
|
-
const payload = await new (0,
|
|
715
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.list({
|
|
716
716
|
...state ? { state } : {},
|
|
717
717
|
...options.status ? { status: options.status } : {},
|
|
718
718
|
...options.limit ? { limit: options.limit } : {},
|
|
719
719
|
...options.cursor ? { cursor: options.cursor } : {},
|
|
720
720
|
...options.includeConsumers ? { includeConsumers: true } : {}
|
|
721
721
|
});
|
|
722
|
-
|
|
722
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, {
|
|
723
723
|
json: options.json,
|
|
724
724
|
text: renderDeployedListText(
|
|
725
725
|
payload,
|
|
@@ -735,10 +735,10 @@ async function handleMonitorsCheck(definition, options) {
|
|
|
735
735
|
argLabel: "<definition>",
|
|
736
736
|
command: "deepline monitors check"
|
|
737
737
|
});
|
|
738
|
-
const payload = await new (0,
|
|
738
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.check(
|
|
739
739
|
body
|
|
740
740
|
);
|
|
741
|
-
|
|
741
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, { json: options.json });
|
|
742
742
|
}
|
|
743
743
|
function previewText(value) {
|
|
744
744
|
return typeof value === "string" && value.trim() ? value.trim() : "-";
|
|
@@ -796,22 +796,22 @@ async function handleMonitorsPreview(definition, options) {
|
|
|
796
796
|
if (limit !== void 0 && !Number.isInteger(limit)) {
|
|
797
797
|
throw new MonitorsUsageError("--limit must be a whole number from 1 to 3.");
|
|
798
798
|
}
|
|
799
|
-
const wantsJson =
|
|
799
|
+
const wantsJson = _chunk2I7VN65Hjs.shouldEmitJson.call(void 0, options.json);
|
|
800
800
|
if (options.idempotencyKey === void 0 && wantsJson) {
|
|
801
801
|
throw new MonitorsUsageError(
|
|
802
802
|
"--json requires --idempotency-key <key>. Choose a new key for each new preview and keep it: rerunning with the same key returns the result without paying again."
|
|
803
803
|
);
|
|
804
804
|
}
|
|
805
805
|
const idempotencyKey = _nullishCoalesce(options.idempotencyKey, () => ( `monitor-preview-${_crypto.randomUUID.call(void 0, )}`));
|
|
806
|
-
const progress =
|
|
806
|
+
const progress = _chunkAWMCZAURjs.createCliProgress.call(void 0, !wantsJson);
|
|
807
807
|
progress.phase(`Preview key: ${idempotencyKey}`);
|
|
808
808
|
try {
|
|
809
|
-
const payload = await new (0,
|
|
809
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.preview(
|
|
810
810
|
body,
|
|
811
811
|
{ idempotencyKey, ...limit === void 0 ? {} : { limit } }
|
|
812
812
|
);
|
|
813
813
|
progress.complete();
|
|
814
|
-
|
|
814
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, {
|
|
815
815
|
json: options.json,
|
|
816
816
|
text: renderMonitorPreviewText(payload)
|
|
817
817
|
});
|
|
@@ -856,7 +856,7 @@ async function handleMonitorsDeploy(definition, options) {
|
|
|
856
856
|
argLabel: "<definition>",
|
|
857
857
|
command: "deepline monitors deploy"
|
|
858
858
|
});
|
|
859
|
-
const client = new (0,
|
|
859
|
+
const client = new (0, _chunk2H4OFVR5js.DeeplineClient)();
|
|
860
860
|
const definitionArg = body;
|
|
861
861
|
if (options.dryRun) {
|
|
862
862
|
const payload2 = await client.monitors.deploy(definitionArg, {
|
|
@@ -864,7 +864,7 @@ async function handleMonitorsDeploy(definition, options) {
|
|
|
864
864
|
});
|
|
865
865
|
const valid = payload2.valid !== false;
|
|
866
866
|
const hasIdentityConflict = Boolean(_optionalChain([asRecord, 'call', _23 => _23(payload2), 'optionalAccess', _24 => _24.identity_conflict]));
|
|
867
|
-
|
|
867
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
868
868
|
{ dry_run: true, ...payload2 },
|
|
869
869
|
{ json: options.json, text: renderMonitorDeployPlan(payload2) }
|
|
870
870
|
);
|
|
@@ -874,7 +874,7 @@ async function handleMonitorsDeploy(definition, options) {
|
|
|
874
874
|
return;
|
|
875
875
|
}
|
|
876
876
|
const payload = await client.monitors.deploy(definitionArg);
|
|
877
|
-
|
|
877
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, {
|
|
878
878
|
json: options.json,
|
|
879
879
|
text: renderMonitorDeployCompletion(payload)
|
|
880
880
|
});
|
|
@@ -886,29 +886,29 @@ async function handleMonitorsSync(definition, options) {
|
|
|
886
886
|
argLabel: "<definition>",
|
|
887
887
|
command: "deepline monitors sync"
|
|
888
888
|
});
|
|
889
|
-
const payload = await new (0,
|
|
889
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.sync(body, {
|
|
890
890
|
...options.dryRun ? { dryRun: true } : {},
|
|
891
891
|
idempotencyKey: _nullishCoalesce(options.idempotencyKey, () => ( monitorJobIdempotencyKey("scalar-sync", void 0)))
|
|
892
892
|
});
|
|
893
893
|
if (options.dryRun) {
|
|
894
894
|
const plan = payload;
|
|
895
|
-
|
|
895
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
896
896
|
{ dry_run: true, ...plan },
|
|
897
897
|
{ json: options.json, text: renderMonitorDeployPlan(plan) }
|
|
898
898
|
);
|
|
899
899
|
return;
|
|
900
900
|
}
|
|
901
|
-
|
|
901
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, {
|
|
902
902
|
json: options.json,
|
|
903
903
|
text: renderMonitorJob(payload)
|
|
904
904
|
});
|
|
905
905
|
}
|
|
906
906
|
async function handleScalarMonitorLifecycle(action, key, options) {
|
|
907
|
-
const payload = await new (0,
|
|
907
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors[action](key, {
|
|
908
908
|
...options.dryRun ? { dryRun: true } : {},
|
|
909
909
|
idempotencyKey: _nullishCoalesce(options.idempotencyKey, () => ( monitorJobIdempotencyKey(`${action}-${key}`, void 0)))
|
|
910
910
|
});
|
|
911
|
-
|
|
911
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, {
|
|
912
912
|
json: options.json,
|
|
913
913
|
text: options.dryRun ? void 0 : renderMonitorJob(payload)
|
|
914
914
|
});
|
|
@@ -997,11 +997,11 @@ async function handleMonitorJobBatchDeploy(options, idempotencyKey) {
|
|
|
997
997
|
lint.issues.filter((issue) => issue.severity === "error").map((issue) => `${issue.path || "batch"}: ${issue.message}`).join("; ")
|
|
998
998
|
);
|
|
999
999
|
}
|
|
1000
|
-
const payload = await new (0,
|
|
1000
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.batch.deploy(
|
|
1001
1001
|
lint.normalized.monitors,
|
|
1002
1002
|
{ idempotencyKey }
|
|
1003
1003
|
);
|
|
1004
|
-
|
|
1004
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
1005
1005
|
{
|
|
1006
1006
|
...payload,
|
|
1007
1007
|
idempotency_key: idempotencyKey,
|
|
@@ -1034,7 +1034,7 @@ async function handleNamedMonitorBatchSync(batchId, options) {
|
|
|
1034
1034
|
);
|
|
1035
1035
|
}
|
|
1036
1036
|
if (options.dryRun) {
|
|
1037
|
-
|
|
1037
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
1038
1038
|
{
|
|
1039
1039
|
ok: true,
|
|
1040
1040
|
dry_run: true,
|
|
@@ -1051,7 +1051,7 @@ async function handleNamedMonitorBatchSync(batchId, options) {
|
|
|
1051
1051
|
"sync",
|
|
1052
1052
|
options.idempotencyKey
|
|
1053
1053
|
);
|
|
1054
|
-
const payload = await new (0,
|
|
1054
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.batches.sync(
|
|
1055
1055
|
batchId,
|
|
1056
1056
|
lint.normalized.monitors,
|
|
1057
1057
|
{
|
|
@@ -1059,14 +1059,14 @@ async function handleNamedMonitorBatchSync(batchId, options) {
|
|
|
1059
1059
|
...parsedGeneration === void 0 ? {} : { expectedGeneration: parsedGeneration }
|
|
1060
1060
|
}
|
|
1061
1061
|
);
|
|
1062
|
-
|
|
1062
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
1063
1063
|
{ ...payload, idempotency_key: idempotencyKey },
|
|
1064
1064
|
{ json: options.json, text: renderMonitorJob(payload) }
|
|
1065
1065
|
);
|
|
1066
1066
|
}
|
|
1067
1067
|
async function handleNamedMonitorBatchLifecycle(batchId, intent, options) {
|
|
1068
1068
|
if (options.dryRun) {
|
|
1069
|
-
|
|
1069
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
1070
1070
|
{
|
|
1071
1071
|
ok: true,
|
|
1072
1072
|
dry_run: true,
|
|
@@ -1082,17 +1082,17 @@ async function handleNamedMonitorBatchLifecycle(batchId, intent, options) {
|
|
|
1082
1082
|
intent,
|
|
1083
1083
|
options.idempotencyKey
|
|
1084
1084
|
);
|
|
1085
|
-
const payload = await new (0,
|
|
1085
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.batches[intent](batchId, {
|
|
1086
1086
|
idempotencyKey
|
|
1087
1087
|
});
|
|
1088
|
-
|
|
1088
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
1089
1089
|
{ ...payload, idempotency_key: idempotencyKey },
|
|
1090
1090
|
{ json: options.json, text: renderMonitorJob(payload) }
|
|
1091
1091
|
);
|
|
1092
1092
|
}
|
|
1093
1093
|
async function handleNamedMonitorBatchGet(batchId, options) {
|
|
1094
|
-
const payload = await new (0,
|
|
1095
|
-
|
|
1094
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.batches.get(batchId);
|
|
1095
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, {
|
|
1096
1096
|
json: options.json,
|
|
1097
1097
|
text: renderMonitorJob(payload)
|
|
1098
1098
|
});
|
|
@@ -1106,7 +1106,7 @@ async function handleMonitorBatchLint(options) {
|
|
|
1106
1106
|
const result = _chunkIF75RD6Ujs.lintMonitorBatchInput.call(void 0,
|
|
1107
1107
|
readMonitorDefinitionsJsonFile(options.file)
|
|
1108
1108
|
);
|
|
1109
|
-
|
|
1109
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
1110
1110
|
{
|
|
1111
1111
|
ok: !result.issues.some((issue) => issue.severity === "error"),
|
|
1112
1112
|
...result.normalized ? { normalized: result.normalized } : {},
|
|
@@ -1126,7 +1126,7 @@ async function handleMonitorFleetLint(options) {
|
|
|
1126
1126
|
const result = _chunkC374C22Yjs.lintMonitorFleetInput.call(void 0,
|
|
1127
1127
|
readMonitorDefinitionsJsonFile(options.file)
|
|
1128
1128
|
);
|
|
1129
|
-
|
|
1129
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
1130
1130
|
{
|
|
1131
1131
|
ok: !result.issues.some((issue) => issue.severity === "error"),
|
|
1132
1132
|
...result.normalized ? { normalized: result.normalized } : {},
|
|
@@ -1138,32 +1138,32 @@ async function handleMonitorFleetLint(options) {
|
|
|
1138
1138
|
process.exitCode = 2;
|
|
1139
1139
|
}
|
|
1140
1140
|
async function handleMonitorJobGet(jobId, options) {
|
|
1141
|
-
const payload = await new (0,
|
|
1142
|
-
|
|
1141
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.jobs.get(jobId);
|
|
1142
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, {
|
|
1143
1143
|
json: options.json,
|
|
1144
1144
|
text: renderMonitorJob(payload)
|
|
1145
1145
|
});
|
|
1146
1146
|
}
|
|
1147
1147
|
async function handleMonitorJobWait(jobId, options) {
|
|
1148
|
-
const payload = await new (0,
|
|
1148
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.jobs.wait(jobId, {
|
|
1149
1149
|
timeoutMs: fleetTimeoutMs(options.timeout),
|
|
1150
1150
|
pollIntervalMs: FLEET_POLL_INTERVAL_MS
|
|
1151
1151
|
});
|
|
1152
|
-
|
|
1152
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, {
|
|
1153
1153
|
json: options.json,
|
|
1154
1154
|
text: renderMonitorJob(payload)
|
|
1155
1155
|
});
|
|
1156
1156
|
}
|
|
1157
1157
|
async function handleMonitorJobLogs(jobId, options) {
|
|
1158
1158
|
const limit = options.limit ? fleetIntegerOption(options.limit, "--limit") : void 0;
|
|
1159
|
-
const payload = await new (0,
|
|
1159
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.jobs.logs(jobId, {
|
|
1160
1160
|
...limit === void 0 ? {} : { limit }
|
|
1161
1161
|
});
|
|
1162
|
-
|
|
1162
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, { json: options.json });
|
|
1163
1163
|
}
|
|
1164
1164
|
async function handleMonitorJobCancel(jobId, options) {
|
|
1165
|
-
const payload = await new (0,
|
|
1166
|
-
|
|
1165
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.jobs.cancel(jobId);
|
|
1166
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, {
|
|
1167
1167
|
json: options.json,
|
|
1168
1168
|
text: renderMonitorJob(payload)
|
|
1169
1169
|
});
|
|
@@ -1472,7 +1472,7 @@ function renderFleetDeactivatePlan(payload, fleetId) {
|
|
|
1472
1472
|
`;
|
|
1473
1473
|
}
|
|
1474
1474
|
function reportFleetState(payload, error, options) {
|
|
1475
|
-
|
|
1475
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
1476
1476
|
{
|
|
1477
1477
|
...payload,
|
|
1478
1478
|
code: error.code,
|
|
@@ -1488,8 +1488,25 @@ Next: ${error.next}
|
|
|
1488
1488
|
);
|
|
1489
1489
|
process.exitCode = monitorsErrorExitCode(error);
|
|
1490
1490
|
}
|
|
1491
|
+
function fleetBillingSuspendedError(fleetId, payload, options) {
|
|
1492
|
+
const reason = asString(_optionalChain([asRecord, 'call', _31 => _31(payload.billing_suspension), 'optionalAccess', _32 => _32.reason]));
|
|
1493
|
+
const suspended = `Fleet ${fleetId} is suspended for billing${reason ? ` (${reason})` : ""}: its monitors are stopped`;
|
|
1494
|
+
if (_optionalChain([options, 'optionalAccess', _33 => _33.deactivating])) {
|
|
1495
|
+
const deactivateCommand = `deepline monitors fleets deactivate ${fleetShellArg(fleetId)} --yes --wait`;
|
|
1496
|
+
return new MonitorFleetStateError({
|
|
1497
|
+
code: "MONITOR_FLEET_BILLING_SUSPENDED",
|
|
1498
|
+
message: `${suspended}, but it is not deactivated. To finish, run: ${deactivateCommand}`,
|
|
1499
|
+
next: _nullishCoalesce(fleetServerNext(payload), () => ( deactivateCommand))
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1502
|
+
return new MonitorFleetStateError({
|
|
1503
|
+
code: "MONITOR_FLEET_BILLING_SUSPENDED",
|
|
1504
|
+
message: `${suspended}, and waiting will not restart them. Once the workspace can pay again, run: deepline monitors fleets reactivate ${fleetShellArg(fleetId)} --yes --wait`,
|
|
1505
|
+
next: _nullishCoalesce(fleetServerNext(payload), () => ( "deepline billing balance"))
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1491
1508
|
function fleetSourceTable(value) {
|
|
1492
|
-
const [schema, table, extra] = _nullishCoalesce(_optionalChain([value, 'optionalAccess',
|
|
1509
|
+
const [schema, table, extra] = _nullishCoalesce(_optionalChain([value, 'optionalAccess', _34 => _34.trim, 'call', _35 => _35(), 'access', _36 => _36.split, 'call', _37 => _37(".")]), () => ( []));
|
|
1493
1510
|
if (!schema || !table || extra || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(schema) || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(table)) {
|
|
1494
1511
|
throw new MonitorsUsageError(
|
|
1495
1512
|
"--source must be a Customer DB table in schema.table form."
|
|
@@ -1498,7 +1515,7 @@ function fleetSourceTable(value) {
|
|
|
1498
1515
|
return { schema, table };
|
|
1499
1516
|
}
|
|
1500
1517
|
function fleetColumnName(value, flag) {
|
|
1501
|
-
const name = _optionalChain([value, 'optionalAccess',
|
|
1518
|
+
const name = _optionalChain([value, 'optionalAccess', _38 => _38.trim, 'call', _39 => _39()]);
|
|
1502
1519
|
if (!name || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
|
|
1503
1520
|
throw new MonitorsUsageError(`${flag} must be a SQL column identifier.`);
|
|
1504
1521
|
}
|
|
@@ -1543,13 +1560,13 @@ async function handleMonitorFleetsInit(fleetId, options) {
|
|
|
1543
1560
|
}
|
|
1544
1561
|
const source = fleetSourceTable(options.source);
|
|
1545
1562
|
const key = fleetColumnName(options.key, "--key");
|
|
1546
|
-
const keyType = _nullishCoalesce(_optionalChain([options, 'access',
|
|
1563
|
+
const keyType = _nullishCoalesce(_optionalChain([options, 'access', _40 => _40.keyType, 'optionalAccess', _41 => _41.trim, 'call', _42 => _42()]), () => ( "text"));
|
|
1547
1564
|
if (!["text", "uuid", "int4", "int8"].includes(keyType)) {
|
|
1548
1565
|
throw new MonitorsUsageError(
|
|
1549
1566
|
"--key-type must be text, uuid, int4, or int8."
|
|
1550
1567
|
);
|
|
1551
1568
|
}
|
|
1552
|
-
const tool = _optionalChain([options, 'access',
|
|
1569
|
+
const tool = _optionalChain([options, 'access', _43 => _43.tool, 'optionalAccess', _44 => _44.trim, 'call', _45 => _45()]);
|
|
1553
1570
|
if (!tool) throw new MonitorsUsageError("--tool is required.");
|
|
1554
1571
|
if (!options.payload) {
|
|
1555
1572
|
throw new MonitorsUsageError(
|
|
@@ -1558,7 +1575,7 @@ async function handleMonitorFleetsInit(fleetId, options) {
|
|
|
1558
1575
|
}
|
|
1559
1576
|
const payload = parseJsonObjectArg(options.payload, "--payload");
|
|
1560
1577
|
const where = options.where ? parseJsonObjectArg(options.where, "--where") : void 0;
|
|
1561
|
-
const out = _optionalChain([options, 'access',
|
|
1578
|
+
const out = _optionalChain([options, 'access', _46 => _46.out, 'optionalAccess', _47 => _47.trim, 'call', _48 => _48()]);
|
|
1562
1579
|
if (!out) throw new MonitorsUsageError("--out is required.");
|
|
1563
1580
|
const authoredDefinition = {
|
|
1564
1581
|
version: 2,
|
|
@@ -1587,7 +1604,7 @@ async function handleMonitorFleetsInit(fleetId, options) {
|
|
|
1587
1604
|
_fs.writeFileSync.call(void 0, file, `${JSON.stringify(definition, null, 2)}
|
|
1588
1605
|
`, "utf8");
|
|
1589
1606
|
const next = `deepline monitors fleets deploy --file ${fleetShellArg(file)} --dry-run`;
|
|
1590
|
-
|
|
1607
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
1591
1608
|
{ schemaVersion: 2, file, definition, next },
|
|
1592
1609
|
{
|
|
1593
1610
|
json: options.json,
|
|
@@ -1627,8 +1644,8 @@ function fleetSyncCommandLine(target, options) {
|
|
|
1627
1644
|
}
|
|
1628
1645
|
async function handleMonitorFleetsSync(target, options, idempotencyKey) {
|
|
1629
1646
|
const fileDefinitions = options.file ? readMonitorDefinitionsJsonFile(options.file) : void 0;
|
|
1630
|
-
const usesDefinition = options.file !== void 0 || _optionalChain([target, 'optionalAccess',
|
|
1631
|
-
if (!usesDefinition && !_optionalChain([target, 'optionalAccess',
|
|
1647
|
+
const usesDefinition = options.file !== void 0 || _optionalChain([target, 'optionalAccess', _49 => _49.trim, 'call', _50 => _50(), 'access', _51 => _51.startsWith, 'call', _52 => _52("{")]) === true;
|
|
1648
|
+
if (!usesDefinition && !_optionalChain([target, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()])) {
|
|
1632
1649
|
throw new MonitorsUsageError(
|
|
1633
1650
|
"sync needs a fleet: pass --file fleet.json to apply a definition, or <fleet-id> to re-plan the stored one.\n deepline monitors fleets sync --file fleet.json --dry-run\n deepline monitors fleets sync <fleet-id> --dry-run"
|
|
1634
1651
|
);
|
|
@@ -1649,7 +1666,7 @@ async function handleMonitorFleetsSync(target, options, idempotencyKey) {
|
|
|
1649
1666
|
'The Fleet definition has no id. Add a top-level "id" and re-run.'
|
|
1650
1667
|
);
|
|
1651
1668
|
}
|
|
1652
|
-
const client = new (0,
|
|
1669
|
+
const client = new (0, _chunk2H4OFVR5js.DeeplineClient)();
|
|
1653
1670
|
const payload = await client.monitors.fleets.sync(
|
|
1654
1671
|
_nullishCoalesce(definition, () => ( fleetId)),
|
|
1655
1672
|
{
|
|
@@ -1671,7 +1688,7 @@ async function handleMonitorFleetsSync(target, options, idempotencyKey) {
|
|
|
1671
1688
|
}
|
|
1672
1689
|
const accepted = { ...payload, idempotency_key: idempotencyKey };
|
|
1673
1690
|
if (!options.wait || options.dryRun) {
|
|
1674
|
-
|
|
1691
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, accepted, {
|
|
1675
1692
|
json: options.json,
|
|
1676
1693
|
text: renderFleetSync(payload, {
|
|
1677
1694
|
fleetId,
|
|
@@ -1697,7 +1714,14 @@ async function handleMonitorFleetsSync(target, options, idempotencyKey) {
|
|
|
1697
1714
|
const status = fleetStatus(final);
|
|
1698
1715
|
const summary = renderFleetGet(final);
|
|
1699
1716
|
if (status === "converged") {
|
|
1700
|
-
|
|
1717
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, envelope, { json: options.json, text: summary });
|
|
1718
|
+
return;
|
|
1719
|
+
}
|
|
1720
|
+
if (status === "billing_suspended") {
|
|
1721
|
+
reportFleetState(envelope, fleetBillingSuspendedError(fleetId, final), {
|
|
1722
|
+
json: options.json,
|
|
1723
|
+
text: summary
|
|
1724
|
+
});
|
|
1701
1725
|
return;
|
|
1702
1726
|
}
|
|
1703
1727
|
const driftCommand = `deepline monitors fleets get ${fleetShellArg(fleetId)} --drift`;
|
|
@@ -1730,14 +1754,14 @@ async function handleMonitorFleetsGet(fleetId, options) {
|
|
|
1730
1754
|
);
|
|
1731
1755
|
}
|
|
1732
1756
|
const limit = options.limit === void 0 ? void 0 : fleetIntegerOption(options.limit, "--limit");
|
|
1733
|
-
const client = new (0,
|
|
1757
|
+
const client = new (0, _chunk2H4OFVR5js.DeeplineClient)();
|
|
1734
1758
|
const payload = await client.monitors.fleets.get(fleetId, {
|
|
1735
1759
|
...options.drift ? { drift: true } : {},
|
|
1736
1760
|
...limit !== void 0 ? { limit } : {}
|
|
1737
1761
|
});
|
|
1738
1762
|
const text = fleetId ? renderFleetGet(payload) : renderFleetList(payload);
|
|
1739
1763
|
if (!options.check) {
|
|
1740
|
-
|
|
1764
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, { json: options.json, text });
|
|
1741
1765
|
return;
|
|
1742
1766
|
}
|
|
1743
1767
|
const statuses = fleetId ? [fleetStatus(payload)] : (Array.isArray(payload.fleets) ? payload.fleets : []).map(
|
|
@@ -1745,7 +1769,7 @@ async function handleMonitorFleetsGet(fleetId, options) {
|
|
|
1745
1769
|
);
|
|
1746
1770
|
const unconverged = statuses.filter((status) => status !== "converged");
|
|
1747
1771
|
if (unconverged.length === 0) {
|
|
1748
|
-
|
|
1772
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, { json: options.json, text });
|
|
1749
1773
|
return;
|
|
1750
1774
|
}
|
|
1751
1775
|
const target = _nullishCoalesce(fleetId, () => ( "<fleet-id>"));
|
|
@@ -1784,13 +1808,13 @@ async function handleMonitorFleetsReactivate(fleetId, options, idempotencyKey) {
|
|
|
1784
1808
|
${fleetReactivateCommandLine(fleetId, options)}`
|
|
1785
1809
|
);
|
|
1786
1810
|
}
|
|
1787
|
-
const client = new (0,
|
|
1811
|
+
const client = new (0, _chunk2H4OFVR5js.DeeplineClient)();
|
|
1788
1812
|
const payload = await client.monitors.fleets.reactivate(fleetId, {
|
|
1789
1813
|
idempotencyKey
|
|
1790
1814
|
});
|
|
1791
1815
|
const accepted = { ...payload, idempotency_key: idempotencyKey };
|
|
1792
1816
|
if (!options.wait) {
|
|
1793
|
-
|
|
1817
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, accepted, {
|
|
1794
1818
|
json: options.json,
|
|
1795
1819
|
text: `Fleet ${fleetId} \u2014 ${readMonitorState(payload) ? `state ${readMonitorState(payload)}` : "reactivation accepted"}
|
|
1796
1820
|
idempotency key ${idempotencyKey}
|
|
@@ -1813,7 +1837,14 @@ async function handleMonitorFleetsReactivate(fleetId, options, idempotencyKey) {
|
|
|
1813
1837
|
const envelope = { ...accepted, ...final };
|
|
1814
1838
|
const text = renderFleetGet(final);
|
|
1815
1839
|
if (fleetStatus(final) === "converged") {
|
|
1816
|
-
|
|
1840
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, envelope, { json: options.json, text });
|
|
1841
|
+
return;
|
|
1842
|
+
}
|
|
1843
|
+
if (fleetStatus(final) === "billing_suspended") {
|
|
1844
|
+
reportFleetState(envelope, fleetBillingSuspendedError(fleetId, final), {
|
|
1845
|
+
json: options.json,
|
|
1846
|
+
text
|
|
1847
|
+
});
|
|
1817
1848
|
return;
|
|
1818
1849
|
}
|
|
1819
1850
|
reportFleetState(
|
|
@@ -1855,7 +1886,7 @@ async function confirmFleetDeactivate(fleetId, plan) {
|
|
|
1855
1886
|
}
|
|
1856
1887
|
}
|
|
1857
1888
|
async function handleMonitorFleetsDeactivate(fleetId, options, idempotencyKey) {
|
|
1858
|
-
const client = new (0,
|
|
1889
|
+
const client = new (0, _chunk2H4OFVR5js.DeeplineClient)();
|
|
1859
1890
|
if (options.dryRun) {
|
|
1860
1891
|
const plan = await client.monitors.fleets.deactivate(fleetId, {
|
|
1861
1892
|
dryRun: true,
|
|
@@ -1865,7 +1896,7 @@ async function handleMonitorFleetsDeactivate(fleetId, options, idempotencyKey) {
|
|
|
1865
1896
|
command: "deepline monitors fleets deactivate",
|
|
1866
1897
|
mutation: "fleet deactivate"
|
|
1867
1898
|
});
|
|
1868
|
-
|
|
1899
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, plan, {
|
|
1869
1900
|
json: options.json,
|
|
1870
1901
|
text: renderFleetDeactivatePlan(plan, fleetId)
|
|
1871
1902
|
});
|
|
@@ -1903,7 +1934,7 @@ Preview the blast radius first:
|
|
|
1903
1934
|
});
|
|
1904
1935
|
const accepted = { ...payload, idempotency_key: idempotencyKey };
|
|
1905
1936
|
if (payload.already === true) {
|
|
1906
|
-
|
|
1937
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, accepted, {
|
|
1907
1938
|
json: options.json,
|
|
1908
1939
|
text: `Fleet ${fleetId} is already deactivated.
|
|
1909
1940
|
`
|
|
@@ -1915,7 +1946,7 @@ Preview the blast radius first:
|
|
|
1915
1946
|
` + (fleetServerNext(payload) ? `Next: ${fleetServerNext(payload)}
|
|
1916
1947
|
` : "");
|
|
1917
1948
|
if (!options.wait) {
|
|
1918
|
-
|
|
1949
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, accepted, {
|
|
1919
1950
|
json: options.json,
|
|
1920
1951
|
text: acceptedText
|
|
1921
1952
|
});
|
|
@@ -1937,7 +1968,15 @@ Preview the blast radius first:
|
|
|
1937
1968
|
const envelope = { ...accepted, ...final };
|
|
1938
1969
|
const summary = renderFleetGet(final);
|
|
1939
1970
|
if (fleetStatus(final) === "deactivated") {
|
|
1940
|
-
|
|
1971
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, envelope, { json: options.json, text: summary });
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1974
|
+
if (fleetStatus(final) === "billing_suspended") {
|
|
1975
|
+
reportFleetState(
|
|
1976
|
+
envelope,
|
|
1977
|
+
fleetBillingSuspendedError(fleetId, final, { deactivating: true }),
|
|
1978
|
+
{ json: options.json, text: summary }
|
|
1979
|
+
);
|
|
1941
1980
|
return;
|
|
1942
1981
|
}
|
|
1943
1982
|
reportFleetState(
|
|
@@ -1968,7 +2007,7 @@ function handleMonitorFleetsOverview(options) {
|
|
|
1968
2007
|
"Agent notes:",
|
|
1969
2008
|
...MONITOR_FLEET_AGENT_NOTES.map((note) => ` ${note}`)
|
|
1970
2009
|
];
|
|
1971
|
-
|
|
2010
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
1972
2011
|
{
|
|
1973
2012
|
schemaVersion: 1,
|
|
1974
2013
|
lifecycle: MONITOR_FLEET_LIFECYCLE,
|
|
@@ -2025,8 +2064,8 @@ function renderMonitorGet(payload) {
|
|
|
2025
2064
|
}
|
|
2026
2065
|
for (const raw of Array.isArray(guidance.documentation) ? guidance.documentation : []) {
|
|
2027
2066
|
const doc = asRecord(raw);
|
|
2028
|
-
const label = asString(_optionalChain([doc, 'optionalAccess',
|
|
2029
|
-
const url = asString(_optionalChain([doc, 'optionalAccess',
|
|
2067
|
+
const label = asString(_optionalChain([doc, 'optionalAccess', _55 => _55.label]));
|
|
2068
|
+
const url = asString(_optionalChain([doc, 'optionalAccess', _56 => _56.url]));
|
|
2030
2069
|
if (label && url) lines.push(` Docs: ${label} \u2014 ${url}`);
|
|
2031
2070
|
}
|
|
2032
2071
|
const payloadExample = asRecord(guidance.payload_example);
|
|
@@ -2043,20 +2082,20 @@ function renderMonitorGet(payload) {
|
|
|
2043
2082
|
);
|
|
2044
2083
|
}
|
|
2045
2084
|
const monitorSpec = asRecord(payload.monitor_spec);
|
|
2046
|
-
if (_optionalChain([monitorSpec, 'optionalAccess',
|
|
2085
|
+
if (_optionalChain([monitorSpec, 'optionalAccess', _57 => _57.available]) === false) {
|
|
2047
2086
|
lines.push(
|
|
2048
2087
|
"",
|
|
2049
2088
|
`Monitor spec: unavailable \u2014 ${_nullishCoalesce(asString(monitorSpec.message), () => ( "use the stored definition and check before an update."))}`
|
|
2050
2089
|
);
|
|
2051
2090
|
}
|
|
2052
|
-
const specFields = Array.isArray(_optionalChain([monitorSpec, 'optionalAccess',
|
|
2091
|
+
const specFields = Array.isArray(_optionalChain([monitorSpec, 'optionalAccess', _58 => _58.fields])) ? monitorSpec.fields.flatMap((value) => {
|
|
2053
2092
|
const field = asRecord(value);
|
|
2054
|
-
const path = asString(_optionalChain([field, 'optionalAccess',
|
|
2055
|
-
const description = asString(_optionalChain([field, 'optionalAccess',
|
|
2056
|
-
const semantics = asString(_optionalChain([field, 'optionalAccess',
|
|
2057
|
-
const applicability = asString(_optionalChain([field, 'optionalAccess',
|
|
2058
|
-
const grammar = asRecord(_optionalChain([field, 'optionalAccess',
|
|
2059
|
-
const grammarSyntax = asString(_optionalChain([grammar, 'optionalAccess',
|
|
2093
|
+
const path = asString(_optionalChain([field, 'optionalAccess', _59 => _59.path]));
|
|
2094
|
+
const description = asString(_optionalChain([field, 'optionalAccess', _60 => _60.description]));
|
|
2095
|
+
const semantics = asString(_optionalChain([field, 'optionalAccess', _61 => _61.semantics]));
|
|
2096
|
+
const applicability = asString(_optionalChain([field, 'optionalAccess', _62 => _62.applicability]));
|
|
2097
|
+
const grammar = asRecord(_optionalChain([field, 'optionalAccess', _63 => _63.grammar]));
|
|
2098
|
+
const grammarSyntax = asString(_optionalChain([grammar, 'optionalAccess', _64 => _64.syntax]));
|
|
2060
2099
|
return path ? [
|
|
2061
2100
|
{
|
|
2062
2101
|
path,
|
|
@@ -2092,10 +2131,10 @@ function renderMonitorGet(payload) {
|
|
|
2092
2131
|
const name = _nullishCoalesce(asString(play.name), () => ( "unnamed Play"));
|
|
2093
2132
|
const listener = asString(play.listener_key);
|
|
2094
2133
|
const health = asRecord(play.consumer_health);
|
|
2095
|
-
const runStatus = asString(_optionalChain([health, 'optionalAccess',
|
|
2096
|
-
const lastDelivery = asFiniteNumber(_optionalChain([health, 'optionalAccess',
|
|
2097
|
-
const runId = asString(_optionalChain([health, 'optionalAccess',
|
|
2098
|
-
const error = asString(_optionalChain([health, 'optionalAccess',
|
|
2134
|
+
const runStatus = asString(_optionalChain([health, 'optionalAccess', _65 => _65.last_run_status]));
|
|
2135
|
+
const lastDelivery = asFiniteNumber(_optionalChain([health, 'optionalAccess', _66 => _66.last_delivery_at]));
|
|
2136
|
+
const runId = asString(_optionalChain([health, 'optionalAccess', _67 => _67.last_run_id]));
|
|
2137
|
+
const error = asString(_optionalChain([health, 'optionalAccess', _68 => _68.last_error]));
|
|
2099
2138
|
lines.push(` ${name}${listener ? ` (listener: ${listener})` : ""}:`);
|
|
2100
2139
|
lines.push(
|
|
2101
2140
|
` Latest delivered event: ${lastDelivery !== void 0 ? new Date(lastDelivery).toISOString() : "never"}`,
|
|
@@ -2122,14 +2161,14 @@ function renderMonitorGet(payload) {
|
|
|
2122
2161
|
);
|
|
2123
2162
|
}
|
|
2124
2163
|
}
|
|
2125
|
-
if (_optionalChain([dependents, 'optionalAccess',
|
|
2164
|
+
if (_optionalChain([dependents, 'optionalAccess', _69 => _69.truncated]) === true) {
|
|
2126
2165
|
lines.push(" Results are truncated.");
|
|
2127
2166
|
}
|
|
2128
2167
|
return `${lines.join("\n")}
|
|
2129
2168
|
`;
|
|
2130
2169
|
}
|
|
2131
2170
|
async function handleMonitorsGet(key, options) {
|
|
2132
|
-
const client = new (0,
|
|
2171
|
+
const client = new (0, _chunk2H4OFVR5js.DeeplineClient)();
|
|
2133
2172
|
const payload = await client.monitors.get(key);
|
|
2134
2173
|
const boundPlays = Array.isArray(payload.bound_plays) ? payload.bound_plays : null;
|
|
2135
2174
|
const dependents = boundPlays ? {
|
|
@@ -2137,24 +2176,24 @@ async function handleMonitorsGet(key, options) {
|
|
|
2137
2176
|
truncated: payload.consumer_health_truncated === true
|
|
2138
2177
|
} : await client.monitors.dependents(key);
|
|
2139
2178
|
const detail = { ...payload, dependents };
|
|
2140
|
-
|
|
2179
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, detail, {
|
|
2141
2180
|
json: options.json,
|
|
2142
2181
|
text: renderMonitorGet(detail)
|
|
2143
2182
|
});
|
|
2144
2183
|
}
|
|
2145
2184
|
async function handleMonitorsTest(key, payload, options) {
|
|
2146
2185
|
const explicitPayload = parseJsonObjectArg(payload, "<payload>");
|
|
2147
|
-
const result = await new (0,
|
|
2186
|
+
const result = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.test(key, explicitPayload);
|
|
2148
2187
|
const text = `Monitor diagnostic for ${key}: ${result.accepted === true ? "accepted" : "rejected"}
|
|
2149
2188
|
mode: validation_only (no rows written, credits spent, or Plays dispatched)
|
|
2150
2189
|
persisted rows: ${_nullishCoalesce(asFiniteNumber(result.persisted_rows), () => ( 0))}
|
|
2151
2190
|
dispatched bound Plays: ${_nullishCoalesce(asFiniteNumber(result.dispatched_bound_plays), () => ( 0))}
|
|
2152
2191
|
`;
|
|
2153
|
-
|
|
2192
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, result, { json: options.json, text });
|
|
2154
2193
|
}
|
|
2155
2194
|
async function handleMonitorsValidate(key, options) {
|
|
2156
|
-
const result = await new (0,
|
|
2157
|
-
|
|
2195
|
+
const result = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.validate(key);
|
|
2196
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, result, { json: options.json });
|
|
2158
2197
|
if (result.valid === false) process.exitCode = 7;
|
|
2159
2198
|
}
|
|
2160
2199
|
async function confirmMonitorDelete(key) {
|
|
@@ -2172,14 +2211,14 @@ async function confirmMonitorDelete(key) {
|
|
|
2172
2211
|
}
|
|
2173
2212
|
}
|
|
2174
2213
|
async function handleMonitorsDelete(key, options) {
|
|
2175
|
-
const client = new (0,
|
|
2214
|
+
const client = new (0, _chunk2H4OFVR5js.DeeplineClient)();
|
|
2176
2215
|
if (options.dryRun) {
|
|
2177
2216
|
const payload2 = await client.monitors.delete(key, { dryRun: true });
|
|
2178
2217
|
assertMonitorDryRunAcknowledged(payload2, {
|
|
2179
2218
|
command: "deepline monitors delete",
|
|
2180
2219
|
mutation: "delete"
|
|
2181
2220
|
});
|
|
2182
|
-
|
|
2221
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload2, {
|
|
2183
2222
|
json: options.json,
|
|
2184
2223
|
text: renderMonitorDeletePlan(payload2, key)
|
|
2185
2224
|
});
|
|
@@ -2199,7 +2238,7 @@ async function handleMonitorsDelete(key, options) {
|
|
|
2199
2238
|
}
|
|
2200
2239
|
}
|
|
2201
2240
|
const payload = await client.monitors.delete(key);
|
|
2202
|
-
|
|
2241
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, { json: options.json });
|
|
2203
2242
|
}
|
|
2204
2243
|
async function handleMonitorsUpdate(key, patch, options) {
|
|
2205
2244
|
const body = resolveMonitorJsonBody({
|
|
@@ -2208,29 +2247,29 @@ async function handleMonitorsUpdate(key, patch, options) {
|
|
|
2208
2247
|
argLabel: "<patch>",
|
|
2209
2248
|
command: `deepline monitors update ${key}`
|
|
2210
2249
|
});
|
|
2211
|
-
const payload = await new (0,
|
|
2212
|
-
|
|
2250
|
+
const payload = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.update(key, body);
|
|
2251
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, { json: options.json });
|
|
2213
2252
|
}
|
|
2214
2253
|
async function handleMonitorsReactivate(key, options) {
|
|
2215
|
-
const client = new (0,
|
|
2254
|
+
const client = new (0, _chunk2H4OFVR5js.DeeplineClient)();
|
|
2216
2255
|
if (options.dryRun) {
|
|
2217
2256
|
const payload2 = await client.monitors.reactivate(key, { dryRun: true });
|
|
2218
2257
|
assertMonitorDryRunAcknowledged(payload2, {
|
|
2219
2258
|
command: "deepline monitors reactivate",
|
|
2220
2259
|
mutation: "reactivate"
|
|
2221
2260
|
});
|
|
2222
|
-
|
|
2261
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload2, {
|
|
2223
2262
|
json: options.json,
|
|
2224
2263
|
text: renderMonitorReactivatePlan(payload2, key)
|
|
2225
2264
|
});
|
|
2226
2265
|
return;
|
|
2227
2266
|
}
|
|
2228
2267
|
const payload = await client.monitors.reactivate(key);
|
|
2229
|
-
|
|
2268
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, payload, { json: options.json });
|
|
2230
2269
|
}
|
|
2231
2270
|
var MONITOR_VERB_POLL_INTERVAL_MS = 2e3;
|
|
2232
2271
|
function monitorHealthLine(health) {
|
|
2233
|
-
if (_optionalChain([health, 'access',
|
|
2272
|
+
if (_optionalChain([health, 'access', _70 => _70.refresh, 'optionalAccess', _71 => _71.state]) === "running") {
|
|
2234
2273
|
return `refreshing whole scope \xB7 scanned ${health.scanned} so far`;
|
|
2235
2274
|
}
|
|
2236
2275
|
const alignmentRequired = _nullishCoalesce(health.alignment_required, () => ( 0));
|
|
@@ -2275,7 +2314,7 @@ async function watchMonitorHealth(input) {
|
|
|
2275
2314
|
while (Date.now() < deadlineAt) {
|
|
2276
2315
|
const unresolved = last.observed.unknown + last.observed.unset;
|
|
2277
2316
|
const alignmentRequired = _nullishCoalesce(last.alignment_required, () => ( 0));
|
|
2278
|
-
if (_optionalChain([last, 'access',
|
|
2317
|
+
if (_optionalChain([last, 'access', _72 => _72.refresh, 'optionalAccess', _73 => _73.state]) !== "running" && !last.truncated && last.needs_repair === 0 && (unresolved === 0 || alignmentRequired === unresolved)) {
|
|
2279
2318
|
return last;
|
|
2280
2319
|
}
|
|
2281
2320
|
await new Promise(
|
|
@@ -2287,13 +2326,13 @@ async function watchMonitorHealth(input) {
|
|
|
2287
2326
|
return last;
|
|
2288
2327
|
}
|
|
2289
2328
|
function monitorHealthText(health) {
|
|
2290
|
-
const partial = _optionalChain([health, 'access',
|
|
2329
|
+
const partial = _optionalChain([health, 'access', _74 => _74.refresh, 'optionalAccess', _75 => _75.state]) === "running" ? " (refreshing \u2014 counts below are not final)" : health.truncated ? " (partial \u2014 scope larger than one read)" : "";
|
|
2291
2330
|
const unauditedMonitors = _nullishCoalesce(health.unaudited_monitors, () => ( []));
|
|
2292
2331
|
const lines = [
|
|
2293
2332
|
`scope: ${_nullishCoalesce(health.scope.fleet_id, () => ( "workspace"))}${partial}`,
|
|
2294
2333
|
monitorHealthLine(health)
|
|
2295
2334
|
];
|
|
2296
|
-
if ((_nullishCoalesce(_optionalChain([health, 'access',
|
|
2335
|
+
if ((_nullishCoalesce(_optionalChain([health, 'access', _76 => _76.batch_operations, 'optionalAccess', _77 => _77.length]), () => ( 0))) > 0) {
|
|
2297
2336
|
lines.push("");
|
|
2298
2337
|
lines.push("batch work in progress:");
|
|
2299
2338
|
for (const operation of _nullishCoalesce(health.batch_operations, () => ( []))) {
|
|
@@ -2348,8 +2387,8 @@ function monitorHealthText(health) {
|
|
|
2348
2387
|
`;
|
|
2349
2388
|
}
|
|
2350
2389
|
async function handleMonitorsAudit(options) {
|
|
2351
|
-
const client = new (0,
|
|
2352
|
-
const fleetId = _optionalChain([options, 'access',
|
|
2390
|
+
const client = new (0, _chunk2H4OFVR5js.DeeplineClient)();
|
|
2391
|
+
const fleetId = _optionalChain([options, 'access', _78 => _78.fleet, 'optionalAccess', _79 => _79.trim, 'call', _80 => _80()]) || void 0;
|
|
2353
2392
|
const scope = fleetId ? { fleetId } : {};
|
|
2354
2393
|
let result = await client.monitors.audit(scope);
|
|
2355
2394
|
const passes = [result.audit];
|
|
@@ -2392,7 +2431,7 @@ async function handleMonitorsAudit(options) {
|
|
|
2392
2431
|
"",
|
|
2393
2432
|
monitorHealthText(health)
|
|
2394
2433
|
].join("\n");
|
|
2395
|
-
|
|
2434
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
2396
2435
|
{ ...result, audit: { ...result.audit, totals }, health },
|
|
2397
2436
|
{ json: options.json, text }
|
|
2398
2437
|
);
|
|
@@ -2400,15 +2439,15 @@ async function handleMonitorsAudit(options) {
|
|
|
2400
2439
|
async function handleMonitorsRepair(options) {
|
|
2401
2440
|
return await handleMonitorBatch("repair", {
|
|
2402
2441
|
...options,
|
|
2403
|
-
..._optionalChain([options, 'access',
|
|
2442
|
+
..._optionalChain([options, 'access', _81 => _81.fleet, 'optionalAccess', _82 => _82.trim, 'call', _83 => _83()]) ? {} : { target: "needs-repair" }
|
|
2404
2443
|
});
|
|
2405
2444
|
}
|
|
2406
2445
|
async function handleMonitorsHealth(options) {
|
|
2407
|
-
const fleetId = _optionalChain([options, 'access',
|
|
2408
|
-
const health = await new (0,
|
|
2446
|
+
const fleetId = _optionalChain([options, 'access', _84 => _84.fleet, 'optionalAccess', _85 => _85.trim, 'call', _86 => _86()]) || void 0;
|
|
2447
|
+
const health = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.health(
|
|
2409
2448
|
fleetId ? { fleetId } : {}
|
|
2410
2449
|
);
|
|
2411
|
-
|
|
2450
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, health, {
|
|
2412
2451
|
json: options.json,
|
|
2413
2452
|
text: monitorHealthText(health)
|
|
2414
2453
|
});
|
|
@@ -2416,8 +2455,8 @@ async function handleMonitorsHealth(options) {
|
|
|
2416
2455
|
function monitorBatchScope(options, kind) {
|
|
2417
2456
|
const selectors = [
|
|
2418
2457
|
options.target ? "target" : null,
|
|
2419
|
-
_optionalChain([options, 'access',
|
|
2420
|
-
_optionalChain([options, 'access',
|
|
2458
|
+
_optionalChain([options, 'access', _87 => _87.fleet, 'optionalAccess', _88 => _88.trim, 'call', _89 => _89()]) ? "fleet" : null,
|
|
2459
|
+
_optionalChain([options, 'access', _90 => _90.keys, 'optionalAccess', _91 => _91.trim, 'call', _92 => _92()]) ? "keys" : null
|
|
2421
2460
|
].filter((value) => value !== null);
|
|
2422
2461
|
if (selectors.length === 0 && kind === "audit") {
|
|
2423
2462
|
return { kind: "target", target: "all" };
|
|
@@ -2428,7 +2467,7 @@ function monitorBatchScope(options, kind) {
|
|
|
2428
2467
|
);
|
|
2429
2468
|
}
|
|
2430
2469
|
if (options.target) return { kind: "target", target: options.target };
|
|
2431
|
-
if (_optionalChain([options, 'access',
|
|
2470
|
+
if (_optionalChain([options, 'access', _93 => _93.fleet, 'optionalAccess', _94 => _94.trim, 'call', _95 => _95()]))
|
|
2432
2471
|
return { kind: "fleet", fleetId: options.fleet.trim() };
|
|
2433
2472
|
const monitorKeys = (_nullishCoalesce(options.keys, () => ( ""))).split(",").map((key) => key.trim()).filter(Boolean);
|
|
2434
2473
|
if (monitorKeys.length === 0) {
|
|
@@ -2439,7 +2478,7 @@ function monitorBatchScope(options, kind) {
|
|
|
2439
2478
|
return { kind: "keys", monitorKeys };
|
|
2440
2479
|
}
|
|
2441
2480
|
function monitorBatchIdempotencyKey(kind, value) {
|
|
2442
|
-
return _optionalChain([value, 'optionalAccess',
|
|
2481
|
+
return _optionalChain([value, 'optionalAccess', _96 => _96.trim, 'call', _97 => _97()]) || `monitor-batch-${kind}-${_crypto.randomUUID.call(void 0, )}`;
|
|
2443
2482
|
}
|
|
2444
2483
|
function isCanonicalBatchJsonDocument(raw) {
|
|
2445
2484
|
try {
|
|
@@ -2452,7 +2491,7 @@ function isCanonicalBatchJsonDocument(raw) {
|
|
|
2452
2491
|
}
|
|
2453
2492
|
}
|
|
2454
2493
|
async function handleMonitorBatchDeploy(options) {
|
|
2455
|
-
if (!_optionalChain([options, 'access',
|
|
2494
|
+
if (!_optionalChain([options, 'access', _98 => _98.file, 'optionalAccess', _99 => _99.trim, 'call', _100 => _100()])) {
|
|
2456
2495
|
throw new MonitorsUsageError(
|
|
2457
2496
|
"monitors batch deploy requires --file <monitors.ndjson>."
|
|
2458
2497
|
);
|
|
@@ -2482,14 +2521,14 @@ async function handleMonitorBatchDeploy(options) {
|
|
|
2482
2521
|
"deploy",
|
|
2483
2522
|
options.idempotencyKey
|
|
2484
2523
|
);
|
|
2485
|
-
const result = await new (0,
|
|
2524
|
+
const result = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.batch.submit({
|
|
2486
2525
|
kind: "deploy",
|
|
2487
2526
|
manifestNdjson,
|
|
2488
2527
|
dryRun: options.dryRun === true,
|
|
2489
2528
|
idempotencyKey
|
|
2490
2529
|
});
|
|
2491
2530
|
const operation = result.operation;
|
|
2492
|
-
|
|
2531
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
2493
2532
|
{ ...result, idempotency_key: idempotencyKey },
|
|
2494
2533
|
{
|
|
2495
2534
|
json: options.json,
|
|
@@ -2508,7 +2547,7 @@ async function handleMonitorBatch(kind, options) {
|
|
|
2508
2547
|
);
|
|
2509
2548
|
}
|
|
2510
2549
|
const scope = monitorBatchScope(options, kind);
|
|
2511
|
-
if (kind === "deactivate" && scope.kind === "target" && !_optionalChain([options, 'access',
|
|
2550
|
+
if (kind === "deactivate" && scope.kind === "target" && !_optionalChain([options, 'access', _101 => _101.reason, 'optionalAccess', _102 => _102.trim, 'call', _103 => _103()])) {
|
|
2512
2551
|
throw new MonitorsUsageError(
|
|
2513
2552
|
"monitors batch deactivate --target requires --reason (for example insufficient_balance or billing_failure). Omit --reason with --keys for a customer-requested teardown."
|
|
2514
2553
|
);
|
|
@@ -2517,11 +2556,11 @@ async function handleMonitorBatch(kind, options) {
|
|
|
2517
2556
|
kind,
|
|
2518
2557
|
options.idempotencyKey
|
|
2519
2558
|
);
|
|
2520
|
-
const result = await new (0,
|
|
2559
|
+
const result = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.batch.submit({
|
|
2521
2560
|
kind,
|
|
2522
2561
|
scope,
|
|
2523
2562
|
dryRun: options.dryRun === true,
|
|
2524
|
-
..._optionalChain([options, 'access',
|
|
2563
|
+
..._optionalChain([options, 'access', _104 => _104.reason, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()]) ? { deactivationReason: options.reason.trim() } : {},
|
|
2525
2564
|
idempotencyKey
|
|
2526
2565
|
});
|
|
2527
2566
|
const operation = result.operation;
|
|
@@ -2530,14 +2569,14 @@ async function handleMonitorBatch(kind, options) {
|
|
|
2530
2569
|
`state ${operation.state} \xB7 retry key ${idempotencyKey}`,
|
|
2531
2570
|
`inspect: deepline monitors batch get ${operation.runId}`
|
|
2532
2571
|
].join("\n");
|
|
2533
|
-
|
|
2572
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0,
|
|
2534
2573
|
{ ...result, idempotency_key: idempotencyKey },
|
|
2535
2574
|
{ json: options.json, text: `${text}
|
|
2536
2575
|
` }
|
|
2537
2576
|
);
|
|
2538
2577
|
}
|
|
2539
2578
|
async function handleMonitorBatchGet(operationId, options) {
|
|
2540
|
-
const result = await new (0,
|
|
2579
|
+
const result = await new (0, _chunk2H4OFVR5js.DeeplineClient)().monitors.batch.get(operationId, {
|
|
2541
2580
|
...options.cursor ? { cursor: options.cursor } : {}
|
|
2542
2581
|
});
|
|
2543
2582
|
const summary = _nullishCoalesce(result.operation.summary, () => ( {}));
|
|
@@ -2549,7 +2588,7 @@ async function handleMonitorBatchGet(operationId, options) {
|
|
|
2549
2588
|
`results ${result.results.page.length}${result.results.isDone ? "" : " (more; pass --cursor)"}`
|
|
2550
2589
|
] : []
|
|
2551
2590
|
].join("\n");
|
|
2552
|
-
|
|
2591
|
+
_chunk2I7VN65Hjs.printCommandEnvelope.call(void 0, result, { json: options.json, text: `${text}
|
|
2553
2592
|
` });
|
|
2554
2593
|
}
|
|
2555
2594
|
function registerMonitorsCommands(program) {
|
|
@@ -3235,7 +3274,8 @@ Notes:
|
|
|
3235
3274
|
never becomes a request. A bare <fleet-id> re-plans the stored definition.
|
|
3236
3275
|
The plan always shows blocked members; they are never hidden.
|
|
3237
3276
|
--wait polls until Deepline reports a terminal status: converged exits 0,
|
|
3238
|
-
degraded exits 6, and a timeout exits 6
|
|
3277
|
+
degraded or billing_suspended exits 6 at once, and a timeout exits 6
|
|
3278
|
+
without implying anything broke.
|
|
3239
3279
|
Progress goes to stderr, so stdout stays exactly one JSON object.
|
|
3240
3280
|
|
|
3241
3281
|
Examples:
|