@psnext/slingcli 2.4.20260525-4 → 2.4.20260527-2

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 (243) hide show
  1. package/bin/sling.js +4 -1
  2. package/node_modules/@aws-sdk/core/package.json +2 -2
  3. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  4. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +12 -6
  5. package/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js +12 -6
  6. package/node_modules/@aws-sdk/credential-provider-http/package.json +3 -2
  7. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  8. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  9. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  10. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  11. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
  12. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  13. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  14. package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
  15. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  16. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  17. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  18. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  19. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  20. package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
  21. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +1 -2
  22. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  23. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +18 -24
  24. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  25. package/node_modules/@earendil-works/pi-ai/dist/cli.js +14 -0
  26. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +78 -63
  27. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +2 -1
  28. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +8 -22
  29. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -1
  30. package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js +1 -1
  31. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +60 -40
  32. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +1 -1
  33. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +1 -1
  34. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +55 -0
  35. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +45 -69
  36. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js +1 -0
  37. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +5 -2
  38. package/node_modules/@earendil-works/pi-ai/package.json +4 -3
  39. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +2 -3
  40. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +18 -12
  41. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js +2 -1
  42. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js +3 -2
  43. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +8 -2
  44. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +2 -1
  45. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +18 -24
  46. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/index.js +8 -6
  47. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.js +6 -3
  48. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +12 -29
  49. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +5 -1
  50. package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.js +52 -22
  51. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +63 -36
  52. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js +6 -20
  53. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +38 -31
  54. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +9 -4
  55. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +32 -24
  56. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +6 -13
  57. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +8 -22
  58. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +54 -53
  59. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.js +8 -1
  60. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +44 -81
  61. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.js +27 -12
  62. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +2 -3
  63. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +3 -3
  64. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +5 -5
  65. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js +9 -3
  66. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js +39 -21
  67. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +9 -8
  68. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/truncate.js +12 -2
  69. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +20 -35
  70. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +5 -6
  71. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +1 -1
  72. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +14 -5
  73. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +29 -4
  74. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +1 -1
  75. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -4
  76. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +37 -28
  77. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +64 -7
  78. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +15 -3
  79. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.js +14 -8
  80. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +124 -0
  81. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +31 -0
  82. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +75 -115
  83. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/paths.js +33 -7
  84. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +13 -26
  85. package/node_modules/@earendil-works/pi-coding-agent/package.json +6 -6
  86. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +40 -55
  87. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +2 -2
  88. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +12 -2
  89. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +53 -0
  90. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +4 -1
  91. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +38 -16
  92. package/node_modules/@earendil-works/pi-tui/dist/utils.js +19 -12
  93. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
  94. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  95. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  96. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  97. package/node_modules/@earendil-works/pi-tui/package.json +3 -5
  98. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  99. package/node_modules/undici/lib/api/api-request.js +1 -1
  100. package/node_modules/undici/lib/cache/sqlite-cache-store.js +3 -3
  101. package/node_modules/undici/lib/core/connect.js +16 -0
  102. package/node_modules/undici/lib/core/request.js +17 -2
  103. package/node_modules/undici/lib/core/socks5-client.js +10 -5
  104. package/node_modules/undici/lib/core/socks5-utils.js +17 -22
  105. package/node_modules/undici/lib/dispatcher/client-h1.js +64 -20
  106. package/node_modules/undici/lib/dispatcher/client.js +6 -2
  107. package/node_modules/undici/lib/dispatcher/h2c-client.js +1 -1
  108. package/node_modules/undici/lib/mock/mock-call-history.js +15 -15
  109. package/node_modules/undici/lib/util/cache.js +8 -7
  110. package/node_modules/undici/lib/web/fetch/formdata-parser.js +17 -6
  111. package/node_modules/undici/lib/web/fetch/index.js +5 -2
  112. package/node_modules/undici/lib/web/webidl/index.js +5 -5
  113. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +1 -7
  114. package/node_modules/undici/package.json +1 -1
  115. package/package.json +6 -6
  116. package/slingshot/index.js +269 -266
  117. package/node_modules/koffi/CHANGELOG.md +0 -1093
  118. package/node_modules/koffi/LICENSE.txt +0 -22
  119. package/node_modules/koffi/README.md +0 -43
  120. package/node_modules/koffi/build/koffi/darwin_arm64/koffi.node +0 -0
  121. package/node_modules/koffi/build/koffi/darwin_x64/koffi.node +0 -0
  122. package/node_modules/koffi/build/koffi/freebsd_arm64/koffi.node +0 -0
  123. package/node_modules/koffi/build/koffi/freebsd_ia32/koffi.node +0 -0
  124. package/node_modules/koffi/build/koffi/freebsd_x64/koffi.node +0 -0
  125. package/node_modules/koffi/build/koffi/linux_arm64/koffi.node +0 -0
  126. package/node_modules/koffi/build/koffi/linux_armhf/koffi.node +0 -0
  127. package/node_modules/koffi/build/koffi/linux_ia32/koffi.node +0 -0
  128. package/node_modules/koffi/build/koffi/linux_loong64/koffi.node +0 -0
  129. package/node_modules/koffi/build/koffi/linux_riscv64d/koffi.node +0 -0
  130. package/node_modules/koffi/build/koffi/linux_x64/koffi.node +0 -0
  131. package/node_modules/koffi/build/koffi/musl_arm64/koffi.node +0 -0
  132. package/node_modules/koffi/build/koffi/musl_x64/koffi.node +0 -0
  133. package/node_modules/koffi/build/koffi/openbsd_ia32/koffi.node +0 -0
  134. package/node_modules/koffi/build/koffi/openbsd_x64/koffi.node +0 -0
  135. package/node_modules/koffi/build/koffi/win32_arm64/koffi.exp +0 -0
  136. package/node_modules/koffi/build/koffi/win32_arm64/koffi.lib +0 -0
  137. package/node_modules/koffi/build/koffi/win32_arm64/koffi.node +0 -0
  138. package/node_modules/koffi/build/koffi/win32_ia32/koffi.exp +0 -0
  139. package/node_modules/koffi/build/koffi/win32_ia32/koffi.lib +0 -0
  140. package/node_modules/koffi/build/koffi/win32_ia32/koffi.node +0 -0
  141. package/node_modules/koffi/build/koffi/win32_x64/koffi.exp +0 -0
  142. package/node_modules/koffi/build/koffi/win32_x64/koffi.lib +0 -0
  143. package/node_modules/koffi/build/koffi/win32_x64/koffi.node +0 -0
  144. package/node_modules/koffi/doc/benchmarks.md +0 -126
  145. package/node_modules/koffi/doc/callbacks.md +0 -210
  146. package/node_modules/koffi/doc/contribute.md +0 -148
  147. package/node_modules/koffi/doc/functions.md +0 -250
  148. package/node_modules/koffi/doc/index.md +0 -61
  149. package/node_modules/koffi/doc/input.md +0 -471
  150. package/node_modules/koffi/doc/migration.md +0 -159
  151. package/node_modules/koffi/doc/misc.md +0 -180
  152. package/node_modules/koffi/doc/output.md +0 -305
  153. package/node_modules/koffi/doc/packaging.md +0 -88
  154. package/node_modules/koffi/doc/platforms.md +0 -36
  155. package/node_modules/koffi/doc/pointers.md +0 -328
  156. package/node_modules/koffi/doc/start.md +0 -118
  157. package/node_modules/koffi/doc/unions.md +0 -186
  158. package/node_modules/koffi/doc/variables.md +0 -102
  159. package/node_modules/koffi/index.d.ts +0 -288
  160. package/node_modules/koffi/index.js +0 -634
  161. package/node_modules/koffi/indirect.js +0 -533
  162. package/node_modules/koffi/lib/native/base/base.cc +0 -11015
  163. package/node_modules/koffi/lib/native/base/base.hh +0 -6003
  164. package/node_modules/koffi/lib/native/base/crc.inc +0 -2214
  165. package/node_modules/koffi/lib/native/base/crc_gen.py +0 -72
  166. package/node_modules/koffi/lib/native/base/mimetypes.inc +0 -1248
  167. package/node_modules/koffi/lib/native/base/mimetypes_gen.py +0 -58
  168. package/node_modules/koffi/lib/native/base/tower.cc +0 -821
  169. package/node_modules/koffi/lib/native/base/tower.hh +0 -81
  170. package/node_modules/koffi/lib/native/base/unicode.inc +0 -408
  171. package/node_modules/koffi/lib/native/base/unicode_gen.py +0 -152
  172. package/node_modules/koffi/package.json +0 -38
  173. package/node_modules/koffi/src/cnoke/LICENSE.txt +0 -22
  174. package/node_modules/koffi/src/cnoke/README.md +0 -99
  175. package/node_modules/koffi/src/cnoke/assets/FindCNoke.cmake +0 -127
  176. package/node_modules/koffi/src/cnoke/assets/toolchains.json +0 -126
  177. package/node_modules/koffi/src/cnoke/assets/win_delay_hook.c +0 -36
  178. package/node_modules/koffi/src/cnoke/cnoke.js +0 -170
  179. package/node_modules/koffi/src/cnoke/package.json +0 -24
  180. package/node_modules/koffi/src/cnoke/src/builder.js +0 -511
  181. package/node_modules/koffi/src/cnoke/src/index.js +0 -10
  182. package/node_modules/koffi/src/cnoke/src/tools.js +0 -407
  183. package/node_modules/koffi/src/koffi/CMakeLists.txt +0 -182
  184. package/node_modules/koffi/src/koffi/src/abi_arm32.cc +0 -1018
  185. package/node_modules/koffi/src/koffi/src/abi_arm32_asm.S +0 -169
  186. package/node_modules/koffi/src/koffi/src/abi_arm64.cc +0 -1295
  187. package/node_modules/koffi/src/koffi/src/abi_arm64_asm.S +0 -195
  188. package/node_modules/koffi/src/koffi/src/abi_arm64_asm.asm +0 -174
  189. package/node_modules/koffi/src/koffi/src/abi_loong64.cc +0 -5
  190. package/node_modules/koffi/src/koffi/src/abi_loong64_asm.S +0 -204
  191. package/node_modules/koffi/src/koffi/src/abi_riscv64.cc +0 -915
  192. package/node_modules/koffi/src/koffi/src/abi_riscv64_asm.S +0 -203
  193. package/node_modules/koffi/src/koffi/src/abi_x64_sysv.cc +0 -939
  194. package/node_modules/koffi/src/koffi/src/abi_x64_sysv_asm.S +0 -231
  195. package/node_modules/koffi/src/koffi/src/abi_x64_win.cc +0 -715
  196. package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.S +0 -166
  197. package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.asm +0 -192
  198. package/node_modules/koffi/src/koffi/src/abi_x86.cc +0 -860
  199. package/node_modules/koffi/src/koffi/src/abi_x86_asm.S +0 -193
  200. package/node_modules/koffi/src/koffi/src/abi_x86_asm.asm +0 -177
  201. package/node_modules/koffi/src/koffi/src/call.cc +0 -1326
  202. package/node_modules/koffi/src/koffi/src/call.hh +0 -179
  203. package/node_modules/koffi/src/koffi/src/errno.inc +0 -462
  204. package/node_modules/koffi/src/koffi/src/ffi.cc +0 -2702
  205. package/node_modules/koffi/src/koffi/src/ffi.hh +0 -354
  206. package/node_modules/koffi/src/koffi/src/init.js +0 -105
  207. package/node_modules/koffi/src/koffi/src/parser.cc +0 -220
  208. package/node_modules/koffi/src/koffi/src/parser.hh +0 -54
  209. package/node_modules/koffi/src/koffi/src/util.cc +0 -1807
  210. package/node_modules/koffi/src/koffi/src/util.hh +0 -221
  211. package/node_modules/koffi/src/koffi/src/uv.cc +0 -193
  212. package/node_modules/koffi/src/koffi/src/uv.def +0 -10
  213. package/node_modules/koffi/src/koffi/src/uv.hh +0 -40
  214. package/node_modules/koffi/src/koffi/src/win32.cc +0 -198
  215. package/node_modules/koffi/src/koffi/src/win32.hh +0 -119
  216. package/node_modules/koffi/src/koffi/tools/write_trampolines.js +0 -77
  217. package/node_modules/koffi/vendor/node-addon-api/LICENSE.md +0 -9
  218. package/node_modules/koffi/vendor/node-addon-api/README.md +0 -95
  219. package/node_modules/koffi/vendor/node-addon-api/napi-inl.deprecated.h +0 -186
  220. package/node_modules/koffi/vendor/node-addon-api/napi-inl.h +0 -7033
  221. package/node_modules/koffi/vendor/node-addon-api/napi.h +0 -3309
  222. package/node_modules/koffi/vendor/node-api-headers/LICENSE +0 -21
  223. package/node_modules/koffi/vendor/node-api-headers/README.md +0 -95
  224. package/node_modules/koffi/vendor/node-api-headers/def/js_native_api.def +0 -125
  225. package/node_modules/koffi/vendor/node-api-headers/def/node_api.def +0 -157
  226. package/node_modules/koffi/vendor/node-api-headers/include/js_native_api.h +0 -591
  227. package/node_modules/koffi/vendor/node-api-headers/include/js_native_api_types.h +0 -210
  228. package/node_modules/koffi/vendor/node-api-headers/include/node_api.h +0 -265
  229. package/node_modules/koffi/vendor/node-api-headers/include/node_api_types.h +0 -58
  230. package/node_modules/koffi/vendor/node-api-headers/include/uv/aix.h +0 -32
  231. package/node_modules/koffi/vendor/node-api-headers/include/uv/bsd.h +0 -34
  232. package/node_modules/koffi/vendor/node-api-headers/include/uv/darwin.h +0 -61
  233. package/node_modules/koffi/vendor/node-api-headers/include/uv/errno.h +0 -483
  234. package/node_modules/koffi/vendor/node-api-headers/include/uv/linux.h +0 -34
  235. package/node_modules/koffi/vendor/node-api-headers/include/uv/os390.h +0 -33
  236. package/node_modules/koffi/vendor/node-api-headers/include/uv/posix.h +0 -31
  237. package/node_modules/koffi/vendor/node-api-headers/include/uv/sunos.h +0 -44
  238. package/node_modules/koffi/vendor/node-api-headers/include/uv/threadpool.h +0 -37
  239. package/node_modules/koffi/vendor/node-api-headers/include/uv/tree.h +0 -521
  240. package/node_modules/koffi/vendor/node-api-headers/include/uv/unix.h +0 -512
  241. package/node_modules/koffi/vendor/node-api-headers/include/uv/version.h +0 -43
  242. package/node_modules/koffi/vendor/node-api-headers/include/uv/win.h +0 -698
  243. package/node_modules/koffi/vendor/node-api-headers/include/uv.h +0 -1990
