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,7 +1,7 @@
import { describe, expect, it, vi, beforeEach } from "vitest";
import { bluebubblesMessageActions } from "./actions.js";
import type { ClawdbotConfig } from "clawdbot/plugin-sdk";
import type { MoltbotConfig } from "clawdbot/plugin-sdk";
vi.mock("./accounts.js", () => ({
resolveBlueBubblesAccount: vi.fn(({ cfg, accountId }) => {
@@ -49,7 +49,7 @@ describe("bluebubblesMessageActions", () => {
describe("listActions", () => {
it("returns empty array when account is not enabled", () => {
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: { bluebubbles: { enabled: false } },
};
const actions = bluebubblesMessageActions.listActions({ cfg });
@@ -57,7 +57,7 @@ describe("bluebubblesMessageActions", () => {
});
it("returns empty array when account is not configured", () => {
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: { bluebubbles: { enabled: true } },
};
const actions = bluebubblesMessageActions.listActions({ cfg });
@@ -65,7 +65,7 @@ describe("bluebubblesMessageActions", () => {
});
it("returns react action when enabled and configured", () => {
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
enabled: true,
@@ -79,7 +79,7 @@ describe("bluebubblesMessageActions", () => {
});
it("excludes react action when reactions are gated off", () => {
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
enabled: true,
@@ -153,7 +153,7 @@ describe("bluebubblesMessageActions", () => {
describe("handleAction", () => {
it("throws for unsupported actions", async () => {
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -172,7 +172,7 @@ describe("bluebubblesMessageActions", () => {
});
it("throws when emoji is missing for react action", async () => {
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -191,7 +191,7 @@ describe("bluebubblesMessageActions", () => {
});
it("throws when messageId is missing", async () => {
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -213,7 +213,7 @@ describe("bluebubblesMessageActions", () => {
const { resolveChatGuidForTarget } = await import("./send.js");
vi.mocked(resolveChatGuidForTarget).mockResolvedValueOnce(null);
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -234,7 +234,7 @@ describe("bluebubblesMessageActions", () => {
it("sends reaction successfully with chatGuid", async () => {
const { sendBlueBubblesReaction } = await import("./reactions.js");
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -269,7 +269,7 @@ describe("bluebubblesMessageActions", () => {
it("sends reaction removal successfully", async () => {
const { sendBlueBubblesReaction } = await import("./reactions.js");
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -305,7 +305,7 @@ describe("bluebubblesMessageActions", () => {
const { resolveChatGuidForTarget } = await import("./send.js");
vi.mocked(resolveChatGuidForTarget).mockResolvedValueOnce("iMessage;-;+15559876543");
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -335,7 +335,7 @@ describe("bluebubblesMessageActions", () => {
it("passes partIndex when provided", async () => {
const { sendBlueBubblesReaction } = await import("./reactions.js");
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -367,7 +367,7 @@ describe("bluebubblesMessageActions", () => {
const { resolveChatGuidForTarget } = await import("./send.js");
vi.mocked(resolveChatGuidForTarget).mockResolvedValueOnce("iMessage;-;+15550001111");
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -405,7 +405,7 @@ describe("bluebubblesMessageActions", () => {
const { sendBlueBubblesReaction } = await import("./reactions.js");
vi.mocked(resolveBlueBubblesMessageId).mockReturnValueOnce("resolved-uuid");
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -439,7 +439,7 @@ describe("bluebubblesMessageActions", () => {
throw new Error("short id expired");
});
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -465,7 +465,7 @@ describe("bluebubblesMessageActions", () => {
it("accepts message param for edit action", async () => {
const { editBlueBubblesMessage } = await import("./chat.js");
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -491,7 +491,7 @@ describe("bluebubblesMessageActions", () => {
it("accepts message/target aliases for sendWithEffect", async () => {
const { sendMessageBlueBubbles } = await import("./send.js");
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -524,7 +524,7 @@ describe("bluebubblesMessageActions", () => {
it("passes asVoice through sendAttachment", async () => {
const { sendBlueBubblesAttachment } = await import("./attachments.js");
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -558,7 +558,7 @@ describe("bluebubblesMessageActions", () => {
});
it("throws when buffer is missing for setGroupIcon", async () => {
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -580,7 +580,7 @@ describe("bluebubblesMessageActions", () => {
it("sets group icon successfully with chatGuid and buffer", async () => {
const { setGroupIconBlueBubbles } = await import("./chat.js");
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",
@@ -619,7 +619,7 @@ describe("bluebubblesMessageActions", () => {
it("uses default filename when not provided for setGroupIcon", async () => {
const { setGroupIconBlueBubbles } = await import("./chat.js");
const cfg: ClawdbotConfig = {
const cfg: MoltbotConfig = {
channels: {
bluebubbles: {
serverUrl: "http://localhost:1234",