From 81ef52a81ebc6183544ae681f0a922a7aee9e3de Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 17 Mar 2026 03:44:10 +0000 Subject: [PATCH] refactor(zalouser): reuse patched setup adapter --- extensions/zalouser/src/setup-core.ts | 44 +++------------------------ 1 file changed, 5 insertions(+), 39 deletions(-) diff --git a/extensions/zalouser/src/setup-core.ts b/extensions/zalouser/src/setup-core.ts index 9e66e2c63c6..f3215a16469 100644 --- a/extensions/zalouser/src/setup-core.ts +++ b/extensions/zalouser/src/setup-core.ts @@ -1,43 +1,9 @@ -import { - applyAccountNameToChannelSection, - applySetupAccountConfigPatch, - DEFAULT_ACCOUNT_ID, - migrateBaseNameToDefaultAccount, - normalizeAccountId, - type ChannelSetupAdapter, -} from "openclaw/plugin-sdk/setup"; +import { createPatchedAccountSetupAdapter } from "../../../src/channels/plugins/setup-helpers.js"; const channel = "zalouser" as const; -export const zalouserSetupAdapter: ChannelSetupAdapter = { - resolveAccountId: ({ accountId }) => normalizeAccountId(accountId), - applyAccountName: ({ cfg, accountId, name }) => - applyAccountNameToChannelSection({ - cfg, - channelKey: channel, - accountId, - name, - }), +export const zalouserSetupAdapter = createPatchedAccountSetupAdapter({ + channelKey: channel, validateInput: () => null, - applyAccountConfig: ({ cfg, accountId, input }) => { - const namedConfig = applyAccountNameToChannelSection({ - cfg, - channelKey: channel, - accountId, - name: input.name, - }); - const next = - accountId !== DEFAULT_ACCOUNT_ID - ? migrateBaseNameToDefaultAccount({ - cfg: namedConfig, - channelKey: channel, - }) - : namedConfig; - return applySetupAccountConfigPatch({ - cfg: next, - channelKey: channel, - accountId, - patch: {}, - }); - }, -}; + buildPatch: () => ({}), +});