tau-all-agent 0.3.0 → 0.4.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/README.md +2 -0
- package/extensions/answer.ts +4 -1
- package/extensions/branch-term/index.ts +49 -57
- package/extensions/btw.ts +4 -1
- package/extensions/insights.ts +4 -1
- package/extensions/loop.ts +33 -7
- package/extensions/review/README.md +24 -0
- package/extensions/review/config.ts +65 -0
- package/extensions/review/focus.ts +48 -0
- package/extensions/review/request.ts +44 -73
- package/extensions/review/runner.ts +5 -1
- package/extensions/review/schema.ts +1 -0
- package/extensions/sandbox/README.md +67 -0
- package/extensions/sandbox/bash.ts +237 -362
- package/extensions/sandbox/classifier/delegation.ts +160 -0
- package/extensions/sandbox/classifier/guardian.ts +146 -0
- package/extensions/sandbox/classifier.ts +848 -0
- package/extensions/sandbox/command.ts +55 -20
- package/extensions/sandbox/config.ts +185 -41
- package/extensions/sandbox/index.ts +65 -100
- package/extensions/sandbox/macos-sandbox-shell.mjs +2 -2
- package/extensions/sandbox/permissions/dialog.ts +326 -80
- package/extensions/sandbox/permissions/filesystem.ts +232 -335
- package/extensions/sandbox/permissions/mach-lookup.ts +80 -131
- package/extensions/sandbox/permissions/proposal.ts +50 -0
- package/extensions/sandbox/runtime.ts +516 -104
- package/extensions/stash.ts +2 -2
- package/extensions/subagent/README.md +9 -5
- package/extensions/subagent/index.ts +71 -53
- package/extensions/subagent/review.ts +304 -0
- package/extensions/subagent/rpc.ts +55 -15
- package/extensions/telegram/README.md +3 -1
- package/extensions/telegram/daemon.mjs +224 -113
- package/extensions/telegram/index.ts +195 -141
- package/extensions/telegram/startup.ts +277 -0
- package/extensions/usage/README.md +1 -1
- package/extensions/usage/index.ts +227 -294
- package/extensions/worktree.ts +46 -65
- package/node_modules/@anthropic-ai/sandbox-runtime/LICENSE +201 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/README.md +922 -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 +487 -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 +20 -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 +18 -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 +327 -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 +2801 -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 +117 -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 +1227 -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 +162 -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 +479 -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/path-entries.d.ts +133 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/path-entries.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/path-entries.js +340 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/path-entries.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/read-deny-glob.d.ts +28 -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 +172 -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 +1887 -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 +1262 -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 +101 -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 +2054 -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 +126 -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 +462 -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 +1525 -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 +933 -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 +1446 -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 +29 -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 +51 -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/node_modules/@pondwader/socks5-server/.github/workflows/ci.yml +27 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/@pondwader/socks5-server/LICENSE +20 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/@pondwader/socks5-server/README.md +151 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/@pondwader/socks5-server/dist/index.d.mts +87 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/@pondwader/socks5-server/dist/index.d.ts +87 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/@pondwader/socks5-server/dist/index.js +346 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/@pondwader/socks5-server/dist/index.mjs +307 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/@pondwader/socks5-server/package.json +31 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/LICENSE +22 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/Readme.md +1157 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/esm.mjs +16 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/index.js +24 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/lib/command.js +2509 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/lib/error.js +39 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/lib/help.js +520 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/lib/option.js +330 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/package-support.json +16 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/package.json +84 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/commander/typings/index.d.ts +969 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/LICENSE +331 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/README.md +2071 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/dist/forge.all.min.js +2 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/dist/forge.all.min.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/dist/forge.min.js +2 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/dist/forge.min.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/dist/prime.worker.min.js +2 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/dist/prime.worker.min.js.map +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/flash/swf/SocketPool.swf +0 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/aes.js +1091 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/aesCipherSuites.js +282 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/asn1-validator.js +91 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/asn1.js +1503 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/baseN.js +186 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/cipher.js +230 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/cipherModes.js +999 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/des.js +496 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/ed25519.js +1091 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/forge.js +13 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/form.js +149 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/hmac.js +146 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/http.js +1346 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/index.all.js +16 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/index.js +33 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/jsbn.js +1294 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/kem.js +168 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/log.js +319 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/md.all.js +13 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/md.js +11 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/md5.js +289 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/mgf.js +12 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/mgf1.js +57 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/oids.js +180 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/pbe.js +1023 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/pbkdf2.js +211 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/pem.js +237 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/pkcs1.js +276 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/pkcs12.js +1078 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/pkcs7.js +1260 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/pkcs7asn1.js +410 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/pki.js +102 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/prime.js +297 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/prime.worker.js +168 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/prng.js +419 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/pss.js +241 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/random.js +191 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/rc2.js +410 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/rsa.js +1968 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/sha1.js +319 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/sha256.js +327 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/sha512.js +561 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/socket.js +287 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/ssh.js +236 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/tls.js +4282 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/tlssocket.js +249 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/util.js +2652 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/x509.js +3251 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/lib/xhr.js +738 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/node-forge/package.json +123 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/LICENSE +21 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/README.md +208 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/index.cjs +33 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/index.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/index.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/index.js +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/package.json +118 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/index.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/complex.test.ts +56 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/function.test.ts +257 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/nan.test.ts +21 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v3/types.ts +5136 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/checks.ts +30 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/compat.ts +66 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/errors.ts +75 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/external.ts +50 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/parse.ts +33 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/schemas.ts +2054 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/catch.test.ts +252 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/datetime.test.ts +296 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/default.test.ts +313 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +619 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +527 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/file.test.ts +91 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/function.test.ts +268 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/index.test.ts +829 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/literal.test.ts +92 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/number.test.ts +247 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/object.test.ts +563 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/optional.test.ts +123 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/partial.test.ts +147 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/pipe.test.ts +81 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +298 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/record.test.ts +342 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +356 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/refine.test.ts +532 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/set.test.ts +179 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/string.test.ts +881 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +758 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2314 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/transform.test.ts +250 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/union.test.ts +94 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/api.ts +1594 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/checks.ts +1283 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/core.ts +134 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/errors.ts +424 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/function.ts +176 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/index.ts +15 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/json-schema.ts +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/parse.ts +94 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/regexes.ts +135 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/registries.ts +96 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/schemas.ts +3842 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/standard-schema.ts +64 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/to-json-schema.ts +977 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/util.ts +775 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/ar.ts +125 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/az.ts +121 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/be.ts +184 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/ca.ts +127 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/cs.ts +142 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/de.ts +124 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/en.ts +127 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/eo.ts +125 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/es.ts +125 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/fa.ts +134 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/fi.ts +131 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/fr.ts +124 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/he.ts +125 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/hu.ts +126 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/id.ts +125 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/index.ts +39 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/it.ts +125 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/ja.ts +122 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/kh.ts +126 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/ko.ts +131 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/mk.ts +127 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/ms.ts +124 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/no.ts +124 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/ota.ts +125 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/pl.ts +126 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/ps.ts +133 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/pt.ts +123 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/ru.ts +184 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/sl.ts +126 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/sv.ts +127 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/ta.ts +125 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/th.ts +126 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/tr.ts +121 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/ua.ts +126 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/ur.ts +126 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/vi.ts +125 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/coerce.ts +22 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/external.ts +40 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/iso.ts +62 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/parse.ts +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/schemas.ts +1579 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/tests/index.test.ts +871 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/tests/object.test.ts +185 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4/mini/tests/string.test.ts +299 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/src/v4-mini/index.ts +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/external.js +6 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/index.js +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/locales/en.cjs +111 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/types.cjs +3775 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/types.d.cts +1031 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/types.d.ts +1031 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v3/types.js +3693 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/checks.cjs +32 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/compat.cjs +57 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/compat.d.cts +46 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/compat.d.ts +46 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/compat.js +27 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/errors.cjs +67 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/errors.js +41 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/external.cjs +70 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/external.d.cts +13 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/external.d.ts +13 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/external.js +18 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/parse.cjs +32 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/parse.d.cts +23 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/parse.d.ts +23 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/parse.js +6 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/schemas.cjs +1109 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/schemas.d.cts +630 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/schemas.d.ts +630 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/classic/schemas.js +1006 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/api.cjs +1039 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/api.d.cts +284 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/api.d.ts +284 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/api.js +906 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/checks.cjs +591 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/checks.js +565 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/core.cjs +67 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/core.d.cts +49 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/core.d.ts +49 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/core.js +61 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/errors.cjs +226 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/errors.d.cts +208 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/errors.d.ts +208 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/errors.js +195 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/function.cjs +102 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/function.d.cts +52 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/function.d.ts +52 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/function.js +75 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/index.cjs +44 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/index.d.cts +15 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/index.d.ts +15 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/index.js +15 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/json-schema.d.cts +87 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/json-schema.d.ts +87 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/parse.cjs +87 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/parse.d.cts +25 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/parse.d.ts +25 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/parse.js +57 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/regexes.cjs +103 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/regexes.d.cts +62 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/regexes.d.ts +62 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/regexes.js +95 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/schemas.cjs +1748 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/schemas.d.cts +1041 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/schemas.d.ts +1041 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/schemas.js +1717 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/to-json-schema.js +849 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/util.cjs +539 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/util.d.cts +183 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/util.d.ts +183 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/util.js +493 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/index.js +3 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ar.cjs +142 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ar.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ar.js +116 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/az.cjs +141 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/az.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/az.js +115 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/be.cjs +190 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/be.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/be.js +164 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ca.cjs +144 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ca.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ca.js +118 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/cs.cjs +161 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/cs.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/cs.js +135 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/de.cjs +142 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/de.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/de.js +116 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/en.cjs +145 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/en.d.ts +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/en.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/eo.cjs +144 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/eo.d.ts +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/eo.js +116 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/es.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/es.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/es.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fa.cjs +148 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fa.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fa.js +122 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fi.cjs +148 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fi.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fi.js +122 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fr-CA.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fr.cjs +142 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fr.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/fr.js +116 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/he.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/he.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/he.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/hu.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/hu.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/hu.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/id.cjs +142 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/id.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/id.js +116 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/index.cjs +84 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/index.d.cts +39 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/index.d.ts +39 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/index.js +39 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/it.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/it.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/it.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ja.cjs +141 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ja.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ja.js +115 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/kh.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/kh.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/kh.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/kh.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ko.cjs +147 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ko.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ko.js +121 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/mk.cjs +144 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/mk.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/mk.js +118 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ms.cjs +142 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ms.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ms.js +116 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/nl.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/nl.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/nl.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/no.cjs +142 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/no.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/no.js +116 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ota.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ota.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ota.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/pl.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/pl.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/pl.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ps.cjs +148 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ps.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ps.js +122 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/pt.cjs +142 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/pt.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/pt.js +116 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ru.cjs +190 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ru.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ru.js +164 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/sl.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/sl.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/sl.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/sv.cjs +144 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/sv.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/sv.js +118 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ta.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ta.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ta.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/th.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/th.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/th.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/tr.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/tr.d.ts +5 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/tr.js +115 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ua.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ua.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ua.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ua.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ur.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ur.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/ur.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/vi.cjs +142 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/vi.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/vi.js +116 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/zh-CN.js +116 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/locales/zh-TW.js +117 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/coerce.cjs +47 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/coerce.js +17 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/external.cjs +62 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/external.d.cts +11 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/external.d.ts +11 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/external.js +13 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/iso.cjs +60 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/iso.js +30 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/parse.cjs +8 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/schemas.cjs +839 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/schemas.d.cts +356 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/schemas.d.ts +356 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4/mini/schemas.js +732 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4-mini/index.cjs +17 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4-mini/index.d.cts +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/node_modules/@anthropic-ai/sandbox-runtime/node_modules/zod/v4-mini/index.js +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/package.json +5 -2
- package/themes/tau-dark.json +1 -1
- package/extensions/sandbox/permissions/network.ts +0 -169
- package/extensions/sandbox/permissions/unsandboxed.ts +0 -31
|
@@ -0,0 +1,1260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Javascript implementation of PKCS#7 v1.5.
|
|
3
|
+
*
|
|
4
|
+
* @author Stefan Siegl
|
|
5
|
+
* @author Dave Longley
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>
|
|
8
|
+
* Copyright (c) 2012-2015 Digital Bazaar, Inc.
|
|
9
|
+
*
|
|
10
|
+
* Currently this implementation only supports ContentType of EnvelopedData,
|
|
11
|
+
* EncryptedData, or SignedData at the root level. The top level elements may
|
|
12
|
+
* contain only a ContentInfo of ContentType Data, i.e. plain data. Further
|
|
13
|
+
* nesting is not (yet) supported.
|
|
14
|
+
*
|
|
15
|
+
* The Forge validators for PKCS #7's ASN.1 structures are available from
|
|
16
|
+
* a separate file pkcs7asn1.js, since those are referenced from other
|
|
17
|
+
* PKCS standards like PKCS #12.
|
|
18
|
+
*/
|
|
19
|
+
var forge = require('./forge');
|
|
20
|
+
require('./aes');
|
|
21
|
+
require('./asn1');
|
|
22
|
+
require('./des');
|
|
23
|
+
require('./oids');
|
|
24
|
+
require('./pem');
|
|
25
|
+
require('./pkcs7asn1');
|
|
26
|
+
require('./random');
|
|
27
|
+
require('./util');
|
|
28
|
+
require('./x509');
|
|
29
|
+
|
|
30
|
+
// shortcut for ASN.1 API
|
|
31
|
+
var asn1 = forge.asn1;
|
|
32
|
+
|
|
33
|
+
// shortcut for PKCS#7 API
|
|
34
|
+
var p7 = module.exports = forge.pkcs7 = forge.pkcs7 || {};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Converts a PKCS#7 message from PEM format.
|
|
38
|
+
*
|
|
39
|
+
* @param pem the PEM-formatted PKCS#7 message.
|
|
40
|
+
*
|
|
41
|
+
* @return the PKCS#7 message.
|
|
42
|
+
*/
|
|
43
|
+
p7.messageFromPem = function(pem) {
|
|
44
|
+
var msg = forge.pem.decode(pem)[0];
|
|
45
|
+
|
|
46
|
+
if(msg.type !== 'PKCS7') {
|
|
47
|
+
var error = new Error('Could not convert PKCS#7 message from PEM; PEM ' +
|
|
48
|
+
'header type is not "PKCS#7".');
|
|
49
|
+
error.headerType = msg.type;
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
if(msg.procType && msg.procType.type === 'ENCRYPTED') {
|
|
53
|
+
throw new Error('Could not convert PKCS#7 message from PEM; PEM is encrypted.');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// convert DER to ASN.1 object
|
|
57
|
+
var obj = asn1.fromDer(msg.body);
|
|
58
|
+
|
|
59
|
+
return p7.messageFromAsn1(obj);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Converts a PKCS#7 message to PEM format.
|
|
64
|
+
*
|
|
65
|
+
* @param msg The PKCS#7 message object
|
|
66
|
+
* @param maxline The maximum characters per line, defaults to 64.
|
|
67
|
+
*
|
|
68
|
+
* @return The PEM-formatted PKCS#7 message.
|
|
69
|
+
*/
|
|
70
|
+
p7.messageToPem = function(msg, maxline) {
|
|
71
|
+
// convert to ASN.1, then DER, then PEM-encode
|
|
72
|
+
var pemObj = {
|
|
73
|
+
type: 'PKCS7',
|
|
74
|
+
body: asn1.toDer(msg.toAsn1()).getBytes()
|
|
75
|
+
};
|
|
76
|
+
return forge.pem.encode(pemObj, {maxline: maxline});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Converts a PKCS#7 message from an ASN.1 object.
|
|
81
|
+
*
|
|
82
|
+
* @param obj the ASN.1 representation of a ContentInfo.
|
|
83
|
+
*
|
|
84
|
+
* @return the PKCS#7 message.
|
|
85
|
+
*/
|
|
86
|
+
p7.messageFromAsn1 = function(obj) {
|
|
87
|
+
// validate root level ContentInfo and capture data
|
|
88
|
+
var capture = {};
|
|
89
|
+
var errors = [];
|
|
90
|
+
if(!asn1.validate(obj, p7.asn1.contentInfoValidator, capture, errors)) {
|
|
91
|
+
var error = new Error('Cannot read PKCS#7 message. ' +
|
|
92
|
+
'ASN.1 object is not an PKCS#7 ContentInfo.');
|
|
93
|
+
error.errors = errors;
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
var contentType = asn1.derToOid(capture.contentType);
|
|
98
|
+
var msg;
|
|
99
|
+
|
|
100
|
+
switch(contentType) {
|
|
101
|
+
case forge.pki.oids.envelopedData:
|
|
102
|
+
msg = p7.createEnvelopedData();
|
|
103
|
+
break;
|
|
104
|
+
|
|
105
|
+
case forge.pki.oids.encryptedData:
|
|
106
|
+
msg = p7.createEncryptedData();
|
|
107
|
+
break;
|
|
108
|
+
|
|
109
|
+
case forge.pki.oids.signedData:
|
|
110
|
+
msg = p7.createSignedData();
|
|
111
|
+
break;
|
|
112
|
+
|
|
113
|
+
default:
|
|
114
|
+
throw new Error('Cannot read PKCS#7 message. ContentType with OID ' +
|
|
115
|
+
contentType + ' is not (yet) supported.');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
msg.fromAsn1(capture.content.value[0]);
|
|
119
|
+
return msg;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
p7.createSignedData = function() {
|
|
123
|
+
var msg = null;
|
|
124
|
+
msg = {
|
|
125
|
+
type: forge.pki.oids.signedData,
|
|
126
|
+
version: 1,
|
|
127
|
+
certificates: [],
|
|
128
|
+
crls: [],
|
|
129
|
+
// TODO: add json-formatted signer stuff here?
|
|
130
|
+
signers: [],
|
|
131
|
+
// populated during sign()
|
|
132
|
+
digestAlgorithmIdentifiers: [],
|
|
133
|
+
contentInfo: null,
|
|
134
|
+
signerInfos: [],
|
|
135
|
+
|
|
136
|
+
fromAsn1: function(obj) {
|
|
137
|
+
// validate SignedData content block and capture data.
|
|
138
|
+
_fromAsn1(msg, obj, p7.asn1.signedDataValidator);
|
|
139
|
+
msg.certificates = [];
|
|
140
|
+
msg.crls = [];
|
|
141
|
+
msg.digestAlgorithmIdentifiers = [];
|
|
142
|
+
msg.contentInfo = null;
|
|
143
|
+
msg.signerInfos = [];
|
|
144
|
+
|
|
145
|
+
if(msg.rawCapture.certificates) {
|
|
146
|
+
var certs = msg.rawCapture.certificates.value;
|
|
147
|
+
for(var i = 0; i < certs.length; ++i) {
|
|
148
|
+
msg.certificates.push(forge.pki.certificateFromAsn1(certs[i]));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// TODO: parse crls
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
toAsn1: function() {
|
|
156
|
+
// degenerate case with no content
|
|
157
|
+
if(!msg.contentInfo) {
|
|
158
|
+
msg.sign();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
var certs = [];
|
|
162
|
+
for(var i = 0; i < msg.certificates.length; ++i) {
|
|
163
|
+
certs.push(forge.pki.certificateToAsn1(msg.certificates[i]));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
var crls = [];
|
|
167
|
+
// TODO: implement CRLs
|
|
168
|
+
|
|
169
|
+
// [0] SignedData
|
|
170
|
+
var signedData = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [
|
|
171
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
172
|
+
// Version
|
|
173
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
|
|
174
|
+
asn1.integerToDer(msg.version).getBytes()),
|
|
175
|
+
// DigestAlgorithmIdentifiers
|
|
176
|
+
asn1.create(
|
|
177
|
+
asn1.Class.UNIVERSAL, asn1.Type.SET, true,
|
|
178
|
+
msg.digestAlgorithmIdentifiers),
|
|
179
|
+
// ContentInfo
|
|
180
|
+
msg.contentInfo
|
|
181
|
+
])
|
|
182
|
+
]);
|
|
183
|
+
if(certs.length > 0) {
|
|
184
|
+
// [0] IMPLICIT ExtendedCertificatesAndCertificates OPTIONAL
|
|
185
|
+
signedData.value[0].value.push(
|
|
186
|
+
asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, certs));
|
|
187
|
+
}
|
|
188
|
+
if(crls.length > 0) {
|
|
189
|
+
// [1] IMPLICIT CertificateRevocationLists OPTIONAL
|
|
190
|
+
signedData.value[0].value.push(
|
|
191
|
+
asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, crls));
|
|
192
|
+
}
|
|
193
|
+
// SignerInfos
|
|
194
|
+
signedData.value[0].value.push(
|
|
195
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true,
|
|
196
|
+
msg.signerInfos));
|
|
197
|
+
|
|
198
|
+
// ContentInfo
|
|
199
|
+
return asn1.create(
|
|
200
|
+
asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
201
|
+
// ContentType
|
|
202
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
|
|
203
|
+
asn1.oidToDer(msg.type).getBytes()),
|
|
204
|
+
// [0] SignedData
|
|
205
|
+
signedData
|
|
206
|
+
]);
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Add (another) entity to list of signers.
|
|
211
|
+
*
|
|
212
|
+
* Note: If authenticatedAttributes are provided, then, per RFC 2315,
|
|
213
|
+
* they must include at least two attributes: content type and
|
|
214
|
+
* message digest. The message digest attribute value will be
|
|
215
|
+
* auto-calculated during signing and will be ignored if provided.
|
|
216
|
+
*
|
|
217
|
+
* Here's an example of providing these two attributes:
|
|
218
|
+
*
|
|
219
|
+
* forge.pkcs7.createSignedData();
|
|
220
|
+
* p7.addSigner({
|
|
221
|
+
* issuer: cert.issuer.attributes,
|
|
222
|
+
* serialNumber: cert.serialNumber,
|
|
223
|
+
* key: privateKey,
|
|
224
|
+
* digestAlgorithm: forge.pki.oids.sha1,
|
|
225
|
+
* authenticatedAttributes: [{
|
|
226
|
+
* type: forge.pki.oids.contentType,
|
|
227
|
+
* value: forge.pki.oids.data
|
|
228
|
+
* }, {
|
|
229
|
+
* type: forge.pki.oids.messageDigest
|
|
230
|
+
* }]
|
|
231
|
+
* });
|
|
232
|
+
*
|
|
233
|
+
* TODO: Support [subjectKeyIdentifier] as signer's ID.
|
|
234
|
+
*
|
|
235
|
+
* @param signer the signer information:
|
|
236
|
+
* key the signer's private key.
|
|
237
|
+
* [certificate] a certificate containing the public key
|
|
238
|
+
* associated with the signer's private key; use this option as
|
|
239
|
+
* an alternative to specifying signer.issuer and
|
|
240
|
+
* signer.serialNumber.
|
|
241
|
+
* [issuer] the issuer attributes (eg: cert.issuer.attributes).
|
|
242
|
+
* [serialNumber] the signer's certificate's serial number in
|
|
243
|
+
* hexadecimal (eg: cert.serialNumber).
|
|
244
|
+
* [digestAlgorithm] the message digest OID, as a string, to use
|
|
245
|
+
* (eg: forge.pki.oids.sha1).
|
|
246
|
+
* [authenticatedAttributes] an optional array of attributes
|
|
247
|
+
* to also sign along with the content.
|
|
248
|
+
*/
|
|
249
|
+
addSigner: function(signer) {
|
|
250
|
+
var issuer = signer.issuer;
|
|
251
|
+
var serialNumber = signer.serialNumber;
|
|
252
|
+
if(signer.certificate) {
|
|
253
|
+
var cert = signer.certificate;
|
|
254
|
+
if(typeof cert === 'string') {
|
|
255
|
+
cert = forge.pki.certificateFromPem(cert);
|
|
256
|
+
}
|
|
257
|
+
issuer = cert.issuer.attributes;
|
|
258
|
+
serialNumber = cert.serialNumber;
|
|
259
|
+
}
|
|
260
|
+
var key = signer.key;
|
|
261
|
+
if(!key) {
|
|
262
|
+
throw new Error(
|
|
263
|
+
'Could not add PKCS#7 signer; no private key specified.');
|
|
264
|
+
}
|
|
265
|
+
if(typeof key === 'string') {
|
|
266
|
+
key = forge.pki.privateKeyFromPem(key);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// ensure OID known for digest algorithm
|
|
270
|
+
var digestAlgorithm = signer.digestAlgorithm || forge.pki.oids.sha1;
|
|
271
|
+
switch(digestAlgorithm) {
|
|
272
|
+
case forge.pki.oids.sha1:
|
|
273
|
+
case forge.pki.oids.sha256:
|
|
274
|
+
case forge.pki.oids.sha384:
|
|
275
|
+
case forge.pki.oids.sha512:
|
|
276
|
+
case forge.pki.oids.md5:
|
|
277
|
+
break;
|
|
278
|
+
default:
|
|
279
|
+
throw new Error(
|
|
280
|
+
'Could not add PKCS#7 signer; unknown message digest algorithm: ' +
|
|
281
|
+
digestAlgorithm);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// if authenticatedAttributes is present, then the attributes
|
|
285
|
+
// must contain at least PKCS #9 content-type and message-digest
|
|
286
|
+
var authenticatedAttributes = signer.authenticatedAttributes || [];
|
|
287
|
+
if(authenticatedAttributes.length > 0) {
|
|
288
|
+
var contentType = false;
|
|
289
|
+
var messageDigest = false;
|
|
290
|
+
for(var i = 0; i < authenticatedAttributes.length; ++i) {
|
|
291
|
+
var attr = authenticatedAttributes[i];
|
|
292
|
+
if(!contentType && attr.type === forge.pki.oids.contentType) {
|
|
293
|
+
contentType = true;
|
|
294
|
+
if(messageDigest) {
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if(!messageDigest && attr.type === forge.pki.oids.messageDigest) {
|
|
300
|
+
messageDigest = true;
|
|
301
|
+
if(contentType) {
|
|
302
|
+
break;
|
|
303
|
+
}
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if(!contentType || !messageDigest) {
|
|
309
|
+
throw new Error('Invalid signer.authenticatedAttributes. If ' +
|
|
310
|
+
'signer.authenticatedAttributes is specified, then it must ' +
|
|
311
|
+
'contain at least two attributes, PKCS #9 content-type and ' +
|
|
312
|
+
'PKCS #9 message-digest.');
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
msg.signers.push({
|
|
317
|
+
key: key,
|
|
318
|
+
version: 1,
|
|
319
|
+
issuer: issuer,
|
|
320
|
+
serialNumber: serialNumber,
|
|
321
|
+
digestAlgorithm: digestAlgorithm,
|
|
322
|
+
signatureAlgorithm: forge.pki.oids.rsaEncryption,
|
|
323
|
+
signature: null,
|
|
324
|
+
authenticatedAttributes: authenticatedAttributes,
|
|
325
|
+
unauthenticatedAttributes: []
|
|
326
|
+
});
|
|
327
|
+
},
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Signs the content.
|
|
331
|
+
* @param options Options to apply when signing:
|
|
332
|
+
* [detached] boolean. If signing should be done in detached mode. Defaults to false.
|
|
333
|
+
*/
|
|
334
|
+
sign: function(options) {
|
|
335
|
+
options = options || {};
|
|
336
|
+
// auto-generate content info
|
|
337
|
+
if(typeof msg.content !== 'object' || msg.contentInfo === null) {
|
|
338
|
+
// use Data ContentInfo
|
|
339
|
+
msg.contentInfo = asn1.create(
|
|
340
|
+
asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
341
|
+
// ContentType
|
|
342
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
|
|
343
|
+
asn1.oidToDer(forge.pki.oids.data).getBytes())
|
|
344
|
+
]);
|
|
345
|
+
|
|
346
|
+
// add actual content, if present
|
|
347
|
+
if('content' in msg) {
|
|
348
|
+
var content;
|
|
349
|
+
if(msg.content instanceof forge.util.ByteBuffer) {
|
|
350
|
+
content = msg.content.bytes();
|
|
351
|
+
} else if(typeof msg.content === 'string') {
|
|
352
|
+
content = forge.util.encodeUtf8(msg.content);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
if (options.detached) {
|
|
356
|
+
msg.detachedContent = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, content);
|
|
357
|
+
} else {
|
|
358
|
+
msg.contentInfo.value.push(
|
|
359
|
+
// [0] EXPLICIT content
|
|
360
|
+
asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [
|
|
361
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
|
|
362
|
+
content)
|
|
363
|
+
]));
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// no signers, return early (degenerate case for certificate container)
|
|
369
|
+
if(msg.signers.length === 0) {
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// generate digest algorithm identifiers
|
|
374
|
+
var mds = addDigestAlgorithmIds();
|
|
375
|
+
|
|
376
|
+
// generate signerInfos
|
|
377
|
+
addSignerInfos(mds);
|
|
378
|
+
},
|
|
379
|
+
|
|
380
|
+
verify: function() {
|
|
381
|
+
throw new Error('PKCS#7 signature verification not yet implemented.');
|
|
382
|
+
},
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Add a certificate.
|
|
386
|
+
*
|
|
387
|
+
* @param cert the certificate to add.
|
|
388
|
+
*/
|
|
389
|
+
addCertificate: function(cert) {
|
|
390
|
+
// convert from PEM
|
|
391
|
+
if(typeof cert === 'string') {
|
|
392
|
+
cert = forge.pki.certificateFromPem(cert);
|
|
393
|
+
}
|
|
394
|
+
msg.certificates.push(cert);
|
|
395
|
+
},
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Add a certificate revokation list.
|
|
399
|
+
*
|
|
400
|
+
* @param crl the certificate revokation list to add.
|
|
401
|
+
*/
|
|
402
|
+
addCertificateRevokationList: function(crl) {
|
|
403
|
+
throw new Error('PKCS#7 CRL support not yet implemented.');
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
return msg;
|
|
407
|
+
|
|
408
|
+
function addDigestAlgorithmIds() {
|
|
409
|
+
var mds = {};
|
|
410
|
+
|
|
411
|
+
for(var i = 0; i < msg.signers.length; ++i) {
|
|
412
|
+
var signer = msg.signers[i];
|
|
413
|
+
var oid = signer.digestAlgorithm;
|
|
414
|
+
if(!(oid in mds)) {
|
|
415
|
+
// content digest
|
|
416
|
+
mds[oid] = forge.md[forge.pki.oids[oid]].create();
|
|
417
|
+
}
|
|
418
|
+
if(signer.authenticatedAttributes.length === 0) {
|
|
419
|
+
// no custom attributes to digest; use content message digest
|
|
420
|
+
signer.md = mds[oid];
|
|
421
|
+
} else {
|
|
422
|
+
// custom attributes to be digested; use own message digest
|
|
423
|
+
// TODO: optimize to just copy message digest state if that
|
|
424
|
+
// feature is ever supported with message digests
|
|
425
|
+
signer.md = forge.md[forge.pki.oids[oid]].create();
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// add unique digest algorithm identifiers
|
|
430
|
+
msg.digestAlgorithmIdentifiers = [];
|
|
431
|
+
for(var oid in mds) {
|
|
432
|
+
msg.digestAlgorithmIdentifiers.push(
|
|
433
|
+
// AlgorithmIdentifier
|
|
434
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
435
|
+
// algorithm
|
|
436
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
|
|
437
|
+
asn1.oidToDer(oid).getBytes()),
|
|
438
|
+
// parameters (null)
|
|
439
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')
|
|
440
|
+
]));
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
return mds;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
function addSignerInfos(mds) {
|
|
447
|
+
var content;
|
|
448
|
+
|
|
449
|
+
if (msg.detachedContent) {
|
|
450
|
+
// Signature has been made in detached mode.
|
|
451
|
+
content = msg.detachedContent;
|
|
452
|
+
} else {
|
|
453
|
+
// Note: ContentInfo is a SEQUENCE with 2 values, second value is
|
|
454
|
+
// the content field and is optional for a ContentInfo but required here
|
|
455
|
+
// since signers are present
|
|
456
|
+
// get ContentInfo content
|
|
457
|
+
content = msg.contentInfo.value[1];
|
|
458
|
+
// skip [0] EXPLICIT content wrapper
|
|
459
|
+
content = content.value[0];
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
if(!content) {
|
|
463
|
+
throw new Error(
|
|
464
|
+
'Could not sign PKCS#7 message; there is no content to sign.');
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// get ContentInfo content type
|
|
468
|
+
var contentType = asn1.derToOid(msg.contentInfo.value[0].value);
|
|
469
|
+
|
|
470
|
+
// serialize content
|
|
471
|
+
var bytes = asn1.toDer(content);
|
|
472
|
+
|
|
473
|
+
// skip identifier and length per RFC 2315 9.3
|
|
474
|
+
// skip identifier (1 byte)
|
|
475
|
+
bytes.getByte();
|
|
476
|
+
// read and discard length bytes
|
|
477
|
+
asn1.getBerValueLength(bytes);
|
|
478
|
+
bytes = bytes.getBytes();
|
|
479
|
+
|
|
480
|
+
// digest content DER value bytes
|
|
481
|
+
for(var oid in mds) {
|
|
482
|
+
mds[oid].start().update(bytes);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// sign content
|
|
486
|
+
var signingTime = new Date();
|
|
487
|
+
for(var i = 0; i < msg.signers.length; ++i) {
|
|
488
|
+
var signer = msg.signers[i];
|
|
489
|
+
|
|
490
|
+
if(signer.authenticatedAttributes.length === 0) {
|
|
491
|
+
// if ContentInfo content type is not "Data", then
|
|
492
|
+
// authenticatedAttributes must be present per RFC 2315
|
|
493
|
+
if(contentType !== forge.pki.oids.data) {
|
|
494
|
+
throw new Error(
|
|
495
|
+
'Invalid signer; authenticatedAttributes must be present ' +
|
|
496
|
+
'when the ContentInfo content type is not PKCS#7 Data.');
|
|
497
|
+
}
|
|
498
|
+
} else {
|
|
499
|
+
// process authenticated attributes
|
|
500
|
+
// [0] IMPLICIT
|
|
501
|
+
signer.authenticatedAttributesAsn1 = asn1.create(
|
|
502
|
+
asn1.Class.CONTEXT_SPECIFIC, 0, true, []);
|
|
503
|
+
|
|
504
|
+
// per RFC 2315, attributes are to be digested using a SET container
|
|
505
|
+
// not the above [0] IMPLICIT container
|
|
506
|
+
var attrsAsn1 = asn1.create(
|
|
507
|
+
asn1.Class.UNIVERSAL, asn1.Type.SET, true, []);
|
|
508
|
+
|
|
509
|
+
for(var ai = 0; ai < signer.authenticatedAttributes.length; ++ai) {
|
|
510
|
+
var attr = signer.authenticatedAttributes[ai];
|
|
511
|
+
if(attr.type === forge.pki.oids.messageDigest) {
|
|
512
|
+
// use content message digest as value
|
|
513
|
+
attr.value = mds[signer.digestAlgorithm].digest();
|
|
514
|
+
} else if(attr.type === forge.pki.oids.signingTime) {
|
|
515
|
+
// auto-populate signing time if not already set
|
|
516
|
+
if(!attr.value) {
|
|
517
|
+
attr.value = signingTime;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// convert to ASN.1 and push onto Attributes SET (for signing) and
|
|
522
|
+
// onto authenticatedAttributesAsn1 to complete SignedData ASN.1
|
|
523
|
+
// TODO: optimize away duplication
|
|
524
|
+
attrsAsn1.value.push(_attributeToAsn1(attr));
|
|
525
|
+
signer.authenticatedAttributesAsn1.value.push(_attributeToAsn1(attr));
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
// DER-serialize and digest SET OF attributes only
|
|
529
|
+
bytes = asn1.toDer(attrsAsn1).getBytes();
|
|
530
|
+
signer.md.start().update(bytes);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// sign digest
|
|
534
|
+
signer.signature = signer.key.sign(signer.md, 'RSASSA-PKCS1-V1_5');
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// add signer info
|
|
538
|
+
msg.signerInfos = _signersToAsn1(msg.signers);
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Creates an empty PKCS#7 message of type EncryptedData.
|
|
544
|
+
*
|
|
545
|
+
* @return the message.
|
|
546
|
+
*/
|
|
547
|
+
p7.createEncryptedData = function() {
|
|
548
|
+
var msg = null;
|
|
549
|
+
msg = {
|
|
550
|
+
type: forge.pki.oids.encryptedData,
|
|
551
|
+
version: 0,
|
|
552
|
+
encryptedContent: {
|
|
553
|
+
algorithm: forge.pki.oids['aes256-CBC']
|
|
554
|
+
},
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* Reads an EncryptedData content block (in ASN.1 format)
|
|
558
|
+
*
|
|
559
|
+
* @param obj The ASN.1 representation of the EncryptedData content block
|
|
560
|
+
*/
|
|
561
|
+
fromAsn1: function(obj) {
|
|
562
|
+
// Validate EncryptedData content block and capture data.
|
|
563
|
+
_fromAsn1(msg, obj, p7.asn1.encryptedDataValidator);
|
|
564
|
+
},
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Decrypt encrypted content
|
|
568
|
+
*
|
|
569
|
+
* @param key The (symmetric) key as a byte buffer
|
|
570
|
+
*/
|
|
571
|
+
decrypt: function(key) {
|
|
572
|
+
if(key !== undefined) {
|
|
573
|
+
msg.encryptedContent.key = key;
|
|
574
|
+
}
|
|
575
|
+
_decryptContent(msg);
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
return msg;
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Creates an empty PKCS#7 message of type EnvelopedData.
|
|
583
|
+
*
|
|
584
|
+
* @return the message.
|
|
585
|
+
*/
|
|
586
|
+
p7.createEnvelopedData = function() {
|
|
587
|
+
var msg = null;
|
|
588
|
+
msg = {
|
|
589
|
+
type: forge.pki.oids.envelopedData,
|
|
590
|
+
version: 0,
|
|
591
|
+
recipients: [],
|
|
592
|
+
encryptedContent: {
|
|
593
|
+
algorithm: forge.pki.oids['aes256-CBC']
|
|
594
|
+
},
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Reads an EnvelopedData content block (in ASN.1 format)
|
|
598
|
+
*
|
|
599
|
+
* @param obj the ASN.1 representation of the EnvelopedData content block.
|
|
600
|
+
*/
|
|
601
|
+
fromAsn1: function(obj) {
|
|
602
|
+
// validate EnvelopedData content block and capture data
|
|
603
|
+
var capture = _fromAsn1(msg, obj, p7.asn1.envelopedDataValidator);
|
|
604
|
+
msg.recipients = _recipientsFromAsn1(capture.recipientInfos.value);
|
|
605
|
+
},
|
|
606
|
+
|
|
607
|
+
toAsn1: function() {
|
|
608
|
+
// ContentInfo
|
|
609
|
+
return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
610
|
+
// ContentType
|
|
611
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
|
|
612
|
+
asn1.oidToDer(msg.type).getBytes()),
|
|
613
|
+
// [0] EnvelopedData
|
|
614
|
+
asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [
|
|
615
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
616
|
+
// Version
|
|
617
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
|
|
618
|
+
asn1.integerToDer(msg.version).getBytes()),
|
|
619
|
+
// RecipientInfos
|
|
620
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true,
|
|
621
|
+
_recipientsToAsn1(msg.recipients)),
|
|
622
|
+
// EncryptedContentInfo
|
|
623
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true,
|
|
624
|
+
_encryptedContentToAsn1(msg.encryptedContent))
|
|
625
|
+
])
|
|
626
|
+
])
|
|
627
|
+
]);
|
|
628
|
+
},
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Find recipient by X.509 certificate's issuer.
|
|
632
|
+
*
|
|
633
|
+
* @param cert the certificate with the issuer to look for.
|
|
634
|
+
*
|
|
635
|
+
* @return the recipient object.
|
|
636
|
+
*/
|
|
637
|
+
findRecipient: function(cert) {
|
|
638
|
+
var sAttr = cert.issuer.attributes;
|
|
639
|
+
|
|
640
|
+
for(var i = 0; i < msg.recipients.length; ++i) {
|
|
641
|
+
var r = msg.recipients[i];
|
|
642
|
+
var rAttr = r.issuer;
|
|
643
|
+
|
|
644
|
+
if(r.serialNumber !== cert.serialNumber) {
|
|
645
|
+
continue;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if(rAttr.length !== sAttr.length) {
|
|
649
|
+
continue;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
var match = true;
|
|
653
|
+
for(var j = 0; j < sAttr.length; ++j) {
|
|
654
|
+
if(rAttr[j].type !== sAttr[j].type ||
|
|
655
|
+
rAttr[j].value !== sAttr[j].value) {
|
|
656
|
+
match = false;
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
if(match) {
|
|
662
|
+
return r;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
return null;
|
|
667
|
+
},
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Decrypt enveloped content
|
|
671
|
+
*
|
|
672
|
+
* @param recipient The recipient object related to the private key
|
|
673
|
+
* @param privKey The (RSA) private key object
|
|
674
|
+
*/
|
|
675
|
+
decrypt: function(recipient, privKey) {
|
|
676
|
+
if(msg.encryptedContent.key === undefined && recipient !== undefined &&
|
|
677
|
+
privKey !== undefined) {
|
|
678
|
+
switch(recipient.encryptedContent.algorithm) {
|
|
679
|
+
case forge.pki.oids.rsaEncryption:
|
|
680
|
+
case forge.pki.oids.desCBC:
|
|
681
|
+
var key = privKey.decrypt(recipient.encryptedContent.content);
|
|
682
|
+
msg.encryptedContent.key = forge.util.createBuffer(key);
|
|
683
|
+
break;
|
|
684
|
+
|
|
685
|
+
default:
|
|
686
|
+
throw new Error('Unsupported asymmetric cipher, ' +
|
|
687
|
+
'OID ' + recipient.encryptedContent.algorithm);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
_decryptContent(msg);
|
|
692
|
+
},
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* Add (another) entity to list of recipients.
|
|
696
|
+
*
|
|
697
|
+
* @param cert The certificate of the entity to add.
|
|
698
|
+
*/
|
|
699
|
+
addRecipient: function(cert) {
|
|
700
|
+
msg.recipients.push({
|
|
701
|
+
version: 0,
|
|
702
|
+
issuer: cert.issuer.attributes,
|
|
703
|
+
serialNumber: cert.serialNumber,
|
|
704
|
+
encryptedContent: {
|
|
705
|
+
// We simply assume rsaEncryption here, since forge.pki only
|
|
706
|
+
// supports RSA so far. If the PKI module supports other
|
|
707
|
+
// ciphers one day, we need to modify this one as well.
|
|
708
|
+
algorithm: forge.pki.oids.rsaEncryption,
|
|
709
|
+
key: cert.publicKey
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
},
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* Encrypt enveloped content.
|
|
716
|
+
*
|
|
717
|
+
* This function supports two optional arguments, cipher and key, which
|
|
718
|
+
* can be used to influence symmetric encryption. Unless cipher is
|
|
719
|
+
* provided, the cipher specified in encryptedContent.algorithm is used
|
|
720
|
+
* (defaults to AES-256-CBC). If no key is provided, encryptedContent.key
|
|
721
|
+
* is (re-)used. If that one's not set, a random key will be generated
|
|
722
|
+
* automatically.
|
|
723
|
+
*
|
|
724
|
+
* @param [key] The key to be used for symmetric encryption.
|
|
725
|
+
* @param [cipher] The OID of the symmetric cipher to use.
|
|
726
|
+
*/
|
|
727
|
+
encrypt: function(key, cipher) {
|
|
728
|
+
// Part 1: Symmetric encryption
|
|
729
|
+
if(msg.encryptedContent.content === undefined) {
|
|
730
|
+
cipher = cipher || msg.encryptedContent.algorithm;
|
|
731
|
+
key = key || msg.encryptedContent.key;
|
|
732
|
+
|
|
733
|
+
var keyLen, ivLen, ciphFn;
|
|
734
|
+
switch(cipher) {
|
|
735
|
+
case forge.pki.oids['aes128-CBC']:
|
|
736
|
+
keyLen = 16;
|
|
737
|
+
ivLen = 16;
|
|
738
|
+
ciphFn = forge.aes.createEncryptionCipher;
|
|
739
|
+
break;
|
|
740
|
+
|
|
741
|
+
case forge.pki.oids['aes192-CBC']:
|
|
742
|
+
keyLen = 24;
|
|
743
|
+
ivLen = 16;
|
|
744
|
+
ciphFn = forge.aes.createEncryptionCipher;
|
|
745
|
+
break;
|
|
746
|
+
|
|
747
|
+
case forge.pki.oids['aes256-CBC']:
|
|
748
|
+
keyLen = 32;
|
|
749
|
+
ivLen = 16;
|
|
750
|
+
ciphFn = forge.aes.createEncryptionCipher;
|
|
751
|
+
break;
|
|
752
|
+
|
|
753
|
+
case forge.pki.oids['des-EDE3-CBC']:
|
|
754
|
+
keyLen = 24;
|
|
755
|
+
ivLen = 8;
|
|
756
|
+
ciphFn = forge.des.createEncryptionCipher;
|
|
757
|
+
break;
|
|
758
|
+
|
|
759
|
+
default:
|
|
760
|
+
throw new Error('Unsupported symmetric cipher, OID ' + cipher);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
if(key === undefined) {
|
|
764
|
+
key = forge.util.createBuffer(forge.random.getBytes(keyLen));
|
|
765
|
+
} else if(key.length() != keyLen) {
|
|
766
|
+
throw new Error('Symmetric key has wrong length; ' +
|
|
767
|
+
'got ' + key.length() + ' bytes, expected ' + keyLen + '.');
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
// Keep a copy of the key & IV in the object, so the caller can
|
|
771
|
+
// use it for whatever reason.
|
|
772
|
+
msg.encryptedContent.algorithm = cipher;
|
|
773
|
+
msg.encryptedContent.key = key;
|
|
774
|
+
msg.encryptedContent.parameter = forge.util.createBuffer(
|
|
775
|
+
forge.random.getBytes(ivLen));
|
|
776
|
+
|
|
777
|
+
var ciph = ciphFn(key);
|
|
778
|
+
ciph.start(msg.encryptedContent.parameter.copy());
|
|
779
|
+
ciph.update(msg.content);
|
|
780
|
+
|
|
781
|
+
// The finish function does PKCS#7 padding by default, therefore
|
|
782
|
+
// no action required by us.
|
|
783
|
+
if(!ciph.finish()) {
|
|
784
|
+
throw new Error('Symmetric encryption failed.');
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
msg.encryptedContent.content = ciph.output;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
// Part 2: asymmetric encryption for each recipient
|
|
791
|
+
for(var i = 0; i < msg.recipients.length; ++i) {
|
|
792
|
+
var recipient = msg.recipients[i];
|
|
793
|
+
|
|
794
|
+
// Nothing to do, encryption already done.
|
|
795
|
+
if(recipient.encryptedContent.content !== undefined) {
|
|
796
|
+
continue;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
switch(recipient.encryptedContent.algorithm) {
|
|
800
|
+
case forge.pki.oids.rsaEncryption:
|
|
801
|
+
recipient.encryptedContent.content =
|
|
802
|
+
recipient.encryptedContent.key.encrypt(
|
|
803
|
+
msg.encryptedContent.key.data);
|
|
804
|
+
break;
|
|
805
|
+
|
|
806
|
+
default:
|
|
807
|
+
throw new Error('Unsupported asymmetric cipher, OID ' +
|
|
808
|
+
recipient.encryptedContent.algorithm);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
return msg;
|
|
814
|
+
};
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Converts a single recipient from an ASN.1 object.
|
|
818
|
+
*
|
|
819
|
+
* @param obj the ASN.1 RecipientInfo.
|
|
820
|
+
*
|
|
821
|
+
* @return the recipient object.
|
|
822
|
+
*/
|
|
823
|
+
function _recipientFromAsn1(obj) {
|
|
824
|
+
// validate EnvelopedData content block and capture data
|
|
825
|
+
var capture = {};
|
|
826
|
+
var errors = [];
|
|
827
|
+
if(!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) {
|
|
828
|
+
var error = new Error('Cannot read PKCS#7 RecipientInfo. ' +
|
|
829
|
+
'ASN.1 object is not an PKCS#7 RecipientInfo.');
|
|
830
|
+
error.errors = errors;
|
|
831
|
+
throw error;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
return {
|
|
835
|
+
version: capture.version.charCodeAt(0),
|
|
836
|
+
issuer: forge.pki.RDNAttributesAsArray(capture.issuer),
|
|
837
|
+
serialNumber: forge.util.createBuffer(capture.serial).toHex(),
|
|
838
|
+
encryptedContent: {
|
|
839
|
+
algorithm: asn1.derToOid(capture.encAlgorithm),
|
|
840
|
+
parameter: capture.encParameter ? capture.encParameter.value : undefined,
|
|
841
|
+
content: capture.encKey
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Converts a single recipient object to an ASN.1 object.
|
|
848
|
+
*
|
|
849
|
+
* @param obj the recipient object.
|
|
850
|
+
*
|
|
851
|
+
* @return the ASN.1 RecipientInfo.
|
|
852
|
+
*/
|
|
853
|
+
function _recipientToAsn1(obj) {
|
|
854
|
+
return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
855
|
+
// Version
|
|
856
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
|
|
857
|
+
asn1.integerToDer(obj.version).getBytes()),
|
|
858
|
+
// IssuerAndSerialNumber
|
|
859
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
860
|
+
// Name
|
|
861
|
+
forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),
|
|
862
|
+
// Serial
|
|
863
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
|
|
864
|
+
forge.util.hexToBytes(obj.serialNumber))
|
|
865
|
+
]),
|
|
866
|
+
// KeyEncryptionAlgorithmIdentifier
|
|
867
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
868
|
+
// Algorithm
|
|
869
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
|
|
870
|
+
asn1.oidToDer(obj.encryptedContent.algorithm).getBytes()),
|
|
871
|
+
// Parameter, force NULL, only RSA supported for now.
|
|
872
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')
|
|
873
|
+
]),
|
|
874
|
+
// EncryptedKey
|
|
875
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
|
|
876
|
+
obj.encryptedContent.content)
|
|
877
|
+
]);
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* Map a set of RecipientInfo ASN.1 objects to recipient objects.
|
|
882
|
+
*
|
|
883
|
+
* @param infos an array of ASN.1 representations RecipientInfo (i.e. SET OF).
|
|
884
|
+
*
|
|
885
|
+
* @return an array of recipient objects.
|
|
886
|
+
*/
|
|
887
|
+
function _recipientsFromAsn1(infos) {
|
|
888
|
+
var ret = [];
|
|
889
|
+
for(var i = 0; i < infos.length; ++i) {
|
|
890
|
+
ret.push(_recipientFromAsn1(infos[i]));
|
|
891
|
+
}
|
|
892
|
+
return ret;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* Map an array of recipient objects to ASN.1 RecipientInfo objects.
|
|
897
|
+
*
|
|
898
|
+
* @param recipients an array of recipientInfo objects.
|
|
899
|
+
*
|
|
900
|
+
* @return an array of ASN.1 RecipientInfos.
|
|
901
|
+
*/
|
|
902
|
+
function _recipientsToAsn1(recipients) {
|
|
903
|
+
var ret = [];
|
|
904
|
+
for(var i = 0; i < recipients.length; ++i) {
|
|
905
|
+
ret.push(_recipientToAsn1(recipients[i]));
|
|
906
|
+
}
|
|
907
|
+
return ret;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* Converts a single signer from an ASN.1 object.
|
|
912
|
+
*
|
|
913
|
+
* @param obj the ASN.1 representation of a SignerInfo.
|
|
914
|
+
*
|
|
915
|
+
* @return the signer object.
|
|
916
|
+
*/
|
|
917
|
+
function _signerFromAsn1(obj) {
|
|
918
|
+
// validate EnvelopedData content block and capture data
|
|
919
|
+
var capture = {};
|
|
920
|
+
var errors = [];
|
|
921
|
+
if(!asn1.validate(obj, p7.asn1.signerInfoValidator, capture, errors)) {
|
|
922
|
+
var error = new Error('Cannot read PKCS#7 SignerInfo. ' +
|
|
923
|
+
'ASN.1 object is not an PKCS#7 SignerInfo.');
|
|
924
|
+
error.errors = errors;
|
|
925
|
+
throw error;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
var rval = {
|
|
929
|
+
version: capture.version.charCodeAt(0),
|
|
930
|
+
issuer: forge.pki.RDNAttributesAsArray(capture.issuer),
|
|
931
|
+
serialNumber: forge.util.createBuffer(capture.serial).toHex(),
|
|
932
|
+
digestAlgorithm: asn1.derToOid(capture.digestAlgorithm),
|
|
933
|
+
signatureAlgorithm: asn1.derToOid(capture.signatureAlgorithm),
|
|
934
|
+
signature: capture.signature,
|
|
935
|
+
authenticatedAttributes: [],
|
|
936
|
+
unauthenticatedAttributes: []
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
// TODO: convert attributes
|
|
940
|
+
var authenticatedAttributes = capture.authenticatedAttributes || [];
|
|
941
|
+
var unauthenticatedAttributes = capture.unauthenticatedAttributes || [];
|
|
942
|
+
|
|
943
|
+
return rval;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
/**
|
|
947
|
+
* Converts a single signerInfo object to an ASN.1 object.
|
|
948
|
+
*
|
|
949
|
+
* @param obj the signerInfo object.
|
|
950
|
+
*
|
|
951
|
+
* @return the ASN.1 representation of a SignerInfo.
|
|
952
|
+
*/
|
|
953
|
+
function _signerToAsn1(obj) {
|
|
954
|
+
// SignerInfo
|
|
955
|
+
var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
956
|
+
// version
|
|
957
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
|
|
958
|
+
asn1.integerToDer(obj.version).getBytes()),
|
|
959
|
+
// issuerAndSerialNumber
|
|
960
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
961
|
+
// name
|
|
962
|
+
forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),
|
|
963
|
+
// serial
|
|
964
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,
|
|
965
|
+
forge.util.hexToBytes(obj.serialNumber))
|
|
966
|
+
]),
|
|
967
|
+
// digestAlgorithm
|
|
968
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
969
|
+
// algorithm
|
|
970
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
|
|
971
|
+
asn1.oidToDer(obj.digestAlgorithm).getBytes()),
|
|
972
|
+
// parameters (null)
|
|
973
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')
|
|
974
|
+
])
|
|
975
|
+
]);
|
|
976
|
+
|
|
977
|
+
// authenticatedAttributes (OPTIONAL)
|
|
978
|
+
if(obj.authenticatedAttributesAsn1) {
|
|
979
|
+
// add ASN.1 previously generated during signing
|
|
980
|
+
rval.value.push(obj.authenticatedAttributesAsn1);
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
// digestEncryptionAlgorithm
|
|
984
|
+
rval.value.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
985
|
+
// algorithm
|
|
986
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
|
|
987
|
+
asn1.oidToDer(obj.signatureAlgorithm).getBytes()),
|
|
988
|
+
// parameters (null)
|
|
989
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')
|
|
990
|
+
]));
|
|
991
|
+
|
|
992
|
+
// encryptedDigest
|
|
993
|
+
rval.value.push(asn1.create(
|
|
994
|
+
asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.signature));
|
|
995
|
+
|
|
996
|
+
// unauthenticatedAttributes (OPTIONAL)
|
|
997
|
+
if(obj.unauthenticatedAttributes.length > 0) {
|
|
998
|
+
// [1] IMPLICIT
|
|
999
|
+
var attrsAsn1 = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, []);
|
|
1000
|
+
for(var i = 0; i < obj.unauthenticatedAttributes.length; ++i) {
|
|
1001
|
+
var attr = obj.unauthenticatedAttributes[i];
|
|
1002
|
+
attrsAsn1.values.push(_attributeToAsn1(attr));
|
|
1003
|
+
}
|
|
1004
|
+
rval.value.push(attrsAsn1);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
return rval;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* Map a set of SignerInfo ASN.1 objects to an array of signer objects.
|
|
1012
|
+
*
|
|
1013
|
+
* @param signerInfoAsn1s an array of ASN.1 SignerInfos (i.e. SET OF).
|
|
1014
|
+
*
|
|
1015
|
+
* @return an array of signers objects.
|
|
1016
|
+
*/
|
|
1017
|
+
function _signersFromAsn1(signerInfoAsn1s) {
|
|
1018
|
+
var ret = [];
|
|
1019
|
+
for(var i = 0; i < signerInfoAsn1s.length; ++i) {
|
|
1020
|
+
ret.push(_signerFromAsn1(signerInfoAsn1s[i]));
|
|
1021
|
+
}
|
|
1022
|
+
return ret;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* Map an array of signer objects to ASN.1 objects.
|
|
1027
|
+
*
|
|
1028
|
+
* @param signers an array of signer objects.
|
|
1029
|
+
*
|
|
1030
|
+
* @return an array of ASN.1 SignerInfos.
|
|
1031
|
+
*/
|
|
1032
|
+
function _signersToAsn1(signers) {
|
|
1033
|
+
var ret = [];
|
|
1034
|
+
for(var i = 0; i < signers.length; ++i) {
|
|
1035
|
+
ret.push(_signerToAsn1(signers[i]));
|
|
1036
|
+
}
|
|
1037
|
+
return ret;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Convert an attribute object to an ASN.1 Attribute.
|
|
1042
|
+
*
|
|
1043
|
+
* @param attr the attribute object.
|
|
1044
|
+
*
|
|
1045
|
+
* @return the ASN.1 Attribute.
|
|
1046
|
+
*/
|
|
1047
|
+
function _attributeToAsn1(attr) {
|
|
1048
|
+
var value;
|
|
1049
|
+
|
|
1050
|
+
// TODO: generalize to support more attributes
|
|
1051
|
+
if(attr.type === forge.pki.oids.contentType) {
|
|
1052
|
+
value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
|
|
1053
|
+
asn1.oidToDer(attr.value).getBytes());
|
|
1054
|
+
} else if(attr.type === forge.pki.oids.messageDigest) {
|
|
1055
|
+
value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
|
|
1056
|
+
attr.value.bytes());
|
|
1057
|
+
} else if(attr.type === forge.pki.oids.signingTime) {
|
|
1058
|
+
/* Note per RFC 2985: Dates between 1 January 1950 and 31 December 2049
|
|
1059
|
+
(inclusive) MUST be encoded as UTCTime. Any dates with year values
|
|
1060
|
+
before 1950 or after 2049 MUST be encoded as GeneralizedTime. [Further,]
|
|
1061
|
+
UTCTime values MUST be expressed in Greenwich Mean Time (Zulu) and MUST
|
|
1062
|
+
include seconds (i.e., times are YYMMDDHHMMSSZ), even where the
|
|
1063
|
+
number of seconds is zero. Midnight (GMT) must be represented as
|
|
1064
|
+
"YYMMDD000000Z". */
|
|
1065
|
+
// TODO: make these module-level constants
|
|
1066
|
+
var jan_1_1950 = new Date('1950-01-01T00:00:00Z');
|
|
1067
|
+
var jan_1_2050 = new Date('2050-01-01T00:00:00Z');
|
|
1068
|
+
var date = attr.value;
|
|
1069
|
+
if(typeof date === 'string') {
|
|
1070
|
+
// try to parse date
|
|
1071
|
+
var timestamp = Date.parse(date);
|
|
1072
|
+
if(!isNaN(timestamp)) {
|
|
1073
|
+
date = new Date(timestamp);
|
|
1074
|
+
} else if(date.length === 13) {
|
|
1075
|
+
// YYMMDDHHMMSSZ (13 chars for UTCTime)
|
|
1076
|
+
date = asn1.utcTimeToDate(date);
|
|
1077
|
+
} else {
|
|
1078
|
+
// assume generalized time
|
|
1079
|
+
date = asn1.generalizedTimeToDate(date);
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
if(date >= jan_1_1950 && date < jan_1_2050) {
|
|
1084
|
+
value = asn1.create(
|
|
1085
|
+
asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false,
|
|
1086
|
+
asn1.dateToUtcTime(date));
|
|
1087
|
+
} else {
|
|
1088
|
+
value = asn1.create(
|
|
1089
|
+
asn1.Class.UNIVERSAL, asn1.Type.GENERALIZEDTIME, false,
|
|
1090
|
+
asn1.dateToGeneralizedTime(date));
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
// TODO: expose as common API call
|
|
1095
|
+
// create a RelativeDistinguishedName set
|
|
1096
|
+
// each value in the set is an AttributeTypeAndValue first
|
|
1097
|
+
// containing the type (an OID) and second the value
|
|
1098
|
+
return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
1099
|
+
// AttributeType
|
|
1100
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
|
|
1101
|
+
asn1.oidToDer(attr.type).getBytes()),
|
|
1102
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [
|
|
1103
|
+
// AttributeValue
|
|
1104
|
+
value
|
|
1105
|
+
])
|
|
1106
|
+
]);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* Map messages encrypted content to ASN.1 objects.
|
|
1111
|
+
*
|
|
1112
|
+
* @param ec The encryptedContent object of the message.
|
|
1113
|
+
*
|
|
1114
|
+
* @return ASN.1 representation of the encryptedContent object (SEQUENCE).
|
|
1115
|
+
*/
|
|
1116
|
+
function _encryptedContentToAsn1(ec) {
|
|
1117
|
+
return [
|
|
1118
|
+
// ContentType, always Data for the moment
|
|
1119
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
|
|
1120
|
+
asn1.oidToDer(forge.pki.oids.data).getBytes()),
|
|
1121
|
+
// ContentEncryptionAlgorithmIdentifier
|
|
1122
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
|
|
1123
|
+
// Algorithm
|
|
1124
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
|
|
1125
|
+
asn1.oidToDer(ec.algorithm).getBytes()),
|
|
1126
|
+
// Parameters (IV)
|
|
1127
|
+
!ec.parameter ?
|
|
1128
|
+
undefined :
|
|
1129
|
+
asn1.create(
|
|
1130
|
+
asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
|
|
1131
|
+
ec.parameter.getBytes())
|
|
1132
|
+
]),
|
|
1133
|
+
// [0] EncryptedContent
|
|
1134
|
+
asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [
|
|
1135
|
+
asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
|
|
1136
|
+
ec.content.getBytes())
|
|
1137
|
+
])
|
|
1138
|
+
];
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* Reads the "common part" of an PKCS#7 content block (in ASN.1 format)
|
|
1143
|
+
*
|
|
1144
|
+
* This function reads the "common part" of the PKCS#7 content blocks
|
|
1145
|
+
* EncryptedData and EnvelopedData, i.e. version number and symmetrically
|
|
1146
|
+
* encrypted content block.
|
|
1147
|
+
*
|
|
1148
|
+
* The result of the ASN.1 validate and capture process is returned
|
|
1149
|
+
* to allow the caller to extract further data, e.g. the list of recipients
|
|
1150
|
+
* in case of a EnvelopedData object.
|
|
1151
|
+
*
|
|
1152
|
+
* @param msg the PKCS#7 object to read the data to.
|
|
1153
|
+
* @param obj the ASN.1 representation of the content block.
|
|
1154
|
+
* @param validator the ASN.1 structure validator object to use.
|
|
1155
|
+
*
|
|
1156
|
+
* @return the value map captured by validator object.
|
|
1157
|
+
*/
|
|
1158
|
+
function _fromAsn1(msg, obj, validator) {
|
|
1159
|
+
var capture = {};
|
|
1160
|
+
var errors = [];
|
|
1161
|
+
if(!asn1.validate(obj, validator, capture, errors)) {
|
|
1162
|
+
var error = new Error('Cannot read PKCS#7 message. ' +
|
|
1163
|
+
'ASN.1 object is not a supported PKCS#7 message.');
|
|
1164
|
+
error.errors = error;
|
|
1165
|
+
throw error;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
// Check contentType, so far we only support (raw) Data.
|
|
1169
|
+
var contentType = asn1.derToOid(capture.contentType);
|
|
1170
|
+
if(contentType !== forge.pki.oids.data) {
|
|
1171
|
+
throw new Error('Unsupported PKCS#7 message. ' +
|
|
1172
|
+
'Only wrapped ContentType Data supported.');
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
if(capture.encryptedContent) {
|
|
1176
|
+
var content = '';
|
|
1177
|
+
if(forge.util.isArray(capture.encryptedContent)) {
|
|
1178
|
+
for(var i = 0; i < capture.encryptedContent.length; ++i) {
|
|
1179
|
+
if(capture.encryptedContent[i].type !== asn1.Type.OCTETSTRING) {
|
|
1180
|
+
throw new Error('Malformed PKCS#7 message, expecting encrypted ' +
|
|
1181
|
+
'content constructed of only OCTET STRING objects.');
|
|
1182
|
+
}
|
|
1183
|
+
content += capture.encryptedContent[i].value;
|
|
1184
|
+
}
|
|
1185
|
+
} else {
|
|
1186
|
+
content = capture.encryptedContent;
|
|
1187
|
+
}
|
|
1188
|
+
msg.encryptedContent = {
|
|
1189
|
+
algorithm: asn1.derToOid(capture.encAlgorithm),
|
|
1190
|
+
parameter: forge.util.createBuffer(capture.encParameter.value),
|
|
1191
|
+
content: forge.util.createBuffer(content)
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
if(capture.content) {
|
|
1196
|
+
var content = '';
|
|
1197
|
+
if(forge.util.isArray(capture.content)) {
|
|
1198
|
+
for(var i = 0; i < capture.content.length; ++i) {
|
|
1199
|
+
if(capture.content[i].type !== asn1.Type.OCTETSTRING) {
|
|
1200
|
+
throw new Error('Malformed PKCS#7 message, expecting ' +
|
|
1201
|
+
'content constructed of only OCTET STRING objects.');
|
|
1202
|
+
}
|
|
1203
|
+
content += capture.content[i].value;
|
|
1204
|
+
}
|
|
1205
|
+
} else {
|
|
1206
|
+
content = capture.content;
|
|
1207
|
+
}
|
|
1208
|
+
msg.content = forge.util.createBuffer(content);
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
msg.version = capture.version.charCodeAt(0);
|
|
1212
|
+
msg.rawCapture = capture;
|
|
1213
|
+
|
|
1214
|
+
return capture;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* Decrypt the symmetrically encrypted content block of the PKCS#7 message.
|
|
1219
|
+
*
|
|
1220
|
+
* Decryption is skipped in case the PKCS#7 message object already has a
|
|
1221
|
+
* (decrypted) content attribute. The algorithm, key and cipher parameters
|
|
1222
|
+
* (probably the iv) are taken from the encryptedContent attribute of the
|
|
1223
|
+
* message object.
|
|
1224
|
+
*
|
|
1225
|
+
* @param The PKCS#7 message object.
|
|
1226
|
+
*/
|
|
1227
|
+
function _decryptContent(msg) {
|
|
1228
|
+
if(msg.encryptedContent.key === undefined) {
|
|
1229
|
+
throw new Error('Symmetric key not available.');
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
if(msg.content === undefined) {
|
|
1233
|
+
var ciph;
|
|
1234
|
+
|
|
1235
|
+
switch(msg.encryptedContent.algorithm) {
|
|
1236
|
+
case forge.pki.oids['aes128-CBC']:
|
|
1237
|
+
case forge.pki.oids['aes192-CBC']:
|
|
1238
|
+
case forge.pki.oids['aes256-CBC']:
|
|
1239
|
+
ciph = forge.aes.createDecryptionCipher(msg.encryptedContent.key);
|
|
1240
|
+
break;
|
|
1241
|
+
|
|
1242
|
+
case forge.pki.oids['desCBC']:
|
|
1243
|
+
case forge.pki.oids['des-EDE3-CBC']:
|
|
1244
|
+
ciph = forge.des.createDecryptionCipher(msg.encryptedContent.key);
|
|
1245
|
+
break;
|
|
1246
|
+
|
|
1247
|
+
default:
|
|
1248
|
+
throw new Error('Unsupported symmetric cipher, OID ' +
|
|
1249
|
+
msg.encryptedContent.algorithm);
|
|
1250
|
+
}
|
|
1251
|
+
ciph.start(msg.encryptedContent.parameter);
|
|
1252
|
+
ciph.update(msg.encryptedContent.content);
|
|
1253
|
+
|
|
1254
|
+
if(!ciph.finish()) {
|
|
1255
|
+
throw new Error('Symmetric decryption failed.');
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
msg.content = ciph.output;
|
|
1259
|
+
}
|
|
1260
|
+
}
|