mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 07:50:22 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } 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 MoltbotConfig;
|
||||
const cfg = {} as OpenClawConfig;
|
||||
expect(resolveSendPolicy({ cfg })).toBe("allow");
|
||||
});
|
||||
|
||||
it("entry override wins", () => {
|
||||
const cfg = {
|
||||
session: { sendPolicy: { default: "allow" } },
|
||||
} as MoltbotConfig;
|
||||
} as OpenClawConfig;
|
||||
const entry: SessionEntry = {
|
||||
sessionId: "s",
|
||||
updatedAt: 0,
|
||||
@@ -34,7 +34,7 @@ describe("resolveSendPolicy", () => {
|
||||
],
|
||||
},
|
||||
},
|
||||
} as MoltbotConfig;
|
||||
} as OpenClawConfig;
|
||||
const entry: SessionEntry = {
|
||||
sessionId: "s",
|
||||
updatedAt: 0,
|
||||
@@ -52,7 +52,7 @@ describe("resolveSendPolicy", () => {
|
||||
rules: [{ action: "deny", match: { keyPrefix: "cron:" } }],
|
||||
},
|
||||
},
|
||||
} as MoltbotConfig;
|
||||
} as OpenClawConfig;
|
||||
expect(resolveSendPolicy({ cfg, sessionKey: "cron:job-1" })).toBe("deny");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } 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: MoltbotConfig;
|
||||
cfg: OpenClawConfig;
|
||||
entry?: SessionEntry;
|
||||
sessionKey?: string;
|
||||
channel?: string;
|
||||
|
||||
Reference in New Issue
Block a user