pi-codex-auto-review 0.1.0
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/LICENSE +201 -0
- package/NOTICE +10 -0
- package/README.md +77 -0
- package/dist/approvals.d.ts +72 -0
- package/dist/approvals.js +167 -0
- package/dist/approvals.js.map +1 -0
- package/dist/audit.d.ts +28 -0
- package/dist/audit.js +40 -0
- package/dist/audit.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +70 -0
- package/dist/cli.js.map +1 -0
- package/dist/context-files.d.ts +14 -0
- package/dist/context-files.js +113 -0
- package/dist/context-files.js.map +1 -0
- package/dist/contracts.d.ts +258 -0
- package/dist/contracts.js +102 -0
- package/dist/contracts.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -0
- package/dist/native/darwin-arm64/artifact.json +5 -0
- package/dist/native/darwin-arm64/pi-guard-execpolicy +0 -0
- package/dist/native/linux-x64/artifact.json +5 -0
- package/dist/native/linux-x64/pi-guard-execpolicy +0 -0
- package/dist/policy/domains.d.ts +5 -0
- package/dist/policy/domains.js +18 -0
- package/dist/policy/domains.js.map +1 -0
- package/dist/policy/index.d.ts +56 -0
- package/dist/policy/index.js +304 -0
- package/dist/policy/index.js.map +1 -0
- package/dist/policy/paths.d.ts +5 -0
- package/dist/policy/paths.js +54 -0
- package/dist/policy/paths.js.map +1 -0
- package/dist/policy/rules.d.ts +36 -0
- package/dist/policy/rules.js +61 -0
- package/dist/policy/rules.js.map +1 -0
- package/dist/policy/shell.d.ts +14 -0
- package/dist/policy/shell.js +122 -0
- package/dist/policy/shell.js.map +1 -0
- package/dist/reports.d.ts +21 -0
- package/dist/reports.js +42 -0
- package/dist/reports.js.map +1 -0
- package/dist/review/context.d.ts +25 -0
- package/dist/review/context.js +108 -0
- package/dist/review/context.js.map +1 -0
- package/dist/review/investigation.d.ts +39 -0
- package/dist/review/investigation.js +36 -0
- package/dist/review/investigation.js.map +1 -0
- package/dist/review/lifecycle.d.ts +29 -0
- package/dist/review/lifecycle.js +71 -0
- package/dist/review/lifecycle.js.map +1 -0
- package/dist/review/policy.d.ts +4 -0
- package/dist/review/policy.js +15 -0
- package/dist/review/policy.js.map +1 -0
- package/dist/review/upstream-policy.d.ts +2 -0
- package/dist/review/upstream-policy.js +210 -0
- package/dist/review/upstream-policy.js.map +1 -0
- package/dist/reviewer.d.ts +45 -0
- package/dist/reviewer.js +148 -0
- package/dist/reviewer.js.map +1 -0
- package/dist/sandbox/broker.d.ts +1 -0
- package/dist/sandbox/broker.js +135 -0
- package/dist/sandbox/broker.js.map +1 -0
- package/dist/sandbox/config.d.ts +5 -0
- package/dist/sandbox/config.js +91 -0
- package/dist/sandbox/config.js.map +1 -0
- package/dist/sandbox/executor.d.ts +20 -0
- package/dist/sandbox/executor.js +144 -0
- package/dist/sandbox/executor.js.map +1 -0
- package/dist/sandbox/hard-links.d.ts +4 -0
- package/dist/sandbox/hard-links.js +145 -0
- package/dist/sandbox/hard-links.js.map +1 -0
- package/dist/sandbox/linux-read-paths.d.ts +7 -0
- package/dist/sandbox/linux-read-paths.js +47 -0
- package/dist/sandbox/linux-read-paths.js.map +1 -0
- package/dist/sandbox/paths.d.ts +3 -0
- package/dist/sandbox/paths.js +10 -0
- package/dist/sandbox/paths.js.map +1 -0
- package/dist/sandbox/runtime-write-paths.d.ts +2 -0
- package/dist/sandbox/runtime-write-paths.js +8 -0
- package/dist/sandbox/runtime-write-paths.js.map +1 -0
- package/dist/sandbox/seccomp.d.ts +5 -0
- package/dist/sandbox/seccomp.js +16 -0
- package/dist/sandbox/seccomp.js.map +1 -0
- package/dist/sandbox/worker.d.ts +1 -0
- package/dist/sandbox/worker.js +73 -0
- package/dist/sandbox/worker.js.map +1 -0
- package/dist/signals.d.ts +10 -0
- package/dist/signals.js +21 -0
- package/dist/signals.js.map +1 -0
- package/dist/startup.d.ts +22 -0
- package/dist/startup.js +100 -0
- package/dist/startup.js.map +1 -0
- package/dist/tools/controller.d.ts +63 -0
- package/dist/tools/controller.js +286 -0
- package/dist/tools/controller.js.map +1 -0
- package/dist/tools/external.d.ts +30 -0
- package/dist/tools/external.js +24 -0
- package/dist/tools/external.js.map +1 -0
- package/dist/tools/mcp.d.ts +17 -0
- package/dist/tools/mcp.js +186 -0
- package/dist/tools/mcp.js.map +1 -0
- package/docs/publishing.md +73 -0
- package/docs/security/dependencies.md +43 -0
- package/docs/testing/auto-review-protection.md +130 -0
- package/docs/usage.md +217 -0
- package/native/execpolicy/LICENSE +201 -0
- package/native/execpolicy/NOTICE +6 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/LICENSE +201 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/README.md +901 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.d.ts +3 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.js +472 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/index.d.ts +19 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/index.js +17 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/address.d.ts +52 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/address.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/address.js +153 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/address.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/aws-sigv4.d.ts +164 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/aws-sigv4.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/aws-sigv4.js +246 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/aws-sigv4.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/body-substitution.d.ts +58 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/body-substitution.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/body-substitution.js +128 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/body-substitution.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-aws-pairs.d.ts +124 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-aws-pairs.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-aws-pairs.js +258 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-aws-pairs.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-decode.d.ts +87 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-decode.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-decode.js +138 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-decode.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-extract.d.ts +67 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-extract.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-extract.js +113 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-extract.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-env.d.ts +70 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-env.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-env.js +171 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-env.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-files.d.ts +120 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-files.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-files.js +281 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-mask-files.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-sentinel.d.ts +108 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-sentinel.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-sentinel.js +208 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/credential-sentinel.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/domain-pattern.d.ts +82 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/domain-pattern.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/domain-pattern.js +155 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/domain-pattern.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.d.ts +44 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.js +220 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/generate-seccomp-filter.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.d.ts +150 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.js +678 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/http-proxy.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/java-proxy-agent.d.ts +32 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/java-proxy-agent.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/java-proxy-agent.js +111 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/java-proxy-agent.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.d.ts +305 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.js +2605 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-sandbox-utils.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-violation-monitor.d.ts +55 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-violation-monitor.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-violation-monitor.js +152 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/linux-violation-monitor.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/listen-in-range.d.ts +12 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/listen-in-range.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/listen-in-range.js +43 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/listen-in-range.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.d.ts +116 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.js +1195 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos-sandbox-utils.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.d.ts +200 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.js +443 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-ca.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-leaf.d.ts +28 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-leaf.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-leaf.js +114 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mitm-leaf.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mux-proxy.d.ts +59 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mux-proxy.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mux-proxy.js +159 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/mux-proxy.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.d.ts +147 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.js +445 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/parent-proxy.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.d.ts +17 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.js +163 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/request-filter.d.ts +83 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/request-filter.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/request-filter.js +212 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/request-filter.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.d.ts +76 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.js +221 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/resolved-address-guard.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.d.ts +1691 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.js +1233 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-config.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.d.ts +97 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.js +1937 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-manager.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-schemas.d.ts +113 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-schemas.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-schemas.js +3 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-schemas.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.d.ts +411 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.js +1408 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.d.ts +37 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.js +125 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-violation-store.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.d.ts +57 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.js +332 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/socks-proxy.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/tls-terminate-proxy.d.ts +100 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/tls-terminate-proxy.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/tls-terminate-proxy.js +546 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/tls-terminate-proxy.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/windows-sandbox-utils.d.ts +923 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/windows-sandbox-utils.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/windows-sandbox-utils.js +1419 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/windows-sandbox-utils.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/config-loader.d.ts +31 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/config-loader.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/config-loader.js +69 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/config-loader.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.d.ts +7 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.js +25 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/debug.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.d.ts +15 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.js +49 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/platform.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.d.ts +17 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.js +37 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/ripgrep.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/shell-quote.d.ts +27 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/shell-quote.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/shell-quote.js +47 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/shell-quote.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.d.ts +9 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.js +25 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/utils/which.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/package.json +88 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/vendor/java-proxy-agent/build.ts +95 -0
- 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 +69 -0
- 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 +28 -0
- 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 +27 -0
- package/node_modules/@pondwader/socks5-server/LICENSE +20 -0
- package/node_modules/@pondwader/socks5-server/README.md +151 -0
- package/node_modules/@pondwader/socks5-server/dist/index.d.mts +87 -0
- package/node_modules/@pondwader/socks5-server/dist/index.d.ts +87 -0
- package/node_modules/@pondwader/socks5-server/dist/index.js +346 -0
- package/node_modules/@pondwader/socks5-server/dist/index.mjs +307 -0
- package/node_modules/@pondwader/socks5-server/package.json +31 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1157 -0
- package/node_modules/commander/esm.mjs +16 -0
- package/node_modules/commander/index.js +24 -0
- package/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/commander/lib/command.js +2509 -0
- package/node_modules/commander/lib/error.js +39 -0
- package/node_modules/commander/lib/help.js +520 -0
- package/node_modules/commander/lib/option.js +330 -0
- package/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/commander/package-support.json +16 -0
- package/node_modules/commander/package.json +84 -0
- package/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/commander/typings/index.d.ts +969 -0
- package/node_modules/node-forge/.editorconfig +17 -0
- package/node_modules/node-forge/.eslintrc.js +24 -0
- package/node_modules/node-forge/.github/workflows/main.yaml +96 -0
- package/node_modules/node-forge/.istanbul.yml +2 -0
- package/node_modules/node-forge/.npmignore +15 -0
- package/node_modules/node-forge/CHANGELOG.md +555 -0
- package/node_modules/node-forge/CONTRIBUTING.md +18 -0
- package/node_modules/node-forge/LICENSE +331 -0
- package/node_modules/node-forge/README.md +2071 -0
- package/node_modules/node-forge/RELEASE.md +19 -0
- package/node_modules/node-forge/SECURITY.md +5 -0
- package/node_modules/node-forge/examples/create-cert.js +110 -0
- package/node_modules/node-forge/examples/create-csr.js +66 -0
- package/node_modules/node-forge/examples/create-pkcs12.js +160 -0
- package/node_modules/node-forge/examples/imap.js +46 -0
- package/node_modules/node-forge/examples/sign-p7.js +115 -0
- package/node_modules/node-forge/examples/tls.js +189 -0
- package/node_modules/node-forge/flash/PooledSocket.as +18 -0
- package/node_modules/node-forge/flash/README.md +48 -0
- package/node_modules/node-forge/flash/SocketEvent.as +36 -0
- package/node_modules/node-forge/flash/SocketPool.as +754 -0
- package/node_modules/node-forge/flash/mod_fsp/README +135 -0
- package/node_modules/node-forge/flash/mod_fsp/mod_fsp.c +415 -0
- package/node_modules/node-forge/flash/package.json +28 -0
- package/node_modules/node-forge/flash/policyserver.js +65 -0
- package/node_modules/node-forge/flash/policyserver.py +112 -0
- package/node_modules/node-forge/flash/swf/SocketPool.swf +0 -0
- package/node_modules/node-forge/karma-sauce.conf.js +79 -0
- package/node_modules/node-forge/karma.conf.js +133 -0
- package/node_modules/node-forge/lib/aes.js +1091 -0
- package/node_modules/node-forge/lib/aesCipherSuites.js +282 -0
- package/node_modules/node-forge/lib/asn1-validator.js +91 -0
- package/node_modules/node-forge/lib/asn1.js +1503 -0
- package/node_modules/node-forge/lib/baseN.js +186 -0
- package/node_modules/node-forge/lib/cipher.js +230 -0
- package/node_modules/node-forge/lib/cipherModes.js +999 -0
- package/node_modules/node-forge/lib/des.js +496 -0
- package/node_modules/node-forge/lib/ed25519.js +1091 -0
- package/node_modules/node-forge/lib/forge.js +13 -0
- package/node_modules/node-forge/lib/form.js +149 -0
- package/node_modules/node-forge/lib/hmac.js +146 -0
- package/node_modules/node-forge/lib/http.js +1346 -0
- package/node_modules/node-forge/lib/index.all.js +16 -0
- package/node_modules/node-forge/lib/index.js +33 -0
- package/node_modules/node-forge/lib/jsbn.js +1294 -0
- package/node_modules/node-forge/lib/kem.js +168 -0
- package/node_modules/node-forge/lib/log.js +319 -0
- package/node_modules/node-forge/lib/md.all.js +13 -0
- package/node_modules/node-forge/lib/md.js +11 -0
- package/node_modules/node-forge/lib/md5.js +289 -0
- package/node_modules/node-forge/lib/mgf.js +12 -0
- package/node_modules/node-forge/lib/mgf1.js +57 -0
- package/node_modules/node-forge/lib/oids.js +180 -0
- package/node_modules/node-forge/lib/pbe.js +1023 -0
- package/node_modules/node-forge/lib/pbkdf2.js +211 -0
- package/node_modules/node-forge/lib/pem.js +237 -0
- package/node_modules/node-forge/lib/pkcs1.js +276 -0
- package/node_modules/node-forge/lib/pkcs12.js +1078 -0
- package/node_modules/node-forge/lib/pkcs7.js +1260 -0
- package/node_modules/node-forge/lib/pkcs7asn1.js +410 -0
- package/node_modules/node-forge/lib/pki.js +102 -0
- package/node_modules/node-forge/lib/prime.js +297 -0
- package/node_modules/node-forge/lib/prime.worker.js +168 -0
- package/node_modules/node-forge/lib/prng.js +419 -0
- package/node_modules/node-forge/lib/pss.js +241 -0
- package/node_modules/node-forge/lib/random.js +191 -0
- package/node_modules/node-forge/lib/rc2.js +410 -0
- package/node_modules/node-forge/lib/rsa.js +1973 -0
- package/node_modules/node-forge/lib/sha1.js +319 -0
- package/node_modules/node-forge/lib/sha256.js +327 -0
- package/node_modules/node-forge/lib/sha512.js +561 -0
- package/node_modules/node-forge/lib/socket.js +287 -0
- package/node_modules/node-forge/lib/ssh.js +236 -0
- package/node_modules/node-forge/lib/tls.js +4282 -0
- package/node_modules/node-forge/lib/tlssocket.js +249 -0
- package/node_modules/node-forge/lib/util.js +2652 -0
- package/node_modules/node-forge/lib/x509.js +3251 -0
- package/node_modules/node-forge/lib/xhr.js +738 -0
- package/node_modules/node-forge/package.json +123 -0
- package/node_modules/node-forge/tests/.eslintrc.js +5 -0
- package/node_modules/node-forge/tests/README.md +4 -0
- package/node_modules/node-forge/tests/benchmarks/aes-speed.js +62 -0
- package/node_modules/node-forge/tests/benchmarks/so-44303784.js +246 -0
- package/node_modules/node-forge/tests/flash/README.md +7 -0
- package/node_modules/node-forge/tests/flash/Test.as +96 -0
- package/node_modules/node-forge/tests/flash/build-flash.xml +7 -0
- package/node_modules/node-forge/tests/flash/index.html +28 -0
- package/node_modules/node-forge/tests/index.html +33 -0
- package/node_modules/node-forge/tests/issues/heartbleed.js +55 -0
- package/node_modules/node-forge/tests/issues/issue-428.html +95 -0
- package/node_modules/node-forge/tests/issues/issue-428.js +375 -0
- package/node_modules/node-forge/tests/karma/index.js +8 -0
- package/node_modules/node-forge/tests/karma/testWorker.js +65 -0
- package/node_modules/node-forge/tests/karma/web-worker-rsa.js +55 -0
- package/node_modules/node-forge/tests/legacy/common.html +65 -0
- package/node_modules/node-forge/tests/legacy/common.js +2199 -0
- package/node_modules/node-forge/tests/legacy/form.html +148 -0
- package/node_modules/node-forge/tests/legacy/form.js +40 -0
- package/node_modules/node-forge/tests/legacy/http.html +235 -0
- package/node_modules/node-forge/tests/legacy/index.html +70 -0
- package/node_modules/node-forge/tests/legacy/keygen.html +113 -0
- package/node_modules/node-forge/tests/legacy/login.css +26 -0
- package/node_modules/node-forge/tests/legacy/loginDemo.html +32 -0
- package/node_modules/node-forge/tests/legacy/loginDemo.js +149 -0
- package/node_modules/node-forge/tests/legacy/performance.html +533 -0
- package/node_modules/node-forge/tests/legacy/result.txt +1 -0
- package/node_modules/node-forge/tests/legacy/socketPool.html +302 -0
- package/node_modules/node-forge/tests/legacy/tasks.html +54 -0
- package/node_modules/node-forge/tests/legacy/tasks.js +378 -0
- package/node_modules/node-forge/tests/legacy/tls.html +389 -0
- package/node_modules/node-forge/tests/legacy/webid.html +89 -0
- package/node_modules/node-forge/tests/legacy/webid.js +313 -0
- package/node_modules/node-forge/tests/legacy/ws-webid.js +120 -0
- package/node_modules/node-forge/tests/legacy/xhr.html +67 -0
- package/node_modules/node-forge/tests/legacy/xhr.js +590 -0
- package/node_modules/node-forge/tests/pocs/ghsa-2328-f5f3-gj25.js +85 -0
- package/node_modules/node-forge/tests/pocs/ghsa-ppp5-5v6c-4jwp.js +166 -0
- package/node_modules/node-forge/tests/pocs/ghsa-q67f-28xg-22rw.js +103 -0
- package/node_modules/node-forge/tests/security/cve-2025-12816.js +75 -0
- package/node_modules/node-forge/tests/security/ghsa-554w-wpv2-vw27.js +81 -0
- package/node_modules/node-forge/tests/security/index.js +3 -0
- package/node_modules/node-forge/tests/server.crt +26 -0
- package/node_modules/node-forge/tests/server.js +87 -0
- package/node_modules/node-forge/tests/server.key +27 -0
- package/node_modules/node-forge/tests/support/task.js +718 -0
- package/node_modules/node-forge/tests/tests.css +61 -0
- package/node_modules/node-forge/tests/unit/aes.js +1498 -0
- package/node_modules/node-forge/tests/unit/asn1.js +1337 -0
- package/node_modules/node-forge/tests/unit/csr.js +129 -0
- package/node_modules/node-forge/tests/unit/des.js +231 -0
- package/node_modules/node-forge/tests/unit/ed25519.js +395 -0
- package/node_modules/node-forge/tests/unit/forge.js +2 -0
- package/node_modules/node-forge/tests/unit/hmac.js +64 -0
- package/node_modules/node-forge/tests/unit/index.html +20 -0
- package/node_modules/node-forge/tests/unit/index.js +27 -0
- package/node_modules/node-forge/tests/unit/jsbn.js +40 -0
- package/node_modules/node-forge/tests/unit/kem.js +167 -0
- package/node_modules/node-forge/tests/unit/md5.js +114 -0
- package/node_modules/node-forge/tests/unit/mgf1.js +16 -0
- package/node_modules/node-forge/tests/unit/pbkdf2.js +182 -0
- package/node_modules/node-forge/tests/unit/pem.js +159 -0
- package/node_modules/node-forge/tests/unit/pkcs1.js +1077 -0
- package/node_modules/node-forge/tests/unit/pkcs12.js +739 -0
- package/node_modules/node-forge/tests/unit/pkcs7.js +792 -0
- package/node_modules/node-forge/tests/unit/random.js +48 -0
- package/node_modules/node-forge/tests/unit/rc2.js +88 -0
- package/node_modules/node-forge/tests/unit/rsa.js +1278 -0
- package/node_modules/node-forge/tests/unit/sha1.js +72 -0
- package/node_modules/node-forge/tests/unit/sha256.js +79 -0
- package/node_modules/node-forge/tests/unit/sha512.js +200 -0
- package/node_modules/node-forge/tests/unit/ssh.js +175 -0
- package/node_modules/node-forge/tests/unit/tls.js +175 -0
- package/node_modules/node-forge/tests/unit/util.js +595 -0
- package/node_modules/node-forge/tests/unit/x509.js +1986 -0
- package/node_modules/node-forge/tests/websockets/server-webid.js +495 -0
- package/node_modules/node-forge/tests/websockets/server-ws.js +158 -0
- package/node_modules/node-forge/webpack-tests.config.js +26 -0
- package/node_modules/node-forge/webpack.config.js +130 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +208 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/package.json +118 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +56 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +257 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5136 -0
- package/node_modules/zod/src/v4/classic/checks.ts +30 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +66 -0
- package/node_modules/zod/src/v4/classic/errors.ts +75 -0
- package/node_modules/zod/src/v4/classic/external.ts +50 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +33 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2054 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +296 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +313 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +619 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +527 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +91 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +268 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +829 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +92 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +247 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +563 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +123 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +147 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +298 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +342 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +356 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +532 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +881 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +758 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2314 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +250 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +94 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1594 -0
- package/node_modules/zod/src/v4/core/checks.ts +1283 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +134 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +424 -0
- package/node_modules/zod/src/v4/core/function.ts +176 -0
- package/node_modules/zod/src/v4/core/index.ts +15 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +143 -0
- package/node_modules/zod/src/v4/core/parse.ts +94 -0
- package/node_modules/zod/src/v4/core/regexes.ts +135 -0
- package/node_modules/zod/src/v4/core/registries.ts +96 -0
- package/node_modules/zod/src/v4/core/schemas.ts +3842 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +64 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +977 -0
- package/node_modules/zod/src/v4/core/util.ts +775 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +125 -0
- package/node_modules/zod/src/v4/locales/az.ts +121 -0
- package/node_modules/zod/src/v4/locales/be.ts +184 -0
- package/node_modules/zod/src/v4/locales/ca.ts +127 -0
- package/node_modules/zod/src/v4/locales/cs.ts +142 -0
- package/node_modules/zod/src/v4/locales/de.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +127 -0
- package/node_modules/zod/src/v4/locales/eo.ts +125 -0
- package/node_modules/zod/src/v4/locales/es.ts +125 -0
- package/node_modules/zod/src/v4/locales/fa.ts +134 -0
- package/node_modules/zod/src/v4/locales/fi.ts +131 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr.ts +124 -0
- package/node_modules/zod/src/v4/locales/he.ts +125 -0
- package/node_modules/zod/src/v4/locales/hu.ts +126 -0
- package/node_modules/zod/src/v4/locales/id.ts +125 -0
- package/node_modules/zod/src/v4/locales/index.ts +39 -0
- package/node_modules/zod/src/v4/locales/it.ts +125 -0
- package/node_modules/zod/src/v4/locales/ja.ts +122 -0
- package/node_modules/zod/src/v4/locales/kh.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +131 -0
- package/node_modules/zod/src/v4/locales/mk.ts +127 -0
- package/node_modules/zod/src/v4/locales/ms.ts +124 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/no.ts +124 -0
- package/node_modules/zod/src/v4/locales/ota.ts +125 -0
- package/node_modules/zod/src/v4/locales/pl.ts +126 -0
- package/node_modules/zod/src/v4/locales/ps.ts +133 -0
- package/node_modules/zod/src/v4/locales/pt.ts +123 -0
- package/node_modules/zod/src/v4/locales/ru.ts +184 -0
- package/node_modules/zod/src/v4/locales/sl.ts +126 -0
- package/node_modules/zod/src/v4/locales/sv.ts +127 -0
- package/node_modules/zod/src/v4/locales/ta.ts +125 -0
- package/node_modules/zod/src/v4/locales/th.ts +126 -0
- package/node_modules/zod/src/v4/locales/tr.ts +121 -0
- package/node_modules/zod/src/v4/locales/ua.ts +126 -0
- package/node_modules/zod/src/v4/locales/ur.ts +126 -0
- package/node_modules/zod/src/v4/locales/vi.ts +125 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +22 -0
- package/node_modules/zod/src/v4/mini/external.ts +40 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +62 -0
- package/node_modules/zod/src/v4/mini/parse.ts +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1579 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +871 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +185 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +299 -0
- package/node_modules/zod/src/v4-mini/index.ts +1 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +111 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3775 -0
- package/node_modules/zod/v3/types.d.cts +1031 -0
- package/node_modules/zod/v3/types.d.ts +1031 -0
- package/node_modules/zod/v3/types.js +3693 -0
- package/node_modules/zod/v4/classic/checks.cjs +32 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +57 -0
- package/node_modules/zod/v4/classic/compat.d.cts +46 -0
- package/node_modules/zod/v4/classic/compat.d.ts +46 -0
- package/node_modules/zod/v4/classic/compat.js +27 -0
- package/node_modules/zod/v4/classic/errors.cjs +67 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +41 -0
- package/node_modules/zod/v4/classic/external.cjs +70 -0
- package/node_modules/zod/v4/classic/external.d.cts +13 -0
- package/node_modules/zod/v4/classic/external.d.ts +13 -0
- package/node_modules/zod/v4/classic/external.js +18 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/parse.cjs +32 -0
- package/node_modules/zod/v4/classic/parse.d.cts +23 -0
- package/node_modules/zod/v4/classic/parse.d.ts +23 -0
- package/node_modules/zod/v4/classic/parse.js +6 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1109 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +630 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +630 -0
- package/node_modules/zod/v4/classic/schemas.js +1006 -0
- package/node_modules/zod/v4/core/api.cjs +1039 -0
- package/node_modules/zod/v4/core/api.d.cts +284 -0
- package/node_modules/zod/v4/core/api.d.ts +284 -0
- package/node_modules/zod/v4/core/api.js +906 -0
- package/node_modules/zod/v4/core/checks.cjs +591 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +565 -0
- package/node_modules/zod/v4/core/core.cjs +67 -0
- package/node_modules/zod/v4/core/core.d.cts +49 -0
- package/node_modules/zod/v4/core/core.d.ts +49 -0
- package/node_modules/zod/v4/core/core.js +61 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +226 -0
- package/node_modules/zod/v4/core/errors.d.cts +208 -0
- package/node_modules/zod/v4/core/errors.d.ts +208 -0
- package/node_modules/zod/v4/core/errors.js +195 -0
- package/node_modules/zod/v4/core/function.cjs +102 -0
- package/node_modules/zod/v4/core/function.d.cts +52 -0
- package/node_modules/zod/v4/core/function.d.ts +52 -0
- package/node_modules/zod/v4/core/function.js +75 -0
- package/node_modules/zod/v4/core/index.cjs +44 -0
- package/node_modules/zod/v4/core/index.d.cts +15 -0
- package/node_modules/zod/v4/core/index.d.ts +15 -0
- package/node_modules/zod/v4/core/index.js +15 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +87 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +87 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/parse.cjs +87 -0
- package/node_modules/zod/v4/core/parse.d.cts +25 -0
- package/node_modules/zod/v4/core/parse.d.ts +25 -0
- package/node_modules/zod/v4/core/parse.js +57 -0
- package/node_modules/zod/v4/core/regexes.cjs +103 -0
- package/node_modules/zod/v4/core/regexes.d.cts +62 -0
- package/node_modules/zod/v4/core/regexes.d.ts +62 -0
- package/node_modules/zod/v4/core/regexes.js +95 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +1748 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1041 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1041 -0
- package/node_modules/zod/v4/core/schemas.js +1717 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.js +849 -0
- package/node_modules/zod/v4/core/util.cjs +539 -0
- package/node_modules/zod/v4/core/util.d.cts +183 -0
- package/node_modules/zod/v4/core/util.d.ts +183 -0
- package/node_modules/zod/v4/core/util.js +493 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +142 -0
- package/node_modules/zod/v4/locales/ar.d.cts +4 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +116 -0
- package/node_modules/zod/v4/locales/az.cjs +141 -0
- package/node_modules/zod/v4/locales/az.d.cts +4 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +115 -0
- package/node_modules/zod/v4/locales/be.cjs +190 -0
- package/node_modules/zod/v4/locales/be.d.cts +4 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +164 -0
- package/node_modules/zod/v4/locales/ca.cjs +144 -0
- package/node_modules/zod/v4/locales/ca.d.cts +4 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +118 -0
- package/node_modules/zod/v4/locales/cs.cjs +161 -0
- package/node_modules/zod/v4/locales/cs.d.cts +4 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +135 -0
- package/node_modules/zod/v4/locales/de.cjs +142 -0
- package/node_modules/zod/v4/locales/de.d.cts +4 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +116 -0
- package/node_modules/zod/v4/locales/en.cjs +145 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +5 -0
- package/node_modules/zod/v4/locales/en.js +117 -0
- package/node_modules/zod/v4/locales/eo.cjs +144 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +5 -0
- package/node_modules/zod/v4/locales/eo.js +116 -0
- package/node_modules/zod/v4/locales/es.cjs +143 -0
- package/node_modules/zod/v4/locales/es.d.cts +4 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +117 -0
- package/node_modules/zod/v4/locales/fa.cjs +148 -0
- package/node_modules/zod/v4/locales/fa.d.cts +4 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +122 -0
- package/node_modules/zod/v4/locales/fi.cjs +148 -0
- package/node_modules/zod/v4/locales/fi.d.cts +4 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +122 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +117 -0
- package/node_modules/zod/v4/locales/fr.cjs +142 -0
- package/node_modules/zod/v4/locales/fr.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +116 -0
- package/node_modules/zod/v4/locales/he.cjs +143 -0
- package/node_modules/zod/v4/locales/he.d.cts +4 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +117 -0
- package/node_modules/zod/v4/locales/hu.cjs +143 -0
- package/node_modules/zod/v4/locales/hu.d.cts +4 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +117 -0
- package/node_modules/zod/v4/locales/id.cjs +142 -0
- package/node_modules/zod/v4/locales/id.d.cts +4 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +116 -0
- package/node_modules/zod/v4/locales/index.cjs +84 -0
- package/node_modules/zod/v4/locales/index.d.cts +39 -0
- package/node_modules/zod/v4/locales/index.d.ts +39 -0
- package/node_modules/zod/v4/locales/index.js +39 -0
- package/node_modules/zod/v4/locales/it.cjs +143 -0
- package/node_modules/zod/v4/locales/it.d.cts +4 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +117 -0
- package/node_modules/zod/v4/locales/ja.cjs +141 -0
- package/node_modules/zod/v4/locales/ja.d.cts +4 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +115 -0
- package/node_modules/zod/v4/locales/kh.cjs +143 -0
- package/node_modules/zod/v4/locales/kh.d.cts +4 -0
- package/node_modules/zod/v4/locales/kh.d.ts +4 -0
- package/node_modules/zod/v4/locales/kh.js +117 -0
- package/node_modules/zod/v4/locales/ko.cjs +147 -0
- package/node_modules/zod/v4/locales/ko.d.cts +4 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +121 -0
- package/node_modules/zod/v4/locales/mk.cjs +144 -0
- package/node_modules/zod/v4/locales/mk.d.cts +4 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +118 -0
- package/node_modules/zod/v4/locales/ms.cjs +142 -0
- package/node_modules/zod/v4/locales/ms.d.cts +4 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +116 -0
- package/node_modules/zod/v4/locales/nl.cjs +143 -0
- package/node_modules/zod/v4/locales/nl.d.cts +4 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +117 -0
- package/node_modules/zod/v4/locales/no.cjs +142 -0
- package/node_modules/zod/v4/locales/no.d.cts +4 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +116 -0
- package/node_modules/zod/v4/locales/ota.cjs +143 -0
- package/node_modules/zod/v4/locales/ota.d.cts +4 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +117 -0
- package/node_modules/zod/v4/locales/pl.cjs +143 -0
- package/node_modules/zod/v4/locales/pl.d.cts +4 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +117 -0
- package/node_modules/zod/v4/locales/ps.cjs +148 -0
- package/node_modules/zod/v4/locales/ps.d.cts +4 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +122 -0
- package/node_modules/zod/v4/locales/pt.cjs +142 -0
- package/node_modules/zod/v4/locales/pt.d.cts +4 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +116 -0
- package/node_modules/zod/v4/locales/ru.cjs +190 -0
- package/node_modules/zod/v4/locales/ru.d.cts +4 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +164 -0
- package/node_modules/zod/v4/locales/sl.cjs +143 -0
- package/node_modules/zod/v4/locales/sl.d.cts +4 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +117 -0
- package/node_modules/zod/v4/locales/sv.cjs +144 -0
- package/node_modules/zod/v4/locales/sv.d.cts +4 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +118 -0
- package/node_modules/zod/v4/locales/ta.cjs +143 -0
- package/node_modules/zod/v4/locales/ta.d.cts +4 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +143 -0
- package/node_modules/zod/v4/locales/th.d.cts +4 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +117 -0
- package/node_modules/zod/v4/locales/tr.cjs +143 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +5 -0
- package/node_modules/zod/v4/locales/tr.js +115 -0
- package/node_modules/zod/v4/locales/ua.cjs +143 -0
- package/node_modules/zod/v4/locales/ua.d.cts +4 -0
- package/node_modules/zod/v4/locales/ua.d.ts +4 -0
- package/node_modules/zod/v4/locales/ua.js +117 -0
- package/node_modules/zod/v4/locales/ur.cjs +143 -0
- package/node_modules/zod/v4/locales/ur.d.cts +4 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +117 -0
- package/node_modules/zod/v4/locales/vi.cjs +142 -0
- package/node_modules/zod/v4/locales/vi.d.cts +4 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +116 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +116 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +117 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +47 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +17 -0
- package/node_modules/zod/v4/mini/external.cjs +62 -0
- package/node_modules/zod/v4/mini/external.d.cts +11 -0
- package/node_modules/zod/v4/mini/external.d.ts +11 -0
- package/node_modules/zod/v4/mini/external.js +13 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +60 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +30 -0
- package/node_modules/zod/v4/mini/parse.cjs +8 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +839 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +356 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +356 -0
- package/node_modules/zod/v4/mini/schemas.js +732 -0
- package/node_modules/zod/v4-mini/index.cjs +17 -0
- package/node_modules/zod/v4-mini/index.d.cts +1 -0
- package/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/node_modules/zod/v4-mini/index.js +1 -0
- package/package.json +97 -0
|
@@ -0,0 +1,678 @@
|
|
|
1
|
+
import { Agent, createServer } from 'node:http';
|
|
2
|
+
import { request as httpRequest } from 'node:http';
|
|
3
|
+
import { request as httpsRequest } from 'node:https';
|
|
4
|
+
import { connect } from 'node:net';
|
|
5
|
+
import { URL } from 'node:url';
|
|
6
|
+
import { logForDebugging } from '../utils/debug.js';
|
|
7
|
+
import { encodedCommandFromProxyUser } from './sandbox-utils.js';
|
|
8
|
+
import { CRL_PATH } from './mitm-ca.js';
|
|
9
|
+
import { decideAndRespond, rawDenied, respondDenied, respondUpstreamError, } from './request-filter.js';
|
|
10
|
+
const ALLOWLIST_DENY = [
|
|
11
|
+
'Connection blocked by network allowlist',
|
|
12
|
+
'blocked-by-allowlist',
|
|
13
|
+
];
|
|
14
|
+
import { peekForClientHello, terminateAndForward, } from './tls-terminate-proxy.js';
|
|
15
|
+
import { prepareBodySubstitution, } from './body-substitution.js';
|
|
16
|
+
import { isResolvedAddressDenied } from './resolved-address-guard.js';
|
|
17
|
+
import { canonicalizeHost, connectViaParentProxy, directRequestOptions, dialDirect, formatAuthority, openConnectTunnel, proxyAuthHeader, selectParentProxyUrl, shouldBypassParentProxy, stripBrackets, stripHopByHop, } from './parent-proxy.js';
|
|
18
|
+
export function createHttpProxyServer(options) {
|
|
19
|
+
const server = createServer();
|
|
20
|
+
// A client that is killed mid-exchange (sandboxed process tree teardown)
|
|
21
|
+
// resets its connection; without a listener that surfaces as an
|
|
22
|
+
// ECONNRESET uncaughtException from node:_http_server and can take down
|
|
23
|
+
// the host process. Parse errors get the RFC-required 400; resets and
|
|
24
|
+
// already-unwritable sockets are just dropped.
|
|
25
|
+
server.on('clientError', (err, socket) => {
|
|
26
|
+
logForDebugging(`Client connection error: ${err.message}`, {
|
|
27
|
+
level: 'error',
|
|
28
|
+
});
|
|
29
|
+
// The peer may reset while the 400 flushes; without a listener that
|
|
30
|
+
// write failure is itself an uncaughtException.
|
|
31
|
+
socket.on('error', () => { });
|
|
32
|
+
if (err.code !== 'ECONNRESET' &&
|
|
33
|
+
socket.writable) {
|
|
34
|
+
// Destroy only after the flush: destroying immediately races the
|
|
35
|
+
// write and can reset the connection before the 400 reaches the
|
|
36
|
+
// client, while end() alone can leave a half-open socket from a
|
|
37
|
+
// client that never closes its side. Under Bun the flush callback
|
|
38
|
+
// may never fire on a parse-errored socket (the 400 is dropped;
|
|
39
|
+
// verified empirically), so back-stop with a timer or the socket
|
|
40
|
+
// leaks.
|
|
41
|
+
const status = err.code === 'HPE_HEADER_OVERFLOW'
|
|
42
|
+
? '431 Request Header Fields Too Large'
|
|
43
|
+
: '400 Bad Request';
|
|
44
|
+
socket.end(`HTTP/1.1 ${status}\r\n\r\n`, () => socket.destroy());
|
|
45
|
+
const backstop = setTimeout(() => socket.destroy(), 1000);
|
|
46
|
+
backstop.unref?.();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
socket.destroy();
|
|
50
|
+
});
|
|
51
|
+
const checkAuth = (got) => {
|
|
52
|
+
if (!options.proxyAuthToken)
|
|
53
|
+
return { ok: true };
|
|
54
|
+
const m = /^basic\s+([a-z0-9+/=]+)\s*$/i.exec(got ?? '');
|
|
55
|
+
if (!m)
|
|
56
|
+
return { ok: false };
|
|
57
|
+
const decoded = Buffer.from(m[1], 'base64').toString('utf8');
|
|
58
|
+
const sep = decoded.indexOf(':');
|
|
59
|
+
if (sep <= 0 || decoded.slice(sep + 1) !== options.proxyAuthToken) {
|
|
60
|
+
return { ok: false };
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
ok: true,
|
|
64
|
+
encodedCommand: encodedCommandFromProxyUser(decoded.slice(0, sep)),
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
// Handle CONNECT requests for HTTPS traffic
|
|
68
|
+
server.on('connect', async (req, socket, head) => {
|
|
69
|
+
// Attach error handler immediately to prevent unhandled errors
|
|
70
|
+
socket.on('error', err => {
|
|
71
|
+
logForDebugging(`Client socket error: ${err.message}`, { level: 'error' });
|
|
72
|
+
// A failed write (e.g. EPIPE to a dead peer) must also release
|
|
73
|
+
// the descriptor: logging alone leaves the fd open for the life
|
|
74
|
+
// of the process, and an open dead-peer fd is what the runtime's
|
|
75
|
+
// EPIPE retry loop spun on (idle-CPU busy-loop incident).
|
|
76
|
+
// destroy() is idempotent, so overlap with the close handlers
|
|
77
|
+
// below is harmless.
|
|
78
|
+
socket.destroy();
|
|
79
|
+
});
|
|
80
|
+
// Track client liveness so we can abort the upstream dial if they bail.
|
|
81
|
+
let clientGone = false;
|
|
82
|
+
socket.once('close', () => {
|
|
83
|
+
clientGone = true;
|
|
84
|
+
});
|
|
85
|
+
// EOF during the decision window is treated as abandonment — a
|
|
86
|
+
// half-closed client cannot run any bidirectional protocol over the
|
|
87
|
+
// tunnel it is waiting for — so close our side immediately, the
|
|
88
|
+
// same close every healthy cycle performs at teardown. Without
|
|
89
|
+
// this, an EOF'd socket survives an arbitrarily long filter await
|
|
90
|
+
// half-open (the host decision may be a model-classifier call or
|
|
91
|
+
// an interactive permission prompt), and the verdict write lands on
|
|
92
|
+
// a dead descriptor. The armed window runs from here through the
|
|
93
|
+
// filter await, the ClientHello peek (MITM path), and the upstream
|
|
94
|
+
// dial; it is disarmed only at tunnel handoff, where established
|
|
95
|
+
// tunnels forward FIN through pipe() and keep half-open semantics —
|
|
96
|
+
// a FIN during the dial tears the connection down rather than
|
|
97
|
+
// half-opening it, which is the cleaner teardown for a client that
|
|
98
|
+
// is gone.
|
|
99
|
+
//
|
|
100
|
+
// Deliberate tradeoff: a hypothetical pipelined send-and-FIN
|
|
101
|
+
// CONNECT client (payload + FIN up front, then read the response
|
|
102
|
+
// across the half-open socket) is also destroyed here. Accepting
|
|
103
|
+
// that means nothing is written once EOF has been observed
|
|
104
|
+
// (checked again at write time via readableEnded). EOF
|
|
105
|
+
// notification is best-effort on a paused socket, so the layered
|
|
106
|
+
// backstop matters: a write that still hits a dead peer errors,
|
|
107
|
+
// and the error handler above destroys the socket, releasing the
|
|
108
|
+
// descriptor. On runtimes whose EPIPE handling spins on dead-peer
|
|
109
|
+
// writes (the incident's Bun builds, pre oven-sh/bun#37076) this
|
|
110
|
+
// narrows the exposure from every abandoned decision to only those
|
|
111
|
+
// whose EOF was never notified.
|
|
112
|
+
const onDecisionWindowEof = () => {
|
|
113
|
+
clientGone = true;
|
|
114
|
+
socket.destroy();
|
|
115
|
+
};
|
|
116
|
+
// 'end' only fires once the stream is being read: on a paused socket
|
|
117
|
+
// (which a CONNECT socket is, between the header parse and the tunnel
|
|
118
|
+
// handoff) a client FIN can sit unobserved for the whole decision.
|
|
119
|
+
// On the opaque path, capture decision-window data to put the socket
|
|
120
|
+
// into flowing mode — making EOF notification reliable across
|
|
121
|
+
// runtimes — and fold anything captured back into `head` at disarm
|
|
122
|
+
// so early tunnel bytes (a client that pipelines its first payload
|
|
123
|
+
// behind the CONNECT) are never lost.
|
|
124
|
+
//
|
|
125
|
+
// Deliberately NOT armed on the mitmCA path: the ClientHello peek
|
|
126
|
+
// and the terminating relay manage this socket's flow themselves
|
|
127
|
+
// (pull-mode reads chosen specifically because pause()/resume()
|
|
128
|
+
// cycles corrupt CONNECT-upgraded sockets under Bun — see
|
|
129
|
+
// relayPaused), and injecting a flowing-mode phase ahead of them
|
|
130
|
+
// breaks the terminating path outright. There, EOF detection during
|
|
131
|
+
// the decision stays best-effort ('close' fires on full close — the
|
|
132
|
+
// incident case — and the peek's own reads surface 'end' once it
|
|
133
|
+
// runs); the write-time guards and the error-handler backstop cover
|
|
134
|
+
// the remainder.
|
|
135
|
+
//
|
|
136
|
+
// Capture is bounded: the paused socket used to give free TCP
|
|
137
|
+
// backpressure, and an untrusted client streaming at line rate for
|
|
138
|
+
// the length of an interactive permission prompt must not balloon
|
|
139
|
+
// host memory. A legitimate pipelined first flight (an SSH banner)
|
|
140
|
+
// is tiny; blowing the cap is abandonment-grade abuse and closes
|
|
141
|
+
// the connection.
|
|
142
|
+
const MAX_DECISION_CAPTURE_BYTES = 64 * 1024;
|
|
143
|
+
let decisionCaptureBytes = 0;
|
|
144
|
+
let capturing = false;
|
|
145
|
+
const decisionData = [];
|
|
146
|
+
const onDecisionData = (chunk) => {
|
|
147
|
+
if (!capturing)
|
|
148
|
+
return;
|
|
149
|
+
decisionCaptureBytes += chunk.length;
|
|
150
|
+
if (decisionCaptureBytes > MAX_DECISION_CAPTURE_BYTES) {
|
|
151
|
+
logForDebugging('CONNECT client exceeded pre-establishment capture cap; destroying', { level: 'error' });
|
|
152
|
+
onDecisionWindowEof();
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
decisionData.push(chunk);
|
|
156
|
+
};
|
|
157
|
+
if (!options.mitmCA) {
|
|
158
|
+
capturing = true;
|
|
159
|
+
socket.on('data', onDecisionData);
|
|
160
|
+
}
|
|
161
|
+
// EOF may already have been processed before this handler arms (a
|
|
162
|
+
// client that sent CONNECT and FIN together), and an already-emitted
|
|
163
|
+
// 'end' never re-fires — check the flag first.
|
|
164
|
+
if (socket.readableEnded) {
|
|
165
|
+
onDecisionWindowEof();
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
socket.once('end', onDecisionWindowEof);
|
|
169
|
+
}
|
|
170
|
+
// Stop capturing, folding captured bytes into `head`. The listener
|
|
171
|
+
// deliberately STAYS attached as a discarding sink: 'data' events
|
|
172
|
+
// broadcast to every listener, so the real consumer (pipe()) still
|
|
173
|
+
// receives everything, while removing the last listener from a
|
|
174
|
+
// flowing stream would silently DROP bytes arriving before the
|
|
175
|
+
// consumer attaches (e.g. during the awaited upstream dial). No
|
|
176
|
+
// pause() — pause/resume cycles corrupt CONNECT-upgraded sockets
|
|
177
|
+
// under Bun (see relayPaused).
|
|
178
|
+
const disarmDecisionCapture = () => {
|
|
179
|
+
capturing = false;
|
|
180
|
+
if (decisionData.length) {
|
|
181
|
+
head = Buffer.concat([head, ...decisionData]);
|
|
182
|
+
decisionData.length = 0;
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
const disarmDecisionWindowEof = () => {
|
|
186
|
+
socket.removeListener('end', onDecisionWindowEof);
|
|
187
|
+
disarmDecisionCapture();
|
|
188
|
+
};
|
|
189
|
+
// Decision-phase status writes go through this guard: a verdict for
|
|
190
|
+
// a dead client is dropped, never written. The filter's work is not
|
|
191
|
+
// wasted — host-side allow/deny caches serve the client's retry.
|
|
192
|
+
const endWithStatus = (payload) => {
|
|
193
|
+
if (clientGone ||
|
|
194
|
+
socket.destroyed ||
|
|
195
|
+
socket.readableEnded ||
|
|
196
|
+
!socket.writable) {
|
|
197
|
+
logForDebugging('CONNECT client gone before status write; dropping verdict and destroying socket');
|
|
198
|
+
socket.destroy();
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
// Disarm before writing: a FIN processed while this verdict is
|
|
202
|
+
// still queued (backpressured or slow client) would otherwise
|
|
203
|
+
// fire the armed 'end' handler and destroy() the unflushed write.
|
|
204
|
+
disarmDecisionWindowEof();
|
|
205
|
+
socket.end(payload);
|
|
206
|
+
};
|
|
207
|
+
// A client that sent CONNECT and FIN together (or closed before the
|
|
208
|
+
// handler ran) was destroyed at arm time: return before spending a
|
|
209
|
+
// decision — possibly an interactive permission prompt or a
|
|
210
|
+
// classifier call — on a connection that no longer exists.
|
|
211
|
+
if (clientGone || socket.destroyed) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
// Whether the MITM sniff path already wrote the 200 — hoisted so the
|
|
215
|
+
// catch below can see it: once the 200 is out, any HTTP status line
|
|
216
|
+
// would land inside what the client treats as tunnel payload.
|
|
217
|
+
let wrote200 = false;
|
|
218
|
+
try {
|
|
219
|
+
const auth = checkAuth(req.headers['proxy-authorization']);
|
|
220
|
+
if (!auth.ok) {
|
|
221
|
+
endWithStatus('HTTP/1.1 407 Proxy Authentication Required\r\n' +
|
|
222
|
+
'Proxy-Authenticate: Basic realm="srt"\r\n\r\n');
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const target = parseConnectTarget(req.url);
|
|
226
|
+
if (!target) {
|
|
227
|
+
logForDebugging(`Invalid CONNECT request: ${req.url}`, {
|
|
228
|
+
level: 'error',
|
|
229
|
+
});
|
|
230
|
+
endWithStatus('HTTP/1.1 400 Bad Request\r\n\r\n');
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const { hostname: requestedHost, port } = target;
|
|
234
|
+
const allowed = await options.filter(port, requestedHost, socket, auth.encodedCommand);
|
|
235
|
+
if (!allowed) {
|
|
236
|
+
logForDebugging(`Connection blocked to ${requestedHost}:${port}`, {
|
|
237
|
+
level: 'error',
|
|
238
|
+
});
|
|
239
|
+
endWithStatus(rawDenied(...ALLOWLIST_DENY));
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
// The client may have died during the filter await (EOF destroy
|
|
243
|
+
// above, or full close): there is nothing left to establish.
|
|
244
|
+
if (clientGone || socket.destroyed) {
|
|
245
|
+
socket.destroy();
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
// From here on, use the spelling the allowlist actually evaluated.
|
|
249
|
+
// The filter canonicalizes before matching (so `Api.Example.com.`,
|
|
250
|
+
// `127.1`, `0x7f.0.0.1` are allowed iff their canonical forms are),
|
|
251
|
+
// and every decision below — TLS-termination exemption, MITM
|
|
252
|
+
// routing, parent-proxy bypass, credential injection, the leaf cert
|
|
253
|
+
// and upstream SNI, the authority we put on the wire — must key off
|
|
254
|
+
// that same spelling. Routing off the raw one let a trailing-dot
|
|
255
|
+
// FQDN pass the allowlist as `api.example.com`, miss every MITM
|
|
256
|
+
// pattern, and dial out directly. Same fallback as the filter for
|
|
257
|
+
// the (already-validated, so practically unreachable) case where
|
|
258
|
+
// canonicalization fails, so the two layers can never disagree.
|
|
259
|
+
const hostname = canonicalizeHost(requestedHost) ?? requestedHost;
|
|
260
|
+
const lookup = options.lookupFor?.(port, auth.encodedCommand);
|
|
261
|
+
// Decide upstream route:
|
|
262
|
+
// in-process TLS termination
|
|
263
|
+
// > external MITM unix socket
|
|
264
|
+
// > parent HTTP proxy
|
|
265
|
+
// > direct
|
|
266
|
+
// (tlsTerminate and mitmProxy are mutually exclusive at the config
|
|
267
|
+
// layer, so the first two never both apply.)
|
|
268
|
+
if (options.mitmCA &&
|
|
269
|
+
(options.shouldTerminateTLS?.(hostname, port) ?? true)) {
|
|
270
|
+
// We can only terminate TLS. CONNECT also carries non-TLS streams —
|
|
271
|
+
// notably SSH on Linux, where the sandbox's own GIT_SSH_COMMAND
|
|
272
|
+
// routes `ssh` through this proxy via `socat - PROXY:`. Send 200 so
|
|
273
|
+
// the client transmits its first bytes, sniff for a ClientHello, and
|
|
274
|
+
// only terminate if it is one. Non-TLS falls through to the opaque
|
|
275
|
+
// tunnel below — i.e. base-sandbox behaviour, hostname-allowlisted
|
|
276
|
+
// but not content-inspected (same as the SOCKS path).
|
|
277
|
+
socket.write('HTTP/1.1 200 Connection Established\r\n\r\n');
|
|
278
|
+
wrote200 = true;
|
|
279
|
+
const peeked = await peekForClientHello(socket, head);
|
|
280
|
+
if (clientGone || socket.destroyed) {
|
|
281
|
+
socket.destroy();
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (peeked.isTLS) {
|
|
285
|
+
disarmDecisionWindowEof();
|
|
286
|
+
terminateAndForward(options.mitmCA, options.filterRequest, options.mutateHeaders, options.getBodySubstitutions, socket, peeked.head, {
|
|
287
|
+
hostname,
|
|
288
|
+
port,
|
|
289
|
+
upstreamCA: options.tlsTerminateUpstreamCA,
|
|
290
|
+
lookup,
|
|
291
|
+
onFilterRequestDeny: options.onFilterRequestDenied
|
|
292
|
+
? (method, url, reason) => options.onFilterRequestDenied({
|
|
293
|
+
method,
|
|
294
|
+
url,
|
|
295
|
+
reason,
|
|
296
|
+
encodedCommand: auth.encodedCommand,
|
|
297
|
+
})
|
|
298
|
+
: undefined,
|
|
299
|
+
}, options.planSigv4, options.maxSigv4ResignBodyBytes);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
logForDebugging(`[tls-terminate] non-TLS bytes on CONNECT ${hostname}:${port}; opaque-tunnelling`);
|
|
303
|
+
head = peeked.head;
|
|
304
|
+
}
|
|
305
|
+
else if (options.mitmCA) {
|
|
306
|
+
// Per-host termination opt-out: the policy exempts this host (mTLS
|
|
307
|
+
// upstream, cert-pinning client), so skip the MITM entirely and
|
|
308
|
+
// take the opaque tunnel below, exactly as if mitmCA were unset.
|
|
309
|
+
logForDebugging(`[tls-terminate] policy exempts ${hostname}:${port}; opaque-tunnelling`);
|
|
310
|
+
}
|
|
311
|
+
const mitmSocketPath = options.getMitmSocketPath?.(hostname);
|
|
312
|
+
const parentUrl = !mitmSocketPath &&
|
|
313
|
+
options.parentProxy &&
|
|
314
|
+
!shouldBypassParentProxy(options.parentProxy, hostname)
|
|
315
|
+
? selectParentProxyUrl(options.parentProxy, { isHttps: true })
|
|
316
|
+
: undefined;
|
|
317
|
+
let upstream;
|
|
318
|
+
try {
|
|
319
|
+
if (mitmSocketPath) {
|
|
320
|
+
logForDebugging(`Routing CONNECT ${hostname}:${port} through MITM proxy at ${mitmSocketPath}`);
|
|
321
|
+
upstream = await openConnectTunnel({
|
|
322
|
+
dial: () => connect({ path: mitmSocketPath }),
|
|
323
|
+
readyEvent: 'connect',
|
|
324
|
+
destHost: hostname,
|
|
325
|
+
destPort: port,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
else if (parentUrl) {
|
|
329
|
+
upstream = await connectViaParentProxy(parentUrl, hostname, port);
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
upstream = await dialDirect(hostname, port, lookup);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
catch (err) {
|
|
336
|
+
logForDebugging(`CONNECT tunnel failed: ${err.message}`, {
|
|
337
|
+
level: 'error',
|
|
338
|
+
});
|
|
339
|
+
// If we already sent 200 (mitmCA sniff path), an HTTP status line now
|
|
340
|
+
// would land inside the tunnel as payload. Just close.
|
|
341
|
+
if (wrote200)
|
|
342
|
+
socket.destroy();
|
|
343
|
+
else if (isResolvedAddressDenied(err)) {
|
|
344
|
+
endWithStatus(rawDenied(err.message));
|
|
345
|
+
}
|
|
346
|
+
else
|
|
347
|
+
endWithStatus('HTTP/1.1 502 Bad Gateway\r\n\r\n');
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
if (clientGone || socket.destroyed) {
|
|
351
|
+
upstream.on('error', () => { }); // swallow post-resolve errors
|
|
352
|
+
upstream.destroy();
|
|
353
|
+
socket.destroy();
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
if (!wrote200) {
|
|
357
|
+
socket.write('HTTP/1.1 200 Connection Established\r\n\r\n');
|
|
358
|
+
}
|
|
359
|
+
disarmDecisionWindowEof();
|
|
360
|
+
// An established tunnel relays each TCP direction independently: a
|
|
361
|
+
// client that half-closes (FIN after its request bytes) must still
|
|
362
|
+
// receive the upstream's reply. Without this, runtimes that default
|
|
363
|
+
// http-server sockets to allowHalfOpen=false auto-close the client
|
|
364
|
+
// side on FIN and the reply is lost.
|
|
365
|
+
socket.allowHalfOpen = true;
|
|
366
|
+
// Forward any bytes the client sent in the same packet as the CONNECT
|
|
367
|
+
// (Node delivers these as the `head` buffer, not via the socket stream),
|
|
368
|
+
// plus anything the ClientHello sniff consumed when mitmCA is on.
|
|
369
|
+
if (head.length)
|
|
370
|
+
upstream.write(head);
|
|
371
|
+
upstream.pipe(socket);
|
|
372
|
+
socket.pipe(upstream);
|
|
373
|
+
upstream.on('error', err => {
|
|
374
|
+
logForDebugging(`CONNECT tunnel failed: ${err.message}`, {
|
|
375
|
+
level: 'error',
|
|
376
|
+
});
|
|
377
|
+
socket.destroy();
|
|
378
|
+
});
|
|
379
|
+
socket.on('close', () => upstream.destroy());
|
|
380
|
+
upstream.on('close', () => socket.destroy());
|
|
381
|
+
}
|
|
382
|
+
catch (err) {
|
|
383
|
+
logForDebugging(`Error handling CONNECT: ${err}`, { level: 'error' });
|
|
384
|
+
// Same rule as the 502 path: once the MITM sniff's 200 is out, a
|
|
385
|
+
// status line would corrupt the tunnel byte stream — just close.
|
|
386
|
+
if (wrote200)
|
|
387
|
+
socket.destroy();
|
|
388
|
+
else
|
|
389
|
+
endWithStatus('HTTP/1.1 500 Internal Server Error\r\n\r\n');
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
// Handle regular HTTP requests
|
|
393
|
+
server.on('request', async (req, res) => {
|
|
394
|
+
// A client abort mid-request destroys req/res with an error; with no
|
|
395
|
+
// listener it escapes as an uncaughtException (the runtime emits it
|
|
396
|
+
// from node:_http_server). `pipe()` does not forward error events, so
|
|
397
|
+
// the body pipelines below never see it either.
|
|
398
|
+
req.on('error', err => {
|
|
399
|
+
logForDebugging(`Client request error: ${err.message}`, {
|
|
400
|
+
level: 'error',
|
|
401
|
+
});
|
|
402
|
+
});
|
|
403
|
+
res.on('error', err => {
|
|
404
|
+
logForDebugging(`Client response error: ${err.message}`, {
|
|
405
|
+
level: 'error',
|
|
406
|
+
});
|
|
407
|
+
// A failed response write (EPIPE to a dead peer) must release
|
|
408
|
+
// the descriptor — same rationale as the CONNECT handler's
|
|
409
|
+
// socket error handler. The res 'close' teardown listeners then
|
|
410
|
+
// handle the upstream leg.
|
|
411
|
+
res.socket?.destroy();
|
|
412
|
+
});
|
|
413
|
+
try {
|
|
414
|
+
// Serve the empty CRL for Schannel's revocation check on MITM-minted
|
|
415
|
+
// leaves (see MitmCA.crlDer). CryptoAPI fetches the leaf's
|
|
416
|
+
// cRLDistributionPoints URL over plain HTTP with no
|
|
417
|
+
// Proxy-Authorization, so this must precede both the auth check and
|
|
418
|
+
// the `new URL(req.url)` parse below (which requires absolute-form).
|
|
419
|
+
// Match on pathname so both origin-form (`GET /srt.crl`, what
|
|
420
|
+
// CryptoAPI sends) and absolute-form (`GET http://…/srt.crl`, what a
|
|
421
|
+
// proxy-aware fetcher would send) resolve; the base is ignored for
|
|
422
|
+
// the absolute case.
|
|
423
|
+
if (options.mitmCA &&
|
|
424
|
+
req.method === 'GET' &&
|
|
425
|
+
new URL(req.url ?? '', 'http://x').pathname === CRL_PATH) {
|
|
426
|
+
res.writeHead(200, {
|
|
427
|
+
'Content-Type': 'application/pkix-crl',
|
|
428
|
+
'Content-Length': options.mitmCA.crlDer.length,
|
|
429
|
+
});
|
|
430
|
+
res.end(options.mitmCA.crlDer);
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
const auth = checkAuth(req.headers['proxy-authorization']);
|
|
434
|
+
if (!auth.ok) {
|
|
435
|
+
res.writeHead(407, { 'Proxy-Authenticate': 'Basic realm="srt"' });
|
|
436
|
+
res.end();
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
const url = new URL(req.url);
|
|
440
|
+
const isHttps = url.protocol === 'https:';
|
|
441
|
+
const defaultPort = isHttps ? 443 : 80;
|
|
442
|
+
const requestedHost = stripBrackets(url.hostname);
|
|
443
|
+
const port = url.port ? parseInt(url.port, 10) : defaultPort;
|
|
444
|
+
const allowed = await options.filter(port, requestedHost, req.socket, auth.encodedCommand);
|
|
445
|
+
if (!allowed) {
|
|
446
|
+
logForDebugging(`HTTP request blocked to ${requestedHost}:${port}`, {
|
|
447
|
+
level: 'error',
|
|
448
|
+
});
|
|
449
|
+
// The client may have aborted during the filter await; a
|
|
450
|
+
// deny for a dead client is dropped, not written. Plain
|
|
451
|
+
// half-close (EOF after a complete request) is legal HTTP
|
|
452
|
+
// and still gets its verdict — only a destroyed socket is
|
|
453
|
+
// dead here.
|
|
454
|
+
if (req.socket.destroyed || res.destroyed) {
|
|
455
|
+
res.destroy();
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
respondDenied(res, ...ALLOWLIST_DENY);
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
// Client may have disconnected while we awaited the filter; bail now
|
|
462
|
+
// rather than dialing an upstream nobody will read from.
|
|
463
|
+
if (req.socket.destroyed)
|
|
464
|
+
return;
|
|
465
|
+
// Same rule as the CONNECT handler: everything after the allow
|
|
466
|
+
// decision keys off the canonical spelling. The URL parser has
|
|
467
|
+
// already lowercased and IPv4-normalized `url.hostname`; what it
|
|
468
|
+
// leaves behind is the trailing dot, which is exactly the spelling
|
|
469
|
+
// that used to reach getMitmSocketPath / the upstream unchanged.
|
|
470
|
+
const hostname = canonicalizeHost(requestedHost) ?? requestedHost;
|
|
471
|
+
// The authority we forward (request-target and Host header) is rebuilt
|
|
472
|
+
// from the canonical host so the MITM / parent proxy sees the host we
|
|
473
|
+
// allowlist-checked, not the client's spelling of it.
|
|
474
|
+
const authority = formatAuthority(hostname, port, defaultPort);
|
|
475
|
+
const fwdHeaders = { ...stripHopByHop(req.headers), host: authority };
|
|
476
|
+
options.mutateHeadersPlaintext?.(fwdHeaders, hostname);
|
|
477
|
+
// Body-substitution counterpart of mutateHeadersPlaintext (opt-in via
|
|
478
|
+
// the same config gate). May delete content-length from fwdHeaders.
|
|
479
|
+
const bodyTransform = prepareBodySubstitution(options.getBodySubstitutionsPlaintext, req, fwdHeaders, hostname);
|
|
480
|
+
// Decide upstream route: MITM unix socket > parent HTTP proxy > direct.
|
|
481
|
+
const mitmSocketPath = options.getMitmSocketPath?.(hostname);
|
|
482
|
+
const parentUrl = !mitmSocketPath &&
|
|
483
|
+
options.parentProxy &&
|
|
484
|
+
!shouldBypassParentProxy(options.parentProxy, hostname)
|
|
485
|
+
? selectParentProxyUrl(options.parentProxy, {
|
|
486
|
+
isHttps,
|
|
487
|
+
})
|
|
488
|
+
: undefined;
|
|
489
|
+
// Reconstruct the absolute URI from parsed components rather than
|
|
490
|
+
// forwarding the client's raw req.url. This ensures the upstream proxy
|
|
491
|
+
// sees exactly the host we allowlist-checked, closing URL-parser
|
|
492
|
+
// differential bypasses.
|
|
493
|
+
const absUrl = `${url.protocol}//${authority}${url.pathname}${url.search}`;
|
|
494
|
+
// Per-request filter applies to plain HTTP too — otherwise a sandboxed
|
|
495
|
+
// client could bypass it by using http:// where the upstream serves it.
|
|
496
|
+
let body = req;
|
|
497
|
+
if (options.filterRequest) {
|
|
498
|
+
const ac = new AbortController();
|
|
499
|
+
res.once('close', () => ac.abort());
|
|
500
|
+
const out = await decideAndRespond(options.filterRequest, req, res, absUrl, ac.signal, options.onFilterRequestDenied
|
|
501
|
+
? (method, url, reason) => options.onFilterRequestDenied({
|
|
502
|
+
method,
|
|
503
|
+
url,
|
|
504
|
+
reason,
|
|
505
|
+
encodedCommand: auth.encodedCommand,
|
|
506
|
+
})
|
|
507
|
+
: undefined);
|
|
508
|
+
if (out === null)
|
|
509
|
+
return;
|
|
510
|
+
body = out;
|
|
511
|
+
// The client may have aborted during the filterRequest await —
|
|
512
|
+
// the tee branch is already destroyed and res 'close' has already
|
|
513
|
+
// fired, so the teardown listeners attached below would never
|
|
514
|
+
// run. Don't dial an upstream for a dead client. A COMPLETED
|
|
515
|
+
// request is also destroyed=true (normal stream lifecycle after
|
|
516
|
+
// 'end'); only a destroy without a clean end is an abort.
|
|
517
|
+
if ((req.destroyed && !req.readableEnded) ||
|
|
518
|
+
res.destroyed ||
|
|
519
|
+
req.socket.destroyed ||
|
|
520
|
+
body.destroyed) {
|
|
521
|
+
body.destroy();
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
// When the client declared a body but the forwarded headers carry no
|
|
526
|
+
// framing (chunked TE stripped as hop-by-hop, or a body transform
|
|
527
|
+
// deleted content-length), the upstream leg must re-frame
|
|
528
|
+
// explicitly: for bodyless-method requests the runtime would
|
|
529
|
+
// otherwise write the piped body bytes raw after complete-framed
|
|
530
|
+
// headers — a request-smuggling primitive.
|
|
531
|
+
const clientDeclaredBody = Boolean(req.headers['content-length'] || req.headers['transfer-encoding']);
|
|
532
|
+
if (clientDeclaredBody &&
|
|
533
|
+
fwdHeaders['content-length'] === undefined &&
|
|
534
|
+
fwdHeaders['transfer-encoding'] === undefined) {
|
|
535
|
+
fwdHeaders['transfer-encoding'] = 'chunked';
|
|
536
|
+
}
|
|
537
|
+
const failUpstream = (err) => {
|
|
538
|
+
logForDebugging(`Proxy request failed: ${err.message}`, {
|
|
539
|
+
level: 'error',
|
|
540
|
+
});
|
|
541
|
+
respondUpstreamError(res, err);
|
|
542
|
+
};
|
|
543
|
+
let proxyReq;
|
|
544
|
+
if (mitmSocketPath) {
|
|
545
|
+
logForDebugging(`Routing HTTP ${req.method} ${hostname}:${port} through MITM proxy at ${mitmSocketPath}`);
|
|
546
|
+
const mitmAgent = new Agent({
|
|
547
|
+
// @ts-expect-error - socketPath is valid but not in types
|
|
548
|
+
socketPath: mitmSocketPath,
|
|
549
|
+
});
|
|
550
|
+
proxyReq = httpRequest({
|
|
551
|
+
agent: mitmAgent,
|
|
552
|
+
path: absUrl,
|
|
553
|
+
method: req.method,
|
|
554
|
+
headers: fwdHeaders,
|
|
555
|
+
}, proxyRes => {
|
|
556
|
+
// The response stream errors independently of proxyReq (e.g.
|
|
557
|
+
// upstream reset mid-body after headers); pipe() does not
|
|
558
|
+
// handle source errors.
|
|
559
|
+
proxyRes.on('error', err => {
|
|
560
|
+
logForDebugging(`Upstream response error: ${err.message}`, {
|
|
561
|
+
level: 'error',
|
|
562
|
+
});
|
|
563
|
+
res.destroy();
|
|
564
|
+
});
|
|
565
|
+
res.writeHead(proxyRes.statusCode, stripHopByHop(proxyRes.headers));
|
|
566
|
+
proxyRes.pipe(res);
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
else if (parentUrl) {
|
|
570
|
+
const parentHost = stripBrackets(parentUrl.hostname);
|
|
571
|
+
const parentPort = Number(parentUrl.port) || (parentUrl.protocol === 'https:' ? 443 : 80);
|
|
572
|
+
const auth = proxyAuthHeader(parentUrl);
|
|
573
|
+
const requestFn = parentUrl.protocol === 'https:' ? httpsRequest : httpRequest;
|
|
574
|
+
proxyReq = requestFn({
|
|
575
|
+
hostname: parentHost,
|
|
576
|
+
port: parentPort,
|
|
577
|
+
path: absUrl,
|
|
578
|
+
method: req.method,
|
|
579
|
+
headers: auth
|
|
580
|
+
? { ...fwdHeaders, 'proxy-authorization': auth }
|
|
581
|
+
: fwdHeaders,
|
|
582
|
+
}, proxyRes => {
|
|
583
|
+
// The response stream errors independently of proxyReq (e.g.
|
|
584
|
+
// upstream reset mid-body after headers); pipe() does not
|
|
585
|
+
// handle source errors.
|
|
586
|
+
proxyRes.on('error', err => {
|
|
587
|
+
logForDebugging(`Upstream response error: ${err.message}`, {
|
|
588
|
+
level: 'error',
|
|
589
|
+
});
|
|
590
|
+
res.destroy();
|
|
591
|
+
});
|
|
592
|
+
res.writeHead(proxyRes.statusCode, stripHopByHop(proxyRes.headers));
|
|
593
|
+
proxyRes.pipe(res);
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
// Vet and pick the upstream address before any request object exists
|
|
598
|
+
// (see directRequestOptions); the name stays in Host and, for TLS, SNI.
|
|
599
|
+
let direct;
|
|
600
|
+
try {
|
|
601
|
+
direct = await directRequestOptions(hostname, port, options.lookupFor?.(port, auth.encodedCommand), isHttps);
|
|
602
|
+
}
|
|
603
|
+
catch (err) {
|
|
604
|
+
failUpstream(err);
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
if (res.destroyed || req.socket.destroyed) {
|
|
608
|
+
// Client went away during the dial.
|
|
609
|
+
body.destroy();
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
proxyReq = (isHttps ? httpsRequest : httpRequest)({
|
|
613
|
+
...direct,
|
|
614
|
+
path: url.pathname + url.search,
|
|
615
|
+
method: req.method,
|
|
616
|
+
headers: fwdHeaders,
|
|
617
|
+
}, proxyRes => {
|
|
618
|
+
// The response stream errors independently of proxyReq (e.g.
|
|
619
|
+
// upstream reset mid-body after headers); pipe() does not
|
|
620
|
+
// handle source errors.
|
|
621
|
+
proxyRes.on('error', err => {
|
|
622
|
+
logForDebugging(`Upstream response error: ${err.message}`, {
|
|
623
|
+
level: 'error',
|
|
624
|
+
});
|
|
625
|
+
res.destroy();
|
|
626
|
+
});
|
|
627
|
+
res.writeHead(proxyRes.statusCode, stripHopByHop(proxyRes.headers));
|
|
628
|
+
proxyRes.pipe(res);
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
proxyReq.on('error', failUpstream);
|
|
632
|
+
// Tear down the upstream request if the client goes away mid-flight.
|
|
633
|
+
res.on('close', () => proxyReq.destroy());
|
|
634
|
+
if (bodyTransform) {
|
|
635
|
+
// Errors on either side of the extra pipe stage tear the chain
|
|
636
|
+
// down — a stalled half-open upstream would otherwise wait for the
|
|
637
|
+
// client.
|
|
638
|
+
bodyTransform.on('error', err => proxyReq.destroy(err));
|
|
639
|
+
body.on('error', err => bodyTransform.destroy(err));
|
|
640
|
+
res.on('close', () => bodyTransform.destroy());
|
|
641
|
+
body.pipe(bodyTransform).pipe(proxyReq);
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
// pipe() does not handle source errors. `body` may be a tee branch
|
|
645
|
+
// from decideAndRespond (not `req` itself), so a client abort
|
|
646
|
+
// surfaces here as an 'error' that would otherwise escape as an
|
|
647
|
+
// uncaughtException.
|
|
648
|
+
body.on('error', err => proxyReq.destroy(err));
|
|
649
|
+
body.pipe(proxyReq);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
catch (err) {
|
|
653
|
+
logForDebugging(`Error handling HTTP request: ${err}`, { level: 'error' });
|
|
654
|
+
if (!res.headersSent) {
|
|
655
|
+
res.writeHead(500, { 'Content-Type': 'text/plain' });
|
|
656
|
+
res.end('Internal Server Error');
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
res.destroy();
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
return server;
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Parse a CONNECT request-target into host + port. Handles both plain
|
|
667
|
+
* `host:port` and bracketed IPv6 `[::1]:port`.
|
|
668
|
+
*/
|
|
669
|
+
function parseConnectTarget(target) {
|
|
670
|
+
const m = /^\[([^\]]+)\]:(\d+)$/.exec(target) ?? /^([^:]+):(\d+)$/.exec(target);
|
|
671
|
+
if (!m)
|
|
672
|
+
return undefined;
|
|
673
|
+
const port = Number(m[2]);
|
|
674
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535)
|
|
675
|
+
return undefined;
|
|
676
|
+
return { hostname: m[1], port };
|
|
677
|
+
}
|
|
678
|
+
//# sourceMappingURL=http-proxy.js.map
|