/**
 * Slash command registry with metadata for inline completion.
 *
 * Assembles slash command entries from the shared constants
 * and provides filtering utilities for the completion menu.
 */
import { SlashCommand } from '../../shared/constants.js';
/** i18n label key for each slash command description */
const SLASH_COMMAND_LABEL_KEYS = {
    '/accept': 'interactive.commands.accept',
    '/play': 'interactive.commands.play',
    '/go': 'interactive.commands.go',
    '/retry': 'interactive.commands.retry',
    '/replay': 'interactive.commands.replay',
    '/cancel': 'interactive.commands.cancel',
    '/resume': 'interactive.commands.resume',
};
/**
 * Registry of all slash commands.
 */
const SLASH_COMMAND_REGISTRY = (Object.values(SlashCommand)).map((command) => ({ command, labelKey: SLASH_COMMAND_LABEL_KEYS[command] }));
/**
 * Filter slash commands by prefix match and availability conditions.
 */
export const filterSlashCommands = (prefix, availability) => {
    const lower = prefix.toLowerCase();
    return SLASH_COMMAND_REGISTRY.filter((entry) => {
        if (!entry.command.startsWith(lower))
            return false;
        if (!availability)
            return true;
        if (entry.command === SlashCommand.Retry && !availability.enableRetryCommand)
            return false;
        if (entry.command === SlashCommand.Replay && !availability.hasPreviousOrder)
            return false;
        return true;
    });
};
//# sourceMappingURL=slashCommandRegistry.js.map