/** * Slack Gateway for MAMA Standalone * * Provides Slack integration using Socket Mode for receiving and responding to messages. * Supports both DM and channel mentions with thread context preservation. */ import { BaseGateway } from './base-gateway.js'; import type { SlackGatewayConfig, SlackChannelConfig } from './types.js'; import type { MessageRouter } from './message-router.js'; import type { MultiAgentConfig } from '../cli/config/types.js'; import type { MultiAgentRuntimeOptions } from '../multi-agent/types.js'; import { MultiAgentSlackHandler } from '../multi-agent/multi-agent-slack.js'; /** * Slack Gateway options */ export interface SlackGatewayOptions { /** Slack bot token (xoxb-...) */ botToken: string; /** Slack app token for Socket Mode (xapp-...) */ appToken: string; /** Message router for processing messages */ messageRouter: MessageRouter; /** Gateway configuration */ config?: Partial; /** Multi-agent configuration (optional) */ multiAgentConfig?: MultiAgentConfig; /** Multi-agent runtime backend options (optional) */ multiAgentRuntime?: MultiAgentRuntimeOptions; } /** * Slack Gateway class * * Connects to Slack via Socket Mode and routes messages * to the MessageRouter for processing. */ export declare class SlackGateway extends BaseGateway { readonly source: "slack"; private socketClient; private webClient; private config; private multiAgentHandler; private multiAgentRuntime?; private botToken; private processedMessages; private static get DEDUP_TTL_MS(); private logger; protected get mentionPattern(): RegExp | null; constructor(options: SlackGatewayOptions); /** * Set up Socket Mode event listeners */ private setupEventListeners; /** * Handle incoming Slack message */ private handleMessage; /** * Check if bot should respond to this message */ private shouldRespond; protected cleanMessageContent(content: string): string; /** * Download files attached to a Slack message. * Slack requires Authorization header with bot token for url_private_download. */ private downloadSlackFiles; /** * Send response to Slack (handling length limits and threading) */ private sendResponse; /** * Start the Slack gateway */ start(): Promise; /** * Stop the Slack gateway */ stop(): Promise; /** * Update gateway configuration */ setConfig(config: Partial): void; /** * Get current configuration */ getConfig(): SlackGatewayConfig; /** * Add channel configuration */ addChannelConfig(channelId: string, config: SlackChannelConfig): void; /** * Send message to a channel */ sendMessage(channelId: string, text: string): Promise; /** * Send file/document to a channel * Supports any file type (documents, images, PDFs, etc.) */ sendFile(channelId: string, filePath: string, caption?: string): Promise; /** * Send image to a channel (alias for sendFile) */ sendImage(channelId: string, imagePath: string, caption?: string): Promise; /** * Get the multi-agent handler (if enabled) */ getMultiAgentHandler(): MultiAgentSlackHandler | null; /** * Update multi-agent configuration */ setMultiAgentConfig(config: MultiAgentConfig): Promise; } //# sourceMappingURL=slack.d.ts.map