#!/usr/bin/env node
import{k as i}from"./chunk-NVD4YMCU.js";var s=Object.freeze({stdout:"",stderr:"",exitCode:0});function O(e="",t){return{stdout:e,stderr:"",exitCode:0,observations:t}}function d(e,t=1,r){return{stdout:"",stderr:e,exitCode:t,observations:r}}function f(e,t,r,n){return{stdout:e,stderr:t,exitCode:r,observations:n}}function _(e){return{stdout:"",stderr:"",exitCode:e?0:1}}function E(e,t,r="",n=""){throw new i(e,t,r,n)}function u(e){let t=e.state.fileDescriptors;if(t&&t.size>=e.limits.maxFileDescriptors)throw new i(`too many open file descriptors (max ${e.limits.maxFileDescriptors})`,"file_descriptors")}var o=Object.freeze({COMMAND_NOT_FOUND:"CMD_NOT_FOUND",FILE_NOT_FOUND:"ENOENT",DIRECTORY_NOT_FOUND:"ENOENT_DIR",PERMISSION_DENIED:"EACCES",IS_A_DIRECTORY:"EISDIR",NOT_A_DIRECTORY:"ENOTDIR",LIMIT_EXCEEDED:"ELIMIT",SECURITY_VIOLATION:"ESEC",SYNTAX_ERROR:"ESYNTAX"}),N=Object.freeze({commandNotFound(e,t){return Object.freeze({type:"command_not_found",code:o.COMMAND_NOT_FOUND,confidence:1,message:`Command '${e}' not found.`,command:e,...t&&t.length>0?{suggestions:t}:{}})},fileNotFound(e,t){return Object.freeze({type:"file_not_found",code:o.FILE_NOT_FOUND,confidence:1,message:`File '${e}' not found.`,path:e,...t?{command:t}:{}})},directoryNotFound(e,t){return Object.freeze({type:"directory_not_found",code:o.DIRECTORY_NOT_FOUND,confidence:1,message:`Directory '${e}' not found.`,path:e,...t?{command:t}:{}})},isADirectory(e,t){return Object.freeze({type:"file_not_found",code:o.IS_A_DIRECTORY,confidence:1,message:`'${e}' is a directory, not a file.`,path:e,...t?{command:t}:{}})},notADirectory(e,t){return Object.freeze({type:"directory_not_found",code:o.NOT_A_DIRECTORY,confidence:1,message:`'${e}' is not a directory.`,path:e,...t?{command:t}:{}})},permissionDenied(e,t){return Object.freeze({type:"permission_denied",code:o.PERMISSION_DENIED,confidence:1,message:`Permission denied for '${e}'.`,path:e,...t?{command:t}:{}})}});export{s as a,O as b,d as c,f as d,_ as e,E as f,u as g,N as h};
