@monster-orange/den 0.2.5 → 0.2.6
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/CHANGELOG.md +98 -0
- package/docs/distributions.md +110 -16
- package/package.json +1 -1
- package/src/pillars/security/discover.ts +1 -1
- package/src/pillars/smoke/setup-global.ts +2 -1
- package/src/scripts/configure-aws-profiles.ts +2 -1
- package/src/scripts/register-repos.ts +4 -3
- package/src/shared/environment-manager/default-workspace.ts +47 -0
- package/src/shared/environment-manager/health.ts +45 -9
- package/src/shared/manifest/placement.ts +1 -1
- package/src/shared/manifest/schema.ts +47 -0
- package/src/shared/manifest/service-links.ts +1 -1
- package/src/shared/manifest/validate-manifest.ts +1 -1
- package/src/shared/plural.ts +13 -0
- package/src/shared/service-url.ts +2 -5
- package/src/shared/stacks/compose-health.ts +106 -14
- package/src/shared/stacks/runtime.ts +2 -0
- package/src/shared/types/index.ts +13 -1
- package/src/ui/cli/create.ts +2 -1
- package/src/ui/cli/index.ts +25 -21
- package/src/ui/cli/mcp-connect.ts +36 -5
- package/src/ui/cli/server-identity.ts +233 -0
- package/src/ui/cli/service-command.ts +136 -12
- package/src/ui/cli/spinner.ts +48 -0
- package/src/ui/cli/web-command.ts +76 -25
- package/src/ui/mcp/api.ts +94 -1
- package/src/ui/mcp/server.ts +6 -1
- package/src/ui/mcp/tools.ts +6 -2
- package/src/ui/server/health-row.ts +6 -3
- package/src/ui/server/index.ts +32 -14
package/src/ui/server/index.ts
CHANGED
|
@@ -12,9 +12,11 @@
|
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
composeHealthTarget,
|
|
15
|
+
containerCheckLabel,
|
|
15
16
|
type ComposeHealthTarget,
|
|
17
|
+
type ContainerHealthTarget,
|
|
16
18
|
} from "../../shared/stacks/compose-health.js";
|
|
17
|
-
import { healthCheckFields } from "./health-row.js";
|
|
19
|
+
import { healthCheckFields, type HealthCheckType } from "./health-row.js";
|
|
18
20
|
import { hasRuntime, repoKind } from "../../shared/repo-kind.js";
|
|
19
21
|
import * as http from "http";
|
|
20
22
|
import * as fs from "fs";
|
|
@@ -62,6 +64,8 @@ import {
|
|
|
62
64
|
isSafeServiceName,
|
|
63
65
|
} from "./log-history.js";
|
|
64
66
|
import {
|
|
67
|
+
containerTarget,
|
|
68
|
+
pingContainerCheck,
|
|
65
69
|
pingHttp,
|
|
66
70
|
pingShellCheck,
|
|
67
71
|
TimeoutStreaks,
|
|
@@ -926,7 +930,7 @@ async function handleRequest(
|
|
|
926
930
|
repo: string;
|
|
927
931
|
service: string;
|
|
928
932
|
label: string;
|
|
929
|
-
checkType:
|
|
933
|
+
checkType: HealthCheckType;
|
|
930
934
|
target: string;
|
|
931
935
|
repoPath: string;
|
|
932
936
|
mode: "dev-managed" | "managed";
|
|
@@ -941,6 +945,8 @@ async function handleRequest(
|
|
|
941
945
|
expect?: Expect;
|
|
942
946
|
/** pingShell options (Den's own `stack health` can report unknown). */
|
|
943
947
|
compose: ComposeHealthTarget | null;
|
|
948
|
+
/** A `type: container` check: answered from the shared listing. */
|
|
949
|
+
container: ContainerHealthTarget | null;
|
|
944
950
|
meta: Pick<HealthResult, "runs" | "target">;
|
|
945
951
|
}> = [];
|
|
946
952
|
let edgeDomain: string | null = null;
|
|
@@ -974,6 +980,7 @@ async function handleRequest(
|
|
|
974
980
|
links: [],
|
|
975
981
|
org: orgOf(resolved.repoName, catalog),
|
|
976
982
|
compose: null,
|
|
983
|
+
container: null,
|
|
977
984
|
meta: { runs: "none", target: null },
|
|
978
985
|
});
|
|
979
986
|
continue;
|
|
@@ -1020,14 +1027,16 @@ async function handleRequest(
|
|
|
1020
1027
|
service: resolved.subsystem,
|
|
1021
1028
|
label: plan.label ?? healthCfg?.label ?? resolved.subsystem,
|
|
1022
1029
|
checkType: healthCfg
|
|
1023
|
-
? healthCfg.type === "shell"
|
|
1024
|
-
?
|
|
1030
|
+
? healthCfg.type === "shell" || healthCfg.type === "container"
|
|
1031
|
+
? healthCfg.type
|
|
1025
1032
|
: "http"
|
|
1026
1033
|
: "none",
|
|
1027
1034
|
target: healthCfg
|
|
1028
1035
|
? healthCfg.type === "shell"
|
|
1029
1036
|
? healthCfg.cmd
|
|
1030
|
-
: healthCfg.
|
|
1037
|
+
: healthCfg.type === "container"
|
|
1038
|
+
? containerCheckLabel(containerTarget(healthCfg))
|
|
1039
|
+
: healthCfg.url
|
|
1031
1040
|
: "",
|
|
1032
1041
|
repoPath: resolved.repoPath,
|
|
1033
1042
|
mode: resolved.mode,
|
|
@@ -1048,14 +1057,15 @@ async function handleRequest(
|
|
|
1048
1057
|
subsystem: resolved.subsystem,
|
|
1049
1058
|
repoName: resolved.repoName,
|
|
1050
1059
|
env,
|
|
1051
|
-
healthUrl:
|
|
1052
|
-
healthCfg && healthCfg.type !== "shell" ? healthCfg.url : null,
|
|
1060
|
+
healthUrl: healthCfg && "url" in healthCfg ? healthCfg.url : null,
|
|
1053
1061
|
edgeDomain,
|
|
1054
1062
|
}),
|
|
1055
1063
|
links: linksFor(manifest, resolved.subsystem, env),
|
|
1056
1064
|
org: orgOf(resolved.repoName, catalog),
|
|
1057
1065
|
...(plan.expect ? { expect: plan.expect } : {}),
|
|
1058
1066
|
compose,
|
|
1067
|
+
container:
|
|
1068
|
+
healthCfg?.type === "container" ? containerTarget(healthCfg) : null,
|
|
1059
1069
|
meta: { runs: plan.placement.runs, target: plan.placement.target },
|
|
1060
1070
|
});
|
|
1061
1071
|
}
|
|
@@ -1086,6 +1096,7 @@ async function handleRequest(
|
|
|
1086
1096
|
meta,
|
|
1087
1097
|
expect,
|
|
1088
1098
|
compose,
|
|
1099
|
+
container,
|
|
1089
1100
|
}) => {
|
|
1090
1101
|
if (checkType !== "none") {
|
|
1091
1102
|
const started = Date.now();
|
|
@@ -1097,13 +1108,15 @@ async function handleRequest(
|
|
|
1097
1108
|
repoPath,
|
|
1098
1109
|
compose,
|
|
1099
1110
|
)
|
|
1100
|
-
:
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1111
|
+
: checkType === "container" && container
|
|
1112
|
+
? await pingContainerCheck(container)
|
|
1113
|
+
: await pingHttp(
|
|
1114
|
+
target,
|
|
1115
|
+
env === "local" && meta.runs !== "remote"
|
|
1116
|
+
? HEALTH_CHECK_TIMEOUT_MS
|
|
1117
|
+
: HOSTED_HEALTH_CHECK_TIMEOUT_MS,
|
|
1118
|
+
expect,
|
|
1119
|
+
);
|
|
1107
1120
|
return {
|
|
1108
1121
|
repo,
|
|
1109
1122
|
service,
|
|
@@ -2373,6 +2386,11 @@ async function handleRequest(
|
|
|
2373
2386
|
port: PORT,
|
|
2374
2387
|
// Den's version: the MCP server compares it with the routes it needs.
|
|
2375
2388
|
version: engineVersion() ?? null,
|
|
2389
|
+
// Whose server this is: `<cli> web up|down`, `mcp connect` and
|
|
2390
|
+
// `service install` compare both with their own and never act on
|
|
2391
|
+
// another distribution's server (see cli/server-identity.ts).
|
|
2392
|
+
root: ROOT,
|
|
2393
|
+
product: product().name,
|
|
2376
2394
|
startedAt: new Date(SERVER_STARTED_AT).toISOString(),
|
|
2377
2395
|
uptimeMs: Date.now() - SERVER_STARTED_AT,
|
|
2378
2396
|
stale,
|