// Feishu Card Builder
// Builds Feishu interactive card JSON using native elements
export class CardBuilder {
    header;
    elements = [];
    withHeader(title, template) {
        this.header = {
            title: { tag: 'plain_text', content: title },
            template
        };
        return this;
    }
    addMarkdown(content) {
        this.elements.push({
            tag: 'markdown',
            content
        });
        return this;
    }
    addDiv(text) {
        this.elements.push({
            tag: 'div',
            text: { tag: 'plain_text', content: text }
        });
        return this;
    }
    addCode(code, language) {
        this.elements.push({
            tag: 'code',
            text: { tag: 'plain_text', content: code },
            language
        });
        return this;
    }
    addDivider() {
        this.elements.push({ tag: 'hr' });
        return this;
    }
    addButtons(buttons) {
        const actions = buttons.map(b => ({
            tag: 'button',
            text: { tag: 'plain_text', content: b.text },
            type: b.type,
            value: b.value
        }));
        this.elements.push({
            tag: 'action',
            actions
        });
        return this;
    }
    addAgentBadge(agent) {
        const agentEmoji = {
            'claude-code': '🧠',
            'codex': '⚡',
            'opencode': '🔧'
        };
        const emoji = agentEmoji[agent] || '🤖';
        this.elements.push({
            tag: 'note',
            elements: [{
                    tag: 'plain_text',
                    content: `${emoji} ${agent}`
                }]
        });
        return this;
    }
    build() {
        const card = {
            config: { wide_screen_mode: true },
            elements: this.elements
        };
        if (this.header) {
            card.header = this.header;
        }
        return card;
    }
}
/**
 * Convert markdown text to Feishu-compatible format
 * Feishu supports most standard markdown in the markdown element
 */
export function markdownToFeishu(text) {
    // Feishu markdown element supports standard markdown
    // Just need to ensure code blocks are properly formatted
    return text;
}
//# sourceMappingURL=card-builder.js.map