mirror of https://github.com/openclaw/openclaw.git
refactor: share onboarding diagnostics type
This commit is contained in:
parent
487e188112
commit
e8a80cfbd8
|
|
@ -16,6 +16,7 @@ import type { OnboardOptions } from "../onboard-types.js";
|
||||||
import { inferAuthChoiceFromFlags } from "./local/auth-choice-inference.js";
|
import { inferAuthChoiceFromFlags } from "./local/auth-choice-inference.js";
|
||||||
import { applyNonInteractiveGatewayConfig } from "./local/gateway-config.js";
|
import { applyNonInteractiveGatewayConfig } from "./local/gateway-config.js";
|
||||||
import {
|
import {
|
||||||
|
type GatewayHealthFailureDiagnostics,
|
||||||
logNonInteractiveOnboardingFailure,
|
logNonInteractiveOnboardingFailure,
|
||||||
logNonInteractiveOnboardingJson,
|
logNonInteractiveOnboardingJson,
|
||||||
} from "./local/output.js";
|
} from "./local/output.js";
|
||||||
|
|
@ -26,36 +27,9 @@ const INSTALL_DAEMON_HEALTH_DEADLINE_MS = 45_000;
|
||||||
const ATTACH_EXISTING_GATEWAY_HEALTH_DEADLINE_MS = 15_000;
|
const ATTACH_EXISTING_GATEWAY_HEALTH_DEADLINE_MS = 15_000;
|
||||||
|
|
||||||
async function collectGatewayHealthFailureDiagnostics(): Promise<
|
async function collectGatewayHealthFailureDiagnostics(): Promise<
|
||||||
| {
|
GatewayHealthFailureDiagnostics | undefined
|
||||||
service?: {
|
|
||||||
label: string;
|
|
||||||
loaded: boolean;
|
|
||||||
loadedText: string;
|
|
||||||
runtimeStatus?: string;
|
|
||||||
state?: string;
|
|
||||||
pid?: number;
|
|
||||||
lastExitStatus?: number;
|
|
||||||
lastExitReason?: string;
|
|
||||||
};
|
|
||||||
lastGatewayError?: string;
|
|
||||||
inspectError?: string;
|
|
||||||
}
|
|
||||||
| undefined
|
|
||||||
> {
|
> {
|
||||||
const diagnostics: {
|
const diagnostics: GatewayHealthFailureDiagnostics = {};
|
||||||
service?: {
|
|
||||||
label: string;
|
|
||||||
loaded: boolean;
|
|
||||||
loadedText: string;
|
|
||||||
runtimeStatus?: string;
|
|
||||||
state?: string;
|
|
||||||
pid?: number;
|
|
||||||
lastExitStatus?: number;
|
|
||||||
lastExitReason?: string;
|
|
||||||
};
|
|
||||||
lastGatewayError?: string;
|
|
||||||
inspectError?: string;
|
|
||||||
} = {};
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { resolveGatewayService } = await import("../../daemon/service.js");
|
const { resolveGatewayService } = await import("../../daemon/service.js");
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { RuntimeEnv } from "../../../runtime.js";
|
import type { RuntimeEnv } from "../../../runtime.js";
|
||||||
import type { OnboardOptions } from "../../onboard-types.js";
|
import type { OnboardOptions } from "../../onboard-types.js";
|
||||||
|
|
||||||
type GatewayHealthFailureDiagnostics = {
|
export type GatewayHealthFailureDiagnostics = {
|
||||||
service?: {
|
service?: {
|
||||||
label: string;
|
label: string;
|
||||||
loaded: boolean;
|
loaded: boolean;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue