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 { applyNonInteractiveGatewayConfig } from "./local/gateway-config.js";
|
||||
import {
|
||||
type GatewayHealthFailureDiagnostics,
|
||||
logNonInteractiveOnboardingFailure,
|
||||
logNonInteractiveOnboardingJson,
|
||||
} 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;
|
||||
|
||||
async function collectGatewayHealthFailureDiagnostics(): Promise<
|
||||
| {
|
||||
service?: {
|
||||
label: string;
|
||||
loaded: boolean;
|
||||
loadedText: string;
|
||||
runtimeStatus?: string;
|
||||
state?: string;
|
||||
pid?: number;
|
||||
lastExitStatus?: number;
|
||||
lastExitReason?: string;
|
||||
};
|
||||
lastGatewayError?: string;
|
||||
inspectError?: string;
|
||||
}
|
||||
| undefined
|
||||
GatewayHealthFailureDiagnostics | undefined
|
||||
> {
|
||||
const diagnostics: {
|
||||
service?: {
|
||||
label: string;
|
||||
loaded: boolean;
|
||||
loadedText: string;
|
||||
runtimeStatus?: string;
|
||||
state?: string;
|
||||
pid?: number;
|
||||
lastExitStatus?: number;
|
||||
lastExitReason?: string;
|
||||
};
|
||||
lastGatewayError?: string;
|
||||
inspectError?: string;
|
||||
} = {};
|
||||
const diagnostics: GatewayHealthFailureDiagnostics = {};
|
||||
|
||||
try {
|
||||
const { resolveGatewayService } = await import("../../daemon/service.js");
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { RuntimeEnv } from "../../../runtime.js";
|
||||
import type { OnboardOptions } from "../../onboard-types.js";
|
||||
|
||||
type GatewayHealthFailureDiagnostics = {
|
||||
export type GatewayHealthFailureDiagnostics = {
|
||||
service?: {
|
||||
label: string;
|
||||
loaded: boolean;
|
||||
|
|
|
|||
Loading…
Reference in New Issue