feat(policy): add per-channel channelPolicies with hot-reload list mode/lists

This commit is contained in:
2026-02-26 00:23:47 +00:00
parent 6d463a4572
commit d6f908b813
7 changed files with 68 additions and 6 deletions

View File

@@ -178,9 +178,10 @@ export default {
const senderId = normalizeSender(e, c);
const content = typeof e.content === "string" ? e.content : "";
const channel = normalizeChannel(c);
const channelId = typeof c.channelId === "string" ? c.channelId : undefined;
const live = getLivePluginConfig(api, baseConfig as WhisperGateConfig);
const decision = evaluateDecision({ config: live, channel, senderId, content });
const decision = evaluateDecision({ config: live, channel, channelId, senderId, content });
sessionDecision.set(sessionKey, { decision, createdAt: Date.now() });
pruneDecisionMap();
api.logger.debug?.(