/** * 判断 target 是否位于 base 目录内(含 base 自身)。 */ export declare function isInsidePath(target: string, base: string): boolean; /** * 检测命令中是否引用了沙箱目录之外的路径。 * * 覆盖常见逃逸写法: * - 绝对路径:/Users/...、/home/...、/etc/...、/private/...、/System/...、/root/...、/var/...、Windows 盘符路径 * - 用户主目录:~/...、$HOME/... * - file:// 协议:file:///Users/...、file:///etc/... * - 父目录穿越(相对路径 ..) * * 仅当命中路径确实位于沙箱 rootDir 之外时才返回该片段; * 沙箱自身的脚本绝对路径(位于 rootDir 内)不会被拦截。 * 例外:命中 Windows 用户主目录(winHome)时无条件拦截, * 即使该路径同时位于 rootDir 内(主目录整体视为逃逸)。 */ export declare function detectOutsideSandboxPath(command: string, rootDir: string): string | null; //# sourceMappingURL=path-guard.d.ts.map