@psnext/slingcli 2.4.20260520-3 → 2.4.20260520-5
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 +9 -6
- package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +5 -5
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +23 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +557 -385
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +13 -82
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +61 -144
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.js +14 -36
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +234 -96
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +85 -55
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +101 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +231 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +42 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +114 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +39 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +3 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.js +50 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +125 -73
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js +86 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +85 -56
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js +103 -18
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +4 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/node.js +3 -0
- package/node_modules/@earendil-works/pi-agent-core/package.json +23 -10
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +11 -3
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +118 -354
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +35 -32
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +5 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +19 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +35 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +24 -10
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.js +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +19 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.js +13 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +6 -4
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js +97 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +3 -1
- package/node_modules/@earendil-works/pi-ai/package.json +15 -20
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli.js +4 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +45 -22
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js +4 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +127 -151
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +25 -15
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.js +17 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.js +48 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +71 -33
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js +6 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +39 -9
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +20 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +2 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +7 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +7 -11
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +7 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/countdown-timer.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/extension-editor.js +14 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/extension-selector.js +6 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +15 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +99 -17
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/dark.json +5 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/light.json +5 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +83 -41
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +62 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.js +52 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js +9 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/html.js +40 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/mime.js +59 -16
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/paths.js +16 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/shell.js +6 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/syntax-highlight.js +118 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/tools-manager.js +80 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/version-check.js +9 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/windows-self-update.js +77 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/LICENSE +21 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Agent.md +84 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/BalancedPool.md +99 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/CacheStorage.md +30 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/CacheStore.md +164 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Client.md +287 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/ClientStats.md +27 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Connector.md +115 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/ContentType.md +57 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Cookies.md +101 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Debug.md +62 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +315 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Dispatcher.md +1427 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +159 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Errors.md +49 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EventSource.md +45 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Fetch.md +60 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/GlobalInstallation.md +141 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/H2CClient.md +263 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/MockAgent.md +603 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/MockCallHistory.md +197 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +43 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/MockClient.md +81 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/MockErrors.md +12 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/MockPool.md +555 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Pool.md +84 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/PoolStats.md +35 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/ProxyAgent.md +229 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/RedirectHandler.md +98 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/RetryAgent.md +49 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/RetryHandler.md +116 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/RoundRobinPool.md +145 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/SnapshotAgent.md +639 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +274 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Util.md +25 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/WebSocket.md +141 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/api-lifecycle.md +91 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/best-practices/client-certificate.md +64 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/best-practices/crawling.md +58 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +231 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/best-practices/mocking-request.md +190 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/best-practices/proxy.md +127 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +224 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/best-practices/writing-tests.md +63 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/index-fetch.js +65 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/index.js +236 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/abort-signal.js +59 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/api-connect.js +112 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/api-pipeline.js +265 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/api-request.js +238 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/api-stream.js +270 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/api-upgrade.js +121 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/index.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/readable.js +581 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/memory-cache-store.js +234 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/sqlite-cache-store.js +463 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/connect.js +153 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/constants.js +120 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/diagnostics.js +227 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/errors.js +477 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/request.js +535 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/socks5-client.js +422 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/socks5-utils.js +212 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/symbols.js +76 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/tree.js +160 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/util.js +1019 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/agent.js +172 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/balanced-pool.js +214 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h1.js +1669 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h2.js +1326 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client.js +666 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher-base.js +184 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher.js +44 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +107 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +146 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/h2c-client.js +51 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/pool-base.js +232 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/pool.js +143 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/proxy-agent.js +343 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/round-robin-pool.js +159 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +264 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/encoding/index.js +33 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/global.js +62 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/cache-handler.js +586 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/cache-revalidation-handler.js +124 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/decorator-handler.js +66 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/deduplication-handler.js +460 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/redirect-handler.js +192 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/retry-handler.js +407 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/cache.js +508 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/decompress.js +285 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/deduplicate.js +117 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dns.js +571 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dump.js +112 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/redirect.js +21 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/response-error.js +95 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/retry.js +19 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/llhttp/constants.js +531 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/llhttp/utils.js +12 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-agent.js +232 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-call-history.js +248 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-client.js +68 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-errors.js +29 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-interceptor.js +209 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-pool.js +68 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-symbols.js +32 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-utils.js +501 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/snapshot-agent.js +363 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/snapshot-recorder.js +623 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/snapshot-utils.js +158 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/cache.js +408 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/date.js +653 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/runtime-features.js +93 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/stats.js +32 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/timers.js +425 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cache/cache.js +862 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cache/util.js +45 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/constants.js +12 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/index.js +199 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/parse.js +322 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/util.js +282 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource-stream.js +494 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource.js +501 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/util.js +29 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/LICENSE +21 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/body.js +503 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/constants.js +131 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/data-url.js +596 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/formdata-parser.js +586 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/formdata.js +278 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/global.js +40 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/headers.js +719 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/index.js +2403 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/request.js +1115 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/response.js +641 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/util.js +1522 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/infra/index.js +229 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/subresource-integrity/Readme.md +9 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +307 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/webidl/index.js +1004 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/connection.js +329 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/constants.js +126 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/events.js +331 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/frame.js +127 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/permessage-deflate.js +100 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/receiver.js +490 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/sender.js +109 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketerror.js +104 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketstream.js +491 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/util.js +347 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/websocket.js +756 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/package.json +152 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/scripts/strip-comments.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +1803 -0
- package/node_modules/@earendil-works/pi-coding-agent/package.json +34 -36
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js +27 -14
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +4 -4
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +11 -5
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +22 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +27 -15
- package/node_modules/@earendil-works/pi-tui/package.json +9 -12
- package/node_modules/cross-spawn/LICENSE +21 -0
- package/node_modules/cross-spawn/README.md +89 -0
- package/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/cross-spawn/lib/parse.js +91 -0
- package/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- package/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- package/node_modules/cross-spawn/package.json +73 -0
- package/node_modules/isexe/.npmignore +2 -0
- package/node_modules/isexe/README.md +51 -0
- package/node_modules/isexe/index.js +57 -0
- package/node_modules/isexe/mode.js +41 -0
- package/node_modules/isexe/package.json +31 -0
- package/node_modules/isexe/test/basic.js +221 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/path-key/index.d.ts +40 -0
- package/node_modules/path-key/index.js +16 -0
- package/node_modules/path-key/package.json +39 -0
- package/node_modules/path-key/readme.md +61 -0
- package/node_modules/shebang-command/index.js +19 -0
- package/node_modules/shebang-command/license +9 -0
- package/node_modules/shebang-command/package.json +34 -0
- package/node_modules/shebang-command/readme.md +34 -0
- package/node_modules/shebang-regex/index.d.ts +22 -0
- package/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/shebang-regex/package.json +35 -0
- package/node_modules/shebang-regex/readme.md +33 -0
- package/node_modules/which/README.md +54 -0
- package/node_modules/which/bin/node-which +52 -0
- package/node_modules/which/package.json +43 -0
- package/node_modules/which/which.js +125 -0
- package/package.json +6 -6
- package/slingshot/index.js +259 -255
- package/node_modules/@borewit/text-codec/LICENSE.txt +0 -9
- package/node_modules/@borewit/text-codec/README.md +0 -87
- package/node_modules/@borewit/text-codec/lib/index.d.ts +0 -6
- package/node_modules/@borewit/text-codec/lib/index.js +0 -380
- package/node_modules/@borewit/text-codec/package.json +0 -70
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js +0 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js +0 -92
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js +0 -42
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js +0 -31
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js +0 -170
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js +0 -90
- package/node_modules/@tokenizer/inflate/LICENSE +0 -15
- package/node_modules/@tokenizer/inflate/README.md +0 -114
- package/node_modules/@tokenizer/inflate/lib/GzipHandler.d.ts +0 -6
- package/node_modules/@tokenizer/inflate/lib/GzipHandler.js +0 -19
- package/node_modules/@tokenizer/inflate/lib/ZipHandler.d.ts +0 -26
- package/node_modules/@tokenizer/inflate/lib/ZipHandler.js +0 -233
- package/node_modules/@tokenizer/inflate/lib/ZipToken.d.ts +0 -94
- package/node_modules/@tokenizer/inflate/lib/ZipToken.js +0 -117
- package/node_modules/@tokenizer/inflate/lib/index.d.ts +0 -3
- package/node_modules/@tokenizer/inflate/lib/index.js +0 -2
- package/node_modules/@tokenizer/inflate/package.json +0 -76
- package/node_modules/@tokenizer/token/README.md +0 -19
- package/node_modules/@tokenizer/token/index.d.ts +0 -30
- package/node_modules/@tokenizer/token/package.json +0 -33
- package/node_modules/@tootallnate/quickjs-emscripten/LICENSE +0 -21
- package/node_modules/@tootallnate/quickjs-emscripten/README.md +0 -597
- package/node_modules/@tootallnate/quickjs-emscripten/c/interface.c +0 -819
- package/node_modules/@tootallnate/quickjs-emscripten/dist/asyncify-helpers.d.ts +0 -24
- package/node_modules/@tootallnate/quickjs-emscripten/dist/asyncify-helpers.js +0 -53
- package/node_modules/@tootallnate/quickjs-emscripten/dist/asyncify-helpers.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/context-asyncify.d.ts +0 -48
- package/node_modules/@tootallnate/quickjs-emscripten/dist/context-asyncify.js +0 -58
- package/node_modules/@tootallnate/quickjs-emscripten/dist/context-asyncify.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/context.d.ts +0 -371
- package/node_modules/@tootallnate/quickjs-emscripten/dist/context.js +0 -691
- package/node_modules/@tootallnate/quickjs-emscripten/dist/context.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/debug.d.ts +0 -5
- package/node_modules/@tootallnate/quickjs-emscripten/dist/debug.js +0 -6
- package/node_modules/@tootallnate/quickjs-emscripten/dist/debug.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/deferred-promise.d.ts +0 -75
- package/node_modules/@tootallnate/quickjs-emscripten/dist/deferred-promise.js +0 -96
- package/node_modules/@tootallnate/quickjs-emscripten/dist/deferred-promise.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/emscripten-types.d.ts +0 -97
- package/node_modules/@tootallnate/quickjs-emscripten/dist/emscripten-types.js +0 -15
- package/node_modules/@tootallnate/quickjs-emscripten/dist/emscripten-types.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/errors.d.ts +0 -28
- package/node_modules/@tootallnate/quickjs-emscripten/dist/errors.js +0 -58
- package/node_modules/@tootallnate/quickjs-emscripten/dist/errors.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/esmHelpers.d.ts +0 -9
- package/node_modules/@tootallnate/quickjs-emscripten/dist/esmHelpers.js +0 -19
- package/node_modules/@tootallnate/quickjs-emscripten/dist/esmHelpers.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/generated/emscripten-module.WASM_RELEASE_SYNC.d.ts +0 -5
- package/node_modules/@tootallnate/quickjs-emscripten/dist/generated/emscripten-module.WASM_RELEASE_SYNC.js +0 -387
- package/node_modules/@tootallnate/quickjs-emscripten/dist/generated/emscripten-module.WASM_RELEASE_SYNC.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/generated/ffi.WASM_RELEASE_SYNC.d.ts +0 -67
- package/node_modules/@tootallnate/quickjs-emscripten/dist/generated/ffi.WASM_RELEASE_SYNC.js +0 -71
- package/node_modules/@tootallnate/quickjs-emscripten/dist/generated/ffi.WASM_RELEASE_SYNC.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/index.d.ts +0 -75
- package/node_modules/@tootallnate/quickjs-emscripten/dist/index.js +0 -128
- package/node_modules/@tootallnate/quickjs-emscripten/dist/index.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/lifetime.d.ts +0 -115
- package/node_modules/@tootallnate/quickjs-emscripten/dist/lifetime.js +0 -227
- package/node_modules/@tootallnate/quickjs-emscripten/dist/lifetime.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/memory.d.ts +0 -18
- package/node_modules/@tootallnate/quickjs-emscripten/dist/memory.js +0 -41
- package/node_modules/@tootallnate/quickjs-emscripten/dist/memory.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/module-asyncify.d.ts +0 -53
- package/node_modules/@tootallnate/quickjs-emscripten/dist/module-asyncify.js +0 -97
- package/node_modules/@tootallnate/quickjs-emscripten/dist/module-asyncify.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/module-test.d.ts +0 -27
- package/node_modules/@tootallnate/quickjs-emscripten/dist/module-test.js +0 -77
- package/node_modules/@tootallnate/quickjs-emscripten/dist/module-test.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/module.d.ts +0 -152
- package/node_modules/@tootallnate/quickjs-emscripten/dist/module.js +0 -302
- package/node_modules/@tootallnate/quickjs-emscripten/dist/module.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/runtime-asyncify.d.ts +0 -38
- package/node_modules/@tootallnate/quickjs-emscripten/dist/runtime-asyncify.js +0 -49
- package/node_modules/@tootallnate/quickjs-emscripten/dist/runtime-asyncify.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/runtime.d.ts +0 -174
- package/node_modules/@tootallnate/quickjs-emscripten/dist/runtime.js +0 -300
- package/node_modules/@tootallnate/quickjs-emscripten/dist/runtime.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/types-ffi.d.ts +0 -114
- package/node_modules/@tootallnate/quickjs-emscripten/dist/types-ffi.js +0 -38
- package/node_modules/@tootallnate/quickjs-emscripten/dist/types-ffi.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/types.d.ts +0 -158
- package/node_modules/@tootallnate/quickjs-emscripten/dist/types.js +0 -58
- package/node_modules/@tootallnate/quickjs-emscripten/dist/types.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/variants.d.ts +0 -113
- package/node_modules/@tootallnate/quickjs-emscripten/dist/variants.js +0 -169
- package/node_modules/@tootallnate/quickjs-emscripten/dist/variants.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/dist/vm-interface.d.ts +0 -68
- package/node_modules/@tootallnate/quickjs-emscripten/dist/vm-interface.js +0 -12
- package/node_modules/@tootallnate/quickjs-emscripten/dist/vm-interface.js.map +0 -1
- package/node_modules/@tootallnate/quickjs-emscripten/package.json +0 -60
- package/node_modules/@types/mime-types/LICENSE +0 -21
- package/node_modules/@types/mime-types/README.md +0 -28
- package/node_modules/@types/mime-types/index.d.ts +0 -9
- package/node_modules/@types/mime-types/package.json +0 -25
- package/node_modules/@types/yauzl/LICENSE +0 -21
- package/node_modules/@types/yauzl/README.md +0 -15
- package/node_modules/@types/yauzl/index.d.ts +0 -110
- package/node_modules/@types/yauzl/package.json +0 -27
- package/node_modules/ansi-regex/index.d.ts +0 -33
- package/node_modules/ansi-regex/index.js +0 -14
- package/node_modules/ansi-regex/license +0 -9
- package/node_modules/ansi-regex/package.json +0 -61
- package/node_modules/ansi-regex/readme.md +0 -66
- package/node_modules/ansi-styles/index.d.ts +0 -345
- package/node_modules/ansi-styles/index.js +0 -163
- package/node_modules/ansi-styles/package.json +0 -56
- package/node_modules/ansi-styles/readme.md +0 -152
- package/node_modules/any-promise/.jshintrc +0 -4
- package/node_modules/any-promise/.npmignore +0 -7
- package/node_modules/any-promise/LICENSE +0 -19
- package/node_modules/any-promise/README.md +0 -161
- package/node_modules/any-promise/implementation.d.ts +0 -3
- package/node_modules/any-promise/implementation.js +0 -1
- package/node_modules/any-promise/index.d.ts +0 -73
- package/node_modules/any-promise/index.js +0 -1
- package/node_modules/any-promise/loader.js +0 -78
- package/node_modules/any-promise/optional.js +0 -6
- package/node_modules/any-promise/package.json +0 -45
- package/node_modules/any-promise/register/bluebird.d.ts +0 -1
- package/node_modules/any-promise/register/bluebird.js +0 -2
- package/node_modules/any-promise/register/es6-promise.d.ts +0 -1
- package/node_modules/any-promise/register/es6-promise.js +0 -2
- package/node_modules/any-promise/register/lie.d.ts +0 -1
- package/node_modules/any-promise/register/lie.js +0 -2
- package/node_modules/any-promise/register/native-promise-only.d.ts +0 -1
- package/node_modules/any-promise/register/native-promise-only.js +0 -2
- package/node_modules/any-promise/register/pinkie.d.ts +0 -1
- package/node_modules/any-promise/register/pinkie.js +0 -2
- package/node_modules/any-promise/register/promise.d.ts +0 -1
- package/node_modules/any-promise/register/promise.js +0 -2
- package/node_modules/any-promise/register/q.d.ts +0 -1
- package/node_modules/any-promise/register/q.js +0 -2
- package/node_modules/any-promise/register/rsvp.d.ts +0 -1
- package/node_modules/any-promise/register/rsvp.js +0 -2
- package/node_modules/any-promise/register/vow.d.ts +0 -1
- package/node_modules/any-promise/register/vow.js +0 -2
- package/node_modules/any-promise/register/when.d.ts +0 -1
- package/node_modules/any-promise/register/when.js +0 -2
- package/node_modules/any-promise/register-shim.js +0 -18
- package/node_modules/any-promise/register.d.ts +0 -17
- package/node_modules/any-promise/register.js +0 -94
- package/node_modules/ast-types/.github/dependabot.yml +0 -9
- package/node_modules/ast-types/.github/workflows/main.yml +0 -29
- package/node_modules/ast-types/LICENSE +0 -20
- package/node_modules/ast-types/README.md +0 -512
- package/node_modules/ast-types/def/babel-core.d.ts +0 -2
- package/node_modules/ast-types/def/babel-core.js +0 -256
- package/node_modules/ast-types/def/babel.d.ts +0 -2
- package/node_modules/ast-types/def/babel.js +0 -11
- package/node_modules/ast-types/def/core.d.ts +0 -2
- package/node_modules/ast-types/def/core.js +0 -298
- package/node_modules/ast-types/def/es-proposals.d.ts +0 -2
- package/node_modules/ast-types/def/es-proposals.js +0 -33
- package/node_modules/ast-types/def/es2020.d.ts +0 -2
- package/node_modules/ast-types/def/es2020.js +0 -16
- package/node_modules/ast-types/def/es6.d.ts +0 -2
- package/node_modules/ast-types/def/es6.js +0 -210
- package/node_modules/ast-types/def/es7.d.ts +0 -2
- package/node_modules/ast-types/def/es7.js +0 -34
- package/node_modules/ast-types/def/esprima.d.ts +0 -2
- package/node_modules/ast-types/def/esprima.js +0 -49
- package/node_modules/ast-types/def/flow.d.ts +0 -2
- package/node_modules/ast-types/def/flow.js +0 -292
- package/node_modules/ast-types/def/jsx.d.ts +0 -2
- package/node_modules/ast-types/def/jsx.js +0 -103
- package/node_modules/ast-types/def/type-annotations.d.ts +0 -7
- package/node_modules/ast-types/def/type-annotations.js +0 -40
- package/node_modules/ast-types/def/typescript.d.ts +0 -2
- package/node_modules/ast-types/def/typescript.js +0 -344
- package/node_modules/ast-types/fork.d.ts +0 -42
- package/node_modules/ast-types/fork.js +0 -52
- package/node_modules/ast-types/gen/builders.d.ts +0 -2584
- package/node_modules/ast-types/gen/builders.js +0 -2
- package/node_modules/ast-types/gen/kinds.d.ts +0 -264
- package/node_modules/ast-types/gen/kinds.js +0 -2
- package/node_modules/ast-types/gen/namedTypes.d.ts +0 -1809
- package/node_modules/ast-types/gen/namedTypes.js +0 -6
- package/node_modules/ast-types/gen/visitor.d.ts +0 -268
- package/node_modules/ast-types/gen/visitor.js +0 -2
- package/node_modules/ast-types/lib/equiv.d.ts +0 -5
- package/node_modules/ast-types/lib/equiv.js +0 -154
- package/node_modules/ast-types/lib/node-path.d.ts +0 -22
- package/node_modules/ast-types/lib/node-path.js +0 -411
- package/node_modules/ast-types/lib/path-visitor.d.ts +0 -52
- package/node_modules/ast-types/lib/path-visitor.js +0 -343
- package/node_modules/ast-types/lib/path.d.ts +0 -25
- package/node_modules/ast-types/lib/path.js +0 -331
- package/node_modules/ast-types/lib/scope.d.ts +0 -26
- package/node_modules/ast-types/lib/scope.js +0 -318
- package/node_modules/ast-types/lib/shared.d.ts +0 -13
- package/node_modules/ast-types/lib/shared.js +0 -47
- package/node_modules/ast-types/lib/types.d.ts +0 -136
- package/node_modules/ast-types/lib/types.js +0 -780
- package/node_modules/ast-types/main.d.ts +0 -28
- package/node_modules/ast-types/main.js +0 -53
- package/node_modules/ast-types/package.json +0 -65
- package/node_modules/ast-types/tsconfig.json +0 -21
- package/node_modules/ast-types/types.d.ts +0 -6
- package/node_modules/ast-types/types.js +0 -2
- package/node_modules/basic-ftp/LICENSE.txt +0 -19
- package/node_modules/basic-ftp/README.md +0 -244
- package/node_modules/basic-ftp/dist/Client.d.ts +0 -340
- package/node_modules/basic-ftp/dist/Client.js +0 -785
- package/node_modules/basic-ftp/dist/FileInfo.d.ts +0 -80
- package/node_modules/basic-ftp/dist/FileInfo.js +0 -92
- package/node_modules/basic-ftp/dist/FtpContext.d.ts +0 -175
- package/node_modules/basic-ftp/dist/FtpContext.js +0 -375
- package/node_modules/basic-ftp/dist/ProgressTracker.d.ts +0 -45
- package/node_modules/basic-ftp/dist/ProgressTracker.js +0 -72
- package/node_modules/basic-ftp/dist/StringEncoding.d.ts +0 -1
- package/node_modules/basic-ftp/dist/StringEncoding.js +0 -2
- package/node_modules/basic-ftp/dist/StringWriter.d.ts +0 -10
- package/node_modules/basic-ftp/dist/StringWriter.js +0 -29
- package/node_modules/basic-ftp/dist/index.d.ts +0 -9
- package/node_modules/basic-ftp/dist/index.js +0 -28
- package/node_modules/basic-ftp/dist/netUtils.d.ts +0 -21
- package/node_modules/basic-ftp/dist/netUtils.js +0 -66
- package/node_modules/basic-ftp/dist/parseControlResponse.d.ts +0 -22
- package/node_modules/basic-ftp/dist/parseControlResponse.js +0 -66
- package/node_modules/basic-ftp/dist/parseList.d.ts +0 -5
- package/node_modules/basic-ftp/dist/parseList.js +0 -79
- package/node_modules/basic-ftp/dist/parseListDOS.d.ts +0 -12
- package/node_modules/basic-ftp/dist/parseListDOS.js +0 -52
- package/node_modules/basic-ftp/dist/parseListMLSD.d.ts +0 -20
- package/node_modules/basic-ftp/dist/parseListMLSD.js +0 -187
- package/node_modules/basic-ftp/dist/parseListUnix.d.ts +0 -12
- package/node_modules/basic-ftp/dist/parseListUnix.js +0 -155
- package/node_modules/basic-ftp/dist/transfer.d.ts +0 -39
- package/node_modules/basic-ftp/dist/transfer.js +0 -318
- package/node_modules/basic-ftp/package.json +0 -52
- package/node_modules/buffer-crc32/LICENSE +0 -19
- package/node_modules/buffer-crc32/README.md +0 -47
- package/node_modules/buffer-crc32/index.js +0 -111
- package/node_modules/buffer-crc32/package.json +0 -39
- package/node_modules/cli-highlight/LICENSE.txt +0 -15
- package/node_modules/cli-highlight/README.md +0 -88
- package/node_modules/cli-highlight/bin/highlight +0 -2
- package/node_modules/cli-highlight/dist/cli.d.ts +0 -1
- package/node_modules/cli-highlight/dist/cli.js +0 -102
- package/node_modules/cli-highlight/dist/cli.js.map +0 -1
- package/node_modules/cli-highlight/dist/index.d.ts +0 -53
- package/node_modules/cli-highlight/dist/index.js +0 -112
- package/node_modules/cli-highlight/dist/index.js.map +0 -1
- package/node_modules/cli-highlight/dist/test/test.d.ts +0 -1
- package/node_modules/cli-highlight/dist/test/test.js +0 -62
- package/node_modules/cli-highlight/dist/test/test.js.map +0 -1
- package/node_modules/cli-highlight/dist/theme.d.ts +0 -270
- package/node_modules/cli-highlight/dist/theme.js +0 -265
- package/node_modules/cli-highlight/dist/theme.js.map +0 -1
- package/node_modules/cli-highlight/node_modules/chalk/index.d.ts +0 -415
- package/node_modules/cli-highlight/node_modules/chalk/package.json +0 -68
- package/node_modules/cli-highlight/node_modules/chalk/readme.md +0 -341
- package/node_modules/cli-highlight/node_modules/chalk/source/index.js +0 -229
- package/node_modules/cli-highlight/node_modules/chalk/source/templates.js +0 -134
- package/node_modules/cli-highlight/node_modules/chalk/source/util.js +0 -39
- package/node_modules/cli-highlight/package.json +0 -129
- package/node_modules/cliui/LICENSE.txt +0 -14
- package/node_modules/cliui/README.md +0 -141
- package/node_modules/cliui/build/index.cjs +0 -302
- package/node_modules/cliui/build/lib/index.js +0 -287
- package/node_modules/cliui/build/lib/string-utils.js +0 -27
- package/node_modules/cliui/index.mjs +0 -13
- package/node_modules/cliui/node_modules/ansi-regex/index.d.ts +0 -37
- package/node_modules/cliui/node_modules/ansi-regex/index.js +0 -10
- package/node_modules/cliui/node_modules/ansi-regex/license +0 -9
- package/node_modules/cliui/node_modules/ansi-regex/package.json +0 -55
- package/node_modules/cliui/node_modules/ansi-regex/readme.md +0 -78
- package/node_modules/cliui/node_modules/strip-ansi/index.d.ts +0 -17
- package/node_modules/cliui/node_modules/strip-ansi/index.js +0 -4
- package/node_modules/cliui/node_modules/strip-ansi/license +0 -9
- package/node_modules/cliui/node_modules/strip-ansi/package.json +0 -54
- package/node_modules/cliui/node_modules/strip-ansi/readme.md +0 -46
- package/node_modules/cliui/package.json +0 -83
- package/node_modules/color-convert/LICENSE +0 -21
- package/node_modules/color-convert/README.md +0 -68
- package/node_modules/color-convert/conversions.js +0 -839
- package/node_modules/color-convert/index.js +0 -81
- package/node_modules/color-convert/package.json +0 -48
- package/node_modules/color-convert/route.js +0 -97
- package/node_modules/color-name/LICENSE +0 -8
- package/node_modules/color-name/README.md +0 -11
- package/node_modules/color-name/index.js +0 -152
- package/node_modules/color-name/package.json +0 -28
- package/node_modules/degenerator/README.md +0 -117
- package/node_modules/degenerator/dist/compile.d.ts +0 -11
- package/node_modules/degenerator/dist/compile.d.ts.map +0 -1
- package/node_modules/degenerator/dist/compile.js +0 -107
- package/node_modules/degenerator/dist/compile.js.map +0 -1
- package/node_modules/degenerator/dist/degenerator.d.ts +0 -12
- package/node_modules/degenerator/dist/degenerator.d.ts.map +0 -1
- package/node_modules/degenerator/dist/degenerator.js +0 -156
- package/node_modules/degenerator/dist/degenerator.js.map +0 -1
- package/node_modules/degenerator/dist/index.d.ts +0 -3
- package/node_modules/degenerator/dist/index.d.ts.map +0 -1
- package/node_modules/degenerator/dist/index.js +0 -19
- package/node_modules/degenerator/dist/index.js.map +0 -1
- package/node_modules/degenerator/package.json +0 -42
- package/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
- package/node_modules/emoji-regex/README.md +0 -73
- package/node_modules/emoji-regex/es2015/index.js +0 -6
- package/node_modules/emoji-regex/es2015/text.js +0 -6
- package/node_modules/emoji-regex/index.d.ts +0 -23
- package/node_modules/emoji-regex/index.js +0 -6
- package/node_modules/emoji-regex/package.json +0 -50
- package/node_modules/emoji-regex/text.js +0 -6
- package/node_modules/end-of-stream/LICENSE +0 -21
- package/node_modules/end-of-stream/README.md +0 -54
- package/node_modules/end-of-stream/index.js +0 -96
- package/node_modules/end-of-stream/package.json +0 -37
- package/node_modules/escalade/dist/index.js +0 -22
- package/node_modules/escalade/dist/index.mjs +0 -22
- package/node_modules/escalade/index.d.mts +0 -11
- package/node_modules/escalade/index.d.ts +0 -15
- package/node_modules/escalade/license +0 -9
- package/node_modules/escalade/package.json +0 -74
- package/node_modules/escalade/readme.md +0 -211
- package/node_modules/escalade/sync/index.d.mts +0 -9
- package/node_modules/escalade/sync/index.d.ts +0 -13
- package/node_modules/escalade/sync/index.js +0 -18
- package/node_modules/escalade/sync/index.mjs +0 -18
- package/node_modules/escodegen/LICENSE.BSD +0 -21
- package/node_modules/escodegen/README.md +0 -84
- package/node_modules/escodegen/bin/escodegen.js +0 -77
- package/node_modules/escodegen/bin/esgenerate.js +0 -64
- package/node_modules/escodegen/escodegen.js +0 -2667
- package/node_modules/escodegen/package.json +0 -63
- package/node_modules/esprima/LICENSE.BSD +0 -21
- package/node_modules/esprima/README.md +0 -46
- package/node_modules/esprima/bin/esparse.js +0 -139
- package/node_modules/esprima/bin/esvalidate.js +0 -236
- package/node_modules/esprima/dist/esprima.js +0 -6709
- package/node_modules/esprima/package.json +0 -112
- package/node_modules/estraverse/.jshintrc +0 -16
- package/node_modules/estraverse/LICENSE.BSD +0 -19
- package/node_modules/estraverse/README.md +0 -153
- package/node_modules/estraverse/estraverse.js +0 -805
- package/node_modules/estraverse/gulpfile.js +0 -70
- package/node_modules/estraverse/package.json +0 -40
- package/node_modules/esutils/LICENSE.BSD +0 -19
- package/node_modules/esutils/README.md +0 -174
- package/node_modules/esutils/lib/ast.js +0 -144
- package/node_modules/esutils/lib/code.js +0 -135
- package/node_modules/esutils/lib/keyword.js +0 -165
- package/node_modules/esutils/lib/utils.js +0 -33
- package/node_modules/esutils/package.json +0 -44
- package/node_modules/extract-zip/LICENSE +0 -23
- package/node_modules/extract-zip/cli.js +0 -19
- package/node_modules/extract-zip/index.d.ts +0 -21
- package/node_modules/extract-zip/index.js +0 -173
- package/node_modules/extract-zip/package.json +0 -80
- package/node_modules/extract-zip/readme.md +0 -57
- package/node_modules/fd-slicer/.npmignore +0 -2
- package/node_modules/fd-slicer/.travis.yml +0 -7
- package/node_modules/fd-slicer/CHANGELOG.md +0 -49
- package/node_modules/fd-slicer/LICENSE +0 -21
- package/node_modules/fd-slicer/README.md +0 -199
- package/node_modules/fd-slicer/index.js +0 -296
- package/node_modules/fd-slicer/package.json +0 -36
- package/node_modules/fd-slicer/test/test.js +0 -350
- package/node_modules/file-type/core.d.ts +0 -253
- package/node_modules/file-type/core.js +0 -2899
- package/node_modules/file-type/index.d.ts +0 -98
- package/node_modules/file-type/index.js +0 -163
- package/node_modules/file-type/license +0 -9
- package/node_modules/file-type/package.json +0 -290
- package/node_modules/file-type/readme.md +0 -667
- package/node_modules/file-type/supported.js +0 -360
- package/node_modules/file-type/util.js +0 -60
- package/node_modules/get-caller-file/LICENSE.md +0 -6
- package/node_modules/get-caller-file/README.md +0 -41
- package/node_modules/get-caller-file/index.d.ts +0 -2
- package/node_modules/get-caller-file/index.js +0 -22
- package/node_modules/get-caller-file/index.js.map +0 -1
- package/node_modules/get-caller-file/package.json +0 -42
- package/node_modules/get-stream/buffer-stream.js +0 -52
- package/node_modules/get-stream/index.d.ts +0 -108
- package/node_modules/get-stream/index.js +0 -60
- package/node_modules/get-stream/license +0 -9
- package/node_modules/get-stream/package.json +0 -50
- package/node_modules/get-stream/readme.md +0 -124
- package/node_modules/get-uri/LICENSE +0 -22
- package/node_modules/get-uri/README.md +0 -109
- package/node_modules/get-uri/dist/data.d.ts +0 -16
- package/node_modules/get-uri/dist/data.js +0 -43
- package/node_modules/get-uri/dist/data.js.map +0 -1
- package/node_modules/get-uri/dist/file.d.ts +0 -17
- package/node_modules/get-uri/dist/file.js +0 -57
- package/node_modules/get-uri/dist/file.js.map +0 -1
- package/node_modules/get-uri/dist/ftp.d.ts +0 -14
- package/node_modules/get-uri/dist/ftp.js +0 -93
- package/node_modules/get-uri/dist/ftp.js.map +0 -1
- package/node_modules/get-uri/dist/http-error.d.ts +0 -8
- package/node_modules/get-uri/dist/http-error.js +0 -15
- package/node_modules/get-uri/dist/http-error.js.map +0 -1
- package/node_modules/get-uri/dist/http.d.ts +0 -29
- package/node_modules/get-uri/dist/http.js +0 -191
- package/node_modules/get-uri/dist/http.js.map +0 -1
- package/node_modules/get-uri/dist/https.d.ts +0 -6
- package/node_modules/get-uri/dist/https.js +0 -16
- package/node_modules/get-uri/dist/https.js.map +0 -1
- package/node_modules/get-uri/dist/index.d.ts +0 -37
- package/node_modules/get-uri/dist/index.js +0 -57
- package/node_modules/get-uri/dist/index.js.map +0 -1
- package/node_modules/get-uri/dist/notfound.d.ts +0 -10
- package/node_modules/get-uri/dist/notfound.js +0 -16
- package/node_modules/get-uri/dist/notfound.js.map +0 -1
- package/node_modules/get-uri/dist/notmodified.d.ts +0 -10
- package/node_modules/get-uri/dist/notmodified.js +0 -17
- package/node_modules/get-uri/dist/notmodified.js.map +0 -1
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/LICENSE +0 -22
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/README.md +0 -61
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/dist/common.d.ts +0 -17
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/dist/common.d.ts.map +0 -1
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/dist/common.js +0 -54
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/dist/common.js.map +0 -1
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/dist/index.d.ts +0 -8
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/dist/index.d.ts.map +0 -1
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/dist/index.js +0 -48
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/dist/index.js.map +0 -1
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/dist/node.d.ts +0 -8
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/dist/node.d.ts.map +0 -1
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/dist/node.js +0 -26
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/dist/node.js.map +0 -1
- package/node_modules/get-uri/node_modules/data-uri-to-buffer/package.json +0 -48
- package/node_modules/get-uri/package.json +0 -58
- package/node_modules/has-flag/index.d.ts +0 -39
- package/node_modules/has-flag/index.js +0 -8
- package/node_modules/has-flag/license +0 -9
- package/node_modules/has-flag/package.json +0 -46
- package/node_modules/has-flag/readme.md +0 -89
- package/node_modules/ieee754/LICENSE +0 -11
- package/node_modules/ieee754/README.md +0 -51
- package/node_modules/ieee754/index.d.ts +0 -10
- package/node_modules/ieee754/index.js +0 -85
- package/node_modules/ieee754/package.json +0 -52
- package/node_modules/ip-address/LICENSE +0 -19
- package/node_modules/ip-address/README.md +0 -278
- package/node_modules/ip-address/dist/address-error.d.ts +0 -4
- package/node_modules/ip-address/dist/address-error.js +0 -12
- package/node_modules/ip-address/dist/address-error.js.map +0 -1
- package/node_modules/ip-address/dist/common.d.ts +0 -20
- package/node_modules/ip-address/dist/common.js +0 -67
- package/node_modules/ip-address/dist/common.js.map +0 -1
- package/node_modules/ip-address/dist/ip-address.d.ts +0 -7
- package/node_modules/ip-address/dist/ip-address.js +0 -35
- package/node_modules/ip-address/dist/ip-address.js.map +0 -1
- package/node_modules/ip-address/dist/ipv4.d.ts +0 -267
- package/node_modules/ip-address/dist/ipv4.js +0 -485
- package/node_modules/ip-address/dist/ipv4.js.map +0 -1
- package/node_modules/ip-address/dist/ipv6.d.ts +0 -489
- package/node_modules/ip-address/dist/ipv6.js +0 -1217
- package/node_modules/ip-address/dist/ipv6.js.map +0 -1
- package/node_modules/ip-address/dist/v4/constants.d.ts +0 -4
- package/node_modules/ip-address/dist/v4/constants.js +0 -8
- package/node_modules/ip-address/dist/v4/constants.js.map +0 -1
- package/node_modules/ip-address/dist/v6/constants.d.ts +0 -44
- package/node_modules/ip-address/dist/v6/constants.js +0 -81
- package/node_modules/ip-address/dist/v6/constants.js.map +0 -1
- package/node_modules/ip-address/dist/v6/helpers.d.ts +0 -18
- package/node_modules/ip-address/dist/v6/helpers.js +0 -54
- package/node_modules/ip-address/dist/v6/helpers.js.map +0 -1
- package/node_modules/ip-address/dist/v6/regular-expressions.d.ts +0 -5
- package/node_modules/ip-address/dist/v6/regular-expressions.js +0 -95
- package/node_modules/ip-address/dist/v6/regular-expressions.js.map +0 -1
- package/node_modules/ip-address/package.json +0 -88
- package/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
- package/node_modules/is-fullwidth-code-point/index.js +0 -50
- package/node_modules/is-fullwidth-code-point/license +0 -9
- package/node_modules/is-fullwidth-code-point/package.json +0 -42
- package/node_modules/is-fullwidth-code-point/readme.md +0 -39
- package/node_modules/mime-db/HISTORY.md +0 -541
- package/node_modules/mime-db/LICENSE +0 -23
- package/node_modules/mime-db/README.md +0 -109
- package/node_modules/mime-db/db.json +0 -9342
- package/node_modules/mime-db/index.js +0 -12
- package/node_modules/mime-db/package.json +0 -56
- package/node_modules/mime-types/HISTORY.md +0 -428
- package/node_modules/mime-types/LICENSE +0 -23
- package/node_modules/mime-types/README.md +0 -126
- package/node_modules/mime-types/index.js +0 -211
- package/node_modules/mime-types/mimeScore.js +0 -57
- package/node_modules/mime-types/package.json +0 -49
- package/node_modules/mz/LICENSE +0 -22
- package/node_modules/mz/README.md +0 -106
- package/node_modules/mz/child_process.js +0 -8
- package/node_modules/mz/crypto.js +0 -9
- package/node_modules/mz/dns.js +0 -16
- package/node_modules/mz/fs.js +0 -62
- package/node_modules/mz/index.js +0 -8
- package/node_modules/mz/package.json +0 -44
- package/node_modules/mz/readline.js +0 -64
- package/node_modules/mz/zlib.js +0 -13
- package/node_modules/netmask/CHANGELOG.md +0 -66
- package/node_modules/netmask/LICENSE.md +0 -21
- package/node_modules/netmask/README.md +0 -112
- package/node_modules/netmask/dist/netmask.d.ts +0 -21
- package/node_modules/netmask/dist/netmask.js +0 -68
- package/node_modules/netmask/dist/netmask4.d.ts +0 -20
- package/node_modules/netmask/dist/netmask4.js +0 -189
- package/node_modules/netmask/dist/netmask6.d.ts +0 -20
- package/node_modules/netmask/dist/netmask6.js +0 -187
- package/node_modules/netmask/package.json +0 -45
- package/node_modules/object-assign/index.js +0 -90
- package/node_modules/object-assign/license +0 -21
- package/node_modules/object-assign/package.json +0 -42
- package/node_modules/object-assign/readme.md +0 -61
- package/node_modules/once/README.md +0 -79
- package/node_modules/once/once.js +0 -42
- package/node_modules/once/package.json +0 -33
- package/node_modules/pac-proxy-agent/LICENSE +0 -22
- package/node_modules/pac-proxy-agent/README.md +0 -27
- package/node_modules/pac-proxy-agent/dist/index.d.ts +0 -60
- package/node_modules/pac-proxy-agent/dist/index.d.ts.map +0 -1
- package/node_modules/pac-proxy-agent/dist/index.js +0 -238
- package/node_modules/pac-proxy-agent/dist/index.js.map +0 -1
- package/node_modules/pac-proxy-agent/package.json +0 -58
- package/node_modules/pac-resolver/LICENSE +0 -22
- package/node_modules/pac-resolver/README.md +0 -59
- package/node_modules/pac-resolver/dist/dateRange.d.ts +0 -67
- package/node_modules/pac-resolver/dist/dateRange.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/dateRange.js +0 -73
- package/node_modules/pac-resolver/dist/dateRange.js.map +0 -1
- package/node_modules/pac-resolver/dist/dnsDomainIs.d.ts +0 -23
- package/node_modules/pac-resolver/dist/dnsDomainIs.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/dnsDomainIs.js +0 -30
- package/node_modules/pac-resolver/dist/dnsDomainIs.js.map +0 -1
- package/node_modules/pac-resolver/dist/dnsDomainLevels.d.ts +0 -18
- package/node_modules/pac-resolver/dist/dnsDomainLevels.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/dnsDomainLevels.js +0 -28
- package/node_modules/pac-resolver/dist/dnsDomainLevels.js.map +0 -1
- package/node_modules/pac-resolver/dist/dnsResolve.d.ts +0 -16
- package/node_modules/pac-resolver/dist/dnsResolve.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/dnsResolve.js +0 -32
- package/node_modules/pac-resolver/dist/dnsResolve.js.map +0 -1
- package/node_modules/pac-resolver/dist/index.d.ts +0 -50
- package/node_modules/pac-resolver/dist/index.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/index.js +0 -87
- package/node_modules/pac-resolver/dist/index.js.map +0 -1
- package/node_modules/pac-resolver/dist/ip.d.ts +0 -8
- package/node_modules/pac-resolver/dist/ip.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/ip.js +0 -50
- package/node_modules/pac-resolver/dist/ip.js.map +0 -1
- package/node_modules/pac-resolver/dist/isInNet.d.ts +0 -24
- package/node_modules/pac-resolver/dist/isInNet.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/isInNet.js +0 -42
- package/node_modules/pac-resolver/dist/isInNet.js.map +0 -1
- package/node_modules/pac-resolver/dist/isPlainHostName.d.ts +0 -18
- package/node_modules/pac-resolver/dist/isPlainHostName.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/isPlainHostName.js +0 -23
- package/node_modules/pac-resolver/dist/isPlainHostName.js.map +0 -1
- package/node_modules/pac-resolver/dist/isResolvable.d.ts +0 -8
- package/node_modules/pac-resolver/dist/isResolvable.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/isResolvable.js +0 -23
- package/node_modules/pac-resolver/dist/isResolvable.js.map +0 -1
- package/node_modules/pac-resolver/dist/localHostOrDomainIs.d.ts +0 -26
- package/node_modules/pac-resolver/dist/localHostOrDomainIs.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/localHostOrDomainIs.js +0 -40
- package/node_modules/pac-resolver/dist/localHostOrDomainIs.js.map +0 -1
- package/node_modules/pac-resolver/dist/myIpAddress.d.ts +0 -16
- package/node_modules/pac-resolver/dist/myIpAddress.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/myIpAddress.js +0 -50
- package/node_modules/pac-resolver/dist/myIpAddress.js.map +0 -1
- package/node_modules/pac-resolver/dist/shExpMatch.d.ts +0 -23
- package/node_modules/pac-resolver/dist/shExpMatch.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/shExpMatch.js +0 -41
- package/node_modules/pac-resolver/dist/shExpMatch.js.map +0 -1
- package/node_modules/pac-resolver/dist/timeRange.d.ts +0 -43
- package/node_modules/pac-resolver/dist/timeRange.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/timeRange.js +0 -92
- package/node_modules/pac-resolver/dist/timeRange.js.map +0 -1
- package/node_modules/pac-resolver/dist/util.d.ts +0 -6
- package/node_modules/pac-resolver/dist/util.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/util.js +0 -22
- package/node_modules/pac-resolver/dist/util.js.map +0 -1
- package/node_modules/pac-resolver/dist/weekdayRange.d.ts +0 -45
- package/node_modules/pac-resolver/dist/weekdayRange.d.ts.map +0 -1
- package/node_modules/pac-resolver/dist/weekdayRange.js +0 -91
- package/node_modules/pac-resolver/dist/weekdayRange.js.map +0 -1
- package/node_modules/pac-resolver/package.json +0 -47
- package/node_modules/parse5/LICENSE +0 -19
- package/node_modules/parse5/README.md +0 -38
- package/node_modules/parse5/lib/common/doctype.js +0 -162
- package/node_modules/parse5/lib/common/error-codes.js +0 -65
- package/node_modules/parse5/lib/common/foreign-content.js +0 -265
- package/node_modules/parse5/lib/common/html.js +0 -272
- package/node_modules/parse5/lib/common/unicode.js +0 -109
- package/node_modules/parse5/lib/extensions/error-reporting/mixin-base.js +0 -43
- package/node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js +0 -52
- package/node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js +0 -24
- package/node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js +0 -17
- package/node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js +0 -35
- package/node_modules/parse5/lib/extensions/location-info/parser-mixin.js +0 -222
- package/node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js +0 -146
- package/node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js +0 -64
- package/node_modules/parse5/lib/index.js +0 -29
- package/node_modules/parse5/lib/parser/formatting-element-list.js +0 -181
- package/node_modules/parse5/lib/parser/index.js +0 -2956
- package/node_modules/parse5/lib/parser/open-element-stack.js +0 -482
- package/node_modules/parse5/lib/serializer/index.js +0 -176
- package/node_modules/parse5/lib/tokenizer/index.js +0 -2196
- package/node_modules/parse5/lib/tokenizer/named-entity-data.js +0 -5
- package/node_modules/parse5/lib/tokenizer/preprocessor.js +0 -159
- package/node_modules/parse5/lib/tree-adapters/default.js +0 -217
- package/node_modules/parse5/lib/utils/merge-options.js +0 -13
- package/node_modules/parse5/lib/utils/mixin.js +0 -39
- package/node_modules/parse5/package.json +0 -35
- package/node_modules/parse5-htmlparser2-tree-adapter/LICENSE +0 -19
- package/node_modules/parse5-htmlparser2-tree-adapter/README.md +0 -34
- package/node_modules/parse5-htmlparser2-tree-adapter/lib/index.js +0 -348
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/LICENSE +0 -19
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/README.md +0 -38
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/doctype.js +0 -162
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/error-codes.js +0 -65
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/foreign-content.js +0 -265
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/html.js +0 -272
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/unicode.js +0 -109
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/mixin-base.js +0 -43
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js +0 -52
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js +0 -24
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js +0 -17
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js +0 -35
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/location-info/parser-mixin.js +0 -223
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js +0 -146
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js +0 -64
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/index.js +0 -29
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/parser/formatting-element-list.js +0 -181
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/parser/index.js +0 -2956
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/parser/open-element-stack.js +0 -482
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/serializer/index.js +0 -176
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tokenizer/index.js +0 -2196
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tokenizer/named-entity-data.js +0 -5
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tokenizer/preprocessor.js +0 -159
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tree-adapters/default.js +0 -221
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/utils/merge-options.js +0 -13
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/utils/mixin.js +0 -39
- package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/package.json +0 -35
- package/node_modules/parse5-htmlparser2-tree-adapter/package.json +0 -27
- package/node_modules/pend/LICENSE +0 -23
- package/node_modules/pend/README.md +0 -41
- package/node_modules/pend/index.js +0 -55
- package/node_modules/pend/package.json +0 -18
- package/node_modules/pend/test.js +0 -137
- package/node_modules/proxy-agent/LICENSE +0 -22
- package/node_modules/proxy-agent/README.md +0 -59
- package/node_modules/proxy-agent/dist/index.d.ts +0 -62
- package/node_modules/proxy-agent/dist/index.d.ts.map +0 -1
- package/node_modules/proxy-agent/dist/index.js +0 -138
- package/node_modules/proxy-agent/dist/index.js.map +0 -1
- package/node_modules/proxy-agent/node_modules/lru-cache/LICENSE +0 -15
- package/node_modules/proxy-agent/node_modules/lru-cache/README.md +0 -1117
- package/node_modules/proxy-agent/node_modules/lru-cache/index.d.ts +0 -869
- package/node_modules/proxy-agent/node_modules/lru-cache/index.js +0 -1227
- package/node_modules/proxy-agent/node_modules/lru-cache/index.mjs +0 -1227
- package/node_modules/proxy-agent/node_modules/lru-cache/package.json +0 -96
- package/node_modules/proxy-agent/package.json +0 -60
- package/node_modules/proxy-from-env/.eslintrc +0 -29
- package/node_modules/proxy-from-env/.travis.yml +0 -10
- package/node_modules/proxy-from-env/LICENSE +0 -20
- package/node_modules/proxy-from-env/README.md +0 -131
- package/node_modules/proxy-from-env/index.js +0 -108
- package/node_modules/proxy-from-env/package.json +0 -34
- package/node_modules/proxy-from-env/test.js +0 -483
- package/node_modules/pump/.github/FUNDING.yml +0 -2
- package/node_modules/pump/.travis.yml +0 -5
- package/node_modules/pump/LICENSE +0 -21
- package/node_modules/pump/README.md +0 -74
- package/node_modules/pump/SECURITY.md +0 -5
- package/node_modules/pump/empty.js +0 -1
- package/node_modules/pump/index.js +0 -86
- package/node_modules/pump/package.json +0 -30
- package/node_modules/pump/test-browser.js +0 -66
- package/node_modules/pump/test-node.js +0 -53
- package/node_modules/require-directory/.jshintrc +0 -67
- package/node_modules/require-directory/.npmignore +0 -1
- package/node_modules/require-directory/.travis.yml +0 -3
- package/node_modules/require-directory/LICENSE +0 -22
- package/node_modules/require-directory/README.markdown +0 -184
- package/node_modules/require-directory/index.js +0 -86
- package/node_modules/require-directory/package.json +0 -40
- package/node_modules/smart-buffer/.prettierrc.yaml +0 -5
- package/node_modules/smart-buffer/.travis.yml +0 -13
- package/node_modules/smart-buffer/LICENSE +0 -20
- package/node_modules/smart-buffer/README.md +0 -633
- package/node_modules/smart-buffer/build/smartbuffer.js +0 -1233
- package/node_modules/smart-buffer/build/smartbuffer.js.map +0 -1
- package/node_modules/smart-buffer/build/utils.js +0 -108
- package/node_modules/smart-buffer/build/utils.js.map +0 -1
- package/node_modules/smart-buffer/docs/CHANGELOG.md +0 -70
- package/node_modules/smart-buffer/docs/README_v3.md +0 -367
- package/node_modules/smart-buffer/docs/ROADMAP.md +0 -0
- package/node_modules/smart-buffer/package.json +0 -79
- package/node_modules/smart-buffer/typings/smartbuffer.d.ts +0 -755
- package/node_modules/smart-buffer/typings/utils.d.ts +0 -66
- package/node_modules/socks/.eslintrc.cjs +0 -11
- package/node_modules/socks/.prettierrc.yaml +0 -7
- package/node_modules/socks/LICENSE +0 -20
- package/node_modules/socks/README.md +0 -686
- package/node_modules/socks/build/client/socksclient.js +0 -793
- package/node_modules/socks/build/client/socksclient.js.map +0 -1
- package/node_modules/socks/build/common/constants.js +0 -108
- package/node_modules/socks/build/common/constants.js.map +0 -1
- package/node_modules/socks/build/common/helpers.js +0 -167
- package/node_modules/socks/build/common/helpers.js.map +0 -1
- package/node_modules/socks/build/common/receivebuffer.js +0 -43
- package/node_modules/socks/build/common/receivebuffer.js.map +0 -1
- package/node_modules/socks/build/common/util.js +0 -25
- package/node_modules/socks/build/common/util.js.map +0 -1
- package/node_modules/socks/build/index.js +0 -18
- package/node_modules/socks/build/index.js.map +0 -1
- package/node_modules/socks/docs/examples/index.md +0 -17
- package/node_modules/socks/docs/examples/javascript/associateExample.md +0 -90
- package/node_modules/socks/docs/examples/javascript/bindExample.md +0 -83
- package/node_modules/socks/docs/examples/javascript/connectExample.md +0 -258
- package/node_modules/socks/docs/examples/typescript/associateExample.md +0 -93
- package/node_modules/socks/docs/examples/typescript/bindExample.md +0 -86
- package/node_modules/socks/docs/examples/typescript/connectExample.md +0 -265
- package/node_modules/socks/docs/index.md +0 -5
- package/node_modules/socks/docs/migratingFromV1.md +0 -86
- package/node_modules/socks/package.json +0 -58
- package/node_modules/socks/typings/client/socksclient.d.ts +0 -162
- package/node_modules/socks/typings/common/constants.d.ts +0 -151
- package/node_modules/socks/typings/common/helpers.d.ts +0 -17
- package/node_modules/socks/typings/common/receivebuffer.d.ts +0 -12
- package/node_modules/socks/typings/common/util.d.ts +0 -14
- package/node_modules/socks/typings/index.d.ts +0 -1
- package/node_modules/socks-proxy-agent/LICENSE +0 -22
- package/node_modules/socks-proxy-agent/README.md +0 -50
- package/node_modules/socks-proxy-agent/dist/index.d.ts +0 -27
- package/node_modules/socks-proxy-agent/dist/index.d.ts.map +0 -1
- package/node_modules/socks-proxy-agent/dist/index.js +0 -195
- package/node_modules/socks-proxy-agent/dist/index.js.map +0 -1
- package/node_modules/socks-proxy-agent/package.json +0 -142
- package/node_modules/source-map/LICENSE +0 -28
- package/node_modules/source-map/README.md +0 -742
- package/node_modules/source-map/dist/source-map.debug.js +0 -3234
- package/node_modules/source-map/dist/source-map.js +0 -3233
- package/node_modules/source-map/dist/source-map.min.js +0 -2
- package/node_modules/source-map/dist/source-map.min.js.map +0 -1
- package/node_modules/source-map/lib/array-set.js +0 -121
- package/node_modules/source-map/lib/base64-vlq.js +0 -140
- package/node_modules/source-map/lib/base64.js +0 -67
- package/node_modules/source-map/lib/binary-search.js +0 -111
- package/node_modules/source-map/lib/mapping-list.js +0 -79
- package/node_modules/source-map/lib/quick-sort.js +0 -114
- package/node_modules/source-map/lib/source-map-consumer.js +0 -1145
- package/node_modules/source-map/lib/source-map-generator.js +0 -425
- package/node_modules/source-map/lib/source-node.js +0 -413
- package/node_modules/source-map/lib/util.js +0 -488
- package/node_modules/source-map/package.json +0 -73
- package/node_modules/source-map/source-map.d.ts +0 -98
- package/node_modules/source-map/source-map.js +0 -8
- package/node_modules/string-width/index.d.ts +0 -29
- package/node_modules/string-width/index.js +0 -47
- package/node_modules/string-width/license +0 -9
- package/node_modules/string-width/node_modules/ansi-regex/index.d.ts +0 -37
- package/node_modules/string-width/node_modules/ansi-regex/index.js +0 -10
- package/node_modules/string-width/node_modules/ansi-regex/license +0 -9
- package/node_modules/string-width/node_modules/ansi-regex/package.json +0 -55
- package/node_modules/string-width/node_modules/ansi-regex/readme.md +0 -78
- package/node_modules/string-width/node_modules/strip-ansi/index.d.ts +0 -17
- package/node_modules/string-width/node_modules/strip-ansi/index.js +0 -4
- package/node_modules/string-width/node_modules/strip-ansi/license +0 -9
- package/node_modules/string-width/node_modules/strip-ansi/package.json +0 -54
- package/node_modules/string-width/node_modules/strip-ansi/readme.md +0 -46
- package/node_modules/string-width/package.json +0 -56
- package/node_modules/string-width/readme.md +0 -50
- package/node_modules/strip-ansi/index.d.ts +0 -15
- package/node_modules/strip-ansi/index.js +0 -19
- package/node_modules/strip-ansi/license +0 -9
- package/node_modules/strip-ansi/package.json +0 -59
- package/node_modules/strip-ansi/readme.md +0 -37
- package/node_modules/strtok3/LICENSE.txt +0 -21
- package/node_modules/strtok3/README.md +0 -399
- package/node_modules/strtok3/lib/AbstractTokenizer.d.ts +0 -76
- package/node_modules/strtok3/lib/AbstractTokenizer.js +0 -111
- package/node_modules/strtok3/lib/BlobTokenizer.d.ts +0 -29
- package/node_modules/strtok3/lib/BlobTokenizer.js +0 -53
- package/node_modules/strtok3/lib/BufferTokenizer.d.ts +0 -29
- package/node_modules/strtok3/lib/BufferTokenizer.js +0 -52
- package/node_modules/strtok3/lib/FileTokenizer.d.ts +0 -37
- package/node_modules/strtok3/lib/FileTokenizer.js +0 -61
- package/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +0 -34
- package/node_modules/strtok3/lib/ReadStreamTokenizer.js +0 -107
- package/node_modules/strtok3/lib/core.d.ts +0 -40
- package/node_modules/strtok3/lib/core.js +0 -62
- package/node_modules/strtok3/lib/index.d.ts +0 -16
- package/node_modules/strtok3/lib/index.js +0 -22
- package/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +0 -54
- package/node_modules/strtok3/lib/stream/AbstractStreamReader.js +0 -71
- package/node_modules/strtok3/lib/stream/Deferred.d.ts +0 -6
- package/node_modules/strtok3/lib/stream/Deferred.js +0 -10
- package/node_modules/strtok3/lib/stream/Errors.d.ts +0 -10
- package/node_modules/strtok3/lib/stream/Errors.js +0 -16
- package/node_modules/strtok3/lib/stream/StreamReader.d.ts +0 -29
- package/node_modules/strtok3/lib/stream/StreamReader.js +0 -83
- package/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +0 -14
- package/node_modules/strtok3/lib/stream/WebStreamByobReader.js +0 -27
- package/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +0 -19
- package/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +0 -62
- package/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +0 -14
- package/node_modules/strtok3/lib/stream/WebStreamReader.js +0 -13
- package/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +0 -5
- package/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +0 -19
- package/node_modules/strtok3/lib/stream/index.d.ts +0 -6
- package/node_modules/strtok3/lib/stream/index.js +0 -5
- package/node_modules/strtok3/lib/types.d.ts +0 -139
- package/node_modules/strtok3/lib/types.js +0 -1
- package/node_modules/strtok3/package.json +0 -94
- package/node_modules/supports-color/browser.js +0 -5
- package/node_modules/supports-color/index.js +0 -135
- package/node_modules/supports-color/license +0 -9
- package/node_modules/supports-color/package.json +0 -53
- package/node_modules/supports-color/readme.md +0 -76
- package/node_modules/thenify/LICENSE +0 -22
- package/node_modules/thenify/README.md +0 -120
- package/node_modules/thenify/index.js +0 -77
- package/node_modules/thenify/package.json +0 -31
- package/node_modules/thenify-all/LICENSE +0 -22
- package/node_modules/thenify-all/README.md +0 -66
- package/node_modules/thenify-all/index.js +0 -73
- package/node_modules/thenify-all/package.json +0 -34
- package/node_modules/token-types/LICENSE.txt +0 -9
- package/node_modules/token-types/README.md +0 -120
- package/node_modules/token-types/lib/index.d.ts +0 -135
- package/node_modules/token-types/lib/index.js +0 -401
- package/node_modules/token-types/package.json +0 -81
- package/node_modules/uint8array-extras/index.d.ts +0 -331
- package/node_modules/uint8array-extras/index.js +0 -318
- package/node_modules/uint8array-extras/license +0 -9
- package/node_modules/uint8array-extras/package.json +0 -54
- package/node_modules/uint8array-extras/readme.md +0 -318
- package/node_modules/uuid/LICENSE.md +0 -9
- package/node_modules/uuid/README.md +0 -491
- package/node_modules/uuid/dist/index.d.ts +0 -15
- package/node_modules/uuid/dist/index.js +0 -14
- package/node_modules/uuid/dist/max.d.ts +0 -2
- package/node_modules/uuid/dist/max.js +0 -1
- package/node_modules/uuid/dist/md5.d.ts +0 -2
- package/node_modules/uuid/dist/md5.js +0 -135
- package/node_modules/uuid/dist/nil.d.ts +0 -2
- package/node_modules/uuid/dist/nil.js +0 -1
- package/node_modules/uuid/dist/parse.d.ts +0 -3
- package/node_modules/uuid/dist/parse.js +0 -9
- package/node_modules/uuid/dist/regex.d.ts +0 -2
- package/node_modules/uuid/dist/regex.js +0 -1
- package/node_modules/uuid/dist/rng.d.ts +0 -1
- package/node_modules/uuid/dist/rng.js +0 -4
- package/node_modules/uuid/dist/sha1.d.ts +0 -2
- package/node_modules/uuid/dist/sha1.js +0 -70
- package/node_modules/uuid/dist/stringify.d.ts +0 -3
- package/node_modules/uuid/dist/stringify.js +0 -35
- package/node_modules/uuid/dist/types.d.ts +0 -22
- package/node_modules/uuid/dist/types.js +0 -1
- package/node_modules/uuid/dist/uuid-bin.d.ts +0 -1
- package/node_modules/uuid/dist/uuid-bin.js +0 -70
- package/node_modules/uuid/dist/v1.d.ts +0 -11
- package/node_modules/uuid/dist/v1.js +0 -83
- package/node_modules/uuid/dist/v1ToV6.d.ts +0 -3
- package/node_modules/uuid/dist/v1ToV6.js +0 -10
- package/node_modules/uuid/dist/v3.d.ts +0 -9
- package/node_modules/uuid/dist/v3.js +0 -9
- package/node_modules/uuid/dist/v35.d.ts +0 -7
- package/node_modules/uuid/dist/v35.js +0 -39
- package/node_modules/uuid/dist/v4.d.ts +0 -4
- package/node_modules/uuid/dist/v4.js +0 -29
- package/node_modules/uuid/dist/v5.d.ts +0 -9
- package/node_modules/uuid/dist/v5.js +0 -9
- package/node_modules/uuid/dist/v6.d.ts +0 -4
- package/node_modules/uuid/dist/v6.js +0 -20
- package/node_modules/uuid/dist/v6ToV1.d.ts +0 -2
- package/node_modules/uuid/dist/v6ToV1.js +0 -10
- package/node_modules/uuid/dist/v7.d.ts +0 -9
- package/node_modules/uuid/dist/v7.js +0 -65
- package/node_modules/uuid/dist/validate.d.ts +0 -2
- package/node_modules/uuid/dist/validate.js +0 -5
- package/node_modules/uuid/dist/version.d.ts +0 -2
- package/node_modules/uuid/dist/version.js +0 -8
- package/node_modules/uuid/dist-node/bin/uuid +0 -2
- package/node_modules/uuid/dist-node/index.js +0 -14
- package/node_modules/uuid/dist-node/max.js +0 -1
- package/node_modules/uuid/dist-node/md5.js +0 -11
- package/node_modules/uuid/dist-node/nil.js +0 -1
- package/node_modules/uuid/dist-node/parse.js +0 -9
- package/node_modules/uuid/dist-node/regex.js +0 -1
- package/node_modules/uuid/dist-node/rng.js +0 -4
- package/node_modules/uuid/dist-node/sha1.js +0 -11
- package/node_modules/uuid/dist-node/stringify.js +0 -35
- package/node_modules/uuid/dist-node/types.js +0 -1
- package/node_modules/uuid/dist-node/uuid-bin.js +0 -70
- package/node_modules/uuid/dist-node/v1.js +0 -83
- package/node_modules/uuid/dist-node/v1ToV6.js +0 -10
- package/node_modules/uuid/dist-node/v3.js +0 -9
- package/node_modules/uuid/dist-node/v35.js +0 -39
- package/node_modules/uuid/dist-node/v4.js +0 -29
- package/node_modules/uuid/dist-node/v5.js +0 -9
- package/node_modules/uuid/dist-node/v6.js +0 -20
- package/node_modules/uuid/dist-node/v6ToV1.js +0 -10
- package/node_modules/uuid/dist-node/v7.js +0 -65
- package/node_modules/uuid/dist-node/validate.js +0 -5
- package/node_modules/uuid/dist-node/version.js +0 -8
- package/node_modules/uuid/package.json +0 -110
- package/node_modules/wrap-ansi/index.js +0 -216
- package/node_modules/wrap-ansi/license +0 -9
- package/node_modules/wrap-ansi/node_modules/ansi-regex/index.d.ts +0 -37
- package/node_modules/wrap-ansi/node_modules/ansi-regex/index.js +0 -10
- package/node_modules/wrap-ansi/node_modules/ansi-regex/license +0 -9
- package/node_modules/wrap-ansi/node_modules/ansi-regex/package.json +0 -55
- package/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md +0 -78
- package/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts +0 -17
- package/node_modules/wrap-ansi/node_modules/strip-ansi/index.js +0 -4
- package/node_modules/wrap-ansi/node_modules/strip-ansi/license +0 -9
- package/node_modules/wrap-ansi/node_modules/strip-ansi/package.json +0 -54
- package/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md +0 -46
- package/node_modules/wrap-ansi/package.json +0 -62
- package/node_modules/wrap-ansi/readme.md +0 -91
- package/node_modules/wrappy/README.md +0 -36
- package/node_modules/wrappy/package.json +0 -29
- package/node_modules/wrappy/wrappy.js +0 -33
- package/node_modules/y18n/LICENSE +0 -13
- package/node_modules/y18n/README.md +0 -127
- package/node_modules/y18n/build/index.cjs +0 -203
- package/node_modules/y18n/build/lib/cjs.js +0 -6
- package/node_modules/y18n/build/lib/index.js +0 -174
- package/node_modules/y18n/build/lib/platform-shims/node.js +0 -19
- package/node_modules/y18n/index.mjs +0 -8
- package/node_modules/y18n/package.json +0 -70
- package/node_modules/yargs/LICENSE +0 -21
- package/node_modules/yargs/README.md +0 -202
- package/node_modules/yargs/browser.mjs +0 -7
- package/node_modules/yargs/build/index.cjs +0 -2920
- package/node_modules/yargs/build/lib/argsert.js +0 -62
- package/node_modules/yargs/build/lib/command.js +0 -382
- package/node_modules/yargs/build/lib/completion-templates.js +0 -47
- package/node_modules/yargs/build/lib/completion.js +0 -128
- package/node_modules/yargs/build/lib/middleware.js +0 -53
- package/node_modules/yargs/build/lib/parse-command.js +0 -32
- package/node_modules/yargs/build/lib/typings/common-types.js +0 -9
- package/node_modules/yargs/build/lib/typings/yargs-parser-types.js +0 -1
- package/node_modules/yargs/build/lib/usage.js +0 -548
- package/node_modules/yargs/build/lib/utils/apply-extends.js +0 -59
- package/node_modules/yargs/build/lib/utils/is-promise.js +0 -5
- package/node_modules/yargs/build/lib/utils/levenshtein.js +0 -26
- package/node_modules/yargs/build/lib/utils/obj-filter.js +0 -10
- package/node_modules/yargs/build/lib/utils/process-argv.js +0 -17
- package/node_modules/yargs/build/lib/utils/set-blocking.js +0 -12
- package/node_modules/yargs/build/lib/utils/which-module.js +0 -10
- package/node_modules/yargs/build/lib/validation.js +0 -308
- package/node_modules/yargs/build/lib/yargs-factory.js +0 -1143
- package/node_modules/yargs/build/lib/yerror.js +0 -7
- package/node_modules/yargs/helpers/helpers.mjs +0 -10
- package/node_modules/yargs/helpers/index.js +0 -14
- package/node_modules/yargs/helpers/package.json +0 -3
- package/node_modules/yargs/index.cjs +0 -39
- package/node_modules/yargs/index.mjs +0 -8
- package/node_modules/yargs/lib/platform-shims/browser.mjs +0 -92
- package/node_modules/yargs/lib/platform-shims/esm.mjs +0 -67
- package/node_modules/yargs/locales/be.json +0 -46
- package/node_modules/yargs/locales/de.json +0 -46
- package/node_modules/yargs/locales/en.json +0 -51
- package/node_modules/yargs/locales/es.json +0 -46
- package/node_modules/yargs/locales/fi.json +0 -49
- package/node_modules/yargs/locales/fr.json +0 -53
- package/node_modules/yargs/locales/hi.json +0 -49
- package/node_modules/yargs/locales/hu.json +0 -46
- package/node_modules/yargs/locales/id.json +0 -50
- package/node_modules/yargs/locales/it.json +0 -46
- package/node_modules/yargs/locales/ja.json +0 -51
- package/node_modules/yargs/locales/ko.json +0 -49
- package/node_modules/yargs/locales/nb.json +0 -44
- package/node_modules/yargs/locales/nl.json +0 -49
- package/node_modules/yargs/locales/nn.json +0 -44
- package/node_modules/yargs/locales/pirate.json +0 -13
- package/node_modules/yargs/locales/pl.json +0 -49
- package/node_modules/yargs/locales/pt.json +0 -45
- package/node_modules/yargs/locales/pt_BR.json +0 -48
- package/node_modules/yargs/locales/ru.json +0 -46
- package/node_modules/yargs/locales/th.json +0 -46
- package/node_modules/yargs/locales/tr.json +0 -48
- package/node_modules/yargs/locales/zh_CN.json +0 -48
- package/node_modules/yargs/locales/zh_TW.json +0 -47
- package/node_modules/yargs/package.json +0 -122
- package/node_modules/yargs/yargs +0 -9
- package/node_modules/yargs-parser/LICENSE.txt +0 -14
- package/node_modules/yargs-parser/README.md +0 -518
- package/node_modules/yargs-parser/browser.js +0 -29
- package/node_modules/yargs-parser/build/index.cjs +0 -1042
- package/node_modules/yargs-parser/build/lib/index.js +0 -59
- package/node_modules/yargs-parser/build/lib/string-utils.js +0 -65
- package/node_modules/yargs-parser/build/lib/tokenize-arg-string.js +0 -40
- package/node_modules/yargs-parser/build/lib/yargs-parser-types.js +0 -12
- package/node_modules/yargs-parser/build/lib/yargs-parser.js +0 -1037
- package/node_modules/yargs-parser/package.json +0 -87
- package/node_modules/yauzl/LICENSE +0 -21
- package/node_modules/yauzl/README.md +0 -658
- package/node_modules/yauzl/index.js +0 -796
- package/node_modules/yauzl/package.json +0 -40
- /package/node_modules/{once → isexe}/LICENSE +0 -0
- /package/node_modules/{ansi-styles → path-key}/license +0 -0
- /package/node_modules/{cli-highlight/node_modules/chalk → shebang-regex}/license +0 -0
- /package/node_modules/{wrappy → which}/LICENSE +0 -0
package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h1.js
ADDED
|
@@ -0,0 +1,1669 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/* global WebAssembly */
|
|
4
|
+
|
|
5
|
+
const assert = require('node:assert')
|
|
6
|
+
const util = require('../core/util.js')
|
|
7
|
+
const { channels } = require('../core/diagnostics.js')
|
|
8
|
+
const timers = require('../util/timers.js')
|
|
9
|
+
const {
|
|
10
|
+
RequestContentLengthMismatchError,
|
|
11
|
+
ResponseContentLengthMismatchError,
|
|
12
|
+
RequestAbortedError,
|
|
13
|
+
HeadersTimeoutError,
|
|
14
|
+
HeadersOverflowError,
|
|
15
|
+
SocketError,
|
|
16
|
+
InformationalError,
|
|
17
|
+
BodyTimeoutError,
|
|
18
|
+
HTTPParserError,
|
|
19
|
+
ResponseExceededMaxSizeError
|
|
20
|
+
} = require('../core/errors.js')
|
|
21
|
+
const {
|
|
22
|
+
kUrl,
|
|
23
|
+
kReset,
|
|
24
|
+
kClient,
|
|
25
|
+
kParser,
|
|
26
|
+
kBlocking,
|
|
27
|
+
kRunning,
|
|
28
|
+
kPending,
|
|
29
|
+
kSize,
|
|
30
|
+
kWriting,
|
|
31
|
+
kQueue,
|
|
32
|
+
kNoRef,
|
|
33
|
+
kKeepAliveDefaultTimeout,
|
|
34
|
+
kHostHeader,
|
|
35
|
+
kPendingIdx,
|
|
36
|
+
kRunningIdx,
|
|
37
|
+
kError,
|
|
38
|
+
kPipelining,
|
|
39
|
+
kSocket,
|
|
40
|
+
kKeepAliveTimeoutValue,
|
|
41
|
+
kMaxHeadersSize,
|
|
42
|
+
kKeepAliveMaxTimeout,
|
|
43
|
+
kKeepAliveTimeoutThreshold,
|
|
44
|
+
kHeadersTimeout,
|
|
45
|
+
kBodyTimeout,
|
|
46
|
+
kStrictContentLength,
|
|
47
|
+
kMaxRequests,
|
|
48
|
+
kCounter,
|
|
49
|
+
kMaxResponseSize,
|
|
50
|
+
kOnError,
|
|
51
|
+
kResume,
|
|
52
|
+
kHTTPContext,
|
|
53
|
+
kClosed
|
|
54
|
+
} = require('../core/symbols.js')
|
|
55
|
+
|
|
56
|
+
const constants = require('../llhttp/constants.js')
|
|
57
|
+
const EMPTY_BUF = Buffer.alloc(0)
|
|
58
|
+
const FastBuffer = Buffer[Symbol.species]
|
|
59
|
+
const removeAllListeners = util.removeAllListeners
|
|
60
|
+
|
|
61
|
+
let extractBody
|
|
62
|
+
|
|
63
|
+
function lazyllhttp () {
|
|
64
|
+
const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined
|
|
65
|
+
|
|
66
|
+
let mod
|
|
67
|
+
|
|
68
|
+
// We disable wasm SIMD on ppc64 as it seems to be broken on Power 9 architectures.
|
|
69
|
+
let useWasmSIMD = process.arch !== 'ppc64'
|
|
70
|
+
// The Env Variable UNDICI_NO_WASM_SIMD allows explicitly overriding the default behavior
|
|
71
|
+
if (process.env.UNDICI_NO_WASM_SIMD === '1') {
|
|
72
|
+
useWasmSIMD = false
|
|
73
|
+
} else if (process.env.UNDICI_NO_WASM_SIMD === '0') {
|
|
74
|
+
useWasmSIMD = true
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (useWasmSIMD) {
|
|
78
|
+
try {
|
|
79
|
+
mod = new WebAssembly.Module(require('../llhttp/llhttp_simd-wasm.js'))
|
|
80
|
+
} catch {
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (!mod) {
|
|
85
|
+
// We could check if the error was caused by the simd option not
|
|
86
|
+
// being enabled, but the occurring of this other error
|
|
87
|
+
// * https://github.com/emscripten-core/emscripten/issues/11495
|
|
88
|
+
// got me to remove that check to avoid breaking Node 12.
|
|
89
|
+
mod = new WebAssembly.Module(llhttpWasmData || require('../llhttp/llhttp-wasm.js'))
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return new WebAssembly.Instance(mod, {
|
|
93
|
+
env: {
|
|
94
|
+
/**
|
|
95
|
+
* @param {number} p
|
|
96
|
+
* @param {number} at
|
|
97
|
+
* @param {number} len
|
|
98
|
+
* @returns {number}
|
|
99
|
+
*/
|
|
100
|
+
wasm_on_url: (p, at, len) => {
|
|
101
|
+
return 0
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* @param {number} p
|
|
105
|
+
* @param {number} at
|
|
106
|
+
* @param {number} len
|
|
107
|
+
* @returns {number}
|
|
108
|
+
*/
|
|
109
|
+
wasm_on_status: (p, at, len) => {
|
|
110
|
+
assert(currentParser.ptr === p)
|
|
111
|
+
const start = at - currentBufferPtr + currentBufferRef.byteOffset
|
|
112
|
+
return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len))
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* @param {number} p
|
|
116
|
+
* @returns {number}
|
|
117
|
+
*/
|
|
118
|
+
wasm_on_message_begin: (p) => {
|
|
119
|
+
assert(currentParser.ptr === p)
|
|
120
|
+
return currentParser.onMessageBegin()
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* @param {number} p
|
|
124
|
+
* @param {number} at
|
|
125
|
+
* @param {number} len
|
|
126
|
+
* @returns {number}
|
|
127
|
+
*/
|
|
128
|
+
wasm_on_header_field: (p, at, len) => {
|
|
129
|
+
assert(currentParser.ptr === p)
|
|
130
|
+
const start = at - currentBufferPtr + currentBufferRef.byteOffset
|
|
131
|
+
return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len))
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* @param {number} p
|
|
135
|
+
* @param {number} at
|
|
136
|
+
* @param {number} len
|
|
137
|
+
* @returns {number}
|
|
138
|
+
*/
|
|
139
|
+
wasm_on_header_value: (p, at, len) => {
|
|
140
|
+
assert(currentParser.ptr === p)
|
|
141
|
+
const start = at - currentBufferPtr + currentBufferRef.byteOffset
|
|
142
|
+
return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len))
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* @param {number} p
|
|
146
|
+
* @param {number} statusCode
|
|
147
|
+
* @param {0|1} upgrade
|
|
148
|
+
* @param {0|1} shouldKeepAlive
|
|
149
|
+
* @returns {number}
|
|
150
|
+
*/
|
|
151
|
+
wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
|
|
152
|
+
assert(currentParser.ptr === p)
|
|
153
|
+
return currentParser.onHeadersComplete(statusCode, upgrade === 1, shouldKeepAlive === 1)
|
|
154
|
+
},
|
|
155
|
+
/**
|
|
156
|
+
* @param {number} p
|
|
157
|
+
* @param {number} at
|
|
158
|
+
* @param {number} len
|
|
159
|
+
* @returns {number}
|
|
160
|
+
*/
|
|
161
|
+
wasm_on_body: (p, at, len) => {
|
|
162
|
+
assert(currentParser.ptr === p)
|
|
163
|
+
const start = at - currentBufferPtr + currentBufferRef.byteOffset
|
|
164
|
+
return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len))
|
|
165
|
+
},
|
|
166
|
+
/**
|
|
167
|
+
* @param {number} p
|
|
168
|
+
* @returns {number}
|
|
169
|
+
*/
|
|
170
|
+
wasm_on_message_complete: (p) => {
|
|
171
|
+
assert(currentParser.ptr === p)
|
|
172
|
+
return currentParser.onMessageComplete()
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
let llhttpInstance = null
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @type {Parser|null}
|
|
183
|
+
*/
|
|
184
|
+
let currentParser = null
|
|
185
|
+
let currentBufferRef = null
|
|
186
|
+
/**
|
|
187
|
+
* @type {number}
|
|
188
|
+
*/
|
|
189
|
+
let currentBufferSize = 0
|
|
190
|
+
let currentBufferPtr = null
|
|
191
|
+
let currentBuffer = null
|
|
192
|
+
|
|
193
|
+
const USE_NATIVE_TIMER = 0
|
|
194
|
+
const USE_FAST_TIMER = 1
|
|
195
|
+
|
|
196
|
+
// Use fast timers for headers and body to take eventual event loop
|
|
197
|
+
// latency into account.
|
|
198
|
+
const TIMEOUT_HEADERS = 2 | USE_FAST_TIMER
|
|
199
|
+
const TIMEOUT_BODY = 4 | USE_FAST_TIMER
|
|
200
|
+
|
|
201
|
+
// Use native timers to ignore event loop latency for keep-alive
|
|
202
|
+
// handling.
|
|
203
|
+
const TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER
|
|
204
|
+
|
|
205
|
+
class Parser {
|
|
206
|
+
/**
|
|
207
|
+
* @param {import('./client.js')} client
|
|
208
|
+
* @param {import('net').Socket} socket
|
|
209
|
+
* @param {*} llhttp
|
|
210
|
+
*/
|
|
211
|
+
constructor (client, socket, { exports }) {
|
|
212
|
+
this.llhttp = exports
|
|
213
|
+
this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
|
|
214
|
+
this.client = client
|
|
215
|
+
/**
|
|
216
|
+
* @type {import('net').Socket}
|
|
217
|
+
*/
|
|
218
|
+
this.socket = socket
|
|
219
|
+
this.timeout = null
|
|
220
|
+
this.timeoutWeakRef = new WeakRef(this)
|
|
221
|
+
this.timeoutValue = null
|
|
222
|
+
this.timeoutType = null
|
|
223
|
+
this.statusCode = 0
|
|
224
|
+
this.statusText = ''
|
|
225
|
+
this.upgrade = false
|
|
226
|
+
this.headers = []
|
|
227
|
+
this.headersSize = 0
|
|
228
|
+
this.headersMaxSize = client[kMaxHeadersSize]
|
|
229
|
+
this.shouldKeepAlive = false
|
|
230
|
+
this.paused = false
|
|
231
|
+
this.resume = this.resume.bind(this)
|
|
232
|
+
|
|
233
|
+
this.bytesRead = 0
|
|
234
|
+
|
|
235
|
+
this.keepAlive = ''
|
|
236
|
+
this.contentLength = -1
|
|
237
|
+
this.connectionKeepAlive = false
|
|
238
|
+
this.maxResponseSize = client[kMaxResponseSize]
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
setTimeout (delay, type) {
|
|
242
|
+
// If the existing timer and the new timer are of different timer type
|
|
243
|
+
// (fast or native) or have different delay, we need to clear the existing
|
|
244
|
+
// timer and set a new one.
|
|
245
|
+
if (
|
|
246
|
+
delay !== this.timeoutValue ||
|
|
247
|
+
(type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER)
|
|
248
|
+
) {
|
|
249
|
+
// If a timeout is already set, clear it with clearTimeout of the fast
|
|
250
|
+
// timer implementation, as it can clear fast and native timers.
|
|
251
|
+
if (this.timeout) {
|
|
252
|
+
timers.clearTimeout(this.timeout)
|
|
253
|
+
this.timeout = null
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (delay) {
|
|
257
|
+
if (type & USE_FAST_TIMER) {
|
|
258
|
+
this.timeout = timers.setFastTimeout(onParserTimeout, delay, this.timeoutWeakRef)
|
|
259
|
+
} else {
|
|
260
|
+
this.timeout = setTimeout(onParserTimeout, delay, this.timeoutWeakRef)
|
|
261
|
+
this.timeout?.unref()
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
this.timeoutValue = delay
|
|
266
|
+
} else if (this.timeout) {
|
|
267
|
+
if (this.timeout.refresh) {
|
|
268
|
+
this.timeout.refresh()
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
this.timeoutType = type
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
resume () {
|
|
276
|
+
if (this.socket.destroyed || !this.paused) {
|
|
277
|
+
return
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
assert(this.ptr != null)
|
|
281
|
+
assert(currentParser === null)
|
|
282
|
+
|
|
283
|
+
this.llhttp.llhttp_resume(this.ptr)
|
|
284
|
+
|
|
285
|
+
assert(this.timeoutType === TIMEOUT_BODY)
|
|
286
|
+
if (this.timeout) {
|
|
287
|
+
if (this.timeout.refresh) {
|
|
288
|
+
this.timeout.refresh()
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
this.paused = false
|
|
293
|
+
this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
|
|
294
|
+
this.readMore()
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
readMore () {
|
|
298
|
+
while (!this.paused && this.ptr) {
|
|
299
|
+
const chunk = this.socket.read()
|
|
300
|
+
if (chunk === null) {
|
|
301
|
+
break
|
|
302
|
+
}
|
|
303
|
+
this.execute(chunk)
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* @param {Buffer} chunk
|
|
309
|
+
*/
|
|
310
|
+
execute (chunk) {
|
|
311
|
+
assert(currentParser === null)
|
|
312
|
+
assert(this.ptr != null)
|
|
313
|
+
assert(!this.paused)
|
|
314
|
+
|
|
315
|
+
const { socket, llhttp } = this
|
|
316
|
+
|
|
317
|
+
// Allocate a new buffer if the current buffer is too small.
|
|
318
|
+
if (chunk.length > currentBufferSize) {
|
|
319
|
+
if (currentBufferPtr) {
|
|
320
|
+
llhttp.free(currentBufferPtr)
|
|
321
|
+
}
|
|
322
|
+
// Allocate a buffer that is a multiple of 4096 bytes.
|
|
323
|
+
currentBufferSize = Math.ceil(chunk.length / 4096) * 4096
|
|
324
|
+
currentBufferPtr = llhttp.malloc(currentBufferSize)
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (
|
|
328
|
+
currentBuffer === null ||
|
|
329
|
+
currentBuffer.buffer !== llhttp.memory.buffer ||
|
|
330
|
+
currentBuffer.byteOffset !== currentBufferPtr ||
|
|
331
|
+
currentBuffer.byteLength !== currentBufferSize
|
|
332
|
+
) {
|
|
333
|
+
currentBuffer = new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize)
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
currentBuffer.set(chunk)
|
|
337
|
+
|
|
338
|
+
// Call `execute` on the wasm parser.
|
|
339
|
+
// We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
|
|
340
|
+
// and finally the length of bytes to parse.
|
|
341
|
+
// The return value is an error code or `constants.ERROR.OK`.
|
|
342
|
+
try {
|
|
343
|
+
let ret
|
|
344
|
+
|
|
345
|
+
try {
|
|
346
|
+
currentBufferRef = chunk
|
|
347
|
+
currentParser = this
|
|
348
|
+
ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, chunk.length)
|
|
349
|
+
} finally {
|
|
350
|
+
currentParser = null
|
|
351
|
+
currentBufferRef = null
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
if (ret !== constants.ERROR.OK) {
|
|
355
|
+
const data = chunk.subarray(llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr)
|
|
356
|
+
|
|
357
|
+
if (ret === constants.ERROR.PAUSED_UPGRADE) {
|
|
358
|
+
this.onUpgrade(data)
|
|
359
|
+
} else if (ret === constants.ERROR.PAUSED) {
|
|
360
|
+
this.paused = true
|
|
361
|
+
socket.unshift(data)
|
|
362
|
+
} else {
|
|
363
|
+
throw this.createError(ret, data)
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
} catch (err) {
|
|
367
|
+
util.destroy(socket, err)
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
finish () {
|
|
372
|
+
assert(currentParser === null)
|
|
373
|
+
assert(this.ptr != null)
|
|
374
|
+
assert(!this.paused)
|
|
375
|
+
|
|
376
|
+
const { llhttp } = this
|
|
377
|
+
|
|
378
|
+
let ret
|
|
379
|
+
|
|
380
|
+
try {
|
|
381
|
+
currentParser = this
|
|
382
|
+
ret = llhttp.llhttp_finish(this.ptr)
|
|
383
|
+
} finally {
|
|
384
|
+
currentParser = null
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (ret === constants.ERROR.OK) {
|
|
388
|
+
return null
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {
|
|
392
|
+
this.paused = true
|
|
393
|
+
return null
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return this.createError(ret, EMPTY_BUF)
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
createError (ret, data) {
|
|
400
|
+
const { llhttp, contentLength, bytesRead } = this
|
|
401
|
+
|
|
402
|
+
if (contentLength !== -1 && bytesRead !== contentLength) {
|
|
403
|
+
return new ResponseContentLengthMismatchError()
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
const ptr = llhttp.llhttp_get_error_reason(this.ptr)
|
|
407
|
+
let message = ''
|
|
408
|
+
if (ptr) {
|
|
409
|
+
const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
|
|
410
|
+
message =
|
|
411
|
+
'Response does not match the HTTP/1.1 protocol (' +
|
|
412
|
+
Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
|
|
413
|
+
')'
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return new HTTPParserError(message, constants.ERROR[ret], data)
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
destroy () {
|
|
420
|
+
assert(currentParser === null)
|
|
421
|
+
assert(this.ptr != null)
|
|
422
|
+
|
|
423
|
+
this.llhttp.llhttp_free(this.ptr)
|
|
424
|
+
this.ptr = null
|
|
425
|
+
|
|
426
|
+
this.timeout && timers.clearTimeout(this.timeout)
|
|
427
|
+
this.timeout = null
|
|
428
|
+
this.timeoutValue = null
|
|
429
|
+
this.timeoutType = null
|
|
430
|
+
|
|
431
|
+
this.paused = false
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* @param {Buffer} buf
|
|
436
|
+
* @returns {0}
|
|
437
|
+
*/
|
|
438
|
+
onStatus (buf) {
|
|
439
|
+
this.statusText = buf.toString()
|
|
440
|
+
return 0
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* @returns {0|-1}
|
|
445
|
+
*/
|
|
446
|
+
onMessageBegin () {
|
|
447
|
+
const { socket, client } = this
|
|
448
|
+
|
|
449
|
+
if (socket.destroyed) {
|
|
450
|
+
return -1
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
const request = client[kQueue][client[kRunningIdx]]
|
|
454
|
+
if (!request) {
|
|
455
|
+
return -1
|
|
456
|
+
}
|
|
457
|
+
request.onResponseStarted()
|
|
458
|
+
|
|
459
|
+
return 0
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* @param {Buffer} buf
|
|
464
|
+
* @returns {number}
|
|
465
|
+
*/
|
|
466
|
+
onHeaderField (buf) {
|
|
467
|
+
const len = this.headers.length
|
|
468
|
+
|
|
469
|
+
if ((len & 1) === 0) {
|
|
470
|
+
this.headers.push(buf)
|
|
471
|
+
} else {
|
|
472
|
+
this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
this.trackHeader(buf.length)
|
|
476
|
+
|
|
477
|
+
return 0
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* @param {Buffer} buf
|
|
482
|
+
* @returns {number}
|
|
483
|
+
*/
|
|
484
|
+
onHeaderValue (buf) {
|
|
485
|
+
let len = this.headers.length
|
|
486
|
+
|
|
487
|
+
if ((len & 1) === 1) {
|
|
488
|
+
this.headers.push(buf)
|
|
489
|
+
len += 1
|
|
490
|
+
} else {
|
|
491
|
+
this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
const key = this.headers[len - 2]
|
|
495
|
+
if (key.length === 10) {
|
|
496
|
+
const headerName = util.bufferToLowerCasedHeaderName(key)
|
|
497
|
+
if (headerName === 'keep-alive') {
|
|
498
|
+
this.keepAlive += buf.toString()
|
|
499
|
+
} else if (headerName === 'connection') {
|
|
500
|
+
this.connectionKeepAlive =
|
|
501
|
+
this.headers[len - 1].length === 10 &&
|
|
502
|
+
util.bufferToLowerCasedHeaderName(this.headers[len - 1]) === 'keep-alive'
|
|
503
|
+
}
|
|
504
|
+
} else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') {
|
|
505
|
+
if (this.contentLength === -1) {
|
|
506
|
+
this.contentLength = 0
|
|
507
|
+
}
|
|
508
|
+
for (let i = 0; i < buf.length; i++) {
|
|
509
|
+
this.contentLength = (this.contentLength * 10) + (buf[i] - 0x30)
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
this.trackHeader(buf.length)
|
|
514
|
+
|
|
515
|
+
return 0
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* @param {number} len
|
|
520
|
+
*/
|
|
521
|
+
trackHeader (len) {
|
|
522
|
+
this.headersSize += len
|
|
523
|
+
if (this.headersSize >= this.headersMaxSize) {
|
|
524
|
+
util.destroy(this.socket, new HeadersOverflowError())
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* @param {Buffer} head
|
|
530
|
+
*/
|
|
531
|
+
onUpgrade (head) {
|
|
532
|
+
const { upgrade, client, socket, headers, statusCode } = this
|
|
533
|
+
|
|
534
|
+
assert(upgrade)
|
|
535
|
+
assert(client[kSocket] === socket)
|
|
536
|
+
assert(!socket.destroyed)
|
|
537
|
+
assert(!this.paused)
|
|
538
|
+
assert((headers.length & 1) === 0)
|
|
539
|
+
|
|
540
|
+
const request = client[kQueue][client[kRunningIdx]]
|
|
541
|
+
assert(request)
|
|
542
|
+
assert(request.upgrade || request.method === 'CONNECT')
|
|
543
|
+
|
|
544
|
+
this.statusCode = 0
|
|
545
|
+
this.statusText = ''
|
|
546
|
+
this.shouldKeepAlive = false
|
|
547
|
+
|
|
548
|
+
this.headers = []
|
|
549
|
+
this.headersSize = 0
|
|
550
|
+
|
|
551
|
+
socket.unshift(head)
|
|
552
|
+
|
|
553
|
+
socket[kParser].destroy()
|
|
554
|
+
socket[kParser] = null
|
|
555
|
+
|
|
556
|
+
socket[kClient] = null
|
|
557
|
+
socket[kError] = null
|
|
558
|
+
|
|
559
|
+
removeAllListeners(socket)
|
|
560
|
+
|
|
561
|
+
client[kSocket] = null
|
|
562
|
+
client[kHTTPContext] = null // TODO (fix): This is hacky...
|
|
563
|
+
client[kQueue][client[kRunningIdx]++] = null
|
|
564
|
+
client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
|
|
565
|
+
|
|
566
|
+
try {
|
|
567
|
+
request.onRequestUpgrade(statusCode, headers, socket)
|
|
568
|
+
} catch (err) {
|
|
569
|
+
util.destroy(socket, err)
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
client[kResume]()
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* @param {number} statusCode
|
|
577
|
+
* @param {boolean} upgrade
|
|
578
|
+
* @param {boolean} shouldKeepAlive
|
|
579
|
+
* @returns {number}
|
|
580
|
+
*/
|
|
581
|
+
onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
|
|
582
|
+
const { client, socket, headers, statusText } = this
|
|
583
|
+
|
|
584
|
+
if (socket.destroyed) {
|
|
585
|
+
return -1
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
const request = client[kQueue][client[kRunningIdx]]
|
|
589
|
+
|
|
590
|
+
if (!request) {
|
|
591
|
+
return -1
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
assert(!this.upgrade)
|
|
595
|
+
assert(this.statusCode < 200)
|
|
596
|
+
|
|
597
|
+
if (statusCode === 100) {
|
|
598
|
+
util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
|
|
599
|
+
return -1
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/* this can only happen if server is misbehaving */
|
|
603
|
+
if (upgrade && !request.upgrade) {
|
|
604
|
+
util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
|
|
605
|
+
return -1
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
assert(this.timeoutType === TIMEOUT_HEADERS)
|
|
609
|
+
|
|
610
|
+
this.statusCode = statusCode
|
|
611
|
+
this.shouldKeepAlive = (
|
|
612
|
+
shouldKeepAlive ||
|
|
613
|
+
// Override llhttp value which does not allow keepAlive for HEAD.
|
|
614
|
+
(request.method === 'HEAD' && !socket[kReset] && this.connectionKeepAlive)
|
|
615
|
+
)
|
|
616
|
+
|
|
617
|
+
if (this.statusCode >= 200) {
|
|
618
|
+
const bodyTimeout = request.bodyTimeout != null
|
|
619
|
+
? request.bodyTimeout
|
|
620
|
+
: client[kBodyTimeout]
|
|
621
|
+
this.setTimeout(bodyTimeout, TIMEOUT_BODY)
|
|
622
|
+
} else if (this.timeout) {
|
|
623
|
+
if (this.timeout.refresh) {
|
|
624
|
+
this.timeout.refresh()
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
if (request.method === 'CONNECT') {
|
|
629
|
+
assert(client[kRunning] === 1)
|
|
630
|
+
this.upgrade = true
|
|
631
|
+
return 2
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
if (upgrade) {
|
|
635
|
+
assert(client[kRunning] === 1)
|
|
636
|
+
this.upgrade = true
|
|
637
|
+
return 2
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
assert((this.headers.length & 1) === 0)
|
|
641
|
+
this.headers = []
|
|
642
|
+
this.headersSize = 0
|
|
643
|
+
|
|
644
|
+
if (this.shouldKeepAlive && client[kPipelining]) {
|
|
645
|
+
const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
|
|
646
|
+
|
|
647
|
+
if (keepAliveTimeout != null) {
|
|
648
|
+
const timeout = Math.min(
|
|
649
|
+
keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
|
|
650
|
+
client[kKeepAliveMaxTimeout]
|
|
651
|
+
)
|
|
652
|
+
if (timeout <= 0) {
|
|
653
|
+
socket[kReset] = true
|
|
654
|
+
} else {
|
|
655
|
+
client[kKeepAliveTimeoutValue] = timeout
|
|
656
|
+
}
|
|
657
|
+
} else {
|
|
658
|
+
client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
|
|
659
|
+
}
|
|
660
|
+
} else {
|
|
661
|
+
// Stop more requests from being dispatched.
|
|
662
|
+
socket[kReset] = true
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
const pause = request.onResponseStart(statusCode, headers, this.resume, statusText) === false
|
|
666
|
+
|
|
667
|
+
if (request.aborted) {
|
|
668
|
+
return -1
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
if (request.method === 'HEAD') {
|
|
672
|
+
return 1
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
if (statusCode < 200) {
|
|
676
|
+
return 1
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
if (socket[kBlocking]) {
|
|
680
|
+
socket[kBlocking] = false
|
|
681
|
+
client[kResume]()
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
return pause ? constants.ERROR.PAUSED : 0
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* @param {Buffer} buf
|
|
689
|
+
* @returns {number}
|
|
690
|
+
*/
|
|
691
|
+
onBody (buf) {
|
|
692
|
+
const { client, socket, statusCode, maxResponseSize } = this
|
|
693
|
+
|
|
694
|
+
if (socket.destroyed) {
|
|
695
|
+
return -1
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
const request = client[kQueue][client[kRunningIdx]]
|
|
699
|
+
assert(request)
|
|
700
|
+
|
|
701
|
+
assert(this.timeoutType === TIMEOUT_BODY)
|
|
702
|
+
if (this.timeout) {
|
|
703
|
+
if (this.timeout.refresh) {
|
|
704
|
+
this.timeout.refresh()
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
assert(statusCode >= 200)
|
|
709
|
+
|
|
710
|
+
if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
|
|
711
|
+
util.destroy(socket, new ResponseExceededMaxSizeError())
|
|
712
|
+
return -1
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
this.bytesRead += buf.length
|
|
716
|
+
|
|
717
|
+
if (request.onResponseData(buf) === false) {
|
|
718
|
+
return constants.ERROR.PAUSED
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
return 0
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* @returns {number}
|
|
726
|
+
*/
|
|
727
|
+
onMessageComplete () {
|
|
728
|
+
const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
|
|
729
|
+
|
|
730
|
+
if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
|
|
731
|
+
return -1
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
if (upgrade) {
|
|
735
|
+
return 0
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
assert(statusCode >= 100)
|
|
739
|
+
assert((this.headers.length & 1) === 0)
|
|
740
|
+
|
|
741
|
+
const request = client[kQueue][client[kRunningIdx]]
|
|
742
|
+
assert(request)
|
|
743
|
+
|
|
744
|
+
this.statusCode = 0
|
|
745
|
+
this.statusText = ''
|
|
746
|
+
this.bytesRead = 0
|
|
747
|
+
this.contentLength = -1
|
|
748
|
+
this.keepAlive = ''
|
|
749
|
+
this.connectionKeepAlive = false
|
|
750
|
+
|
|
751
|
+
this.headers = []
|
|
752
|
+
this.headersSize = 0
|
|
753
|
+
|
|
754
|
+
if (statusCode < 200) {
|
|
755
|
+
return 0
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
if (request.method !== 'HEAD' && contentLength !== -1 && bytesRead !== contentLength) {
|
|
759
|
+
util.destroy(socket, new ResponseContentLengthMismatchError())
|
|
760
|
+
return -1
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
request.onResponseEnd(headers)
|
|
764
|
+
|
|
765
|
+
client[kQueue][client[kRunningIdx]++] = null
|
|
766
|
+
|
|
767
|
+
if (socket[kWriting]) {
|
|
768
|
+
assert(client[kRunning] === 0)
|
|
769
|
+
// Response completed before request.
|
|
770
|
+
util.destroy(socket, new InformationalError('reset'))
|
|
771
|
+
return constants.ERROR.PAUSED
|
|
772
|
+
} else if (!shouldKeepAlive) {
|
|
773
|
+
util.destroy(socket, new InformationalError('reset'))
|
|
774
|
+
return constants.ERROR.PAUSED
|
|
775
|
+
} else if (socket[kReset] && client[kRunning] === 0) {
|
|
776
|
+
// Destroy socket once all requests have completed.
|
|
777
|
+
// The request at the tail of the pipeline is the one
|
|
778
|
+
// that requested reset and no further requests should
|
|
779
|
+
// have been queued since then.
|
|
780
|
+
util.destroy(socket, new InformationalError('reset'))
|
|
781
|
+
return constants.ERROR.PAUSED
|
|
782
|
+
} else if (client[kPipelining] == null || client[kPipelining] === 1) {
|
|
783
|
+
// We must wait a full event loop cycle to reuse this socket to make sure
|
|
784
|
+
// that non-spec compliant servers are not closing the connection even if they
|
|
785
|
+
// said they won't.
|
|
786
|
+
setImmediate(client[kResume])
|
|
787
|
+
} else {
|
|
788
|
+
client[kResume]()
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
return 0
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
function onParserTimeout (parserWeakRef) {
|
|
796
|
+
const parser = parserWeakRef.deref()
|
|
797
|
+
if (!parser) {
|
|
798
|
+
return
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
const { socket, timeoutType, client, paused } = parser
|
|
802
|
+
|
|
803
|
+
if (timeoutType === TIMEOUT_HEADERS) {
|
|
804
|
+
if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
|
|
805
|
+
assert(!paused, 'cannot be paused while waiting for headers')
|
|
806
|
+
util.destroy(socket, new HeadersTimeoutError())
|
|
807
|
+
}
|
|
808
|
+
} else if (timeoutType === TIMEOUT_BODY) {
|
|
809
|
+
if (!paused) {
|
|
810
|
+
util.destroy(socket, new BodyTimeoutError())
|
|
811
|
+
}
|
|
812
|
+
} else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
|
|
813
|
+
assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
|
|
814
|
+
util.destroy(socket, new InformationalError('socket idle timeout'))
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* @param {import ('./client.js')} client
|
|
820
|
+
* @param {import('net').Socket} socket
|
|
821
|
+
* @returns
|
|
822
|
+
*/
|
|
823
|
+
function connectH1 (client, socket) {
|
|
824
|
+
client[kSocket] = socket
|
|
825
|
+
|
|
826
|
+
if (!llhttpInstance) {
|
|
827
|
+
llhttpInstance = lazyllhttp()
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
if (socket.errored) {
|
|
831
|
+
throw socket.errored
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
if (socket.destroyed) {
|
|
835
|
+
throw new SocketError('destroyed')
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
socket[kNoRef] = false
|
|
839
|
+
socket[kWriting] = false
|
|
840
|
+
socket[kReset] = false
|
|
841
|
+
socket[kBlocking] = false
|
|
842
|
+
socket[kParser] = new Parser(client, socket, llhttpInstance)
|
|
843
|
+
|
|
844
|
+
util.addListener(socket, 'error', onHttpSocketError)
|
|
845
|
+
util.addListener(socket, 'readable', onHttpSocketReadable)
|
|
846
|
+
util.addListener(socket, 'end', onHttpSocketEnd)
|
|
847
|
+
util.addListener(socket, 'close', onHttpSocketClose)
|
|
848
|
+
|
|
849
|
+
socket[kClosed] = false
|
|
850
|
+
socket.on('close', onSocketClose)
|
|
851
|
+
|
|
852
|
+
return {
|
|
853
|
+
version: 'h1',
|
|
854
|
+
defaultPipelining: 1,
|
|
855
|
+
write (request) {
|
|
856
|
+
return writeH1(client, request)
|
|
857
|
+
},
|
|
858
|
+
resume () {
|
|
859
|
+
resumeH1(client)
|
|
860
|
+
},
|
|
861
|
+
/**
|
|
862
|
+
* @param {Error|undefined} err
|
|
863
|
+
* @param {() => void} callback
|
|
864
|
+
*/
|
|
865
|
+
destroy (err, callback) {
|
|
866
|
+
if (socket[kClosed]) {
|
|
867
|
+
queueMicrotask(callback)
|
|
868
|
+
} else {
|
|
869
|
+
socket.on('close', callback)
|
|
870
|
+
socket.destroy(err)
|
|
871
|
+
}
|
|
872
|
+
},
|
|
873
|
+
/**
|
|
874
|
+
* @returns {boolean}
|
|
875
|
+
*/
|
|
876
|
+
get destroyed () {
|
|
877
|
+
return socket.destroyed
|
|
878
|
+
},
|
|
879
|
+
/**
|
|
880
|
+
* @param {import('../core/request.js')} request
|
|
881
|
+
* @returns {boolean}
|
|
882
|
+
*/
|
|
883
|
+
busy (request) {
|
|
884
|
+
if (socket[kWriting] || socket[kReset] || socket[kBlocking]) {
|
|
885
|
+
return true
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
if (request) {
|
|
889
|
+
if (client[kRunning] > 0 && !request.idempotent) {
|
|
890
|
+
// Non-idempotent request cannot be retried.
|
|
891
|
+
// Ensure that no other requests are inflight and
|
|
892
|
+
// could cause failure.
|
|
893
|
+
return true
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
|
|
897
|
+
// Don't dispatch an upgrade until all preceding requests have completed.
|
|
898
|
+
// A misbehaving server might upgrade the connection before all pipelined
|
|
899
|
+
// request has completed.
|
|
900
|
+
return true
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
|
|
904
|
+
(util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) {
|
|
905
|
+
// Request with stream or iterator body can error while other requests
|
|
906
|
+
// are inflight and indirectly error those as well.
|
|
907
|
+
// Ensure this doesn't happen by waiting for inflight
|
|
908
|
+
// to complete before dispatching.
|
|
909
|
+
|
|
910
|
+
// Request with stream or iterator body cannot be retried.
|
|
911
|
+
// Ensure that no other requests are inflight and
|
|
912
|
+
// could cause failure.
|
|
913
|
+
return true
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
return false
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
function onHttpSocketError (err) {
|
|
923
|
+
assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
|
|
924
|
+
|
|
925
|
+
const parser = this[kParser]
|
|
926
|
+
|
|
927
|
+
// On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
|
|
928
|
+
// to the user.
|
|
929
|
+
if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
|
|
930
|
+
const parserErr = parser.finish()
|
|
931
|
+
if (parserErr) {
|
|
932
|
+
this[kError] = parserErr
|
|
933
|
+
this[kClient][kOnError](parserErr)
|
|
934
|
+
}
|
|
935
|
+
return
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
this[kError] = err
|
|
939
|
+
|
|
940
|
+
this[kClient][kOnError](err)
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
function onHttpSocketReadable () {
|
|
944
|
+
this[kParser]?.readMore()
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
function onHttpSocketEnd () {
|
|
948
|
+
const parser = this[kParser]
|
|
949
|
+
|
|
950
|
+
if (parser.statusCode && !parser.shouldKeepAlive) {
|
|
951
|
+
const parserErr = parser.finish()
|
|
952
|
+
if (parserErr) {
|
|
953
|
+
util.destroy(this, parserErr)
|
|
954
|
+
}
|
|
955
|
+
return
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
function onHttpSocketClose () {
|
|
962
|
+
const parser = this[kParser]
|
|
963
|
+
|
|
964
|
+
if (parser) {
|
|
965
|
+
if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
|
|
966
|
+
this[kError] = parser.finish() || this[kError]
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
this[kParser].destroy()
|
|
970
|
+
this[kParser] = null
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
|
|
974
|
+
|
|
975
|
+
const client = this[kClient]
|
|
976
|
+
|
|
977
|
+
client[kSocket] = null
|
|
978
|
+
client[kHTTPContext] = null // TODO (fix): This is hacky...
|
|
979
|
+
|
|
980
|
+
if (client.destroyed) {
|
|
981
|
+
assert(client[kPending] === 0)
|
|
982
|
+
|
|
983
|
+
// Fail entire queue.
|
|
984
|
+
const requests = client[kQueue].splice(client[kRunningIdx])
|
|
985
|
+
for (let i = 0; i < requests.length; i++) {
|
|
986
|
+
const request = requests[i]
|
|
987
|
+
util.errorRequest(client, request, err)
|
|
988
|
+
}
|
|
989
|
+
} else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
|
|
990
|
+
// Fail head of pipeline.
|
|
991
|
+
const request = client[kQueue][client[kRunningIdx]]
|
|
992
|
+
client[kQueue][client[kRunningIdx]++] = null
|
|
993
|
+
|
|
994
|
+
util.errorRequest(client, request, err)
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
client[kPendingIdx] = client[kRunningIdx]
|
|
998
|
+
|
|
999
|
+
assert(client[kRunning] === 0)
|
|
1000
|
+
|
|
1001
|
+
client.emit('disconnect', client[kUrl], [client], err)
|
|
1002
|
+
|
|
1003
|
+
client[kResume]()
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
function onSocketClose () {
|
|
1007
|
+
this[kClosed] = true
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* @param {import('./client.js')} client
|
|
1012
|
+
*/
|
|
1013
|
+
function resumeH1 (client) {
|
|
1014
|
+
const socket = client[kSocket]
|
|
1015
|
+
|
|
1016
|
+
if (socket && !socket.destroyed) {
|
|
1017
|
+
if (client[kSize] === 0) {
|
|
1018
|
+
if (!socket[kNoRef] && socket.unref) {
|
|
1019
|
+
socket.unref()
|
|
1020
|
+
socket[kNoRef] = true
|
|
1021
|
+
}
|
|
1022
|
+
} else if (socket[kNoRef] && socket.ref) {
|
|
1023
|
+
socket.ref()
|
|
1024
|
+
socket[kNoRef] = false
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
if (client[kSize] === 0) {
|
|
1028
|
+
if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {
|
|
1029
|
+
socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE)
|
|
1030
|
+
}
|
|
1031
|
+
} else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
|
|
1032
|
+
if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
|
|
1033
|
+
const request = client[kQueue][client[kRunningIdx]]
|
|
1034
|
+
const headersTimeout = request.headersTimeout != null
|
|
1035
|
+
? request.headersTimeout
|
|
1036
|
+
: client[kHeadersTimeout]
|
|
1037
|
+
socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
|
|
1044
|
+
function shouldSendContentLength (method) {
|
|
1045
|
+
return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* @param {import('./client.js')} client
|
|
1050
|
+
* @param {import('../core/request.js')} request
|
|
1051
|
+
* @returns
|
|
1052
|
+
*/
|
|
1053
|
+
function writeH1 (client, request) {
|
|
1054
|
+
const { method, path, host, upgrade, blocking, reset } = request
|
|
1055
|
+
|
|
1056
|
+
let { body, headers, contentLength } = request
|
|
1057
|
+
|
|
1058
|
+
// https://tools.ietf.org/html/rfc7231#section-4.3.1
|
|
1059
|
+
// https://tools.ietf.org/html/rfc7231#section-4.3.2
|
|
1060
|
+
// https://tools.ietf.org/html/rfc7231#section-4.3.5
|
|
1061
|
+
|
|
1062
|
+
// Sending a payload body on a request that does not
|
|
1063
|
+
// expect it can cause undefined behavior on some
|
|
1064
|
+
// servers and corrupt connection state. Do not
|
|
1065
|
+
// re-use the connection for further requests.
|
|
1066
|
+
|
|
1067
|
+
const expectsPayload = (
|
|
1068
|
+
method === 'PUT' ||
|
|
1069
|
+
method === 'POST' ||
|
|
1070
|
+
method === 'PATCH' ||
|
|
1071
|
+
method === 'QUERY' ||
|
|
1072
|
+
method === 'PROPFIND' ||
|
|
1073
|
+
method === 'PROPPATCH'
|
|
1074
|
+
)
|
|
1075
|
+
|
|
1076
|
+
if (util.isFormDataLike(body)) {
|
|
1077
|
+
if (!extractBody) {
|
|
1078
|
+
extractBody = require('../web/fetch/body.js').extractBody
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
const [bodyStream, contentType] = extractBody(body)
|
|
1082
|
+
if (request.contentType == null) {
|
|
1083
|
+
headers.push('content-type', contentType)
|
|
1084
|
+
}
|
|
1085
|
+
body = bodyStream.stream
|
|
1086
|
+
contentLength = bodyStream.length
|
|
1087
|
+
} else if (util.isBlobLike(body) && request.contentType == null && body.type) {
|
|
1088
|
+
headers.push('content-type', body.type)
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
if (body && typeof body.read === 'function') {
|
|
1092
|
+
// Try to read EOF in order to get length.
|
|
1093
|
+
body.read(0)
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
const bodyLength = util.bodyLength(body)
|
|
1097
|
+
|
|
1098
|
+
contentLength = bodyLength ?? contentLength
|
|
1099
|
+
|
|
1100
|
+
if (contentLength === null) {
|
|
1101
|
+
contentLength = request.contentLength
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
if (contentLength === 0 && !expectsPayload) {
|
|
1105
|
+
// https://tools.ietf.org/html/rfc7230#section-3.3.2
|
|
1106
|
+
// A user agent SHOULD NOT send a Content-Length header field when
|
|
1107
|
+
// the request message does not contain a payload body and the method
|
|
1108
|
+
// semantics do not anticipate such a body.
|
|
1109
|
+
|
|
1110
|
+
contentLength = null
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
// https://github.com/nodejs/undici/issues/2046
|
|
1114
|
+
// A user agent may send a Content-Length header with 0 value, this should be allowed.
|
|
1115
|
+
if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
|
|
1116
|
+
if (client[kStrictContentLength]) {
|
|
1117
|
+
util.errorRequest(client, request, new RequestContentLengthMismatchError())
|
|
1118
|
+
return false
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
process.emitWarning(new RequestContentLengthMismatchError())
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
const socket = client[kSocket]
|
|
1125
|
+
|
|
1126
|
+
/**
|
|
1127
|
+
* @param {Error} [err]
|
|
1128
|
+
* @returns {void}
|
|
1129
|
+
*/
|
|
1130
|
+
const abort = (err) => {
|
|
1131
|
+
if (request.aborted || request.completed) {
|
|
1132
|
+
return
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
util.errorRequest(client, request, err || new RequestAbortedError())
|
|
1136
|
+
|
|
1137
|
+
util.destroy(body)
|
|
1138
|
+
util.destroy(socket, new InformationalError('aborted'))
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
try {
|
|
1142
|
+
request.onRequestStart(abort, null)
|
|
1143
|
+
} catch (err) {
|
|
1144
|
+
util.errorRequest(client, request, err)
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
if (request.aborted) {
|
|
1148
|
+
return false
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
if (method === 'HEAD') {
|
|
1152
|
+
// https://github.com/mcollina/undici/issues/258
|
|
1153
|
+
// Close after a HEAD request to interop with misbehaving servers
|
|
1154
|
+
// that may send a body in the response.
|
|
1155
|
+
|
|
1156
|
+
socket[kReset] = true
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
if (upgrade || method === 'CONNECT') {
|
|
1160
|
+
// On CONNECT or upgrade, block pipeline from dispatching further
|
|
1161
|
+
// requests on this connection.
|
|
1162
|
+
|
|
1163
|
+
socket[kReset] = true
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
if (reset != null) {
|
|
1167
|
+
socket[kReset] = reset
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
if (client[kMaxRequests] && ++socket[kCounter] >= client[kMaxRequests]) {
|
|
1171
|
+
socket[kReset] = true
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
if (blocking) {
|
|
1175
|
+
socket[kBlocking] = true
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
if (socket.setTypeOfService) {
|
|
1179
|
+
socket.setTypeOfService(request.typeOfService)
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
let header = `${method} ${path} HTTP/1.1\r\n`
|
|
1183
|
+
|
|
1184
|
+
if (typeof host === 'string') {
|
|
1185
|
+
header += `host: ${host}\r\n`
|
|
1186
|
+
} else {
|
|
1187
|
+
header += client[kHostHeader]
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
if (upgrade) {
|
|
1191
|
+
header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
|
|
1192
|
+
} else if (client[kPipelining] && !socket[kReset]) {
|
|
1193
|
+
header += 'connection: keep-alive\r\n'
|
|
1194
|
+
} else {
|
|
1195
|
+
header += 'connection: close\r\n'
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
if (Array.isArray(headers)) {
|
|
1199
|
+
for (let n = 0; n < headers.length; n += 2) {
|
|
1200
|
+
const key = headers[n + 0]
|
|
1201
|
+
const val = headers[n + 1]
|
|
1202
|
+
|
|
1203
|
+
if (Array.isArray(val)) {
|
|
1204
|
+
for (let i = 0; i < val.length; i++) {
|
|
1205
|
+
header += `${key}: ${val[i]}\r\n`
|
|
1206
|
+
}
|
|
1207
|
+
} else {
|
|
1208
|
+
header += `${key}: ${val}\r\n`
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
if (channels.sendHeaders.hasSubscribers) {
|
|
1214
|
+
channels.sendHeaders.publish({ request, headers: header, socket })
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
if (!body || bodyLength === 0) {
|
|
1218
|
+
writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload)
|
|
1219
|
+
} else if (util.isBuffer(body)) {
|
|
1220
|
+
writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload)
|
|
1221
|
+
} else if (util.isBlobLike(body)) {
|
|
1222
|
+
if (typeof body.stream === 'function') {
|
|
1223
|
+
writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload)
|
|
1224
|
+
} else {
|
|
1225
|
+
writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload)
|
|
1226
|
+
}
|
|
1227
|
+
} else if (util.isStream(body)) {
|
|
1228
|
+
writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload)
|
|
1229
|
+
} else if (util.isIterable(body)) {
|
|
1230
|
+
writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload)
|
|
1231
|
+
} else {
|
|
1232
|
+
assert(false)
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
return true
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* @param {AbortCallback} abort
|
|
1240
|
+
* @param {import('stream').Stream} body
|
|
1241
|
+
* @param {import('./client.js')} client
|
|
1242
|
+
* @param {import('../core/request.js')} request
|
|
1243
|
+
* @param {import('net').Socket} socket
|
|
1244
|
+
* @param {number} contentLength
|
|
1245
|
+
* @param {string} header
|
|
1246
|
+
* @param {boolean} expectsPayload
|
|
1247
|
+
*/
|
|
1248
|
+
function writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) {
|
|
1249
|
+
assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
|
|
1250
|
+
|
|
1251
|
+
let finished = false
|
|
1252
|
+
|
|
1253
|
+
const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })
|
|
1254
|
+
|
|
1255
|
+
/**
|
|
1256
|
+
* @param {Buffer} chunk
|
|
1257
|
+
* @returns {void}
|
|
1258
|
+
*/
|
|
1259
|
+
const onData = function (chunk) {
|
|
1260
|
+
if (finished) {
|
|
1261
|
+
return
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
try {
|
|
1265
|
+
if (!writer.write(chunk) && this.pause) {
|
|
1266
|
+
this.pause()
|
|
1267
|
+
}
|
|
1268
|
+
} catch (err) {
|
|
1269
|
+
util.destroy(this, err)
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
/**
|
|
1274
|
+
* @returns {void}
|
|
1275
|
+
*/
|
|
1276
|
+
const onDrain = function () {
|
|
1277
|
+
if (finished) {
|
|
1278
|
+
return
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
if (body.resume) {
|
|
1282
|
+
body.resume()
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* @returns {void}
|
|
1288
|
+
*/
|
|
1289
|
+
const onClose = function () {
|
|
1290
|
+
// 'close' might be emitted *before* 'error' for
|
|
1291
|
+
// broken streams. Wait a tick to avoid this case.
|
|
1292
|
+
queueMicrotask(() => {
|
|
1293
|
+
// It's only safe to remove 'error' listener after
|
|
1294
|
+
// 'close'.
|
|
1295
|
+
body.removeListener('error', onFinished)
|
|
1296
|
+
})
|
|
1297
|
+
|
|
1298
|
+
if (!finished) {
|
|
1299
|
+
const err = new RequestAbortedError()
|
|
1300
|
+
queueMicrotask(() => onFinished(err))
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
/**
|
|
1305
|
+
* @param {Error} [err]
|
|
1306
|
+
* @returns
|
|
1307
|
+
*/
|
|
1308
|
+
const onFinished = function (err) {
|
|
1309
|
+
if (finished) {
|
|
1310
|
+
return
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
finished = true
|
|
1314
|
+
|
|
1315
|
+
assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
|
|
1316
|
+
|
|
1317
|
+
socket
|
|
1318
|
+
.off('drain', onDrain)
|
|
1319
|
+
.off('error', onFinished)
|
|
1320
|
+
|
|
1321
|
+
body
|
|
1322
|
+
.removeListener('data', onData)
|
|
1323
|
+
.removeListener('end', onFinished)
|
|
1324
|
+
.removeListener('close', onClose)
|
|
1325
|
+
|
|
1326
|
+
if (!err) {
|
|
1327
|
+
try {
|
|
1328
|
+
writer.end()
|
|
1329
|
+
} catch (er) {
|
|
1330
|
+
err = er
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
writer.destroy(err)
|
|
1335
|
+
|
|
1336
|
+
if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
|
|
1337
|
+
util.destroy(body, err)
|
|
1338
|
+
} else {
|
|
1339
|
+
util.destroy(body)
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
body
|
|
1344
|
+
.on('data', onData)
|
|
1345
|
+
.on('end', onFinished)
|
|
1346
|
+
.on('error', onFinished)
|
|
1347
|
+
.on('close', onClose)
|
|
1348
|
+
|
|
1349
|
+
if (body.resume) {
|
|
1350
|
+
body.resume()
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
socket
|
|
1354
|
+
.on('drain', onDrain)
|
|
1355
|
+
.on('error', onFinished)
|
|
1356
|
+
|
|
1357
|
+
if (body.errorEmitted ?? body.errored) {
|
|
1358
|
+
setImmediate(onFinished, body.errored)
|
|
1359
|
+
} else if (body.endEmitted ?? body.readableEnded) {
|
|
1360
|
+
setImmediate(onFinished, null)
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
if (body.closeEmitted ?? body.closed) {
|
|
1364
|
+
setImmediate(onClose)
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
/**
|
|
1369
|
+
* @typedef AbortCallback
|
|
1370
|
+
* @type {Function}
|
|
1371
|
+
* @param {Error} [err]
|
|
1372
|
+
* @returns {void}
|
|
1373
|
+
*/
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* @param {AbortCallback} abort
|
|
1377
|
+
* @param {Uint8Array|null} body
|
|
1378
|
+
* @param {import('./client.js')} client
|
|
1379
|
+
* @param {import('../core/request.js')} request
|
|
1380
|
+
* @param {import('net').Socket} socket
|
|
1381
|
+
* @param {number} contentLength
|
|
1382
|
+
* @param {string} header
|
|
1383
|
+
* @param {boolean} expectsPayload
|
|
1384
|
+
* @returns {void}
|
|
1385
|
+
*/
|
|
1386
|
+
function writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) {
|
|
1387
|
+
try {
|
|
1388
|
+
if (!body) {
|
|
1389
|
+
if (contentLength === 0) {
|
|
1390
|
+
socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
|
|
1391
|
+
} else {
|
|
1392
|
+
assert(contentLength === null, 'no body must not have content length')
|
|
1393
|
+
socket.write(`${header}\r\n`, 'latin1')
|
|
1394
|
+
}
|
|
1395
|
+
} else if (util.isBuffer(body)) {
|
|
1396
|
+
assert(contentLength === body.byteLength, 'buffer body must have content length')
|
|
1397
|
+
|
|
1398
|
+
socket.cork()
|
|
1399
|
+
socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
|
|
1400
|
+
socket.write(body)
|
|
1401
|
+
socket.uncork()
|
|
1402
|
+
request.onBodySent(body)
|
|
1403
|
+
|
|
1404
|
+
if (!expectsPayload && request.reset !== false) {
|
|
1405
|
+
socket[kReset] = true
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
request.onRequestSent()
|
|
1409
|
+
|
|
1410
|
+
client[kResume]()
|
|
1411
|
+
} catch (err) {
|
|
1412
|
+
abort(err)
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* @param {AbortCallback} abort
|
|
1418
|
+
* @param {Blob} body
|
|
1419
|
+
* @param {import('./client.js')} client
|
|
1420
|
+
* @param {import('../core/request.js')} request
|
|
1421
|
+
* @param {import('net').Socket} socket
|
|
1422
|
+
* @param {number} contentLength
|
|
1423
|
+
* @param {string} header
|
|
1424
|
+
* @param {boolean} expectsPayload
|
|
1425
|
+
* @returns {Promise<void>}
|
|
1426
|
+
*/
|
|
1427
|
+
async function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) {
|
|
1428
|
+
try {
|
|
1429
|
+
if (contentLength != null && contentLength !== body.size) {
|
|
1430
|
+
throw new RequestContentLengthMismatchError()
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
const buffer = Buffer.from(await body.arrayBuffer())
|
|
1434
|
+
|
|
1435
|
+
socket.cork()
|
|
1436
|
+
socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
|
|
1437
|
+
socket.write(buffer)
|
|
1438
|
+
socket.uncork()
|
|
1439
|
+
|
|
1440
|
+
request.onBodySent(buffer)
|
|
1441
|
+
request.onRequestSent()
|
|
1442
|
+
|
|
1443
|
+
if (!expectsPayload && request.reset !== false) {
|
|
1444
|
+
socket[kReset] = true
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
client[kResume]()
|
|
1448
|
+
} catch (err) {
|
|
1449
|
+
abort(err)
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* @param {AbortCallback} abort
|
|
1455
|
+
* @param {Iterable} body
|
|
1456
|
+
* @param {import('./client.js')} client
|
|
1457
|
+
* @param {import('../core/request.js')} request
|
|
1458
|
+
* @param {import('net').Socket} socket
|
|
1459
|
+
* @param {number} contentLength
|
|
1460
|
+
* @param {string} header
|
|
1461
|
+
* @param {boolean} expectsPayload
|
|
1462
|
+
* @returns {Promise<void>}
|
|
1463
|
+
*/
|
|
1464
|
+
async function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) {
|
|
1465
|
+
assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
|
|
1466
|
+
|
|
1467
|
+
let callback = null
|
|
1468
|
+
function onDrain () {
|
|
1469
|
+
if (callback) {
|
|
1470
|
+
const cb = callback
|
|
1471
|
+
callback = null
|
|
1472
|
+
cb()
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
const waitForDrain = () => new Promise((resolve, reject) => {
|
|
1477
|
+
assert(callback === null)
|
|
1478
|
+
|
|
1479
|
+
if (socket[kError]) {
|
|
1480
|
+
reject(socket[kError])
|
|
1481
|
+
} else {
|
|
1482
|
+
callback = resolve
|
|
1483
|
+
}
|
|
1484
|
+
})
|
|
1485
|
+
|
|
1486
|
+
socket
|
|
1487
|
+
.on('close', onDrain)
|
|
1488
|
+
.on('drain', onDrain)
|
|
1489
|
+
|
|
1490
|
+
const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header })
|
|
1491
|
+
try {
|
|
1492
|
+
// It's up to the user to somehow abort the async iterable.
|
|
1493
|
+
for await (const chunk of body) {
|
|
1494
|
+
if (socket[kError]) {
|
|
1495
|
+
throw socket[kError]
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
if (!writer.write(chunk)) {
|
|
1499
|
+
await waitForDrain()
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
writer.end()
|
|
1504
|
+
} catch (err) {
|
|
1505
|
+
writer.destroy(err)
|
|
1506
|
+
} finally {
|
|
1507
|
+
socket
|
|
1508
|
+
.off('close', onDrain)
|
|
1509
|
+
.off('drain', onDrain)
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
class AsyncWriter {
|
|
1514
|
+
/**
|
|
1515
|
+
*
|
|
1516
|
+
* @param {object} arg
|
|
1517
|
+
* @param {AbortCallback} arg.abort
|
|
1518
|
+
* @param {import('net').Socket} arg.socket
|
|
1519
|
+
* @param {import('../core/request.js')} arg.request
|
|
1520
|
+
* @param {number} arg.contentLength
|
|
1521
|
+
* @param {import('./client.js')} arg.client
|
|
1522
|
+
* @param {boolean} arg.expectsPayload
|
|
1523
|
+
* @param {string} arg.header
|
|
1524
|
+
*/
|
|
1525
|
+
constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) {
|
|
1526
|
+
this.socket = socket
|
|
1527
|
+
this.request = request
|
|
1528
|
+
this.contentLength = contentLength
|
|
1529
|
+
this.client = client
|
|
1530
|
+
this.bytesWritten = 0
|
|
1531
|
+
this.expectsPayload = expectsPayload
|
|
1532
|
+
this.header = header
|
|
1533
|
+
this.abort = abort
|
|
1534
|
+
|
|
1535
|
+
socket[kWriting] = true
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
/**
|
|
1539
|
+
* @param {string|Uint8Array} chunk
|
|
1540
|
+
* @returns
|
|
1541
|
+
*/
|
|
1542
|
+
write (chunk) {
|
|
1543
|
+
const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
|
|
1544
|
+
|
|
1545
|
+
if (socket[kError]) {
|
|
1546
|
+
throw socket[kError]
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
if (socket.destroyed) {
|
|
1550
|
+
return false
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
const len = chunk instanceof Uint8Array ? chunk.byteLength : Buffer.byteLength(chunk)
|
|
1554
|
+
if (!len) {
|
|
1555
|
+
return true
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
// We should defer writing chunks.
|
|
1559
|
+
if (contentLength !== null && bytesWritten + len > contentLength) {
|
|
1560
|
+
if (client[kStrictContentLength]) {
|
|
1561
|
+
throw new RequestContentLengthMismatchError()
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
process.emitWarning(new RequestContentLengthMismatchError())
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
socket.cork()
|
|
1568
|
+
|
|
1569
|
+
if (bytesWritten === 0) {
|
|
1570
|
+
if (!expectsPayload && request.reset !== false) {
|
|
1571
|
+
socket[kReset] = true
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
if (contentLength === null) {
|
|
1575
|
+
socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
|
|
1576
|
+
} else {
|
|
1577
|
+
socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
if (contentLength === null) {
|
|
1582
|
+
socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
this.bytesWritten += len
|
|
1586
|
+
|
|
1587
|
+
const ret = socket.write(chunk)
|
|
1588
|
+
|
|
1589
|
+
socket.uncork()
|
|
1590
|
+
|
|
1591
|
+
request.onBodySent(chunk)
|
|
1592
|
+
|
|
1593
|
+
if (!ret) {
|
|
1594
|
+
if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
|
|
1595
|
+
if (socket[kParser].timeout.refresh) {
|
|
1596
|
+
socket[kParser].timeout.refresh()
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
return ret
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
/**
|
|
1605
|
+
* @returns {void}
|
|
1606
|
+
*/
|
|
1607
|
+
end () {
|
|
1608
|
+
const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
|
|
1609
|
+
request.onRequestSent()
|
|
1610
|
+
|
|
1611
|
+
socket[kWriting] = false
|
|
1612
|
+
|
|
1613
|
+
if (socket[kError]) {
|
|
1614
|
+
throw socket[kError]
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
if (socket.destroyed) {
|
|
1618
|
+
return
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
if (bytesWritten === 0) {
|
|
1622
|
+
if (expectsPayload) {
|
|
1623
|
+
// https://tools.ietf.org/html/rfc7230#section-3.3.2
|
|
1624
|
+
// A user agent SHOULD send a Content-Length in a request message when
|
|
1625
|
+
// no Transfer-Encoding is sent and the request method defines a meaning
|
|
1626
|
+
// for an enclosed payload body.
|
|
1627
|
+
|
|
1628
|
+
socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
|
|
1629
|
+
} else {
|
|
1630
|
+
socket.write(`${header}\r\n`, 'latin1')
|
|
1631
|
+
}
|
|
1632
|
+
} else if (contentLength === null) {
|
|
1633
|
+
socket.write('\r\n0\r\n\r\n', 'latin1')
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
if (contentLength !== null && bytesWritten !== contentLength) {
|
|
1637
|
+
if (client[kStrictContentLength]) {
|
|
1638
|
+
throw new RequestContentLengthMismatchError()
|
|
1639
|
+
} else {
|
|
1640
|
+
process.emitWarning(new RequestContentLengthMismatchError())
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
|
|
1645
|
+
if (socket[kParser].timeout.refresh) {
|
|
1646
|
+
socket[kParser].timeout.refresh()
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
client[kResume]()
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* @param {Error} [err]
|
|
1655
|
+
* @returns {void}
|
|
1656
|
+
*/
|
|
1657
|
+
destroy (err) {
|
|
1658
|
+
const { socket, client, abort } = this
|
|
1659
|
+
|
|
1660
|
+
socket[kWriting] = false
|
|
1661
|
+
|
|
1662
|
+
if (err) {
|
|
1663
|
+
assert(client[kRunning] <= 1, 'pipeline should only contain this request')
|
|
1664
|
+
abort(err)
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
module.exports = connectH1
|