export declare const PACKAGE_ROOT: string; export declare function realpath(p: string): string; /** Whether `file` is one of the CLI's own files, not one of its dependencies. */ export declare function isOwnPath(file: string, packageRoot: string): boolean; /** `err` and its causes, outermost first, at most MAX_CAUSE_DEPTH of them. */ export declare function errorChain(err: unknown): Generator; /** * Whether `err` or one of its causes is of a type a CLI bug throws. Cheap, so * it can run where an error is printed; `findCliBug`, which reads the stack, * decides. */ export declare function mayBeCliBug(err: unknown): boolean; /** The file a frame's code is in, as a path: for an eval, the file that ran it. */ export declare function frameFile(filename: string): string; /** * Whether `err` is a bug in the CLI's own code: one of the runtime error types * a bug throws, raised in a file of the CLI. A TypeError in a user's check * file, which the CLI loads and runs in its own process, is the user's. * `packageRoot` is a real path, as the stack's files are. */ export declare function isCliBug(err: unknown, packageRoot?: string): boolean; /** * The CLI bug in `err` or in its causes: the CLI wraps many errors in a plain * Error with the original as `cause`. Only that error is reported, not the * wrapper, whose message may quote a user's file and its stack. */ export declare function findCliBug(err: unknown, packageRoot?: string): Error | undefined;