

























@@ -34,6 +34,16 @@ function resolveGatewayStatusProbeDetails(result: GatewayStatusProbeResult) {
3434return "authProbe" in result ? result.authProbe : result;
3535}
363637+function readRuntimeVersionFromStatusPayload(payload: unknown): string | null {
38+if (!payload || typeof payload !== "object") {
39+return null;
40+}
41+const runtimeVersion = (payload as { runtimeVersion?: unknown }).runtimeVersion;
42+return typeof runtimeVersion === "string" && runtimeVersion.trim().length > 0
43+ ? runtimeVersion.trim()
44+ : null;
45+}
46+3747export async function probeGatewayStatus(opts: {
3848url: string;
3949token?: string;
@@ -48,6 +58,7 @@ export async function probeGatewayStatus(opts: {
4858}) {
4959const kind = (opts.requireRpc ? "read" : "connect") satisfies GatewayStatusProbeKind;
5060try {
61+let statusRuntimeVersion: string | null = null;
5162const result = await withProgress<GatewayStatusProbeResult>(
5263{
5364label: "Checking gateway status...",
@@ -71,7 +82,7 @@ export async function probeGatewayStatus(opts: {
7182};
7283if (opts.requireRpc) {
7384const { callGateway } = await import("../../gateway/call.js");
74-await callGateway({
85+const statusPayload = await callGateway({
7586url: opts.url,
7687token: opts.token,
7788password: opts.password,
@@ -81,6 +92,7 @@ export async function probeGatewayStatus(opts: {
8192timeoutMs: opts.timeoutMs,
8293 ...(opts.configPath ? { configPath: opts.configPath } : {}),
8394});
95+statusRuntimeVersion = readRuntimeVersionFromStatusPayload(statusPayload);
8496const authProbe = await probeGateway(probeOpts).catch(() => null);
8597return { ok: true as const, authProbe };
8698}
@@ -91,6 +103,7 @@ export async function probeGatewayStatus(opts: {
91103const auth = probeDetails?.auth;
92104const server = probeDetails?.server;
93105const serverSummary = server ? { server } : {};
106+const version = server?.version ?? ("authProbe" in result ? statusRuntimeVersion : null);
94107if (result.ok) {
95108return {
96109ok: true,
@@ -103,6 +116,7 @@ export async function probeGatewayStatus(opts: {
103116 : auth?.capability,
104117 auth,
105118 ...serverSummary,
119+ ...(version != null ? { version } : {}),
106120} as const;
107121}
108122return {
@@ -111,6 +125,7 @@ export async function probeGatewayStatus(opts: {
111125capability: auth?.capability,
112126 auth,
113127 ...serverSummary,
128+ ...(version != null ? { version } : {}),
114129error: resolveProbeFailureMessage(result),
115130} as const;
116131} catch (err) {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。