@@ -69,9 +69,9 @@ function lazyllhttp () {
69
69
  let useWasmSIMD = process.arch !== 'ppc64'
70
70
  // The Env Variable UNDICI_NO_WASM_SIMD allows explicitly overriding the default behavior
71
71
  if (process.env.UNDICI_NO_WASM_SIMD === '1') {
72
- useWasmSIMD = true
73
- } else if (process.env.UNDICI_NO_WASM_SIMD === '0') {
74
72
  useWasmSIMD = false
73
+ } else if (process.env.UNDICI_NO_WASM_SIMD === '0') {
74
+ useWasmSIMD = true
75
75
  }
76
76
 
77
77
  if (useWasmSIMD) {
@@ -216,6 +216,7 @@ class Parser {
216
216
  */
217
217
  this.socket = socket
218
218
  this.timeout = null
219
+ this.timeoutWeakRef = new WeakRef(this)
219
220
  this.timeoutValue = null
220
221
  this.timeoutType = null
221
222
  this.statusCode = 0
@@ -253,9 +254,9 @@ class Parser {
253
254
 
254
255
  if (delay) {
255
256
  if (type & USE_FAST_TIMER) {
256
- this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this))
257
+ this.timeout = timers.setFastTimeout(onParserTimeout, delay, this.timeoutWeakRef)
257
258
  } else {
258
- this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this))
259
+ this.timeout = setTimeout(onParserTimeout, delay, this.timeoutWeakRef)
259
260
  this.timeout?.unref()
260
261
  }
261
262
  }
