refactor: rename to openclaw

This commit is contained in:
Peter Steinberger
2026-01-30 03:15:10 +01:00
parent 4583f88626
commit 9a7160786a
2357 changed files with 16688 additions and 16788 deletions

View File

@@ -26,7 +26,7 @@ beforeEach(() => {
readConfigFileSnapshot.mockReset();
writeConfigFile.mockReset().mockResolvedValue(undefined);
resolveMoltbotPackageRoot.mockReset().mockResolvedValue(null);
resolveOpenClawPackageRoot.mockReset().mockResolvedValue(null);
runGatewayUpdate.mockReset().mockResolvedValue({
status: "skipped",
mode: "unknown",
@@ -34,7 +34,7 @@ beforeEach(() => {
durationMs: 0,
});
legacyReadConfigFileSnapshot.mockReset().mockResolvedValue({
path: "/tmp/moltbot.json",
path: "/tmp/openclaw.json",
exists: false,
raw: null,
parsed: {},
@@ -75,11 +75,11 @@ beforeEach(() => {
originalIsTTY = process.stdin.isTTY;
setStdinTty(true);
originalStateDir = process.env.CLAWDBOT_STATE_DIR;
originalUpdateInProgress = process.env.CLAWDBOT_UPDATE_IN_PROGRESS;
process.env.CLAWDBOT_UPDATE_IN_PROGRESS = "1";
tempStateDir = fs.mkdtempSync(path.join(os.tmpdir(), "moltbot-doctor-state-"));
process.env.CLAWDBOT_STATE_DIR = tempStateDir;
originalStateDir = process.env.OPENCLAW_STATE_DIR;
originalUpdateInProgress = process.env.OPENCLAW_UPDATE_IN_PROGRESS;
process.env.OPENCLAW_UPDATE_IN_PROGRESS = "1";
tempStateDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-doctor-state-"));
process.env.OPENCLAW_STATE_DIR = tempStateDir;
fs.mkdirSync(path.join(tempStateDir, "agents", "main", "sessions"), {
recursive: true,
});
@@ -89,14 +89,14 @@ beforeEach(() => {
afterEach(() => {
setStdinTty(originalIsTTY);
if (originalStateDir === undefined) {
delete process.env.CLAWDBOT_STATE_DIR;
delete process.env.OPENCLAW_STATE_DIR;
} else {
process.env.CLAWDBOT_STATE_DIR = originalStateDir;
process.env.OPENCLAW_STATE_DIR = originalStateDir;
}
if (originalUpdateInProgress === undefined) {
delete process.env.CLAWDBOT_UPDATE_IN_PROGRESS;
delete process.env.OPENCLAW_UPDATE_IN_PROGRESS;
} else {
process.env.CLAWDBOT_UPDATE_IN_PROGRESS = originalUpdateInProgress;
process.env.OPENCLAW_UPDATE_IN_PROGRESS = originalUpdateInProgress;
}
if (tempStateDir) {
fs.rmSync(tempStateDir, { recursive: true, force: true });
@@ -109,7 +109,7 @@ const confirm = vi.fn().mockResolvedValue(true);
const select = vi.fn().mockResolvedValue("node");
const note = vi.fn();
const writeConfigFile = vi.fn().mockResolvedValue(undefined);
const resolveMoltbotPackageRoot = vi.fn().mockResolvedValue(null);
const resolveOpenClawPackageRoot = vi.fn().mockResolvedValue(null);
const runGatewayUpdate = vi.fn().mockResolvedValue({
status: "skipped",
mode: "unknown",
@@ -133,7 +133,7 @@ const runCommandWithTimeout = vi.fn().mockResolvedValue({
const ensureAuthProfileStore = vi.fn().mockReturnValue({ version: 1, profiles: {} });
const legacyReadConfigFileSnapshot = vi.fn().mockResolvedValue({
path: "/tmp/moltbot.json",
path: "/tmp/openclaw.json",
exists: false,
raw: null,
parsed: {},
@@ -173,14 +173,14 @@ vi.mock("../agents/skills-status.js", () => ({
}));
vi.mock("../plugins/loader.js", () => ({
loadMoltbotPlugins: () => ({ plugins: [], diagnostics: [] }),
loadOpenClawPlugins: () => ({ plugins: [], diagnostics: [] }),
}));
vi.mock("../config/config.js", async (importOriginal) => {
const actual = await importOriginal();
return {
...actual,
CONFIG_PATH: "/tmp/moltbot.json",
CONFIG_PATH: "/tmp/openclaw.json",
createConfigIO,
readConfigFileSnapshot,
writeConfigFile,
@@ -215,8 +215,8 @@ vi.mock("../process/exec.js", () => ({
runCommandWithTimeout,
}));
vi.mock("../infra/moltbot-root.js", () => ({
resolveMoltbotPackageRoot,
vi.mock("../infra/openclaw-root.js", () => ({
resolveOpenClawPackageRoot,
}));
vi.mock("../infra/update-runner.js", () => ({
@@ -336,7 +336,7 @@ vi.mock("./doctor-update.js", () => ({
describe("doctor command", () => {
it("warns when the state directory is missing", async () => {
readConfigFileSnapshot.mockResolvedValue({
path: "/tmp/moltbot.json",
path: "/tmp/openclaw.json",
exists: true,
raw: "{}",
parsed: {},
@@ -346,9 +346,9 @@ describe("doctor command", () => {
legacyIssues: [],
});
const missingDir = fs.mkdtempSync(path.join(os.tmpdir(), "moltbot-missing-state-"));
const missingDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-missing-state-"));
fs.rmSync(missingDir, { recursive: true, force: true });
process.env.CLAWDBOT_STATE_DIR = missingDir;
process.env.OPENCLAW_STATE_DIR = missingDir;
note.mockClear();
const { doctorCommand } = await import("./doctor.js");
@@ -364,7 +364,7 @@ describe("doctor command", () => {
it("warns about opencode provider overrides", async () => {
readConfigFileSnapshot.mockResolvedValue({
path: "/tmp/moltbot.json",
path: "/tmp/openclaw.json",
exists: true,
raw: "{}",
parsed: {},
@@ -396,9 +396,9 @@ describe("doctor command", () => {
expect(warned).toBe(true);
});
it("skips gateway auth warning when CLAWDBOT_GATEWAY_TOKEN is set", async () => {
it("skips gateway auth warning when OPENCLAW_GATEWAY_TOKEN is set", async () => {
readConfigFileSnapshot.mockResolvedValue({
path: "/tmp/moltbot.json",
path: "/tmp/openclaw.json",
exists: true,
raw: "{}",
parsed: {},
@@ -410,8 +410,8 @@ describe("doctor command", () => {
legacyIssues: [],
});
const prevToken = process.env.CLAWDBOT_GATEWAY_TOKEN;
process.env.CLAWDBOT_GATEWAY_TOKEN = "env-token-1234567890";
const prevToken = process.env.OPENCLAW_GATEWAY_TOKEN;
process.env.OPENCLAW_GATEWAY_TOKEN = "env-token-1234567890";
note.mockClear();
try {
@@ -421,8 +421,8 @@ describe("doctor command", () => {
{ nonInteractive: true, workspaceSuggestions: false },
);
} finally {
if (prevToken === undefined) delete process.env.CLAWDBOT_GATEWAY_TOKEN;
else process.env.CLAWDBOT_GATEWAY_TOKEN = prevToken;
if (prevToken === undefined) delete process.env.OPENCLAW_GATEWAY_TOKEN;
else process.env.OPENCLAW_GATEWAY_TOKEN = prevToken;
}
const warned = note.mock.calls.some(([message]) =>