mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:20:44 +00:00
refactor: hide doctor overview internals
This commit is contained in:
@@ -19,7 +19,7 @@ import { resolveAgentModelPrimaryValue } from "../config/model-input.js";
|
|||||||
import { normalizeAgentId } from "../routing/session-key.js";
|
import { normalizeAgentId } from "../routing/session-key.js";
|
||||||
import { probeGatewayUrl, probeLocalCommand, type LocalCommandProbe } from "./probes.js";
|
import { probeGatewayUrl, probeLocalCommand, type LocalCommandProbe } from "./probes.js";
|
||||||
|
|
||||||
export type CrestodianAgentSummary = {
|
type CrestodianAgentSummary = {
|
||||||
id: string;
|
id: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
isDefault: boolean;
|
isDefault: boolean;
|
||||||
@@ -274,7 +274,7 @@ export function formatCrestodianOverview(overview: CrestodianOverview): string {
|
|||||||
.join("\n");
|
.join("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function recommendCrestodianNextStep(overview: CrestodianOverview): string {
|
function recommendCrestodianNextStep(overview: CrestodianOverview): string {
|
||||||
if (!overview.config.exists) {
|
if (!overview.config.exists) {
|
||||||
return 'run "setup" to create a starter config';
|
return 'run "setup" to create a starter config';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,16 +6,16 @@ import type { buildGatewayConnectionDetails } from "../gateway/call.js";
|
|||||||
import type { RuntimeEnv } from "../runtime.js";
|
import type { RuntimeEnv } from "../runtime.js";
|
||||||
import type { FlowContribution } from "./types.js";
|
import type { FlowContribution } from "./types.js";
|
||||||
|
|
||||||
export type DoctorFlowMode = "local" | "remote";
|
type DoctorFlowMode = "local" | "remote";
|
||||||
|
|
||||||
export type DoctorConfigResult = {
|
type DoctorConfigResult = {
|
||||||
cfg: OpenClawConfig;
|
cfg: OpenClawConfig;
|
||||||
path?: string;
|
path?: string;
|
||||||
shouldWriteConfig?: boolean;
|
shouldWriteConfig?: boolean;
|
||||||
sourceConfigValid?: boolean;
|
sourceConfigValid?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type DoctorHealthFlowContext = {
|
type DoctorHealthFlowContext = {
|
||||||
runtime: RuntimeEnv;
|
runtime: RuntimeEnv;
|
||||||
options: DoctorOptions;
|
options: DoctorOptions;
|
||||||
prompter: DoctorPrompter;
|
prompter: DoctorPrompter;
|
||||||
@@ -30,13 +30,13 @@ export type DoctorHealthFlowContext = {
|
|||||||
gatewayMemoryProbe?: Awaited<ReturnType<typeof probeGatewayMemoryStatus>>;
|
gatewayMemoryProbe?: Awaited<ReturnType<typeof probeGatewayMemoryStatus>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type DoctorHealthContribution = FlowContribution & {
|
type DoctorHealthContribution = FlowContribution & {
|
||||||
kind: "core";
|
kind: "core";
|
||||||
surface: "health";
|
surface: "health";
|
||||||
run: (ctx: DoctorHealthFlowContext) => Promise<void>;
|
run: (ctx: DoctorHealthFlowContext) => Promise<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function resolveDoctorMode(cfg: OpenClawConfig): DoctorFlowMode {
|
function resolveDoctorMode(cfg: OpenClawConfig): DoctorFlowMode {
|
||||||
return cfg.gateway?.mode === "remote" ? "remote" : "local";
|
return cfg.gateway?.mode === "remote" ? "remote" : "local";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user