@yanglaofish/fishtools 0.5.1 → 0.5.3

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 (846) hide show
  1. package/README.md +25 -11
  2. package/manual/README.md +25 -11
  3. package/manual/docs/deployment.md +3 -3
  4. package/manual/docs/examples/action-plugin/package.json +1 -1
  5. package/manual/docs/modules.md +2 -0
  6. package/manual/docs/plugin-development.md +18 -5
  7. package/manual/docs/releases.md +56 -6
  8. package/manual/docs/superpowers/plans/2026-10-13-command-shortcuts.md +108 -0
  9. package/manual/docs/superpowers/plans/2026-10-13-global-plugins.md +56 -0
  10. package/manual/docs/superpowers/plans/2026-10-13-tui-readable-sessions.md +21 -0
  11. package/manual/docs/superpowers/reviews/2026-10-13-0.5.0-followup-review.md +4 -1
  12. package/manual/docs/superpowers/reviews/2026-10-13-0.5.3-review.md +28 -0
  13. package/manual/docs/superpowers/reviews/2026-10-13-command-shortcuts-review.md +70 -0
  14. package/manual/docs/superpowers/reviews/2026-10-13-tui-sessions-review.md +55 -0
  15. package/manual/docs/superpowers/specs/2026-10-12-workflow-variation-design.md +1 -1
  16. package/manual/docs/superpowers/specs/2026-10-13-command-shortcuts-design.md +56 -0
  17. package/manual/docs/superpowers/specs/2026-10-13-issue-4-workflow-menu.md +51 -0
  18. package/manual/docs/superpowers/specs/2026-10-13-issue-5-results-and-history.md +20 -0
  19. package/manual/docs/terminal-commands.md +72 -0
  20. package/manual/docs/verification.md +56 -1
  21. package/manual/packages/core/README.md +5 -1
  22. package/manual/packages/core/package.json +2 -1
  23. package/manual/packages/core/src/application.js +203 -57
  24. package/manual/packages/core/src/development-watch-worker.js +10 -1
  25. package/manual/packages/core/src/development.js +1 -1
  26. package/manual/packages/core/src/export-snapshot.js +20 -1
  27. package/manual/packages/core/src/plugin-catalog.js +42 -0
  28. package/manual/packages/core/src/version.js +1 -1
  29. package/manual/packages/fst-cli/README.md +6 -0
  30. package/manual/packages/fst-cli/bin/fst.js +7 -6
  31. package/manual/packages/fst-cli/package.json +1 -1
  32. package/manual/packages/fst-cli/src/development.js +6 -1
  33. package/manual/packages/fst-cli/src/terminal/command-menu.js +191 -0
  34. package/manual/packages/fst-cli/src/terminal/navigation.js +6 -3
  35. package/manual/packages/fst-cli/src/terminal/presentation.js +4 -3
  36. package/manual/packages/fst-cli/src/terminal/run-feed.js +69 -13
  37. package/manual/packages/fst-cli/src/terminal/run-presentation.js +55 -12
  38. package/manual/packages/fst-cli/src/terminal/run-viewer.js +26 -10
  39. package/manual/packages/fst-cli/src/terminal/session-history.js +82 -0
  40. package/manual/packages/fst-cli/src/terminal/session.js +153 -43
  41. package/manual/packages/fst-cli/src/terminal/view.js +74 -16
  42. package/manual/packages/fst-cli/src/terminal/workflow-menu.js +15 -15
  43. package/manual/packages/fst-devtools/package.json +2 -2
  44. package/manual/packages/fst-devtools/src/documentation.js +2 -1
  45. package/manual/packages/fst-devtools/src/plugin-tools.js +1 -1
  46. package/manual/packages/fst-logs/README.md +23 -2
  47. package/manual/packages/fst-logs/package.json +2 -1
  48. package/manual/packages/fst-logs/src/file-identity.js +23 -0
  49. package/manual/packages/fst-logs/src/markdown-log.js +4 -3
  50. package/manual/packages/fst-logs/src/run-logs.js +3 -2
  51. package/manual/packages/fst-logs/src/session-history.js +180 -0
  52. package/manual/packages/fst-platform/README.md +15 -0
  53. package/manual/packages/fst-platform/package.json +4 -3
  54. package/manual/packages/fst-platform/src/process.js +15 -8
  55. package/manual/packages/fst-platform/src/shell.js +103 -0
  56. package/manual/packages/fst-plugin/package.json +1 -1
  57. package/manual/packages/fst-plugin/src/contracts.js +6 -2
  58. package/manual/packages/fst-plugin/src/host.js +31 -23
  59. package/manual/packages/fst-workflow/package.json +1 -1
  60. package/manual/packages/fst-workflow/src/engine.js +1 -1
  61. package/manual/packages/fst-workspace/README.md +5 -0
  62. package/manual/packages/fst-workspace/package.json +3 -1
  63. package/manual/packages/fst-workspace/src/plugin-registry.js +58 -0
  64. package/manual/packages/fst-workspace/src/plugins.js +7 -4
  65. package/manual/packages/fst-workspace/src/shortcuts.js +119 -0
  66. package/manual/packages/fst-workspace/src/workflows.js +5 -3
  67. package/manual/packages/pack/index.js +1 -1
  68. package/manual/packages/pack/package.json +3 -3
  69. package/manual/packages/pack/runtime-cache.js +26 -0
  70. package/manual/packages/pack/runtime.js +6 -10
  71. package/manual/plugins/commands/LICENSE +21 -0
  72. package/manual/plugins/commands/README.md +41 -0
  73. package/manual/plugins/commands/index.js +94 -0
  74. package/manual/plugins/commands/package.json +17 -0
  75. package/node_modules/@mytools/commands/LICENSE +21 -0
  76. package/node_modules/@mytools/commands/README.md +41 -0
  77. package/node_modules/@mytools/commands/index.js +94 -0
  78. package/node_modules/@mytools/commands/package.json +17 -0
  79. package/node_modules/@mytools/core/README.md +5 -1
  80. package/node_modules/@mytools/core/package.json +2 -1
  81. package/node_modules/@mytools/core/src/application.js +203 -57
  82. package/node_modules/@mytools/core/src/development-watch-worker.js +10 -1
  83. package/node_modules/@mytools/core/src/development.js +1 -1
  84. package/node_modules/@mytools/core/src/export-snapshot.js +20 -1
  85. package/node_modules/@mytools/core/src/plugin-catalog.js +42 -0
  86. package/node_modules/@mytools/core/src/version.js +1 -1
  87. package/node_modules/@mytools/fst-cli/README.md +6 -0
  88. package/node_modules/@mytools/fst-cli/bin/fst.js +7 -6
  89. package/node_modules/@mytools/fst-cli/package.json +1 -1
  90. package/node_modules/@mytools/fst-cli/src/development.js +6 -1
  91. package/node_modules/@mytools/fst-cli/src/terminal/command-menu.js +191 -0
  92. package/node_modules/@mytools/fst-cli/src/terminal/navigation.js +6 -3
  93. package/node_modules/@mytools/fst-cli/src/terminal/presentation.js +4 -3
  94. package/node_modules/@mytools/fst-cli/src/terminal/run-feed.js +69 -13
  95. package/node_modules/@mytools/fst-cli/src/terminal/run-presentation.js +55 -12
  96. package/node_modules/@mytools/fst-cli/src/terminal/run-viewer.js +26 -10
  97. package/node_modules/@mytools/fst-cli/src/terminal/session-history.js +82 -0
  98. package/node_modules/@mytools/fst-cli/src/terminal/session.js +153 -43
  99. package/node_modules/@mytools/fst-cli/src/terminal/view.js +74 -16
  100. package/node_modules/@mytools/fst-cli/src/terminal/workflow-menu.js +15 -15
  101. package/node_modules/@mytools/fst-devtools/package.json +2 -2
  102. package/node_modules/@mytools/fst-devtools/src/documentation.js +2 -1
  103. package/node_modules/@mytools/fst-devtools/src/plugin-tools.js +1 -1
  104. package/node_modules/@mytools/fst-logs/README.md +23 -2
  105. package/node_modules/@mytools/fst-logs/package.json +2 -1
  106. package/node_modules/@mytools/fst-logs/src/file-identity.js +23 -0
  107. package/node_modules/@mytools/fst-logs/src/markdown-log.js +4 -3
  108. package/node_modules/@mytools/fst-logs/src/run-logs.js +3 -2
  109. package/node_modules/@mytools/fst-logs/src/session-history.js +180 -0
  110. package/node_modules/@mytools/fst-platform/README.md +15 -0
  111. package/node_modules/@mytools/fst-platform/node_modules/undici/LICENSE +21 -0
  112. package/node_modules/{undici/docs/docs/index.md → @mytools/fst-platform/node_modules/undici/README.md} +85 -137
  113. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Agent.md +84 -0
  114. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/BalancedPool.md +99 -0
  115. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/CacheStorage.md +30 -0
  116. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/CacheStore.md +164 -0
  117. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Client.md +288 -0
  118. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/ClientStats.md +27 -0
  119. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Connector.md +115 -0
  120. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/ContentType.md +57 -0
  121. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Cookies.md +128 -0
  122. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Debug.md +62 -0
  123. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +317 -0
  124. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Dispatcher.md +1393 -0
  125. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +159 -0
  126. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Errors.md +49 -0
  127. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/EventSource.md +45 -0
  128. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Fetch.md +60 -0
  129. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/GlobalInstallation.md +139 -0
  130. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/H2CClient.md +263 -0
  131. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockAgent.md +603 -0
  132. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockCallHistory.md +197 -0
  133. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +43 -0
  134. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockClient.md +81 -0
  135. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockErrors.md +12 -0
  136. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/MockPool.md +555 -0
  137. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Pool.md +84 -0
  138. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/PoolStats.md +35 -0
  139. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/ProxyAgent.md +229 -0
  140. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/RedirectHandler.md +93 -0
  141. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/RetryAgent.md +50 -0
  142. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/RetryHandler.md +118 -0
  143. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/RoundRobinPool.md +145 -0
  144. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/SnapshotAgent.md +616 -0
  145. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +275 -0
  146. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/Util.md +25 -0
  147. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/WebSocket.md +141 -0
  148. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/api/api-lifecycle.md +91 -0
  149. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/best-practices/client-certificate.md +64 -0
  150. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/docs/docs/best-practices/crawling.md +1 -3
  151. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/best-practices/mocking-request.md +190 -0
  152. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/best-practices/proxy.md +127 -0
  153. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/docs/docs/best-practices/undici-vs-builtin-fetch.md +8 -10
  154. package/node_modules/@mytools/fst-platform/node_modules/undici/docs/docs/best-practices/writing-tests.md +63 -0
  155. package/node_modules/@mytools/fst-platform/node_modules/undici/index-fetch.js +65 -0
  156. package/node_modules/@mytools/fst-platform/node_modules/undici/index.d.ts +3 -0
  157. package/node_modules/@mytools/fst-platform/node_modules/undici/index.js +234 -0
  158. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/abort-signal.js +59 -0
  159. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-connect.js +110 -0
  160. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-pipeline.js +252 -0
  161. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-request.js +214 -0
  162. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-stream.js +209 -0
  163. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/api-upgrade.js +111 -0
  164. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/index.js +7 -0
  165. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/api/readable.js +580 -0
  166. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/cache/memory-cache-store.js +3 -3
  167. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/cache/sqlite-cache-store.js +1 -3
  168. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/connect.js +153 -0
  169. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/constants.js +143 -0
  170. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/diagnostics.js +227 -0
  171. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/errors.js +477 -0
  172. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/request.js +485 -0
  173. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/symbols.js +75 -0
  174. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/tree.js +160 -0
  175. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/core/util.js +992 -0
  176. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/agent.js +158 -0
  177. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/balanced-pool.js +221 -0
  178. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/client-h1.js +1746 -0
  179. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/client-h2.js +1060 -0
  180. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/client.js +668 -0
  181. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/dispatcher-base.js +184 -0
  182. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/dispatcher.js +48 -0
  183. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +146 -0
  184. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
  185. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/dispatcher/h2c-client.js +4 -4
  186. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/pool-base.js +214 -0
  187. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/pool.js +118 -0
  188. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/proxy-agent.js +319 -0
  189. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
  190. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/dispatcher/round-robin-pool.js +10 -32
  191. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/dispatcher/socks5-proxy-agent.js +63 -153
  192. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/global.js +59 -0
  193. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/handler/cache-handler.js +7 -49
  194. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/handler/cache-revalidation-handler.js +0 -10
  195. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/decorator-handler.js +67 -0
  196. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/handler/deduplication-handler.js +10 -29
  197. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/redirect-handler.js +238 -0
  198. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/retry-handler.js +504 -0
  199. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/unwrap-handler.js +106 -0
  200. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/handler/wrap-handler.js +105 -0
  201. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/interceptor/cache.js +26 -79
  202. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/interceptor/decompress.js +3 -13
  203. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/interceptor/deduplicate.js +4 -5
  204. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/dns.js +571 -0
  205. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/dump.js +99 -0
  206. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/redirect.js +21 -0
  207. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/response-error.js +95 -0
  208. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/interceptor/retry.js +19 -0
  209. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/.gitkeep +0 -0
  210. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/constants.js +531 -0
  211. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
  212. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
  213. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/llhttp/utils.js +12 -0
  214. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-agent.js +232 -0
  215. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/mock/mock-call-history.js +1 -1
  216. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-client.js +68 -0
  217. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-errors.js +29 -0
  218. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-interceptor.js +209 -0
  219. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-pool.js +68 -0
  220. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-symbols.js +32 -0
  221. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/mock-utils.js +486 -0
  222. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
  223. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/mock/snapshot-agent.js +7 -25
  224. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/mock/snapshot-recorder.js +3 -38
  225. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/util/cache.js +10 -92
  226. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/util/promise.js +28 -0
  227. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/util/runtime-features.js +34 -3
  228. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/util/timers.js +425 -0
  229. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cache/cache.js +864 -0
  230. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
  231. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cache/util.js +45 -0
  232. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cookies/constants.js +12 -0
  233. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cookies/index.js +199 -0
  234. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cookies/parse.js +314 -0
  235. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/cookies/util.js +352 -0
  236. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/eventsource/eventsource-stream.js +494 -0
  237. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/eventsource/eventsource.js +501 -0
  238. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/eventsource/util.js +29 -0
  239. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/LICENSE +21 -0
  240. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/body.js +509 -0
  241. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/constants.js +131 -0
  242. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/data-url.js +596 -0
  243. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/formdata-parser.js +586 -0
  244. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/formdata.js +259 -0
  245. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/global.js +40 -0
  246. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/headers.js +719 -0
  247. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/index.js +2413 -0
  248. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/request.js +1115 -0
  249. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/response.js +641 -0
  250. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/fetch/util.js +1522 -0
  251. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/infra/index.js +1 -16
  252. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/webidl/index.js +21 -7
  253. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/connection.js +339 -0
  254. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/constants.js +126 -0
  255. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/events.js +331 -0
  256. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/frame.js +133 -0
  257. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/permessage-deflate.js +105 -0
  258. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/receiver.js +507 -0
  259. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/sender.js +109 -0
  260. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/websocket/stream/websocketerror.js +10 -13
  261. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/websocket/stream/websocketstream.js +14 -29
  262. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/util.js +347 -0
  263. package/node_modules/@mytools/fst-platform/node_modules/undici/lib/web/websocket/websocket.js +758 -0
  264. package/node_modules/@mytools/fst-platform/node_modules/undici/package.json +152 -0
  265. package/node_modules/@mytools/fst-platform/node_modules/undici/scripts/strip-comments.js +10 -0
  266. package/node_modules/@mytools/fst-platform/node_modules/undici/types/README.md +6 -0
  267. package/node_modules/@mytools/fst-platform/node_modules/undici/types/agent.d.ts +32 -0
  268. package/node_modules/@mytools/fst-platform/node_modules/undici/types/api.d.ts +43 -0
  269. package/node_modules/@mytools/fst-platform/node_modules/undici/types/balanced-pool.d.ts +30 -0
  270. package/node_modules/@mytools/fst-platform/node_modules/undici/types/cache.d.ts +36 -0
  271. package/node_modules/@mytools/fst-platform/node_modules/undici/types/client.d.ts +139 -0
  272. package/node_modules/@mytools/fst-platform/node_modules/undici/types/connector.d.ts +36 -0
  273. package/node_modules/@mytools/fst-platform/node_modules/undici/types/content-type.d.ts +21 -0
  274. package/node_modules/@mytools/fst-platform/node_modules/undici/types/cookies.d.ts +30 -0
  275. package/node_modules/@mytools/fst-platform/node_modules/undici/types/diagnostics-channel.d.ts +74 -0
  276. package/node_modules/@mytools/fst-platform/node_modules/undici/types/dispatcher.d.ts +275 -0
  277. package/node_modules/@mytools/fst-platform/node_modules/undici/types/env-http-proxy-agent.d.ts +22 -0
  278. package/node_modules/@mytools/fst-platform/node_modules/undici/types/errors.d.ts +177 -0
  279. package/node_modules/@mytools/fst-platform/node_modules/undici/types/eventsource.d.ts +66 -0
  280. package/node_modules/@mytools/fst-platform/node_modules/undici/types/fetch.d.ts +231 -0
  281. package/node_modules/@mytools/fst-platform/node_modules/undici/types/formdata.d.ts +114 -0
  282. package/node_modules/@mytools/fst-platform/node_modules/undici/types/global-dispatcher.d.ts +9 -0
  283. package/node_modules/@mytools/fst-platform/node_modules/undici/types/global-origin.d.ts +7 -0
  284. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/h2c-client.d.ts +6 -6
  285. package/node_modules/@mytools/fst-platform/node_modules/undici/types/handlers.d.ts +14 -0
  286. package/node_modules/@mytools/fst-platform/node_modules/undici/types/header.d.ts +160 -0
  287. package/node_modules/@mytools/fst-platform/node_modules/undici/types/index.d.ts +91 -0
  288. package/node_modules/@mytools/fst-platform/node_modules/undici/types/interceptors.d.ts +82 -0
  289. package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-agent.d.ts +68 -0
  290. package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-client.d.ts +27 -0
  291. package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-errors.d.ts +12 -0
  292. package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-interceptor.d.ts +94 -0
  293. package/node_modules/@mytools/fst-platform/node_modules/undici/types/mock-pool.d.ts +27 -0
  294. package/node_modules/@mytools/fst-platform/node_modules/undici/types/patch.d.ts +29 -0
  295. package/node_modules/@mytools/fst-platform/node_modules/undici/types/pool-stats.d.ts +19 -0
  296. package/node_modules/@mytools/fst-platform/node_modules/undici/types/pool.d.ts +41 -0
  297. package/node_modules/@mytools/fst-platform/node_modules/undici/types/proxy-agent.d.ts +29 -0
  298. package/node_modules/@mytools/fst-platform/node_modules/undici/types/readable.d.ts +68 -0
  299. package/node_modules/@mytools/fst-platform/node_modules/undici/types/retry-agent.d.ts +8 -0
  300. package/node_modules/@mytools/fst-platform/node_modules/undici/types/retry-handler.d.ts +125 -0
  301. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/round-robin-pool.d.ts +2 -0
  302. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/snapshot-agent.d.ts +0 -4
  303. package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/socks5-proxy-agent.d.ts +2 -4
  304. package/node_modules/@mytools/fst-platform/node_modules/undici/types/util.d.ts +18 -0
  305. package/node_modules/@mytools/fst-platform/node_modules/undici/types/webidl.d.ts +347 -0
  306. package/node_modules/@mytools/fst-platform/node_modules/undici/types/websocket.d.ts +188 -0
  307. package/node_modules/@mytools/fst-platform/package.json +4 -3
  308. package/node_modules/@mytools/fst-platform/src/process.js +15 -8
  309. package/node_modules/@mytools/fst-platform/src/shell.js +103 -0
  310. package/node_modules/@mytools/fst-plugin/package.json +1 -1
  311. package/node_modules/@mytools/fst-plugin/src/contracts.js +6 -2
  312. package/node_modules/@mytools/fst-plugin/src/host.js +31 -23
  313. package/node_modules/@mytools/fst-workflow/package.json +1 -1
  314. package/node_modules/@mytools/fst-workflow/src/engine.js +1 -1
  315. package/node_modules/@mytools/fst-workspace/README.md +5 -0
  316. package/node_modules/@mytools/fst-workspace/package.json +3 -1
  317. package/node_modules/@mytools/fst-workspace/src/plugin-registry.js +58 -0
  318. package/node_modules/@mytools/fst-workspace/src/plugins.js +7 -4
  319. package/node_modules/@mytools/fst-workspace/src/shortcuts.js +119 -0
  320. package/node_modules/@mytools/fst-workspace/src/workflows.js +5 -3
  321. package/node_modules/@mytools/pack/index.js +1 -1
  322. package/node_modules/@mytools/pack/package.json +3 -3
  323. package/node_modules/@mytools/pack/runtime-cache.js +26 -0
  324. package/node_modules/@mytools/pack/runtime.js +6 -10
  325. package/node_modules/@mytools/web/public/THIRD_PARTY_NOTICES.txt +1246 -1232
  326. package/node_modules/@npmcli/agent/lib/agents.js +0 -10
  327. package/node_modules/@npmcli/agent/package.json +12 -11
  328. package/node_modules/@npmcli/arborist/README.md +2 -2
  329. package/node_modules/@npmcli/arborist/bin/index.js +2 -1
  330. package/node_modules/@npmcli/arborist/bin/shrinkwrap.js +7 -0
  331. package/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js +25 -159
  332. package/node_modules/@npmcli/arborist/lib/arborist/isolated-reifier.js +49 -11
  333. package/node_modules/@npmcli/arborist/lib/arborist/load-actual.js +0 -67
  334. package/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js +37 -5
  335. package/node_modules/@npmcli/arborist/lib/arborist/rebuild.js +8 -15
  336. package/node_modules/@npmcli/arborist/lib/arborist/reify.js +42 -59
  337. package/node_modules/@npmcli/arborist/lib/consistent-resolve.js +1 -1
  338. package/node_modules/@npmcli/arborist/lib/diff.js +22 -17
  339. package/node_modules/@npmcli/arborist/lib/edge.js +2 -22
  340. package/node_modules/@npmcli/arborist/lib/index.js +0 -2
  341. package/node_modules/@npmcli/arborist/lib/isolated-classes.js +1 -4
  342. package/node_modules/@npmcli/arborist/lib/node.js +9 -13
  343. package/node_modules/@npmcli/arborist/lib/place-dep.js +0 -6
  344. package/node_modules/@npmcli/arborist/lib/printable.js +5 -0
  345. package/node_modules/@npmcli/arborist/lib/shrinkwrap.js +32 -55
  346. package/node_modules/@npmcli/arborist/package.json +26 -32
  347. package/node_modules/@npmcli/fs/lib/move-file.js +5 -5
  348. package/node_modules/@npmcli/fs/package.json +5 -5
  349. package/node_modules/@npmcli/git/package.json +12 -13
  350. package/node_modules/@npmcli/installed-package-contents/package.json +7 -7
  351. package/node_modules/@npmcli/map-workspaces/package.json +7 -7
  352. package/node_modules/@npmcli/metavuln-calculator/package.json +16 -10
  353. package/node_modules/@npmcli/name-from-folder/package.json +16 -13
  354. package/node_modules/@npmcli/node-gyp/package.json +5 -5
  355. package/node_modules/@npmcli/package-json/lib/index.js +1 -2
  356. package/node_modules/@npmcli/package-json/lib/normalize.js +22 -23
  357. package/node_modules/@npmcli/package-json/package.json +10 -11
  358. package/node_modules/@npmcli/promise-spawn/README.md +2 -1
  359. package/node_modules/@npmcli/promise-spawn/package.json +5 -5
  360. package/node_modules/@npmcli/redact/package.json +4 -4
  361. package/node_modules/@npmcli/run-script/lib/is-server-package.js +11 -0
  362. package/node_modules/@npmcli/run-script/lib/make-spawn-args.js +6 -5
  363. package/node_modules/@npmcli/run-script/lib/run-script-pkg.js +13 -4
  364. package/node_modules/@npmcli/run-script/lib/run-script.js +2 -1
  365. package/node_modules/@npmcli/run-script/package.json +11 -12
  366. package/node_modules/@sigstore/bundle/README.md +1 -1
  367. package/node_modules/@sigstore/bundle/dist/error.js +0 -1
  368. package/node_modules/@sigstore/bundle/package.json +2 -2
  369. package/node_modules/@sigstore/core/README.md +1 -1
  370. package/node_modules/@sigstore/core/dist/asn1/length.js +1 -12
  371. package/node_modules/@sigstore/core/dist/asn1/obj.js +7 -25
  372. package/node_modules/@sigstore/core/dist/asn1/parse.js +5 -24
  373. package/node_modules/@sigstore/core/package.json +2 -2
  374. package/node_modules/@sigstore/sign/README.md +1 -1
  375. package/node_modules/@sigstore/sign/dist/signer/fulcio/ephemeral.js +1 -1
  376. package/node_modules/@sigstore/sign/package.json +9 -9
  377. package/node_modules/@sigstore/tuf/README.md +1 -1
  378. package/node_modules/@sigstore/tuf/package.json +4 -4
  379. package/node_modules/@sigstore/tuf/seeds.json +1 -1
  380. package/node_modules/@sigstore/verify/README.md +1 -1
  381. package/node_modules/@sigstore/verify/dist/bundle/dsse.d.ts +0 -1
  382. package/node_modules/@sigstore/verify/dist/bundle/dsse.js +0 -6
  383. package/node_modules/@sigstore/verify/dist/bundle/message.d.ts +0 -1
  384. package/node_modules/@sigstore/verify/dist/bundle/message.js +0 -5
  385. package/node_modules/@sigstore/verify/dist/policy.d.ts +1 -1
  386. package/node_modules/@sigstore/verify/dist/policy.js +2 -0
  387. package/node_modules/@sigstore/verify/dist/shared.types.d.ts +1 -6
  388. package/node_modules/@sigstore/verify/dist/tlog/checkpoint.js +3 -17
  389. package/node_modules/@sigstore/verify/dist/tlog/hashedrekord.js +4 -4
  390. package/node_modules/@sigstore/verify/dist/tlog/index.js +1 -13
  391. package/node_modules/@sigstore/verify/dist/tlog/merkle.js +1 -12
  392. package/node_modules/@sigstore/verify/dist/verifier.js +5 -13
  393. package/node_modules/@sigstore/verify/package.json +5 -5
  394. package/node_modules/@tufjs/models/package.json +3 -3
  395. package/node_modules/abbrev/package.json +8 -9
  396. package/node_modules/agent-base/dist/helpers.d.ts +5 -0
  397. package/node_modules/agent-base/dist/helpers.d.ts.map +1 -1
  398. package/node_modules/agent-base/dist/helpers.js +34 -5
  399. package/node_modules/agent-base/dist/helpers.js.map +1 -1
  400. package/node_modules/agent-base/dist/index.d.ts +5 -1
  401. package/node_modules/agent-base/dist/index.d.ts.map +1 -1
  402. package/node_modules/agent-base/dist/index.js +40 -8
  403. package/node_modules/agent-base/dist/index.js.map +1 -1
  404. package/node_modules/agent-base/package.json +12 -12
  405. package/node_modules/bin-links/README.md +4 -5
  406. package/node_modules/bin-links/lib/fix-bin.js +1 -3
  407. package/node_modules/bin-links/lib/index.js +16 -8
  408. package/node_modules/bin-links/lib/link-mans.js +53 -0
  409. package/node_modules/bin-links/package.json +12 -11
  410. package/node_modules/cacache/lib/content/write.js +0 -2
  411. package/node_modules/cacache/lib/entry-index.js +0 -3
  412. package/node_modules/cacache/lib/rm.js +0 -1
  413. package/node_modules/cacache/lib/util/tmp.js +1 -5
  414. package/node_modules/cacache/lib/verify.js +2 -2
  415. package/node_modules/cacache/package.json +7 -7
  416. package/node_modules/cmd-shim/lib/index.js +32 -67
  417. package/node_modules/cmd-shim/package.json +5 -5
  418. package/node_modules/hosted-git-info/README.md +1 -1
  419. package/node_modules/hosted-git-info/lib/parse-url.js +3 -1
  420. package/node_modules/hosted-git-info/package.json +4 -4
  421. package/node_modules/http-proxy-agent/dist/index.d.ts +5 -8
  422. package/node_modules/http-proxy-agent/dist/index.d.ts.map +1 -1
  423. package/node_modules/http-proxy-agent/dist/index.js +42 -26
  424. package/node_modules/http-proxy-agent/dist/index.js.map +1 -1
  425. package/node_modules/http-proxy-agent/package.json +14 -15
  426. package/node_modules/https-proxy-agent/dist/index.d.ts +5 -9
  427. package/node_modules/https-proxy-agent/dist/index.d.ts.map +1 -1
  428. package/node_modules/https-proxy-agent/dist/index.js +44 -98
  429. package/node_modules/https-proxy-agent/dist/index.js.map +1 -1
  430. package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +3 -0
  431. package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map +1 -1
  432. package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +10 -3
  433. package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -1
  434. package/node_modules/https-proxy-agent/package.json +15 -16
  435. package/node_modules/ignore-walk/package.json +4 -4
  436. package/node_modules/ini/package.json +5 -5
  437. package/node_modules/ip-address/README.md +70 -70
  438. package/node_modules/ip-address/dist/ipv6.js +7 -4
  439. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  440. package/node_modules/ip-address/dist/v6/constants.d.ts +3 -0
  441. package/node_modules/ip-address/dist/v6/constants.js +3 -0
  442. package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  443. package/node_modules/ip-address/package.json +2 -1
  444. package/node_modules/json-parse-even-better-errors/lib/index.js +1 -3
  445. package/node_modules/json-parse-even-better-errors/package.json +17 -13
  446. package/node_modules/make-fetch-happen/package.json +11 -11
  447. package/node_modules/minipass-fetch/package.json +4 -4
  448. package/node_modules/node-gyp/.release-please-manifest.json +1 -1
  449. package/node_modules/node-gyp/CHANGELOG.md +0 -102
  450. package/node_modules/node-gyp/README.md +2 -3
  451. package/node_modules/node-gyp/eslint.config.js +1 -4
  452. package/node_modules/node-gyp/gyp/.release-please-manifest.json +1 -1
  453. package/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +19 -14
  454. package/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +2 -7
  455. package/node_modules/node-gyp/gyp/pyproject.toml +1 -1
  456. package/node_modules/node-gyp/lib/build.js +6 -18
  457. package/node_modules/node-gyp/lib/create-config-gypi.js +0 -5
  458. package/node_modules/node-gyp/lib/node-gyp.js +2 -9
  459. package/node_modules/node-gyp/lib/rebuild.js +3 -3
  460. package/node_modules/node-gyp/package.json +9 -11
  461. package/node_modules/nopt/README.md +4 -2
  462. package/node_modules/nopt/lib/debug.js +5 -0
  463. package/node_modules/nopt/lib/nopt-lib.js +43 -7
  464. package/node_modules/nopt/lib/nopt.js +4 -2
  465. package/node_modules/nopt/lib/type-defs.js +13 -8
  466. package/node_modules/nopt/package.json +17 -15
  467. package/node_modules/npm-bundled/package.json +6 -6
  468. package/node_modules/npm-install-checks/package.json +5 -5
  469. package/node_modules/npm-normalize-package-bin/package.json +16 -13
  470. package/node_modules/npm-package-arg/package.json +7 -7
  471. package/node_modules/npm-packlist/README.md +30 -45
  472. package/node_modules/npm-packlist/lib/index.js +47 -115
  473. package/node_modules/npm-packlist/package.json +8 -10
  474. package/node_modules/npm-pick-manifest/package.json +19 -15
  475. package/node_modules/npm-registry-fetch/lib/errors.js +3 -8
  476. package/node_modules/npm-registry-fetch/package.json +12 -12
  477. package/node_modules/pacote/lib/dir.js +5 -60
  478. package/node_modules/pacote/lib/fetcher.js +0 -4
  479. package/node_modules/pacote/lib/git.js +3 -11
  480. package/node_modules/pacote/lib/util/add-git-sha.js +1 -1
  481. package/node_modules/pacote/package.json +18 -19
  482. package/node_modules/parse-conflict-json/package.json +6 -6
  483. package/node_modules/proc-log/package.json +4 -4
  484. package/node_modules/read-cmd-shim/lib/index.js +1 -1
  485. package/node_modules/read-cmd-shim/package.json +18 -14
  486. package/node_modules/sigstore/README.md +1 -1
  487. package/node_modules/sigstore/package.json +10 -10
  488. package/node_modules/socks-proxy-agent/dist/index.d.ts +3 -1
  489. package/node_modules/socks-proxy-agent/dist/index.d.ts.map +1 -1
  490. package/node_modules/socks-proxy-agent/dist/index.js +43 -17
  491. package/node_modules/socks-proxy-agent/dist/index.js.map +1 -1
  492. package/node_modules/socks-proxy-agent/package.json +15 -15
  493. package/node_modules/ssri/package.json +4 -4
  494. package/node_modules/tuf-js/dist/config.d.ts +2 -2
  495. package/node_modules/tuf-js/dist/fetcher.d.ts +4 -4
  496. package/node_modules/tuf-js/dist/fetcher.js +16 -55
  497. package/node_modules/tuf-js/dist/updater.js +2 -2
  498. package/node_modules/tuf-js/package.json +8 -8
  499. package/node_modules/undici/README.md +72 -405
  500. package/node_modules/undici/docs/docs/api/Agent.md +41 -252
  501. package/node_modules/undici/docs/docs/api/BalancedPool.md +48 -246
  502. package/node_modules/undici/docs/docs/api/CacheStorage.md +13 -171
  503. package/node_modules/undici/docs/docs/api/Client.md +139 -395
  504. package/node_modules/undici/docs/docs/api/Connector.md +35 -118
  505. package/node_modules/undici/docs/docs/api/ContentType.md +25 -65
  506. package/node_modules/undici/docs/docs/api/Cookies.md +47 -125
  507. package/node_modules/undici/docs/docs/api/Debug.md +31 -47
  508. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +97 -409
  509. package/node_modules/undici/docs/docs/api/DispatchInterceptor.md +60 -0
  510. package/node_modules/undici/docs/docs/api/Dispatcher.md +1011 -500
  511. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +96 -105
  512. package/node_modules/undici/docs/docs/api/Errors.md +28 -528
  513. package/node_modules/undici/docs/docs/api/EventSource.md +13 -326
  514. package/node_modules/undici/docs/docs/api/Fetch.md +24 -693
  515. package/node_modules/undici/docs/docs/api/MockAgent.md +264 -346
  516. package/node_modules/undici/docs/docs/api/MockClient.md +31 -153
  517. package/node_modules/undici/docs/docs/api/MockErrors.md +5 -56
  518. package/node_modules/undici/docs/docs/api/MockPool.md +253 -324
  519. package/node_modules/undici/docs/docs/api/Pool.md +41 -235
  520. package/node_modules/undici/docs/docs/api/PoolStats.md +13 -119
  521. package/node_modules/undici/docs/docs/api/ProxyAgent.md +81 -198
  522. package/node_modules/undici/docs/docs/api/RedirectHandler.md +58 -238
  523. package/node_modules/undici/docs/docs/api/RetryAgent.md +28 -119
  524. package/node_modules/undici/docs/docs/api/RetryHandler.md +78 -161
  525. package/node_modules/undici/docs/docs/api/Util.md +11 -68
  526. package/node_modules/undici/docs/docs/api/WebSocket.md +24 -509
  527. package/node_modules/undici/docs/docs/api/api-lifecycle.md +33 -101
  528. package/node_modules/undici/docs/docs/best-practices/client-certificate.md +0 -2
  529. package/node_modules/undici/docs/docs/best-practices/mocking-request.md +2 -58
  530. package/node_modules/undici/docs/docs/best-practices/proxy.md +1 -3
  531. package/node_modules/undici/docs/docs/best-practices/writing-tests.md +0 -45
  532. package/node_modules/undici/index-fetch.js +4 -34
  533. package/node_modules/undici/index.d.ts +1 -1
  534. package/node_modules/undici/index.js +20 -87
  535. package/node_modules/undici/lib/api/abort-signal.js +0 -2
  536. package/node_modules/undici/lib/api/api-connect.js +11 -15
  537. package/node_modules/undici/lib/api/api-pipeline.js +19 -33
  538. package/node_modules/undici/lib/api/api-request.js +59 -89
  539. package/node_modules/undici/lib/api/api-stream.js +64 -114
  540. package/node_modules/undici/lib/api/api-upgrade.js +13 -26
  541. package/node_modules/undici/lib/api/readable.js +87 -317
  542. package/node_modules/undici/lib/api/util.js +93 -0
  543. package/node_modules/undici/lib/core/connect.js +125 -77
  544. package/node_modules/undici/lib/core/constants.js +9 -11
  545. package/node_modules/undici/lib/core/diagnostics.js +129 -154
  546. package/node_modules/undici/lib/core/errors.js +50 -122
  547. package/node_modules/undici/lib/core/request.js +87 -172
  548. package/node_modules/undici/lib/core/symbols.js +2 -14
  549. package/node_modules/undici/lib/core/tree.js +2 -10
  550. package/node_modules/undici/lib/core/util.js +190 -481
  551. package/node_modules/undici/lib/dispatcher/agent.js +35 -83
  552. package/node_modules/undici/lib/dispatcher/balanced-pool.js +38 -46
  553. package/node_modules/undici/lib/dispatcher/client-h1.js +199 -492
  554. package/node_modules/undici/lib/dispatcher/client-h2.js +380 -1409
  555. package/node_modules/undici/lib/dispatcher/client.js +130 -253
  556. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +52 -50
  557. package/node_modules/undici/lib/dispatcher/dispatcher.js +24 -17
  558. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +45 -75
  559. package/node_modules/undici/lib/dispatcher/fixed-queue.js +50 -68
  560. package/node_modules/undici/lib/dispatcher/pool-base.js +54 -153
  561. package/node_modules/undici/lib/dispatcher/pool-stats.js +34 -0
  562. package/node_modules/undici/lib/dispatcher/pool.js +16 -135
  563. package/node_modules/undici/lib/dispatcher/proxy-agent.js +41 -175
  564. package/node_modules/undici/lib/dispatcher/retry-agent.js +0 -3
  565. package/node_modules/undici/lib/global.js +9 -59
  566. package/node_modules/undici/lib/handler/decorator-handler.js +15 -43
  567. package/node_modules/undici/lib/handler/redirect-handler.js +116 -127
  568. package/node_modules/undici/lib/handler/retry-handler.js +182 -398
  569. package/node_modules/undici/lib/interceptor/dns.js +47 -254
  570. package/node_modules/undici/lib/interceptor/dump.js +56 -32
  571. package/node_modules/undici/lib/interceptor/redirect-interceptor.js +21 -0
  572. package/node_modules/undici/lib/interceptor/redirect.js +14 -11
  573. package/node_modules/undici/lib/interceptor/response-error.js +22 -31
  574. package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
  575. package/node_modules/undici/lib/llhttp/constants.js +193 -446
  576. package/node_modules/undici/lib/llhttp/llhttp-wasm.js +1 -11
  577. package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +1 -11
  578. package/node_modules/undici/lib/llhttp/utils.js +12 -9
  579. package/node_modules/undici/lib/mock/mock-agent.js +22 -106
  580. package/node_modules/undici/lib/mock/mock-client.js +4 -13
  581. package/node_modules/undici/lib/mock/mock-errors.js +2 -3
  582. package/node_modules/undici/lib/mock/mock-interceptor.js +13 -33
  583. package/node_modules/undici/lib/mock/mock-pool.js +4 -13
  584. package/node_modules/undici/lib/mock/mock-symbols.js +1 -10
  585. package/node_modules/undici/lib/mock/mock-utils.js +51 -404
  586. package/node_modules/undici/lib/mock/pluralizer.js +29 -0
  587. package/node_modules/undici/lib/util/timers.js +9 -11
  588. package/node_modules/undici/lib/web/cache/cache.js +51 -63
  589. package/node_modules/undici/lib/web/cache/cachestorage.js +7 -13
  590. package/node_modules/undici/lib/web/cache/symbols.js +5 -0
  591. package/node_modules/undici/lib/web/cookies/index.js +18 -45
  592. package/node_modules/undici/lib/web/cookies/parse.js +149 -157
  593. package/node_modules/undici/lib/web/cookies/util.js +2 -4
  594. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +9 -37
  595. package/node_modules/undici/lib/web/eventsource/eventsource.js +64 -108
  596. package/node_modules/undici/lib/web/eventsource/util.js +5 -28
  597. package/node_modules/undici/lib/web/fetch/body.js +148 -173
  598. package/node_modules/undici/lib/web/fetch/constants.js +6 -13
  599. package/node_modules/undici/lib/web/fetch/data-url.js +167 -19
  600. package/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +46 -0
  601. package/node_modules/undici/lib/web/fetch/file.js +126 -0
  602. package/node_modules/undici/lib/web/fetch/formdata-parser.js +117 -229
  603. package/node_modules/undici/lib/web/fetch/formdata.js +65 -85
  604. package/node_modules/undici/lib/web/fetch/headers.js +108 -143
  605. package/node_modules/undici/lib/web/fetch/index.js +446 -627
  606. package/node_modules/undici/lib/web/fetch/request.js +115 -217
  607. package/node_modules/undici/lib/web/fetch/response.js +82 -110
  608. package/node_modules/undici/lib/web/fetch/symbols.js +9 -0
  609. package/node_modules/undici/lib/web/fetch/util.js +393 -291
  610. package/node_modules/undici/lib/web/fetch/webidl.js +695 -0
  611. package/node_modules/undici/lib/web/fileapi/encoding.js +290 -0
  612. package/node_modules/undici/lib/web/fileapi/filereader.js +344 -0
  613. package/node_modules/undici/lib/web/fileapi/progressevent.js +78 -0
  614. package/node_modules/undici/lib/web/fileapi/symbols.js +10 -0
  615. package/node_modules/undici/lib/web/fileapi/util.js +391 -0
  616. package/node_modules/undici/lib/web/websocket/connection.js +160 -139
  617. package/node_modules/undici/lib/web/websocket/constants.js +10 -70
  618. package/node_modules/undici/lib/web/websocket/events.js +30 -49
  619. package/node_modules/undici/lib/web/websocket/frame.js +20 -51
  620. package/node_modules/undici/lib/web/websocket/receiver.js +87 -83
  621. package/node_modules/undici/lib/web/websocket/sender.js +13 -18
  622. package/node_modules/undici/lib/web/websocket/symbols.js +12 -0
  623. package/node_modules/undici/lib/web/websocket/util.js +90 -115
  624. package/node_modules/undici/lib/web/websocket/websocket.js +171 -359
  625. package/node_modules/undici/package.json +57 -49
  626. package/node_modules/undici/scripts/strip-comments.js +1 -3
  627. package/node_modules/undici/types/agent.d.ts +13 -12
  628. package/node_modules/undici/types/api.d.ts +26 -26
  629. package/node_modules/undici/types/balanced-pool.d.ts +12 -13
  630. package/node_modules/undici/types/client.d.ts +39 -98
  631. package/node_modules/undici/types/connector.d.ts +2 -5
  632. package/node_modules/undici/types/cookies.d.ts +1 -3
  633. package/node_modules/undici/types/diagnostics-channel.d.ts +11 -20
  634. package/node_modules/undici/types/dispatcher.d.ts +139 -136
  635. package/node_modules/undici/types/env-http-proxy-agent.d.ts +3 -4
  636. package/node_modules/undici/types/errors.d.ts +54 -86
  637. package/node_modules/undici/types/eventsource.d.ts +4 -9
  638. package/node_modules/undici/types/fetch.d.ts +25 -51
  639. package/node_modules/undici/types/file.d.ts +39 -0
  640. package/node_modules/undici/types/filereader.d.ts +54 -0
  641. package/node_modules/undici/types/formdata.d.ts +7 -7
  642. package/node_modules/undici/types/global-dispatcher.d.ts +4 -4
  643. package/node_modules/undici/types/global-origin.d.ts +5 -5
  644. package/node_modules/undici/types/handlers.d.ts +9 -10
  645. package/node_modules/undici/types/header.d.ts +1 -162
  646. package/node_modules/undici/types/index.d.ts +47 -69
  647. package/node_modules/undici/types/interceptors.d.ts +12 -62
  648. package/node_modules/undici/types/mock-agent.d.ts +27 -46
  649. package/node_modules/undici/types/mock-client.d.ts +4 -6
  650. package/node_modules/undici/types/mock-errors.d.ts +3 -3
  651. package/node_modules/undici/types/mock-interceptor.d.ts +21 -26
  652. package/node_modules/undici/types/mock-pool.d.ts +4 -6
  653. package/node_modules/undici/types/patch.d.ts +4 -0
  654. package/node_modules/undici/types/pool-stats.d.ts +8 -8
  655. package/node_modules/undici/types/pool.d.ts +14 -14
  656. package/node_modules/undici/types/proxy-agent.d.ts +6 -13
  657. package/node_modules/undici/types/readable.d.ts +16 -19
  658. package/node_modules/undici/types/retry-agent.d.ts +1 -1
  659. package/node_modules/undici/types/retry-handler.d.ts +9 -18
  660. package/node_modules/undici/types/util.d.ts +3 -3
  661. package/node_modules/undici/types/webidl.d.ts +32 -156
  662. package/node_modules/undici/types/websocket.d.ts +10 -48
  663. package/node_modules/validate-npm-package-name/package.json +4 -4
  664. package/node_modules/which/package.json +4 -4
  665. package/node_modules/write-file-atomic/package.json +4 -4
  666. package/package.json +58 -60
  667. package/node_modules/@npmcli/arborist/lib/npm-extension.js +0 -237
  668. package/node_modules/@npmcli/arborist/lib/package-extensions.js +0 -236
  669. package/node_modules/@npmcli/arborist/lib/patch.js +0 -111
  670. package/node_modules/@npmcli/arborist/lib/patched-dependencies.js +0 -168
  671. package/node_modules/cacache/lib/util/cache-dir.js +0 -29
  672. package/node_modules/diff/CONTRIBUTING.md +0 -28
  673. package/node_modules/diff/LICENSE +0 -29
  674. package/node_modules/diff/README.md +0 -388
  675. package/node_modules/diff/dist/diff.js +0 -1782
  676. package/node_modules/diff/dist/diff.min.js +0 -1
  677. package/node_modules/diff/eslint.config.mjs +0 -182
  678. package/node_modules/diff/libcjs/convert/dmp.d.ts +0 -8
  679. package/node_modules/diff/libcjs/convert/dmp.d.ts.map +0 -1
  680. package/node_modules/diff/libcjs/convert/dmp.js +0 -24
  681. package/node_modules/diff/libcjs/convert/xml.d.ts +0 -6
  682. package/node_modules/diff/libcjs/convert/xml.d.ts.map +0 -1
  683. package/node_modules/diff/libcjs/convert/xml.js +0 -34
  684. package/node_modules/diff/libcjs/diff/array.d.ts +0 -19
  685. package/node_modules/diff/libcjs/diff/array.d.ts.map +0 -1
  686. package/node_modules/diff/libcjs/diff/array.js +0 -40
  687. package/node_modules/diff/libcjs/diff/base.d.ts +0 -20
  688. package/node_modules/diff/libcjs/diff/base.d.ts.map +0 -1
  689. package/node_modules/diff/libcjs/diff/base.js +0 -265
  690. package/node_modules/diff/libcjs/diff/character.d.ts +0 -19
  691. package/node_modules/diff/libcjs/diff/character.d.ts.map +0 -1
  692. package/node_modules/diff/libcjs/diff/character.js +0 -31
  693. package/node_modules/diff/libcjs/diff/css.d.ts +0 -18
  694. package/node_modules/diff/libcjs/diff/css.d.ts.map +0 -1
  695. package/node_modules/diff/libcjs/diff/css.js +0 -34
  696. package/node_modules/diff/libcjs/diff/json.d.ts +0 -24
  697. package/node_modules/diff/libcjs/diff/json.d.ts.map +0 -1
  698. package/node_modules/diff/libcjs/diff/json.js +0 -105
  699. package/node_modules/diff/libcjs/diff/line.d.ts +0 -24
  700. package/node_modules/diff/libcjs/diff/line.d.ts.map +0 -1
  701. package/node_modules/diff/libcjs/diff/line.js +0 -89
  702. package/node_modules/diff/libcjs/diff/sentence.d.ts +0 -21
  703. package/node_modules/diff/libcjs/diff/sentence.d.ts.map +0 -1
  704. package/node_modules/diff/libcjs/diff/sentence.js +0 -67
  705. package/node_modules/diff/libcjs/diff/word.d.ts +0 -35
  706. package/node_modules/diff/libcjs/diff/word.d.ts.map +0 -1
  707. package/node_modules/diff/libcjs/diff/word.js +0 -312
  708. package/node_modules/diff/libcjs/index.d.ts +0 -20
  709. package/node_modules/diff/libcjs/index.d.ts.map +0 -1
  710. package/node_modules/diff/libcjs/index.js +0 -64
  711. package/node_modules/diff/libcjs/package.json +0 -1
  712. package/node_modules/diff/libcjs/patch/apply.d.ts +0 -62
  713. package/node_modules/diff/libcjs/patch/apply.d.ts.map +0 -1
  714. package/node_modules/diff/libcjs/patch/apply.js +0 -267
  715. package/node_modules/diff/libcjs/patch/create.d.ts +0 -122
  716. package/node_modules/diff/libcjs/patch/create.d.ts.map +0 -1
  717. package/node_modules/diff/libcjs/patch/create.js +0 -251
  718. package/node_modules/diff/libcjs/patch/line-endings.d.ts +0 -17
  719. package/node_modules/diff/libcjs/patch/line-endings.d.ts.map +0 -1
  720. package/node_modules/diff/libcjs/patch/line-endings.js +0 -61
  721. package/node_modules/diff/libcjs/patch/parse.d.ts +0 -8
  722. package/node_modules/diff/libcjs/patch/parse.d.ts.map +0 -1
  723. package/node_modules/diff/libcjs/patch/parse.js +0 -150
  724. package/node_modules/diff/libcjs/patch/reverse.d.ts +0 -9
  725. package/node_modules/diff/libcjs/patch/reverse.d.ts.map +0 -1
  726. package/node_modules/diff/libcjs/patch/reverse.js +0 -37
  727. package/node_modules/diff/libcjs/types.d.ts +0 -213
  728. package/node_modules/diff/libcjs/types.d.ts.map +0 -1
  729. package/node_modules/diff/libcjs/types.js +0 -2
  730. package/node_modules/diff/libcjs/util/array.d.ts +0 -3
  731. package/node_modules/diff/libcjs/util/array.d.ts.map +0 -1
  732. package/node_modules/diff/libcjs/util/array.js +0 -21
  733. package/node_modules/diff/libcjs/util/distance-iterator.d.ts +0 -2
  734. package/node_modules/diff/libcjs/util/distance-iterator.d.ts.map +0 -1
  735. package/node_modules/diff/libcjs/util/distance-iterator.js +0 -40
  736. package/node_modules/diff/libcjs/util/params.d.ts +0 -4
  737. package/node_modules/diff/libcjs/util/params.d.ts.map +0 -1
  738. package/node_modules/diff/libcjs/util/params.js +0 -17
  739. package/node_modules/diff/libcjs/util/string.d.ts +0 -30
  740. package/node_modules/diff/libcjs/util/string.d.ts.map +0 -1
  741. package/node_modules/diff/libcjs/util/string.js +0 -200
  742. package/node_modules/diff/libesm/convert/dmp.d.ts +0 -8
  743. package/node_modules/diff/libesm/convert/dmp.d.ts.map +0 -1
  744. package/node_modules/diff/libesm/convert/dmp.js +0 -21
  745. package/node_modules/diff/libesm/convert/xml.d.ts +0 -6
  746. package/node_modules/diff/libesm/convert/xml.d.ts.map +0 -1
  747. package/node_modules/diff/libesm/convert/xml.js +0 -31
  748. package/node_modules/diff/libesm/diff/array.d.ts +0 -19
  749. package/node_modules/diff/libesm/diff/array.d.ts.map +0 -1
  750. package/node_modules/diff/libesm/diff/array.js +0 -16
  751. package/node_modules/diff/libesm/diff/base.d.ts +0 -20
  752. package/node_modules/diff/libesm/diff/base.d.ts.map +0 -1
  753. package/node_modules/diff/libesm/diff/base.js +0 -253
  754. package/node_modules/diff/libesm/diff/character.d.ts +0 -19
  755. package/node_modules/diff/libesm/diff/character.d.ts.map +0 -1
  756. package/node_modules/diff/libesm/diff/character.js +0 -7
  757. package/node_modules/diff/libesm/diff/css.d.ts +0 -18
  758. package/node_modules/diff/libesm/diff/css.d.ts.map +0 -1
  759. package/node_modules/diff/libesm/diff/css.js +0 -10
  760. package/node_modules/diff/libesm/diff/json.d.ts +0 -24
  761. package/node_modules/diff/libesm/diff/json.d.ts.map +0 -1
  762. package/node_modules/diff/libesm/diff/json.js +0 -78
  763. package/node_modules/diff/libesm/diff/line.d.ts +0 -24
  764. package/node_modules/diff/libesm/diff/line.d.ts.map +0 -1
  765. package/node_modules/diff/libesm/diff/line.js +0 -65
  766. package/node_modules/diff/libesm/diff/sentence.d.ts +0 -21
  767. package/node_modules/diff/libesm/diff/sentence.d.ts.map +0 -1
  768. package/node_modules/diff/libesm/diff/sentence.js +0 -43
  769. package/node_modules/diff/libesm/diff/word.d.ts +0 -35
  770. package/node_modules/diff/libesm/diff/word.d.ts.map +0 -1
  771. package/node_modules/diff/libesm/diff/word.js +0 -281
  772. package/node_modules/diff/libesm/index.d.ts +0 -20
  773. package/node_modules/diff/libesm/index.d.ts.map +0 -1
  774. package/node_modules/diff/libesm/index.js +0 -30
  775. package/node_modules/diff/libesm/package.json +0 -1
  776. package/node_modules/diff/libesm/patch/apply.d.ts +0 -62
  777. package/node_modules/diff/libesm/patch/apply.d.ts.map +0 -1
  778. package/node_modules/diff/libesm/patch/apply.js +0 -257
  779. package/node_modules/diff/libesm/patch/create.d.ts +0 -122
  780. package/node_modules/diff/libesm/patch/create.d.ts.map +0 -1
  781. package/node_modules/diff/libesm/patch/create.js +0 -228
  782. package/node_modules/diff/libesm/patch/line-endings.d.ts +0 -17
  783. package/node_modules/diff/libesm/patch/line-endings.d.ts.map +0 -1
  784. package/node_modules/diff/libesm/patch/line-endings.js +0 -44
  785. package/node_modules/diff/libesm/patch/parse.d.ts +0 -8
  786. package/node_modules/diff/libesm/patch/parse.d.ts.map +0 -1
  787. package/node_modules/diff/libesm/patch/parse.js +0 -147
  788. package/node_modules/diff/libesm/patch/reverse.d.ts +0 -9
  789. package/node_modules/diff/libesm/patch/reverse.d.ts.map +0 -1
  790. package/node_modules/diff/libesm/patch/reverse.js +0 -23
  791. package/node_modules/diff/libesm/types.d.ts +0 -213
  792. package/node_modules/diff/libesm/types.d.ts.map +0 -1
  793. package/node_modules/diff/libesm/types.js +0 -1
  794. package/node_modules/diff/libesm/util/array.d.ts +0 -3
  795. package/node_modules/diff/libesm/util/array.d.ts.map +0 -1
  796. package/node_modules/diff/libesm/util/array.js +0 -17
  797. package/node_modules/diff/libesm/util/distance-iterator.d.ts +0 -2
  798. package/node_modules/diff/libesm/util/distance-iterator.d.ts.map +0 -1
  799. package/node_modules/diff/libesm/util/distance-iterator.js +0 -37
  800. package/node_modules/diff/libesm/util/params.d.ts +0 -4
  801. package/node_modules/diff/libesm/util/params.d.ts.map +0 -1
  802. package/node_modules/diff/libesm/util/params.js +0 -14
  803. package/node_modules/diff/libesm/util/string.d.ts +0 -30
  804. package/node_modules/diff/libesm/util/string.d.ts.map +0 -1
  805. package/node_modules/diff/libesm/util/string.js +0 -184
  806. package/node_modules/diff/package.json +0 -130
  807. package/node_modules/diff/release-notes.md +0 -432
  808. package/node_modules/node-gyp/commitlint.config.mjs +0 -3
  809. package/node_modules/node-gyp/gyp/commitlint.config.js +0 -6
  810. package/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake_test.py +0 -105
  811. package/node_modules/node-gyp/zizmor.yml +0 -5
  812. package/node_modules/proxy-agent-negotiate/dist/index.d.ts +0 -14
  813. package/node_modules/proxy-agent-negotiate/dist/index.d.ts.map +0 -1
  814. package/node_modules/proxy-agent-negotiate/dist/index.js +0 -35
  815. package/node_modules/proxy-agent-negotiate/dist/index.js.map +0 -1
  816. package/node_modules/proxy-agent-negotiate/package.json +0 -47
  817. package/node_modules/undici/docs/docs/api/CacheStore.md +0 -360
  818. package/node_modules/undici/docs/docs/api/ClientStats.md +0 -93
  819. package/node_modules/undici/docs/docs/api/GlobalInstallation.md +0 -121
  820. package/node_modules/undici/docs/docs/api/H2CClient.md +0 -385
  821. package/node_modules/undici/docs/docs/api/Interceptors.md +0 -419
  822. package/node_modules/undici/docs/docs/api/MockCallHistory.md +0 -371
  823. package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +0 -206
  824. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +0 -239
  825. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +0 -361
  826. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +0 -256
  827. package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +0 -233
  828. package/node_modules/undici/docs/docs/getting-started.md +0 -281
  829. package/node_modules/undici/docs/docs/site.json +0 -125
  830. package/node_modules/undici/docs/docs/type-map.json +0 -79
  831. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +0 -110
  832. package/node_modules/undici/types/dispatcher1-wrapper.d.ts +0 -7
  833. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/core/socks5-client.js +0 -0
  834. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/core/socks5-utils.js +0 -0
  835. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/encoding/index.js +0 -0
  836. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/llhttp/constants.d.ts +0 -0
  837. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/llhttp/utils.d.ts +0 -0
  838. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/mock/snapshot-utils.js +0 -0
  839. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/util/date.js +0 -0
  840. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/util/stats.js +0 -0
  841. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/subresource-integrity/Readme.md +0 -0
  842. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/lib/web/subresource-integrity/subresource-integrity.js +0 -0
  843. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/cache-interceptor.d.ts +0 -0
  844. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/client-stats.d.ts +0 -0
  845. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/mock-call-history.d.ts +0 -0
  846. /package/node_modules/{undici → @mytools/fst-platform/node_modules/undici}/types/utility.d.ts +0 -0
