/**
 * Chat-adapter factory (T-CHAT-AS-TERMINAL CAT.1b).
 *
 * Builds the transport adapters the chat-daemon owns, from the chat-connection
 * config (`./config.ts` — `chat_connections` block + env/.env token overlay).
 * Ports `src.legacy/chat/factory.ts buildChatGateway` onto the new-tree
 * primitives: it returns the rich-transport `ChannelAdapter` map the gateway +
 * worker consume, NOT a legacy `ChatGateway` instance.
 *
 * Per-platform policy (mirrors the legacy "skip a platform with no/invalid
 * token" posture so a partial config never blocks the others):
 *
 *   - TELEGRAM (required surface): activated whenever a token resolves and the
 *     config validates. `allowlistChatIds` comes from the config block; the
 *     bot's own @username is resolved best-effort via `getMe` at build time so
 *     `subscribeTransport` can compute `mentionsBot`. A `getMe` failure leaves
 *     `botUsername` undefined (mentionsBot stays false) — never blocks build.
 *
 *   - DISCORD / SLACK: SKIPPED for now. The new-tree discord/slack adapters
 *     (`./adapters/{discord,slack}.ts`) implement the AUTO.6 `subscribeInbound`
 *     surface but NOT the CAT.1b rich `subscribeTransport` envelope the
 *     transport daemon's inbox writer needs (`transport_inbox.ts` is
 *     telegram-sourced; `InboundChatMessage` carries telegram-shaped ids).
 *     They are reported in `issues` as skipped, not silently dropped. When
 *     their adapters grow `subscribeTransport`, add them here.
 *
 * Imports from: grammy (getMe only), ./config, ./adapters/telegram, ./types.
 * Imported by: ./daemon/worker.ts + tests. NOT wired into the CLI (CAT.1d).
 */
import { type ChatConnectionsConfig } from './config.js';
import type { ChannelAdapter } from './types.js';
export type ChatPlatform = 'telegram' | 'discord' | 'slack';
export interface BuildChatAdaptersOpts {
    /** Inject a pre-loaded config (skips the disk read). For tests. */
    config?: ChatConnectionsConfig;
    /**
     * Seam for `getMe` so tests don't hit the live Bot API. Given a token,
     * resolves the bot's @username (without `@`) or undefined. Defaults to a
     * real grammy `getMe` call. Best-effort — a throw is caught by the caller.
     */
    resolveBotUsername?: (token: string) => Promise<string | undefined>;
}
export interface BuildChatAdaptersResult {
    /** Active adapters keyed by platform. Only platforms with a usable token. */
    adapters: Map<ChatPlatform, ChannelAdapter>;
    /** Platforms that ended up activated (telegram first). */
    activated: ChatPlatform[];
    /** Human-readable notes: validation problems + intentionally-skipped platforms. */
    issues: string[];
}
export declare function buildChatAdapters(opts?: BuildChatAdaptersOpts): Promise<BuildChatAdaptersResult>;
//# sourceMappingURL=factory.d.ts.map