/**
 * Action Intent Detection Keywords
 * Maps intent types to user query patterns for detecting user actions.
 */
export const ACTION_KEYWORDS = {
    // Auth Actions
    'logout': ['logout', 'sign out', 'log out', 'signoff', 'logoff'],
    'login': ['login', 'signin', 'log in', 'sign in', 'authenticate', 'auth'],
    // Data Transfer
    'import': ['import', 'upload', 'restore', 'ingest'],
    'export': ['export', 'download', 'backup', 'dump'],
    // Monitoring
    'MONITOR': ['monitor', 'track', 'audit', 'inspect', 'history', 'logs', 'usage', 'metrics', 'stats'],
    // CRUD
    'create': ['create', 'add', 'new', 'make', 'generate', 'register'],
    'update': ['update', 'edit', 'change', 'modify', 'save', 'set', 'reset', 'password', 'refresh', 'approve', 'reject'],
    'delete': ['delete', 'remove', 'drop', 'erase'],
    'list': ['list', 'get', 'show', 'fetch', 'all', 'view', 'files', 'status', 'check'],
};
/**
 * Order matters: More specific actions should be checked first.
 * e.g., 'logout' should be checked before 'delete' to avoid misclassification.
 */
export const ACTION_PRIORITY = [
    'logout',
    'import',
    'export',
    'MONITOR',
    'login',
    'create',
    'update',
    'delete',
    'list',
];
/**
 * Checks if a keyword appears as a whole word in the query.
 * Prevents false positives like "add" matching "additional".
 */
export function matchesKeyword(query, keyword) {
    if (keyword.includes(' ')) {
        // Multi-word keywords: use simple includes (already specific enough)
        return query.includes(keyword);
    }
    const regex = new RegExp(`\\b${keyword}\\b`);
    return regex.test(query);
}
