refactor: move remaining channel seams into plugins

This commit is contained in:
Peter Steinberger
2026-03-15 23:47:22 -07:00
parent ae60094fb5
commit 2054cb9431
42 changed files with 246 additions and 787 deletions

View File

@@ -1,3 +1,4 @@
import { buildAccountScopedAllowlistConfigEditor } from "openclaw/plugin-sdk/compat";
import {
buildChannelConfigSchema,
buildAccountScopedDmSecurityPolicy,
@@ -195,11 +196,13 @@ export const whatsappPlugin: ChannelPlugin<ResolvedWhatsAppAccount> = {
groupPolicy: account.groupPolicy,
};
},
resolveConfigEdit: ({ scope, pathPrefix, writeTarget }) => ({
pathPrefix,
writeTarget,
readPaths: [[scope === "dm" ? "allowFrom" : "groupAllowFrom"]],
writePath: [scope === "dm" ? "allowFrom" : "groupAllowFrom"],
applyConfigEdit: buildAccountScopedAllowlistConfigEditor({
channelId: "whatsapp",
normalize: ({ values }) => formatWhatsAppConfigAllowFromEntries(values),
resolvePaths: (scope) => ({
readPaths: [[scope === "dm" ? "allowFrom" : "groupAllowFrom"]],
writePath: [scope === "dm" ? "allowFrom" : "groupAllowFrom"],
}),
}),
},
security: {