mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 21:41:24 +00:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -20,7 +20,7 @@ import {
|
||||
} from "../commands/onboard-helpers.js";
|
||||
import { formatCliCommand } from "../cli/command-format.js";
|
||||
import type { OnboardOptions } from "../commands/onboard-types.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import { resolveGatewayService } from "../daemon/service.js";
|
||||
import { isSystemdUserServiceAvailable } from "../daemon/systemd.js";
|
||||
import { ensureControlUiAssetsBuilt } from "../infra/control-ui-assets.js";
|
||||
@@ -37,8 +37,8 @@ import type { WizardPrompter } from "./prompts.js";
|
||||
type FinalizeOnboardingOptions = {
|
||||
flow: WizardFlow;
|
||||
opts: OnboardOptions;
|
||||
baseConfig: ClawdbotConfig;
|
||||
nextConfig: ClawdbotConfig;
|
||||
baseConfig: MoltbotConfig;
|
||||
nextConfig: MoltbotConfig;
|
||||
workspaceDir: string;
|
||||
settings: GatewayWizardSettings;
|
||||
prompter: WizardPrompter;
|
||||
@@ -305,9 +305,9 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
await prompter.note(
|
||||
[
|
||||
"Gateway token: shared auth for the Gateway + Control UI.",
|
||||
"Stored in: ~/.clawdbot/clawdbot.json (gateway.auth.token) or CLAWDBOT_GATEWAY_TOKEN.",
|
||||
"Web UI stores a copy in this browser's localStorage (clawdbot.control.settings.v1).",
|
||||
`Get the tokenized link anytime: ${formatCliCommand("clawdbot dashboard --no-open")}`,
|
||||
"Stored in: ~/.clawdbot/moltbot.json (gateway.auth.token) or CLAWDBOT_GATEWAY_TOKEN.",
|
||||
"Web UI stores a copy in this browser's localStorage (moltbot.control.settings.v1).",
|
||||
`Get the tokenized link anytime: ${formatCliCommand("moltbot dashboard --no-open")}`,
|
||||
].join("\n"),
|
||||
"Token",
|
||||
);
|
||||
@@ -337,7 +337,7 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
if (seededInBackground) {
|
||||
await prompter.note(
|
||||
`Web UI seeded in the background. Open later with: ${formatCliCommand(
|
||||
"clawdbot dashboard --no-open",
|
||||
"moltbot dashboard --no-open",
|
||||
)}`,
|
||||
"Web UI",
|
||||
);
|
||||
@@ -364,8 +364,8 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
[
|
||||
`Dashboard link (with token): ${authedUrl}`,
|
||||
controlUiOpened
|
||||
? "Opened in your browser. Keep that tab to control Clawdbot."
|
||||
: "Copy/paste this URL in a browser on this machine to control Clawdbot.",
|
||||
? "Opened in your browser. Keep that tab to control Moltbot."
|
||||
: "Copy/paste this URL in a browser on this machine to control Moltbot.",
|
||||
controlUiOpenHint,
|
||||
]
|
||||
.filter(Boolean)
|
||||
@@ -374,7 +374,7 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
);
|
||||
} else {
|
||||
await prompter.note(
|
||||
`When you're ready: ${formatCliCommand("clawdbot dashboard --no-open")}`,
|
||||
`When you're ready: ${formatCliCommand("moltbot dashboard --no-open")}`,
|
||||
"Later",
|
||||
);
|
||||
}
|
||||
@@ -422,8 +422,8 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
[
|
||||
`Dashboard link (with token): ${authedUrl}`,
|
||||
controlUiOpened
|
||||
? "Opened in your browser. Keep that tab to control Clawdbot."
|
||||
: "Copy/paste this URL in a browser on this machine to control Clawdbot.",
|
||||
? "Opened in your browser. Keep that tab to control Moltbot."
|
||||
: "Copy/paste this URL in a browser on this machine to control Moltbot.",
|
||||
controlUiOpenHint,
|
||||
]
|
||||
.filter(Boolean)
|
||||
@@ -448,10 +448,10 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
: [
|
||||
"If you want your agent to be able to search the web, you’ll need an API key.",
|
||||
"",
|
||||
"Clawdbot uses Brave Search for the `web_search` tool. Without a Brave Search API key, web search won’t work.",
|
||||
"Moltbot uses Brave Search for the `web_search` tool. Without a Brave Search API key, web search won’t work.",
|
||||
"",
|
||||
"Set it up interactively:",
|
||||
`- Run: ${formatCliCommand("clawdbot configure --section web")}`,
|
||||
`- Run: ${formatCliCommand("moltbot configure --section web")}`,
|
||||
"- Enable web_search and paste your Brave Search API key",
|
||||
"",
|
||||
"Alternative: set BRAVE_API_KEY in the Gateway environment (no config changes).",
|
||||
@@ -467,9 +467,9 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
|
||||
await prompter.outro(
|
||||
controlUiOpened
|
||||
? "Onboarding complete. Dashboard opened with your token; keep that tab to control Clawdbot."
|
||||
? "Onboarding complete. Dashboard opened with your token; keep that tab to control Moltbot."
|
||||
: seededInBackground
|
||||
? "Onboarding complete. Web UI seeded in the background; open it anytime with the tokenized link above."
|
||||
: "Onboarding complete. Use the tokenized dashboard link above to control Clawdbot.",
|
||||
: "Onboarding complete. Use the tokenized dashboard link above to control Moltbot.",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { randomToken } from "../commands/onboard-helpers.js";
|
||||
import type { GatewayAuthChoice } from "../commands/onboard-types.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import { findTailscaleBinary } from "../infra/tailscale.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import type {
|
||||
@@ -12,8 +12,8 @@ import type { WizardPrompter } from "./prompts.js";
|
||||
|
||||
type ConfigureGatewayOptions = {
|
||||
flow: WizardFlow;
|
||||
baseConfig: ClawdbotConfig;
|
||||
nextConfig: ClawdbotConfig;
|
||||
baseConfig: MoltbotConfig;
|
||||
nextConfig: MoltbotConfig;
|
||||
localPort: number;
|
||||
quickstartGateway: QuickstartGatewayDefaults;
|
||||
prompter: WizardPrompter;
|
||||
@@ -21,7 +21,7 @@ type ConfigureGatewayOptions = {
|
||||
};
|
||||
|
||||
type ConfigureGatewayResult = {
|
||||
nextConfig: ClawdbotConfig;
|
||||
nextConfig: MoltbotConfig;
|
||||
settings: GatewayWizardSettings;
|
||||
};
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ vi.mock("../tui/tui.js", () => ({
|
||||
describe("runOnboardingWizard", () => {
|
||||
it("exits when config is invalid", async () => {
|
||||
readConfigFileSnapshot.mockResolvedValueOnce({
|
||||
path: "/tmp/.clawdbot/clawdbot.json",
|
||||
path: "/tmp/.clawdbot/moltbot.json",
|
||||
exists: true,
|
||||
raw: "{}",
|
||||
parsed: {},
|
||||
@@ -174,7 +174,7 @@ describe("runOnboardingWizard", () => {
|
||||
it("launches TUI without auto-delivery when hatching", async () => {
|
||||
runTui.mockClear();
|
||||
|
||||
const workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-onboard-"));
|
||||
const workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-onboard-"));
|
||||
await fs.writeFile(path.join(workspaceDir, DEFAULT_BOOTSTRAP_FILENAME), "{}");
|
||||
|
||||
const select: WizardPrompter["select"] = vi.fn(async (opts) => {
|
||||
@@ -230,7 +230,7 @@ describe("runOnboardingWizard", () => {
|
||||
it("offers TUI hatch even without BOOTSTRAP.md", async () => {
|
||||
runTui.mockClear();
|
||||
|
||||
const workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-onboard-"));
|
||||
const workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-onboard-"));
|
||||
|
||||
const select: WizardPrompter["select"] = vi.fn(async (opts) => {
|
||||
if (opts.message === "How do you want to hatch your bot?") return "tui";
|
||||
|
||||
@@ -27,7 +27,7 @@ import type {
|
||||
ResetScope,
|
||||
} from "../commands/onboard-types.js";
|
||||
import { formatCliCommand } from "../cli/command-format.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import {
|
||||
DEFAULT_GATEWAY_PORT,
|
||||
readConfigFileSnapshot,
|
||||
@@ -53,11 +53,11 @@ async function requireRiskAcknowledgement(params: {
|
||||
[
|
||||
"Security warning — please read.",
|
||||
"",
|
||||
"Clawdbot is a hobby project and still in beta. Expect sharp edges.",
|
||||
"Moltbot is a hobby project and still in beta. Expect sharp edges.",
|
||||
"This bot can read files and run actions if tools are enabled.",
|
||||
"A bad prompt can trick it into doing unsafe things.",
|
||||
"",
|
||||
"If you’re not comfortable with basic security and access control, don’t run Clawdbot.",
|
||||
"If you’re not comfortable with basic security and access control, don’t run Moltbot.",
|
||||
"Ask someone experienced to help before enabling tools or exposing it to the internet.",
|
||||
"",
|
||||
"Recommended baseline:",
|
||||
@@ -67,8 +67,8 @@ async function requireRiskAcknowledgement(params: {
|
||||
"- Use the strongest available model for any bot with tools or untrusted inboxes.",
|
||||
"",
|
||||
"Run regularly:",
|
||||
"clawdbot security audit --deep",
|
||||
"clawdbot security audit --fix",
|
||||
"moltbot security audit --deep",
|
||||
"moltbot security audit --fix",
|
||||
"",
|
||||
"Must read: https://docs.molt.bot/gateway/security",
|
||||
].join("\n"),
|
||||
@@ -90,11 +90,11 @@ export async function runOnboardingWizard(
|
||||
prompter: WizardPrompter,
|
||||
) {
|
||||
printWizardHeader(runtime);
|
||||
await prompter.intro("Clawdbot onboarding");
|
||||
await prompter.intro("Moltbot onboarding");
|
||||
await requireRiskAcknowledgement({ opts, prompter });
|
||||
|
||||
const snapshot = await readConfigFileSnapshot();
|
||||
let baseConfig: ClawdbotConfig = snapshot.valid ? snapshot.config : {};
|
||||
let baseConfig: MoltbotConfig = snapshot.valid ? snapshot.config : {};
|
||||
|
||||
if (snapshot.exists && !snapshot.valid) {
|
||||
await prompter.note(summarizeExistingConfig(baseConfig), "Invalid config");
|
||||
@@ -109,13 +109,13 @@ export async function runOnboardingWizard(
|
||||
);
|
||||
}
|
||||
await prompter.outro(
|
||||
`Config invalid. Run \`${formatCliCommand("clawdbot doctor")}\` to repair it, then re-run onboarding.`,
|
||||
`Config invalid. Run \`${formatCliCommand("moltbot doctor")}\` to repair it, then re-run onboarding.`,
|
||||
);
|
||||
runtime.exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
const quickstartHint = `Configure details later via ${formatCliCommand("clawdbot configure")}.`;
|
||||
const quickstartHint = `Configure details later via ${formatCliCommand("moltbot configure")}.`;
|
||||
const manualHint = "Configure port, network, Tailscale, and auth options.";
|
||||
const explicitFlowRaw = opts.flow?.trim();
|
||||
const normalizedExplicitFlow = explicitFlowRaw === "manual" ? "advanced" : explicitFlowRaw;
|
||||
@@ -335,7 +335,7 @@ export async function runOnboardingWizard(
|
||||
|
||||
const workspaceDir = resolveUserPath(workspaceInput.trim() || DEFAULT_WORKSPACE);
|
||||
|
||||
let nextConfig: ClawdbotConfig = {
|
||||
let nextConfig: MoltbotConfig = {
|
||||
...baseConfig,
|
||||
agents: {
|
||||
...baseConfig.agents,
|
||||
|
||||
Reference in New Issue
Block a user