mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 13:50:22 +00:00
refactor: share warning collector projections
This commit is contained in:
@@ -9,7 +9,7 @@ import { createAccountStatusSink } from "openclaw/plugin-sdk/channel-lifecycle";
|
||||
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
||||
import {
|
||||
createOpenGroupPolicyRestrictSendersWarningCollector,
|
||||
projectWarningCollector,
|
||||
projectAccountWarningCollector,
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import { createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
|
||||
import { createChatChannelPlugin } from "openclaw/plugin-sdk/core";
|
||||
@@ -282,10 +282,10 @@ export const bluebubblesPlugin: ChannelPlugin<ResolvedBlueBubblesAccount, BlueBu
|
||||
},
|
||||
security: {
|
||||
resolveDmPolicy: resolveBlueBubblesDmPolicy,
|
||||
collectWarnings: projectWarningCollector(
|
||||
({ account }: { account: ResolvedBlueBubblesAccount }) => account,
|
||||
collectBlueBubblesSecurityWarnings,
|
||||
),
|
||||
collectWarnings: projectAccountWarningCollector<
|
||||
ResolvedBlueBubblesAccount,
|
||||
{ account: ResolvedBlueBubblesAccount }
|
||||
>(collectBlueBubblesSecurityWarnings),
|
||||
},
|
||||
threading: {
|
||||
buildToolContext: ({ context, hasRepliedRef }) => ({
|
||||
|
||||
@@ -12,7 +12,7 @@ import type {
|
||||
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
||||
import {
|
||||
createAllowlistProviderGroupPolicyWarningCollector,
|
||||
projectWarningCollector,
|
||||
projectConfigAccountIdWarningCollector,
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import { createChatChannelPlugin } from "openclaw/plugin-sdk/core";
|
||||
import {
|
||||
@@ -963,13 +963,10 @@ export const feishuPlugin: ChannelPlugin<ResolvedFeishuAccount, FeishuProbeResul
|
||||
},
|
||||
},
|
||||
security: {
|
||||
collectWarnings: projectWarningCollector(
|
||||
({ cfg, accountId }: { cfg: ClawdbotConfig; accountId?: string | null }) => ({
|
||||
cfg,
|
||||
accountId,
|
||||
}),
|
||||
collectFeishuSecurityWarnings,
|
||||
),
|
||||
collectWarnings: projectConfigAccountIdWarningCollector<{
|
||||
cfg: ClawdbotConfig;
|
||||
accountId?: string | null;
|
||||
}>(collectFeishuSecurityWarnings),
|
||||
},
|
||||
pairing: {
|
||||
text: {
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from "openclaw/plugin-sdk/channel-pairing";
|
||||
import {
|
||||
createAllowlistProviderOpenWarningCollector,
|
||||
projectWarningCollector,
|
||||
projectAccountConfigWarningCollector,
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import { createScopedAccountReplyToModeResolver } from "openclaw/plugin-sdk/conversation-runtime";
|
||||
import { createChatChannelPlugin } from "openclaw/plugin-sdk/core";
|
||||
@@ -411,11 +411,8 @@ export const matrixPlugin: ChannelPlugin<ResolvedMatrixAccount, MatrixProbe> =
|
||||
},
|
||||
security: {
|
||||
resolveDmPolicy: resolveMatrixDmPolicy,
|
||||
collectWarnings: projectWarningCollector(
|
||||
({ account, cfg }: { account: ResolvedMatrixAccount; cfg: unknown }) => ({
|
||||
account,
|
||||
cfg: cfg as CoreConfig,
|
||||
}),
|
||||
collectWarnings: projectAccountConfigWarningCollector(
|
||||
(cfg) => cfg as CoreConfig,
|
||||
collectMatrixSecurityWarningsForAccount,
|
||||
),
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ import type {
|
||||
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
||||
import {
|
||||
createAllowlistProviderGroupPolicyWarningCollector,
|
||||
projectWarningCollector,
|
||||
projectConfigWarningCollector,
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import { createChatChannelPlugin } from "openclaw/plugin-sdk/core";
|
||||
import {
|
||||
@@ -475,8 +475,7 @@ export const msteamsPlugin: ChannelPlugin<ResolvedMSTeamsAccount, ProbeMSTeamsRe
|
||||
},
|
||||
},
|
||||
security: {
|
||||
collectWarnings: projectWarningCollector(
|
||||
({ cfg }: { cfg: OpenClawConfig }) => ({ cfg }),
|
||||
collectWarnings: projectConfigWarningCollector<{ cfg: OpenClawConfig }>(
|
||||
collectMSTeamsSecurityWarnings,
|
||||
),
|
||||
},
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
|
||||
import {
|
||||
createConditionalWarningCollector,
|
||||
projectWarningCollector,
|
||||
projectAccountWarningCollector,
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import { attachChannelToResult } from "openclaw/plugin-sdk/channel-send-result";
|
||||
import { createChatChannelPlugin, type ChannelPlugin } from "openclaw/plugin-sdk/core";
|
||||
@@ -262,10 +262,10 @@ export function createSynologyChatPlugin(): SynologyChatPlugin {
|
||||
},
|
||||
security: {
|
||||
resolveDmPolicy: resolveSynologyChatDmPolicy,
|
||||
collectWarnings: projectWarningCollector(
|
||||
({ account }: { account: ResolvedSynologyChatAccount }) => account,
|
||||
collectSynologyChatSecurityWarnings,
|
||||
),
|
||||
collectWarnings: projectAccountWarningCollector<
|
||||
ResolvedSynologyChatAccount,
|
||||
{ account: ResolvedSynologyChatAccount }
|
||||
>(collectSynologyChatSecurityWarnings),
|
||||
},
|
||||
outbound: {
|
||||
deliveryMode: "gateway" as const,
|
||||
|
||||
Reference in New Issue
Block a user