/**
 * Mattermost Channel Adapter
 *
 * Connects to Mattermost via WebSocket for real-time messaging.
 * This is a stub implementation.
 */
import { logger } from '../../utils/logger.js';
export class MattermostAdapter {
    config;
    running = false;
    constructor(config) {
        this.config = { ...config };
    }
    async start() {
        if (this.running) {
            throw new Error('MattermostAdapter is already running');
        }
        logger.debug('MattermostAdapter: connecting via WebSocket', { url: this.config.url });
        this.running = true;
    }
    async stop() {
        if (!this.running) {
            throw new Error('MattermostAdapter is not running');
        }
        logger.debug('MattermostAdapter: disconnecting');
        this.running = false;
    }
    isRunning() {
        return this.running;
    }
    async sendMessage(channelId, text) {
        if (!this.running) {
            throw new Error('MattermostAdapter is not running');
        }
        logger.debug('MattermostAdapter: sending message', { channelId, textLength: text.length });
        return { success: true, postId: `mm_${Date.now()}` };
    }
    async sendReply(channelId, rootId, text) {
        if (!this.running) {
            throw new Error('MattermostAdapter is not running');
        }
        logger.debug('MattermostAdapter: sending reply', { channelId, rootId, textLength: text.length });
        return { success: true, postId: `mm_reply_${Date.now()}` };
    }
    async getChannels() {
        if (!this.running) {
            throw new Error('MattermostAdapter is not running');
        }
        return [];
    }
    getConfig() {
        return { ...this.config };
    }
}
export default MattermostAdapter;
//# sourceMappingURL=index.js.map