const ERROR_MAP = [
    { pattern: /command not found/i, type: 'CommandNotFound' },
    { pattern: /Permission denied|EACCES/i, type: 'PermissionError' },
    { pattern: /No such file or directory|ENOENT/i, type: 'FileNotFound' },
    { pattern: /ECONNREFUSED/i, type: 'ConnectionRefused' },
    { pattern: /EADDRINUSE/i, type: 'AddressInUse' },
    { pattern: /ETIMEDOUT|ESOCKETTIMEDOUT/i, type: 'Timeout' },
    { pattern: /ENOMEM/i, type: 'OutOfMemory' },
];
export const shellParser = {
    name: 'shell',
    priority: 5,
    canParse(input) {
        return ERROR_MAP.some(e => e.pattern.test(input));
    },
    parse(input) {
        let errorType = 'ShellError';
        for (const entry of ERROR_MAP) {
            if (entry.pattern.test(input)) {
                errorType = entry.type;
                break;
            }
        }
        const firstLine = input.trim().split('\n')[0] ?? input;
        return {
            errorType,
            message: firstLine,
            stackTrace: null,
            frames: [],
            sourceFile: null,
            sourceLine: null,
            language: 'shell',
        };
    },
};
//# sourceMappingURL=shell.js.map