pi-codex-auto-review 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -10
- package/dist/approval-commands.d.ts +4 -0
- package/dist/approval-commands.js +103 -0
- package/dist/approval-commands.js.map +1 -0
- package/dist/approval-settings.d.ts +9 -0
- package/dist/approval-settings.js +40 -0
- package/dist/approval-settings.js.map +1 -0
- package/dist/contracts.d.ts +2 -0
- package/dist/contracts.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -34
- package/dist/index.js.map +1 -1
- package/dist/policy/index.d.ts +0 -1
- package/dist/policy/index.js +6 -32
- package/dist/policy/index.js.map +1 -1
- package/dist/review/investigation.d.ts +3 -3
- package/dist/review/investigation.js +1 -1
- package/dist/review/investigation.js.map +1 -1
- package/dist/review/policy.js +1 -1
- package/dist/tools/controller.d.ts +7 -4
- package/dist/tools/controller.js +51 -35
- package/dist/tools/controller.js.map +1 -1
- package/dist/tools/environment.d.ts +1 -0
- package/dist/tools/environment.js +6 -0
- package/dist/tools/environment.js.map +1 -0
- package/dist/tools/executor.d.ts +14 -0
- package/dist/tools/executor.js +75 -0
- package/dist/tools/executor.js.map +1 -0
- package/dist/tools/mutation-queue.d.ts +1 -0
- package/dist/tools/mutation-queue.js +16 -0
- package/dist/tools/mutation-queue.js.map +1 -0
- package/docs/publishing.md +7 -7
- package/docs/security/dependencies.md +13 -3
- package/docs/testing/auto-review-protection.md +28 -8
- package/docs/usage.md +19 -16
- package/package.json +11 -14
- package/dist/sandbox/broker.d.ts +0 -1
- package/dist/sandbox/broker.js +0 -139
- package/dist/sandbox/broker.js.map +0 -1
- package/dist/sandbox/config.d.ts +0 -5
- package/dist/sandbox/config.js +0 -97
- package/dist/sandbox/config.js.map +0 -1
- package/dist/sandbox/directory-scan.d.ts +0 -1
- package/dist/sandbox/directory-scan.js +0 -32
- package/dist/sandbox/directory-scan.js.map +0 -1
- package/dist/sandbox/executor.d.ts +0 -20
- package/dist/sandbox/executor.js +0 -146
- package/dist/sandbox/executor.js.map +0 -1
- package/dist/sandbox/hard-links.d.ts +0 -4
- package/dist/sandbox/hard-links.js +0 -155
- package/dist/sandbox/hard-links.js.map +0 -1
- package/dist/sandbox/linux-read-paths.d.ts +0 -7
- package/dist/sandbox/linux-read-paths.js +0 -47
- package/dist/sandbox/linux-read-paths.js.map +0 -1
- package/dist/sandbox/paths.d.ts +0 -3
- package/dist/sandbox/paths.js +0 -10
- package/dist/sandbox/paths.js.map +0 -1
- package/dist/sandbox/runtime-write-paths.d.ts +0 -2
- package/dist/sandbox/runtime-write-paths.js +0 -8
- package/dist/sandbox/runtime-write-paths.js.map +0 -1
- package/dist/sandbox/seccomp.d.ts +0 -5
- package/dist/sandbox/seccomp.js +0 -16
- package/dist/sandbox/seccomp.js.map +0 -1
- package/dist/sandbox/worker.d.ts +0 -1
- package/dist/sandbox/worker.js +0 -78
- package/dist/sandbox/worker.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/LICENSE +0 -201
- package/node_modules/@anthropic-ai/sandbox-runtime/README.md +0 -901
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.d.ts +0 -3
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.js +0 -472
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/index.d.ts +0 -19
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/index.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/index.js +0 -17
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/index.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/address.d.ts +0 -52
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/address.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/address.js +0 -153
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/address.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/aws-sigv4.d.ts +0 -164
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/aws-sigv4.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/aws-sigv4.js +0 -246
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/aws-sigv4.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/body-substitution.d.ts +0 -58
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/body-substitution.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/body-substitution.js +0 -128
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/body-substitution.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-aws-pairs.d.ts +0 -124
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-aws-pairs.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-aws-pairs.js +0 -258
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-aws-pairs.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-decode.d.ts +0 -87
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-decode.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-decode.js +0 -138
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-decode.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-extract.d.ts +0 -67
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-extract.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-extract.js +0 -113
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-extract.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-env.d.ts +0 -70
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-env.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-env.js +0 -171
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-env.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-files.d.ts +0 -120
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-files.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-files.js +0 -281
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-files.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-sentinel.d.ts +0 -108
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-sentinel.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-sentinel.js +0 -208
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-sentinel.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/domain-pattern.d.ts +0 -82
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/domain-pattern.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/domain-pattern.js +0 -155
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/domain-pattern.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.d.ts +0 -44
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.js +0 -220
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.d.ts +0 -150
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.js +0 -678
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/java-proxy-agent.d.ts +0 -32
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/java-proxy-agent.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/java-proxy-agent.js +0 -111
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/java-proxy-agent.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.d.ts +0 -305
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.js +0 -2605
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-violation-monitor.d.ts +0 -55
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-violation-monitor.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-violation-monitor.js +0 -152
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-violation-monitor.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/listen-in-range.d.ts +0 -12
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/listen-in-range.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/listen-in-range.js +0 -43
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/listen-in-range.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.d.ts +0 -116
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.js +0 -1195
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.d.ts +0 -200
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.js +0 -443
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-leaf.d.ts +0 -28
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-leaf.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-leaf.js +0 -114
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-leaf.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mux-proxy.d.ts +0 -59
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mux-proxy.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mux-proxy.js +0 -159
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mux-proxy.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.d.ts +0 -147
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.js +0 -445
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.d.ts +0 -17
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.js +0 -163
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/request-filter.d.ts +0 -83
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/request-filter.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/request-filter.js +0 -212
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/request-filter.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.d.ts +0 -76
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.js +0 -221
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.d.ts +0 -1691
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.js +0 -1233
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.d.ts +0 -97
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.js +0 -1937
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-schemas.d.ts +0 -113
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-schemas.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-schemas.js +0 -3
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-schemas.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.d.ts +0 -411
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.js +0 -1408
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.d.ts +0 -37
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.js +0 -125
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.d.ts +0 -57
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.js +0 -332
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/tls-terminate-proxy.d.ts +0 -100
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/tls-terminate-proxy.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/tls-terminate-proxy.js +0 -546
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/tls-terminate-proxy.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/windows-sandbox-utils.d.ts +0 -923
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/windows-sandbox-utils.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/windows-sandbox-utils.js +0 -1419
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/windows-sandbox-utils.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/config-loader.d.ts +0 -31
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/config-loader.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/config-loader.js +0 -69
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/config-loader.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.d.ts +0 -7
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.js +0 -25
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.d.ts +0 -15
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.js +0 -49
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.d.ts +0 -17
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.js +0 -37
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/shell-quote.d.ts +0 -27
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/shell-quote.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/shell-quote.js +0 -47
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/shell-quote.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.d.ts +0 -9
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.js +0 -25
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.js.map +0 -1
- package/node_modules/@anthropic-ai/sandbox-runtime/package.json +0 -88
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/java-proxy-agent/build.ts +0 -95
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/java-proxy-agent/srt-proxy-agent.jar +0 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/seccomp/arm64/apply-seccomp +0 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/seccomp/build.ts +0 -69
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/seccomp/x64/apply-seccomp +0 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/srt-win/arm64/srt-win.exe +0 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/srt-win/build.ts +0 -28
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/srt-win/x64/srt-win.exe +0 -0
- package/node_modules/@pondwader/socks5-server/.github/workflows/ci.yml +0 -27
- package/node_modules/@pondwader/socks5-server/LICENSE +0 -20
- package/node_modules/@pondwader/socks5-server/README.md +0 -151
- package/node_modules/@pondwader/socks5-server/dist/index.d.mts +0 -87
- package/node_modules/@pondwader/socks5-server/dist/index.d.ts +0 -87
- package/node_modules/@pondwader/socks5-server/dist/index.js +0 -346
- package/node_modules/@pondwader/socks5-server/dist/index.mjs +0 -307
- package/node_modules/@pondwader/socks5-server/package.json +0 -31
- package/node_modules/commander/LICENSE +0 -22
- package/node_modules/commander/Readme.md +0 -1157
- package/node_modules/commander/esm.mjs +0 -16
- package/node_modules/commander/index.js +0 -24
- package/node_modules/commander/lib/argument.js +0 -149
- package/node_modules/commander/lib/command.js +0 -2509
- package/node_modules/commander/lib/error.js +0 -39
- package/node_modules/commander/lib/help.js +0 -520
- package/node_modules/commander/lib/option.js +0 -330
- package/node_modules/commander/lib/suggestSimilar.js +0 -101
- package/node_modules/commander/package-support.json +0 -16
- package/node_modules/commander/package.json +0 -84
- package/node_modules/commander/typings/esm.d.mts +0 -3
- package/node_modules/commander/typings/index.d.ts +0 -969
- package/node_modules/node-forge/.editorconfig +0 -17
- package/node_modules/node-forge/.eslintrc.js +0 -24
- package/node_modules/node-forge/.github/workflows/main.yaml +0 -96
- package/node_modules/node-forge/.istanbul.yml +0 -2
- package/node_modules/node-forge/.npmignore +0 -15
- package/node_modules/node-forge/CHANGELOG.md +0 -555
- package/node_modules/node-forge/CONTRIBUTING.md +0 -18
- package/node_modules/node-forge/LICENSE +0 -331
- package/node_modules/node-forge/README.md +0 -2071
- package/node_modules/node-forge/RELEASE.md +0 -19
- package/node_modules/node-forge/SECURITY.md +0 -5
- package/node_modules/node-forge/examples/create-cert.js +0 -110
- package/node_modules/node-forge/examples/create-csr.js +0 -66
- package/node_modules/node-forge/examples/create-pkcs12.js +0 -160
- package/node_modules/node-forge/examples/imap.js +0 -46
- package/node_modules/node-forge/examples/sign-p7.js +0 -115
- package/node_modules/node-forge/examples/tls.js +0 -189
- package/node_modules/node-forge/flash/PooledSocket.as +0 -18
- package/node_modules/node-forge/flash/README.md +0 -48
- package/node_modules/node-forge/flash/SocketEvent.as +0 -36
- package/node_modules/node-forge/flash/SocketPool.as +0 -754
- package/node_modules/node-forge/flash/mod_fsp/README +0 -135
- package/node_modules/node-forge/flash/mod_fsp/mod_fsp.c +0 -415
- package/node_modules/node-forge/flash/package.json +0 -28
- package/node_modules/node-forge/flash/policyserver.js +0 -65
- package/node_modules/node-forge/flash/policyserver.py +0 -112
- package/node_modules/node-forge/flash/swf/SocketPool.swf +0 -0
- package/node_modules/node-forge/karma-sauce.conf.js +0 -79
- package/node_modules/node-forge/karma.conf.js +0 -133
- package/node_modules/node-forge/lib/aes.js +0 -1091
- package/node_modules/node-forge/lib/aesCipherSuites.js +0 -282
- package/node_modules/node-forge/lib/asn1-validator.js +0 -91
- package/node_modules/node-forge/lib/asn1.js +0 -1503
- package/node_modules/node-forge/lib/baseN.js +0 -186
- package/node_modules/node-forge/lib/cipher.js +0 -230
- package/node_modules/node-forge/lib/cipherModes.js +0 -999
- package/node_modules/node-forge/lib/des.js +0 -496
- package/node_modules/node-forge/lib/ed25519.js +0 -1091
- package/node_modules/node-forge/lib/forge.js +0 -13
- package/node_modules/node-forge/lib/form.js +0 -149
- package/node_modules/node-forge/lib/hmac.js +0 -146
- package/node_modules/node-forge/lib/http.js +0 -1346
- package/node_modules/node-forge/lib/index.all.js +0 -16
- package/node_modules/node-forge/lib/index.js +0 -33
- package/node_modules/node-forge/lib/jsbn.js +0 -1294
- package/node_modules/node-forge/lib/kem.js +0 -168
- package/node_modules/node-forge/lib/log.js +0 -319
- package/node_modules/node-forge/lib/md.all.js +0 -13
- package/node_modules/node-forge/lib/md.js +0 -11
- package/node_modules/node-forge/lib/md5.js +0 -289
- package/node_modules/node-forge/lib/mgf.js +0 -12
- package/node_modules/node-forge/lib/mgf1.js +0 -57
- package/node_modules/node-forge/lib/oids.js +0 -180
- package/node_modules/node-forge/lib/pbe.js +0 -1023
- package/node_modules/node-forge/lib/pbkdf2.js +0 -211
- package/node_modules/node-forge/lib/pem.js +0 -237
- package/node_modules/node-forge/lib/pkcs1.js +0 -276
- package/node_modules/node-forge/lib/pkcs12.js +0 -1078
- package/node_modules/node-forge/lib/pkcs7.js +0 -1260
- package/node_modules/node-forge/lib/pkcs7asn1.js +0 -410
- package/node_modules/node-forge/lib/pki.js +0 -102
- package/node_modules/node-forge/lib/prime.js +0 -297
- package/node_modules/node-forge/lib/prime.worker.js +0 -168
- package/node_modules/node-forge/lib/prng.js +0 -419
- package/node_modules/node-forge/lib/pss.js +0 -241
- package/node_modules/node-forge/lib/random.js +0 -191
- package/node_modules/node-forge/lib/rc2.js +0 -410
- package/node_modules/node-forge/lib/rsa.js +0 -1973
- package/node_modules/node-forge/lib/sha1.js +0 -319
- package/node_modules/node-forge/lib/sha256.js +0 -327
- package/node_modules/node-forge/lib/sha512.js +0 -561
- package/node_modules/node-forge/lib/socket.js +0 -287
- package/node_modules/node-forge/lib/ssh.js +0 -236
- package/node_modules/node-forge/lib/tls.js +0 -4282
- package/node_modules/node-forge/lib/tlssocket.js +0 -249
- package/node_modules/node-forge/lib/util.js +0 -2652
- package/node_modules/node-forge/lib/x509.js +0 -3251
- package/node_modules/node-forge/lib/xhr.js +0 -738
- package/node_modules/node-forge/package.json +0 -123
- package/node_modules/node-forge/tests/.eslintrc.js +0 -5
- package/node_modules/node-forge/tests/README.md +0 -4
- package/node_modules/node-forge/tests/benchmarks/aes-speed.js +0 -62
- package/node_modules/node-forge/tests/benchmarks/so-44303784.js +0 -246
- package/node_modules/node-forge/tests/flash/README.md +0 -7
- package/node_modules/node-forge/tests/flash/Test.as +0 -96
- package/node_modules/node-forge/tests/flash/build-flash.xml +0 -7
- package/node_modules/node-forge/tests/flash/index.html +0 -28
- package/node_modules/node-forge/tests/index.html +0 -33
- package/node_modules/node-forge/tests/issues/heartbleed.js +0 -55
- package/node_modules/node-forge/tests/issues/issue-428.html +0 -95
- package/node_modules/node-forge/tests/issues/issue-428.js +0 -375
- package/node_modules/node-forge/tests/karma/index.js +0 -8
- package/node_modules/node-forge/tests/karma/testWorker.js +0 -65
- package/node_modules/node-forge/tests/karma/web-worker-rsa.js +0 -55
- package/node_modules/node-forge/tests/legacy/common.html +0 -65
- package/node_modules/node-forge/tests/legacy/common.js +0 -2199
- package/node_modules/node-forge/tests/legacy/form.html +0 -148
- package/node_modules/node-forge/tests/legacy/form.js +0 -40
- package/node_modules/node-forge/tests/legacy/http.html +0 -235
- package/node_modules/node-forge/tests/legacy/index.html +0 -70
- package/node_modules/node-forge/tests/legacy/keygen.html +0 -113
- package/node_modules/node-forge/tests/legacy/login.css +0 -26
- package/node_modules/node-forge/tests/legacy/loginDemo.html +0 -32
- package/node_modules/node-forge/tests/legacy/loginDemo.js +0 -149
- package/node_modules/node-forge/tests/legacy/performance.html +0 -533
- package/node_modules/node-forge/tests/legacy/result.txt +0 -1
- package/node_modules/node-forge/tests/legacy/socketPool.html +0 -302
- package/node_modules/node-forge/tests/legacy/tasks.html +0 -54
- package/node_modules/node-forge/tests/legacy/tasks.js +0 -378
- package/node_modules/node-forge/tests/legacy/tls.html +0 -389
- package/node_modules/node-forge/tests/legacy/webid.html +0 -89
- package/node_modules/node-forge/tests/legacy/webid.js +0 -313
- package/node_modules/node-forge/tests/legacy/ws-webid.js +0 -120
- package/node_modules/node-forge/tests/legacy/xhr.html +0 -67
- package/node_modules/node-forge/tests/legacy/xhr.js +0 -590
- package/node_modules/node-forge/tests/pocs/ghsa-2328-f5f3-gj25.js +0 -85
- package/node_modules/node-forge/tests/pocs/ghsa-ppp5-5v6c-4jwp.js +0 -166
- package/node_modules/node-forge/tests/pocs/ghsa-q67f-28xg-22rw.js +0 -103
- package/node_modules/node-forge/tests/security/cve-2025-12816.js +0 -75
- package/node_modules/node-forge/tests/security/ghsa-554w-wpv2-vw27.js +0 -81
- package/node_modules/node-forge/tests/security/index.js +0 -3
- package/node_modules/node-forge/tests/server.crt +0 -26
- package/node_modules/node-forge/tests/server.js +0 -87
- package/node_modules/node-forge/tests/server.key +0 -27
- package/node_modules/node-forge/tests/support/task.js +0 -718
- package/node_modules/node-forge/tests/tests.css +0 -61
- package/node_modules/node-forge/tests/unit/aes.js +0 -1498
- package/node_modules/node-forge/tests/unit/asn1.js +0 -1337
- package/node_modules/node-forge/tests/unit/csr.js +0 -129
- package/node_modules/node-forge/tests/unit/des.js +0 -231
- package/node_modules/node-forge/tests/unit/ed25519.js +0 -395
- package/node_modules/node-forge/tests/unit/forge.js +0 -2
- package/node_modules/node-forge/tests/unit/hmac.js +0 -64
- package/node_modules/node-forge/tests/unit/index.html +0 -20
- package/node_modules/node-forge/tests/unit/index.js +0 -27
- package/node_modules/node-forge/tests/unit/jsbn.js +0 -40
- package/node_modules/node-forge/tests/unit/kem.js +0 -167
- package/node_modules/node-forge/tests/unit/md5.js +0 -114
- package/node_modules/node-forge/tests/unit/mgf1.js +0 -16
- package/node_modules/node-forge/tests/unit/pbkdf2.js +0 -182
- package/node_modules/node-forge/tests/unit/pem.js +0 -159
- package/node_modules/node-forge/tests/unit/pkcs1.js +0 -1077
- package/node_modules/node-forge/tests/unit/pkcs12.js +0 -739
- package/node_modules/node-forge/tests/unit/pkcs7.js +0 -792
- package/node_modules/node-forge/tests/unit/random.js +0 -48
- package/node_modules/node-forge/tests/unit/rc2.js +0 -88
- package/node_modules/node-forge/tests/unit/rsa.js +0 -1278
- package/node_modules/node-forge/tests/unit/sha1.js +0 -72
- package/node_modules/node-forge/tests/unit/sha256.js +0 -79
- package/node_modules/node-forge/tests/unit/sha512.js +0 -200
- package/node_modules/node-forge/tests/unit/ssh.js +0 -175
- package/node_modules/node-forge/tests/unit/tls.js +0 -175
- package/node_modules/node-forge/tests/unit/util.js +0 -595
- package/node_modules/node-forge/tests/unit/x509.js +0 -1986
- package/node_modules/node-forge/tests/websockets/server-webid.js +0 -495
- package/node_modules/node-forge/tests/websockets/server-ws.js +0 -158
- package/node_modules/node-forge/webpack-tests.config.js +0 -26
- package/node_modules/node-forge/webpack.config.js +0 -130
- package/node_modules/zod/LICENSE +0 -21
- package/node_modules/zod/README.md +0 -208
- package/node_modules/zod/index.cjs +0 -33
- package/node_modules/zod/index.d.cts +0 -4
- package/node_modules/zod/index.d.ts +0 -4
- package/node_modules/zod/index.js +0 -4
- package/node_modules/zod/package.json +0 -118
- package/node_modules/zod/src/index.ts +0 -4
- package/node_modules/zod/src/v3/ZodError.ts +0 -330
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
- package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
- package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
- package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
- package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
- package/node_modules/zod/src/v3/errors.ts +0 -13
- package/node_modules/zod/src/v3/external.ts +0 -6
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
- package/node_modules/zod/src/v3/helpers/util.ts +0 -224
- package/node_modules/zod/src/v3/index.ts +0 -4
- package/node_modules/zod/src/v3/locales/en.ts +0 -124
- package/node_modules/zod/src/v3/standard-schema.ts +0 -113
- package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
- package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
- package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
- package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
- package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
- package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/complex.test.ts +0 -56
- package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
- package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
- package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
- package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
- package/node_modules/zod/src/v3/tests/function.test.ts +0 -257
- package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
- package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
- package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
- package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
- package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
- package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
- package/node_modules/zod/src/v3/tests/nan.test.ts +0 -21
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
- package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
- package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
- package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
- package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
- package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
- package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
- package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
- package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
- package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
- package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
- package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
- package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
- package/node_modules/zod/src/v3/types.ts +0 -5136
- package/node_modules/zod/src/v4/classic/checks.ts +0 -30
- package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
- package/node_modules/zod/src/v4/classic/compat.ts +0 -66
- package/node_modules/zod/src/v4/classic/errors.ts +0 -75
- package/node_modules/zod/src/v4/classic/external.ts +0 -50
- package/node_modules/zod/src/v4/classic/index.ts +0 -5
- package/node_modules/zod/src/v4/classic/iso.ts +0 -90
- package/node_modules/zod/src/v4/classic/parse.ts +0 -33
- package/node_modules/zod/src/v4/classic/schemas.ts +0 -2054
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -210
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -63
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -252
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -352
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -31
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -296
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -313
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -619
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -527
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -91
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -175
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -268
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -829
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -34
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -171
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -108
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -92
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -196
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -86
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -247
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -563
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -123
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -147
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -127
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -81
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -37
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -298
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -342
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -356
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -532
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -204
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -179
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -57
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -109
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -881
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -66
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -758
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -2314
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -250
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -163
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -94
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
- package/node_modules/zod/src/v4/core/api.ts +0 -1594
- package/node_modules/zod/src/v4/core/checks.ts +0 -1283
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- package/node_modules/zod/src/v4/core/core.ts +0 -134
- package/node_modules/zod/src/v4/core/doc.ts +0 -44
- package/node_modules/zod/src/v4/core/errors.ts +0 -424
- package/node_modules/zod/src/v4/core/function.ts +0 -176
- package/node_modules/zod/src/v4/core/index.ts +0 -15
- package/node_modules/zod/src/v4/core/json-schema.ts +0 -143
- package/node_modules/zod/src/v4/core/parse.ts +0 -94
- package/node_modules/zod/src/v4/core/regexes.ts +0 -135
- package/node_modules/zod/src/v4/core/registries.ts +0 -96
- package/node_modules/zod/src/v4/core/schemas.ts +0 -3842
- package/node_modules/zod/src/v4/core/standard-schema.ts +0 -64
- package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
- package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -977
- package/node_modules/zod/src/v4/core/util.ts +0 -775
- package/node_modules/zod/src/v4/core/versions.ts +0 -5
- package/node_modules/zod/src/v4/core/zsf.ts +0 -323
- package/node_modules/zod/src/v4/index.ts +0 -4
- package/node_modules/zod/src/v4/locales/ar.ts +0 -125
- package/node_modules/zod/src/v4/locales/az.ts +0 -121
- package/node_modules/zod/src/v4/locales/be.ts +0 -184
- package/node_modules/zod/src/v4/locales/ca.ts +0 -127
- package/node_modules/zod/src/v4/locales/cs.ts +0 -142
- package/node_modules/zod/src/v4/locales/de.ts +0 -124
- package/node_modules/zod/src/v4/locales/en.ts +0 -127
- package/node_modules/zod/src/v4/locales/eo.ts +0 -125
- package/node_modules/zod/src/v4/locales/es.ts +0 -125
- package/node_modules/zod/src/v4/locales/fa.ts +0 -134
- package/node_modules/zod/src/v4/locales/fi.ts +0 -131
- package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -126
- package/node_modules/zod/src/v4/locales/fr.ts +0 -124
- package/node_modules/zod/src/v4/locales/he.ts +0 -125
- package/node_modules/zod/src/v4/locales/hu.ts +0 -126
- package/node_modules/zod/src/v4/locales/id.ts +0 -125
- package/node_modules/zod/src/v4/locales/index.ts +0 -39
- package/node_modules/zod/src/v4/locales/it.ts +0 -125
- package/node_modules/zod/src/v4/locales/ja.ts +0 -122
- package/node_modules/zod/src/v4/locales/kh.ts +0 -126
- package/node_modules/zod/src/v4/locales/ko.ts +0 -131
- package/node_modules/zod/src/v4/locales/mk.ts +0 -127
- package/node_modules/zod/src/v4/locales/ms.ts +0 -124
- package/node_modules/zod/src/v4/locales/nl.ts +0 -126
- package/node_modules/zod/src/v4/locales/no.ts +0 -124
- package/node_modules/zod/src/v4/locales/ota.ts +0 -125
- package/node_modules/zod/src/v4/locales/pl.ts +0 -126
- package/node_modules/zod/src/v4/locales/ps.ts +0 -133
- package/node_modules/zod/src/v4/locales/pt.ts +0 -123
- package/node_modules/zod/src/v4/locales/ru.ts +0 -184
- package/node_modules/zod/src/v4/locales/sl.ts +0 -126
- package/node_modules/zod/src/v4/locales/sv.ts +0 -127
- package/node_modules/zod/src/v4/locales/ta.ts +0 -125
- package/node_modules/zod/src/v4/locales/th.ts +0 -126
- package/node_modules/zod/src/v4/locales/tr.ts +0 -121
- package/node_modules/zod/src/v4/locales/ua.ts +0 -126
- package/node_modules/zod/src/v4/locales/ur.ts +0 -126
- package/node_modules/zod/src/v4/locales/vi.ts +0 -125
- package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -123
- package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -125
- package/node_modules/zod/src/v4/mini/checks.ts +0 -32
- package/node_modules/zod/src/v4/mini/coerce.ts +0 -22
- package/node_modules/zod/src/v4/mini/external.ts +0 -40
- package/node_modules/zod/src/v4/mini/index.ts +0 -3
- package/node_modules/zod/src/v4/mini/iso.ts +0 -62
- package/node_modules/zod/src/v4/mini/parse.ts +0 -1
- package/node_modules/zod/src/v4/mini/schemas.ts +0 -1579
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -51
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -43
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -871
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -185
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -275
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -299
- package/node_modules/zod/src/v4-mini/index.ts +0 -1
- package/node_modules/zod/v3/ZodError.cjs +0 -138
- package/node_modules/zod/v3/ZodError.d.cts +0 -164
- package/node_modules/zod/v3/ZodError.d.ts +0 -164
- package/node_modules/zod/v3/ZodError.js +0 -133
- package/node_modules/zod/v3/errors.cjs +0 -17
- package/node_modules/zod/v3/errors.d.cts +0 -5
- package/node_modules/zod/v3/errors.d.ts +0 -5
- package/node_modules/zod/v3/errors.js +0 -9
- package/node_modules/zod/v3/external.cjs +0 -22
- package/node_modules/zod/v3/external.d.cts +0 -6
- package/node_modules/zod/v3/external.d.ts +0 -6
- package/node_modules/zod/v3/external.js +0 -6
- package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
- package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
- package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
- package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
- package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
- package/node_modules/zod/v3/helpers/util.cjs +0 -137
- package/node_modules/zod/v3/helpers/util.d.cts +0 -85
- package/node_modules/zod/v3/helpers/util.d.ts +0 -85
- package/node_modules/zod/v3/helpers/util.js +0 -133
- package/node_modules/zod/v3/index.cjs +0 -33
- package/node_modules/zod/v3/index.d.cts +0 -4
- package/node_modules/zod/v3/index.d.ts +0 -4
- package/node_modules/zod/v3/index.js +0 -4
- package/node_modules/zod/v3/locales/en.cjs +0 -111
- package/node_modules/zod/v3/locales/en.d.cts +0 -3
- package/node_modules/zod/v3/locales/en.d.ts +0 -3
- package/node_modules/zod/v3/locales/en.js +0 -109
- package/node_modules/zod/v3/standard-schema.cjs +0 -2
- package/node_modules/zod/v3/standard-schema.d.cts +0 -102
- package/node_modules/zod/v3/standard-schema.d.ts +0 -102
- package/node_modules/zod/v3/standard-schema.js +0 -1
- package/node_modules/zod/v3/types.cjs +0 -3775
- package/node_modules/zod/v3/types.d.cts +0 -1031
- package/node_modules/zod/v3/types.d.ts +0 -1031
- package/node_modules/zod/v3/types.js +0 -3693
- package/node_modules/zod/v4/classic/checks.cjs +0 -32
- package/node_modules/zod/v4/classic/checks.d.cts +0 -1
- package/node_modules/zod/v4/classic/checks.d.ts +0 -1
- package/node_modules/zod/v4/classic/checks.js +0 -1
- package/node_modules/zod/v4/classic/coerce.cjs +0 -47
- package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
- package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
- package/node_modules/zod/v4/classic/coerce.js +0 -17
- package/node_modules/zod/v4/classic/compat.cjs +0 -57
- package/node_modules/zod/v4/classic/compat.d.cts +0 -46
- package/node_modules/zod/v4/classic/compat.d.ts +0 -46
- package/node_modules/zod/v4/classic/compat.js +0 -27
- package/node_modules/zod/v4/classic/errors.cjs +0 -67
- package/node_modules/zod/v4/classic/errors.d.cts +0 -30
- package/node_modules/zod/v4/classic/errors.d.ts +0 -30
- package/node_modules/zod/v4/classic/errors.js +0 -41
- package/node_modules/zod/v4/classic/external.cjs +0 -70
- package/node_modules/zod/v4/classic/external.d.cts +0 -13
- package/node_modules/zod/v4/classic/external.d.ts +0 -13
- package/node_modules/zod/v4/classic/external.js +0 -18
- package/node_modules/zod/v4/classic/index.cjs +0 -33
- package/node_modules/zod/v4/classic/index.d.cts +0 -4
- package/node_modules/zod/v4/classic/index.d.ts +0 -4
- package/node_modules/zod/v4/classic/index.js +0 -4
- package/node_modules/zod/v4/classic/iso.cjs +0 -60
- package/node_modules/zod/v4/classic/iso.d.cts +0 -22
- package/node_modules/zod/v4/classic/iso.d.ts +0 -22
- package/node_modules/zod/v4/classic/iso.js +0 -30
- package/node_modules/zod/v4/classic/parse.cjs +0 -32
- package/node_modules/zod/v4/classic/parse.d.cts +0 -23
- package/node_modules/zod/v4/classic/parse.d.ts +0 -23
- package/node_modules/zod/v4/classic/parse.js +0 -6
- package/node_modules/zod/v4/classic/schemas.cjs +0 -1109
- package/node_modules/zod/v4/classic/schemas.d.cts +0 -630
- package/node_modules/zod/v4/classic/schemas.d.ts +0 -630
- package/node_modules/zod/v4/classic/schemas.js +0 -1006
- package/node_modules/zod/v4/core/api.cjs +0 -1039
- package/node_modules/zod/v4/core/api.d.cts +0 -284
- package/node_modules/zod/v4/core/api.d.ts +0 -284
- package/node_modules/zod/v4/core/api.js +0 -906
- package/node_modules/zod/v4/core/checks.cjs +0 -591
- package/node_modules/zod/v4/core/checks.d.cts +0 -278
- package/node_modules/zod/v4/core/checks.d.ts +0 -278
- package/node_modules/zod/v4/core/checks.js +0 -565
- package/node_modules/zod/v4/core/core.cjs +0 -67
- package/node_modules/zod/v4/core/core.d.cts +0 -49
- package/node_modules/zod/v4/core/core.d.ts +0 -49
- package/node_modules/zod/v4/core/core.js +0 -61
- package/node_modules/zod/v4/core/doc.cjs +0 -39
- package/node_modules/zod/v4/core/doc.d.cts +0 -14
- package/node_modules/zod/v4/core/doc.d.ts +0 -14
- package/node_modules/zod/v4/core/doc.js +0 -35
- package/node_modules/zod/v4/core/errors.cjs +0 -226
- package/node_modules/zod/v4/core/errors.d.cts +0 -208
- package/node_modules/zod/v4/core/errors.d.ts +0 -208
- package/node_modules/zod/v4/core/errors.js +0 -195
- package/node_modules/zod/v4/core/function.cjs +0 -102
- package/node_modules/zod/v4/core/function.d.cts +0 -52
- package/node_modules/zod/v4/core/function.d.ts +0 -52
- package/node_modules/zod/v4/core/function.js +0 -75
- package/node_modules/zod/v4/core/index.cjs +0 -44
- package/node_modules/zod/v4/core/index.d.cts +0 -15
- package/node_modules/zod/v4/core/index.d.ts +0 -15
- package/node_modules/zod/v4/core/index.js +0 -15
- package/node_modules/zod/v4/core/json-schema.cjs +0 -2
- package/node_modules/zod/v4/core/json-schema.d.cts +0 -87
- package/node_modules/zod/v4/core/json-schema.d.ts +0 -87
- package/node_modules/zod/v4/core/json-schema.js +0 -1
- package/node_modules/zod/v4/core/parse.cjs +0 -87
- package/node_modules/zod/v4/core/parse.d.cts +0 -25
- package/node_modules/zod/v4/core/parse.d.ts +0 -25
- package/node_modules/zod/v4/core/parse.js +0 -57
- package/node_modules/zod/v4/core/regexes.cjs +0 -103
- package/node_modules/zod/v4/core/regexes.d.cts +0 -62
- package/node_modules/zod/v4/core/regexes.d.ts +0 -62
- package/node_modules/zod/v4/core/regexes.js +0 -95
- package/node_modules/zod/v4/core/registries.cjs +0 -56
- package/node_modules/zod/v4/core/registries.d.cts +0 -35
- package/node_modules/zod/v4/core/registries.d.ts +0 -35
- package/node_modules/zod/v4/core/registries.js +0 -51
- package/node_modules/zod/v4/core/schemas.cjs +0 -1748
- package/node_modules/zod/v4/core/schemas.d.cts +0 -1041
- package/node_modules/zod/v4/core/schemas.d.ts +0 -1041
- package/node_modules/zod/v4/core/schemas.js +0 -1717
- package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
- package/node_modules/zod/v4/core/standard-schema.d.cts +0 -55
- package/node_modules/zod/v4/core/standard-schema.d.ts +0 -55
- package/node_modules/zod/v4/core/standard-schema.js +0 -1
- package/node_modules/zod/v4/core/to-json-schema.cjs +0 -854
- package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -88
- package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -88
- package/node_modules/zod/v4/core/to-json-schema.js +0 -849
- package/node_modules/zod/v4/core/util.cjs +0 -539
- package/node_modules/zod/v4/core/util.d.cts +0 -183
- package/node_modules/zod/v4/core/util.d.ts +0 -183
- package/node_modules/zod/v4/core/util.js +0 -493
- package/node_modules/zod/v4/core/versions.cjs +0 -8
- package/node_modules/zod/v4/core/versions.d.cts +0 -5
- package/node_modules/zod/v4/core/versions.d.ts +0 -5
- package/node_modules/zod/v4/core/versions.js +0 -5
- package/node_modules/zod/v4/index.cjs +0 -22
- package/node_modules/zod/v4/index.d.cts +0 -3
- package/node_modules/zod/v4/index.d.ts +0 -3
- package/node_modules/zod/v4/index.js +0 -3
- package/node_modules/zod/v4/locales/ar.cjs +0 -142
- package/node_modules/zod/v4/locales/ar.d.cts +0 -4
- package/node_modules/zod/v4/locales/ar.d.ts +0 -4
- package/node_modules/zod/v4/locales/ar.js +0 -116
- package/node_modules/zod/v4/locales/az.cjs +0 -141
- package/node_modules/zod/v4/locales/az.d.cts +0 -4
- package/node_modules/zod/v4/locales/az.d.ts +0 -4
- package/node_modules/zod/v4/locales/az.js +0 -115
- package/node_modules/zod/v4/locales/be.cjs +0 -190
- package/node_modules/zod/v4/locales/be.d.cts +0 -4
- package/node_modules/zod/v4/locales/be.d.ts +0 -4
- package/node_modules/zod/v4/locales/be.js +0 -164
- package/node_modules/zod/v4/locales/ca.cjs +0 -144
- package/node_modules/zod/v4/locales/ca.d.cts +0 -4
- package/node_modules/zod/v4/locales/ca.d.ts +0 -4
- package/node_modules/zod/v4/locales/ca.js +0 -118
- package/node_modules/zod/v4/locales/cs.cjs +0 -161
- package/node_modules/zod/v4/locales/cs.d.cts +0 -4
- package/node_modules/zod/v4/locales/cs.d.ts +0 -4
- package/node_modules/zod/v4/locales/cs.js +0 -135
- package/node_modules/zod/v4/locales/de.cjs +0 -142
- package/node_modules/zod/v4/locales/de.d.cts +0 -4
- package/node_modules/zod/v4/locales/de.d.ts +0 -4
- package/node_modules/zod/v4/locales/de.js +0 -116
- package/node_modules/zod/v4/locales/en.cjs +0 -145
- package/node_modules/zod/v4/locales/en.d.cts +0 -5
- package/node_modules/zod/v4/locales/en.d.ts +0 -5
- package/node_modules/zod/v4/locales/en.js +0 -117
- package/node_modules/zod/v4/locales/eo.cjs +0 -144
- package/node_modules/zod/v4/locales/eo.d.cts +0 -5
- package/node_modules/zod/v4/locales/eo.d.ts +0 -5
- package/node_modules/zod/v4/locales/eo.js +0 -116
- package/node_modules/zod/v4/locales/es.cjs +0 -143
- package/node_modules/zod/v4/locales/es.d.cts +0 -4
- package/node_modules/zod/v4/locales/es.d.ts +0 -4
- package/node_modules/zod/v4/locales/es.js +0 -117
- package/node_modules/zod/v4/locales/fa.cjs +0 -148
- package/node_modules/zod/v4/locales/fa.d.cts +0 -4
- package/node_modules/zod/v4/locales/fa.d.ts +0 -4
- package/node_modules/zod/v4/locales/fa.js +0 -122
- package/node_modules/zod/v4/locales/fi.cjs +0 -148
- package/node_modules/zod/v4/locales/fi.d.cts +0 -4
- package/node_modules/zod/v4/locales/fi.d.ts +0 -4
- package/node_modules/zod/v4/locales/fi.js +0 -122
- package/node_modules/zod/v4/locales/fr-CA.cjs +0 -143
- package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.js +0 -117
- package/node_modules/zod/v4/locales/fr.cjs +0 -142
- package/node_modules/zod/v4/locales/fr.d.cts +0 -4
- package/node_modules/zod/v4/locales/fr.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr.js +0 -116
- package/node_modules/zod/v4/locales/he.cjs +0 -143
- package/node_modules/zod/v4/locales/he.d.cts +0 -4
- package/node_modules/zod/v4/locales/he.d.ts +0 -4
- package/node_modules/zod/v4/locales/he.js +0 -117
- package/node_modules/zod/v4/locales/hu.cjs +0 -143
- package/node_modules/zod/v4/locales/hu.d.cts +0 -4
- package/node_modules/zod/v4/locales/hu.d.ts +0 -4
- package/node_modules/zod/v4/locales/hu.js +0 -117
- package/node_modules/zod/v4/locales/id.cjs +0 -142
- package/node_modules/zod/v4/locales/id.d.cts +0 -4
- package/node_modules/zod/v4/locales/id.d.ts +0 -4
- package/node_modules/zod/v4/locales/id.js +0 -116
- package/node_modules/zod/v4/locales/index.cjs +0 -84
- package/node_modules/zod/v4/locales/index.d.cts +0 -39
- package/node_modules/zod/v4/locales/index.d.ts +0 -39
- package/node_modules/zod/v4/locales/index.js +0 -39
- package/node_modules/zod/v4/locales/it.cjs +0 -143
- package/node_modules/zod/v4/locales/it.d.cts +0 -4
- package/node_modules/zod/v4/locales/it.d.ts +0 -4
- package/node_modules/zod/v4/locales/it.js +0 -117
- package/node_modules/zod/v4/locales/ja.cjs +0 -141
- package/node_modules/zod/v4/locales/ja.d.cts +0 -4
- package/node_modules/zod/v4/locales/ja.d.ts +0 -4
- package/node_modules/zod/v4/locales/ja.js +0 -115
- package/node_modules/zod/v4/locales/kh.cjs +0 -143
- package/node_modules/zod/v4/locales/kh.d.cts +0 -4
- package/node_modules/zod/v4/locales/kh.d.ts +0 -4
- package/node_modules/zod/v4/locales/kh.js +0 -117
- package/node_modules/zod/v4/locales/ko.cjs +0 -147
- package/node_modules/zod/v4/locales/ko.d.cts +0 -4
- package/node_modules/zod/v4/locales/ko.d.ts +0 -4
- package/node_modules/zod/v4/locales/ko.js +0 -121
- package/node_modules/zod/v4/locales/mk.cjs +0 -144
- package/node_modules/zod/v4/locales/mk.d.cts +0 -4
- package/node_modules/zod/v4/locales/mk.d.ts +0 -4
- package/node_modules/zod/v4/locales/mk.js +0 -118
- package/node_modules/zod/v4/locales/ms.cjs +0 -142
- package/node_modules/zod/v4/locales/ms.d.cts +0 -4
- package/node_modules/zod/v4/locales/ms.d.ts +0 -4
- package/node_modules/zod/v4/locales/ms.js +0 -116
- package/node_modules/zod/v4/locales/nl.cjs +0 -143
- package/node_modules/zod/v4/locales/nl.d.cts +0 -4
- package/node_modules/zod/v4/locales/nl.d.ts +0 -4
- package/node_modules/zod/v4/locales/nl.js +0 -117
- package/node_modules/zod/v4/locales/no.cjs +0 -142
- package/node_modules/zod/v4/locales/no.d.cts +0 -4
- package/node_modules/zod/v4/locales/no.d.ts +0 -4
- package/node_modules/zod/v4/locales/no.js +0 -116
- package/node_modules/zod/v4/locales/ota.cjs +0 -143
- package/node_modules/zod/v4/locales/ota.d.cts +0 -4
- package/node_modules/zod/v4/locales/ota.d.ts +0 -4
- package/node_modules/zod/v4/locales/ota.js +0 -117
- package/node_modules/zod/v4/locales/pl.cjs +0 -143
- package/node_modules/zod/v4/locales/pl.d.cts +0 -4
- package/node_modules/zod/v4/locales/pl.d.ts +0 -4
- package/node_modules/zod/v4/locales/pl.js +0 -117
- package/node_modules/zod/v4/locales/ps.cjs +0 -148
- package/node_modules/zod/v4/locales/ps.d.cts +0 -4
- package/node_modules/zod/v4/locales/ps.d.ts +0 -4
- package/node_modules/zod/v4/locales/ps.js +0 -122
- package/node_modules/zod/v4/locales/pt.cjs +0 -142
- package/node_modules/zod/v4/locales/pt.d.cts +0 -4
- package/node_modules/zod/v4/locales/pt.d.ts +0 -4
- package/node_modules/zod/v4/locales/pt.js +0 -116
- package/node_modules/zod/v4/locales/ru.cjs +0 -190
- package/node_modules/zod/v4/locales/ru.d.cts +0 -4
- package/node_modules/zod/v4/locales/ru.d.ts +0 -4
- package/node_modules/zod/v4/locales/ru.js +0 -164
- package/node_modules/zod/v4/locales/sl.cjs +0 -143
- package/node_modules/zod/v4/locales/sl.d.cts +0 -4
- package/node_modules/zod/v4/locales/sl.d.ts +0 -4
- package/node_modules/zod/v4/locales/sl.js +0 -117
- package/node_modules/zod/v4/locales/sv.cjs +0 -144
- package/node_modules/zod/v4/locales/sv.d.cts +0 -4
- package/node_modules/zod/v4/locales/sv.d.ts +0 -4
- package/node_modules/zod/v4/locales/sv.js +0 -118
- package/node_modules/zod/v4/locales/ta.cjs +0 -143
- package/node_modules/zod/v4/locales/ta.d.cts +0 -4
- package/node_modules/zod/v4/locales/ta.d.ts +0 -4
- package/node_modules/zod/v4/locales/ta.js +0 -117
- package/node_modules/zod/v4/locales/th.cjs +0 -143
- package/node_modules/zod/v4/locales/th.d.cts +0 -4
- package/node_modules/zod/v4/locales/th.d.ts +0 -4
- package/node_modules/zod/v4/locales/th.js +0 -117
- package/node_modules/zod/v4/locales/tr.cjs +0 -143
- package/node_modules/zod/v4/locales/tr.d.cts +0 -5
- package/node_modules/zod/v4/locales/tr.d.ts +0 -5
- package/node_modules/zod/v4/locales/tr.js +0 -115
- package/node_modules/zod/v4/locales/ua.cjs +0 -143
- package/node_modules/zod/v4/locales/ua.d.cts +0 -4
- package/node_modules/zod/v4/locales/ua.d.ts +0 -4
- package/node_modules/zod/v4/locales/ua.js +0 -117
- package/node_modules/zod/v4/locales/ur.cjs +0 -143
- package/node_modules/zod/v4/locales/ur.d.cts +0 -4
- package/node_modules/zod/v4/locales/ur.d.ts +0 -4
- package/node_modules/zod/v4/locales/ur.js +0 -117
- package/node_modules/zod/v4/locales/vi.cjs +0 -142
- package/node_modules/zod/v4/locales/vi.d.cts +0 -4
- package/node_modules/zod/v4/locales/vi.d.ts +0 -4
- package/node_modules/zod/v4/locales/vi.js +0 -116
- package/node_modules/zod/v4/locales/zh-CN.cjs +0 -142
- package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.js +0 -116
- package/node_modules/zod/v4/locales/zh-TW.cjs +0 -143
- package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.js +0 -117
- package/node_modules/zod/v4/mini/checks.cjs +0 -34
- package/node_modules/zod/v4/mini/checks.d.cts +0 -1
- package/node_modules/zod/v4/mini/checks.d.ts +0 -1
- package/node_modules/zod/v4/mini/checks.js +0 -1
- package/node_modules/zod/v4/mini/coerce.cjs +0 -47
- package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
- package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
- package/node_modules/zod/v4/mini/coerce.js +0 -17
- package/node_modules/zod/v4/mini/external.cjs +0 -62
- package/node_modules/zod/v4/mini/external.d.cts +0 -11
- package/node_modules/zod/v4/mini/external.d.ts +0 -11
- package/node_modules/zod/v4/mini/external.js +0 -13
- package/node_modules/zod/v4/mini/index.cjs +0 -32
- package/node_modules/zod/v4/mini/index.d.cts +0 -3
- package/node_modules/zod/v4/mini/index.d.ts +0 -3
- package/node_modules/zod/v4/mini/index.js +0 -3
- package/node_modules/zod/v4/mini/iso.cjs +0 -60
- package/node_modules/zod/v4/mini/iso.d.cts +0 -22
- package/node_modules/zod/v4/mini/iso.d.ts +0 -22
- package/node_modules/zod/v4/mini/iso.js +0 -30
- package/node_modules/zod/v4/mini/parse.cjs +0 -8
- package/node_modules/zod/v4/mini/parse.d.cts +0 -1
- package/node_modules/zod/v4/mini/parse.d.ts +0 -1
- package/node_modules/zod/v4/mini/parse.js +0 -1
- package/node_modules/zod/v4/mini/schemas.cjs +0 -839
- package/node_modules/zod/v4/mini/schemas.d.cts +0 -356
- package/node_modules/zod/v4/mini/schemas.d.ts +0 -356
- package/node_modules/zod/v4/mini/schemas.js +0 -732
- package/node_modules/zod/v4-mini/index.cjs +0 -17
- package/node_modules/zod/v4-mini/index.d.cts +0 -1
- package/node_modules/zod/v4-mini/index.d.ts +0 -1
- package/node_modules/zod/v4-mini/index.js +0 -1
package/dist/sandbox/config.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { realpath } from 'node:fs/promises';
|
|
2
|
-
import { basename, dirname, resolve } from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { GuardError, createProfile } from '../contracts.js';
|
|
5
|
-
import { canonicalPath, isWithin } from '../policy/paths.js';
|
|
6
|
-
import { matchesDomain, isNetworkHost, normalizeHost } from '../policy/domains.js';
|
|
7
|
-
import { linuxReadPaths } from './linux-read-paths.js';
|
|
8
|
-
import { runtimeWritePaths } from './runtime-write-paths.js';
|
|
9
|
-
import { seccompRuntime } from './seccomp.js';
|
|
10
|
-
import { assertLiteralNativePaths } from './paths.js';
|
|
11
|
-
export function shellQuote(text) { return `'${text.replace(/'/g, "'\\''")}'`; }
|
|
12
|
-
const AMBIENT_ENV = new Set(['PATH', 'LANG', 'LC_ALL', 'LC_CTYPE', 'TZ', 'TERM']);
|
|
13
|
-
const FORBIDDEN_ENV = /(?:TOKEN|SECRET|PASSWORD|CREDENTIAL|API_KEY|AUTH|^AWS_|^AZURE_|^GOOGLE_|^OPENAI_|^ANTHROPIC_|^CODEX_|^SSH_|^GIT_CONFIG|^NODE_|^BASH_ENV$|^ENV$|^DYLD_|^LD_|^JAVA_TOOL_OPTIONS$|^JDK_JAVA_OPTIONS$|^PYTHONPATH$|^PYTHONSTARTUP$|^RUBYOPT$|^PERL5OPT$|PROXY|^NO_PROXY$)/i;
|
|
14
|
-
export function workloadEnvironment(caller = {}, ambient = process.env) {
|
|
15
|
-
const env = {};
|
|
16
|
-
for (const [key, value] of Object.entries(ambient))
|
|
17
|
-
if (AMBIENT_ENV.has(key) && value !== undefined)
|
|
18
|
-
env[key] = value;
|
|
19
|
-
for (const [key, value] of Object.entries(caller)) {
|
|
20
|
-
if (!FORBIDDEN_ENV.test(key) && !['HOME', 'TMPDIR', 'TMP', 'TEMP', 'NODE_CHANNEL_FD', 'NODE_CHANNEL_SERIALIZATION_MODE', 'PI_GUARD_KERNEL_ARCH'].includes(key) && /^[A-Za-z_][A-Za-z0-9_]*$/.test(key) && typeof value === 'string' && !value.includes('\0'))
|
|
21
|
-
env[key] = value;
|
|
22
|
-
}
|
|
23
|
-
return env;
|
|
24
|
-
}
|
|
25
|
-
export async function nativeConfig(profile, delta, cwd, authority, piSDKEntryPath) {
|
|
26
|
-
createProfile(profile);
|
|
27
|
-
const resolved = { ...profile };
|
|
28
|
-
for (const key of ['readRoots', 'writeRoots', 'denyRead', 'denyWrite'])
|
|
29
|
-
resolved[key] = await Promise.all(profile[key].map(path => canonicalPath(path, cwd)));
|
|
30
|
-
profile = createProfile(resolved);
|
|
31
|
-
if (profile.readRoots.some(path => profile.denyRead.some(root => isWithin(path, root))) || profile.writeRoots.some(path => [...profile.denyRead, ...profile.denyWrite].some(root => isWithin(path, root))))
|
|
32
|
-
throw new GuardError('HARD_DENY', 'An explicit permission root conflicts with an absolute deny');
|
|
33
|
-
for (const key of ['readPaths', 'writePaths', 'domains'])
|
|
34
|
-
if (!Array.isArray(delta[key]) || delta[key].some(x => typeof x !== 'string'))
|
|
35
|
-
throw new GuardError('INVALID_DELTA', 'Invalid permission delta');
|
|
36
|
-
const reads = await Promise.all(delta.readPaths.map(path => canonicalPath(path, cwd)));
|
|
37
|
-
const writes = await Promise.all(delta.writePaths.map(path => canonicalPath(path, cwd)));
|
|
38
|
-
assertLiteralNativePaths([cwd, ...profile.readRoots, ...profile.writeRoots, ...profile.denyRead, ...profile.denyWrite, ...(profile.readOnlyPaths ?? []), ...reads, ...writes]);
|
|
39
|
-
if (reads.some(path => profile.denyRead.some(root => isWithin(path, root))) || writes.some(path => [...profile.denyRead, ...profile.denyWrite].some(root => isWithin(path, root))))
|
|
40
|
-
throw new GuardError('HARD_DENY', 'Permission delta targets a protected path');
|
|
41
|
-
if (delta.domains.some(domain => !isNetworkHost(domain) || profile.deniedDomains.some(pattern => matchesDomain(domain, pattern))))
|
|
42
|
-
throw new GuardError('HARD_DENY', 'Invalid or denied network domain');
|
|
43
|
-
const isCommandAuthority = authority?.kind === 'command-rule' || authority?.kind === 'reviewed-command';
|
|
44
|
-
const hasFullRead = isCommandAuthority || profile.readRoots.includes('/');
|
|
45
|
-
const baseProtected = await Promise.all((profile.readOnlyPaths ?? []).map(path => canonicalPath(path, cwd)));
|
|
46
|
-
const lifted = baseProtected.filter(root => writes.some(path => isWithin(path, root)));
|
|
47
|
-
// Removing a base metadata deny must not expose its siblings through the original workspace root.
|
|
48
|
-
const writeRoots = isCommandAuthority ? ['/'] : lifted.length ? writes : [...profile.writeRoots, ...writes];
|
|
49
|
-
const unapprovedDefaults = (await runtimeWritePaths(cwd)).filter(root => !writeRoots.some(path => isWithin(root, path)));
|
|
50
|
-
if (unapprovedDefaults.some(root => writeRoots.some(path => isWithin(path, root))))
|
|
51
|
-
throw new GuardError('NATIVE_SCOPE_UNSUPPORTED', 'A nested runtime default write path requires its enclosing directory in the reviewed native scope');
|
|
52
|
-
const packageRoot = fileURLToPath(new URL('../../', import.meta.url));
|
|
53
|
-
const nodeRoot = resolve(dirname(await realpath(process.execPath)), '..');
|
|
54
|
-
const dependencyRoots = [];
|
|
55
|
-
for (const entry of [
|
|
56
|
-
piSDKEntryPath ?? fileURLToPath(import.meta.resolve('@earendil-works/pi-coding-agent')),
|
|
57
|
-
fileURLToPath(import.meta.resolve('@anthropic-ai/sandbox-runtime')),
|
|
58
|
-
]) {
|
|
59
|
-
let current = dirname(await realpath(entry));
|
|
60
|
-
let root = current;
|
|
61
|
-
while (dirname(current) !== current) {
|
|
62
|
-
if (basename(current) === 'node_modules' || basename(current) === '.pnpm')
|
|
63
|
-
root = current;
|
|
64
|
-
current = dirname(current);
|
|
65
|
-
}
|
|
66
|
-
dependencyRoots.push(root);
|
|
67
|
-
}
|
|
68
|
-
const systemRead = ['/usr', '/bin', '/sbin', '/System', '/Library', '/opt/homebrew', '/private/etc', '/etc', '/dev', '/proc', '/sys', nodeRoot];
|
|
69
|
-
const runtimeRead = [resolve(packageRoot, 'dist'), resolve(packageRoot, 'node_modules'), resolve(packageRoot, 'package.json'), ...dependencyRoots];
|
|
70
|
-
const seccomp = seccompRuntime();
|
|
71
|
-
const config = {
|
|
72
|
-
...(seccomp ? { seccomp: { applyPath: seccomp.applyPath } } : {}),
|
|
73
|
-
filesystem: {
|
|
74
|
-
// A full-read profile needs only its explicit denies. Re-allowing "/" would
|
|
75
|
-
// make SRT's nested denies override runtime code installed inside the agent directory.
|
|
76
|
-
denyRead: [...(hasFullRead ? [] : ['/']), ...profile.denyRead],
|
|
77
|
-
allowRead: [...await linuxReadPaths([...systemRead, ...(hasFullRead ? [] : [...profile.readRoots, ...reads, ...writes])], writeRoots), ...runtimeRead],
|
|
78
|
-
allowWrite: writeRoots,
|
|
79
|
-
denyWrite: [...profile.denyWrite, ...profile.denyRead, ...unapprovedDefaults, ...(isCommandAuthority ? [] : baseProtected.filter(root => !lifted.includes(root))), ...dependencyRoots, resolve(packageRoot, 'dist'), resolve(packageRoot, 'node_modules'), resolve(packageRoot, 'package.json'), resolve(packageRoot, 'package-lock.json')],
|
|
80
|
-
allowGitConfig: isCommandAuthority || writes.some(path => /[/\\]\.git(?:[/\\]config)?$/.test(path)),
|
|
81
|
-
},
|
|
82
|
-
network: { allowedDomains: isCommandAuthority ? ['*'] : [...profile.allowedDomains, ...delta.domains.map(normalizeHost)], deniedDomains: [...profile.deniedDomains], strictAllowlist: true, allowAllUnixSockets: false, allowLocalBinding: false },
|
|
83
|
-
credentials: { files: profile.denyRead.map(path => ({ path, mode: 'deny' })) },
|
|
84
|
-
enableWeakerNestedSandbox: false,
|
|
85
|
-
enableWeakerNetworkIsolation: false,
|
|
86
|
-
allowAppleEvents: false,
|
|
87
|
-
};
|
|
88
|
-
if (process.platform === 'linux') {
|
|
89
|
-
// A missing leaf becomes /dev/null in SRT, unreadable on a nodev mount.
|
|
90
|
-
// A child deny selects its read-only directory placeholder instead. The
|
|
91
|
-
// parent deny remains; existing worktree .git files are handled by SRT.
|
|
92
|
-
config.filesystem.denyWrite.push(...config.filesystem.denyWrite.filter(path => basename(path) === '.git' && !profile.denyRead.some(root => isWithin(path, root))).map(path => resolve(path, 'HEAD')));
|
|
93
|
-
}
|
|
94
|
-
assertLiteralNativePaths([...config.filesystem.denyRead, ...(config.filesystem.allowRead ?? []), ...config.filesystem.allowWrite, ...config.filesystem.denyWrite]);
|
|
95
|
-
return config;
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/sandbox/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MA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AC;QACjC,wEAAwE;QACxE,wEAAwE;QACxE,wEAAwE;QACxE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACxM,CAAC;IACD,wBAAwB,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,IAAI,EAAE,CAAC,EAAC,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,EAAC,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;IAChK,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { readFileSync, readdirSync } from 'node:fs';
|
|
2
|
-
import { join, sep } from 'node:path';
|
|
3
|
-
import { isWithin } from '../policy/paths.js';
|
|
4
|
-
// Internal metadata-only child. The parent supplies canonical, disjoint roots
|
|
5
|
-
// and owns cancellation, the time budget and the bounded output buffer.
|
|
6
|
-
const { roots, denied } = JSON.parse(readFileSync(0, 'utf8'));
|
|
7
|
-
const unlistable = [];
|
|
8
|
-
for (const root of roots) {
|
|
9
|
-
const exclusions = denied.filter(path => isWithin(path, root));
|
|
10
|
-
const pending = [root];
|
|
11
|
-
while (pending.length) {
|
|
12
|
-
const path = pending.pop();
|
|
13
|
-
if (exclusions.some(root => path === root || path.startsWith(root + sep)))
|
|
14
|
-
continue;
|
|
15
|
-
try {
|
|
16
|
-
for (const entry of readdirSync(path, { withFileTypes: true })) {
|
|
17
|
-
if (entry.isDirectory())
|
|
18
|
-
pending.push(join(path, entry.name));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
catch (error) {
|
|
22
|
-
const code = error.code;
|
|
23
|
-
if (code === 'ENOENT' || code === 'ENOTDIR')
|
|
24
|
-
continue;
|
|
25
|
-
if (code !== 'EACCES' && code !== 'EPERM')
|
|
26
|
-
throw error;
|
|
27
|
-
unlistable.push(path);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
process.stdout.write(JSON.stringify(unlistable));
|
|
32
|
-
//# sourceMappingURL=directory-scan.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directory-scan.js","sourceRoot":"","sources":["../../src/sandbox/directory-scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,8EAA8E;AAC9E,wEAAwE;AACxE,MAAM,EAAC,KAAK,EAAC,MAAM,EAAC,GAAqC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAC,MAAM,CAAC,CAAC,CAAC;AAC5F,MAAM,UAAU,GAAa,EAAE,CAAC;AAChC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;QACtB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAG,CAAC;QAC5B,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;YAAE,SAAS;QACpF,IAAI,CAAC;YACH,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,IAAI,EAAC,EAAC,aAAa,EAAC,IAAI,EAAC,CAAC,EAAE,CAAC;gBAC3D,IAAI,KAAK,CAAC,WAAW,EAAE;oBAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;YAC/D,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,GAAI,KAA+B,CAAC,IAAI,CAAC;YACnD,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS;gBAAE,SAAS;YACtD,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,OAAO;gBAAE,MAAM,KAAK,CAAC;YACvD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;AACH,CAAC;AACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type ExecutionOptions, type Json, type PermissionDelta, type PermissionProfile, type WorkerJob } from '../contracts.js';
|
|
2
|
-
export interface SandboxExecutor {
|
|
3
|
-
execute(job: WorkerJob, profile: PermissionProfile, delta: PermissionDelta, options?: ExecutionOptions): Promise<Json>;
|
|
4
|
-
qualify(profile: PermissionProfile, cwd: string): Promise<void>;
|
|
5
|
-
close(): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
export declare class NativeExecutor implements SandboxExecutor {
|
|
8
|
-
private readonly transport?;
|
|
9
|
-
private active;
|
|
10
|
-
private stop;
|
|
11
|
-
get activeInvocationCount(): number;
|
|
12
|
-
/** Trusted broker transport, e.g. an enterprise proxy. Never sourced from tool arguments. */
|
|
13
|
-
constructor(transport?: {
|
|
14
|
-
socketPath: string;
|
|
15
|
-
domains: readonly string[];
|
|
16
|
-
} | undefined);
|
|
17
|
-
qualify(profile: PermissionProfile, cwd: string): Promise<void>;
|
|
18
|
-
execute(job: WorkerJob, profile: PermissionProfile, delta?: PermissionDelta, options?: ExecutionOptions): Promise<Json>;
|
|
19
|
-
close(): Promise<void>;
|
|
20
|
-
}
|
package/dist/sandbox/executor.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { fork } from 'node:child_process';
|
|
2
|
-
import { randomUUID } from 'node:crypto';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { realpath } from 'node:fs/promises';
|
|
5
|
-
import { GuardError, EMPTY_DELTA, validateWorkerFrame } from '../contracts.js';
|
|
6
|
-
import { nativeConfig, workloadEnvironment } from './config.js';
|
|
7
|
-
import { assertHardLinkBoundaries } from './hard-links.js';
|
|
8
|
-
import { withSignal } from '../signals.js';
|
|
9
|
-
import { matchesDomain, isNetworkHost, normalizeHost } from '../policy/domains.js';
|
|
10
|
-
import { getPiSDKEntryPath } from '../pi-host.js';
|
|
11
|
-
export class NativeExecutor {
|
|
12
|
-
transport;
|
|
13
|
-
active = new Set();
|
|
14
|
-
stop = new AbortController();
|
|
15
|
-
get activeInvocationCount() { return this.active.size; }
|
|
16
|
-
/** Trusted broker transport, e.g. an enterprise proxy. Never sourced from tool arguments. */
|
|
17
|
-
constructor(transport) {
|
|
18
|
-
this.transport = transport;
|
|
19
|
-
}
|
|
20
|
-
async qualify(profile, cwd) {
|
|
21
|
-
const data = [];
|
|
22
|
-
try {
|
|
23
|
-
const result = await this.execute({ kind: 'shell', command: "printf 'pi-guard-native-ready'", cwd }, profile, EMPTY_DELTA, { timeoutSeconds: 15, onData: chunk => data.push(chunk) });
|
|
24
|
-
if (result.exitCode !== 0 || Buffer.concat(data).toString() !== 'pi-guard-native-ready')
|
|
25
|
-
throw new GuardError('ENVIRONMENT_BLOCKED', 'Native permitted-launch control did not succeed');
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
throw new GuardError('ENVIRONMENT_BLOCKED', `ENVIRONMENT_BLOCKED: native qualification failed: ${error.message}`, { cause: error });
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
async execute(job, profile, delta = EMPTY_DELTA, options = {}) {
|
|
32
|
-
if (!['darwin', 'linux'].includes(process.platform))
|
|
33
|
-
throw new GuardError('UNSUPPORTED_PLATFORM', 'Native isolation supports only Darwin and Linux');
|
|
34
|
-
const lifetime = new AbortController();
|
|
35
|
-
const signal = AbortSignal.any([lifetime.signal, this.stop.signal, ...(options.signal ? [options.signal] : [])]);
|
|
36
|
-
signal.throwIfAborted();
|
|
37
|
-
const piSDKEntryPath = getPiSDKEntryPath();
|
|
38
|
-
const config = await nativeConfig(profile, delta, job.cwd, options.authority, piSDKEntryPath);
|
|
39
|
-
await assertHardLinkBoundaries(profile, delta, config, signal);
|
|
40
|
-
if (options.onNetworkRequest)
|
|
41
|
-
config.network.strictAllowlist = false;
|
|
42
|
-
if (this.transport)
|
|
43
|
-
config.network.mitmProxy = { socketPath: await realpath(this.transport.socketPath), domains: [...this.transport.domains] };
|
|
44
|
-
const timeoutSeconds = options.timeoutSeconds ?? (job.kind === 'shell' ? job.timeoutSeconds : undefined) ?? 120;
|
|
45
|
-
if (!Number.isFinite(timeoutSeconds) || timeoutSeconds <= 0)
|
|
46
|
-
throw new GuardError('INVALID_TIMEOUT', 'Execution timeout must be positive seconds');
|
|
47
|
-
signal.throwIfAborted();
|
|
48
|
-
const child = fork(fileURLToPath(new URL('./broker.js', import.meta.url)), [piSDKEntryPath], {
|
|
49
|
-
execArgv: [], serialization: 'json', env: workloadEnvironment(), stdio: ['ignore', 'ignore', 'pipe', 'ipc'],
|
|
50
|
-
});
|
|
51
|
-
// Broker owns the workload process group and is never itself a workload child.
|
|
52
|
-
const seenNetworkRequests = new Set();
|
|
53
|
-
const task = new Promise((resolve, reject) => {
|
|
54
|
-
let terminal, error, stderr = '', isTerminal = false, forceTimer, processGroupId;
|
|
55
|
-
const killOwnedGroup = () => { if (processGroupId)
|
|
56
|
-
try {
|
|
57
|
-
process.kill(-processGroupId, 'SIGKILL');
|
|
58
|
-
}
|
|
59
|
-
catch (cause) {
|
|
60
|
-
if (cause.code !== 'ESRCH')
|
|
61
|
-
error ??= cause;
|
|
62
|
-
} };
|
|
63
|
-
const terminate = (cause) => {
|
|
64
|
-
error ??= cause;
|
|
65
|
-
if (child.connected)
|
|
66
|
-
child.send({ type: 'cancel' });
|
|
67
|
-
forceTimer ??= setTimeout(() => { killOwnedGroup(); child.kill('SIGKILL'); }, 4000);
|
|
68
|
-
};
|
|
69
|
-
const onAbort = () => terminate(new GuardError('CANCELLED', 'Native execution cancelled'));
|
|
70
|
-
signal.addEventListener('abort', onAbort, { once: true });
|
|
71
|
-
if (signal.aborted)
|
|
72
|
-
onAbort();
|
|
73
|
-
const deadline = setTimeout(() => terminate(new GuardError('TIMEOUT', `Native execution exceeded ${timeoutSeconds} seconds`)), timeoutSeconds * 1000);
|
|
74
|
-
child.stderr?.on('data', chunk => { stderr = (stderr + chunk.toString()).slice(-8192); });
|
|
75
|
-
child.on('error', cause => { error ??= cause; });
|
|
76
|
-
child.on('message', raw => {
|
|
77
|
-
try {
|
|
78
|
-
const control = raw;
|
|
79
|
-
if (control.type === 'network-request') {
|
|
80
|
-
const requestId = control.requestId, destination = control.destination;
|
|
81
|
-
if (control.schemaVersion !== 1 || !requestId || seenNetworkRequests.has(requestId) || !destination || typeof destination.host !== 'string' || !isNetworkHost(destination.host) || destination.port !== undefined && (!Number.isInteger(destination.port) || destination.port < 1 || destination.port > 65535) || isTerminal)
|
|
82
|
-
throw new GuardError('INVALID_IPC', 'Invalid network approval request');
|
|
83
|
-
seenNetworkRequests.add(requestId);
|
|
84
|
-
const request = { host: normalizeHost(destination.host), ...(destination.port !== undefined ? { port: destination.port } : {}) };
|
|
85
|
-
const pending = signal.aborted || profile.deniedDomains.some(pattern => matchesDomain(request.host, pattern)) || !options.onNetworkRequest
|
|
86
|
-
? Promise.resolve(false) : withSignal(options.onNetworkRequest(request, signal), signal);
|
|
87
|
-
void pending.catch(() => false).then(isAllowed => { if (child.connected)
|
|
88
|
-
child.send({ schemaVersion: 1, type: 'network-response', requestId, isAllowed: isAllowed === true && !signal.aborted }); });
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (control.type === 'workload-started') {
|
|
92
|
-
if (control.schemaVersion !== 1 || !Number.isInteger(control.processGroupId) || control.processGroupId <= 1 || processGroupId || isTerminal)
|
|
93
|
-
throw new GuardError('INVALID_IPC', 'Invalid broker process group');
|
|
94
|
-
processGroupId = control.processGroupId;
|
|
95
|
-
if (error || signal.aborted)
|
|
96
|
-
killOwnedGroup();
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const frame = validateWorkerFrame(raw);
|
|
100
|
-
if (isTerminal)
|
|
101
|
-
throw new GuardError('INVALID_IPC', 'Worker emitted data after its terminal frame');
|
|
102
|
-
if (frame.type === 'data')
|
|
103
|
-
options.onData?.(Buffer.from(frame.data, 'base64'));
|
|
104
|
-
if (frame.type === 'update')
|
|
105
|
-
options.onUpdate?.(frame.result);
|
|
106
|
-
if (frame.type === 'result') {
|
|
107
|
-
terminal = frame.result;
|
|
108
|
-
isTerminal = true;
|
|
109
|
-
}
|
|
110
|
-
if (frame.type === 'error') {
|
|
111
|
-
error ??= new GuardError(frame.code, frame.message);
|
|
112
|
-
isTerminal = true;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
catch (cause) {
|
|
116
|
-
terminate(cause);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
child.once('close', () => {
|
|
120
|
-
if (!isTerminal)
|
|
121
|
-
killOwnedGroup();
|
|
122
|
-
clearTimeout(deadline);
|
|
123
|
-
if (forceTimer)
|
|
124
|
-
clearTimeout(forceTimer);
|
|
125
|
-
signal.removeEventListener('abort', onAbort);
|
|
126
|
-
lifetime.abort();
|
|
127
|
-
if (error)
|
|
128
|
-
reject(error);
|
|
129
|
-
else if (!isTerminal)
|
|
130
|
-
reject(new GuardError('WORKER_FAILED', `Worker closed without a result${stderr ? `: ${stderr}` : ''}`));
|
|
131
|
-
else
|
|
132
|
-
resolve(terminal);
|
|
133
|
-
});
|
|
134
|
-
child.send({ type: 'execute', commandId: randomUUID(), config, job: { ...job, ...(job.kind === 'shell' ? { env: workloadEnvironment(options.env ?? job.env), timeoutSeconds } : {}) } });
|
|
135
|
-
});
|
|
136
|
-
this.active.add(task);
|
|
137
|
-
try {
|
|
138
|
-
return await task;
|
|
139
|
-
}
|
|
140
|
-
finally {
|
|
141
|
-
this.active.delete(task);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
async close() { this.stop.abort(); await Promise.allSettled([...this.active]); }
|
|
145
|
-
}
|
|
146
|
-
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../src/sandbox/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAkG,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC/K,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EA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ACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC;YAAC,OAAO,MAAM,IAAI,CAAC;QAAC,CAAC;gBAAS,CAAC;YAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAAC,CAAC;IAClE,CAAC;IACD,KAAK,CAAC,KAAK,KAAoB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAChG"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { SandboxRuntimeConfig } from '@anthropic-ai/sandbox-runtime';
|
|
2
|
-
import { type PermissionProfile, type PermissionDelta } from '../contracts.js';
|
|
3
|
-
/** Path-based OS sandboxes cannot distinguish names of an inode linked before launch. */
|
|
4
|
-
export declare function assertHardLinkBoundaries(profile: PermissionProfile, delta: PermissionDelta, config: SandboxRuntimeConfig, signal: AbortSignal): Promise<void>;
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { access, lstat, realpath } from 'node:fs/promises';
|
|
2
|
-
import { constants } from 'node:fs';
|
|
3
|
-
import { execFile } from 'node:child_process';
|
|
4
|
-
import { promisify } from 'node:util';
|
|
5
|
-
import { parse } from 'node:path';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import { GuardError } from '../contracts.js';
|
|
8
|
-
import { isWithin } from '../policy/paths.js';
|
|
9
|
-
const MAX_SCAN_MS = 30000;
|
|
10
|
-
const runScan = promisify(execFile);
|
|
11
|
-
const isMissing = (error) => ['ENOENT', 'ENOTDIR'].includes(error.code ?? '');
|
|
12
|
-
async function existingRoots(paths) {
|
|
13
|
-
const values = [];
|
|
14
|
-
for (const path of paths) {
|
|
15
|
-
try {
|
|
16
|
-
values.push(await realpath(path));
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
if (!isMissing(error))
|
|
20
|
-
throw error;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return [...new Set(values)].filter((path, _, all) => !all.some(parent => parent !== path && isWithin(path, parent)));
|
|
24
|
-
}
|
|
25
|
-
/** Path-based OS sandboxes cannot distinguish names of an inode linked before launch. */
|
|
26
|
-
export async function assertHardLinkBoundaries(profile, delta, config, signal) {
|
|
27
|
-
const deadlineMs = Date.now() + MAX_SCAN_MS;
|
|
28
|
-
const check = () => {
|
|
29
|
-
signal.throwIfAborted();
|
|
30
|
-
if (Date.now() > deadlineMs)
|
|
31
|
-
throw new GuardError('HARD_LINK_SCAN_LIMIT', 'The filesystem is too large to qualify hard-link boundaries safely');
|
|
32
|
-
};
|
|
33
|
-
const scanned = new Map();
|
|
34
|
-
const directoryScans = new Map();
|
|
35
|
-
const opaqueDirectories = async (paths, exclusions) => {
|
|
36
|
-
const denied = await existingRoots(exclusions);
|
|
37
|
-
const roots = (await existingRoots(paths)).filter(root => root !== parse(root).root && !denied.some(path => isWithin(root, path)));
|
|
38
|
-
if (!roots.length)
|
|
39
|
-
return [];
|
|
40
|
-
const prune = denied.filter(path => roots.some(root => isWithin(path, root)));
|
|
41
|
-
const key = JSON.stringify([roots.toSorted(), prune.toSorted()]);
|
|
42
|
-
if (directoryScans.has(key))
|
|
43
|
-
return directoryScans.get(key);
|
|
44
|
-
check();
|
|
45
|
-
// Synchronous directory I/O avoids a promise per directory. Keep it in an
|
|
46
|
-
// owned process so the shared deadline and caller cancellation stay effective.
|
|
47
|
-
const scan = runScan(process.execPath, [fileURLToPath(new URL('./directory-scan.js', import.meta.url))], { encoding: 'utf8', maxBuffer: 16 * 1024 * 1024, timeout: Math.max(1, deadlineMs - Date.now()), killSignal: 'SIGKILL', signal, env: {} });
|
|
48
|
-
scan.child.stdin.on('error', () => { });
|
|
49
|
-
scan.child.stdin.end(JSON.stringify({ roots, denied: prune }));
|
|
50
|
-
const { stdout } = await scan;
|
|
51
|
-
const unlistable = JSON.parse(stdout);
|
|
52
|
-
if (!Array.isArray(unlistable) || unlistable.some(path => typeof path !== 'string' || path.includes('\0') || !roots.some(root => isWithin(path, root))))
|
|
53
|
-
throw new GuardError('HARD_LINK_SCAN_FAILED', 'Invalid directory scan output');
|
|
54
|
-
const result = [];
|
|
55
|
-
for (const path of unlistable) {
|
|
56
|
-
check();
|
|
57
|
-
const isSearchable = await access(path, constants.X_OK).then(() => true, error => {
|
|
58
|
-
if (['EACCES', 'EPERM'].includes(error.code ?? ''))
|
|
59
|
-
return false;
|
|
60
|
-
throw error;
|
|
61
|
-
});
|
|
62
|
-
// An unlistable but searchable directory can still expose known filenames.
|
|
63
|
-
if (isSearchable)
|
|
64
|
-
throw new GuardError('HARD_LINK_SCAN_FAILED', 'A searchable directory could not be inspected safely');
|
|
65
|
-
if (/[?*[\]{}]/.test(path))
|
|
66
|
-
throw new GuardError('NATIVE_SCOPE_UNSUPPORTED', 'An opaque directory cannot be represented safely in the native profile');
|
|
67
|
-
result.push(path);
|
|
68
|
-
}
|
|
69
|
-
directoryScans.set(key, result);
|
|
70
|
-
return result;
|
|
71
|
-
};
|
|
72
|
-
const inspect = async (paths, exclusions = []) => {
|
|
73
|
-
const roots = await existingRoots(paths), denied = await existingRoots(exclusions);
|
|
74
|
-
// Every name is already in scope when the filesystem root is admitted (or denied).
|
|
75
|
-
if (roots.some(root => root === parse(root).root) && denied.length === 0)
|
|
76
|
-
return;
|
|
77
|
-
const admitted = roots.filter(path => !denied.some(root => isWithin(path, root)));
|
|
78
|
-
if (!admitted.length)
|
|
79
|
-
return;
|
|
80
|
-
const prune = denied.filter(path => admitted.some(root => isWithin(path, root)));
|
|
81
|
-
// Read/write passes with the same effective subtree share one qualification.
|
|
82
|
-
const key = JSON.stringify([admitted.toSorted(), prune.toSorted()]);
|
|
83
|
-
if (scanned.has(key))
|
|
84
|
-
return scanned.get(key);
|
|
85
|
-
const scan = async () => {
|
|
86
|
-
// Native find performs the metadata traversal without one JS promise/stat per ordinary file.
|
|
87
|
-
// Arguments are passed directly (no shell); NUL framing preserves spaces/newlines in names.
|
|
88
|
-
const escapePattern = (path) => path.replace(/[?*\[\]\\]/g, '\\$&');
|
|
89
|
-
const terms = prune.flatMap((path, index) => [...(index ? ['-o'] : []), '-path', escapePattern(path)]);
|
|
90
|
-
const args = [...admitted, ...(terms.length ? ['(', ...terms, ')', '-prune', '-o'] : []), '-type', 'f', '-links', '+1', '-print0'];
|
|
91
|
-
check();
|
|
92
|
-
const { stdout } = await runScan('/usr/bin/find', args, { encoding: 'buffer', maxBuffer: 16 * 1024 * 1024, timeout: Math.max(1, deadlineMs - Date.now()), killSignal: 'SIGKILL', signal, env: {} });
|
|
93
|
-
const names = [];
|
|
94
|
-
for (let start = 0, end = stdout.indexOf(0); end >= 0; start = end + 1, end = stdout.indexOf(0, start))
|
|
95
|
-
names.push(stdout.subarray(start, end));
|
|
96
|
-
if (stdout.length && stdout.at(-1) !== 0)
|
|
97
|
-
throw new GuardError('HARD_LINK_SCAN_FAILED', 'Incomplete hard-link scan output');
|
|
98
|
-
const links = new Map();
|
|
99
|
-
for (let start = 0; start < names.length; start += 64) {
|
|
100
|
-
check();
|
|
101
|
-
const batch = names.slice(start, start + 64);
|
|
102
|
-
const metadata = await Promise.all(batch.map(path => lstat(path)));
|
|
103
|
-
for (const [index, info] of metadata.entries()) {
|
|
104
|
-
if (!info.isFile() || info.nlink < 2)
|
|
105
|
-
throw new GuardError('HARD_LINK_CHANGED', 'Hard-link topology changed during qualification');
|
|
106
|
-
const inode = `${info.dev}:${info.ino}`, prior = links.get(inode);
|
|
107
|
-
if (prior && prior.nlink !== info.nlink)
|
|
108
|
-
throw new GuardError('HARD_LINK_CHANGED', 'Hard-link topology changed during qualification');
|
|
109
|
-
links.set(inode, { count: (prior?.count ?? 0) + 1, nlink: info.nlink, path: batch[index] });
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
const values = [...links.values()];
|
|
113
|
-
for (let start = 0; start < values.length; start += 64) {
|
|
114
|
-
check();
|
|
115
|
-
const batch = values.slice(start, start + 64);
|
|
116
|
-
const metadata = await Promise.all(batch.map(value => lstat(value.path)));
|
|
117
|
-
for (const [index, info] of metadata.entries()) {
|
|
118
|
-
const value = batch[index];
|
|
119
|
-
if (value.count !== value.nlink || info.nlink !== value.nlink)
|
|
120
|
-
throw new GuardError('HARD_LINK_BOUNDARY', 'A pre-existing hard link crosses the admitted filesystem boundary');
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
const pending = scan();
|
|
125
|
-
scanned.set(key, pending);
|
|
126
|
-
await pending;
|
|
127
|
-
};
|
|
128
|
-
try {
|
|
129
|
-
// A protected inode with another name outside these denies must never be read.
|
|
130
|
-
await inspect(profile.denyRead);
|
|
131
|
-
const reads = [...profile.readRoots, ...delta.readPaths, ...delta.writePaths];
|
|
132
|
-
const hasFullRead = !config.filesystem.denyRead.includes('/') || (config.filesystem.allowRead ?? []).some(root => root === parse(root).root);
|
|
133
|
-
const writes = config.filesystem.allowWrite ?? [], writeDenies = config.filesystem.denyWrite ?? [];
|
|
134
|
-
const opaque = [...new Set([...(hasFullRead ? [] : await opaqueDirectories(reads, profile.denyRead)), ...await opaqueDirectories(writes, writeDenies)])];
|
|
135
|
-
// Keep opaque subtrees inaccessible in the workload, including chmod and ancestor moves.
|
|
136
|
-
// Never silently ignore a failed scan of a protected or searchable directory.
|
|
137
|
-
config.filesystem.denyRead = [...(config.filesystem.denyRead ?? []), ...opaque];
|
|
138
|
-
config.filesystem.denyWrite = [...writeDenies, ...opaque];
|
|
139
|
-
if (!hasFullRead)
|
|
140
|
-
await inspect(reads, [...profile.denyRead, ...opaque]);
|
|
141
|
-
if (writes.length) {
|
|
142
|
-
if ((await existingRoots(writes)).some(root => root === parse(root).root))
|
|
143
|
-
await inspect(writeDenies);
|
|
144
|
-
else
|
|
145
|
-
await inspect(writes, [...writeDenies, ...opaque]);
|
|
146
|
-
}
|
|
147
|
-
check();
|
|
148
|
-
}
|
|
149
|
-
catch (error) {
|
|
150
|
-
if (error instanceof GuardError || signal.aborted)
|
|
151
|
-
throw error;
|
|
152
|
-
throw new GuardError('HARD_LINK_SCAN_FAILED', 'Hard-link boundaries could not be qualified; no workload was launched', { cause: error });
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
//# sourceMappingURL=hard-links.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hard-links.js","sourceRoot":"","sources":["../../src/sandbox/hard-links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAgD,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,WAAW,GAAG,KAAK,CAAC;AAC1B,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AACpC,MAAM,SAAS,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAC,SAAS,CAAC,CAAC,QAAQ,CAAE,KAA+B,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;AACjH,KAAK,UAAU,aAAa,CAAC,KAAwB;IACnD,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC;YAAC,MAAM,CAAC,IAAI,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAAC,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AK,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;gBAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;;gBACjG,MAAM,OAAO,CAAC,MAAM,EAAC,CAAC,GAAG,WAAW,EAAC,GAAG,MAAM,CAAC,CAAC,CAAC;QACxD,CAAC;QACD,KAAK,EAAE,CAAC;IACV,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,UAAU,IAAI,MAAM,CAAC,OAAO;YAAE,MAAM,KAAK,CAAC;QAC/D,MAAM,IAAI,UAAU,CAAC,uBAAuB,EAAE,uEAAuE,EAAE,EAAC,KAAK,EAAC,KAAK,EAAC,CAAC,CAAC;IACxI,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SRT 0.0.78 restores write mounts before read mounts below a denyRead tmpfs.
|
|
3
|
-
* An enclosing read mount would therefore hide a narrower write mount.
|
|
4
|
-
* Partition only those enclosing directories, retaining readable siblings
|
|
5
|
-
* without making any additional path writable or following an escaping link.
|
|
6
|
-
*/
|
|
7
|
-
export declare function linuxReadPaths(reads: readonly string[], writes: readonly string[]): Promise<string[]>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { readdir, realpath } from 'node:fs/promises';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { GuardError } from '../contracts.js';
|
|
4
|
-
import { isWithin } from '../policy/paths.js';
|
|
5
|
-
/**
|
|
6
|
-
* SRT 0.0.78 restores write mounts before read mounts below a denyRead tmpfs.
|
|
7
|
-
* An enclosing read mount would therefore hide a narrower write mount.
|
|
8
|
-
* Partition only those enclosing directories, retaining readable siblings
|
|
9
|
-
* without making any additional path writable or following an escaping link.
|
|
10
|
-
*/
|
|
11
|
-
export async function linuxReadPaths(reads, writes) {
|
|
12
|
-
if (process.platform !== 'linux' || reads.includes('/'))
|
|
13
|
-
return [...reads];
|
|
14
|
-
const result = new Set();
|
|
15
|
-
let entries = 0;
|
|
16
|
-
async function visit(path, root) {
|
|
17
|
-
if (writes.some(write => isWithin(path, write)))
|
|
18
|
-
return;
|
|
19
|
-
if (!writes.some(write => write !== path && isWithin(write, path))) {
|
|
20
|
-
result.add(path);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const children = await readdir(path, { withFileTypes: true });
|
|
24
|
-
entries += children.length;
|
|
25
|
-
if (entries > 10000)
|
|
26
|
-
throw new GuardError('READ_SCOPE_TOO_LARGE', 'Cannot safely partition this read scope for the requested Linux write grant');
|
|
27
|
-
for (const child of children) {
|
|
28
|
-
const childPath = join(path, child.name);
|
|
29
|
-
if (child.isSymbolicLink()) {
|
|
30
|
-
let target;
|
|
31
|
-
try {
|
|
32
|
-
target = await realpath(childPath);
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
if (!isWithin(target, root))
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
await visit(childPath, root);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
for (const path of new Set(reads))
|
|
44
|
-
await visit(path, path);
|
|
45
|
-
return [...result];
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=linux-read-paths.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linux-read-paths.js","sourceRoot":"","sources":["../../src/sandbox/linux-read-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAAwB,EAAE,MAAyB;IACtF,IAAI,OAAO,CAAC,QAAQ,KAAK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KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC;QAAE,MAAM,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3D,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;AACrB,CAAC"}
|
package/dist/sandbox/paths.d.ts
DELETED
package/dist/sandbox/paths.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { GuardError } from '../contracts.js';
|
|
2
|
-
/** The pinned runtime treats these characters as globs, with no literal-path config API. */
|
|
3
|
-
export function hasNativePatternChars(path) {
|
|
4
|
-
return /[*?[\]]/.test(path);
|
|
5
|
-
}
|
|
6
|
-
export function assertLiteralNativePaths(paths) {
|
|
7
|
-
if (paths.some(hasNativePatternChars))
|
|
8
|
-
throw new GuardError('NATIVE_PATH_UNSUPPORTED', 'Native permission roots containing *, ?, [ or ] are unsupported; no pattern permission was granted');
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=paths.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/sandbox/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,4FAA4F;AAC5F,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAwB;IAC/D,IAAI,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,yBAAyB,EAAE,oGAAoG,CAAC,CAAC;AAC/L,CAAC"}
|