@psnext/slingcli 3.5.20261007-2 → 3.5.20261019-1

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.
Files changed (392) hide show
  1. package/bin/sling-startup-output.js +47 -0
  2. package/bin/sling.js +29 -2
  3. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +12 -3
  4. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +94 -1589
  5. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +12 -3
  6. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -7
  7. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -3
  8. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -3
  9. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +2 -8
  10. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
  11. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
  12. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
  13. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
  14. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +10 -10
  15. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
  16. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
  17. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
  18. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
  19. package/node_modules/@aws-sdk/core/package.json +3 -3
  20. package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
  21. package/node_modules/@aws-sdk/credential-provider-http/package.json +3 -3
  22. package/node_modules/@aws-sdk/credential-provider-ini/package.json +10 -10
  23. package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
  24. package/node_modules/@aws-sdk/credential-provider-node/package.json +8 -8
  25. package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
  26. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +37 -19
  27. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +37 -19
  28. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +4 -4
  29. package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
  30. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
  31. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +2 -2
  32. package/node_modules/@aws-sdk/middleware-eventstream/package.json +2 -2
  33. package/node_modules/@aws-sdk/middleware-websocket/package.json +4 -4
  34. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +11 -1
  35. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +6 -1
  36. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +6 -1
  37. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +13 -1
  38. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +9 -1
  39. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/models/CognitoIdentityServiceException.js +1 -0
  40. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/models/errors.js +9 -0
  41. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js +1 -0
  42. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js +4 -0
  43. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js +1 -0
  44. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/errors.js +4 -0
  45. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js +1 -0
  46. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js +11 -0
  47. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js +1 -0
  48. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js +7 -0
  49. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/models/CognitoIdentityServiceException.d.ts +1 -0
  50. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/models/errors.d.ts +9 -0
  51. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/SigninServiceException.d.ts +1 -0
  52. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/errors.d.ts +4 -0
  53. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/models/SSOServiceException.d.ts +1 -0
  54. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/models/errors.d.ts +4 -0
  55. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/models/SSOOIDCServiceException.d.ts +1 -0
  56. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/models/errors.d.ts +11 -0
  57. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/STSServiceException.d.ts +1 -0
  58. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/errors.d.ts +7 -0
  59. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/models/CognitoIdentityServiceException.d.ts +1 -0
  60. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/models/errors.d.ts +9 -0
  61. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/SigninServiceException.d.ts +1 -0
  62. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/errors.d.ts +4 -0
  63. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/models/SSOServiceException.d.ts +1 -0
  64. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/models/errors.d.ts +4 -0
  65. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/models/SSOOIDCServiceException.d.ts +1 -0
  66. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/models/errors.d.ts +11 -0
  67. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/STSServiceException.d.ts +1 -0
  68. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/errors.d.ts +7 -0
  69. package/node_modules/@aws-sdk/nested-clients/package.json +4 -4
  70. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
  71. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +2 -0
  72. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js +21 -86
  73. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js +3 -103
  74. package/node_modules/@earendil-works/pi-codemode/package.json +1 -1
  75. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-JPNA2XH6.js → chunk-23QDZLZG.js} +22 -16
  76. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-4RGLMKVY.js → chunk-QPFSTNX5.js} +1 -1
  77. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{virtual-modules-SXTR3NIO.js → virtual-modules-GRXGP6ZA.js} +1 -1
  78. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli-runtime.js +1 -1
  79. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
  80. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
  81. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/pi-logo.js +8 -0
  82. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +6 -3
  83. package/node_modules/@earendil-works/pi-coding-agent/docs/mcp.md +1 -0
  84. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Agent.md +8 -8
  85. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
  86. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Client.md +11 -6
  87. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
  88. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Dispatcher.md +12 -0
  89. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Errors.md +101 -1
  90. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Fetch.md +10 -0
  91. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
  92. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Interceptors.md +17 -9
  93. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Pool.md +5 -6
  94. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
  95. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/index.md +22 -13
  96. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/type-map.json +66 -66
  97. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/readable.js +1 -2
  98. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
  99. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
  100. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/connect.js +10 -4
  101. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/constants.js +12 -1
  102. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/errors.js +38 -1
  103. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/request.js +39 -3
  104. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/symbols.js +2 -0
  105. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/util.js +26 -40
  106. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/agent.js +6 -2
  107. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h1.js +127 -84
  108. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h2.js +97 -21
  109. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client.js +10 -2
  110. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
  111. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
  112. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
  113. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
  114. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/pool-base.js +117 -19
  115. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/pool.js +99 -13
  116. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/proxy-agent.js +34 -11
  117. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
  118. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
  119. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/cache-handler.js +153 -15
  120. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/deduplication-handler.js +126 -52
  121. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/redirect-handler.js +31 -6
  122. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/retry-handler.js +116 -24
  123. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/cache.js +15 -4
  124. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/decompress.js +253 -73
  125. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dns.js +11 -0
  126. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/response-error.js +72 -28
  127. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/milo/LICENSE.md +7 -0
  128. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/milo/no-simd.js +1002 -0
  129. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/milo/simd.js +1002 -0
  130. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-agent.js +11 -0
  131. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
  132. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
  133. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/cache.js +11 -5
  134. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cache/cache.js +17 -8
  135. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
  136. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/index.js +19 -7
  137. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/util.js +21 -2
  138. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
  139. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource.js +50 -3
  140. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/body.js +69 -53
  141. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/data-url.js +6 -6
  142. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
  143. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/formdata.js +30 -36
  144. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/headers.js +36 -33
  145. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/index.js +54 -29
  146. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/request.js +74 -79
  147. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/response.js +43 -44
  148. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/util.js +7 -7
  149. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/infra/index.js +16 -1
  150. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  151. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/webidl/index.js +2 -14
  152. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/connection.js +33 -12
  153. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/events.js +43 -26
  154. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/receiver.js +27 -4
  155. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
  156. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
  157. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/websocket.js +44 -41
  158. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/package.json +7 -5
  159. package/node_modules/@earendil-works/pi-coding-agent/package.json +2 -2
  160. package/node_modules/@hono/node-server/README.md +2 -0
  161. package/node_modules/@hono/node-server/dist/index.cjs +1 -1
  162. package/node_modules/@hono/node-server/dist/index.mjs +1 -1
  163. package/node_modules/@hono/node-server/dist/serve-static.cjs +2 -1
  164. package/node_modules/@hono/node-server/dist/serve-static.mjs +2 -1
  165. package/node_modules/@hono/node-server/package.json +2 -2
  166. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
  167. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +2 -1
  168. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +1695 -3
  169. package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js +2 -1
  170. package/node_modules/@smithy/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js +6 -0
  171. package/node_modules/@smithy/core/dist-es/submodules/protocols/UnionSerde.js +26 -0
  172. package/node_modules/@smithy/core/dist-es/submodules/protocols/common.js +3 -0
  173. package/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +8 -0
  174. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/SmithyRpcV2JsonProtocol.js +102 -0
  175. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +8 -1
  176. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +8 -1
  177. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +13 -2
  178. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +11 -1
  179. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/parseJsonBody.js +16 -1
  180. package/node_modules/@smithy/core/dist-es/submodules/protocols/writeKey.js +3 -0
  181. package/node_modules/@smithy/core/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -0
  182. package/node_modules/@smithy/core/dist-types/submodules/protocols/UnionSerde.d.ts +24 -0
  183. package/node_modules/@smithy/core/dist-types/submodules/protocols/common.d.ts +2 -0
  184. package/node_modules/@smithy/core/dist-types/submodules/protocols/index.d.ts +9 -0
  185. package/node_modules/@smithy/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +13 -0
  186. package/node_modules/@smithy/core/dist-types/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +28 -0
  187. package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +16 -0
  188. package/node_modules/@smithy/core/dist-types/submodules/protocols/writeKey.d.ts +4 -0
  189. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -0
  190. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/UnionSerde.d.ts +24 -0
  191. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/common.d.ts +2 -0
  192. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/index.d.ts +9 -0
  193. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +13 -0
  194. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +28 -0
  195. package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +15 -11
  196. package/node_modules/{@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json → @smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1}/JsonSettings.d.ts +7 -4
  197. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +14 -0
  198. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +29 -0
  199. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +51 -0
  200. package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +13 -9
  201. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +30 -0
  202. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +60 -0
  203. package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -1
  204. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +21 -0
  205. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +15 -0
  206. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +11 -0
  207. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +38 -0
  208. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +4 -0
  209. package/node_modules/@smithy/core/package.json +2 -1
  210. package/node_modules/@types/node/README.md +1 -1
  211. package/node_modules/@types/node/package.json +2 -2
  212. package/node_modules/@types/node/util.d.ts +6 -3
  213. package/node_modules/content-disposition/README.md +105 -35
  214. package/node_modules/content-disposition/dist/index.d.ts +72 -0
  215. package/node_modules/content-disposition/dist/index.js +388 -0
  216. package/node_modules/content-disposition/dist/index.js.map +1 -0
  217. package/node_modules/content-disposition/package.json +31 -19
  218. package/node_modules/express/Readme.md +15 -9
  219. package/node_modules/express/lib/application.js +2 -2
  220. package/node_modules/express/lib/request.js +32 -19
  221. package/node_modules/express/lib/response.js +27 -30
  222. package/node_modules/express/node_modules/content-type/LICENSE +22 -0
  223. package/node_modules/express/node_modules/content-type/README.md +71 -0
  224. package/node_modules/express/node_modules/content-type/dist/index.d.ts +46 -0
  225. package/node_modules/express/node_modules/content-type/dist/index.js +176 -0
  226. package/node_modules/express/node_modules/content-type/dist/index.js.map +1 -0
  227. package/node_modules/express/node_modules/content-type/package.json +52 -0
  228. package/node_modules/express/package.json +10 -10
  229. package/node_modules/fast-uri/.github/workflows/release.yml +35 -0
  230. package/node_modules/fast-uri/README.md +8 -0
  231. package/node_modules/fast-uri/index.js +98 -18
  232. package/node_modules/fast-uri/lib/utils.js +52 -0
  233. package/node_modules/fast-uri/package.json +1 -1
  234. package/node_modules/fast-uri/test/host-delimiter-security.test.js +94 -0
  235. package/node_modules/fast-uri/test/relative-normalization-security.test.js +156 -0
  236. package/node_modules/fast-uri/test/reserved-path-normalization.test.js +32 -4
  237. package/node_modules/fast-uri/test/scheme-validation.test.js +53 -14
  238. package/node_modules/ip-address/README.md +70 -70
  239. package/node_modules/ip-address/dist/ipv6.js +7 -4
  240. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  241. package/node_modules/ip-address/dist/v6/constants.d.ts +3 -0
  242. package/node_modules/ip-address/dist/v6/constants.js +3 -0
  243. package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  244. package/node_modules/ip-address/package.json +2 -1
  245. package/node_modules/jose/README.md +2 -2
  246. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +5 -4
  247. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +4 -4
  248. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +5 -4
  249. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +5 -5
  250. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +5 -4
  251. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +5 -5
  252. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -4
  253. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +5 -5
  254. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -4
  255. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +6 -5
  256. package/node_modules/jose/dist/types/jws/general/sign.d.ts +9 -6
  257. package/node_modules/jose/dist/types/jws/general/verify.d.ts +7 -5
  258. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +7 -6
  259. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +1 -1
  260. package/node_modules/jose/dist/types/jwt/sign.d.ts +1 -1
  261. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +1 -1
  262. package/node_modules/jose/dist/types/jwt/verify.d.ts +3 -5
  263. package/node_modules/jose/dist/types/key/export.d.ts +1 -1
  264. package/node_modules/jose/dist/types/key/generate_secret.d.ts +1 -1
  265. package/node_modules/jose/dist/types/key/import.d.ts +2 -2
  266. package/node_modules/jose/dist/types/types.d.ts +165 -107
  267. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +2 -2
  268. package/node_modules/jose/dist/types/util/errors.d.ts +1 -1
  269. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +3 -3
  270. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +8 -8
  271. package/node_modules/jose/dist/webapi/jwks/local.js +2 -1
  272. package/node_modules/jose/dist/webapi/jwks/remote.js +4 -4
  273. package/node_modules/jose/dist/webapi/jws/general/sign.js +3 -3
  274. package/node_modules/jose/dist/webapi/jws/general/verify.js +3 -3
  275. package/node_modules/jose/dist/webapi/jwt/encrypt.js +2 -2
  276. package/node_modules/jose/dist/webapi/jwt/sign.js +2 -2
  277. package/node_modules/jose/dist/webapi/jwt/unsecured.js +3 -3
  278. package/node_modules/jose/dist/webapi/key/generate_secret.js +4 -4
  279. package/node_modules/jose/dist/webapi/lib/asn1.js +2 -2
  280. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +4 -4
  281. package/node_modules/jose/dist/webapi/lib/content_encryption.js +8 -8
  282. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +14 -14
  283. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +3 -3
  284. package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +2 -2
  285. package/node_modules/jose/dist/webapi/lib/jws_sign.js +11 -11
  286. package/node_modules/jose/dist/webapi/lib/jws_verify.js +19 -16
  287. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +44 -43
  288. package/node_modules/jose/dist/webapi/lib/key.js +4 -4
  289. package/node_modules/jose/dist/webapi/lib/key_management.js +17 -17
  290. package/node_modules/jose/dist/webapi/lib/validate.js +10 -10
  291. package/node_modules/jose/dist/webapi/util/decode_jwt.js +12 -12
  292. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -5
  293. package/node_modules/jose/package.json +1 -1
  294. package/node_modules/qs/.github/THREAT_MODEL.md +4 -2
  295. package/node_modules/qs/CHANGELOG.md +38 -14
  296. package/node_modules/qs/README.md +31 -3
  297. package/node_modules/qs/dist/qs.js +20 -20
  298. package/node_modules/qs/lib/parse.js +94 -4
  299. package/node_modules/qs/lib/stringify.js +4 -4
  300. package/node_modules/qs/lib/utils.js +130 -6
  301. package/node_modules/qs/package.json +4 -4
  302. package/node_modules/qs/test/parse.js +174 -0
  303. package/node_modules/qs/test/stringify.js +263 -33
  304. package/node_modules/qs/test/utils.js +184 -0
  305. package/node_modules/undici/docs/docs/api/Client.md +2 -0
  306. package/node_modules/undici/lib/core/connect.js +10 -4
  307. package/node_modules/undici/lib/core/symbols.js +1 -0
  308. package/node_modules/undici/lib/dispatcher/agent.js +6 -2
  309. package/node_modules/undici/lib/dispatcher/client-h1.js +0 -2
  310. package/node_modules/undici/lib/dispatcher/client-h2.js +0 -4
  311. package/node_modules/undici/lib/dispatcher/client.js +3 -2
  312. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +12 -0
  313. package/node_modules/undici/lib/handler/cache-handler.js +48 -0
  314. package/node_modules/undici/lib/handler/deduplication-handler.js +57 -13
  315. package/node_modules/undici/lib/handler/redirect-handler.js +8 -1
  316. package/node_modules/undici/lib/interceptor/decompress.js +15 -5
  317. package/node_modules/undici/lib/web/cookies/index.js +3 -1
  318. package/node_modules/undici/lib/web/cookies/parse.js +138 -137
  319. package/node_modules/undici/lib/web/cookies/util.js +21 -2
  320. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +90 -9
  321. package/node_modules/undici/lib/web/eventsource/eventsource.js +4 -1
  322. package/node_modules/undici/lib/web/fetch/index.js +3 -3
  323. package/node_modules/undici/lib/web/infra/index.js +14 -0
  324. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  325. package/node_modules/undici/lib/web/websocket/receiver.js +13 -0
  326. package/node_modules/undici/package.json +1 -1
  327. package/node_modules/undici/types/client.d.ts +14 -0
  328. package/node_modules/zod/package.json +1 -1
  329. package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
  330. package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
  331. package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
  332. package/node_modules/zod/src/v4/core/compile.ts +9 -0
  333. package/node_modules/zod/src/v4/core/schemas.ts +35 -1
  334. package/node_modules/zod/src/v4/core/util.ts +13 -0
  335. package/node_modules/zod/src/v4/core/versions.ts +1 -1
  336. package/node_modules/zod/v4/core/compile.cjs +8 -0
  337. package/node_modules/zod/v4/core/compile.js +8 -0
  338. package/node_modules/zod/v4/core/schemas.cjs +30 -0
  339. package/node_modules/zod/v4/core/schemas.d.cts +3 -1
  340. package/node_modules/zod/v4/core/schemas.d.ts +3 -1
  341. package/node_modules/zod/v4/core/schemas.js +30 -0
  342. package/node_modules/zod/v4/core/util.cjs +15 -0
  343. package/node_modules/zod/v4/core/util.d.cts +2 -0
  344. package/node_modules/zod/v4/core/util.d.ts +2 -0
  345. package/node_modules/zod/v4/core/util.js +14 -0
  346. package/node_modules/zod/v4/core/versions.cjs +1 -1
  347. package/node_modules/zod/v4/core/versions.js +1 -1
  348. package/package.json +5 -4
  349. package/slingshot/index.js +214 -214
  350. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -7
  351. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -4
  352. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -13
  353. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -18
  354. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -27
  355. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -15
  356. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -39
  357. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +0 -7
  358. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +0 -7
  359. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +0 -2
  360. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +0 -14
  361. package/node_modules/@esbuild/linux-x64/README.md +0 -3
  362. package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  363. package/node_modules/@esbuild/linux-x64/package.json +0 -20
  364. package/node_modules/content-disposition/index.js +0 -536
  365. package/node_modules/esbuild/LICENSE.md +0 -21
  366. package/node_modules/esbuild/README.md +0 -3
  367. package/node_modules/esbuild/bin/esbuild +0 -0
  368. package/node_modules/esbuild/install.js +0 -300
  369. package/node_modules/esbuild/lib/main.d.ts +0 -720
  370. package/node_modules/esbuild/lib/main.js +0 -2536
  371. package/node_modules/esbuild/package.json +0 -74
  372. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/JsonSettings.js +0 -0
  373. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonCodec.js +0 -0
  374. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +0 -0
  375. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +0 -0
  376. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +0 -0
  377. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/detectBufferParsing.js +0 -0
  378. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/jsonReplacer.js +0 -0
  379. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/jsonReviver.js +0 -0
  380. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/needsReviver.js +0 -0
  381. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonCodec.d.ts +0 -0
  382. /package/node_modules/{@aws-sdk/core/dist-types/submodules/protocols/json → @smithy/core/dist-types/submodules/protocols/json/codec-v1}/JsonSettings.d.ts +0 -0
  383. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -0
  384. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -0
  385. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -0
  386. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -0
  387. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -0
  388. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -0
  389. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/detectBufferParsing.d.ts +0 -0
  390. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/jsonReplacer.d.ts +0 -0
  391. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/jsonReviver.d.ts +0 -0
  392. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/needsReviver.d.ts +0 -0
