import type { OpenClawConfig } from "../config/config.js"; export function resolveChannelAccountConfigBasePath(params: { cfg: OpenClawConfig; channelKey: string; accountId: string; }): string { const channels = params.cfg.channels as unknown as Record | undefined; const channelSection = channels?.[params.channelKey] as Record | undefined; const accounts = channelSection?.accounts as Record | undefined; const useAccountPath = Boolean(accounts?.[params.accountId]); return useAccountPath ? `channels.${params.channelKey}.accounts.${params.accountId}.` : `channels.${params.channelKey}.`; }