From 49dbf64ab193af6dfeb64ef2a6131958c59f5470 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 27 Mar 2026 19:50:59 +0000 Subject: [PATCH] fix(core): harden bundled provider runtime surfaces --- src/plugin-sdk/runtime-api-guardrails.test.ts | 7 +++++++ src/plugins/commands.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugin-sdk/runtime-api-guardrails.test.ts b/src/plugin-sdk/runtime-api-guardrails.test.ts index 284276dffdc..26edbf16e9a 100644 --- a/src/plugin-sdk/runtime-api-guardrails.test.ts +++ b/src/plugin-sdk/runtime-api-guardrails.test.ts @@ -15,6 +15,7 @@ const RUNTIME_API_EXPORT_GUARDS: Record = { 'export * from "./src/channel-actions.js";', 'export * from "./src/directory-live.js";', 'export * from "./src/monitor.js";', + 'export { __testing as discordMonitorTesting } from "./src/monitor/provider.js";', 'export * from "./src/monitor/gateway-plugin.js";', 'export * from "./src/monitor/gateway-registry.js";', 'export * from "./src/monitor/presence-cache.js";', @@ -26,12 +27,15 @@ const RUNTIME_API_EXPORT_GUARDS: Record = { 'export * from "./src/resolve-users.js";', 'export * from "./src/outbound-session-route.js";', 'export * from "./src/send.js";', + 'export const discordSessionBindingAdapterChannels = ["discord"] as const;', ], "extensions/imessage/runtime-api.ts": [ 'export { DEFAULT_ACCOUNT_ID, PAIRING_APPROVED_MESSAGE, buildComputedAccountStatusSnapshot, buildChannelConfigSchema, collectStatusIssuesFromLastError, formatTrimmedAllowFromEntries, getChatChannelMeta, looksLikeIMessageTargetId, normalizeIMessageMessagingTarget, resolveChannelMediaMaxBytes, resolveIMessageConfigAllowFrom, resolveIMessageConfigDefaultTo, IMessageConfigSchema, type ChannelPlugin, type IMessageAccountConfig } from "openclaw/plugin-sdk/imessage";', 'export { resolveIMessageGroupRequireMention, resolveIMessageGroupToolPolicy } from "./src/group-policy.js";', 'export { monitorIMessageProvider } from "./src/monitor.js";', 'export type { MonitorIMessageOpts } from "./src/monitor.js";', + 'export { __testing as imessageMonitorTesting } from "./src/monitor/monitor-provider.js";', + 'export { imessageOutbound } from "./src/outbound-adapter.js";', 'export { probeIMessage } from "./src/probe.js";', 'export { sendMessageIMessage } from "./src/send.js";', ], @@ -55,6 +59,7 @@ const RUNTIME_API_EXPORT_GUARDS: Record = { 'export * from "./src/action-runtime.js";', 'export * from "./src/directory-live.js";', 'export * from "./src/index.js";', + 'export { __testing as slackMonitorTesting } from "./src/monitor/provider.js";', 'export * from "./src/resolve-channels.js";', 'export * from "./src/resolve-users.js";', ], @@ -77,7 +82,9 @@ const RUNTIME_API_EXPORT_GUARDS: Record = { 'export { makeProxyFetch } from "./src/proxy.js";', 'export { createForumTopicTelegram, deleteMessageTelegram, editForumTopicTelegram, editMessageReplyMarkupTelegram, editMessageTelegram, pinMessageTelegram, reactMessageTelegram, renameForumTopicTelegram, sendMessageTelegram, sendPollTelegram, sendStickerTelegram, sendTypingTelegram, unpinMessageTelegram } from "./src/send.js";', 'export { createTelegramThreadBindingManager, getTelegramThreadBindingManager, setTelegramThreadBindingIdleTimeoutBySessionKey, setTelegramThreadBindingMaxAgeBySessionKey } from "./src/thread-bindings.js";', + 'export { __testing as telegramThreadBindingTesting } from "./src/thread-bindings.js";', 'export { resolveTelegramToken } from "./src/token.js";', + 'export const telegramSessionBindingAdapterChannels = ["telegram"] as const;', ], "extensions/whatsapp/runtime-api.ts": [ 'export * from "./src/active-listener.js";', diff --git a/src/plugins/commands.ts b/src/plugins/commands.ts index 31dfd89219c..25698fe05be 100644 --- a/src/plugins/commands.ts +++ b/src/plugins/commands.ts @@ -193,7 +193,7 @@ function resolveBindingConversationFromCommand(params: { conversationId: "conversationId" in target ? target.conversationId - : `${target.chatType === "group" ? "channel" : "user"}:${target.to}`, + : `${target.chatType === "direct" ? "user" : "channel"}:${target.to}`, }; } return null;