diff --git a/src/config/types.channels.ts b/src/config/types.channels.ts index b73fcf3737e..9094e8b660f 100644 --- a/src/config/types.channels.ts +++ b/src/config/types.channels.ts @@ -1,4 +1,13 @@ import type { ContextVisibilityMode, GroupPolicy } from "./types.base.js"; +import type { DiscordConfig } from "./types.discord.js"; +import type { GoogleChatConfig } from "./types.googlechat.js"; +import type { IMessageConfig } from "./types.imessage.js"; +import type { IrcConfig } from "./types.irc.js"; +import type { MSTeamsConfig } from "./types.msteams.js"; +import type { SignalConfig } from "./types.signal.js"; +import type { SlackConfig } from "./types.slack.js"; +import type { TelegramConfig } from "./types.telegram.js"; +import type { WhatsAppConfig } from "./types.whatsapp.js"; export type ChannelHeartbeatVisibilityConfig = { /** Show HEARTBEAT_OK acknowledgments in chat (default: false). */ @@ -74,6 +83,15 @@ export interface ChannelsConfig { defaults?: ChannelDefaultsConfig; /** Map provider -> channel id -> model override. */ modelByChannel?: ChannelModelByChannelConfig; + discord?: DiscordConfig; + googlechat?: GoogleChatConfig; + imessage?: IMessageConfig; + irc?: IrcConfig; + msteams?: MSTeamsConfig; + signal?: SignalConfig; + slack?: SlackConfig; + telegram?: TelegramConfig; + whatsapp?: WhatsAppConfig; /** * Channel sections are plugin-owned and keyed by arbitrary channel ids. * Keep the lookup permissive so augmented channel configs remain ergonomic at call sites. diff --git a/src/config/types.discord.ts b/src/config/types.discord.ts index 59d589bfdef..4f0bb693d51 100644 --- a/src/config/types.discord.ts +++ b/src/config/types.discord.ts @@ -440,9 +440,3 @@ export type DiscordConfig = { /** Optional default account id when multiple accounts are configured. */ defaultAccount?: string; } & DiscordAccountConfig; - -declare module "./types.channels.js" { - interface ChannelsConfig { - discord?: DiscordConfig; - } -} diff --git a/src/config/types.googlechat.ts b/src/config/types.googlechat.ts index 495ab5dd04e..15a5db99105 100644 --- a/src/config/types.googlechat.ts +++ b/src/config/types.googlechat.ts @@ -121,9 +121,3 @@ export type GoogleChatConfig = { /** Optional default account id when multiple accounts are configured. */ defaultAccount?: string; } & GoogleChatAccountConfig; - -declare module "./types.channels.js" { - interface ChannelsConfig { - googlechat?: GoogleChatConfig; - } -} diff --git a/src/config/types.imessage.ts b/src/config/types.imessage.ts index 089fd1273c6..1fe00bbab43 100644 --- a/src/config/types.imessage.ts +++ b/src/config/types.imessage.ts @@ -163,9 +163,3 @@ export type IMessageConfig = { /** Optional default account id when multiple accounts are configured. */ defaultAccount?: string; } & IMessageAccountConfig; - -declare module "./types.channels.js" { - interface ChannelsConfig { - imessage?: IMessageConfig; - } -} diff --git a/src/config/types.irc.ts b/src/config/types.irc.ts index f093fde26af..bccb71ba68e 100644 --- a/src/config/types.irc.ts +++ b/src/config/types.irc.ts @@ -59,9 +59,3 @@ export type IrcConfig = { /** Optional default account id when multiple accounts are configured. */ defaultAccount?: string; } & IrcAccountConfig; - -declare module "./types.channels.js" { - interface ChannelsConfig { - irc?: IrcConfig; - } -} diff --git a/src/config/types.msteams.ts b/src/config/types.msteams.ts index c4dc8f4cc5d..a91c9c39015 100644 --- a/src/config/types.msteams.ts +++ b/src/config/types.msteams.ts @@ -194,9 +194,3 @@ export type MSTeamsConfig = { /** Bot Framework OAuth SSO (signin/tokenExchange + signin/verifyState) settings. */ sso?: MSTeamsSsoConfig; }; - -declare module "./types.channels.js" { - interface ChannelsConfig { - msteams?: MSTeamsConfig; - } -} diff --git a/src/config/types.signal.ts b/src/config/types.signal.ts index 3ae784d228b..11e434fb7cf 100644 --- a/src/config/types.signal.ts +++ b/src/config/types.signal.ts @@ -62,9 +62,3 @@ export type SignalConfig = { /** Optional default account id when multiple accounts are configured. */ defaultAccount?: string; } & SignalAccountConfig; - -declare module "./types.channels.js" { - interface ChannelsConfig { - signal?: SignalConfig; - } -} diff --git a/src/config/types.slack.ts b/src/config/types.slack.ts index 927b8d1b8bf..ca11205f5b3 100644 --- a/src/config/types.slack.ts +++ b/src/config/types.slack.ts @@ -221,9 +221,3 @@ export type SlackConfig = { /** Optional default account id when multiple accounts are configured. */ defaultAccount?: string; } & SlackAccountConfig; - -declare module "./types.channels.js" { - interface ChannelsConfig { - slack?: SlackConfig; - } -} diff --git a/src/config/types.telegram.ts b/src/config/types.telegram.ts index e96d0c82f02..f2b0aab13bf 100644 --- a/src/config/types.telegram.ts +++ b/src/config/types.telegram.ts @@ -323,9 +323,3 @@ export type TelegramConfig = { /** Optional default account id when multiple accounts are configured. */ defaultAccount?: string; } & TelegramAccountConfig; - -declare module "./types.channels.js" { - interface ChannelsConfig { - telegram?: TelegramConfig; - } -} diff --git a/src/config/types.whatsapp.ts b/src/config/types.whatsapp.ts index 0d52fee9dea..218096f1aa7 100644 --- a/src/config/types.whatsapp.ts +++ b/src/config/types.whatsapp.ts @@ -145,9 +145,3 @@ export type WhatsAppAccountConfig = WhatsAppConfigCore & /** Override auth directory (Baileys multi-file auth state). */ authDir?: string; }; - -declare module "./types.channels.js" { - interface ChannelsConfig { - whatsapp?: WhatsAppConfig; - } -} diff --git a/src/infra/tsdown-config.test.ts b/src/infra/tsdown-config.test.ts index 440b9ce9300..f172e21a961 100644 --- a/src/infra/tsdown-config.test.ts +++ b/src/infra/tsdown-config.test.ts @@ -163,19 +163,27 @@ describe("tsdown config", () => { const external = unifiedGraph?.inputOptions?.({})?.external; if (typeof neverBundle === "function") { + expect(neverBundle("@discordjs/voice")).toBe(true); expect(neverBundle("@lancedb/lancedb")).toBe(true); expect(neverBundle("@larksuiteoapi/node-sdk")).toBe(true); expect(neverBundle("@matrix-org/matrix-sdk-crypto-nodejs")).toBe(true); + expect(neverBundle("@vitest/expect")).toBe(true); expect(neverBundle("matrix-js-sdk/lib/client.js")).toBe(true); + expect(neverBundle("prism-media")).toBe(true); expect(neverBundle("qrcode-terminal/lib/main.js")).toBe(true); + expect(neverBundle("vitest")).toBe(true); expect(neverBundle("not-a-runtime-dependency")).toBe(false); } else { expect(neverBundle).toEqual( expect.arrayContaining([ + "@discordjs/voice", "@lancedb/lancedb", "@larksuiteoapi/node-sdk", + "@vitest/expect", "matrix-js-sdk", + "prism-media", "qrcode-terminal", + "vitest", ]), ); } diff --git a/tsdown.config.ts b/tsdown.config.ts index fc8406f1608..f22aa6d6114 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -161,11 +161,15 @@ const bundledPluginRoot = (pluginId: string) => ["extensions", pluginId].join("/ const bundledPluginFile = (pluginId: string, relativePath: string) => `${bundledPluginRoot(pluginId)}/${relativePath}`; const explicitNeverBundleDependencies = [ + "@discordjs/voice", "@lancedb/lancedb", "@larksuiteoapi/node-sdk", "@matrix-org/matrix-sdk-crypto-nodejs", + "@vitest/expect", "matrix-js-sdk", + "prism-media", "qrcode-terminal", + "vitest", ].toSorted((left, right) => left.localeCompare(right)); function shouldNeverBundleDependency(id: string): boolean {