/**
 * Slack Integration Types
 *
 * Types for Slack bot integration enabling mobile communication
 * with the Crewly orchestrator.
 *
 * @module types/slack
 */
/**
 * Valid notification urgency levels
 */
export const NOTIFICATION_URGENCIES = ['low', 'normal', 'high', 'critical'];
/**
 * Command intent patterns for parsing
 */
export const COMMAND_PATTERNS = {
    status: [
        /^(what('s| is) the )?status/i,
        /^how('s| is| are)/i,
        /^(show|get|check) (me )?(the )?(status|progress)/i,
    ],
    assign: [/^assign/i, /^give .+ to/i, /^have .+ (work on|do)/i],
    create_task: [/^create (a )?task/i, /^add (a )?task/i, /^new task/i],
    create_project: [/^create (a )?project/i, /^new project/i, /^start (a )?project/i],
    list_projects: [/^(list|show|get) (all )?(the )?projects/i, /^what projects/i],
    list_teams: [/^(list|show|get) (all )?(the )?teams/i, /^what teams/i],
    list_agents: [/^(list|show|get) (all )?(the )?agents/i, /^who('s| is) (working|available)/i],
    pause: [/^pause/i, /^stop/i, /^hold/i],
    resume: [/^resume/i, /^continue/i, /^start/i, /^unpause/i],
    help: [/^help/i, /^what can you do/i, /^commands/i],
    conversation: [/.*/], // Catch-all for general conversation
    unknown: [],
};
/**
 * Check if user is allowed to interact with the bot
 *
 * @param userId - Slack user ID to check
 * @param config - Slack configuration with allowed users
 * @returns True if user is allowed to interact
 */
export function isUserAllowed(userId, config) {
    if (!config.allowedUserIds || config.allowedUserIds.length === 0) {
        return true; // No restrictions
    }
    return config.allowedUserIds.includes(userId);
}
/**
 * Parse command intent from message text
 *
 * @param text - Message text to parse
 * @returns Detected command intent
 */
export function parseCommandIntent(text) {
    const normalizedText = text.trim().toLowerCase();
    for (const [intent, patterns] of Object.entries(COMMAND_PATTERNS)) {
        if (intent === 'conversation' || intent === 'unknown')
            continue;
        for (const pattern of patterns) {
            if (pattern.test(normalizedText)) {
                return intent;
            }
        }
    }
    return 'conversation'; // Default to conversation
}
//# sourceMappingURL=slack.types.js.map