@@ -5,13 +5,16 @@ const { kDestroyed, kBodyUsed, kListeners, kBody } = require('./symbols')
5
5
  const { IncomingMessage } = require('node:http')
6
6
  const stream = require('node:stream')
7
7
  const net = require('node:net')
8
+ const { Blob } = require('node:buffer')
9
+ const nodeUtil = require('node:util')
8
10
  const { stringify } = require('node:querystring')
9
- const { EventEmitter: EE, addAbortListener: addAbortListenerNative } = require('node:events')
10
- const timers = require('../util/timers')
11
- const { InvalidArgumentError, ConnectTimeoutError } = require('./errors')
11
+ const { EventEmitter: EE } = require('node:events')
12
+ const { InvalidArgumentError } = require('./errors')
12
13
  const { headerNameLowerCasedRecord } = require('./constants')
13
14
  const { tree } = require('./tree')
14
15
 
16
+ const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
17
+
15
18
  class BodyAsyncIterable {
16
19
  constructor (body) {
17
20
  this[kBody] = body
@@ -25,12 +28,6 @@ class BodyAsyncIterable {
25
28
  }
26
29
  }
27
30
 
28
- function noop () {}
29
-
30
- /**
31
- * @param {*} body
32
- * @returns {*}
33
- */
34
31
  function wrapRequestBody (body) {
35
32
  if (isStream(body)) {
36
33
  // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
@@ -56,8 +53,6 @@ function wrapRequestBody (body) {
56
53
  // to determine whether or not it has been disturbed. This is just
57
54
  // a workaround.
58
55
  return new BodyAsyncIterable(body)
59
- } else if (body && isFormDataLike(body)) {
60
- return body
61
56
  } else if (
62
57
  body &&
63
58
  typeof body !== 'string' &&
@@ -72,40 +67,32 @@ function wrapRequestBody (body) {
72
67
  }
73
68
  }
74
69
 
75
- /**
76
- * @param {*} obj
77
- * @returns {obj is import('node:stream').Stream}
78
- */
70
+ function nop () {}
71
+
79
72
  function isStream (obj) {
80
73
  return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
81
74
  }
82
75
 
83
- /**
84
- * @param {*} object
85
- * @returns {object is Blob}
86
- */
76
+ // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
87
77
  function isBlobLike (object) {
88
- return object instanceof Blob
89
- }
78
+ if (object === null) {
79
+ return false
80
+ } else if (object instanceof Blob) {
81
+ return true
82
+ } else if (typeof object !== 'object') {
83
+ return false
84
+ } else {
85
+ const sTag = object[Symbol.toStringTag]
90
86
 
91
- /**
92
- * @param {string} url The path to check for query strings or fragments.
93
- * @returns {boolean} Returns true if the path contains a query string or fragment.
94
- */
95
- function pathHasQueryOrFragment (url) {
96
- return (
97
- url.includes('?') ||
98
- url.includes('#')
99
- )
87
+ return (sTag === 'Blob' || sTag === 'File') && (
88
+ ('stream' in object && typeof object.stream === 'function') ||
89
+ ('arrayBuffer' in object && typeof object.arrayBuffer === 'function')
90
+ )
91
+ }
100
92
  }
101
93
 
102
- /**
103
- * @param {string} url The URL to add the query params to
104
- * @param {import('node:querystring').ParsedUrlQueryInput} queryParams The object to serialize into a URL query string
105
- * @returns {string} The URL with the query params added
106
- */
107
- function serializePathWithQuery (url, queryParams) {
108
- if (pathHasQueryOrFragment(url)) {
94
+ function buildURL (url, queryParams) {
95
+ if (url.includes('?') || url.includes('#')) {
109
96
  throw new Error('Query params cannot be passed when url already contains "?" or "#".')
110
97
  }
111
98
 
@@ -118,10 +105,6 @@ function serializePathWithQuery (url, queryParams) {
118
105
  return url
119
106
  }
120
107
 
121
- /**
122
- * @param {number|string|undefined} port
123
- * @returns {boolean}
124
- */
125
108
  function isValidPort (port) {
126
109
  const value = parseInt(port, 10)
127
110
  return (
@@ -131,12 +114,6 @@ function isValidPort (port) {
131
114
  )
132
115
  }
133
116
 
134
- /**
135
- * Check if the value is a valid http or https prefixed string.
136
- *
137
- * @param {string} value
138
- * @returns {boolean}
139
- */
140
117
  function isHttpOrHttpsPrefixed (value) {
141
118
  return (
142
119
  value != null &&
@@ -154,15 +131,8 @@ function isHttpOrHttpsPrefixed (value) {
154
131
  )
155
132
  }
156
133
 
157
- /**
158
- * @param {string|URL|Record<string,string>} url
159
- * @returns {URL}
160
- */
161
134
  function parseURL (url) {
162
135
  if (typeof url === 'string') {
163
- /**
164
- * @type {URL}
165
- */
166
136
  url = new URL(url)
167
137
 
168
138
  if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
@@ -232,10 +202,6 @@ function parseURL (url) {
232
202
  return url
233
203
  }
234
204
 
235
- /**
236
- * @param {string|URL|Record<string, string>} url
237
- * @returns {URL}
238
- */
239
205
  function parseOrigin (url) {
240
206
  url = parseURL(url)
241
207
 
@@ -246,10 +212,6 @@ function parseOrigin (url) {
246
212
  return url
247
213
  }
248
214
 
249
- /**
250
- * @param {string} host
251
- * @returns {string}
252
- */
253
215
  function getHostname (host) {
254
216
  if (host[0] === '[') {
255
217
  const idx = host.indexOf(']')
@@ -264,12 +226,8 @@ function getHostname (host) {
264
226
  return host.substring(0, idx)
265
227
  }
266
228
 
267
- /**
268
- * IP addresses are not valid server names per RFC6066
269
- * Currently, the only server names supported are DNS hostnames
270
- * @param {string|null} host
271
- * @returns {string|null}
272
- */
229
+ // IP addresses are not valid server names per RFC6066
230
+ // > Currently, the only server names supported are DNS hostnames
273
231
  function getServerName (host) {
274
232
  if (!host) {
275
233
  return null
@@ -285,50 +243,18 @@ function getServerName (host) {
285
243
  return servername
286
244
  }
287
245
 
288
- /**
289
- * @function
290
- * @template T
291
- * @param {T} obj
292
- * @returns {T}
293
- */
294
246
  function deepClone (obj) {
295
247
  return JSON.parse(JSON.stringify(obj))
296
248
  }
297
249
 
298
- /**
299
- * @param {*} obj
300
- * @returns {obj is AsyncIterable}
301
- */
302
250
  function isAsyncIterable (obj) {
303
251
  return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
304
252
  }
305
253
 
306
- /**
307
- * @param {*} obj
308
- * @returns {obj is Iterable}
309
- */
310
254
  function isIterable (obj) {
311
255
  return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
312
256
  }
313
257
 
314
- /**
315
- * Checks whether an object has a safe Symbol.iterator — i.e. one that is
316
- * either own or inherited from a non-Object.prototype chain. This prevents
317
- * prototype-pollution attacks from injecting a fake iterator on
318
- * Object.prototype.
319
- * @param {object} obj
320
- * @returns {boolean}
321
- */
322
- function hasSafeIterator (obj) {
323
- const prototype = Object.getPrototypeOf(obj)
324
- const ownIterator = Object.hasOwn(obj, Symbol.iterator)
325
- return ownIterator || (prototype != null && prototype !== Object.prototype && typeof obj[Symbol.iterator] === 'function')
326
- }
327
-
328
- /**
329
- * @param {Blob|Buffer|import ('stream').Stream} body
330
- * @returns {number|null}
331
- */
332
258
  function bodyLength (body) {
333
259
  if (body == null) {
334
260
  return 0
@@ -346,19 +272,10 @@ function bodyLength (body) {
346
272
  return null
347
273
  }
348
274
 
349
- /**
350
- * @param {import ('stream').Stream} body
351
- * @returns {boolean}
352
- */
353
275
  function isDestroyed (body) {
354
276
  return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))
355
277
  }
356
278
 
357
- /**
358
- * @param {import ('stream').Stream} stream
359
- * @param {Error} [err]
360
- * @returns {void}
361
- */
362
279
  function destroy (stream, err) {
363
280
  if (stream == null || !isStream(stream) || isDestroyed(stream)) {
364
281
  return
@@ -370,12 +287,7 @@ function destroy (stream, err) {
370
287
  stream.socket = null
371
288
  }
372
289
 
373
- try {
374
- stream.destroy(err)
375
- } catch {
376
- // stream.destroy may throw on managed sockets (e.g., http2).
377
- // Silently ignore — the socket lifecycle is handled by the subsystem.
378
- }
290
+ stream.destroy(err)
379
291
  } else if (err) {
380
292
  queueMicrotask(() => {
381
293
  stream.emit('error', err)
@@ -388,12 +300,8 @@ function destroy (stream, err) {
388
300
  }
389
301
 
390
302
  const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
391
- /**
392
- * @param {string} val
393
- * @returns {number | null}
394
- */
395
303
  function parseKeepAliveTimeout (val) {
396
- const m = val.match(KEEPALIVE_TIMEOUT_EXPR)
304
+ const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
397
305
  return m ? parseInt(m[1], 10) * 1000 : null
398
306
  }
399
307
 
@@ -418,219 +326,131 @@ function bufferToLowerCasedHeaderName (value) {
418
326
  }
419
327
 
420
328
  /**
421
- * @param {(Buffer | string)[]} headers
329
+ * @param {Record<string, string | string[]> | (Buffer | string | (Buffer | string)[])[]} headers
422
330
  * @param {Record<string, string | string[]>} [obj]
423
331
  * @returns {Record<string, string | string[]>}
424
332
  */
425
333
  function parseHeaders (headers, obj) {
426
334
  if (obj === undefined) obj = {}
427
-
428
335
  for (let i = 0; i < headers.length; i += 2) {
429
336
  const key = headerNameToString(headers[i])
430
337
  let val = obj[key]
431
338
 
432
- if (val !== undefined) {
433
- if (!Object.hasOwn(obj, key)) {
434
- const headersValue = typeof headers[i + 1] === 'string'
435
- ? headers[i + 1]
436
- : Array.isArray(headers[i + 1])
437
- ? headers[i + 1].map(x => x.toString('latin1'))
438
- : headers[i + 1].toString('latin1')
439
-
440
- if (key === '__proto__') {
441
- Object.defineProperty(obj, key, {
442
- value: headersValue,
443
- enumerable: true,
444
- configurable: true,
445
- writable: true
446
- })
447
- } else {
448
- obj[key] = headersValue
449
- }
450
- } else {
451
- if (typeof val === 'string') {
452
- val = [val]
453
- obj[key] = val
454
- }
455
- val.push(headers[i + 1].toString('latin1'))
339
+ if (val) {
340
+ if (typeof val === 'string') {
341
+ val = [val]
342
+ obj[key] = val
456
343
  }
344
+ val.push(headers[i + 1].toString('utf8'))
457
345
  } else {
458
- const headersValue = typeof headers[i + 1] === 'string'
459
- ? headers[i + 1]
460
- : Array.isArray(headers[i + 1])
461
- ? headers[i + 1].map(x => x.toString('latin1'))
462
- : headers[i + 1].toString('latin1')
463
-
464
- obj[key] = headersValue
346
+ const headersValue = headers[i + 1]
347
+ if (typeof headersValue === 'string') {
348
+ obj[key] = headersValue
349
+ } else {
350
+ obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8')
351
+ }
465
352
  }
466
353
  }
467
354
 
355
+ // See https://github.com/nodejs/node/pull/46528
356
+ if ('content-length' in obj && 'content-disposition' in obj) {
357
+ obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
358
+ }
359
+
468
360
  return obj
469
361
  }
470
362
 
471
- /**
472
- * @param {Buffer[] | string[] | Record<string, string | string[]> | null | undefined} headers
473
- * @returns {string[]}
474
- */
475
363
  function parseRawHeaders (headers) {
476
- if (headers == null) {
477
- return []
478
- }
479
-
480
- if (!Array.isArray(headers)) {
481
- const rawHeaders = []
482
-
483
- for (const [name, value] of Object.entries(headers)) {
484
- if (Array.isArray(value)) {
485
- for (const entry of value) {
486
- rawHeaders.push(name, `${entry}`)
487
- }
488
- } else {
489
- rawHeaders.push(name, `${value}`)
490
- }
491
- }
492
-
493
- return rawHeaders
494
- }
495
-
496
- const headersLength = headers.length
497
- /**
498
- * @type {string[]}
499
- */
500
- const ret = new Array(headersLength)
364
+ const len = headers.length
365
+ const ret = new Array(len)
501
366
 
367
+ let hasContentLength = false
368
+ let contentDispositionIdx = -1
502
369
  let key
503
370
  let val
371
+ let kLen = 0
504
372
 
505
- for (let n = 0; n < headersLength; n += 2) {
373
+ for (let n = 0; n < headers.length; n += 2) {
506
374
  key = headers[n]
507
375
  val = headers[n + 1]
508
376
 
509
377
  typeof key !== 'string' && (key = key.toString())
510
- typeof val !== 'string' && (val = val.toString('latin1'))
378
+ typeof val !== 'string' && (val = val.toString('utf8'))
511
379
 
380
+ kLen = key.length
381
+ if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
382
+ hasContentLength = true
383
+ } else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
384
+ contentDispositionIdx = n + 1
385
+ }
512
386
  ret[n] = key
513
387
  ret[n + 1] = val
514
388
  }
515
389
 
516
- return ret
517
- }
518
-
519
- /**
520
- * @param {Record<string, string | string[]>} headers
521
- * @returns {Buffer[]}
522
- */
523
- function toRawHeaders (headers) {
524
- const rawHeaders = []
525
-
526
- for (const [name, value] of Object.entries(headers)) {
527
- if (Array.isArray(value)) {
528
- for (const entry of value) {
529
- rawHeaders.push(Buffer.from(name, 'latin1'), Buffer.from(`${entry}`, 'latin1'))
530
- }
531
- } else {
532
- rawHeaders.push(Buffer.from(name, 'latin1'), Buffer.from(`${value}`, 'latin1'))
533
- }
390
+ // See https://github.com/nodejs/node/pull/46528
391
+ if (hasContentLength && contentDispositionIdx !== -1) {
392
+ ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
534
393
  }
535
394
 
536
- return rawHeaders
537
- }
538
-
539
- /**
540
- * @param {string[]} headers
541
- * @param {Buffer[]} headers
542
- */
543
- function encodeRawHeaders (headers) {
544
- if (!Array.isArray(headers)) {
545
- throw new TypeError('expected headers to be an array')
546
- }
547
- return headers.map(x => Buffer.from(x))
395
+ return ret
548
396
  }
549
397
 
550
- /**
551
- * @param {*} buffer
552
- * @returns {buffer is Buffer}
553
- */
554
398
  function isBuffer (buffer) {
555
399
  // See, https://github.com/mcollina/undici/pull/319
556
400
  return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
557
401
  }
558
402
 
559
- /**
560
- * Asserts that the handler object is a request handler.
561
- *
562
- * @param {object} handler
563
- * @param {string} method
564
- * @param {string} [upgrade]
565
- * @returns {asserts handler is import('../api/api-request').RequestHandler}
566
- */
567
- function assertRequestHandler (handler, method, upgrade) {
403
+ function validateHandler (handler, method, upgrade) {
568
404
  if (!handler || typeof handler !== 'object') {
569
405
  throw new InvalidArgumentError('handler must be an object')
570
406
  }
571
407
 
572
- if (typeof handler.onRequestStart !== 'function') {
573
- throw new InvalidArgumentError('invalid onRequestStart method')
408
+ if (typeof handler.onConnect !== 'function') {
409
+ throw new InvalidArgumentError('invalid onConnect method')
574
410
  }
575
411
 
576
- if (typeof handler.onResponseError !== 'function') {
577
- throw new InvalidArgumentError('invalid onResponseError method')
412
+ if (typeof handler.onError !== 'function') {
413
+ throw new InvalidArgumentError('invalid onError method')
578
414
  }
579
415
 
580
416
  if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
581
417
  throw new InvalidArgumentError('invalid onBodySent method')
582
418
  }
583
419
 
584
- if (typeof handler.onRequestSent !== 'function' && handler.onRequestSent !== undefined) {
585
- throw new InvalidArgumentError('invalid onRequestSent method')
586
- }
587
-
588
420
  if (upgrade || method === 'CONNECT') {
589
- if (typeof handler.onRequestUpgrade !== 'function') {
590
- throw new InvalidArgumentError('invalid onRequestUpgrade method')
421
+ if (typeof handler.onUpgrade !== 'function') {
422
+ throw new InvalidArgumentError('invalid onUpgrade method')
591
423
  }
592
424
  } else {
593
- if (typeof handler.onResponseStart !== 'function') {
594
- throw new InvalidArgumentError('invalid onResponseStart method')
425
+ if (typeof handler.onHeaders !== 'function') {
426
+ throw new InvalidArgumentError('invalid onHeaders method')
595
427
  }
596
428
 
597
- if (typeof handler.onResponseData !== 'function') {
598
- throw new InvalidArgumentError('invalid onResponseData method')
429
+ if (typeof handler.onData !== 'function') {
430
+ throw new InvalidArgumentError('invalid onData method')
599
431
  }
600
432
 
601
- if (typeof handler.onResponseEnd !== 'function') {
602
- throw new InvalidArgumentError('invalid onResponseEnd method')
433
+ if (typeof handler.onComplete !== 'function') {
434
+ throw new InvalidArgumentError('invalid onComplete method')
603
435
  }
604
436
  }
605
437
  }
606
438
 
607
- /**
608
- * A body is disturbed if it has been read from and it cannot be re-used without
609
- * losing state or data.
610
- * @param {import('node:stream').Readable} body
611
- * @returns {boolean}
612
- */
439
+ // A body is disturbed if it has been read from and it cannot
440
+ // be re-used without losing state or data.
613
441
  function isDisturbed (body) {
614
442
  // TODO (fix): Why is body[kBodyUsed] needed?
615
443
  return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))
616
444
  }
617
445
 
618
- /**
619
- * @typedef {object} SocketInfo
620
- * @property {string} [localAddress]
621
- * @property {number} [localPort]
622
- * @property {string} [remoteAddress]
623
- * @property {number} [remotePort]
624
- * @property {string} [remoteFamily]
625
- * @property {number} [timeout]
626
- * @property {number} bytesWritten
627
- * @property {number} bytesRead
628
- */
446
+ function isErrored (body) {
447
+ return !!(body && stream.isErrored(body))
448
+ }
449
+
450
+ function isReadable (body) {
451
+ return !!(body && stream.isReadable(body))
452
+ }
629
453
 
630
- /**
631
- * @param {import('net').Socket} socket
632
- * @returns {SocketInfo}
633
- */
634
454
  function getSocketInfo (socket) {
635
455
  return {
636
456
  localAddress: socket.localAddress,
@@ -644,12 +464,41 @@ function getSocketInfo (socket) {
644
464
  }
645
465
  }
646
466
 
647
- /**
648
- * The object should be a FormData instance and contains all the required
649
- * methods.
650
- * @param {*} object
651
- * @returns {object is FormData}
652
- */
467
+ /** @type {globalThis['ReadableStream']} */
468
+ function ReadableStreamFrom (iterable) {
469
+ // We cannot use ReadableStream.from here because it does not return a byte stream.
470
+
471
+ let iterator
472
+ return new ReadableStream(
473
+ {
474
+ async start () {
475
+ iterator = iterable[Symbol.asyncIterator]()
476
+ },
477
+ async pull (controller) {
478
+ const { done, value } = await iterator.next()
479
+ if (done) {
480
+ queueMicrotask(() => {
481
+ controller.close()
482
+ controller.byobRequest?.respond(0)
483
+ })
484
+ } else {
485
+ const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
486
+ if (buf.byteLength) {
487
+ controller.enqueue(new Uint8Array(buf))
488
+ }
489
+ }
490
+ return controller.desiredSize > 0
491
+ },
492
+ async cancel (reason) {
493
+ await iterator.return()
494
+ },
495
+ type: 'bytes'
496
+ }
497
+ )
498
+ }
499
+
500
+ // The chunk should be a FormData instance and contains
501
+ // all the required methods.
653
502
  function isFormDataLike (object) {
654
503
  return (
655
504
  object &&
@@ -665,58 +514,72 @@ function isFormDataLike (object) {
665
514
  }
666
515
 
667
516
  function addAbortListener (signal, listener) {
668
- if (!signal || 'aborted' in signal) {
669
- return addAbortListenerNative(signal, listener)[Symbol.dispose]
670
- }
671
-
672
- if (typeof signal.addEventListener === 'function') {
517
+ if ('addEventListener' in signal) {
673
518
  signal.addEventListener('abort', listener, { once: true })
674
519
  return () => signal.removeEventListener('abort', listener)
675
520
  }
676
- signal.once('abort', listener)
521
+ signal.addListener('abort', listener)
677
522
  return () => signal.removeListener('abort', listener)
678
523
  }
679
524
 
680
- const validTokenChars = new Uint8Array([
681
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0-15
682
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16-31
683
- 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32-47 (!"#$%&'()*+,-./)
684
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48-63 (0-9:;<=>?)
685
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64-79 (@A-O)
686
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80-95 (P-Z[\]^_)
687
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96-111 (`a-o)
688
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, // 112-127 (p-z{|}~)
689
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 128-143
690
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 144-159
691
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 160-175
692
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 176-191
693
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 192-207
694
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 208-223
695
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 224-239
696
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // 240-255
697
- ])
525
+ const hasToWellFormed = typeof String.prototype.toWellFormed === 'function'
526
+ const hasIsWellFormed = typeof String.prototype.isWellFormed === 'function'
527
+
528
+ /**
529
+ * @param {string} val
530
+ */
531
+ function toUSVString (val) {
532
+ return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val)
533
+ }
534
+
535
+ /**
536
+ * @param {string} val
537
+ */
538
+ // TODO: move this to webidl
539
+ function isUSVString (val) {
540
+ return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`
541
+ }
698
542
 
699
543
  /**
700
544
  * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
701
545
  * @param {number} c
702
- * @returns {boolean}
703
546
  */
704
547
  function isTokenCharCode (c) {
705
- return (validTokenChars[c] === 1)
548
+ switch (c) {
549
+ case 0x22:
550
+ case 0x28:
551
+ case 0x29:
552
+ case 0x2c:
553
+ case 0x2f:
554
+ case 0x3a:
555
+ case 0x3b:
556
+ case 0x3c:
557
+ case 0x3d:
558
+ case 0x3e:
559
+ case 0x3f:
560
+ case 0x40:
561
+ case 0x5b:
562
+ case 0x5c:
563
+ case 0x5d:
564
+ case 0x7b:
565
+ case 0x7d:
566
+ // DQUOTE and "(),/:;<=>?@[\]{}"
567
+ return false
568
+ default:
569
+ // VCHAR %x21-7E
570
+ return c >= 0x21 && c <= 0x7e
571
+ }
706
572
  }
707
573
 
708
- const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
709
-
710
574
  /**
711
575
  * @param {string} characters
712
- * @returns {boolean}
713
576
  */
714
577
  function isValidHTTPToken (characters) {
715
- if (characters.length >= 12) return tokenRegExp.test(characters)
716
- if (characters.length === 0) return false
717
-
718
- for (let i = 0; i < characters.length; i++) {
719
- if (validTokenChars[characters.charCodeAt(i)] !== 1) {
578
+ if (characters.length === 0) {
579
+ return false
580
+ }
581
+ for (let i = 0; i < characters.length; ++i) {
582
+ if (!isTokenCharCode(characters.charCodeAt(i))) {
720
583
  return false
721
584
  }
722
585
  }
@@ -736,48 +599,26 @@ const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
736
599
 
737
600
  /**
738
601
  * @param {string} characters
739
- * @returns {boolean}
740
602
  */
741
603
  function isValidHeaderValue (characters) {
742
604
  return !headerCharRegex.test(characters)
743
605
  }
744
606
 
745
- const rangeHeaderRegex = /^bytes (\d+)-(\d+)\/(\d+|\*)?$/
746
-
747
- /**
748
- * @typedef {object} RangeHeader
749
- * @property {number} start
750
- * @property {number | null} end
751
- * @property {number | null} size
752
- */
753
-
754
- /**
755
- * Parse accordingly to RFC 9110
756
- * @see https://www.rfc-editor.org/rfc/rfc9110#field.content-range
757
- * @param {string} [range]
758
- * @returns {RangeHeader|null}
759
- */
607
+ // Parsed accordingly to RFC 9110
608
+ // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
760
609
  function parseRangeHeader (range) {
761
610
  if (range == null || range === '') return { start: 0, end: null, size: null }
762
- if (!range) return null
763
611
 
764
- const m = rangeHeaderRegex.exec(range)
612
+ const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
765
613
  return m
766
614
  ? {
767
615
  start: parseInt(m[1]),
768
616
  end: m[2] ? parseInt(m[2]) : null,
769
- size: m[3] && m[3] !== '*' ? parseInt(m[3]) : null
617
+ size: m[3] ? parseInt(m[3]) : null
770
618
  }
771
619
  : null
772
620
  }
773
621
 
774
- /**
775
- * @template {import("events").EventEmitter} T
776
- * @param {T} obj
777
- * @param {string} name
778
- * @param {(...args: any[]) => void} listener
779
- * @returns {T}
780
- */
781
622
  function addListener (obj, name, listener) {
782
623
  const listeners = (obj[kListeners] ??= [])
783
624
  listeners.push([name, listener])
@@ -785,156 +626,24 @@ function addListener (obj, name, listener) {
785
626
  return obj
786
627
  }
787
628
 
788
- /**
789
- * @template {import("events").EventEmitter} T
790
- * @param {T} obj
791
- * @returns {T}
792
- */
793
629
  function removeAllListeners (obj) {
794
- if (obj[kListeners] != null) {
795
- for (const [name, listener] of obj[kListeners]) {
796
- obj.removeListener(name, listener)
797
- }
798
- obj[kListeners] = null
630
+ for (const [name, listener] of obj[kListeners] ?? []) {
631
+ obj.removeListener(name, listener)
799
632
  }
800
- return obj
633
+ obj[kListeners] = null
801
634
  }
802
635
 
803
- /**
804
- * @param {import ('../dispatcher/client')} client
805
- * @param {import ('../core/request')} request
806
- * @param {Error} err
807
- */
808
636
  function errorRequest (client, request, err) {
809
637
  try {
810
- request.onResponseError(err)
638
+ request.onError(err)
811
639
  assert(request.aborted)
812
640
  } catch (err) {
813
641
  client.emit('error', err)
814
642
  }
815
643
  }
816
644
 
817
- /**
818
- * @param {WeakRef<net.Socket>} socketWeakRef
819
- * @param {object} opts
820
- * @param {number} opts.timeout
821
- * @param {string} opts.hostname
822
- * @param {number} opts.port
823
- * @returns {() => void}
824
- */
825
- const setupConnectTimeout = process.platform === 'win32'
826
- ? (socketWeakRef, opts) => {
827
- if (!opts.timeout) {
828
- return noop
829
- }
830
-
831
- let s1 = null
832
- let s2 = null
833
- const fastTimer = timers.setFastTimeout(() => {
834
- // setImmediate is added to make sure that we prioritize socket error events over timeouts
835
- s1 = setImmediate(() => {
836
- // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
837
- s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))
838
- })
839
- }, opts.timeout)
840
- return () => {
841
- timers.clearFastTimeout(fastTimer)
842
- clearImmediate(s1)
843
- clearImmediate(s2)
844
- }
845
- }
846
- : (socketWeakRef, opts) => {
847
- if (!opts.timeout) {
848
- return noop
849
- }
850
-
851
- let s1 = null
852
- const fastTimer = timers.setFastTimeout(() => {
853
- // setImmediate is added to make sure that we prioritize socket error events over timeouts
854
- s1 = setImmediate(() => {
855
- onConnectTimeout(socketWeakRef.deref(), opts)
856
- })
857
- }, opts.timeout)
858
- return () => {
859
- timers.clearFastTimeout(fastTimer)
860
- clearImmediate(s1)
861
- }
862
- }
863
-
864
- /**
865
- * @param {net.Socket} socket
866
- * @param {object} opts
867
- * @param {number} opts.timeout
868
- * @param {string} opts.hostname
869
- * @param {number} opts.port
870
- */
871
- function onConnectTimeout (socket, opts) {
872
- // The socket could be already garbage collected
873
- if (socket == null) {
874
- return
875
- }
876
-
877
- let message = 'Connect Timeout Error'
878
- if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {
879
- message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`
880
- } else {
881
- message += ` (attempted address: ${opts.hostname}:${opts.port},`
882
- }
883
-
884
- message += ` timeout: ${opts.timeout}ms)`
885
-
886
- destroy(socket, new ConnectTimeoutError(message))
887
- }
888
-
889
- let lastUrlString = null
890
- let lastProtocol = null
891
-
892
- /**
893
- * @param {string} urlString
894
- * @returns {string}
895
- */
896
- function getProtocolFromUrlString (urlString) {
897
- // Requests are typically dispatched against the same origin over and over,
898
- // so cache the last (urlString, protocol) pair to skip re-parsing.
899
- if (urlString === lastUrlString) {
900
- return lastProtocol
901
- }
902
-
903
- const protocol = getProtocolFromUrlStringSlow(urlString)
904
- lastUrlString = urlString
905
- lastProtocol = protocol
906
-
907
- return protocol
908
- }
909
-
910
- /**
911
- * @param {string} urlString
912
- * @returns {string}
913
- */
914
- function getProtocolFromUrlStringSlow (urlString) {
915
- if (
916
- urlString[0] === 'h' &&
917
- urlString[1] === 't' &&
918
- urlString[2] === 't' &&
919
- urlString[3] === 'p'
920
- ) {
921
- switch (urlString[4]) {
922
- case ':':
923
- return 'http:'
924
- case 's':
925
- if (urlString[5] === ':') {
926
- return 'https:'
927
- }
928
- }
929
- }
930
- // fallback if none of the usual suspects
931
- return urlString.slice(0, urlString.indexOf(':') + 1)
932
- }
933
-
934
- const kEnumerableProperty = {
935
- __proto__: null,
936
- enumerable: true
937
- }
645
+ const kEnumerableProperty = Object.create(null)
646
+ kEnumerableProperty.enumerable = true
938
647
 
939
648
  const normalizedMethodRecordsBase = {
940
649
  delete: 'DELETE',
@@ -948,9 +657,7 @@ const normalizedMethodRecordsBase = {
948
657
  post: 'POST',
949
658
  POST: 'POST',
950
659
  put: 'PUT',
951
- PUT: 'PUT',
952
- query: 'QUERY',
953
- QUERY: 'QUERY'
660
+ PUT: 'PUT'
954
661
  }
955
662
 
956
663
  const normalizedMethodRecords = {
@@ -965,14 +672,18 @@ Object.setPrototypeOf(normalizedMethodRecords, null)
965
672
 
966
673
  module.exports = {
967
674
  kEnumerableProperty,
675
+ nop,
968
676
  isDisturbed,
677
+ isErrored,
678
+ isReadable,
679
+ toUSVString,
680
+ isUSVString,
969
681
  isBlobLike,
970
682
  parseOrigin,
971
683
  parseURL,
972
684
  getServerName,
973
685
  isStream,
974
686
  isIterable,
975
- hasSafeIterator,
976
687
  isAsyncIterable,
977
688
  isDestroyed,
978
689
  headerNameToString,
@@ -981,19 +692,17 @@ module.exports = {
981
692
  removeAllListeners,
982
693
  errorRequest,
983
694
  parseRawHeaders,
984
- toRawHeaders,
985
- encodeRawHeaders,
986
695
  parseHeaders,
987
696
  parseKeepAliveTimeout,
988
697
  destroy,
989
698
  bodyLength,
990
699
  deepClone,
700
+ ReadableStreamFrom,
991
701
  isBuffer,
992
- assertRequestHandler,
702
+ validateHandler,
993
703
  getSocketInfo,
994
704
  isFormDataLike,
995
- pathHasQueryOrFragment,
996
- serializePathWithQuery,
705
+ buildURL,
997
706
  addAbortListener,
998
707
  isValidHTTPToken,
999
708
  isValidHeaderValue,
@@ -1003,8 +712,8 @@ module.exports = {
1003
712
  normalizedMethodRecords,
1004
713
  isValidPort,
1005
714
  isHttpOrHttpsPrefixed,
1006
- safeHTTPMethods: Object.freeze(['GET', 'HEAD', 'OPTIONS', 'TRACE']),
1007
- wrapRequestBody,
1008
- setupConnectTimeout,
1009
- getProtocolFromUrlString
715
+ nodeMajor,
716
+ nodeMinor,
717
+ safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'],
718
+ wrapRequestBody
1010
719
  }