/** * Base Gateway abstract class * * Extracts common logic shared across Discord, Slack, and Telegram gateways. * Platform-specific behavior is implemented via abstract methods and properties. */ import type { Gateway, GatewayEvent, GatewayEventHandler, GatewayConfig, MessageSource } from './types.js'; import type { SessionDirectory, TurnProcessor } from './turn-contract.js'; export interface BaseGatewayOptions { /** * How a turn is processed. Required, because this is what a user-facing surface * actually needs; the concrete router is an extra capability, not the dependency. */ turnProcessor: TurnProcessor; /** * Optional, and narrow. Only surfaces that read session data for their own display * concerns - naming a channel, listing what is active - ask for this. It is not a * router: a surface that serves turns cannot reach past the contract through it. */ sessionDirectory?: SessionDirectory; config?: Partial; } export declare abstract class BaseGateway implements Gateway { abstract readonly source: MessageSource; protected sessionDirectory?: SessionDirectory; /** * The turn seam, shared by every user-facing surface. * * Telegram, Discord and Slack are ONE role - the place a person reaches the agent - so * the boundary belongs here rather than to any one of them. Connectors are not turn * sources at all; they are data the agent reads, and they never pass through here. * * Required: a surface that serves turns needs this and nothing else. */ protected turnProcessor: TurnProcessor; protected eventHandlers: GatewayEventHandler[]; protected connected: boolean; constructor(options: BaseGatewayOptions); abstract start(): Promise; abstract stop(): Promise; abstract sendMessage(channelId: string, text: string): Promise; abstract sendFile(channelId: string, filePath: string, caption?: string): Promise; /** Regex to strip bot mentions from message text. null = no stripping. */ protected abstract get mentionPattern(): RegExp | null; isConnected(): boolean; onEvent(handler: GatewayEventHandler): void; protected emitEvent(event: GatewayEvent): void; protected cleanMessageContent(content: string): string; } //# sourceMappingURL=base-gateway.d.ts.map