refactor!: rename chat providers to channels

This commit is contained in:
Peter Steinberger
2026-01-13 06:16:43 +00:00
parent 0cd632ba84
commit 90342a4f3a
393 changed files with 8004 additions and 6737 deletions

View File

@@ -14,7 +14,7 @@ export type ResolvedIMessageAccount = {
};
function listConfiguredAccountIds(cfg: ClawdbotConfig): string[] {
const accounts = cfg.imessage?.accounts;
const accounts = cfg.channels?.imessage?.accounts;
if (!accounts || typeof accounts !== "object") return [];
return Object.keys(accounts).filter(Boolean);
}
@@ -35,7 +35,7 @@ function resolveAccountConfig(
cfg: ClawdbotConfig,
accountId: string,
): IMessageAccountConfig | undefined {
const accounts = cfg.imessage?.accounts;
const accounts = cfg.channels?.imessage?.accounts;
if (!accounts || typeof accounts !== "object") return undefined;
return accounts[accountId] as IMessageAccountConfig | undefined;
}
@@ -44,7 +44,7 @@ function mergeIMessageAccountConfig(
cfg: ClawdbotConfig,
accountId: string,
): IMessageAccountConfig {
const { accounts: _ignored, ...base } = (cfg.imessage ??
const { accounts: _ignored, ...base } = (cfg.channels?.imessage ??
{}) as IMessageAccountConfig & { accounts?: unknown };
const account = resolveAccountConfig(cfg, accountId) ?? {};
return { ...base, ...account };
@@ -55,7 +55,7 @@ export function resolveIMessageAccount(params: {
accountId?: string | null;
}): ResolvedIMessageAccount {
const accountId = normalizeAccountId(params.accountId);
const baseEnabled = params.cfg.imessage?.enabled !== false;
const baseEnabled = params.cfg.channels?.imessage?.enabled !== false;
const merged = mergeIMessageAccountConfig(params.cfg, accountId);
const accountEnabled = merged.enabled !== false;
const configured = Boolean(