Plugins: internalize irc SDK imports

This commit is contained in:
Vincent Koc 2026-03-17 20:51:53 -07:00
parent 2a02337be2
commit 0636c6eafa
8 changed files with 81 additions and 28 deletions

View File

@ -4,7 +4,7 @@ import {
createAccountListHelpers,
normalizeResolvedSecretInputString,
parseOptionalDelimitedEntries,
} from "openclaw/plugin-sdk/irc";
} from "./runtime-api.js";
import type { CoreConfig, IrcAccountConfig, IrcNickServConfig } from "./types.js";
const TRUTHY_ENV = new Set(["true", "1", "yes", "on"]);

View File

@ -8,16 +8,6 @@ import {
buildOpenGroupPolicyWarning,
collectAllowlistProviderGroupPolicyWarnings,
} from "openclaw/plugin-sdk/channel-policy";
import {
buildBaseAccountStatusSnapshot,
buildBaseChannelStatusSummary,
buildChannelConfigSchema,
createAccountStatusSink,
DEFAULT_ACCOUNT_ID,
getChatChannelMeta,
PAIRING_APPROVED_MESSAGE,
type ChannelPlugin,
} from "openclaw/plugin-sdk/irc";
import { runStoppablePassiveMonitor } from "../../shared/passive-monitor.js";
import {
listIrcAccountIds,
@ -35,6 +25,16 @@ import {
} from "./normalize.js";
import { resolveIrcGroupMatch, resolveIrcRequireMention } from "./policy.js";
import { probeIrc } from "./probe.js";
import {
buildBaseAccountStatusSnapshot,
buildBaseChannelStatusSummary,
buildChannelConfigSchema,
createAccountStatusSink,
DEFAULT_ACCOUNT_ID,
getChatChannelMeta,
PAIRING_APPROVED_MESSAGE,
type ChannelPlugin,
} from "./runtime-api.js";
import { getIrcRuntime } from "./runtime.js";
import { sendMessageIrc } from "./send.js";
import { ircSetupAdapter } from "./setup-core.js";

View File

@ -1,3 +1,5 @@
import { z } from "zod";
import { requireChannelOpenAllowFrom } from "../../shared/config-schema-helpers.js";
import {
BlockStreamingCoalesceSchema,
DmConfigSchema,
@ -7,9 +9,7 @@ import {
ReplyRuntimeConfigSchemaShape,
ToolPolicySchema,
requireOpenAllowFrom,
} from "openclaw/plugin-sdk/irc";
import { z } from "zod";
import { requireChannelOpenAllowFrom } from "../../shared/config-schema-helpers.js";
} from "./runtime-api.js";
const IrcGroupSchema = z
.object({

View File

@ -1,3 +1,12 @@
import type { ResolvedIrcAccount } from "./accounts.js";
import { normalizeIrcAllowlist, resolveIrcAllowlistMatch } from "./normalize.js";
import {
resolveIrcMentionGate,
resolveIrcGroupAccessGate,
resolveIrcGroupMatch,
resolveIrcGroupSenderAllowed,
resolveIrcRequireMention,
} from "./policy.js";
import {
GROUP_POLICY_BLOCKED_LABEL,
createScopedPairingAccess,
@ -16,16 +25,7 @@ import {
type OutboundReplyPayload,
type OpenClawConfig,
type RuntimeEnv,
} from "openclaw/plugin-sdk/irc";
import type { ResolvedIrcAccount } from "./accounts.js";
import { normalizeIrcAllowlist, resolveIrcAllowlistMatch } from "./normalize.js";
import {
resolveIrcMentionGate,
resolveIrcGroupAccessGate,
resolveIrcGroupMatch,
resolveIrcGroupSenderAllowed,
resolveIrcRequireMention,
} from "./policy.js";
} from "./runtime-api.js";
import { getIrcRuntime } from "./runtime.js";
import { sendMessageIrc } from "./send.js";
import type { CoreConfig, IrcInboundMessage } from "./types.js";

View File

@ -1,4 +1,3 @@
import type { RuntimeEnv } from "openclaw/plugin-sdk/irc";
import { resolveLoggerBackedRuntime } from "../../shared/runtime.js";
import { resolveIrcAccount } from "./accounts.js";
import { connectIrcClient, type IrcClient } from "./client.js";
@ -6,6 +5,7 @@ import { buildIrcConnectOptions } from "./connect-options.js";
import { handleIrcInbound } from "./inbound.js";
import { isChannelTarget } from "./normalize.js";
import { makeIrcMessageId } from "./protocol.js";
import type { RuntimeEnv } from "./runtime-api.js";
import { getIrcRuntime } from "./runtime.js";
import type { CoreConfig, IrcInboundMessage } from "./types.js";

View File

@ -0,0 +1,53 @@
export {
addWildcardAllowFrom,
buildBaseAccountStatusSnapshot,
buildBaseChannelStatusSummary,
buildChannelConfigSchema,
createAccountListHelpers,
createAccountStatusSink,
createLoggerBackedRuntime,
createNormalizedOutboundDeliverer,
createReplyPrefixOptions,
createScopedPairingAccess,
dispatchInboundReplyWithBase,
emptyPluginConfigSchema,
formatDocsLink,
formatPairingApproveHint,
formatTextWithAttachmentLinks,
getChatChannelMeta,
GROUP_POLICY_BLOCKED_LABEL,
isDangerousNameMatchingEnabled,
issuePairingChallenge,
logInboundDrop,
normalizeResolvedSecretInputString,
parseOptionalDelimitedEntries,
PAIRING_APPROVED_MESSAGE,
patchScopedAccountConfig,
readStoreAllowFromForDmPolicy,
resolveAllowlistProviderRuntimeGroupPolicy,
resolveControlCommandGate,
resolveDefaultGroupPolicy,
resolveEffectiveAllowFromLists,
resolveOutboundMediaUrls,
runPassiveAccountLifecycle,
setAccountEnabledInConfigSection,
setTopLevelChannelAllowFrom,
setTopLevelChannelDmPolicyWithAllowFrom,
ToolPolicySchema,
warnMissingProviderGroupPolicyFallbackOnce,
type BaseProbeResult,
type BlockStreamingCoalesceConfig,
type ChannelPlugin,
type DmConfig,
type DmPolicy,
type GroupPolicy,
type GroupToolPolicyBySenderConfig,
type GroupToolPolicyConfig,
type MarkdownConfig,
type OpenClawConfig,
type OpenClawPluginApi,
type OutboundReplyPayload,
type PluginRuntime,
type RuntimeEnv,
type WizardPrompter,
} from "openclaw/plugin-sdk/irc";

View File

@ -1,5 +1,5 @@
import type { PluginRuntime } from "openclaw/plugin-sdk/irc";
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
import type { PluginRuntime } from "./runtime-api.js";
const { setRuntime: setIrcRuntime, getRuntime: getIrcRuntime } =
createPluginRuntimeStore<PluginRuntime>("IRC runtime not initialized");

View File

@ -1,4 +1,3 @@
import type { BaseProbeResult } from "openclaw/plugin-sdk/irc";
import type {
BlockStreamingCoalesceConfig,
DmConfig,
@ -8,7 +7,8 @@ import type {
GroupToolPolicyConfig,
MarkdownConfig,
OpenClawConfig,
} from "openclaw/plugin-sdk/irc";
BaseProbeResult,
} from "./runtime-api.js";
export type IrcChannelConfig = {
requireMention?: boolean;