mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 07:52:44 +00:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -10,13 +10,13 @@ import {
|
||||
resolveHooksGmailModel,
|
||||
} from "../agents/model-selection.js";
|
||||
import { formatCliCommand } from "../cli/command-format.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import { CONFIG_PATH_CLAWDBOT, readConfigFileSnapshot, writeConfigFile } from "../config/config.js";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import { CONFIG_PATH, readConfigFileSnapshot, writeConfigFile } from "../config/config.js";
|
||||
import { logConfigUpdated } from "../config/logging.js";
|
||||
import { resolveGatewayService } from "../daemon/service.js";
|
||||
import { resolveGatewayAuth } from "../gateway/auth.js";
|
||||
import { buildGatewayConnectionDetails } from "../gateway/call.js";
|
||||
import { resolveClawdbotPackageRoot } from "../infra/clawdbot-root.js";
|
||||
import { resolveMoltbotPackageRoot } from "../infra/moltbot-root.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { note } from "../terminal/note.js";
|
||||
@@ -58,7 +58,7 @@ import { ensureSystemdUserLingerInteractive } from "./systemd-linger.js";
|
||||
const intro = (message: string) => clackIntro(stylePromptTitle(message) ?? message);
|
||||
const outro = (message: string) => clackOutro(stylePromptTitle(message) ?? message);
|
||||
|
||||
function resolveMode(cfg: ClawdbotConfig): "local" | "remote" {
|
||||
function resolveMode(cfg: MoltbotConfig): "local" | "remote" {
|
||||
return cfg.gateway?.mode === "remote" ? "remote" : "local";
|
||||
}
|
||||
|
||||
@@ -68,9 +68,9 @@ export async function doctorCommand(
|
||||
) {
|
||||
const prompter = createDoctorPrompter({ runtime, options });
|
||||
printWizardHeader(runtime);
|
||||
intro("Clawdbot doctor");
|
||||
intro("Moltbot doctor");
|
||||
|
||||
const root = await resolveClawdbotPackageRoot({
|
||||
const root = await resolveMoltbotPackageRoot({
|
||||
moduleUrl: import.meta.url,
|
||||
argv1: process.argv[1],
|
||||
cwd: process.cwd(),
|
||||
@@ -92,17 +92,17 @@ export async function doctorCommand(
|
||||
options,
|
||||
confirm: (p) => prompter.confirm(p),
|
||||
});
|
||||
let cfg: ClawdbotConfig = configResult.cfg;
|
||||
let cfg: MoltbotConfig = configResult.cfg;
|
||||
|
||||
const configPath = configResult.path ?? CONFIG_PATH_CLAWDBOT;
|
||||
const configPath = configResult.path ?? CONFIG_PATH;
|
||||
if (!cfg.gateway?.mode) {
|
||||
const lines = [
|
||||
"gateway.mode is unset; gateway start will be blocked.",
|
||||
`Fix: run ${formatCliCommand("clawdbot configure")} and set Gateway mode (local/remote).`,
|
||||
`Or set directly: ${formatCliCommand("clawdbot config set gateway.mode local")}`,
|
||||
`Fix: run ${formatCliCommand("moltbot configure")} and set Gateway mode (local/remote).`,
|
||||
`Or set directly: ${formatCliCommand("moltbot config set gateway.mode local")}`,
|
||||
];
|
||||
if (!fs.existsSync(configPath)) {
|
||||
lines.push(`Missing config: run ${formatCliCommand("clawdbot setup")} first.`);
|
||||
lines.push(`Missing config: run ${formatCliCommand("moltbot setup")} first.`);
|
||||
}
|
||||
note(lines.join("\n"), "Gateway");
|
||||
}
|
||||
@@ -179,7 +179,7 @@ export async function doctorCommand(
|
||||
}
|
||||
}
|
||||
|
||||
await noteStateIntegrity(cfg, prompter, configResult.path ?? CONFIG_PATH_CLAWDBOT);
|
||||
await noteStateIntegrity(cfg, prompter, configResult.path ?? CONFIG_PATH);
|
||||
|
||||
cfg = await maybeRepairSandboxImages(cfg, runtime, prompter);
|
||||
noteSandboxScopeWarnings(cfg);
|
||||
@@ -277,12 +277,12 @@ export async function doctorCommand(
|
||||
cfg = applyWizardMetadata(cfg, { command: "doctor", mode: resolveMode(cfg) });
|
||||
await writeConfigFile(cfg);
|
||||
logConfigUpdated(runtime);
|
||||
const backupPath = `${CONFIG_PATH_CLAWDBOT}.bak`;
|
||||
const backupPath = `${CONFIG_PATH}.bak`;
|
||||
if (fs.existsSync(backupPath)) {
|
||||
runtime.log(`Backup: ${shortenHomePath(backupPath)}`);
|
||||
}
|
||||
} else {
|
||||
runtime.log(`Run "${formatCliCommand("clawdbot doctor --fix")}" to apply changes.`);
|
||||
runtime.log(`Run "${formatCliCommand("moltbot doctor --fix")}" to apply changes.`);
|
||||
}
|
||||
|
||||
if (options.workspaceSuggestions !== false) {
|
||||
|
||||
Reference in New Issue
Block a user