/**
 * Channel Manager — thin composition root for the channel subsystem.
 *
 * Wires together the four coordinators that own what used to be the eight
 * concerns of this 707-line class:
 *
 *   - {@link ChannelPluginRegistry}        — plugins Map, register/get
 *   - {@link ChannelLifecycleSupervisor}   — init/start/stop/restart-backoff
 *   - {@link ChannelHeartbeatScheduler}    — per-account heartbeat probes
 *   - {@link ChannelOutboundSender}        — TTS rewrite + persist + delivery
 *
 * The public surface (`registerPlugin`, `initialize`, `start`, `send`, etc.) is
 * preserved so callers (`GatewayService`, CLI commands, channel plugins) are
 * unchanged.
 */
import type { Config } from '../config/schema.js';
import type { MessageBus } from '../infra/bus/index.js';
import type { InboundMessage, OutboundMessage } from './transport-types.js';
import type { ChannelPlugin, ChannelPluginSessionModelHooks, ChannelStreamHandle } from './plugin-types.js';
import { ChannelHealthMonitor, type ChannelHealthState } from './health-monitor.js';
import { type OutboundChannelHooks } from './outbound-sender.js';
export type { OutboundChannelHooks } from './outbound-sender.js';
export declare class ChannelManager {
    private config;
    private readonly registry;
    private readonly healthMonitor;
    private readonly lifecycle;
    private readonly heartbeat;
    private readonly outbound;
    private sessionModelHooks?;
    constructor(config: Config, bus: MessageBus);
    setOutboundHooks(hooks: OutboundChannelHooks): void;
    /** Call before `initialize()` so plugins can persist per-session model overrides. */
    setSessionModelHooks(hooks: ChannelPluginSessionModelHooks | undefined): void;
    enableOutboundPersistence(agentDir: string): void;
    registerPlugin(plugin: ChannelPlugin): void;
    getPlugin(id: string): ChannelPlugin | undefined;
    getAllPlugins(): ChannelPlugin[];
    /** Backward-compat alias for `getAllPlugins`. */
    getAllChannels(): ChannelPlugin[];
    /** Channel IDs whose runtime reports connected (e.g. Telegram polling active). */
    getRunningChannels(): string[];
    initialize(): Promise<void>;
    start(options?: {
        deferConnectPluginIds?: ReadonlySet<string>;
    }): Promise<void>;
    startDeferredConnects(): Promise<void>;
    stop(): Promise<void>;
    stopChannel(channelId: string): Promise<void>;
    startChannel(channelId: string): Promise<void>;
    listDeferConnectChannelIds(cfg: Config): string[];
    send(msg: OutboundMessage, options?: {
        skipPersist?: boolean;
    }): Promise<void>;
    replayPendingOutboundMessages(): Promise<void>;
    startStream(channel: string, chatId: string, accountId?: string, opts?: {
        threadId?: string;
        replyToMessageId?: string;
    }): ChannelStreamHandle | null;
    getChannelStatus(channel: string): Promise<Record<string, unknown>>;
    /**
     * Optional channel hook before `AgentService` consumes an inbound message
     * (e.g. Feishu card-action triggers).
     */
    dispatchInboundMessageAction(msg: InboundMessage): Promise<void>;
    updateConfig(config: Config): Promise<void>;
    /** Replace in-memory config without running plugin `onConfigUpdated` hooks. */
    setRuntimeConfig(config: Config): void;
    getRuntimeSnapshot(): {
        initialized: boolean;
        running: boolean;
        pluginIds: string[];
        initializedPluginIds: string[];
        manuallyStopped: string[];
        restartAttempts: Record<string, number>;
        channelHealth: Record<string, ChannelHealthState>;
    };
    getHealthMonitor(): ChannelHealthMonitor;
}
export declare function createChannelManager(config: Config, bus: MessageBus): ChannelManager;
