/** * ChannelRunner — starts the connected channels from the store against a * running gateway (SH1 part 3). This is the "always-on" process that hosts the * channels: read the store → build each shuttle → start it. `reload()` diffs * the store vs what's running so adding/removing a channel takes effect WITHOUT * a restart (the deploy-once, connect-at-runtime model). * * Self-driving channels (telegram/slack/discord) start here; webhook channels * (whatsapp/sms) return null (they mount on an HTTP endpoint separately). */ import { type GatewayClient } from '../gateway-client.js'; import type { PairingStore } from '../pairing.js'; import type { ChannelConfig } from './config.js'; import type { ChannelStore } from './store.js'; export interface RunnableShuttle { start(): Promise; stop(): void; /** Outbound push (schedule delivery). Optional — webhook channels may lack it. */ sendText?(target: string, text: string): Promise; } export interface ShuttleFactoryDeps { /** Pairing store for personal lines (`line.dm: 'pairing'`). */ readonly pairing?: PairingStore; } export type ShuttleFactory = (config: ChannelConfig, gateway: GatewayClient, deps?: ShuttleFactoryDeps) => RunnableShuttle | null; /** Default factory: the self-driving channels. Webhook channels return null. */ export declare function defaultShuttleFactory(config: ChannelConfig, gateway: GatewayClient, deps?: ShuttleFactoryDeps): RunnableShuttle | null; export interface ChannelRunnerOptions { readonly gateway?: GatewayClient; readonly gatewayUrl?: string; readonly gatewayToken?: string; readonly factory?: ShuttleFactory; /** Pairing store handed to the factory (personal-line channels). */ readonly pairing?: PairingStore; } export declare class ChannelRunner { private readonly store; private readonly running; private readonly gateway; private readonly factory; private readonly factoryDeps; constructor(store: ChannelStore, opts?: ChannelRunnerOptions); /** Start every enabled, self-driving channel. Returns the ids started. */ start(): Promise; /** Diff the store vs running: start newly-added, stop removed/disabled. No restart. */ reload(): Promise<{ started: string[]; stopped: string[]; }>; /** * Outbound push (schedule delivery): send `text` to `target` on the first * running channel of `kind` (e.g. 'slack' → a channel/DM id). Returns false * when no running channel of that kind can send — the caller decides whether * that's an error (a schedule that asked for it) or a quiet no-op. */ deliver(kind: string, target: string, text: string): Promise; stop(): void; get activeIds(): string[]; private enabledConfigs; } //# sourceMappingURL=runner.d.ts.map