refactor: rename clawdbot to moltbot with legacy compat

This commit is contained in:
Peter Steinberger
2026-01-27 12:19:58 +00:00
parent 83460df96f
commit 6d16a658e5
1839 changed files with 11250 additions and 11199 deletions

View File

@@ -13,12 +13,12 @@ vi.mock("../../plugins/install.js", () => ({
}));
vi.mock("../../plugins/loader.js", () => ({
loadClawdbotPlugins: vi.fn(),
loadMoltbotPlugins: vi.fn(),
}));
import fs from "node:fs";
import type { ChannelPluginCatalogEntry } from "../../channels/plugins/catalog.js";
import type { ClawdbotConfig } from "../../config/config.js";
import type { MoltbotConfig } from "../../config/config.js";
import type { WizardPrompter } from "../../wizard/prompts.js";
import { makePrompter, makeRuntime } from "./__tests__/test-utils.js";
import { ensureOnboardingPluginInstalled } from "./plugin-install.js";
@@ -34,7 +34,7 @@ const baseEntry: ChannelPluginCatalogEntry = {
blurb: "Test",
},
install: {
npmSpec: "@clawdbot/zalo",
npmSpec: "@moltbot/zalo",
localPath: "extensions/zalo",
},
};
@@ -49,7 +49,7 @@ describe("ensureOnboardingPluginInstalled", () => {
const prompter = makePrompter({
select: vi.fn(async () => "npm") as WizardPrompter["select"],
});
const cfg: ClawdbotConfig = { plugins: { allow: ["other"] } };
const cfg: MoltbotConfig = { plugins: { allow: ["other"] } };
vi.mocked(fs.existsSync).mockReturnValue(false);
installPluginFromNpmSpec.mockResolvedValue({
ok: true,
@@ -69,10 +69,10 @@ describe("ensureOnboardingPluginInstalled", () => {
expect(result.cfg.plugins?.entries?.zalo?.enabled).toBe(true);
expect(result.cfg.plugins?.allow).toContain("zalo");
expect(result.cfg.plugins?.installs?.zalo?.source).toBe("npm");
expect(result.cfg.plugins?.installs?.zalo?.spec).toBe("@clawdbot/zalo");
expect(result.cfg.plugins?.installs?.zalo?.spec).toBe("@moltbot/zalo");
expect(result.cfg.plugins?.installs?.zalo?.installPath).toBe("/tmp/zalo");
expect(installPluginFromNpmSpec).toHaveBeenCalledWith(
expect.objectContaining({ spec: "@clawdbot/zalo" }),
expect.objectContaining({ spec: "@moltbot/zalo" }),
);
});
@@ -81,7 +81,7 @@ describe("ensureOnboardingPluginInstalled", () => {
const prompter = makePrompter({
select: vi.fn(async () => "local") as WizardPrompter["select"],
});
const cfg: ClawdbotConfig = {};
const cfg: MoltbotConfig = {};
vi.mocked(fs.existsSync).mockImplementation((value) => {
const raw = String(value);
return (
@@ -106,7 +106,7 @@ describe("ensureOnboardingPluginInstalled", () => {
const runtime = makeRuntime();
const select = vi.fn(async () => "skip") as WizardPrompter["select"];
const prompter = makePrompter({ select });
const cfg: ClawdbotConfig = { update: { channel: "dev" } };
const cfg: MoltbotConfig = { update: { channel: "dev" } };
vi.mocked(fs.existsSync).mockImplementation((value) => {
const raw = String(value);
return (
@@ -129,7 +129,7 @@ describe("ensureOnboardingPluginInstalled", () => {
const runtime = makeRuntime();
const select = vi.fn(async () => "skip") as WizardPrompter["select"];
const prompter = makePrompter({ select });
const cfg: ClawdbotConfig = { update: { channel: "beta" } };
const cfg: MoltbotConfig = { update: { channel: "beta" } };
vi.mocked(fs.existsSync).mockImplementation((value) => {
const raw = String(value);
return (
@@ -157,7 +157,7 @@ describe("ensureOnboardingPluginInstalled", () => {
note,
confirm,
});
const cfg: ClawdbotConfig = {};
const cfg: MoltbotConfig = {};
vi.mocked(fs.existsSync).mockImplementation((value) => {
const raw = String(value);
return (