maka-agent 0.2.1-dev.91.20261018 → 0.2.2-dev.97.20261024
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/DISCLAIMER-WIP +1 -1
- package/LICENSE +15 -11
- package/README.md +173 -1
- package/README.zh-CN.md +156 -0
- package/THIRD_PARTY_NOTICES.txt +12 -12
- package/dist/cli-core.js +1 -0
- package/dist/pi-goal.js +13 -0
- package/dist/pi-tui-runner.js +44 -1
- package/dist/run-command-core.js +256 -48
- package/dist/run-session-command.js +534 -0
- package/dist/run-session-result.js +38 -0
- package/dist/run-turn-outcome.js +174 -0
- package/dist/runtime-host-cli.js +32 -17
- package/dist/runtime-host-run-command.js +53 -165
- package/dist/runtime-host-run-mcp.js +3 -0
- package/dist/runtime-host-session-channel.js +3 -1
- package/dist/runtime-host-session-driver.js +5 -0
- package/dist/runtime-host-setup-command.js +114 -7
- package/dist/tui-copy-catalog.js +24 -0
- package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/Client.md +2 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/core/symbols.js +1 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client-h1.js +0 -2
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client-h2.js +0 -4
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client.js +3 -2
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/dispatcher-base.js +12 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/cache-handler.js +48 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/deduplication-handler.js +57 -13
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/redirect-handler.js +8 -1
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/interceptor/decompress.js +15 -5
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/cookies/index.js +3 -1
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/cookies/parse.js +138 -137
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/cookies/util.js +21 -2
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/eventsource/eventsource-stream.js +90 -9
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/eventsource/eventsource.js +4 -1
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/fetch/index.js +3 -3
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/infra/index.js +14 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/websocket/receiver.js +13 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/package.json +1 -1
- package/node_modules/@maka/acp-executor-plugin/dist/acp-catalog-store.js +87 -0
- package/node_modules/@maka/acp-executor-plugin/dist/acp-catalog.js +98 -21
- package/node_modules/@maka/acp-executor-plugin/dist/index.js +90 -14
- package/node_modules/@maka/acp-executor-plugin/dist/plugin.mjs +3997 -56
- package/node_modules/@maka/core/dist/assistant-turn-ids.js +34 -0
- package/node_modules/@maka/core/dist/bot-chat-settings.js +10 -1
- package/node_modules/@maka/core/dist/event-wait-delivery.js +67 -0
- package/node_modules/@maka/core/dist/event-wait.js +75 -10
- package/node_modules/@maka/core/dist/executor-catalog.js +3 -1
- package/node_modules/@maka/core/dist/goal.js +54 -2
- package/node_modules/@maka/core/dist/model-catalog.js +19 -1
- package/node_modules/@maka/core/dist/model-metadata.generated.js +4 -14
- package/node_modules/@maka/core/dist/model-metadata.js +42 -1
- package/node_modules/@maka/core/dist/models-dev-projection.js +32 -1
- package/node_modules/@maka/core/dist/provider-registry.js +16 -2
- package/node_modules/@maka/core/dist/runtime-event-store.js +0 -1
- package/node_modules/@maka/core/dist/runtime-event.js +24 -2
- package/node_modules/@maka/core/dist/runtime-invocation.js +10 -0
- package/node_modules/@maka/core/dist/session-checkin.js +31 -0
- package/node_modules/@maka/core/dist/tool-ledger-scanner.js +1 -9
- package/node_modules/@maka/core/dist/tool-recovery-bundle.js +1 -14
- package/node_modules/@maka/core/dist/turn-origin.js +14 -2
- package/node_modules/@maka/core/dist/usage-stats/types.js +1 -0
- package/node_modules/@maka/core/package.json +3 -0
- package/node_modules/@maka/eval/node_modules/undici/README.md +25 -3
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Client.md +11 -6
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Errors.md +76 -1
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Interceptors.md +28 -8
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/index.md +12 -12
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/type-map.json +66 -66
- package/node_modules/@maka/eval/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
- package/node_modules/@maka/eval/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
- package/node_modules/@maka/eval/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/@maka/eval/node_modules/undici/lib/core/constants.js +12 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/core/errors.js +38 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/core/request.js +16 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/core/util.js +26 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client-h2.js +124 -17
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client.js +4 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/pool-base.js +85 -31
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/pool.js +11 -8
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
- package/node_modules/@maka/eval/node_modules/undici/lib/handler/cache-handler.js +153 -15
- package/node_modules/@maka/eval/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
- package/node_modules/@maka/eval/node_modules/undici/lib/handler/redirect-handler.js +28 -8
- package/node_modules/@maka/eval/node_modules/undici/lib/handler/retry-handler.js +44 -11
- package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/cache.js +11 -3
- package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/decompress.js +22 -9
- package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/dns.js +11 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/response-error.js +72 -28
- package/node_modules/@maka/eval/node_modules/undici/lib/milo/LICENSE.md +7 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/milo/no-simd.js +1002 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/milo/simd.js +1002 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/mock/mock-agent.js +11 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
- package/node_modules/@maka/eval/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
- package/node_modules/@maka/eval/node_modules/undici/lib/util/cache.js +11 -5
- package/node_modules/@maka/eval/node_modules/undici/lib/web/cookies/util.js +19 -2
- package/node_modules/@maka/eval/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
- package/node_modules/@maka/eval/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/body.js +47 -38
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/headers.js +2 -2
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/index.js +8 -4
- package/node_modules/@maka/eval/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/receiver.js +25 -4
- package/node_modules/@maka/eval/node_modules/undici/package.json +9 -7
- package/node_modules/@maka/mcp/package.json +1 -1
- package/node_modules/@maka/runtime/dist/agent-run.js +5 -1
- package/node_modules/@maka/runtime/dist/agent-swarm-status-tool.js +0 -1
- package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +29 -15
- package/node_modules/@maka/runtime/dist/ai-sdk-message-projection.js +10 -1
- package/node_modules/@maka/runtime/dist/ai-sdk-turn.js +125 -131
- package/node_modules/@maka/runtime/dist/bots/bot-registry.js +19 -3
- package/node_modules/@maka/runtime/dist/bots/feishu-bridge.js +178 -6
- package/node_modules/@maka/runtime/dist/bots/wechat-bridge.js +163 -9
- package/node_modules/@maka/runtime/dist/context-budget-policy.js +9 -2
- package/node_modules/@maka/runtime/dist/event-wait-tool.js +69 -0
- package/node_modules/@maka/runtime/dist/goal-continuation.js +195 -117
- package/node_modules/@maka/runtime/dist/goal-state.js +8 -0
- package/node_modules/@maka/runtime/dist/history-compact-checkpoint.js +34 -4
- package/node_modules/@maka/runtime/dist/history-compaction.js +7 -0
- package/node_modules/@maka/runtime/dist/memory-extraction.js +0 -2
- package/node_modules/@maka/runtime/dist/model-factory.js +26 -6
- package/node_modules/@maka/runtime/dist/model-fetcher.js +8 -1
- package/node_modules/@maka/runtime/dist/model-history.js +16 -3
- package/node_modules/@maka/runtime/dist/openai-codex-history-compactor.js +15 -5
- package/node_modules/@maka/runtime/dist/plan-tools.js +0 -3
- package/node_modules/@maka/runtime/dist/plugin-executor-backend.js +49 -2
- package/node_modules/@maka/runtime/dist/plugin-executor-service.js +12 -3
- package/node_modules/@maka/runtime/dist/provider-error-classification.js +2 -0
- package/node_modules/@maka/runtime/dist/recovery-resolver.js +2 -1
- package/node_modules/@maka/runtime/dist/runtime-context.js +53 -0
- package/node_modules/@maka/runtime/dist/runtime-event-read-model.js +3 -0
- package/node_modules/@maka/runtime/dist/sandbox-boundary-path.js +79 -2
- package/node_modules/@maka/runtime/dist/session-checkin.js +331 -0
- package/node_modules/@maka/runtime/dist/session-event-runtime-mapper.js +7 -0
- package/node_modules/@maka/runtime/dist/session-manager.js +5 -1
- package/node_modules/@maka/runtime/dist/shell-run-manager.js +34 -0
- package/node_modules/@maka/runtime/dist/stream-graph-supervisor-tools.js +0 -3
- package/node_modules/@maka/runtime/dist/telemetry/builtin-pricing.js +21 -2
- package/node_modules/@maka/runtime/dist/tool-runtime.js +11 -2
- package/node_modules/@maka/runtime/dist/workers/filesystem-worker.mjs +50 -1
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/docs/docs/api/Client.md +2 -0
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/core/symbols.js +1 -0
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client-h1.js +0 -2
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client-h2.js +0 -4
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client.js +3 -2
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/dispatcher-base.js +12 -0
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/cache-handler.js +48 -0
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/deduplication-handler.js +57 -13
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/redirect-handler.js +8 -1
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/interceptor/decompress.js +15 -5
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/cookies/index.js +3 -1
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/cookies/parse.js +138 -137
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/cookies/util.js +21 -2
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/eventsource/eventsource-stream.js +90 -9
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/eventsource/eventsource.js +4 -1
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/fetch/index.js +3 -3
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/infra/index.js +14 -0
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/websocket/receiver.js +13 -0
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/package.json +1 -1
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/package.json +1 -1
- package/node_modules/@maka/runtime/node_modules/undici/README.md +25 -3
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Client.md +11 -6
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Errors.md +76 -1
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Interceptors.md +28 -8
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/index.md +12 -12
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/type-map.json +66 -66
- package/node_modules/@maka/runtime/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
- package/node_modules/@maka/runtime/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
- package/node_modules/@maka/runtime/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/@maka/runtime/node_modules/undici/lib/core/constants.js +12 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/core/errors.js +38 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/core/request.js +16 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/core/util.js +26 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client-h2.js +124 -17
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client.js +4 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/pool-base.js +85 -31
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/pool.js +11 -8
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
- package/node_modules/@maka/runtime/node_modules/undici/lib/handler/cache-handler.js +153 -15
- package/node_modules/@maka/runtime/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
- package/node_modules/@maka/runtime/node_modules/undici/lib/handler/redirect-handler.js +28 -8
- package/node_modules/@maka/runtime/node_modules/undici/lib/handler/retry-handler.js +44 -11
- package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/cache.js +11 -3
- package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/decompress.js +22 -9
- package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/dns.js +11 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/response-error.js +72 -28
- package/node_modules/@maka/runtime/node_modules/undici/lib/milo/LICENSE.md +7 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/milo/no-simd.js +1002 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/milo/simd.js +1002 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/mock/mock-agent.js +11 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
- package/node_modules/@maka/runtime/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
- package/node_modules/@maka/runtime/node_modules/undici/lib/util/cache.js +11 -5
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/cookies/util.js +19 -2
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/body.js +47 -38
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/headers.js +2 -2
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/index.js +8 -4
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/receiver.js +25 -4
- package/node_modules/@maka/runtime/node_modules/undici/package.json +9 -7
- package/node_modules/@maka/runtime/package.json +3 -0
- package/node_modules/@maka/runtime-host/dist/assistant/bot/bridge.js +8 -0
- package/node_modules/@maka/runtime-host/dist/assistant/bot/capabilities.js +1 -0
- package/node_modules/@maka/runtime-host/dist/assistant/bot/controller.js +92 -22
- package/node_modules/@maka/runtime-host/dist/assistant/bot/host.js +11 -2
- package/node_modules/@maka/runtime-host/dist/assistant/bot/store.js +71 -2
- package/node_modules/@maka/runtime-host/dist/assistant/bot/turn-ids.js +38 -0
- package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/assistant.js +7 -0
- package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/controller.js +193 -32
- package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/discovery-capabilities.js +69 -0
- package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/host.js +15 -28
- package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/notebook.js +286 -0
- package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/prompt.js +31 -6
- package/node_modules/@maka/runtime-host/dist/assistant/index-initiative/store.js +18 -1
- package/node_modules/@maka/runtime-host/dist/assistant/memory-network/controller.js +203 -71
- package/node_modules/@maka/runtime-host/dist/assistant/memory-network/host.js +21 -5
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/condition-observer.js +94 -0
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/condition-store.js +253 -0
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/condition.js +133 -0
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/controller.js +27 -14
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/delegation.js +37 -5
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/delivery.js +1 -1
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/host.js +16 -2
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/matter.js +13 -0
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/prompt.js +7 -5
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/review.js +68 -14
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/settlement-context.js +126 -0
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/store.js +92 -6
- package/node_modules/@maka/runtime-host/dist/assistant/proactive-matters/tools.js +93 -23
- package/node_modules/@maka/runtime-host/dist/assistant/service.js +72 -16
- package/node_modules/@maka/runtime-host/dist/client/host-profile.js +30 -1
- package/node_modules/@maka/runtime-host/dist/client/ssh-operator-activation.js +9 -2
- package/node_modules/@maka/runtime-host/dist/protocol/goal.js +119 -1
- package/node_modules/@maka/runtime-host/dist/protocol/index.js +10 -3
- package/node_modules/@maka/runtime-host/dist/protocol/operations.js +8 -1
- package/node_modules/@maka/runtime-host/dist/protocol/personal-assistant.js +1 -0
- package/node_modules/@maka/runtime-host/dist/protocol/plugin-platform.js +7 -1
- package/node_modules/@maka/runtime-host/dist/protocol/session-checkin.js +133 -0
- package/node_modules/@maka/runtime-host/dist/server/agent-settings-tools.js +0 -1
- package/node_modules/@maka/runtime-host/dist/server/canonical-session-projection.js +3 -2
- package/node_modules/@maka/runtime-host/dist/server/event-wait-manager.js +151 -20
- package/node_modules/@maka/runtime-host/dist/server/event-wait-observation-store.js +19 -0
- package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +127 -11
- package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +47 -3
- package/node_modules/@maka/runtime-host/dist/server/execution-model-composition.js +11 -0
- package/node_modules/@maka/runtime-host/dist/server/external-session-coordinator.js +5 -2
- package/node_modules/@maka/runtime-host/dist/server/goal-coordinator.js +343 -53
- package/node_modules/@maka/runtime-host/dist/server/goal-event-waits.js +457 -0
- package/node_modules/@maka/runtime-host/dist/server/goal-execution-coordinator.js +23 -6
- package/node_modules/@maka/runtime-host/dist/server/goal-projection.js +24 -3
- package/node_modules/@maka/runtime-host/dist/server/hosted-execution-recovery.js +5 -1
- package/node_modules/@maka/runtime-host/dist/server/index.js +2 -0
- package/node_modules/@maka/runtime-host/dist/server/interactive-run-composer.js +44 -2
- package/node_modules/@maka/runtime-host/dist/server/personal-assistant-workspace.js +78 -0
- package/node_modules/@maka/runtime-host/dist/server/root-turn-coordinator.js +8 -0
- package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +73 -3
- package/node_modules/@maka/runtime-host/dist/server/session-checkin.js +257 -0
- package/node_modules/@maka/runtime-host/dist/server/session-checkpoint-coordinator.js +282 -0
- package/node_modules/@maka/runtime-host/dist/server/session-checkpoint-publication.js +250 -0
- package/node_modules/@maka/runtime-host/dist/server/shell-run-event-wait-access.js +166 -0
- package/node_modules/@maka/runtime-host/dist/server/shell-run-event-wait-adapter.js +59 -0
- package/node_modules/@maka/runtime-host/dist/server/skill-catalog-repository.js +4 -2
- package/node_modules/@maka/storage/dist/agent-run-store-contract.js +14 -3
- package/node_modules/@maka/storage/dist/agent-run-store.js +10 -0
- package/node_modules/@maka/storage/dist/codex-session-adapter.js +20 -3
- package/node_modules/@maka/storage/dist/context-offload-snapshot.js +2 -1
- package/node_modules/@maka/storage/dist/event-wait-authority.js +18 -1
- package/node_modules/@maka/storage/dist/event-wait-bridge.js +336 -0
- package/node_modules/@maka/storage/dist/execution-stores.js +39 -1
- package/node_modules/@maka/storage/dist/external-session-images.js +131 -0
- package/node_modules/@maka/storage/dist/external-session-importer.js +12 -2
- package/node_modules/@maka/storage/dist/goal-authority.js +2 -0
- package/node_modules/@maka/storage/dist/local-execution-persistence.js +27 -1
- package/node_modules/@maka/storage/dist/operational-state-store.js +1 -1
- package/node_modules/@maka/storage/dist/production-session-snapshot.js +14 -6
- package/node_modules/@maka/storage/dist/runtime-event-persistence.js +1 -0
- package/node_modules/@maka/storage/dist/session-bundle-policy.js +116 -16
- package/node_modules/@maka/storage/dist/session-checkpoint-publication-store.js +204 -0
- package/node_modules/@maka/storage/dist/session-store.js +37 -8
- package/node_modules/@maka/storage/dist/snapshot-operation-gate.js +65 -0
- package/node_modules/@maka/storage/dist/sqlite-context-offload-schema.js +3 -3
- package/node_modules/@maka/storage/dist/sqlite-context-offload-store.js +4 -2
- package/node_modules/@maka/storage/dist/sqlite-event-wait-authority.js +81 -8
- package/node_modules/@maka/storage/dist/sqlite-event-wait-bridge.js +94 -0
- package/node_modules/@maka/storage/dist/sqlite-reclamation-checkpoint.js +37 -0
- package/node_modules/@maka/storage/dist/sqlite-runtime-schema.js +7 -8
- package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +38 -162
- package/node_modules/@maka/storage/dist/sqlite-workflow-schema.js +7 -4
- package/node_modules/@maka/storage/dist/tool-commit-validation.js +1 -1
- package/node_modules/@maka/storage/package.json +4 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-B-4n9P0J.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-J2FaQ-KY.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs +76 -22
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs +76 -22
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/{src-oZBjf3U1.cjs → src-DpAS0jfg.cjs} +105 -8
- package/node_modules/@modelcontextprotocol/client/dist/{src-xKF0PJN-.mjs → src-WCy6ifGf.mjs} +88 -9
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/@modelcontextprotocol/core/package.json +2 -2
- package/node_modules/@modelcontextprotocol/client/package.json +5 -5
- package/node_modules/fast-uri/.github/workflows/release.yml +35 -0
- package/node_modules/fast-uri/README.md +8 -0
- package/node_modules/fast-uri/index.js +98 -18
- package/node_modules/fast-uri/lib/utils.js +52 -0
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/follow-redirects/index.js +10 -1
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/ip-address/README.md +104 -104
- package/node_modules/ip-address/dist/ipv4.js +7 -0
- package/node_modules/ip-address/dist/ipv6.js +7 -4
- package/node_modules/ip-address/dist/v6/constants.js +3 -0
- package/node_modules/ip-address/package.json +2 -1
- package/node_modules/undici/README.md +25 -3
- package/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
- package/node_modules/undici/docs/docs/api/Client.md +11 -6
- package/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
- package/node_modules/undici/docs/docs/api/Errors.md +76 -1
- package/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
- package/node_modules/undici/docs/docs/api/Interceptors.md +28 -8
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
- package/node_modules/undici/docs/docs/index.md +12 -12
- package/node_modules/undici/docs/docs/type-map.json +66 -66
- package/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
- package/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/undici/lib/core/constants.js +12 -1
- package/node_modules/undici/lib/core/errors.js +38 -1
- package/node_modules/undici/lib/core/request.js +16 -1
- package/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/undici/lib/core/util.js +26 -1
- package/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
- package/node_modules/undici/lib/dispatcher/client-h2.js +124 -17
- package/node_modules/undici/lib/dispatcher/client.js +4 -1
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
- package/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
- package/node_modules/undici/lib/dispatcher/pool-base.js +85 -31
- package/node_modules/undici/lib/dispatcher/pool.js +11 -8
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
- package/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
- package/node_modules/undici/lib/handler/cache-handler.js +153 -15
- package/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
- package/node_modules/undici/lib/handler/redirect-handler.js +28 -8
- package/node_modules/undici/lib/handler/retry-handler.js +44 -11
- package/node_modules/undici/lib/interceptor/cache.js +11 -3
- package/node_modules/undici/lib/interceptor/decompress.js +22 -9
- package/node_modules/undici/lib/interceptor/dns.js +11 -0
- package/node_modules/undici/lib/interceptor/response-error.js +72 -28
- package/node_modules/undici/lib/milo/LICENSE.md +7 -0
- package/node_modules/undici/lib/milo/no-simd.js +1002 -0
- package/node_modules/undici/lib/milo/simd.js +1002 -0
- package/node_modules/undici/lib/mock/mock-agent.js +11 -0
- package/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
- package/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
- package/node_modules/undici/lib/util/cache.js +11 -5
- package/node_modules/undici/lib/web/cookies/util.js +19 -2
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
- package/node_modules/undici/lib/web/fetch/body.js +47 -38
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
- package/node_modules/undici/lib/web/fetch/headers.js +2 -2
- package/node_modules/undici/lib/web/fetch/index.js +8 -4
- package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/undici/lib/web/websocket/receiver.js +25 -4
- package/node_modules/undici/package.json +9 -7
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/package.json +2 -2
- package/node_modules/@modelcontextprotocol/client/dist/index-D_CiY-T3.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/index-D_QDtbiv.d.mts.map +0 -1
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
{
|
|
2
|
-
"AbortError": "/api/Errors.
|
|
3
|
-
"Agent": "/api/Agent.
|
|
4
|
-
"AgentDispatchOptions": "/api/Agent.
|
|
5
|
-
"AgentOptions": "/api/Agent.
|
|
6
|
-
"BalancedPool": "/api/BalancedPool.
|
|
7
|
-
"BalancedPoolOptions": "/api/BalancedPool.
|
|
8
|
-
"BodyMixin": "/api/Fetch.
|
|
2
|
+
"AbortError": "/api/Errors.html#class-aborterror",
|
|
3
|
+
"Agent": "/api/Agent.html#class-agent",
|
|
4
|
+
"AgentDispatchOptions": "/api/Agent.html#agentdispatchoptions-handler",
|
|
5
|
+
"AgentOptions": "/api/Agent.html#new-agentoptions",
|
|
6
|
+
"BalancedPool": "/api/BalancedPool.html#class-balancedpool",
|
|
7
|
+
"BalancedPoolOptions": "/api/BalancedPool.html#parameter-balancedpooloptions",
|
|
8
|
+
"BodyMixin": "/api/Fetch.html#new-formdata",
|
|
9
9
|
"Buffer": "https://nodejs.org/api/buffer.html#class-buffer",
|
|
10
|
-
"BuildOptions": "/api/Connector.
|
|
11
|
-
"CacheKey": "/api/CacheStore.
|
|
12
|
-
"CacheStore": "/api/CacheStore.
|
|
13
|
-
"CacheValue": "/api/CacheStore.
|
|
14
|
-
"ClientDestroyedError": "/api/Errors.
|
|
15
|
-
"ClientOptions": "/api/Client.
|
|
16
|
-
"ClientStats": "/api/ClientStats.
|
|
17
|
-
"ConnectOptions": "/api/Dispatcher.
|
|
18
|
-
"Cookie": "/api/Cookies.
|
|
19
|
-
"DispatchController": "/api/Dispatcher.
|
|
20
|
-
"DispatchHandler": "/api/Dispatcher.
|
|
21
|
-
"DispatchOptions": "/api/Dispatcher.
|
|
22
|
-
"Dispatcher": "/api/Dispatcher.
|
|
10
|
+
"BuildOptions": "/api/Connector.html#buildconnectoroptions",
|
|
11
|
+
"CacheKey": "/api/CacheStore.html#cachekey",
|
|
12
|
+
"CacheStore": "/api/CacheStore.html#new-memorycachestoreoptions",
|
|
13
|
+
"CacheValue": "/api/CacheStore.html#cachevalue",
|
|
14
|
+
"ClientDestroyedError": "/api/Errors.html#class-clientdestroyederror",
|
|
15
|
+
"ClientOptions": "/api/Client.html#new-clienturl-options",
|
|
16
|
+
"ClientStats": "/api/ClientStats.html#class-clientstats",
|
|
17
|
+
"ConnectOptions": "/api/Dispatcher.html#class-dispatcher",
|
|
18
|
+
"Cookie": "/api/Cookies.html#cookie",
|
|
19
|
+
"DispatchController": "/api/Dispatcher.html#class-dispatcher",
|
|
20
|
+
"DispatchHandler": "/api/Dispatcher.html#class-dispatcher",
|
|
21
|
+
"DispatchOptions": "/api/Dispatcher.html#class-dispatcher",
|
|
22
|
+
"Dispatcher": "/api/Dispatcher.html#class-dispatcher",
|
|
23
23
|
"Duplex": "https://nodejs.org/api/stream.html#class-streamduplex",
|
|
24
|
-
"EnvHttpProxyAgent": "/api/EnvHttpProxyAgent.
|
|
25
|
-
"EnvHttpProxyAgentOptions": "/api/EnvHttpProxyAgent.
|
|
24
|
+
"EnvHttpProxyAgent": "/api/EnvHttpProxyAgent.html#class-envhttpproxyagent",
|
|
25
|
+
"EnvHttpProxyAgentOptions": "/api/EnvHttpProxyAgent.html#new-envhttpproxyagentoptions",
|
|
26
26
|
"EventEmitter": "https://nodejs.org/api/events.html#class-eventemitter",
|
|
27
|
-
"GetResult": "/api/CacheStore.
|
|
28
|
-
"H2CClientOptions": "/api/H2CClient.
|
|
27
|
+
"GetResult": "/api/CacheStore.html#getresult",
|
|
28
|
+
"H2CClientOptions": "/api/H2CClient.html#new-h2cclienturl-options",
|
|
29
29
|
"HeadersInit": "https://developer.mozilla.org/docs/Web/API/Headers/Headers",
|
|
30
|
-
"InvalidArgumentError": "/api/Errors.
|
|
30
|
+
"InvalidArgumentError": "/api/Errors.html#class-invalidargumenterror",
|
|
31
31
|
"Iterable": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols",
|
|
32
|
-
"MaxOriginsReachedError": "/api/Errors.
|
|
33
|
-
"MockAgent": "/api/MockAgent.
|
|
34
|
-
"MockAgentOptions": "/api/MockAgent.
|
|
35
|
-
"MockCallHistory": "/api/MockCallHistory.
|
|
36
|
-
"MockCallHistoryLog": "/api/MockCallHistoryLog.
|
|
37
|
-
"MockClient": "/api/MockClient.
|
|
38
|
-
"MockClientOptions": "/api/MockClient.
|
|
39
|
-
"MockInterceptor": "/api/MockPool.
|
|
40
|
-
"MockInterceptor.Options": "/api/MockPool.
|
|
41
|
-
"MockPool": "/api/MockPool.
|
|
42
|
-
"MockPoolInterceptOptions": "/api/MockPool.
|
|
43
|
-
"MockPoolOptions": "/api/MockPool.
|
|
44
|
-
"MockResponseOptions": "/api/MockPool.
|
|
45
|
-
"MockScope": "/api/MockPool.
|
|
46
|
-
"PendingInterceptor": "/api/MockAgent.
|
|
47
|
-
"PipelineOptions": "/api/Dispatcher.
|
|
48
|
-
"Pool": "/api/Pool.
|
|
49
|
-
"PoolOptions": "/api/Pool.
|
|
50
|
-
"PoolStats": "/api/PoolStats.
|
|
51
|
-
"ProxyAgent": "/api/ProxyAgent.
|
|
52
|
-
"ProxyAgentOptions": "/api/ProxyAgent.
|
|
32
|
+
"MaxOriginsReachedError": "/api/Errors.html#class-maxoriginsreachederror",
|
|
33
|
+
"MockAgent": "/api/MockAgent.html#class-mockagent",
|
|
34
|
+
"MockAgentOptions": "/api/MockAgent.html#parameter-mockagentoptions",
|
|
35
|
+
"MockCallHistory": "/api/MockCallHistory.html#class-mockcallhistory",
|
|
36
|
+
"MockCallHistoryLog": "/api/MockCallHistoryLog.html#class-mockcallhistorylog",
|
|
37
|
+
"MockClient": "/api/MockClient.html#class-mockclient",
|
|
38
|
+
"MockClientOptions": "/api/MockClient.html#parameter-mockclientoptions",
|
|
39
|
+
"MockInterceptor": "/api/MockPool.html#return-mockinterceptor",
|
|
40
|
+
"MockInterceptor.Options": "/api/MockPool.html#parameter-mockpoolinterceptoptions",
|
|
41
|
+
"MockPool": "/api/MockPool.html#class-mockpool",
|
|
42
|
+
"MockPoolInterceptOptions": "/api/MockPool.html#parameter-mockpoolinterceptoptions",
|
|
43
|
+
"MockPoolOptions": "/api/MockPool.html#parameter-mockpooloptions",
|
|
44
|
+
"MockResponseOptions": "/api/MockPool.html#parameter-mockresponseoptions",
|
|
45
|
+
"MockScope": "/api/MockPool.html#return-mockscope",
|
|
46
|
+
"PendingInterceptor": "/api/MockAgent.html#new-mockagentoptions",
|
|
47
|
+
"PipelineOptions": "/api/Dispatcher.html#class-dispatcher",
|
|
48
|
+
"Pool": "/api/Pool.html#class-pool",
|
|
49
|
+
"PoolOptions": "/api/Pool.html#new-poolurl-options",
|
|
50
|
+
"PoolStats": "/api/PoolStats.html#class-poolstats",
|
|
51
|
+
"ProxyAgent": "/api/ProxyAgent.html#class-proxyagent",
|
|
52
|
+
"ProxyAgentOptions": "/api/ProxyAgent.html#new-proxyagentoptions",
|
|
53
53
|
"Readable": "https://nodejs.org/api/stream.html#class-streamreadable",
|
|
54
54
|
"Record": "https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type",
|
|
55
|
-
"RequestInit": "/api/Fetch.
|
|
56
|
-
"RequestOptions": "/api/Dispatcher.
|
|
57
|
-
"ResponseInit": "/api/Fetch.
|
|
58
|
-
"RetryContext": "/api/RetryHandler.
|
|
59
|
-
"RetryHandler": "/api/RetryHandler.
|
|
60
|
-
"RetryHandlers": "/api/RetryHandler.
|
|
61
|
-
"RetryOptions": "/api/RetryHandler.
|
|
62
|
-
"RetryState": "/api/RetryHandler.
|
|
63
|
-
"RoundRobinPoolOptions": "/api/RoundRobinPool.
|
|
64
|
-
"SnapshotRecorder": "/api/SnapshotAgent.
|
|
55
|
+
"RequestInit": "/api/Fetch.html#new-formdata",
|
|
56
|
+
"RequestOptions": "/api/Dispatcher.html#class-dispatcher",
|
|
57
|
+
"ResponseInit": "/api/Fetch.html#new-formdata",
|
|
58
|
+
"RetryContext": "/api/RetryHandler.html#retrycontext",
|
|
59
|
+
"RetryHandler": "/api/RetryHandler.html#class-retryhandler",
|
|
60
|
+
"RetryHandlers": "/api/RetryHandler.html#parameter-retryhandlers",
|
|
61
|
+
"RetryOptions": "/api/RetryHandler.html#retryoptions",
|
|
62
|
+
"RetryState": "/api/RetryHandler.html#retrystate",
|
|
63
|
+
"RoundRobinPoolOptions": "/api/RoundRobinPool.html#parameter-roundrobinpooloptions",
|
|
64
|
+
"SnapshotRecorder": "/api/SnapshotAgent.html#new-snapshotagentoptions",
|
|
65
65
|
"Socket": "https://nodejs.org/api/net.html#class-netsocket",
|
|
66
|
-
"SocketInfo": "/api/Errors.
|
|
67
|
-
"StreamOptions": "/api/Dispatcher.
|
|
66
|
+
"SocketInfo": "/api/Errors.html#new-requestretryerrormessage-code-options",
|
|
67
|
+
"StreamOptions": "/api/Dispatcher.html#class-dispatcher",
|
|
68
68
|
"TLSSocket": "https://nodejs.org/api/tls.html#class-tlstlssocket",
|
|
69
|
-
"UndiciError": "/api/Errors.
|
|
70
|
-
"UndiciHeaders": "/api/Dispatcher.
|
|
71
|
-
"UpgradeOptions": "/api/Dispatcher.
|
|
72
|
-
"UrlObject": "/index.
|
|
73
|
-
"WebSocketInit": "/api/WebSocket.
|
|
74
|
-
"WebSocketStreamOptions": "/api/WebSocket.
|
|
69
|
+
"UndiciError": "/api/Errors.html#class-undicierror",
|
|
70
|
+
"UndiciHeaders": "/api/Dispatcher.html#class-dispatcher",
|
|
71
|
+
"UpgradeOptions": "/api/Dispatcher.html#class-dispatcher",
|
|
72
|
+
"UrlObject": "/index.html#urlobject",
|
|
73
|
+
"WebSocketInit": "/api/WebSocket.html#new-websocketurl-protocols",
|
|
74
|
+
"WebSocketStreamOptions": "/api/WebSocket.html#new-websocketurl-protocols",
|
|
75
75
|
"Writable": "https://nodejs.org/api/stream.html#class-streamwritable",
|
|
76
|
-
"buildConnector.BuildOptions": "/api/Connector.
|
|
76
|
+
"buildConnector.BuildOptions": "/api/Connector.html#buildconnectoroptions",
|
|
77
77
|
"net.Socket": "https://nodejs.org/api/net.html#class-netsocket",
|
|
78
78
|
"stream.Readable": "https://nodejs.org/api/stream.html#class-streamreadable"
|
|
79
|
-
}
|
|
79
|
+
}
|
|
@@ -100,6 +100,11 @@ class MemoryCacheStore extends EventEmitter {
|
|
|
100
100
|
|
|
101
101
|
const entry = entries ? findEntry(key, entries, now) : null
|
|
102
102
|
|
|
103
|
+
if (entry != null) {
|
|
104
|
+
this.#entries.delete(topLevelKey)
|
|
105
|
+
this.#entries.set(topLevelKey, entries)
|
|
106
|
+
}
|
|
107
|
+
|
|
103
108
|
return entry == null
|
|
104
109
|
? undefined
|
|
105
110
|
: {
|
|
@@ -148,11 +153,13 @@ class MemoryCacheStore extends EventEmitter {
|
|
|
148
153
|
},
|
|
149
154
|
final (callback) {
|
|
150
155
|
let entries = store.#entries.get(topLevelKey)
|
|
151
|
-
if (
|
|
156
|
+
if (entries) {
|
|
157
|
+
store.#entries.delete(topLevelKey)
|
|
158
|
+
} else {
|
|
152
159
|
entries = []
|
|
153
|
-
store.#entries.set(topLevelKey, entries)
|
|
154
160
|
}
|
|
155
|
-
|
|
161
|
+
store.#entries.set(topLevelKey, entries)
|
|
162
|
+
const previousEntry = findEntry(key, entries, -Infinity)
|
|
156
163
|
if (previousEntry) {
|
|
157
164
|
const index = entries.indexOf(previousEntry)
|
|
158
165
|
entries.splice(index, 1, entry)
|
|
@@ -177,16 +184,7 @@ class MemoryCacheStore extends EventEmitter {
|
|
|
177
184
|
store.#hasEmittedMaxSizeEvent = true
|
|
178
185
|
}
|
|
179
186
|
|
|
180
|
-
|
|
181
|
-
for (const [key, entries] of store.#entries) {
|
|
182
|
-
for (const entry of entries.splice(0, Math.ceil(entries.length / 2))) {
|
|
183
|
-
store.#size -= entry.size
|
|
184
|
-
store.#count -= 1
|
|
185
|
-
}
|
|
186
|
-
if (entries.length === 0) {
|
|
187
|
-
store.#entries.delete(key)
|
|
188
|
-
}
|
|
189
|
-
}
|
|
187
|
+
store.#evict(entry)
|
|
190
188
|
|
|
191
189
|
// Reset the event flag after eviction
|
|
192
190
|
if (store.#size < store.#maxSize && store.#count < store.#maxCount) {
|
|
@@ -199,6 +197,43 @@ class MemoryCacheStore extends EventEmitter {
|
|
|
199
197
|
})
|
|
200
198
|
}
|
|
201
199
|
|
|
200
|
+
#evict (keep) {
|
|
201
|
+
const targetSize = this.#maxSize / 2
|
|
202
|
+
const targetCount = this.#maxCount / 2
|
|
203
|
+
|
|
204
|
+
for (const [key, entries] of this.#entries) {
|
|
205
|
+
for (let i = 0; i < entries.length && (this.#size > targetSize || this.#count > targetCount);) {
|
|
206
|
+
const entry = entries[i]
|
|
207
|
+
if (entry === keep) {
|
|
208
|
+
i++
|
|
209
|
+
continue
|
|
210
|
+
}
|
|
211
|
+
entries.splice(i, 1)
|
|
212
|
+
this.#size -= entry.size
|
|
213
|
+
this.#count -= 1
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (entries.length === 0) {
|
|
217
|
+
this.#entries.delete(key)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (this.#size <= targetSize && this.#count <= targetCount) {
|
|
221
|
+
return
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (this.#size > this.#maxSize || this.#count > this.#maxCount) {
|
|
226
|
+
const topLevelKey = `${keep.origin}:${keep.path}`
|
|
227
|
+
const entries = this.#entries.get(topLevelKey)
|
|
228
|
+
entries.splice(entries.indexOf(keep), 1)
|
|
229
|
+
this.#size -= keep.size
|
|
230
|
+
this.#count -= 1
|
|
231
|
+
if (entries.length === 0) {
|
|
232
|
+
this.#entries.delete(topLevelKey)
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
202
237
|
/**
|
|
203
238
|
* @param {CacheKey} key
|
|
204
239
|
*/
|
|
@@ -2,14 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
const { Writable } = require('node:stream')
|
|
4
4
|
const { assertCacheKey, assertCacheValue } = require('../util/cache.js')
|
|
5
|
+
const { zstdCompressSync, zstdDecompressSync } = require('node:zlib')
|
|
5
6
|
|
|
6
7
|
let DatabaseSync
|
|
7
8
|
|
|
8
|
-
const VERSION =
|
|
9
|
+
const VERSION = 4
|
|
9
10
|
|
|
10
11
|
// 2gb
|
|
11
12
|
const MAX_ENTRY_SIZE = 2 * 1000 * 1000 * 1000
|
|
12
13
|
|
|
14
|
+
// 1MiB
|
|
15
|
+
const COMPRESS_THRESHOLD = 1024 * 1024
|
|
16
|
+
|
|
17
|
+
// zstd support landed in Node 22.19.0/23.4.0, so it may be missing even when
|
|
18
|
+
// node:sqlite is available.
|
|
19
|
+
const hasZstd = typeof zstdCompressSync === 'function' && typeof zstdDecompressSync === 'function'
|
|
20
|
+
|
|
13
21
|
/**
|
|
14
22
|
* @typedef {import('../../types/cache-interceptor.d.ts').default.CacheStore} CacheStore
|
|
15
23
|
* @implements {CacheStore}
|
|
@@ -17,6 +25,7 @@ const MAX_ENTRY_SIZE = 2 * 1000 * 1000 * 1000
|
|
|
17
25
|
* @typedef {{
|
|
18
26
|
* id: Readonly<number>,
|
|
19
27
|
* body?: Uint8Array
|
|
28
|
+
* compressed?: string
|
|
20
29
|
* statusCode: number
|
|
21
30
|
* statusMessage: string
|
|
22
31
|
* headers?: string
|
|
@@ -31,6 +40,7 @@ const MAX_ENTRY_SIZE = 2 * 1000 * 1000 * 1000
|
|
|
31
40
|
module.exports = class SqliteCacheStore {
|
|
32
41
|
#maxEntrySize = MAX_ENTRY_SIZE
|
|
33
42
|
#maxCount = Infinity
|
|
43
|
+
#compressThreshold = COMPRESS_THRESHOLD
|
|
34
44
|
|
|
35
45
|
/**
|
|
36
46
|
* @type {import('node:sqlite').DatabaseSync}
|
|
@@ -107,6 +117,17 @@ module.exports = class SqliteCacheStore {
|
|
|
107
117
|
}
|
|
108
118
|
this.#maxCount = opts.maxCount
|
|
109
119
|
}
|
|
120
|
+
|
|
121
|
+
if (opts.compressThreshold !== undefined) {
|
|
122
|
+
if (
|
|
123
|
+
typeof opts.compressThreshold !== 'number' ||
|
|
124
|
+
!Number.isInteger(opts.compressThreshold) ||
|
|
125
|
+
opts.compressThreshold < 0
|
|
126
|
+
) {
|
|
127
|
+
throw new TypeError('SqliteCacheStore options.compressThreshold must be a non-negative integer')
|
|
128
|
+
}
|
|
129
|
+
this.#compressThreshold = opts.compressThreshold
|
|
130
|
+
}
|
|
110
131
|
}
|
|
111
132
|
|
|
112
133
|
if (!DatabaseSync) {
|
|
@@ -128,6 +149,7 @@ module.exports = class SqliteCacheStore {
|
|
|
128
149
|
|
|
129
150
|
-- Data returned to the interceptor
|
|
130
151
|
body BUF NULL,
|
|
152
|
+
compressed TEXT NULL,
|
|
131
153
|
deleteAt INTEGER NOT NULL,
|
|
132
154
|
statusCode INTEGER NOT NULL,
|
|
133
155
|
statusMessage TEXT NOT NULL,
|
|
@@ -147,6 +169,7 @@ module.exports = class SqliteCacheStore {
|
|
|
147
169
|
SELECT
|
|
148
170
|
id,
|
|
149
171
|
body,
|
|
172
|
+
compressed,
|
|
150
173
|
deleteAt,
|
|
151
174
|
statusCode,
|
|
152
175
|
statusMessage,
|
|
@@ -167,6 +190,7 @@ module.exports = class SqliteCacheStore {
|
|
|
167
190
|
this.#updateValueQuery = this.#db.prepare(`
|
|
168
191
|
UPDATE cacheInterceptorV${VERSION} SET
|
|
169
192
|
body = ?,
|
|
193
|
+
compressed = ?,
|
|
170
194
|
deleteAt = ?,
|
|
171
195
|
statusCode = ?,
|
|
172
196
|
statusMessage = ?,
|
|
@@ -185,6 +209,7 @@ module.exports = class SqliteCacheStore {
|
|
|
185
209
|
url,
|
|
186
210
|
method,
|
|
187
211
|
body,
|
|
212
|
+
compressed,
|
|
188
213
|
deleteAt,
|
|
189
214
|
statusCode,
|
|
190
215
|
statusMessage,
|
|
@@ -194,7 +219,7 @@ module.exports = class SqliteCacheStore {
|
|
|
194
219
|
vary,
|
|
195
220
|
cachedAt,
|
|
196
221
|
staleAt
|
|
197
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
222
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
198
223
|
`)
|
|
199
224
|
|
|
200
225
|
this.#deleteByUrlQuery = this.#db.prepare(
|
|
@@ -237,7 +262,11 @@ module.exports = class SqliteCacheStore {
|
|
|
237
262
|
const value = this.#findValue(key)
|
|
238
263
|
return value
|
|
239
264
|
? {
|
|
240
|
-
body: value.body
|
|
265
|
+
body: value.body
|
|
266
|
+
? value.compressed === 'zstd'
|
|
267
|
+
? zstdDecompressSync(Buffer.from(value.body.buffer, value.body.byteOffset, value.body.byteLength))
|
|
268
|
+
: Buffer.from(value.body.buffer, value.body.byteOffset, value.body.byteLength)
|
|
269
|
+
: undefined,
|
|
241
270
|
statusCode: value.statusCode,
|
|
242
271
|
statusMessage: value.statusMessage,
|
|
243
272
|
headers: value.headers ? JSON.parse(value.headers) : undefined,
|
|
@@ -268,11 +297,22 @@ module.exports = class SqliteCacheStore {
|
|
|
268
297
|
return
|
|
269
298
|
}
|
|
270
299
|
|
|
300
|
+
let compressed = null
|
|
301
|
+
let storedBody = body
|
|
302
|
+
if (body && hasZstd && (size > this.#compressThreshold || isCompressibleContentType(getContentType(value.headers)))) {
|
|
303
|
+
const candidate = zstdCompressSync(body)
|
|
304
|
+
if (candidate.byteLength < body.byteLength) {
|
|
305
|
+
storedBody = candidate
|
|
306
|
+
compressed = 'zstd'
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
271
310
|
const existingValue = this.#findValue(key, true)
|
|
272
311
|
if (existingValue) {
|
|
273
312
|
// Updating an existing response, let's overwrite it
|
|
274
313
|
this.#updateValueQuery.run(
|
|
275
|
-
|
|
314
|
+
storedBody,
|
|
315
|
+
compressed,
|
|
276
316
|
value.deleteAt,
|
|
277
317
|
value.statusCode,
|
|
278
318
|
value.statusMessage,
|
|
@@ -289,7 +329,8 @@ module.exports = class SqliteCacheStore {
|
|
|
289
329
|
this.#insertValueQuery.run(
|
|
290
330
|
url,
|
|
291
331
|
key.method,
|
|
292
|
-
|
|
332
|
+
storedBody,
|
|
333
|
+
compressed,
|
|
293
334
|
value.deleteAt,
|
|
294
335
|
value.statusCode,
|
|
295
336
|
value.statusMessage,
|
|
@@ -467,3 +508,40 @@ function headerValueEquals (lhs, rhs) {
|
|
|
467
508
|
|
|
468
509
|
return lhs === rhs
|
|
469
510
|
}
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* @param {Record<string, string|string[]>|null|undefined} headers
|
|
514
|
+
* @returns {string|undefined}
|
|
515
|
+
*/
|
|
516
|
+
function getContentType (headers) {
|
|
517
|
+
if (headers == null) {
|
|
518
|
+
return undefined
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
for (const key in headers) {
|
|
522
|
+
if (key.toLowerCase() === 'content-type') {
|
|
523
|
+
const value = headers[key]
|
|
524
|
+
return Array.isArray(value) ? value[0] : value
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
return undefined
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* @param {string|undefined} contentType
|
|
533
|
+
* @returns {boolean}
|
|
534
|
+
*/
|
|
535
|
+
function isCompressibleContentType (contentType) {
|
|
536
|
+
if (contentType == null) {
|
|
537
|
+
return false
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
const type = contentType.toLowerCase()
|
|
541
|
+
|
|
542
|
+
// text/* and application/json, xml, javascript, ... are easily compressible
|
|
543
|
+
// even at smaller sizes, so ignore the compressThreshold for them.
|
|
544
|
+
return /^text\//.test(type) ||
|
|
545
|
+
/^application\/(json|xml|javascript|x-www-form-urlencoded|graphql)(\s|;|$)/.test(type) ||
|
|
546
|
+
/\+(json|xml)(\s|;|$)/.test(type)
|
|
547
|
+
}
|
|
@@ -41,16 +41,22 @@ const SessionCache = class WeakSessionCache {
|
|
|
41
41
|
if (this._sessionCache.has(sessionKey)) {
|
|
42
42
|
this._sessionCache.delete(sessionKey)
|
|
43
43
|
} else if (this._sessionCache.size >= this._maxCachedSessions) {
|
|
44
|
+
// Make room for the new session: prefer an entry whose session has
|
|
45
|
+
// already been collected, otherwise evict the oldest one.
|
|
46
|
+
let evicted = false
|
|
44
47
|
for (const [key, ref] of this._sessionCache) {
|
|
45
48
|
if (ref.deref() === undefined) {
|
|
46
49
|
this._sessionCache.delete(key)
|
|
47
|
-
|
|
50
|
+
evicted = true
|
|
51
|
+
break
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
if (!evicted) {
|
|
56
|
+
const oldest = this._sessionCache.keys().next()
|
|
57
|
+
if (!oldest.done) {
|
|
58
|
+
this._sessionCache.delete(oldest.value)
|
|
59
|
+
}
|
|
54
60
|
}
|
|
55
61
|
}
|
|
56
62
|
|
|
@@ -114,7 +114,18 @@ for (let i = 0; i < wellknownHeaderNames.length; ++i) {
|
|
|
114
114
|
lowerCasedKey
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Default WebSocket receive limits (see `webSocket` in Client.md). Used by
|
|
119
|
+
* DispatcherBase#webSocketOptions and by the WebSocket parser when the
|
|
120
|
+
* dispatcher doesn't provide a value, so a dispatcher without
|
|
121
|
+
* `webSocketOptions` (a custom one, or a wrapper) doesn't remove the limits.
|
|
122
|
+
*/
|
|
123
|
+
const defaultWebSocketMaxFragments = 131072
|
|
124
|
+
const defaultWebSocketMaxPayloadSize = 128 * 1024 * 1024 // 128 MB
|
|
125
|
+
|
|
117
126
|
module.exports = {
|
|
118
127
|
wellknownHeaderNames,
|
|
119
|
-
headerNameLowerCasedRecord
|
|
128
|
+
headerNameLowerCasedRecord,
|
|
129
|
+
defaultWebSocketMaxFragments,
|
|
130
|
+
defaultWebSocketMaxPayloadSize
|
|
120
131
|
}
|
|
@@ -306,6 +306,22 @@ class BalancedPoolMissingUpstreamError extends UndiciError {
|
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
+
const kWebAssemblyNotSupportedError = Symbol.for('undici.error.ERR_WEBASSEMBLY_NOT_SUPPORTED')
|
|
310
|
+
class WebAssemblyNotSupportedError extends Error {
|
|
311
|
+
constructor (message) {
|
|
312
|
+
super(message || 'WebAssembly is not supported in this environment, but is required for HTTP/1 parsing')
|
|
313
|
+
this.code = 'ERR_WEBASSEMBLY_NOT_SUPPORTED'
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
static [Symbol.hasInstance] (instance) {
|
|
317
|
+
return instance && instance[kWebAssemblyNotSupportedError] === true
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
get [kWebAssemblyNotSupportedError] () {
|
|
321
|
+
return true
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
309
325
|
const kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER')
|
|
310
326
|
class HTTPParserError extends Error {
|
|
311
327
|
constructor (message, code, data) {
|
|
@@ -365,13 +381,14 @@ class RequestRetryError extends UndiciError {
|
|
|
365
381
|
|
|
366
382
|
const kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE')
|
|
367
383
|
class ResponseError extends UndiciError {
|
|
368
|
-
constructor (message, code, { headers, body }) {
|
|
384
|
+
constructor (message, code, { headers, body, bodyTruncated = false }) {
|
|
369
385
|
super(message)
|
|
370
386
|
this.name = 'ResponseError'
|
|
371
387
|
this.message = message || 'Response error'
|
|
372
388
|
this.code = 'UND_ERR_RESPONSE'
|
|
373
389
|
this.statusCode = code
|
|
374
390
|
this.body = body
|
|
391
|
+
this.bodyTruncated = bodyTruncated
|
|
375
392
|
this.headers = headers
|
|
376
393
|
}
|
|
377
394
|
|
|
@@ -422,6 +439,24 @@ class ProxyConnectionError extends UndiciError {
|
|
|
422
439
|
}
|
|
423
440
|
}
|
|
424
441
|
|
|
442
|
+
const kMaxRedirectsError = Symbol.for('undici.error.UND_ERR_REDIRECT_MAX')
|
|
443
|
+
class MaxRedirectsError extends UndiciError {
|
|
444
|
+
constructor (message) {
|
|
445
|
+
super(message)
|
|
446
|
+
this.name = 'MaxRedirectsError'
|
|
447
|
+
this.message = message || 'max redirects'
|
|
448
|
+
this.code = 'UND_ERR_REDIRECT_MAX'
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
static [Symbol.hasInstance] (instance) {
|
|
452
|
+
return instance && instance[kMaxRedirectsError] === true
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
get [kMaxRedirectsError] () {
|
|
456
|
+
return true
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
425
460
|
const kMaxOriginsReachedError = Symbol.for('undici.error.UND_ERR_MAX_ORIGINS_REACHED')
|
|
426
461
|
class MaxOriginsReachedError extends UndiciError {
|
|
427
462
|
constructor (message) {
|
|
@@ -469,6 +504,7 @@ class MessageSizeExceededError extends UndiciError {
|
|
|
469
504
|
|
|
470
505
|
module.exports = {
|
|
471
506
|
AbortError,
|
|
507
|
+
WebAssemblyNotSupportedError,
|
|
472
508
|
HTTPParserError,
|
|
473
509
|
UndiciError,
|
|
474
510
|
HeadersTimeoutError,
|
|
@@ -492,6 +528,7 @@ module.exports = {
|
|
|
492
528
|
SecureProxyConnectionError,
|
|
493
529
|
ProxyConnectionError,
|
|
494
530
|
MaxOriginsReachedError,
|
|
531
|
+
MaxRedirectsError,
|
|
495
532
|
Socks5ProxyError,
|
|
496
533
|
MessageSizeExceededError
|
|
497
534
|
}
|
|
@@ -206,7 +206,12 @@ class Request {
|
|
|
206
206
|
this.body = body.byteLength ? Buffer.from(body) : null
|
|
207
207
|
} else if (typeof body === 'string') {
|
|
208
208
|
this.body = body.length ? Buffer.from(body) : null
|
|
209
|
-
} else if (isFormDataLike(body)
|
|
209
|
+
} else if (isFormDataLike(body)) {
|
|
210
|
+
if (!isUndiciFormData(body)) {
|
|
211
|
+
throw new InvalidArgumentError('body must be a FormData created by this undici package instance; FormData from other sources, such as the built-in FormData provided by Node.js, is not supported')
|
|
212
|
+
}
|
|
213
|
+
this.body = body
|
|
214
|
+
} else if (isIterable(body) || isBlobLike(body)) {
|
|
210
215
|
this.body = body
|
|
211
216
|
} else {
|
|
212
217
|
throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
|
|
@@ -564,4 +569,14 @@ function processHeader (request, key, val) {
|
|
|
564
569
|
}
|
|
565
570
|
}
|
|
566
571
|
|
|
572
|
+
let isFormData
|
|
573
|
+
|
|
574
|
+
function isUndiciFormData (body) {
|
|
575
|
+
if (isFormData === undefined) {
|
|
576
|
+
require('../web/fetch/formdata')
|
|
577
|
+
isFormData = require('../web/webidl').webidl.is.FormData
|
|
578
|
+
}
|
|
579
|
+
return isFormData(body)
|
|
580
|
+
}
|
|
581
|
+
|
|
567
582
|
module.exports = Request
|
|
@@ -6,6 +6,7 @@ module.exports = {
|
|
|
6
6
|
kDispatch: Symbol('dispatch'),
|
|
7
7
|
kUrl: Symbol('url'),
|
|
8
8
|
kRequestOrigin: Symbol('request origin'),
|
|
9
|
+
kRedirectCacheControl: Symbol('redirect cache control'),
|
|
9
10
|
kOriginless: Symbol('originless'),
|
|
10
11
|
kWriting: Symbol('writing'),
|
|
11
12
|
kResuming: Symbol('resuming'),
|
|
@@ -72,6 +73,7 @@ module.exports = {
|
|
|
72
73
|
kRemoteSettings: Symbol('http2session remote settings'),
|
|
73
74
|
kHTTP2Stream: Symbol('http2session client stream'),
|
|
74
75
|
kPingInterval: Symbol('ping interval'),
|
|
76
|
+
kUseMilo: Symbol('use milo'),
|
|
75
77
|
kNoProxyAgent: Symbol('no proxy agent'),
|
|
76
78
|
kHttpProxyAgent: Symbol('http proxy agent'),
|
|
77
79
|
kHttpsProxyAgent: Symbol('https proxy agent'),
|
|
@@ -387,7 +387,7 @@ function destroy (stream, err) {
|
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
|
|
390
|
+
const KEEPALIVE_TIMEOUT_EXPR = /(?:^|,)[\t ]*timeout=(\d+)/i
|
|
391
391
|
/**
|
|
392
392
|
* @param {string} val
|
|
393
393
|
* @returns {number | null}
|
|
@@ -417,6 +417,30 @@ function bufferToLowerCasedHeaderName (value) {
|
|
|
417
417
|
return tree.lookup(value) ?? value.toString('latin1').toLowerCase()
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
+
/**
|
|
421
|
+
* Writes a header onto a plain object without going through the
|
|
422
|
+
* `Object.prototype` `__proto__` setter. Plain assignment there drops a string
|
|
423
|
+
* value and, when the value is an array, replaces the object's prototype
|
|
424
|
+
* instead of storing anything. Every other name is a normal assignment.
|
|
425
|
+
*
|
|
426
|
+
* @param {Record<string, string | string[]>} obj Accumulator to write onto
|
|
427
|
+
* @param {string} key Header name
|
|
428
|
+
* @param {string | string[]} value Header value
|
|
429
|
+
* @returns {void}
|
|
430
|
+
*/
|
|
431
|
+
function setHeader (obj, key, value) {
|
|
432
|
+
if (key === '__proto__') {
|
|
433
|
+
Object.defineProperty(obj, key, {
|
|
434
|
+
value,
|
|
435
|
+
enumerable: true,
|
|
436
|
+
configurable: true,
|
|
437
|
+
writable: true
|
|
438
|
+
})
|
|
439
|
+
} else {
|
|
440
|
+
obj[key] = value
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
420
444
|
/**
|
|
421
445
|
* @param {(Buffer | string)[]} headers
|
|
422
446
|
* @param {Record<string, string | string[]>} [obj]
|
|
@@ -984,6 +1008,7 @@ module.exports = {
|
|
|
984
1008
|
toRawHeaders,
|
|
985
1009
|
encodeRawHeaders,
|
|
986
1010
|
parseHeaders,
|
|
1011
|
+
setHeader,
|
|
987
1012
|
parseKeepAliveTimeout,
|
|
988
1013
|
destroy,
|
|
989
1014
|
bodyLength,
|
|
@@ -22,7 +22,7 @@ function defaultFactory (origin, opts) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
class Agent extends DispatcherBase {
|
|
25
|
-
constructor ({ factory = defaultFactory, maxOrigins = Infinity, connect, ...options } = {}) {
|
|
25
|
+
constructor ({ factory = defaultFactory, maxOrigins = Infinity, connect, tls, ...options } = {}) {
|
|
26
26
|
if (typeof factory !== 'function') {
|
|
27
27
|
throw new InvalidArgumentError('factory must be a function.')
|
|
28
28
|
}
|
|
@@ -41,7 +41,11 @@ class Agent extends DispatcherBase {
|
|
|
41
41
|
connect = { ...connect }
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
if (tls && typeof tls !== 'function') {
|
|
45
|
+
tls = { ...tls }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
this[kOptions] = { ...util.deepClone(options), maxOrigins, connect, tls }
|
|
45
49
|
this[kFactory] = factory
|
|
46
50
|
this[kClients] = new Map()
|
|
47
51
|
this[kOrigins] = new Set()
|