/** * 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 { TurnProcessor } from './turn-contract.js'; import type { MultiAgentConfig } from '../cli/config/types.js'; /** * Slack Gateway options */ export interface SlackGatewayOptions { /** Slack bot token (xoxb-...) */ botToken: string; /** Slack app token for Socket Mode (xapp-...) */ appToken: string; /** Owner Slack user ID. Unset means owner resolution fails closed. */ ownerUserId?: string; /** Message router for processing messages */ turnProcessor: TurnProcessor; /** Gateway configuration */ config?: Partial; /** Multi-agent configuration (optional) */ multiAgentConfig?: MultiAgentConfig; /** Multi-agent runtime backend options (optional) */ /** Optional core-backed principal lookup; consumed by the identity overlay in Task 5. */ principalResolver?: (connector: string, namespace: string, externalId: string) => { principalId: string; kind: 'owner' | 'member'; status: string; } | null; } /** * 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"; readonly principalResolver: SlackGatewayOptions['principalResolver']; private socketClient; private webClient; private config; private teamId?; private ownerWarningLogged; private missingTeamIdWarningLogged; 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; /** * Update multi-agent configuration */ setMultiAgentConfig(config: MultiAgentConfig): Promise; } //# sourceMappingURL=slack.d.ts.map