|
1 | 1 | import { canExecRequestNode } from "../../agents/exec-defaults.js"; |
2 | 2 | import { buildWorkspaceSkillStatus } from "../../agents/skills-status.js"; |
3 | | -import { formatCliCommand } from "../../cli/command-format.js"; |
4 | 3 | import { readConfigFileSnapshot, resolveGatewayPort } from "../../config/config.js"; |
5 | 4 | import { readLastGatewayErrorLine } from "../../daemon/diagnostics.js"; |
6 | 5 | import { inspectPortUsage } from "../../infra/ports.js"; |
7 | 6 | import { readRestartSentinel } from "../../infra/restart-sentinel.js"; |
8 | 7 | import { getRemoteSkillEligibility } from "../../infra/skills-remote.js"; |
9 | 8 | import { buildPluginCompatibilityNotices } from "../../plugins/status.js"; |
10 | | -import { VERSION } from "../../version.js"; |
11 | | -import { buildStatusAllAgentsValue, buildStatusSecretsValue } from "../status-overview-values.ts"; |
| 9 | +import { buildStatusAllOverviewRows } from "../status-overview-rows.ts"; |
| 10 | +import { |
| 11 | + buildStatusOverviewSurfaceFromOverview, |
| 12 | + type StatusOverviewSurface, |
| 13 | +} from "../status-overview-surface.ts"; |
12 | 14 | import { |
13 | 15 | resolveStatusGatewayHealthSafe, |
14 | 16 | type resolveStatusServiceSummaries, |
15 | 17 | } from "../status-runtime-shared.ts"; |
16 | 18 | import { resolveStatusAllConnectionDetails } from "../status.gateway-connection.ts"; |
17 | 19 | import type { NodeOnlyGatewayInfo } from "../status.node-mode.js"; |
18 | 20 | import type { StatusScanOverviewResult } from "../status.scan-overview.ts"; |
19 | | -import { buildStatusOverviewSurfaceRows } from "./format.js"; |
20 | 21 |
|
21 | 22 | type StatusServiceSummaries = Awaited<ReturnType<typeof resolveStatusServiceSummaries>>; |
22 | 23 | type StatusGatewayServiceSummary = StatusServiceSummaries[0]; |
@@ -166,46 +167,19 @@ export async function buildStatusAllReportData(params: { |
166 | 167 | timeoutMs: params.timeoutMs, |
167 | 168 | }); |
168 | 169 |
|
169 | | - const overviewRows = buildStatusOverviewSurfaceRows({ |
170 | | - cfg: params.overview.cfg, |
171 | | - update: params.overview.update, |
172 | | - tailscaleMode: params.overview.tailscaleMode, |
173 | | - tailscaleDns: params.overview.tailscaleDns, |
174 | | - tailscaleHttpsUrl: params.overview.tailscaleHttpsUrl, |
175 | | - tailscaleBackendState: diagnosis.tailscale.backendState, |
176 | | - includeBackendStateWhenOff: true, |
177 | | - includeBackendStateWhenOn: true, |
178 | | - includeDnsNameWhenOff: true, |
179 | | - gatewayMode: gatewaySnapshot.gatewayMode, |
180 | | - remoteUrlMissing: gatewaySnapshot.remoteUrlMissing, |
181 | | - gatewayConnection: gatewaySnapshot.gatewayConnection, |
182 | | - gatewayReachable: gatewaySnapshot.gatewayReachable, |
183 | | - gatewayProbe: gatewaySnapshot.gatewayProbe, |
184 | | - gatewayProbeAuth: gatewaySnapshot.gatewayProbeAuth, |
185 | | - gatewayProbeAuthWarning: gatewaySnapshot.gatewayProbeAuthWarning, |
186 | | - gatewaySelf: gatewaySnapshot.gatewaySelf, |
| 170 | + const overviewSurface: StatusOverviewSurface = buildStatusOverviewSurfaceFromOverview({ |
| 171 | + overview: params.overview, |
187 | 172 | gatewayService: params.daemon, |
188 | 173 | nodeService: params.nodeService, |
189 | 174 | nodeOnlyGateway: params.nodeOnlyGateway, |
190 | | - prefixRows: [ |
191 | | - { Item: "Version", Value: VERSION }, |
192 | | - { Item: "OS", Value: params.overview.osSummary.label }, |
193 | | - { Item: "Node", Value: process.versions.node }, |
194 | | - { Item: "Config", Value: configPath }, |
195 | | - ], |
196 | | - middleRows: [ |
197 | | - { Item: "Security", Value: `Run: ${formatCliCommand("openclaw security audit --deep")}` }, |
198 | | - ], |
199 | | - agentsValue: buildStatusAllAgentsValue({ |
200 | | - agentStatus: params.overview.agentStatus, |
201 | | - }), |
202 | | - suffixRows: [ |
203 | | - { |
204 | | - Item: "Secrets", |
205 | | - Value: buildStatusSecretsValue(params.overview.secretDiagnostics.length), |
206 | | - }, |
207 | | - ], |
208 | | - gatewaySelfFallbackValue: "unknown", |
| 175 | + }); |
| 176 | + const overviewRows = buildStatusAllOverviewRows({ |
| 177 | + surface: overviewSurface, |
| 178 | + osLabel: params.overview.osSummary.label, |
| 179 | + configPath, |
| 180 | + secretDiagnosticsCount: params.overview.secretDiagnostics.length, |
| 181 | + agentStatus: params.overview.agentStatus, |
| 182 | + tailscaleBackendState: diagnosis.tailscale.backendState, |
209 | 183 | }); |
210 | 184 |
|
211 | 185 | return { |
|
0 commit comments