@@ -55,6 +55,17 @@ class MockAgent extends Dispatcher {
55
55
  }
56
56
  }
57
57
 
58
+ // WebSocket and EventSource read their receive limits from the dispatcher
59
+ // they are given, so report the settings of the agent that makes real
60
+ // connections.
61
+ get webSocketOptions () {
62
+ return this[kAgent].webSocketOptions
63
+ }
64
+
65
+ get eventSourceOptions () {
66
+ return this[kAgent].eventSourceOptions
67
+ }
68
+
58
69
  get (origin) {
59
70
  // Normalize origin to handle URL objects and case-insensitive hostnames
60
71
  const normalizedOrigin = normalizeOrigin(origin)
@@ -4,6 +4,7 @@ const { writeFile, readFile, mkdir } = require('node:fs/promises')
4
4
  const { dirname, resolve } = require('node:path')
5
5
  const { setTimeout, clearTimeout } = require('node:timers')
6
6
  const { InvalidArgumentError, UndiciError } = require('../core/errors')
7
+ const { setHeader } = require('../core/util')
7
8
  const { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require('./snapshot-utils')
8
9
 
9
10
  /**
@@ -169,7 +170,7 @@ function filterHeadersForMatching (headers, headerFilters, matchOptions = {}) {
169
170
  if (!match.has(headerKey)) continue
170
171
  }
171
172
 
172
- filtered[headerKey] = value
173
+ setHeader(filtered, headerKey, value)
173
174
  }
174
175
 
175
176
  return filtered
@@ -198,7 +199,7 @@ function filterHeadersForStorage (headers, headerFilters, matchOptions = {}) {
198
199
  // Skip if in exclude list (for security)
199
200
  if (excludeSet.has(headerKey)) continue
200
201
 
201
- filtered[headerKey] = value
202
+ setHeader(filtered, headerKey, value)
202
203
  }
203
204
 
204
205
  return filtered
@@ -1,6 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  const { InvalidArgumentError } = require('../core/errors')
4
+ const { setHeader } = require('../core/util')
4
5
  const { runtimeFeatures } = require('../util/runtime-features.js')
5
6
 
6
7
  /**
@@ -116,7 +117,7 @@ function normalizeHeaders (headers) {
116
117
  // Convert Buffers to strings if needed
117
118
  const keyStr = Buffer.isBuffer(key) ? key.toString() : key
118
119
  const valueStr = Buffer.isBuffer(value) ? value.toString() : value
119
- normalizedHeaders[keyStr.toLowerCase()] = valueStr
120
+ setHeader(normalizedHeaders, keyStr.toLowerCase(), valueStr)
120
121
  }
121
122
  }
122
123
  return normalizedHeaders
@@ -126,7 +127,7 @@ function normalizeHeaders (headers) {
126
127
  if (headers && typeof headers === 'object') {
127
128
  for (const [key, value] of Object.entries(headers)) {
128
129
  if (key && typeof key === 'string') {
129
- normalizedHeaders[key.toLowerCase()] = Array.isArray(value) ? value.join(', ') : String(value)
130
+ setHeader(normalizedHeaders, key.toLowerCase(), Array.isArray(value) ? value.join(', ') : String(value))
130
131
  }
131
132
  }
132
133
  }
@@ -4,7 +4,8 @@ const {
4
4
  safeHTTPMethods,
5
5
  pathHasQueryOrFragment,
6
6
  hasSafeIterator,
7
- isValidHTTPToken
7
+ isValidHTTPToken,
8
+ setHeader
8
9
  } = require('../core/util')
9
10
 
10
11
  const { serializePathWithQuery } = require('../core/util')
@@ -206,15 +207,20 @@ function makeCacheKey (opts, origin = getRequestOrigin(opts)) {
206
207
 
207
208
  function appendHeader (headers, key, val) {
208
209
  const headerName = key.toLowerCase()
209
- const current = headers[headerName]
210
+ // Reading `headers[headerName]` directly would resolve `__proto__` (and any
211
+ // other inherited name) through the prototype chain rather than report the
212
+ // header as absent.
213
+ const current = Object.hasOwn(headers, headerName)
214
+ ? headers[headerName]
215
+ : undefined
210
216
  const values = Array.isArray(val) ? val : [val]
211
217
 
212
218
  if (current === undefined) {
213
- headers[headerName] = Array.isArray(val) ? val.slice() : val
219
+ setHeader(headers, headerName, Array.isArray(val) ? val.slice() : val)
214
220
  } else if (Array.isArray(current)) {
215
221
  current.push(...values)
216
222
  } else {
217
- headers[headerName] = [current, ...values]
223
+ setHeader(headers, headerName, [current, ...values])
218
224
  }
219
225
  }
220
226
 
@@ -732,7 +738,7 @@ function makeDeduplicationKey (cacheKey, excludeHeaders) {
732
738
  if (excludeHeaders?.has(header.toLowerCase())) {
733
739
  continue
734
740
  }
735
- headers[header] = cacheKey.headers[header]
741
+ setHeader(headers, header, cacheKey.headers[header])
736
742
  }
737
743
  }
738
744
 
@@ -41,7 +41,7 @@ class Cache {
41
41
  }
42
42
 
43
43
  async match (request, options = {}) {
44
- webidl.brandCheck(this, Cache)
44
+ webidl.brandCheck(this, webidl.is.Cache)
45
45
 
46
46
  const prefix = 'Cache.match'
47
47
  webidl.argumentLengthCheck(arguments, 1, prefix)
@@ -59,7 +59,7 @@ class Cache {
59
59
  }
60
60
 
61
61
  async matchAll (request = undefined, options = {}) {
62
- webidl.brandCheck(this, Cache)
62
+ webidl.brandCheck(this, webidl.is.Cache)
63
63
 
64
64
  const prefix = 'Cache.matchAll'
65
65
  if (request !== undefined) request = webidl.converters.RequestInfo(request)
@@ -69,7 +69,7 @@ class Cache {
69
69
  }
70
70
 
71
71
  async add (request) {
72
- webidl.brandCheck(this, Cache)
72
+ webidl.brandCheck(this, webidl.is.Cache)
73
73
 
74
74
  const prefix = 'Cache.add'
75
75
  webidl.argumentLengthCheck(arguments, 1, prefix)
@@ -87,7 +87,7 @@ class Cache {
87
87
  }
88
88
 
89
89
  async addAll (requests) {
90
- webidl.brandCheck(this, Cache)
90
+ webidl.brandCheck(this, webidl.is.Cache)
91
91
 
92
92
  const prefix = 'Cache.addAll'
93
93
  webidl.argumentLengthCheck(arguments, 1, prefix)
@@ -185,7 +185,10 @@ class Cache {
185
185
  }
186
186
  }
187
187
  },
188
- processResponseEndOfBody (response) {
188
+ // Possible spec bug. If the body is never read, `processResponseEndOfBody` (which is attached to a TransformStream's flush hook)
189
+ // never runs, so this would hang. This hook, on the other hand, always reads the body.
190
+ // https://github.com/nodejs/undici/issues/5615
191
+ processResponseConsumeBody (response) {
189
192
  // 1.
190
193
  if (response.aborted) {
191
194
  responsePromise.reject(new DOMException('aborted', 'AbortError'))
@@ -257,7 +260,7 @@ class Cache {
257
260
  }
258
261
 
259
262
  async put (request, response) {
260
- webidl.brandCheck(this, Cache)
263
+ webidl.brandCheck(this, webidl.is.Cache)
261
264
 
262
265
  const prefix = 'Cache.put'
263
266
  webidl.argumentLengthCheck(arguments, 2, prefix)
@@ -388,7 +391,7 @@ class Cache {
388
391
  }
389
392
 
390
393
  async delete (request, options = {}) {
391
- webidl.brandCheck(this, Cache)
394
+ webidl.brandCheck(this, webidl.is.Cache)
392
395
 
393
396
  const prefix = 'Cache.delete'
394
397
  webidl.argumentLengthCheck(arguments, 1, prefix)
@@ -454,7 +457,7 @@ class Cache {
454
457
  * @returns {Promise<readonly Request[]>}
455
458
  */
456
459
  async keys (request = undefined, options = {}) {
457
- webidl.brandCheck(this, Cache)
460
+ webidl.brandCheck(this, webidl.is.Cache)
458
461
 
459
462
  const prefix = 'Cache.keys'
460
463
 
@@ -804,6 +807,12 @@ class Cache {
804
807
  // 6.
805
808
  return Object.freeze(responseList)
806
809
  }
810
+
811
+ static {
812
+ webidl.is.Cache = (arg) => {
813
+ return arg != null && typeof arg === 'object' && #relevantRequestResponseList in arg
814
+ }
815
+ }
807
816
  }
808
817
 
809
818
  Object.defineProperties(Cache.prototype, {
@@ -21,7 +21,7 @@ class CacheStorage {
21
21
  }
22
22
 
23
23
  async match (request, options = {}) {
24
- webidl.brandCheck(this, CacheStorage)
24
+ webidl.brandCheck(this, webidl.is.CacheStorage)
25
25
  webidl.argumentLengthCheck(arguments, 1, 'CacheStorage.match')
26
26
 
27
27
  request = webidl.converters.RequestInfo(request)
@@ -58,7 +58,7 @@ class CacheStorage {
58
58
  * @returns {Promise<boolean>}
59
59
  */
60
60
  async has (cacheName) {
61
- webidl.brandCheck(this, CacheStorage)
61
+ webidl.brandCheck(this, webidl.is.CacheStorage)
62
62
 
63
63
  const prefix = 'CacheStorage.has'
64
64
  webidl.argumentLengthCheck(arguments, 1, prefix)
@@ -76,7 +76,7 @@ class CacheStorage {
76
76
  * @returns {Promise<Cache>}
77
77
  */
78
78
  async open (cacheName) {
79
- webidl.brandCheck(this, CacheStorage)
79
+ webidl.brandCheck(this, webidl.is.CacheStorage)
80
80
 
81
81
  const prefix = 'CacheStorage.open'
82
82
  webidl.argumentLengthCheck(arguments, 1, prefix)
@@ -110,7 +110,7 @@ class CacheStorage {
110
110
  * @returns {Promise<boolean>}
111
111
  */
112
112
  async delete (cacheName) {
113
- webidl.brandCheck(this, CacheStorage)
113
+ webidl.brandCheck(this, webidl.is.CacheStorage)
114
114
 
115
115
  const prefix = 'CacheStorage.delete'
116
116
  webidl.argumentLengthCheck(arguments, 1, prefix)
@@ -125,7 +125,7 @@ class CacheStorage {
125
125
  * @returns {Promise<string[]>}
126
126
  */
127
127
  async keys () {
128
- webidl.brandCheck(this, CacheStorage)
128
+ webidl.brandCheck(this, webidl.is.CacheStorage)
129
129
 
130
130
  // 2.1
131
131
  const keys = this.#caches.keys()
@@ -133,6 +133,12 @@ class CacheStorage {
133
133
  // 2.2
134
134
  return [...keys]
135
135
  }
136
+
137
+ static {
138
+ webidl.is.CacheStorage = (arg) => {
139
+ return arg != null && typeof arg === 'object' && #caches in arg
140
+ }
141
+ }
136
142
  }
137
143
 
138
144
  Object.defineProperties(CacheStorage.prototype, {
@@ -3,9 +3,19 @@
3
3
  const { parseSetCookie } = require('./parse')
4
4
  const { stringify } = require('./util')
5
5
  const { webidl } = require('../webidl')
6
- const { Headers } = require('../fetch/headers')
7
6
 
8
- const brandChecks = webidl.brandCheckMultiple([Headers, globalThis.Headers].filter(Boolean))
7
+ const globalHeadersBrandCheck = (arg) => webidl.brandCheck(arg, webidl.util.MakeTypeAssertion(globalThis.Headers))
8
+ const undiciHeadersBrandCheck = (arg) => webidl.brandCheck(arg, webidl.is.Headers)
9
+
10
+ function brandCheckHeaders (arg) {
11
+ try {
12
+ undiciHeadersBrandCheck(arg)
13
+ return
14
+ } catch {
15
+ }
16
+
17
+ globalHeadersBrandCheck(arg)
18
+ }
9
19
 
10
20
  /**
11
21
  * @typedef {Object} Cookie
@@ -28,12 +38,14 @@ const brandChecks = webidl.brandCheckMultiple([Headers, globalThis.Headers].filt
28
38
  function getCookies (headers) {
29
39
  webidl.argumentLengthCheck(arguments, 1, 'getCookies')
30
40
 
31
- brandChecks(headers)
41
+ brandCheckHeaders(headers)
32
42
 
33
43
  const cookie = headers.get('cookie')
34
44
 
45
+ // A null prototype keeps a cookie named `__proto__` from hitting the
46
+ // Object.prototype setter, which would silently drop it.
35
47
  /** @type {Record<string, string>} */
36
- const out = {}
48
+ const out = { __proto__: null }
37
49
 
38
50
  if (!cookie) {
39
51
  return out
@@ -55,7 +67,7 @@ function getCookies (headers) {
55
67
  * @returns {void}
56
68
  */
57
69
  function deleteCookie (headers, name, attributes) {
58
- brandChecks(headers)
70
+ brandCheckHeaders(headers)
59
71
 
60
72
  const prefix = 'deleteCookie'
61
73
  webidl.argumentLengthCheck(arguments, 2, prefix)
@@ -80,7 +92,7 @@ function deleteCookie (headers, name, attributes) {
80
92
  function getSetCookies (headers) {
81
93
  webidl.argumentLengthCheck(arguments, 1, 'getSetCookies')
82
94
 
83
- brandChecks(headers)
95
+ brandCheckHeaders(headers)
84
96
 
85
97
  const cookies = headers.getSetCookie()
86
98
 
@@ -109,7 +121,7 @@ function parseCookie (cookie) {
109
121
  function setCookie (headers, cookie) {
110
122
  webidl.argumentLengthCheck(arguments, 2, 'setCookie')
111
123
 
112
- brandChecks(headers)
124
+ brandCheckHeaders(headers)
113
125
 
114
126
  cookie = webidl.converters.Cookie(cookie)
115
127
 
@@ -315,8 +315,27 @@ function stringify (cookie) {
315
315
  out.push(`Path=${cookie.path}`)
316
316
  }
317
317
 
318
- if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
319
- out.push(`Expires=${toIMFDate(cookie.expires)}`)
318
+ // A numeric 0 is the Unix epoch, not an absent value -- the same reason the
319
+ // Max-Age check above tests the type rather than truthiness.
320
+ //
321
+ // expires is Date | number, so the "Invalid Date" check only guards the Date
322
+ // form. A number that is not a valid time value (NaN, +/-Infinity, or outside
323
+ // the Date range) would otherwise reach toIMFDate, which splices undefined and
324
+ // NaN into the header value instead of failing.
325
+ if (cookie.expires != null) {
326
+ const expiresMs = cookie.expires instanceof Date
327
+ ? cookie.expires.getTime()
328
+ : cookie.expires
329
+
330
+ // The largest time value a Date can represent, in milliseconds, i.e.
331
+ // 100,000,000 days either side of the epoch (ECMA-262 Date Time Values).
332
+ // Anything within it is safe for toIMFDate to format; anything beyond it
333
+ // produces an invalid Date and must be ignored instead.
334
+ const maxTimeValue = 8640000000000000
335
+
336
+ if (typeof expiresMs === 'number' && Number.isFinite(expiresMs) && Math.abs(expiresMs) <= maxTimeValue) {
337
+ out.push(`Expires=${toIMFDate(cookie.expires)}`)
338
+ }
320
339
  }
321
340
 
322
341
  if (cookie.sameSite) {
@@ -31,6 +31,12 @@ const EVENT = Buffer.from('event')
31
31
  const ID = Buffer.from('id')
32
32
  const RETRY = Buffer.from('retry')
33
33
 
34
+ // Each data field creates a string node, and each unconsumed input chunk keeps
35
+ // a Buffer wrapper. The absolute ceiling protects the large default byte limit.
36
+ const minParserItems = 1024
37
+ const maxParserItems = 131072
38
+ const bytesPerParserItem = 128
39
+
34
40
  function isASCIINumberBytes (buffer, start) {
35
41
  if (start >= buffer.length) {
36
42
  return false
@@ -123,8 +129,13 @@ class EventSourceStream extends Transform {
123
129
  pos = 0
124
130
  lineChunkIndex = 0
125
131
  linePos = 0
126
- eventDataSize = 0
132
+ lineLength = 0
133
+ eventSize = 0
134
+ eventFieldSizes = { data: 0, event: 0, id: 0, retry: 0 }
135
+ dataLineCount = 0
127
136
  maxEventSize
137
+ maxDataLines
138
+ maxBufferedChunks
128
139
 
129
140
  event = {
130
141
  data: undefined,
@@ -149,6 +160,11 @@ class EventSourceStream extends Transform {
149
160
 
150
161
  this.state = options.eventSourceSettings || {}
151
162
  this.maxEventSize = options.maxEventSize ?? defaultMaxEventSize
163
+ const parserItemLimit = this.maxEventSize > 0
164
+ ? Math.min(maxParserItems, Math.max(minParserItems, Math.floor(this.maxEventSize / bytesPerParserItem)))
165
+ : 0
166
+ this.maxDataLines = parserItemLimit
167
+ this.maxBufferedChunks = parserItemLimit
152
168
  if (options.push) {
153
169
  this.push = options.push
154
170
  }
@@ -166,6 +182,14 @@ class EventSourceStream extends Transform {
166
182
  return
167
183
  }
168
184
 
185
+ // A leading line ending can immediately release the currently buffered
186
+ // line, even when it uses the final allowed chunk slot.
187
+ if (this.maxEventSize > 0 &&
188
+ this.chunks.length >= this.maxBufferedChunks &&
189
+ chunk[0] !== LF && chunk[0] !== CR) {
190
+ callback(createMaxEventSizeExceededError())
191
+ return
192
+ }
169
193
  this.chunks.push(chunk)
170
194
 
171
195
  // Strip leading byte-order-mark if we opened the stream and started
@@ -258,12 +282,25 @@ class EventSourceStream extends Transform {
258
282
  continue
259
283
  }
260
284
 
285
+ // readLine() is only called after CR or LF. Reject an unfinished line
286
+ // before it can retain an unbounded number of decoded chunks. The seven
287
+ // extra bytes allow the longest field prefix ("event: " or "retry: ").
288
+ if (this.maxEventSize > 0 && ++this.lineLength > this.maxEventSize + 7) {
289
+ callback(createMaxEventSizeExceededError())
290
+ return
291
+ }
261
292
  this.advanceCursor()
262
293
  }
263
294
 
264
295
  callback()
265
296
  }
266
297
 
298
+ _destroy (error, callback) {
299
+ this.chunks.length = 0
300
+ this.clearEvent()
301
+ super._destroy(error, callback)
302
+ }
303
+
267
304
  /**
268
305
  * @param {Buffer} line
269
306
  * @param {EventSourceStreamEvent} event
@@ -300,12 +337,12 @@ class EventSourceStream extends Transform {
300
337
  }
301
338
 
302
339
  if (isFieldName(line, fieldLength, DATA)) {
303
- const valueBytes = line.length - valueStart
304
- const eventDataSize = this.eventDataSize + (event.data === undefined ? 0 : 1) + valueBytes
305
-
306
- if (this.maxEventSize > 0 && eventDataSize > this.maxEventSize) {
340
+ if (this.maxEventSize > 0 && this.dataLineCount >= this.maxDataLines) {
307
341
  throw createMaxEventSizeExceededError()
308
342
  }
343
+ const valueBytes = line.length - valueStart
344
+ const dataSize = this.eventFieldSizes.data + (event.data === undefined ? 0 : 1) + valueBytes
345
+ this.setEventFieldSize('data', dataSize)
309
346
 
310
347
  const value = line.toString('utf8', valueStart)
311
348
 
@@ -314,12 +351,13 @@ class EventSourceStream extends Transform {
314
351
  } else {
315
352
  event.data += `\n${value}`
316
353
  }
317
- this.eventDataSize = eventDataSize
354
+ this.dataLineCount++
318
355
  return
319
356
  }
320
357
 
321
358
  if (isFieldName(line, fieldLength, RETRY)) {
322
359
  if (isASCIINumberBytes(line, valueStart)) {
360
+ this.setEventFieldSize('retry', line.length - valueStart)
323
361
  event.retry = line.toString('utf8', valueStart)
324
362
  }
325
363
  return
@@ -327,20 +365,29 @@ class EventSourceStream extends Transform {
327
365
 
328
366
  if (isFieldName(line, fieldLength, ID)) {
329
367
  if (isValidLastEventIdBytes(line, valueStart)) {
368
+ this.setEventFieldSize('id', line.length - valueStart)
330
369
  event.id = line.toString('utf8', valueStart)
331
370
  }
332
371
  return
333
372
  }
334
373
 
335
374
  if (isFieldName(line, fieldLength, EVENT)) {
336
- const value = line.toString('utf8', valueStart)
337
-
338
- if (value.length > 0) {
339
- event.event = value
375
+ if (valueStart < line.length) {
376
+ this.setEventFieldSize('event', line.length - valueStart)
377
+ event.event = line.toString('utf8', valueStart)
340
378
  }
341
379
  }
342
380
  }
343
381
 
382
+ setEventFieldSize (field, size) {
383
+ const eventSize = this.eventSize - this.eventFieldSizes[field] + size
384
+ if (this.maxEventSize > 0 && eventSize > this.maxEventSize) {
385
+ throw createMaxEventSizeExceededError()
386
+ }
387
+ this.eventSize = eventSize
388
+ this.eventFieldSizes[field] = size
389
+ }
390
+
344
391
  /**
345
392
  * @param {EventSourceStreamEvent} event
346
393
  */
@@ -371,7 +418,12 @@ class EventSourceStream extends Transform {
371
418
  this.event.event = undefined
372
419
  this.event.id = undefined
373
420
  this.event.retry = undefined
374
- this.eventDataSize = 0
421
+ this.eventSize = 0
422
+ this.dataLineCount = 0
423
+ this.eventFieldSizes.data = 0
424
+ this.eventFieldSizes.event = 0
425
+ this.eventFieldSizes.id = 0
426
+ this.eventFieldSizes.retry = 0
375
427
  }
376
428
 
377
429
  hasPendingEvent () {
@@ -407,14 +459,16 @@ class EventSourceStream extends Transform {
407
459
  syncLineStartToCursor () {
408
460
  this.lineChunkIndex = this.chunkIndex
409
461
  this.linePos = this.pos
462
+ this.lineLength = 0
410
463
  this.dropConsumedChunks()
411
464
  }
412
465
 
413
466
  dropConsumedChunks () {
414
- while (this.lineChunkIndex > 0) {
415
- this.chunks.shift()
416
- this.lineChunkIndex--
417
- this.chunkIndex--
467
+ if (this.lineChunkIndex > 0) {
468
+ const consumed = this.lineChunkIndex
469
+ this.chunks.splice(0, consumed)
470
+ this.lineChunkIndex = 0
471
+ this.chunkIndex -= consumed
418
472
  }
419
473
 
420
474
  if (this.chunkIndex === this.chunks.length) {
@@ -7,6 +7,7 @@ const { EventSourceStream } = require('./eventsource-stream')
7
7
  const { parseMIMEType } = require('../fetch/data-url')
8
8
  const { createFastMessageEvent } = require('../websocket/events')
9
9
  const { isNetworkError } = require('../fetch/response')
10
+ const { cloneRequest } = require('../fetch/request')
10
11
  const { isValidHeaderValue, kEnumerableProperty } = require('../../core/util')
11
12
  const { environmentSettingsObject } = require('../fetch/util')
12
13
  const { createPotentialCORSRequest } = require('./util')
@@ -29,6 +30,14 @@ let experimentalWarned = false
29
30
  */
30
31
  const defaultReconnectionTime = 3000
31
32
 
33
+ /**
34
+ * The largest delay setTimeout supports. Larger values (including Infinity)
35
+ * make Node.js fire the timer after 1 ms instead, which would turn a large
36
+ * reconnection time into a reconnect storm.
37
+ * @type {number}
38
+ */
39
+ const maxReconnectionTime = 2 ** 31 - 1
40
+
32
41
  /**
33
42
  * The readyState attribute represents the state of the connection.
34
43
  * @typedef ReadyState
@@ -191,6 +200,8 @@ class EventSource extends EventTarget {
191
200
  * @readonly
192
201
  */
193
202
  get readyState () {
203
+ webidl.brandCheck(this, webidl.is.EventSource)
204
+
194
205
  return this.#readyState
195
206
  }
196
207
 
@@ -200,6 +211,8 @@ class EventSource extends EventTarget {
200
211
  * @returns {string}
201
212
  */
202
213
  get url () {
214
+ webidl.brandCheck(this, webidl.is.EventSource)
215
+
203
216
  return this.#url
204
217
  }
205
218
 
@@ -208,6 +221,8 @@ class EventSource extends EventTarget {
208
221
  * instantiated with CORS credentials set (true), or not (false, the default).
209
222
  */
210
223
  get withCredentials () {
224
+ webidl.brandCheck(this, webidl.is.EventSource)
225
+
211
226
  return this.#withCredentials
212
227
  }
213
228
 
@@ -216,8 +231,22 @@ class EventSource extends EventTarget {
216
231
 
217
232
  this.#readyState = CONNECTING
218
233
 
234
+ // Fetch a copy of the request so that every connection starts from the
235
+ // original request. Fetch mutates the request it is given (URL list,
236
+ // redirect count, response tainting and, on cross-origin redirects,
237
+ // headers), so reusing it makes reconnects go to the last redirect
238
+ // target and, after 20 redirects in total, fail forever.
239
+ // cloneRequest() shares the URL list, so copy it as well.
240
+ // 301/308 permanent redirects are handled the same as 302/307 temporary
241
+ // redirects. While the original EventSource spec required that permanent
242
+ // redirects be handled, WHATWG removed that requirement and has not
243
+ // yet opted to restore it... therefore all redirects gets handled the
244
+ // same.
245
+ const request = cloneRequest(this.#request)
246
+ request.urlList = [...this.#request.urlList]
247
+
219
248
  const fetchParams = {
220
- request: this.#request,
249
+ request,
221
250
  dispatcher: this.#dispatcher
222
251
  }
223
252
 
@@ -355,7 +384,7 @@ class EventSource extends EventTarget {
355
384
 
356
385
  // 4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.
357
386
  this.#connect()
358
- }, this.#state.reconnectionTime)?.unref()
387
+ }, Math.min(this.#state.reconnectionTime, maxReconnectionTime))?.unref()
359
388
  }
360
389
 
361
390
  /**
@@ -363,7 +392,7 @@ class EventSource extends EventTarget {
363
392
  * CLOSED.
364
393
  */
365
394
  close () {
366
- webidl.brandCheck(this, EventSource)
395
+ webidl.brandCheck(this, webidl.is.EventSource)
367
396
 
368
397
  if (this.#readyState === CLOSED) return
369
398
  this.#readyState = CLOSED
@@ -372,10 +401,14 @@ class EventSource extends EventTarget {
372
401
  }
373
402
 
374
403
  get onopen () {
404
+ webidl.brandCheck(this, webidl.is.EventSource)
405
+
375
406
  return this.#events.open
376
407
  }
377
408
 
378
409
  set onopen (fn) {
410
+ webidl.brandCheck(this, webidl.is.EventSource)
411
+
379
412
  if (this.#events.open) {
380
413
  this.removeEventListener('open', this.#events.open)
381
414
  }
@@ -391,10 +424,14 @@ class EventSource extends EventTarget {
391
424
  }
392
425
 
393
426
  get onmessage () {
427
+ webidl.brandCheck(this, webidl.is.EventSource)
428
+
394
429
  return this.#events.message
395
430
  }
396
431
 
397
432
  set onmessage (fn) {
433
+ webidl.brandCheck(this, webidl.is.EventSource)
434
+
398
435
  if (this.#events.message) {
399
436
  this.removeEventListener('message', this.#events.message)
400
437
  }
@@ -410,10 +447,14 @@ class EventSource extends EventTarget {
410
447
  }
411
448
 
412
449
  get onerror () {
450
+ webidl.brandCheck(this, webidl.is.EventSource)
451
+
413
452
  return this.#events.error
414
453
  }
415
454
 
416
455
  set onerror (fn) {
456
+ webidl.brandCheck(this, webidl.is.EventSource)
457
+
417
458
  if (this.#events.error) {
418
459
  this.removeEventListener('error', this.#events.error)
419
460
  }
@@ -427,6 +468,12 @@ class EventSource extends EventTarget {
427
468
  this.#events.error = null
428
469
  }
429
470
  }
471
+
472
+ static {
473
+ webidl.is.EventSource = (arg) => {
474
+ return arg != null && typeof arg === 'object' && #events in arg
475
+ }
476
+ }
430
477
  }
431
478
 
432
479
  const constantsPropertyDescriptors = {