deepline 0.3.504 → 0.3.506
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 +121 -5
- package/dist/bundling-sources/sdk/src/index.ts +3 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +5 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/issues.ts +176 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +17 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/overview.ts +118 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +29 -1
- package/dist/bundling-sources/shared_libs/monitors/legacy-radar-retirement.ts +29 -10
- package/dist/bundling-sources/shared_libs/monitors/package.json +4 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +9 -9
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +52 -5
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +48 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +157 -47
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +36 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-gateway-egress.ts +55 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +66 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +18 -0
- package/dist/bundling-sources/shared_libs/product-notifications/onboarding-unsubscribe.ts +23 -0
- package/dist/cli/auth-MMHG2OFE.js +43 -0
- package/dist/cli/{auth-3L5AA5AX.mjs → auth-ZHFONT2D.mjs} +5 -5
- package/dist/cli/{billing-HOGXVE2V.js → billing-3Z7N4WTL.js} +101 -91
- package/dist/cli/{billing-E7EASVPO.mjs → billing-B2YEMNHE.mjs} +27 -17
- package/dist/cli/{chunk-UXQQPMYO.js → chunk-26DJ4BDY.js} +2 -2
- package/dist/cli/{chunk-3MLFFWDM.mjs → chunk-2CFTDVEP.mjs} +2 -2
- package/dist/cli/{chunk-QOLX2O2S.mjs → chunk-2IXXB7OA.mjs} +93 -34
- package/dist/cli/{chunk-6JNBMTCZ.js → chunk-2OY5DXTC.js} +1 -1
- package/dist/cli/{chunk-SVFTZTCI.mjs → chunk-3BFZEHBH.mjs} +1 -1
- package/dist/cli/{chunk-67OI26OE.js → chunk-3F676QXJ.js} +96 -37
- package/dist/cli/{chunk-KCKAFTPY.js → chunk-5ARG7J7A.js} +6 -6
- package/dist/cli/{chunk-5CHBIJIM.mjs → chunk-6RYVIZRP.mjs} +2 -2
- package/dist/cli/{chunk-QKKU2FH4.js → chunk-75NAFY36.js} +7 -7
- package/dist/cli/{chunk-7P2QVMBP.js → chunk-AD2WJUZA.js} +91 -48
- package/dist/cli/{chunk-UFYJTRSF.mjs → chunk-AFSYNOG4.mjs} +42 -7
- package/dist/cli/{chunk-VJVJWZ6I.mjs → chunk-BJ5OX62J.mjs} +5 -5
- package/dist/cli/{chunk-HUX5DZO6.mjs → chunk-BQBPVUFJ.mjs} +3 -3
- package/dist/cli/{chunk-MLMWM5DV.mjs → chunk-CHGRURBN.mjs} +5 -5
- package/dist/cli/{chunk-22OCKCYS.mjs → chunk-D7OCORZ7.mjs} +1 -1
- package/dist/cli/{chunk-SMSQVRHE.js → chunk-DB54ROPH.js} +5 -5
- package/dist/cli/{chunk-KGUGNEKL.js → chunk-E554XCJI.js} +96 -96
- package/dist/cli/{chunk-GGBXNQCR.mjs → chunk-EN7GXLFX.mjs} +4 -4
- package/dist/cli/{chunk-2W77YCKH.js → chunk-F53SGS3C.js} +5 -5
- package/dist/cli/{chunk-6SMR7LU7.js → chunk-F7IQQYKV.js} +2 -2
- package/dist/cli/chunk-FFGQR5J3.mjs +405 -0
- package/dist/cli/{chunk-UJMBG5JU.js → chunk-FWSEGIT6.js} +4 -4
- package/dist/cli/{chunk-GJ2DA35C.js → chunk-GDHLL5EQ.js} +42 -7
- package/dist/cli/{chunk-XHZSPMNC.mjs → chunk-GJNIC2CO.mjs} +84 -441
- package/dist/cli/chunk-GRESJ3H3.js +405 -0
- package/dist/cli/{chunk-WZSFIJMG.js → chunk-HINTYT5H.js} +113 -470
- package/dist/cli/{chunk-A6LA42JY.js → chunk-LRSRJJPD.js} +16 -16
- package/dist/cli/{chunk-WBIDPDKJ.js → chunk-MHRR47VQ.js} +3 -3
- package/dist/cli/{chunk-FTRVCIGC.js → chunk-N7G36GXB.js} +26 -26
- package/dist/cli/{chunk-BTWUNKKX.mjs → chunk-ND4WPLTE.mjs} +2 -2
- package/dist/cli/{chunk-NZ7Z7WNM.mjs → chunk-O4DZG4VA.mjs} +2 -2
- package/dist/cli/{chunk-LHXYCZYO.js → chunk-OD6TASBP.js} +8 -8
- package/dist/cli/{chunk-GRAGUYIE.js → chunk-OHNMJ5XQ.js} +41 -41
- package/dist/cli/{chunk-OX2D6BG4.mjs → chunk-ONBXTEFQ.mjs} +46 -3
- package/dist/cli/{chunk-7F4OEHQK.mjs → chunk-OPBXKB57.mjs} +1 -1
- package/dist/cli/{chunk-Y7VEHKID.mjs → chunk-OUGJUM5X.mjs} +6 -6
- package/dist/cli/{chunk-USTJEEND.js → chunk-PRIHD5XS.js} +9 -9
- package/dist/cli/{chunk-IGNQKOWT.mjs → chunk-QAY5AS2H.mjs} +12 -12
- package/dist/cli/{chunk-5Z6EULD5.js → chunk-QP333GFE.js} +7 -7
- package/dist/cli/{chunk-JPR2546F.js → chunk-SUJIVF6L.js} +16 -16
- package/dist/cli/{chunk-DEAJVQEG.mjs → chunk-TEMORCEE.mjs} +1 -1
- package/dist/cli/{chunk-YOQ2NNDO.mjs → chunk-TS4KFQKS.mjs} +1 -1
- package/dist/cli/{chunk-4CC67XH5.mjs → chunk-XUY7WQ2R.mjs} +3 -3
- package/dist/cli/{chunk-Z6FXUDIL.mjs → chunk-YEX6RPUO.mjs} +1 -1
- package/dist/cli/{chunk-MJTK6Q3G.js → chunk-YJKKOSXS.js} +3 -3
- package/dist/cli/{chunk-Y6XKCEPK.mjs → chunk-YVOS5KSG.mjs} +1 -1
- package/dist/cli/{chunk-2ABRDH3B.mjs → chunk-YWZEBPXK.mjs} +2 -2
- package/dist/cli/{chunk-BX45XMXZ.mjs → chunk-Z7EHY2MF.mjs} +2 -2
- package/dist/cli/{chunk-FISP4LCK.js → chunk-ZM5BJ5MP.js} +53 -53
- package/dist/cli/{chunk-IPAMOMGP.js → chunk-ZZDTWVCQ.js} +21 -21
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-2XWGPITO.js → csv-7K7LK63Y.js} +13 -13
- package/dist/cli/{csv-433JEHLQ.mjs → csv-ARHQ54HA.mjs} +4 -4
- package/dist/cli/{db-K747DH43.mjs → db-JBX24NJY.mjs} +6 -6
- package/dist/cli/{db-PJJMD4VH.js → db-V4Z2I6DY.js} +27 -27
- package/dist/cli/describe-AYXVS6DZ.js +50 -0
- package/dist/cli/{describe-VEDDYW4P.mjs → describe-RBDSGSZ7.mjs} +18 -17
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/{executions-JWRX3XCT.mjs → executions-BAZEU63W.mjs} +6 -6
- package/dist/cli/{executions-HM5T72H6.js → executions-XEZKV5QU.js} +8 -8
- package/dist/cli/{feedback-34UG4BO3.js → feedback-LOERESRU.js} +8 -8
- package/dist/cli/{feedback-MNSIA63Y.mjs → feedback-YDSWBHCO.mjs} +4 -4
- package/dist/cli/{git-ZKEOXV3A.mjs → git-4Z3W2CQU.mjs} +5 -5
- package/dist/cli/git-T6WKO7EA.js +25 -0
- package/dist/cli/index.js +146 -148
- package/dist/cli/index.mjs +53 -55
- package/dist/cli/{legacy-noops-YXSI4FVU.js → legacy-noops-4QIQPVE5.js} +8 -8
- package/dist/cli/{legacy-noops-5M4T4ZVT.mjs → legacy-noops-E4HH7S5O.mjs} +5 -5
- package/dist/cli/{monitors-C65OC4AW.mjs → monitors-FPDW5DDM.mjs} +305 -8
- package/dist/cli/{monitors-O25GDOYE.js → monitors-QBHDSDA7.js} +423 -126
- package/dist/cli/{org-2GSPLY2A.js → org-JO4GGSAH.js} +72 -72
- package/dist/cli/{org-ZRMG5NS2.mjs → org-UCDHIHAD.mjs} +6 -6
- package/dist/cli/{pages-TZZUFBRO.mjs → pages-6V52IZXY.mjs} +6 -6
- package/dist/cli/{pages-45DPADK6.js → pages-FJAAXAWO.js} +18 -18
- package/dist/cli/{play-RCGMND6X.js → play-F3AENS6W.js} +317 -316
- package/dist/cli/{play-3D7HH273.mjs → play-MF4DWROJ.mjs} +18 -17
- package/dist/cli/{providers-PSAKV6CJ.mjs → providers-NJJLTECA.mjs} +6 -6
- package/dist/cli/{providers-3N3ECMTY.js → providers-XXOQLPX7.js} +9 -9
- package/dist/cli/{quickstart-6R6AIXM6.js → quickstart-JCE3XGQG.js} +6 -6
- package/dist/cli/{quickstart-2A35SMGC.mjs → quickstart-Z5MSMI7S.mjs} +4 -4
- package/dist/cli/{run-F3TLDGUO.mjs → run-56UGPIRL.mjs} +23 -22
- package/dist/cli/{run-F6ZXTASZ.js → run-X2DNIW3F.js} +41 -40
- package/dist/cli/search-B753RTKC.js +33 -0
- package/dist/cli/{search-CZLCY3D2.mjs → search-SZYI4NBB.mjs} +8 -7
- package/dist/cli/{search-output-R5XDNILW.js → search-output-7UNT6EMP.js} +6 -6
- package/dist/cli/{search-output-MQTSTLN5.mjs → search-output-T35QNZUF.mjs} +4 -4
- package/dist/cli/{secrets-DCJYHDSY.js → secrets-JMUAVIVC.js} +15 -15
- package/dist/cli/{secrets-D3GF4B2Z.mjs → secrets-Q36VC35L.mjs} +6 -6
- package/dist/cli/{sessions-QGEQ2UYZ.mjs → sessions-HG6I3HMY.mjs} +5 -5
- package/dist/cli/{sessions-Z4JYJSDP.js → sessions-SUXU7OM7.js} +6 -6
- package/dist/cli/{settings-UVXXAT4A.js → settings-UIELQ5CV.js} +106 -78
- package/dist/cli/{settings-G7QEXA4N.mjs → settings-Z76XW4KF.mjs} +39 -11
- package/dist/cli/{setup-5I42W7D4.js → setup-2L7H5P2O.js} +50 -49
- package/dist/cli/{setup-QHJU3DUI.mjs → setup-OXNYAOQ4.mjs} +10 -9
- package/dist/cli/skills-DEVXYGYH.js +37 -0
- package/dist/cli/{skills-5LRF4UKX.mjs → skills-XSNLXJGI.mjs} +8 -7
- package/dist/cli/tools-SCGHABDL.js +57 -0
- package/dist/cli/{tools-PUT6STVG.mjs → tools-SUSFAYFH.mjs} +17 -16
- package/dist/cli/update-BSIILGO3.js +35 -0
- package/dist/cli/{update-CJ2GA64X.mjs → update-ENSTG3QO.mjs} +10 -9
- package/dist/cli/{workflow-O67MEBCP.js → workflow-FMBZNY4F.js} +17 -17
- package/dist/cli/{workflow-HVEWRTXD.mjs → workflow-Z33QE6VT.mjs} +7 -7
- package/dist/{client-DYAfJpaN.d.mts → client-BDbouy3Y.d.mts} +1 -1
- package/dist/{client-CIwenMFS.d.ts → client-Cx0420fs.d.ts} +1 -1
- package/dist/{client-core-CRjtyMAI.d.ts → client-core-B4hq0-m2.d.ts} +56 -4
- package/dist/{client-core-DlzP8vEs.d.mts → client-core-CwiVaMZ5.d.mts} +56 -4
- package/dist/{compiler-manifest-DaJrA2KV.d.mts → compiler-manifest-BeURaD5Y.d.mts} +2 -0
- package/dist/{compiler-manifest-DaJrA2KV.d.ts → compiler-manifest-BeURaD5Y.d.ts} +2 -0
- package/dist/{errors-KLga4bLr.d.ts → errors-BoPXPrSy.d.ts} +1 -1
- package/dist/{errors-BKnSYueU.d.mts → errors-kBuT4kGK.d.mts} +1 -1
- package/dist/{index-C5nAZ-VS.d.ts → index-D0crdGM1.d.ts} +1 -1
- package/dist/{index-C-8AFpWy.d.mts → index-DC7oRAAC.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +116 -110
- 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/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-UPK4IIIN.js +0 -43
- package/dist/cli/describe-OYS7LZJD.js +0 -49
- package/dist/cli/git-5YQJSJFR.js +0 -25
- package/dist/cli/search-R5VEWJO2.js +0 -32
- package/dist/cli/skills-FB6TV52O.js +0 -36
- package/dist/cli/tools-L2364RPA.js +0 -56
- package/dist/cli/update-ESYJGYVZ.js +0 -34
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./chunk-EXMLR72R.mjs";
|
|
2
2
|
import {
|
|
3
3
|
DeeplineClient
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-YWZEBPXK.mjs";
|
|
5
|
+
import "./chunk-ONBXTEFQ.mjs";
|
|
6
6
|
import "./chunk-L2VKAASU.mjs";
|
|
7
7
|
import "./chunk-N4TR6QRI.mjs";
|
|
8
8
|
import "./chunk-S3A4IXBQ.mjs";
|
|
@@ -17,15 +17,15 @@ import {
|
|
|
17
17
|
} from "./chunk-MI6ZP7XI.mjs";
|
|
18
18
|
import {
|
|
19
19
|
createCliProgress
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-TEMORCEE.mjs";
|
|
21
21
|
import {
|
|
22
22
|
errorToJsonPayload,
|
|
23
23
|
printCommandEnvelope,
|
|
24
24
|
printJson,
|
|
25
25
|
shouldEmitJson
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-2CFTDVEP.mjs";
|
|
27
|
+
import "./chunk-YVOS5KSG.mjs";
|
|
28
|
+
import "./chunk-TS4KFQKS.mjs";
|
|
29
29
|
import {
|
|
30
30
|
AuthError
|
|
31
31
|
} from "./chunk-4QF2K7TM.mjs";
|
|
@@ -33,7 +33,7 @@ import "./chunk-DLIRSHV6.mjs";
|
|
|
33
33
|
import {
|
|
34
34
|
DeeplineError
|
|
35
35
|
} from "./chunk-HBL4PM5Q.mjs";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-OPBXKB57.mjs";
|
|
37
37
|
import "./chunk-WZYKRD7T.mjs";
|
|
38
38
|
import "./chunk-KRD6H754.mjs";
|
|
39
39
|
|
|
@@ -773,6 +773,15 @@ function renderMonitorLedgerText(payload) {
|
|
|
773
773
|
`! ${asString(play.name) ?? "A Play"} is failing: ${asString(play.error) ?? "latest run failed"}${asString(play.run_id) ? ` (run ${asString(play.run_id)})` : ""}`
|
|
774
774
|
);
|
|
775
775
|
}
|
|
776
|
+
const fleetScope = asRecord(payload.fleet_scope);
|
|
777
|
+
if (fleetScope) {
|
|
778
|
+
const issues = asFiniteNumber(fleetScope.issues) ?? 0;
|
|
779
|
+
lines.push(
|
|
780
|
+
`Fleet ${asString(fleetScope.id) ?? "unknown"} \xB7 ${fleetOverviewStatusLabel(
|
|
781
|
+
asString(fleetScope.status)
|
|
782
|
+
)} \xB7 ${asFiniteNumber(fleetScope.live) ?? 0} of ${asFiniteNumber(fleetScope.owned) ?? asFiniteNumber(fleetScope.expected) ?? 0} live \xB7 ${issues} ${issues === 1 ? "issue" : "issues"}`
|
|
783
|
+
);
|
|
784
|
+
}
|
|
776
785
|
const total = asFiniteNumber(payload.total);
|
|
777
786
|
lines.push(
|
|
778
787
|
monitors.length === 0 ? "No monitors matched." : total !== void 0 && total > monitors.length ? `Monitors (${monitors.length} of ${total}):` : `Monitors (${monitors.length}):`
|
|
@@ -833,6 +842,7 @@ async function handleMonitorsLedger(key, options) {
|
|
|
833
842
|
...options.state?.length ? { states: options.state } : {},
|
|
834
843
|
...options.signal?.length ? { signals: options.signal } : {},
|
|
835
844
|
...options.play ? { play: options.play } : {},
|
|
845
|
+
...options.fleet ? { fleet: options.fleet } : {},
|
|
836
846
|
...options.sort ? { sort: options.sort } : {},
|
|
837
847
|
...options.window ? { window: options.window } : {},
|
|
838
848
|
...options.limit ? { limit: options.limit } : {},
|
|
@@ -1332,6 +1342,14 @@ var MONITOR_FLEET_COMMANDS = [
|
|
|
1332
1342
|
name: "get",
|
|
1333
1343
|
summary: "Read one fleet, list every fleet, or inspect drift."
|
|
1334
1344
|
},
|
|
1345
|
+
{
|
|
1346
|
+
name: "overview",
|
|
1347
|
+
summary: "List fleets by status, issues and findings, or read one fleet\u2019s issues by cause."
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
name: "issues",
|
|
1351
|
+
summary: "Page through a fleet\u2019s members that are not live, with each cause and message."
|
|
1352
|
+
},
|
|
1335
1353
|
{
|
|
1336
1354
|
name: "deactivate",
|
|
1337
1355
|
summary: "Deactivate a fleet and the monitors it owns."
|
|
@@ -1899,6 +1917,207 @@ async function handleMonitorFleetsGet(fleetId, options) {
|
|
|
1899
1917
|
{ json: options.json, text }
|
|
1900
1918
|
);
|
|
1901
1919
|
}
|
|
1920
|
+
var FLEET_OVERVIEW_STATUSES = [
|
|
1921
|
+
"needs_attention",
|
|
1922
|
+
"paused_credits",
|
|
1923
|
+
"paused_cap",
|
|
1924
|
+
"paused_billing",
|
|
1925
|
+
"setting_up",
|
|
1926
|
+
"running",
|
|
1927
|
+
"deactivated"
|
|
1928
|
+
];
|
|
1929
|
+
var FLEET_OVERVIEW_SORTS = [
|
|
1930
|
+
"attention",
|
|
1931
|
+
"findings",
|
|
1932
|
+
"newest",
|
|
1933
|
+
"name"
|
|
1934
|
+
];
|
|
1935
|
+
var FLEET_ISSUE_GROUPS = ["failed", "blocked", "waiting"];
|
|
1936
|
+
var FLEET_OVERVIEW_STATUS_LABELS = {
|
|
1937
|
+
needs_attention: "needs attention",
|
|
1938
|
+
paused_credits: "paused \xB7 out of credits",
|
|
1939
|
+
paused_cap: "paused \xB7 spending cap",
|
|
1940
|
+
paused_billing: "paused \xB7 billing issue",
|
|
1941
|
+
setting_up: "setting up",
|
|
1942
|
+
running: "running",
|
|
1943
|
+
deactivated: "deactivated"
|
|
1944
|
+
};
|
|
1945
|
+
function fleetOverviewStatusLabel(status) {
|
|
1946
|
+
return status ? FLEET_OVERVIEW_STATUS_LABELS[status] ?? status : "unknown";
|
|
1947
|
+
}
|
|
1948
|
+
function fleetChoice(value, allowed, flag) {
|
|
1949
|
+
if (value === void 0) return void 0;
|
|
1950
|
+
if (allowed.includes(value)) return value;
|
|
1951
|
+
throw new MonitorsUsageError(
|
|
1952
|
+
`${flag} must be ${allowed.join(", ")}; received ${value}.`
|
|
1953
|
+
);
|
|
1954
|
+
}
|
|
1955
|
+
function fleetIssueTotal(fleet) {
|
|
1956
|
+
return asFiniteNumber(asRecord(fleet.issues)?.total) ?? 0;
|
|
1957
|
+
}
|
|
1958
|
+
function fleetFindingsText(fleet, windowLabel) {
|
|
1959
|
+
return ledgerFindingsText(asRecord(fleet.findings), windowLabel);
|
|
1960
|
+
}
|
|
1961
|
+
function renderFleetOverviewList(payload) {
|
|
1962
|
+
const fleets = (Array.isArray(payload.fleets) ? payload.fleets : []).flatMap(
|
|
1963
|
+
(raw) => {
|
|
1964
|
+
const fleet = asRecord(raw);
|
|
1965
|
+
return fleet ? [fleet] : [];
|
|
1966
|
+
}
|
|
1967
|
+
);
|
|
1968
|
+
const window = asString(asRecord(payload.applied)?.window) ?? "30d";
|
|
1969
|
+
const windowLabel = LEDGER_WINDOW_LABELS[window] ?? window;
|
|
1970
|
+
if (fleets.length === 0) {
|
|
1971
|
+
return "No fleets matched.\nNext: deepline monitors fleets overview --state deactivated\n";
|
|
1972
|
+
}
|
|
1973
|
+
const idWidth = fleets.reduce(
|
|
1974
|
+
(max, fleet) => Math.max(max, (asString(fleet.id) ?? "-").length),
|
|
1975
|
+
0
|
|
1976
|
+
);
|
|
1977
|
+
const statusWidth = fleets.reduce(
|
|
1978
|
+
(max, fleet) => Math.max(max, fleetOverviewStatusLabel(asString(fleet.status)).length),
|
|
1979
|
+
0
|
|
1980
|
+
);
|
|
1981
|
+
const total = asFiniteNumber(payload.total);
|
|
1982
|
+
const lines = [
|
|
1983
|
+
total !== void 0 && total > fleets.length ? `Fleets (${fleets.length} of ${total})` : `Fleets (${fleets.length})`
|
|
1984
|
+
];
|
|
1985
|
+
for (const fleet of fleets) {
|
|
1986
|
+
const issues = fleetIssueTotal(fleet);
|
|
1987
|
+
lines.push(
|
|
1988
|
+
` ${(asString(fleet.id) ?? "-").padEnd(idWidth)} ${fleetOverviewStatusLabel(
|
|
1989
|
+
asString(fleet.status)
|
|
1990
|
+
).padEnd(statusWidth)} ${asFiniteNumber(fleet.live) ?? 0} of ${asFiniteNumber(fleet.owned) ?? asFiniteNumber(fleet.expected) ?? 0} live \xB7 ${issues} ${issues === 1 ? "issue" : "issues"} \xB7 ${fleetFindingsText(
|
|
1991
|
+
fleet,
|
|
1992
|
+
windowLabel
|
|
1993
|
+
)}`
|
|
1994
|
+
);
|
|
1995
|
+
}
|
|
1996
|
+
return `${lines.join("\n")}
|
|
1997
|
+
`;
|
|
1998
|
+
}
|
|
1999
|
+
function fleetIssueCauses(group) {
|
|
2000
|
+
const causes = asRecord(group?.causes) ?? {};
|
|
2001
|
+
return Object.entries(causes).flatMap(([cause, raw]) => {
|
|
2002
|
+
const count = asFiniteNumber(raw) ?? 0;
|
|
2003
|
+
return count > 0 ? [[cause, count]] : [];
|
|
2004
|
+
}).sort(
|
|
2005
|
+
(left, right) => right[1] - left[1] || left[0].localeCompare(right[0])
|
|
2006
|
+
);
|
|
2007
|
+
}
|
|
2008
|
+
function renderFleetOverviewDetail(payload, window) {
|
|
2009
|
+
const id = asString(payload.id) ?? "unknown";
|
|
2010
|
+
const windowLabel = LEDGER_WINDOW_LABELS[window ?? "30d"] ?? window ?? "30d";
|
|
2011
|
+
const settingUp = asFiniteNumber(payload.setting_up) ?? 0;
|
|
2012
|
+
const missing = asFiniteNumber(payload.missing_at_provider) ?? 0;
|
|
2013
|
+
const lines = [
|
|
2014
|
+
`Fleet ${id} \u2014 ${fleetOverviewStatusLabel(asString(payload.status))}`,
|
|
2015
|
+
` monitors ${asFiniteNumber(payload.live) ?? 0} of ${asFiniteNumber(payload.owned) ?? asFiniteNumber(payload.expected) ?? 0} live${settingUp ? ` \xB7 ${settingUp} setting up` : ""}${missing ? ` \xB7 ${missing} missing at provider` : ""}`,
|
|
2016
|
+
` last sync ${asString(payload.last_sync_attempt_at) ?? "never"} (attempt)`,
|
|
2017
|
+
` findings ${fleetFindingsText(payload, windowLabel)}`
|
|
2018
|
+
];
|
|
2019
|
+
const issues = asRecord(payload.issues) ?? {};
|
|
2020
|
+
const total = asFiniteNumber(issues.total) ?? 0;
|
|
2021
|
+
lines.push("", `Issues (${total}):`);
|
|
2022
|
+
for (const group of ["failed", "blocked"]) {
|
|
2023
|
+
const record = asRecord(issues[group]);
|
|
2024
|
+
const count = asFiniteNumber(record?.total) ?? 0;
|
|
2025
|
+
if (count === 0) continue;
|
|
2026
|
+
lines.push(` ${group} ${count}`);
|
|
2027
|
+
for (const [cause, causeCount] of fleetIssueCauses(record)) {
|
|
2028
|
+
lines.push(` ${cause} ${causeCount}`);
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
const waiting = asFiniteNumber(asRecord(issues.waiting)?.total) ?? 0;
|
|
2032
|
+
if (waiting > 0) {
|
|
2033
|
+
lines.push(` waiting ${waiting} (rate limited; retries on its own)`);
|
|
2034
|
+
}
|
|
2035
|
+
if (total === 0 && waiting === 0) lines.push(" none");
|
|
2036
|
+
const shellId = fleetShellArg(id);
|
|
2037
|
+
if (total > 0) lines.push(`Next: deepline monitors fleets issues ${shellId}`);
|
|
2038
|
+
lines.push(`Resync: deepline monitors fleets sync ${shellId} --dry-run`);
|
|
2039
|
+
return `${lines.join("\n")}
|
|
2040
|
+
`;
|
|
2041
|
+
}
|
|
2042
|
+
function renderFleetIssuePage(payload) {
|
|
2043
|
+
const issues = (Array.isArray(payload.issues) ? payload.issues : []).flatMap(
|
|
2044
|
+
(raw) => {
|
|
2045
|
+
const issue = asRecord(raw);
|
|
2046
|
+
return issue ? [issue] : [];
|
|
2047
|
+
}
|
|
2048
|
+
);
|
|
2049
|
+
const fleetId = asString(payload.fleet_id) ?? "unknown";
|
|
2050
|
+
const total = asFiniteNumber(payload.total);
|
|
2051
|
+
const lines = [
|
|
2052
|
+
issues.length === 0 ? `Fleet ${fleetId} has no matching issues.` : total !== void 0 && total > issues.length ? `Fleet ${fleetId} issues (${issues.length} of ${total}):` : `Fleet ${fleetId} issues (${issues.length}):`
|
|
2053
|
+
];
|
|
2054
|
+
for (const issue of issues) {
|
|
2055
|
+
lines.push(
|
|
2056
|
+
`- ${asString(issue.source_key) ?? "(no source row)"} [${asString(issue.monitor_key) ?? "-"}] \xB7 ${asString(issue.group) ?? "unknown"} \xB7 ${asString(issue.cause) ?? "unknown"}`
|
|
2057
|
+
);
|
|
2058
|
+
const message = asString(issue.message);
|
|
2059
|
+
if (message) lines.push(` ${message}`);
|
|
2060
|
+
}
|
|
2061
|
+
const next = asString(payload.next_cursor);
|
|
2062
|
+
if (next) lines.push(`More: --cursor ${next}`);
|
|
2063
|
+
return `${lines.join("\n")}
|
|
2064
|
+
`;
|
|
2065
|
+
}
|
|
2066
|
+
async function handleMonitorFleetsOverviewRead(fleetId, options) {
|
|
2067
|
+
const window = fleetChoice(options.window, LEDGER_WINDOWS, "--window");
|
|
2068
|
+
const client = new DeeplineClient();
|
|
2069
|
+
if (fleetId) {
|
|
2070
|
+
const listOnly = [
|
|
2071
|
+
options.q !== void 0 ? "--q" : "",
|
|
2072
|
+
options.state?.length ? "--state" : "",
|
|
2073
|
+
options.sort !== void 0 ? "--sort" : ""
|
|
2074
|
+
].filter(Boolean);
|
|
2075
|
+
if (listOnly.length > 0) {
|
|
2076
|
+
throw new MonitorsUsageError(
|
|
2077
|
+
`${listOnly.join(", ")} filter the Fleets list and cannot be combined with a fleet id. Drop the id to filter the list (deepline monitors fleets overview --state needs_attention), or drop ${listOnly.join(", ")} to read one fleet (deepline monitors fleets overview ${fleetShellArg(fleetId)}).`
|
|
2078
|
+
);
|
|
2079
|
+
}
|
|
2080
|
+
const payload2 = await client.monitors.fleets.overview(fleetId, {
|
|
2081
|
+
...window ? { window } : {}
|
|
2082
|
+
});
|
|
2083
|
+
printCommandEnvelope(payload2, {
|
|
2084
|
+
json: options.json,
|
|
2085
|
+
text: renderFleetOverviewDetail(payload2, window)
|
|
2086
|
+
});
|
|
2087
|
+
return;
|
|
2088
|
+
}
|
|
2089
|
+
for (const state of options.state ?? []) {
|
|
2090
|
+
fleetChoice(state, FLEET_OVERVIEW_STATUSES, "--state");
|
|
2091
|
+
}
|
|
2092
|
+
const sort = fleetChoice(options.sort, FLEET_OVERVIEW_SORTS, "--sort");
|
|
2093
|
+
const payload = await client.monitors.fleets.overview(void 0, {
|
|
2094
|
+
...options.q ? { q: options.q } : {},
|
|
2095
|
+
...options.state?.length ? { states: options.state } : {},
|
|
2096
|
+
...sort ? { sort } : {},
|
|
2097
|
+
...window ? { window } : {}
|
|
2098
|
+
});
|
|
2099
|
+
printCommandEnvelope(payload, {
|
|
2100
|
+
json: options.json,
|
|
2101
|
+
text: renderFleetOverviewList(payload)
|
|
2102
|
+
});
|
|
2103
|
+
}
|
|
2104
|
+
async function handleMonitorFleetsIssues(fleetId, options) {
|
|
2105
|
+
const group = fleetChoice(options.group, FLEET_ISSUE_GROUPS, "--group");
|
|
2106
|
+
const limit = fleetIntegerOption(options.limit, "--limit");
|
|
2107
|
+
if (limit !== void 0 && (limit < 1 || limit > 100)) {
|
|
2108
|
+
throw new MonitorsUsageError("--limit must be an integer from 1 to 100.");
|
|
2109
|
+
}
|
|
2110
|
+
const payload = await new DeeplineClient().monitors.fleets.issues(fleetId, {
|
|
2111
|
+
...group ? { group } : {},
|
|
2112
|
+
...options.cause ? { cause: options.cause } : {},
|
|
2113
|
+
...options.cursor ? { cursor: options.cursor } : {},
|
|
2114
|
+
...limit !== void 0 ? { limit } : {}
|
|
2115
|
+
});
|
|
2116
|
+
printCommandEnvelope(payload, {
|
|
2117
|
+
json: options.json,
|
|
2118
|
+
text: renderFleetIssuePage(payload)
|
|
2119
|
+
});
|
|
2120
|
+
}
|
|
1902
2121
|
function fleetReactivateCommandLine(fleetId, options) {
|
|
1903
2122
|
const parts = [
|
|
1904
2123
|
"deepline",
|
|
@@ -3059,6 +3278,9 @@ Notes:
|
|
|
3059
3278
|
window, so the count is partial; a null count means the monitor has not
|
|
3060
3279
|
been counted yet.
|
|
3061
3280
|
|
|
3281
|
+
--fleet lists only the monitors one Monitor Fleet owns; fleet_scope then
|
|
3282
|
+
carries that fleet's status, live of expected, and issue count.
|
|
3283
|
+
|
|
3062
3284
|
Filters apply before paging, so total is the filtered count. Page with
|
|
3063
3285
|
--cursor <next_cursor> until next_cursor is null.
|
|
3064
3286
|
|
|
@@ -3069,6 +3291,7 @@ Examples:
|
|
|
3069
3291
|
deepline monitors ledger --search halcyon --sort installed
|
|
3070
3292
|
deepline monitors ledger --sort findings --window 7d
|
|
3071
3293
|
deepline monitors ledger --play none
|
|
3294
|
+
deepline monitors ledger --fleet account-job-openings
|
|
3072
3295
|
deepline monitors ledger halcyon-openings --json
|
|
3073
3296
|
deepline monitors ledger halcyon-openings --findings --json
|
|
3074
3297
|
`
|
|
@@ -3086,7 +3309,7 @@ Examples:
|
|
|
3086
3309
|
).option(
|
|
3087
3310
|
"--play <play>",
|
|
3088
3311
|
'Only monitors triggering this Play definition id, or "none" for monitors no Play listens to'
|
|
3089
|
-
).option(
|
|
3312
|
+
).option("--fleet <fleet-id>", "Only the monitors this Monitor Fleet owns").option(
|
|
3090
3313
|
"--sort <sort>",
|
|
3091
3314
|
"recent (default; newest finding first), installed, name, or findings (most in --window first)"
|
|
3092
3315
|
).option(
|
|
@@ -3521,6 +3744,77 @@ Examples:
|
|
|
3521
3744
|
"Exit 0 when converged and 6 otherwise, for scripts and agents"
|
|
3522
3745
|
)
|
|
3523
3746
|
).action(monitorsAction(handleMonitorFleetsGet));
|
|
3747
|
+
withJsonOption(
|
|
3748
|
+
fleets.command("overview [fleet-id]").description(
|
|
3749
|
+
"List fleets as the Fleets page does, or read one fleet\u2019s overview."
|
|
3750
|
+
).addHelpText(
|
|
3751
|
+
"after",
|
|
3752
|
+
`
|
|
3753
|
+
Notes:
|
|
3754
|
+
Read-only. Without an id, lists every fleet with its status, live of
|
|
3755
|
+
expected monitors, issue count, and findings in --window, ordered by --sort.
|
|
3756
|
+
Statuses: needs_attention, paused_credits, paused_cap, paused_billing,
|
|
3757
|
+
setting_up, running, deactivated. Every status except deactivated is shown
|
|
3758
|
+
by default; repeat --state to choose. --q, --state, and --sort apply only to
|
|
3759
|
+
the list and are refused with an id.
|
|
3760
|
+
|
|
3761
|
+
With an id, reads that fleet: status, live of expected, the last sync
|
|
3762
|
+
attempt (an attempt, not proof it succeeded), findings, source table and
|
|
3763
|
+
filters, member tool, the Plays its output triggers, and its issues counted
|
|
3764
|
+
by group and cause. Issues count failed and blocked members; waiting
|
|
3765
|
+
members are rate limited and retry on their own. Page the members behind
|
|
3766
|
+
each count with \`deepline monitors fleets issues <fleet-id>\`.
|
|
3767
|
+
|
|
3768
|
+
--json prints the server response as one JSON object.
|
|
3769
|
+
|
|
3770
|
+
Examples:
|
|
3771
|
+
deepline monitors fleets overview
|
|
3772
|
+
deepline monitors fleets overview --state needs_attention --sort findings
|
|
3773
|
+
deepline monitors fleets overview --q accounts --window 7d
|
|
3774
|
+
deepline monitors fleets overview account-job-openings
|
|
3775
|
+
deepline monitors fleets overview account-job-openings --json
|
|
3776
|
+
`
|
|
3777
|
+
).option(
|
|
3778
|
+
"--q <text>",
|
|
3779
|
+
"Search fleet ids, source tables, member tools and signals"
|
|
3780
|
+
).option(
|
|
3781
|
+
"--state <status>",
|
|
3782
|
+
"Include a status (repeatable): needs_attention, paused_credits, paused_cap, paused_billing, setting_up, running, deactivated",
|
|
3783
|
+
(value, previous = []) => [...previous, value]
|
|
3784
|
+
).option(
|
|
3785
|
+
"--sort <sort>",
|
|
3786
|
+
"attention (default; most attention first), findings, newest, or name"
|
|
3787
|
+
).option(
|
|
3788
|
+
"--window <window>",
|
|
3789
|
+
"Findings window: 1d, 7d, 30d (default), 90d, or 1y"
|
|
3790
|
+
)
|
|
3791
|
+
).action(monitorsAction(handleMonitorFleetsOverviewRead));
|
|
3792
|
+
withJsonOption(
|
|
3793
|
+
fleets.command("issues <fleet-id>").description(
|
|
3794
|
+
"Page through a fleet\u2019s members that are not live, with cause and message."
|
|
3795
|
+
).addHelpText(
|
|
3796
|
+
"after",
|
|
3797
|
+
`
|
|
3798
|
+
Notes:
|
|
3799
|
+
Read-only. Each row is one member that is not live: its source row key,
|
|
3800
|
+
monitor key, group (failed, blocked, or waiting), cause, and the provider's
|
|
3801
|
+
own message. The causes are the ones \`fleets overview <fleet-id>\` counts.
|
|
3802
|
+
Page with --cursor <next_cursor> until next_cursor is null.
|
|
3803
|
+
|
|
3804
|
+
After fixing a cause, resync with
|
|
3805
|
+
\`deepline monitors fleets sync <fleet-id> --dry-run\`.
|
|
3806
|
+
|
|
3807
|
+
Examples:
|
|
3808
|
+
deepline monitors fleets issues account-job-openings
|
|
3809
|
+
deepline monitors fleets issues account-job-openings --group failed
|
|
3810
|
+
deepline monitors fleets issues account-job-openings --cause watched_accounts_limit --limit 100
|
|
3811
|
+
deepline monitors fleets issues account-job-openings --cursor <next_cursor> --json
|
|
3812
|
+
`
|
|
3813
|
+
).option("--group <group>", "Only failed, blocked, or waiting members").option(
|
|
3814
|
+
"--cause <cause>",
|
|
3815
|
+
"Only one cause, as the fleet overview names it (for example provider_rejected)"
|
|
3816
|
+
).option("--cursor <cursor>", "Continue from a prior next_cursor").option("--limit <n>", "Rows per page, 1 to 100 (default 25)")
|
|
3817
|
+
).action(monitorsAction(handleMonitorFleetsIssues));
|
|
3524
3818
|
withJsonOption(
|
|
3525
3819
|
fleets.command("deactivate <fleet-id>").alias("stop").description("Deactivate a fleet and the monitors it owns.").addHelpText(
|
|
3526
3820
|
"after",
|
|
@@ -3638,6 +3932,9 @@ export {
|
|
|
3638
3932
|
registerMonitorsCommands,
|
|
3639
3933
|
renderAvailableToolsText,
|
|
3640
3934
|
renderDeployedListText,
|
|
3935
|
+
renderFleetIssuePage,
|
|
3936
|
+
renderFleetOverviewDetail,
|
|
3937
|
+
renderFleetOverviewList,
|
|
3641
3938
|
renderMonitorDeletePlan,
|
|
3642
3939
|
renderMonitorDeployCompletion,
|
|
3643
3940
|
renderMonitorDeployPlan,
|