mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 16:48:26 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { formatCliCommand } from "../cli/command-format.js";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { readConfigFileSnapshot, resolveGatewayPort, writeConfigFile } from "../config/config.js";
|
||||
import { logConfigUpdated } from "../config/logging.js";
|
||||
import { ensureControlUiAssetsBuilt } from "../infra/control-ui-assets.js";
|
||||
@@ -79,7 +79,7 @@ async function promptChannelMode(runtime: RuntimeEnv): Promise<ChannelsWizardMod
|
||||
{
|
||||
value: "remove",
|
||||
label: "Remove channel config",
|
||||
hint: "Delete channel tokens/settings from moltbot.json",
|
||||
hint: "Delete channel tokens/settings from openclaw.json",
|
||||
},
|
||||
],
|
||||
initialValue: "configure",
|
||||
@@ -89,9 +89,9 @@ async function promptChannelMode(runtime: RuntimeEnv): Promise<ChannelsWizardMod
|
||||
}
|
||||
|
||||
async function promptWebToolsConfig(
|
||||
nextConfig: MoltbotConfig,
|
||||
nextConfig: OpenClawConfig,
|
||||
runtime: RuntimeEnv,
|
||||
): Promise<MoltbotConfig> {
|
||||
): Promise<OpenClawConfig> {
|
||||
const existingSearch = nextConfig.tools?.web?.search;
|
||||
const existingFetch = nextConfig.tools?.web?.fetch;
|
||||
const hasSearchKey = Boolean(existingSearch?.apiKey);
|
||||
@@ -100,7 +100,7 @@ async function promptWebToolsConfig(
|
||||
[
|
||||
"Web search lets your agent look things up online using the `web_search` tool.",
|
||||
"It requires a Brave Search API key (you can store it in the config or set BRAVE_API_KEY in the Gateway environment).",
|
||||
"Docs: https://docs.molt.bot/tools/web",
|
||||
"Docs: https://docs.openclaw.ai/tools/web",
|
||||
].join("\n"),
|
||||
"Web search",
|
||||
);
|
||||
@@ -136,7 +136,7 @@ async function promptWebToolsConfig(
|
||||
[
|
||||
"No key stored yet, so web_search will stay unavailable.",
|
||||
"Store a key here or set BRAVE_API_KEY in the Gateway environment.",
|
||||
"Docs: https://docs.molt.bot/tools/web",
|
||||
"Docs: https://docs.openclaw.ai/tools/web",
|
||||
].join("\n"),
|
||||
"Web search",
|
||||
);
|
||||
@@ -175,11 +175,11 @@ export async function runConfigureWizard(
|
||||
) {
|
||||
try {
|
||||
printWizardHeader(runtime);
|
||||
intro(opts.command === "update" ? "Moltbot update wizard" : "Moltbot configure");
|
||||
intro(opts.command === "update" ? "OpenClaw update wizard" : "OpenClaw configure");
|
||||
const prompter = createClackPrompter();
|
||||
|
||||
const snapshot = await readConfigFileSnapshot();
|
||||
const baseConfig: MoltbotConfig = snapshot.valid ? snapshot.config : {};
|
||||
const baseConfig: OpenClawConfig = snapshot.valid ? snapshot.config : {};
|
||||
|
||||
if (snapshot.exists) {
|
||||
const title = snapshot.valid ? "Existing config detected" : "Invalid config";
|
||||
@@ -189,14 +189,14 @@ export async function runConfigureWizard(
|
||||
[
|
||||
...snapshot.issues.map((iss) => `- ${iss.path}: ${iss.message}`),
|
||||
"",
|
||||
"Docs: https://docs.molt.bot/gateway/configuration",
|
||||
"Docs: https://docs.openclaw.ai/gateway/configuration",
|
||||
].join("\n"),
|
||||
"Config issues",
|
||||
);
|
||||
}
|
||||
if (!snapshot.valid) {
|
||||
outro(
|
||||
`Config invalid. Run \`${formatCliCommand("moltbot doctor")}\` to repair it, then re-run configure.`,
|
||||
`Config invalid. Run \`${formatCliCommand("openclaw doctor")}\` to repair it, then re-run configure.`,
|
||||
);
|
||||
runtime.exit(1);
|
||||
return;
|
||||
@@ -206,8 +206,8 @@ export async function runConfigureWizard(
|
||||
const localUrl = "ws://127.0.0.1:18789";
|
||||
const localProbe = await probeGatewayReachable({
|
||||
url: localUrl,
|
||||
token: baseConfig.gateway?.auth?.token ?? process.env.CLAWDBOT_GATEWAY_TOKEN,
|
||||
password: baseConfig.gateway?.auth?.password ?? process.env.CLAWDBOT_GATEWAY_PASSWORD,
|
||||
token: baseConfig.gateway?.auth?.token ?? process.env.OPENCLAW_GATEWAY_TOKEN,
|
||||
password: baseConfig.gateway?.auth?.password ?? process.env.OPENCLAW_GATEWAY_PASSWORD,
|
||||
});
|
||||
const remoteUrl = baseConfig.gateway?.remote?.url?.trim() ?? "";
|
||||
const remoteProbe = remoteUrl
|
||||
@@ -274,7 +274,7 @@ export async function runConfigureWizard(
|
||||
let gatewayToken: string | undefined =
|
||||
nextConfig.gateway?.auth?.token ??
|
||||
baseConfig.gateway?.auth?.token ??
|
||||
process.env.CLAWDBOT_GATEWAY_TOKEN;
|
||||
process.env.OPENCLAW_GATEWAY_TOKEN;
|
||||
|
||||
const persistConfig = async () => {
|
||||
nextConfig = applyWizardMetadata(nextConfig, {
|
||||
@@ -377,9 +377,9 @@ export async function runConfigureWizard(
|
||||
const remoteUrl = nextConfig.gateway?.remote?.url?.trim();
|
||||
const wsUrl =
|
||||
nextConfig.gateway?.mode === "remote" && remoteUrl ? remoteUrl : localLinks.wsUrl;
|
||||
const token = nextConfig.gateway?.auth?.token ?? process.env.CLAWDBOT_GATEWAY_TOKEN;
|
||||
const token = nextConfig.gateway?.auth?.token ?? process.env.OPENCLAW_GATEWAY_TOKEN;
|
||||
const password =
|
||||
nextConfig.gateway?.auth?.password ?? process.env.CLAWDBOT_GATEWAY_PASSWORD;
|
||||
nextConfig.gateway?.auth?.password ?? process.env.OPENCLAW_GATEWAY_PASSWORD;
|
||||
await waitForGatewayReachable({
|
||||
url: wsUrl,
|
||||
token,
|
||||
@@ -393,8 +393,8 @@ export async function runConfigureWizard(
|
||||
note(
|
||||
[
|
||||
"Docs:",
|
||||
"https://docs.molt.bot/gateway/health",
|
||||
"https://docs.molt.bot/gateway/troubleshooting",
|
||||
"https://docs.openclaw.ai/gateway/health",
|
||||
"https://docs.openclaw.ai/gateway/troubleshooting",
|
||||
].join("\n"),
|
||||
"Health check help",
|
||||
);
|
||||
@@ -502,9 +502,9 @@ export async function runConfigureWizard(
|
||||
const remoteUrl = nextConfig.gateway?.remote?.url?.trim();
|
||||
const wsUrl =
|
||||
nextConfig.gateway?.mode === "remote" && remoteUrl ? remoteUrl : localLinks.wsUrl;
|
||||
const token = nextConfig.gateway?.auth?.token ?? process.env.CLAWDBOT_GATEWAY_TOKEN;
|
||||
const token = nextConfig.gateway?.auth?.token ?? process.env.OPENCLAW_GATEWAY_TOKEN;
|
||||
const password =
|
||||
nextConfig.gateway?.auth?.password ?? process.env.CLAWDBOT_GATEWAY_PASSWORD;
|
||||
nextConfig.gateway?.auth?.password ?? process.env.OPENCLAW_GATEWAY_PASSWORD;
|
||||
await waitForGatewayReachable({
|
||||
url: wsUrl,
|
||||
token,
|
||||
@@ -518,8 +518,8 @@ export async function runConfigureWizard(
|
||||
note(
|
||||
[
|
||||
"Docs:",
|
||||
"https://docs.molt.bot/gateway/health",
|
||||
"https://docs.molt.bot/gateway/troubleshooting",
|
||||
"https://docs.openclaw.ai/gateway/health",
|
||||
"https://docs.openclaw.ai/gateway/troubleshooting",
|
||||
].join("\n"),
|
||||
"Health check help",
|
||||
);
|
||||
@@ -551,9 +551,9 @@ export async function runConfigureWizard(
|
||||
basePath: nextConfig.gateway?.controlUi?.basePath,
|
||||
});
|
||||
// Try both new and old passwords since gateway may still have old config.
|
||||
const newPassword = nextConfig.gateway?.auth?.password ?? process.env.CLAWDBOT_GATEWAY_PASSWORD;
|
||||
const oldPassword = baseConfig.gateway?.auth?.password ?? process.env.CLAWDBOT_GATEWAY_PASSWORD;
|
||||
const token = nextConfig.gateway?.auth?.token ?? process.env.CLAWDBOT_GATEWAY_TOKEN;
|
||||
const newPassword = nextConfig.gateway?.auth?.password ?? process.env.OPENCLAW_GATEWAY_PASSWORD;
|
||||
const oldPassword = baseConfig.gateway?.auth?.password ?? process.env.OPENCLAW_GATEWAY_PASSWORD;
|
||||
const token = nextConfig.gateway?.auth?.token ?? process.env.OPENCLAW_GATEWAY_TOKEN;
|
||||
|
||||
let gatewayProbe = await probeGatewayReachable({
|
||||
url: links.wsUrl,
|
||||
@@ -577,7 +577,7 @@ export async function runConfigureWizard(
|
||||
`Web UI: ${links.httpUrl}`,
|
||||
`Gateway WS: ${links.wsUrl}`,
|
||||
gatewayStatusLine,
|
||||
"Docs: https://docs.molt.bot/web/control-ui",
|
||||
"Docs: https://docs.openclaw.ai/web/control-ui",
|
||||
].join("\n"),
|
||||
"Control UI",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user