@@ -349,16 +350,7 @@ class Parser {
349
350
  this.paused = true
350
351
  socket.unshift(data)
351
352
  } else {
352
- const ptr = llhttp.llhttp_get_error_reason(this.ptr)
353
- let message = ''
354
- if (ptr) {
355
- const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
356
- message =
357
- 'Response does not match the HTTP/1.1 protocol (' +
358
- Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
359
- ')'
360
- }
361
- throw new HTTPParserError(message, constants.ERROR[ret], data)
353
+ throw this.createError(ret, data)
362
354
  }
363
355
  }
364
356
  } catch (err) {
@@ -366,6 +358,54 @@ class Parser {
366
358
  }
367
359
  }
368
360
 
361
+ finish () {
362
+ assert(currentParser === null)
363
+ assert(this.ptr != null)
364
+ assert(!this.paused)
365
+
366
+ const { llhttp } = this
367
+
368
+ let ret
369
+
370
+ try {
371
+ currentParser = this
372
+ ret = llhttp.llhttp_finish(this.ptr)
373
+ } finally {
374
+ currentParser = null
375
+ }
376
+
377
+ if (ret === constants.ERROR.OK) {
378
+ return null
379
+ }
380
+
381
+ if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {
382
+ this.paused = true
383
+ return null
384
+ }
385
+
386
+ return this.createError(ret, EMPTY_BUF)
387
+ }
388
+
389
+ createError (ret, data) {
390
+ const { llhttp, contentLength, bytesRead } = this
391
+
392
+ if (contentLength && bytesRead !== parseInt(contentLength, 10)) {
393
+ return new ResponseContentLengthMismatchError()
394
+ }
395
+
396
+ const ptr = llhttp.llhttp_get_error_reason(this.ptr)
397
+ let message = ''
398
+ if (ptr) {
399
+ const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
400
+ message =
401
+ 'Response does not match the HTTP/1.1 protocol (' +
402
+ Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
403
+ ')'
404
+ }
405
+
406
+ return new HTTPParserError(message, constants.ERROR[ret], data)
407
+ }
408
+
369
409
  destroy () {
370
410
  assert(currentParser === null)
371
411
  assert(this.ptr != null)
@@ -870,8 +910,11 @@ function onHttpSocketError (err) {
870
910
  // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
871
911
  // to the user.
872
912
  if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
873
- // We treat all incoming data so for as a valid response.
874
- parser.onMessageComplete()
913
+ const parserErr = parser.finish()
914
+ if (parserErr) {
915
+ this[kError] = parserErr
916
+ this[kClient][kOnError](parserErr)
917
+ }
875
918
  return
876
919
  }
877
920
 
@@ -888,8 +931,10 @@ function onHttpSocketEnd () {
888
931
  const parser = this[kParser]
889
932
 
890
933
  if (parser.statusCode && !parser.shouldKeepAlive) {
891
- // We treat all incoming data so far as a valid response.
892
- parser.onMessageComplete()
934
+ const parserErr = parser.finish()
935
+ if (parserErr) {
936
+ util.destroy(this, parserErr)
937
+ }
893
938
  return
894
939
  }
895
940
 
@@ -901,8 +946,7 @@ function onHttpSocketClose () {
901
946
 
902
947
  if (parser) {
903
948
  if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
904
- // We treat all incoming data so far as a valid response.
905
- parser.onMessageComplete()
949
+ this[kError] = parser.finish() || this[kError]
906
950
  }
907
951
 
908
952
  this[kParser].destroy()
@@ -235,9 +235,13 @@ class Client extends DispatcherBase {
235
235
  ...(typeof autoSelectFamily === 'boolean' ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
236
236
  ...connect
237
237
  })
238
- } else if (socketPath != null) {
238
+ } else {
239
239
  const customConnect = connect
240
- connect = (opts, callback) => customConnect({ ...opts, socketPath }, callback)
240
+ connect = (opts, callback) => customConnect({
241
+ ...opts,
242
+ ...(socketPath != null ? { socketPath } : null),
243
+ ...(allowH2 != null ? { allowH2 } : null)
244
+ }, callback)
241
245
  }
242
246
 
243
247
  this[kUrl] = util.parseOrigin(url)
@@ -15,7 +15,7 @@ class H2CClient extends Client {
15
15
  )
16
16
  }
17
17
 
18
- const { connect, maxConcurrentStreams, pipelining, ...opts } =
18
+ const { maxConcurrentStreams, pipelining, ...opts } =
19
19
  clientOpts ?? {}
20
20
  let defaultMaxConcurrentStreams = 100
21
21
  let defaultPipelining = 100
@@ -3,14 +3,14 @@
3
3
  const { kMockCallHistoryAddLog } = require('./mock-symbols')
4
4
  const { InvalidArgumentError } = require('../core/errors')
5
5
 
6
- function handleFilterCallsWithOptions (criteria, options, handler, store) {
6
+ function handleFilterCallsWithOptions (criteria, options, handler, store, allLogs) {
7
7
  switch (options.operator) {
8
8
  case 'OR':
9
- store.push(...handler(criteria))
9
+ store.push(...handler(criteria, allLogs))
10
10
 
11
11
  return store
12
12
  case 'AND':
13
- return handler.call({ logs: store }, criteria)
13
+ return handler(criteria, store)
14
14
  default:
15
15
  // guard -- should never happens because buildAndValidateFilterCallsOptions is called before
16
16
  throw new InvalidArgumentError('options.operator must to be a case insensitive string equal to \'OR\' or \'AND\'')
@@ -35,14 +35,14 @@ function buildAndValidateFilterCallsOptions (options = {}) {
35
35
  }
36
36
 
37
37
  function makeFilterCalls (parameterName) {
38
- return (parameterValue) => {
38
+ return (parameterValue, logs) => {
39
39
  if (typeof parameterValue === 'string' || parameterValue == null) {
40
- return this.logs.filter((log) => {
40
+ return logs.filter((log) => {
41
41
  return log[parameterName] === parameterValue
42
42
  })
43
43
  }
44
44
  if (parameterValue instanceof RegExp) {
45
- return this.logs.filter((log) => {
45
+ return logs.filter((log) => {
46
46
  return parameterValue.test(log[parameterName])
47
47
  })
48
48
  }
@@ -175,30 +175,30 @@ class MockCallHistory {
175
175
 
176
176
  const finalOptions = { operator: 'OR', ...buildAndValidateFilterCallsOptions(options) }
177
177
 
178
- let maybeDuplicatedLogsFiltered = []
178
+ let maybeDuplicatedLogsFiltered = finalOptions.operator === 'AND' ? this.logs : []
179
179
  if ('protocol' in criteria) {
180
- maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.protocol, finalOptions, this.filterCallsByProtocol, maybeDuplicatedLogsFiltered)
180
+ maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.protocol, finalOptions, this.filterCallsByProtocol, maybeDuplicatedLogsFiltered, this.logs)
181
181
  }
182
182
  if ('host' in criteria) {
183
- maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.host, finalOptions, this.filterCallsByHost, maybeDuplicatedLogsFiltered)
183
+ maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.host, finalOptions, this.filterCallsByHost, maybeDuplicatedLogsFiltered, this.logs)
184
184
  }
185
185
  if ('port' in criteria) {
186
- maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.port, finalOptions, this.filterCallsByPort, maybeDuplicatedLogsFiltered)
186
+ maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.port, finalOptions, this.filterCallsByPort, maybeDuplicatedLogsFiltered, this.logs)
187
187
  }
188
188
  if ('origin' in criteria) {
189
- maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.origin, finalOptions, this.filterCallsByOrigin, maybeDuplicatedLogsFiltered)
189
+ maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.origin, finalOptions, this.filterCallsByOrigin, maybeDuplicatedLogsFiltered, this.logs)
190
190
  }
191
191
  if ('path' in criteria) {
192
- maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.path, finalOptions, this.filterCallsByPath, maybeDuplicatedLogsFiltered)
192
+ maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.path, finalOptions, this.filterCallsByPath, maybeDuplicatedLogsFiltered, this.logs)
193
193
  }
194
194
  if ('hash' in criteria) {
195
- maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.hash, finalOptions, this.filterCallsByHash, maybeDuplicatedLogsFiltered)
195
+ maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.hash, finalOptions, this.filterCallsByHash, maybeDuplicatedLogsFiltered, this.logs)
196
196
  }
