refactor: centralize ack reaction gating
This commit is contained in:
@@ -25,6 +25,7 @@ import { resolveEffectiveMessagesConfig, resolveHumanDelayConfig } from "../../a
|
||||
import { createMemoryGetTool, createMemorySearchTool } from "../../agents/tools/memory-tool.js";
|
||||
import { handleSlackAction } from "../../agents/tools/slack-actions.js";
|
||||
import { handleWhatsAppAction } from "../../agents/tools/whatsapp-actions.js";
|
||||
import { shouldAckReaction } from "../../channels/ack-reactions.js";
|
||||
import { resolveCommandAuthorizedFromAuthorizers } from "../../channels/command-gating.js";
|
||||
import { discordMessageActions } from "../../channels/plugins/actions/discord.js";
|
||||
import { telegramMessageActions } from "../../channels/plugins/actions/telegram.js";
|
||||
@@ -198,6 +199,9 @@ export function createPluginRuntime(): PluginRuntime {
|
||||
buildMentionRegexes,
|
||||
matchesMentionPatterns,
|
||||
},
|
||||
reactions: {
|
||||
shouldAckReaction,
|
||||
},
|
||||
groups: {
|
||||
resolveGroupPolicy: resolveChannelGroupPolicy,
|
||||
resolveRequireMention: resolveChannelGroupRequireMention,
|
||||
|
||||
@@ -19,6 +19,7 @@ type SaveMediaBuffer = typeof import("../../media/store.js").saveMediaBuffer;
|
||||
type BuildMentionRegexes = typeof import("../../auto-reply/reply/mentions.js").buildMentionRegexes;
|
||||
type MatchesMentionPatterns =
|
||||
typeof import("../../auto-reply/reply/mentions.js").matchesMentionPatterns;
|
||||
type ShouldAckReaction = typeof import("../../channels/ack-reactions.js").shouldAckReaction;
|
||||
type ResolveChannelGroupPolicy =
|
||||
typeof import("../../config/group-policy.js").resolveChannelGroupPolicy;
|
||||
type ResolveChannelGroupRequireMention =
|
||||
@@ -211,6 +212,9 @@ export type PluginRuntime = {
|
||||
buildMentionRegexes: BuildMentionRegexes;
|
||||
matchesMentionPatterns: MatchesMentionPatterns;
|
||||
};
|
||||
reactions: {
|
||||
shouldAckReaction: ShouldAckReaction;
|
||||
};
|
||||
groups: {
|
||||
resolveGroupPolicy: ResolveChannelGroupPolicy;
|
||||
resolveRequireMention: ResolveChannelGroupRequireMention;
|
||||
|
||||
Reference in New Issue
Block a user