From 34896839ba22f3a71a3d5a8fb4ca5f4c6989a534 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 24 Apr 2026 15:12:37 +0100 Subject: [PATCH] perf: slim irc inbound imports --- extensions/irc/src/inbound.ts | 39 ++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/extensions/irc/src/inbound.ts b/extensions/irc/src/inbound.ts index 5694d6a4e3e..2c693303fee 100644 --- a/extensions/irc/src/inbound.ts +++ b/extensions/irc/src/inbound.ts @@ -1,3 +1,22 @@ +import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing"; +import { + readStoreAllowFromForDmPolicy, + resolveEffectiveAllowFromLists, +} from "openclaw/plugin-sdk/channel-policy"; +import { resolveControlCommandGate } from "openclaw/plugin-sdk/command-auth"; +import { + GROUP_POLICY_BLOCKED_LABEL, + isDangerousNameMatchingEnabled, + resolveAllowlistProviderRuntimeGroupPolicy, + resolveDefaultGroupPolicy, + warnMissingProviderGroupPolicyFallbackOnce, + type OpenClawConfig, +} from "openclaw/plugin-sdk/config-runtime"; +import { + deliverFormattedTextWithAttachments, + type OutboundReplyPayload, +} from "openclaw/plugin-sdk/reply-payload"; +import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime"; import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, @@ -11,23 +30,6 @@ import { resolveIrcGroupSenderAllowed, resolveIrcRequireMention, } from "./policy.js"; -import { - GROUP_POLICY_BLOCKED_LABEL, - createChannelPairingController, - deliverFormattedTextWithAttachments, - dispatchInboundReplyWithBase, - logInboundDrop, - isDangerousNameMatchingEnabled, - readStoreAllowFromForDmPolicy, - resolveControlCommandGate, - resolveAllowlistProviderRuntimeGroupPolicy, - resolveDefaultGroupPolicy, - resolveEffectiveAllowFromLists, - warnMissingProviderGroupPolicyFallbackOnce, - type OutboundReplyPayload, - type OpenClawConfig, - type RuntimeEnv, -} from "./runtime-api.js"; import { getIrcRuntime } from "./runtime.js"; import { sendMessageIrc } from "./send.js"; import type { CoreConfig, IrcInboundMessage } from "./types.js"; @@ -239,6 +241,7 @@ export async function handleIrcInbound(params: { } if (message.isGroup && commandGate.shouldBlock) { + const { logInboundDrop } = await import("openclaw/plugin-sdk/channel-inbound"); logInboundDrop({ log: (line) => runtime.log?.(line), channel: CHANNEL_ID, @@ -332,6 +335,8 @@ export async function handleIrcInbound(params: { CommandAuthorized: commandAuthorized, }); + const { dispatchInboundReplyWithBase } = + await import("openclaw/plugin-sdk/inbound-reply-dispatch"); await dispatchInboundReplyWithBase({ cfg: config as OpenClawConfig, channel: CHANNEL_ID,