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
|
@@ -61,6 +61,12 @@ const kRefusedStreamRetry = Symbol('refused stream retry')
|
|
|
61
61
|
// event loop.
|
|
62
62
|
const MAX_GOAWAY_REPLAY_ATTEMPTS = 1
|
|
63
63
|
|
|
64
|
+
// Lower bound on how long a liveness PING may take to be acked. Stream
|
|
65
|
+
// timeouts can be tiny (tens of ms), while an ack on a live connection can take
|
|
66
|
+
// longer than that on a loaded event loop; without a floor a slow but healthy
|
|
67
|
+
// connection would be torn down.
|
|
68
|
+
const MIN_PROBE_TIMEOUT = 1e3
|
|
69
|
+
|
|
64
70
|
let extractBody
|
|
65
71
|
|
|
66
72
|
/** @type {import('http2')} */
|
|
@@ -277,6 +283,9 @@ function connectH2 (client, socket) {
|
|
|
277
283
|
// Armed while the peer advertises MAX_CONCURRENT_STREAMS = 0 and we have
|
|
278
284
|
// work that cannot start. See setNoStreamsTimeout.
|
|
279
285
|
noStreamsTimeout: null,
|
|
286
|
+
// Armed while a PING checks whether the peer is still there after a
|
|
287
|
+
// stream timed out. See probeHttp2Session.
|
|
288
|
+
probeTimeout: null,
|
|
280
289
|
// Sockets start out ref'd. Session ref/unref proxies to the socket, so a
|
|
281
290
|
// single cached flag lets us skip redundant uv ref/unref calls, provided
|
|
282
291
|
// every ref/unref of the session or its socket goes through
|
|
@@ -361,6 +370,11 @@ function connectH2 (client, socket) {
|
|
|
361
370
|
return true
|
|
362
371
|
}
|
|
363
372
|
|
|
373
|
+
// Do not open streams on a connection that may be dead.
|
|
374
|
+
if (session[kHTTP2SessionState].probeTimeout != null) {
|
|
375
|
+
return true
|
|
376
|
+
}
|
|
377
|
+
|
|
364
378
|
if (client[kRunning] >= client[kMaxConcurrentStreams]) {
|
|
365
379
|
return true
|
|
366
380
|
}
|
|
@@ -494,6 +508,60 @@ function onNoStreamsTimeout (session) {
|
|
|
494
508
|
resetHttp2Session(session, err)
|
|
495
509
|
}
|
|
496
510
|
|
|
511
|
+
// A stream timeout only resets that stream, unlike HTTP/1.1 which destroys the
|
|
512
|
+
// socket. If the connection itself silently died (dropped by a NAT or load
|
|
513
|
+
// balancer, a hung peer), every new stream would time out in turn and the
|
|
514
|
+
// session would never be replaced. Ask the peer for a PING ack within the
|
|
515
|
+
// timeout that just fired (but at least MIN_PROBE_TIMEOUT): if it answers, only
|
|
516
|
+
// that request was slow; if not, drop the session so queued requests move to a
|
|
517
|
+
// fresh connection.
|
|
518
|
+
function probeHttp2Session (session, timeout) {
|
|
519
|
+
const state = session[kHTTP2SessionState]
|
|
520
|
+
|
|
521
|
+
if (state.probeTimeout != null || session.closed || session.destroyed) {
|
|
522
|
+
return
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
try {
|
|
526
|
+
session.ping(onHttp2ProbeAck.bind(session))
|
|
527
|
+
} catch {
|
|
528
|
+
// The session is going away on its own.
|
|
529
|
+
return
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
state.probeTimeout = setTimeout(onHttp2ProbeTimeout, Math.max(timeout, MIN_PROBE_TIMEOUT), session).unref()
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
function clearHttp2ProbeTimeout (session) {
|
|
536
|
+
const state = session[kHTTP2SessionState]
|
|
537
|
+
|
|
538
|
+
if (state?.probeTimeout != null) {
|
|
539
|
+
clearTimeout(state.probeTimeout)
|
|
540
|
+
state.probeTimeout = null
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
function onHttp2ProbeAck () {
|
|
545
|
+
if (this[kHTTP2SessionState].probeTimeout == null) {
|
|
546
|
+
return
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
clearHttp2ProbeTimeout(this)
|
|
550
|
+
this[kClient][kResume]()
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
function onHttp2ProbeTimeout (session) {
|
|
554
|
+
session[kHTTP2SessionState].probeTimeout = null
|
|
555
|
+
|
|
556
|
+
if (session.closed || session.destroyed) {
|
|
557
|
+
return
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
const err = new SocketError('HTTP/2: connection unresponsive', util.getSocketInfo(session[kSocket]))
|
|
561
|
+
session[kError] = err
|
|
562
|
+
resetHttp2Session(session, err)
|
|
563
|
+
}
|
|
564
|
+
|
|
497
565
|
function clearHttp2IdleTimeout (session) {
|
|
498
566
|
const state = session[kHTTP2SessionState]
|
|
499
567
|
|
|
@@ -548,8 +616,14 @@ function applyConnectionWindowSize (connectionWindowSize) {
|
|
|
548
616
|
}
|
|
549
617
|
|
|
550
618
|
function onHttp2RemoteSettings (settings) {
|
|
551
|
-
|
|
552
|
-
|
|
619
|
+
const client = this[kClient]
|
|
620
|
+
|
|
621
|
+
// The configured maxConcurrentStreams (default 100) is the client's own
|
|
622
|
+
// ceiling. The server's SETTINGS_MAX_CONCURRENT_STREAMS can lower it, but
|
|
623
|
+
// must not raise it: a default Node.js server advertises 2^32-1.
|
|
624
|
+
const localMaxConcurrentStreams = client[kHTTP2Options].maxConcurrentStreams
|
|
625
|
+
const remoteMaxConcurrentStreams = settings.maxConcurrentStreams ?? client[kMaxConcurrentStreams] ?? localMaxConcurrentStreams
|
|
626
|
+
client[kMaxConcurrentStreams] = Math.min(remoteMaxConcurrentStreams, localMaxConcurrentStreams)
|
|
553
627
|
/**
|
|
554
628
|
* From RFC-8441
|
|
555
629
|
* A sender MUST NOT send a SETTINGS_ENABLE_CONNECT_PROTOCOL parameter
|
|
@@ -594,8 +668,6 @@ function onHttp2SendPing (session) {
|
|
|
594
668
|
}
|
|
595
669
|
|
|
596
670
|
function onHttp2SessionError (err) {
|
|
597
|
-
assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
|
|
598
|
-
|
|
599
671
|
this[kSocket][kError] = err
|
|
600
672
|
|
|
601
673
|
if (this[kReceivedGoAway]) {
|
|
@@ -676,8 +748,13 @@ function onHttp2SessionGoAway (errorCode, lastStreamID) {
|
|
|
676
748
|
client[kHTTP2Session] = null
|
|
677
749
|
}
|
|
678
750
|
|
|
751
|
+
if (this[kOpenStreams] === 0) {
|
|
752
|
+
unrefH2Session(this)
|
|
753
|
+
}
|
|
754
|
+
|
|
679
755
|
clearHttp2IdleTimeout(this)
|
|
680
756
|
clearNoStreamsTimeout(this)
|
|
757
|
+
clearHttp2ProbeTimeout(this)
|
|
681
758
|
|
|
682
759
|
if (!this.closed && !this.destroyed) {
|
|
683
760
|
this.close()
|
|
@@ -703,6 +780,7 @@ function onHttp2SessionClose () {
|
|
|
703
780
|
|
|
704
781
|
clearHttp2IdleTimeout(this)
|
|
705
782
|
clearNoStreamsTimeout(this)
|
|
783
|
+
clearHttp2ProbeTimeout(this)
|
|
706
784
|
|
|
707
785
|
if (state.ping.interval != null) {
|
|
708
786
|
clearInterval(state.ping.interval)
|
|
@@ -757,8 +835,6 @@ function onHttp2SocketClose () {
|
|
|
757
835
|
}
|
|
758
836
|
|
|
759
837
|
function onHttp2SocketError (err) {
|
|
760
|
-
assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
|
|
761
|
-
|
|
762
838
|
this[kError] = err
|
|
763
839
|
|
|
764
840
|
if (this[kHTTP2Session]?.[kReceivedGoAway]) {
|
|
@@ -844,25 +920,27 @@ function buildRequestHeaders (reqHeaders) {
|
|
|
844
920
|
for (let n = 0; n < reqHeaders.length; n += 2) {
|
|
845
921
|
const key = reqHeaders[n + 0]
|
|
846
922
|
const val = reqHeaders[n + 1]
|
|
847
|
-
|
|
923
|
+
// Reading headers[key] directly resolves `__proto__` through the prototype
|
|
924
|
+
// chain instead of reporting the header as absent.
|
|
925
|
+
const current = Object.hasOwn(headers, key) ? headers[key] : undefined
|
|
848
926
|
|
|
849
927
|
if (key === 'cookie') {
|
|
850
928
|
if (current != null) {
|
|
851
|
-
headers
|
|
929
|
+
util.setHeader(headers, key, Array.isArray(current) ? (current.push(val), current) : [current, val])
|
|
852
930
|
} else {
|
|
853
|
-
headers
|
|
931
|
+
util.setHeader(headers, key, val)
|
|
854
932
|
}
|
|
855
933
|
|
|
856
934
|
continue
|
|
857
935
|
}
|
|
858
936
|
|
|
859
937
|
if (typeof val === 'string') {
|
|
860
|
-
headers
|
|
938
|
+
util.setHeader(headers, key, current ? `${current}, ${val}` : val)
|
|
861
939
|
continue
|
|
862
940
|
}
|
|
863
941
|
|
|
864
942
|
for (let i = 0; i < val.length; i++) {
|
|
865
|
-
headers
|
|
943
|
+
util.setHeader(headers, key, Object.hasOwn(headers, key) ? `${headers[key]}, ${val[i]}` : val[i])
|
|
866
944
|
}
|
|
867
945
|
}
|
|
868
946
|
|
|
@@ -1368,10 +1446,34 @@ function onData (chunk) {
|
|
|
1368
1446
|
state.bytesRead += chunk.length
|
|
1369
1447
|
|
|
1370
1448
|
if (request.onResponseData(chunk) === false) {
|
|
1371
|
-
stream
|
|
1449
|
+
pauseResponseStream(stream, state)
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
// The body timeout measures how long the peer takes to send data. While the
|
|
1454
|
+
// consumer applies backpressure the peer can't send (it's out of flow-control
|
|
1455
|
+
// window), and Http2Stream's timer, which counts stream activity, would fire.
|
|
1456
|
+
// Stop it while paused and start a fresh one on resume, like HTTP/1.1, which
|
|
1457
|
+
// ignores the body timeout while its parser is paused.
|
|
1458
|
+
function pauseResponseStream (stream, state) {
|
|
1459
|
+
stream.pause()
|
|
1460
|
+
if (state.bodyTimeout) {
|
|
1461
|
+
stream.setTimeout(0)
|
|
1372
1462
|
}
|
|
1373
1463
|
}
|
|
1374
1464
|
|
|
1465
|
+
// Passed to the handler as its resume callback, bound to the stream.
|
|
1466
|
+
function resumeResponseStream () {
|
|
1467
|
+
const stream = this
|
|
1468
|
+
const state = stream[kRequestStreamState]
|
|
1469
|
+
|
|
1470
|
+
if (state != null && state.bodyTimeout && stream.isPaused()) {
|
|
1471
|
+
stream.setTimeout(state.bodyTimeout)
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
stream.resume()
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1375
1477
|
function onInterimResponse (headers) {
|
|
1376
1478
|
const stream = this
|
|
1377
1479
|
const state = stream[kRequestStreamState]
|
|
@@ -1446,8 +1548,8 @@ function onResponse (headers) {
|
|
|
1446
1548
|
return
|
|
1447
1549
|
}
|
|
1448
1550
|
|
|
1449
|
-
if (request.onResponseStart(statusCode, headers,
|
|
1450
|
-
stream
|
|
1551
|
+
if (request.onResponseStart(statusCode, headers, resumeResponseStream.bind(stream), '') === false) {
|
|
1552
|
+
pauseResponseStream(stream, state)
|
|
1451
1553
|
}
|
|
1452
1554
|
|
|
1453
1555
|
stream.on('data', onData)
|
|
@@ -1578,9 +1680,14 @@ function onTimeout () {
|
|
|
1578
1680
|
// Remove self so timeout doesn't fire again after we handle it
|
|
1579
1681
|
stream.off('timeout', onTimeout)
|
|
1580
1682
|
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1583
|
-
|
|
1683
|
+
const { responseReceived, session, bodyTimeout, headersTimeout } = state
|
|
1684
|
+
const err = responseReceived
|
|
1685
|
+
? new BodyTimeoutError(`HTTP/2: "stream timeout after ${bodyTimeout}"`)
|
|
1686
|
+
: new HeadersTimeoutError(`HTTP/2: "headers timeout after ${headersTimeout}"`)
|
|
1687
|
+
|
|
1688
|
+
// Probe before aborting: completing the request resumes the queue, which
|
|
1689
|
+
// must not open new streams until the peer has proven it is alive.
|
|
1690
|
+
probeHttp2Session(session, responseReceived ? bodyTimeout : headersTimeout)
|
|
1584
1691
|
state.abort(err)
|
|
1585
1692
|
}
|
|
1586
1693
|
|
|
@@ -54,7 +54,8 @@ const {
|
|
|
54
54
|
kMaxConcurrentStreams,
|
|
55
55
|
kHostAuthority,
|
|
56
56
|
kResume,
|
|
57
|
-
kHTTP2Options
|
|
57
|
+
kHTTP2Options,
|
|
58
|
+
kUseMilo
|
|
58
59
|
} = require('../core/symbols.js')
|
|
59
60
|
const connectH1 = require('./client-h1.js')
|
|
60
61
|
const connectH2 = require('./client-h2.js')
|
|
@@ -136,6 +137,7 @@ class Client extends DispatcherBase {
|
|
|
136
137
|
initialWindowSize,
|
|
137
138
|
connectionWindowSize,
|
|
138
139
|
pingInterval,
|
|
140
|
+
useMilo,
|
|
139
141
|
webSocket,
|
|
140
142
|
h2Options,
|
|
141
143
|
eventSource
|
|
@@ -335,6 +337,7 @@ class Client extends DispatcherBase {
|
|
|
335
337
|
initialWindowSize: h2Options?.initialWindowSize ?? initialWindowSize ?? 262144
|
|
336
338
|
}
|
|
337
339
|
}
|
|
340
|
+
this[kUseMilo] = useMilo
|
|
338
341
|
|
|
339
342
|
// kQueue is built up of 3 sections separated by
|
|
340
343
|
// the kRunningIdx and kPendingIdx indices.
|
|
@@ -8,6 +8,7 @@ const {
|
|
|
8
8
|
InvalidArgumentError
|
|
9
9
|
} = require('../core/errors')
|
|
10
10
|
const { kDestroy, kClose, kClosed, kDestroyed, kDispatch } = require('../core/symbols')
|
|
11
|
+
const { defaultWebSocketMaxFragments, defaultWebSocketMaxPayloadSize } = require('../core/constants')
|
|
11
12
|
|
|
12
13
|
const kOnDestroyed = Symbol('onDestroyed')
|
|
13
14
|
const kOnClosed = Symbol('onClosed')
|
|
@@ -41,8 +42,8 @@ class DispatcherBase extends Dispatcher {
|
|
|
41
42
|
*/
|
|
42
43
|
get webSocketOptions () {
|
|
43
44
|
return {
|
|
44
|
-
maxFragments: this[kWebSocketOptions].maxFragments ??
|
|
45
|
-
maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ??
|
|
45
|
+
maxFragments: this[kWebSocketOptions].maxFragments ?? defaultWebSocketMaxFragments,
|
|
46
|
+
maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? defaultWebSocketMaxPayloadSize
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -17,12 +17,16 @@ class LegacyHandlerWrapper {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
onRequestUpgrade (controller, statusCode, headers, socket) {
|
|
20
|
-
const rawHeaders = controller?.rawHeaders
|
|
20
|
+
const rawHeaders = Array.isArray(controller?.rawHeaders)
|
|
21
|
+
? controller.rawHeaders
|
|
22
|
+
: toRawHeaders(controller?.rawHeaders ?? headers ?? {})
|
|
21
23
|
this.#handler.onUpgrade?.(statusCode, rawHeaders, socket)
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
onResponseStart (controller, statusCode, headers, statusMessage) {
|
|
25
|
-
const rawHeaders = controller?.rawHeaders
|
|
27
|
+
const rawHeaders = Array.isArray(controller?.rawHeaders)
|
|
28
|
+
? controller.rawHeaders
|
|
29
|
+
: toRawHeaders(controller?.rawHeaders ?? headers ?? {})
|
|
26
30
|
|
|
27
31
|
if (this.#handler.onHeaders?.(statusCode, rawHeaders, () => controller.resume(), statusMessage) === false) {
|
|
28
32
|
controller.pause()
|
|
@@ -36,7 +40,9 @@ class LegacyHandlerWrapper {
|
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
onResponseEnd (controller, trailers) {
|
|
39
|
-
const rawTrailers = controller?.rawTrailers
|
|
43
|
+
const rawTrailers = Array.isArray(controller?.rawTrailers)
|
|
44
|
+
? controller.rawTrailers
|
|
45
|
+
: toRawHeaders(controller?.rawTrailers ?? trailers ?? {})
|
|
40
46
|
this.#handler.onComplete?.(rawTrailers)
|
|
41
47
|
}
|
|
42
48
|
|
|
@@ -98,6 +104,17 @@ class Dispatcher1Wrapper extends Dispatcher {
|
|
|
98
104
|
return this.#dispatcher.dispatch(opts, Dispatcher1Wrapper.wrapHandler(handler))
|
|
99
105
|
}
|
|
100
106
|
|
|
107
|
+
// Older undici versions read WebSocket and EventSource receive limits from
|
|
108
|
+
// the (legacy) global dispatcher, which is this wrapper, so report the
|
|
109
|
+
// wrapped dispatcher's settings.
|
|
110
|
+
get webSocketOptions () {
|
|
111
|
+
return this.#dispatcher.webSocketOptions
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
get eventSourceOptions () {
|
|
115
|
+
return this.#dispatcher.eventSourceOptions
|
|
116
|
+
}
|
|
117
|
+
|
|
101
118
|
close (...args) {
|
|
102
119
|
return this.#dispatcher.close(...args)
|
|
103
120
|
}
|