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,18 +1,18 @@
import { describe, expect, it } from "vitest";
import type { ClawdbotConfig } from "../config/config.js";
import type { MoltbotConfig } from "../config/config.js";
import type { SessionEntry } from "../config/sessions.js";
import { resolveSendPolicy } from "./send-policy.js";
describe("resolveSendPolicy", () => {
it("defaults to allow", () => {
const cfg = {} as ClawdbotConfig;
const cfg = {} as MoltbotConfig;
expect(resolveSendPolicy({ cfg })).toBe("allow");
});
it("entry override wins", () => {
const cfg = {
session: { sendPolicy: { default: "allow" } },
} as ClawdbotConfig;
} as MoltbotConfig;
const entry: SessionEntry = {
sessionId: "s",
updatedAt: 0,
@@ -34,7 +34,7 @@ describe("resolveSendPolicy", () => {
],
},
},
} as ClawdbotConfig;
} as MoltbotConfig;
const entry: SessionEntry = {
sessionId: "s",
updatedAt: 0,
@@ -52,7 +52,7 @@ describe("resolveSendPolicy", () => {
rules: [{ action: "deny", match: { keyPrefix: "cron:" } }],
},
},
} as ClawdbotConfig;
} as MoltbotConfig;
expect(resolveSendPolicy({ cfg, sessionKey: "cron:job-1" })).toBe("deny");
});
});

View File

@@ -1,4 +1,4 @@
import type { ClawdbotConfig } from "../config/config.js";
import type { MoltbotConfig } from "../config/config.js";
import type { SessionChatType, SessionEntry } from "../config/sessions.js";
import { normalizeChatType } from "../channels/chat-type.js";
@@ -33,7 +33,7 @@ function deriveChatTypeFromKey(key?: string): SessionChatType | undefined {
}
export function resolveSendPolicy(params: {
cfg: ClawdbotConfig;
cfg: MoltbotConfig;
entry?: SessionEntry;
sessionKey?: string;
channel?: string;