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

@@ -1,6 +1,6 @@
import { describe, expect, it, vi } from "vitest";
import type { ClawdbotConfig } from "../../../config/config.js";
import type { MoltbotConfig } from "../../../config/config.js";
type SendMessageDiscord = typeof import("../../../discord/send.js").sendMessageDiscord;
type SendPollDiscord = typeof import("../../../discord/send.js").sendPollDiscord;
@@ -34,7 +34,7 @@ const loadDiscordMessageActions = async () => {
describe("discord message actions", () => {
it("lists channel and upload actions by default", async () => {
const cfg = { channels: { discord: { token: "d0" } } } as ClawdbotConfig;
const cfg = { channels: { discord: { token: "d0" } } } as MoltbotConfig;
const discordMessageActions = await loadDiscordMessageActions();
const actions = discordMessageActions.listActions?.({ cfg }) ?? [];
@@ -46,7 +46,7 @@ describe("discord message actions", () => {
it("respects disabled channel actions", async () => {
const cfg = {
channels: { discord: { token: "d0", actions: { channels: false } } },
} as ClawdbotConfig;
} as MoltbotConfig;
const discordMessageActions = await loadDiscordMessageActions();
const actions = discordMessageActions.listActions?.({ cfg }) ?? [];
@@ -65,7 +65,7 @@ describe("handleDiscordMessageAction", () => {
to: "channel:123",
message: "hi",
},
cfg: {} as ClawdbotConfig,
cfg: {} as MoltbotConfig,
accountId: "ops",
});
@@ -90,7 +90,7 @@ describe("handleDiscordMessageAction", () => {
pollOption: ["Yes", "No"],
accountId: "marve",
},
cfg: {} as ClawdbotConfig,
cfg: {} as MoltbotConfig,
});
expect(sendPollDiscord).toHaveBeenCalledWith(
@@ -115,7 +115,7 @@ describe("handleDiscordMessageAction", () => {
channelId: "123",
message: "hi",
},
cfg: {} as ClawdbotConfig,
cfg: {} as MoltbotConfig,
accountId: "ops",
});
@@ -141,7 +141,7 @@ describe("handleDiscordMessageAction", () => {
channelId: "123",
message: "hi",
},
cfg: {} as ClawdbotConfig,
cfg: {} as MoltbotConfig,
accountId: "ops",
});

View File

@@ -1,6 +1,6 @@
import { describe, expect, it, vi } from "vitest";
import type { ClawdbotConfig } from "../../../config/config.js";
import type { MoltbotConfig } from "../../../config/config.js";
import { signalMessageActions } from "./signal.js";
const sendReactionSignal = vi.fn(async () => ({ ok: true }));
@@ -13,14 +13,14 @@ vi.mock("../../../signal/send-reactions.js", () => ({
describe("signalMessageActions", () => {
it("returns no actions when no configured accounts exist", () => {
const cfg = {} as ClawdbotConfig;
const cfg = {} as MoltbotConfig;
expect(signalMessageActions.listActions({ cfg })).toEqual([]);
});
it("hides react when reactions are disabled", () => {
const cfg = {
channels: { signal: { account: "+15550001111", actions: { reactions: false } } },
} as ClawdbotConfig;
} as MoltbotConfig;
expect(signalMessageActions.listActions({ cfg })).toEqual(["send"]);
});
@@ -34,7 +34,7 @@ describe("signalMessageActions", () => {
},
},
},
} as ClawdbotConfig;
} as MoltbotConfig;
expect(signalMessageActions.listActions({ cfg })).toEqual(["send", "react"]);
});
@@ -46,7 +46,7 @@ describe("signalMessageActions", () => {
it("blocks reactions when action gate is disabled", async () => {
const cfg = {
channels: { signal: { account: "+15550001111", actions: { reactions: false } } },
} as ClawdbotConfig;
} as MoltbotConfig;
await expect(
signalMessageActions.handleAction({
@@ -69,7 +69,7 @@ describe("signalMessageActions", () => {
},
},
},
} as ClawdbotConfig;
} as MoltbotConfig;
await signalMessageActions.handleAction({
action: "react",
@@ -87,7 +87,7 @@ describe("signalMessageActions", () => {
sendReactionSignal.mockClear();
const cfg = {
channels: { signal: { account: "+15550001111" } },
} as ClawdbotConfig;
} as MoltbotConfig;
await signalMessageActions.handleAction({
action: "react",
@@ -111,7 +111,7 @@ describe("signalMessageActions", () => {
it("requires targetAuthor for group reactions", async () => {
const cfg = {
channels: { signal: { account: "+15550001111" } },
} as ClawdbotConfig;
} as MoltbotConfig;
await expect(
signalMessageActions.handleAction({
@@ -127,7 +127,7 @@ describe("signalMessageActions", () => {
sendReactionSignal.mockClear();
const cfg = {
channels: { signal: { account: "+15550001111" } },
} as ClawdbotConfig;
} as MoltbotConfig;
await signalMessageActions.handleAction({
action: "react",

View File

@@ -1,6 +1,6 @@
import { describe, expect, it, vi } from "vitest";
import type { ClawdbotConfig } from "../../../config/config.js";
import type { MoltbotConfig } from "../../../config/config.js";
import { telegramMessageActions } from "./telegram.js";
const handleTelegramAction = vi.fn(async () => ({ ok: true }));
@@ -11,7 +11,7 @@ vi.mock("../../../agents/tools/telegram-actions.js", () => ({
describe("telegramMessageActions", () => {
it("excludes sticker actions when not enabled", () => {
const cfg = { channels: { telegram: { botToken: "tok" } } } as ClawdbotConfig;
const cfg = { channels: { telegram: { botToken: "tok" } } } as MoltbotConfig;
const actions = telegramMessageActions.listActions({ cfg });
expect(actions).not.toContain("sticker");
expect(actions).not.toContain("sticker-search");
@@ -19,7 +19,7 @@ describe("telegramMessageActions", () => {
it("allows media-only sends and passes asVoice", async () => {
handleTelegramAction.mockClear();
const cfg = { channels: { telegram: { botToken: "tok" } } } as ClawdbotConfig;
const cfg = { channels: { telegram: { botToken: "tok" } } } as MoltbotConfig;
await telegramMessageActions.handleAction({
action: "send",
@@ -46,7 +46,7 @@ describe("telegramMessageActions", () => {
it("passes silent flag for silent sends", async () => {
handleTelegramAction.mockClear();
const cfg = { channels: { telegram: { botToken: "tok" } } } as ClawdbotConfig;
const cfg = { channels: { telegram: { botToken: "tok" } } } as MoltbotConfig;
await telegramMessageActions.handleAction({
action: "send",
@@ -72,7 +72,7 @@ describe("telegramMessageActions", () => {
it("maps edit action params into editMessage", async () => {
handleTelegramAction.mockClear();
const cfg = { channels: { telegram: { botToken: "tok" } } } as ClawdbotConfig;
const cfg = { channels: { telegram: { botToken: "tok" } } } as MoltbotConfig;
await telegramMessageActions.handleAction({
action: "edit",
@@ -101,7 +101,7 @@ describe("telegramMessageActions", () => {
it("rejects non-integer messageId for edit before reaching telegram-actions", async () => {
handleTelegramAction.mockClear();
const cfg = { channels: { telegram: { botToken: "tok" } } } as ClawdbotConfig;
const cfg = { channels: { telegram: { botToken: "tok" } } } as MoltbotConfig;
await expect(
telegramMessageActions.handleAction({