refactor: share scoped account accessor adapters

This commit is contained in:
Peter Steinberger
2026-03-22 20:04:22 +00:00
parent 8aca2fdc73
commit fa13c2960e
21 changed files with 126 additions and 57 deletions

View File

@@ -1,6 +1,9 @@
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
import { createMessageToolCardSchema } from "openclaw/plugin-sdk/channel-actions";
import { createHybridChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
import {
adaptScopedAccountAccessor,
createHybridChannelConfigAdapter,
} from "openclaw/plugin-sdk/channel-config-helpers";
import type {
ChannelMessageActionAdapter,
ChannelMessageToolDiscovery,
@@ -164,7 +167,7 @@ const feishuConfigAdapter = createHybridChannelConfigAdapter<
>({
sectionKey: "feishu",
listAccountIds: listFeishuAccountIds,
resolveAccount: (cfg, accountId) => resolveFeishuAccount({ cfg, accountId }),
resolveAccount: adaptScopedAccountAccessor(resolveFeishuAccount),
defaultAccountId: resolveDefaultFeishuAccountId,
clearBaseFields: [],
resolveAllowFrom: (account) => account.config.allowFrom,