197
197
  if ('fullUrl' in criteria) {
198
- maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.fullUrl, finalOptions, this.filterCallsByFullUrl, maybeDuplicatedLogsFiltered)
198
+ maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.fullUrl, finalOptions, this.filterCallsByFullUrl, maybeDuplicatedLogsFiltered, this.logs)
199
199
  }
200
200
  if ('method' in criteria) {
201
- maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.method, finalOptions, this.filterCallsByMethod, maybeDuplicatedLogsFiltered)
201
+ maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.method, finalOptions, this.filterCallsByMethod, maybeDuplicatedLogsFiltered, this.logs)
202
202
  }
203
203
 
204
204
  const uniqLogsFiltered = [...new Set(maybeDuplicatedLogsFiltered)]
@@ -18,7 +18,7 @@ function makeCacheKey (opts) {
18
18
 
19
19
  let fullPath = opts.path || '/'
20
20
 
21
- if (opts.query && !pathHasQueryOrFragment(opts.path)) {
21
+ if (opts.query && !pathHasQueryOrFragment(fullPath)) {
22
22
  fullPath = serializePathWithQuery(fullPath, opts.query)
23
23
  }
24
24
 
@@ -374,9 +374,11 @@ function assertCacheMethods (methods, name = 'CacheMethods') {
374
374
  * @returns {string}
375
375
  */
376
376
  function makeDeduplicationKey (cacheKey, excludeHeaders) {
377
- // Create a deterministic string key from the cache key
378
- // Include origin, method, path, and sorted headers
379
- let key = `${cacheKey.origin}:${cacheKey.method}:${cacheKey.path}`
377
+ // Use JSON.stringify to produce a collision-resistant key.
378
+ // Previous format used `:` and `=` delimiters without escaping, which
379
+ // allowed different header sets to produce identical keys (e.g.
380
+ // {a:"x:b=y"} vs {a:"x", b:"y"}). See: https://github.com/nodejs/undici/issues/5012
381
+ const headers = {}
380
382
 
381
383
  if (cacheKey.headers) {
382
384
  const sortedHeaders = Object.keys(cacheKey.headers).sort()
@@ -385,12 +387,11 @@ function makeDeduplicationKey (cacheKey, excludeHeaders) {
385
387
  if (excludeHeaders?.has(header.toLowerCase())) {
386
388
  continue
387
389
  }
388
- const value = cacheKey.headers[header]
389
- key += `:${header}=${Array.isArray(value) ? value.join(',') : value}`
390
+ headers[header] = cacheKey.headers[header]
390
391
  }
391
392
  }
392
393
 
393
- return key
394
+ return JSON.stringify([cacheKey.origin, cacheKey.method, cacheKey.path, headers])
394
395
  }
395
396
 
396
397
  module.exports = {
@@ -204,7 +204,7 @@ function multipartFormDataParser (input, mimeType) {
204
204
  * Parses content-disposition attributes (e.g., name="value" or filename*=utf-8''encoded)
205
205
  * @param {Buffer} input
206
206
  * @param {{ position: number }} position
207
- * @returns {{ name: string, value: string }}
207
+ * @returns {{ name: string, value: string, extended: boolean } | null}
208
208
  */
209
209
  function parseContentDispositionAttribute (input, position) {
210
210
  // Skip leading semicolon and whitespace
@@ -304,7 +304,7 @@ function parseContentDispositionAttribute (input, position) {
304
304
  value = decoder.decode(tokenValue)
305
305
  }
306
306
 
307
- return { name: attrNameStr, value }
307
+ return { name: attrNameStr, value, extended: isExtended }
308
308
  }
309
309
 
310
310
  /**
@@ -368,6 +368,9 @@ function parseMultipartFormDataHeaders (input, position) {
368
368
  switch (bufferToLowerCasedHeaderName(headerName)) {
369
369
  case 'content-disposition': {
370
370
  name = filename = null
371
+ // Track whether filename was set from the extended (RFC 5987) form so
372
+ // a subsequent legacy `filename` attribute does not override it.
373
+ let filenameIsExtended = false
371
374
 
372
375
  // Collect the disposition type (should be "form-data")
373
376
  const dispositionType = collectASequenceOfBytes(
@@ -383,8 +386,8 @@ function parseMultipartFormDataHeaders (input, position) {
383
386
  // Parse attributes recursively until CRLF
384
387
  while (
385
388
  position.position < input.length &&
386
- input[position.position] !== 0x0d &&
387
- input[position.position + 1] !== 0x0a
389
+ (input[position.position] !== 0x0d ||
390
+ input[position.position + 1] !== 0x0a)
388
391
  ) {
389
392
  const attribute = parseContentDispositionAttribute(input, position)
390
393
 
@@ -395,7 +398,15 @@ function parseMultipartFormDataHeaders (input, position) {
395
398
  if (attribute.name === 'name') {
396
399
  name = attribute.value
397
400
  } else if (attribute.name === 'filename') {
398
- filename = attribute.value
401
+ // Per RFC 5987 §4.1, when both legacy and extended forms of the
402
+ // same parameter are present, the extended (filename*) form takes
403
+ // precedence regardless of the order they appear in.
404
+ if (attribute.extended) {
405
+ filename = attribute.value
406
+ filenameIsExtended = true
407
+ } else if (!filenameIsExtended) {
408
+ filename = attribute.value
409
+ }
399
410
  }
400
411
  }
401
412
 
@@ -448,7 +459,7 @@ function parseMultipartFormDataHeaders (input, position) {
448
459
 
449
460
  // 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A
450
461
  // (CR LF), return failure. Otherwise, advance position by 2 (past the newline).
451
- if (input[position.position] !== 0x0d && input[position.position + 1] !== 0x0a) {
462
+ if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {
452
463
  throw parsingError('expected CRLF')
453
464
  } else {
454
465
  position.position += 2
@@ -1030,7 +1030,7 @@ function fetchFinale (fetchParams, response) {
1030
1030
  let responseStatus = 0
1031
1031
 
1032
1032
  // 7. If fetchParams’s request’s mode is not "navigate" or response’s has-cross-origin-redirects is false:
1033
- if (fetchParams.request.mode !== 'navigator' || !response.hasCrossOriginRedirects) {
1033
+ if (fetchParams.request.mode !== 'navigate' || !response.hasCrossOriginRedirects) {
1034
1034
  // 1. Set responseStatus to response’s status.
1035
1035
  responseStatus = response.status
1036
1036
 
@@ -1433,7 +1433,10 @@ async function httpNetworkOrCacheFetch (
1433
1433
  // 8. If contentLengthHeaderValue is non-null, then append
1434
1434
  // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
1435
1435
  // list.
1436
- if (contentLengthHeaderValue != null) {
1436
+ if (
1437
+ contentLengthHeaderValue != null &&
1438
+ !httpRequest.headersList.contains('content-length', true)
1439
+ ) {
1437
1440
  httpRequest.headersList.append('content-length', contentLengthHeaderValue, true)
1438
1441
  }
1439
1442
 
@@ -190,10 +190,10 @@ webidl.util.ConvertToInt = function (V, bitLength, signedness, flags) {
190
190
  } else {
191
191
  // 3. Otherwise:
192
192
 
193
- // 1. Let lowerBound be -2^bitLength − 1.
194
- lowerBound = Math.pow(-2, bitLength) - 1
193
+ // 1. Let lowerBound be -2^(bitLength − 1).
194
+ lowerBound = -Math.pow(2, bitLength - 1)
195
195
 
196
- // 2. Let upperBound be 2^bitLength − 1 − 1.
196
+ // 2. Let upperBound be 2^(bitLength − 1) − 1.
197
197
  upperBound = Math.pow(2, bitLength - 1) - 1
198
198
  }
199
199
 
@@ -272,9 +272,9 @@ webidl.util.ConvertToInt = function (V, bitLength, signedness, flags) {
272
272
  // 10. Set x to x modulo 2^bitLength.
273
273
  x = x % Math.pow(2, bitLength)
274
274
 
275
- // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
275
+ // 11. If signedness is "signed" and x ≥ 2^(bitLength − 1),
276
276
  // then return x − 2^bitLength.
277
- if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
277
+ if (signedness === 'signed' && x >= Math.pow(2, bitLength - 1)) {
278
278
  return x - Math.pow(2, bitLength)
279
279
  }
280
280
 
@@ -284,12 +284,6 @@ class WebSocketStream {
284
284
  start: (controller) => {
285
285
  this.#readableStreamController = controller
286
286
  },
287
- pull (controller) {
288
- let chunk
289
- while (controller.desiredSize > 0 && (chunk = response.socket.read()) !== null) {
290
- controller.enqueue(chunk)
291
- }
292
- },
293
287
  cancel: (reason) => this.#cancel(reason)
294
288
  })
295
289
 
@@ -338,7 +332,7 @@ class WebSocketStream {
338
332
  try {
339
333
  chunk = utf8Decode(data)
340
334
  } catch {
341
- failWebsocketConnection(this.#handler, 'Received invalid UTF-8 in text frame.')
335
+ failWebsocketConnection(this.#handler, 1007, 'Received invalid UTF-8 in text frame.')
342
336
  return
343
337
  }
344
338
  } else if (type === opcodes.BINARY) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici",
3
- "version": "7.25.0",
3
+ "version": "7.26.0",
4
4
  "description": "An HTTP/1.1 client, written from scratch for Node.js",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@psnext/slingcli",
3
- "version": "2.4.20260525-4",
3
+ "version": "2.4.20260527-2",
4
4
  "description": "Connects Sling CLI to Publicis Sapient Slingshot enterprise LLM gateway. Bundles the pi coding-agent runtime.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -29,12 +29,12 @@
29
29
  "type": "git",
30
30
  "url": "git+https://pscode.lioncloud.net/psaiproducts/slingcli.git"
31
31
  },
32
- "slingVersion": "2.4.20260525-4",
32
+ "slingVersion": "2.4.20260527-2",
33
33
  "dependencies": {
34
- "@earendil-works/pi-tui": "file:../.sling-pack/earendil-works-pi-tui-0.75.4.tgz",
35
- "@earendil-works/pi-ai": "file:../.sling-pack/earendil-works-pi-ai-0.75.4.tgz",
36
- "@earendil-works/pi-agent-core": "file:../.sling-pack/earendil-works-pi-agent-core-0.75.4.tgz",
37
- "@earendil-works/pi-coding-agent": "file:../.sling-pack/earendil-works-pi-coding-agent-0.75.4.tgz",
34
+ "@earendil-works/pi-tui": "file:../.sling-pack/earendil-works-pi-tui-0.75.5.tgz",
35
+ "@earendil-works/pi-ai": "file:../.sling-pack/earendil-works-pi-ai-0.75.5.tgz",
36
+ "@earendil-works/pi-agent-core": "file:../.sling-pack/earendil-works-pi-agent-core-0.75.5.tgz",
37
+ "@earendil-works/pi-coding-agent": "file:../.sling-pack/earendil-works-pi-coding-agent-0.75.5.tgz",
38
38
  "undici": "^7.19.1",
39
39
  "semver": "^7.6.0"
40
40
  },