diff --git a/src/agents/channel-tools.ts b/src/agents/channel-tools.ts index aad6d103f0c..b6c36682a1f 100644 --- a/src/agents/channel-tools.ts +++ b/src/agents/channel-tools.ts @@ -17,6 +17,19 @@ type ChannelAgentToolMeta = { channelId: string; }; +type ChannelMessageActionDiscoveryParams = { + cfg?: OpenClawConfig; + currentChannelId?: string | null; + currentThreadTs?: string | null; + currentMessageId?: string | number | null; + accountId?: string | null; + sessionKey?: string | null; + sessionId?: string | null; + agentId?: string | null; + requesterSenderId?: string | null; + senderIsOwner?: boolean; +}; + const channelAgentToolMeta = new WeakMap(); export function getChannelAgentToolMeta(tool: ChannelAgentTool): ChannelAgentToolMeta | undefined { @@ -34,19 +47,11 @@ export function copyChannelAgentToolMeta(source: ChannelAgentTool, target: Chann * Get the list of supported message actions for a specific channel. * Returns an empty array if channel is not found or has no actions configured. */ -export function listChannelSupportedActions(params: { - cfg?: OpenClawConfig; - channel?: string; - currentChannelId?: string | null; - currentThreadTs?: string | null; - currentMessageId?: string | number | null; - accountId?: string | null; - sessionKey?: string | null; - sessionId?: string | null; - agentId?: string | null; - requesterSenderId?: string | null; - senderIsOwner?: boolean; -}): ChannelMessageActionName[] { +export function listChannelSupportedActions( + params: ChannelMessageActionDiscoveryParams & { + channel?: string; + }, +): ChannelMessageActionName[] { const channelId = resolveMessageActionDiscoveryChannelId(params.channel); if (!channelId) { return []; @@ -66,18 +71,9 @@ export function listChannelSupportedActions(params: { /** * Get the list of all supported message actions across all configured channels. */ -export function listAllChannelSupportedActions(params: { - cfg?: OpenClawConfig; - currentChannelId?: string | null; - currentThreadTs?: string | null; - currentMessageId?: string | number | null; - accountId?: string | null; - sessionKey?: string | null; - sessionId?: string | null; - agentId?: string | null; - requesterSenderId?: string | null; - senderIsOwner?: boolean; -}): ChannelMessageActionName[] { +export function listAllChannelSupportedActions( + params: ChannelMessageActionDiscoveryParams, +): ChannelMessageActionName[] { const actions = new Set(); for (const plugin of listChannelPlugins()) { const channelActions = resolveMessageActionDiscoveryForPlugin({