@psnext/slingcli 2.5.20260615-2 → 2.5.20260617-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/node_modules/@aws-sdk/core/dist-cjs/index.js +45 -50
  2. package/node_modules/@aws-sdk/core/dist-cjs/submodules/account-id-endpoint/index.js +2 -4
  3. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +21 -22
  4. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +51 -51
  5. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +21 -22
  6. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +19 -21
  7. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +107 -109
  8. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -4
  9. package/node_modules/@aws-sdk/core/package.json +8 -8
  10. package/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +4 -6
  11. package/node_modules/@aws-sdk/credential-provider-env/package.json +6 -6
  12. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js +3 -7
  13. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.browser.js +12 -16
  14. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +16 -21
  15. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js +14 -18
  16. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js +1 -5
  17. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.browser.js +2 -5
  18. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +2 -7
  19. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -13
  20. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +7 -7
  21. package/node_modules/@aws-sdk/credential-provider-http/package.json +6 -6
  22. package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +47 -41
  23. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js +8 -4
  24. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js +14 -10
  25. package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
  26. package/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +31 -33
  27. package/node_modules/@aws-sdk/credential-provider-login/package.json +7 -7
  28. package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +16 -18
  29. package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
  30. package/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +11 -13
  31. package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
  32. package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +22 -24
  33. package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BGYXHf8s.js +3 -0
  34. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +26 -28
  35. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +7 -7
  36. package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
  37. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js +10 -14
  38. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +2 -6
  39. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +3 -27
  40. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
  41. package/node_modules/@aws-sdk/eventstream-handler-node/dist-cjs/index.js +7 -9
  42. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +5 -5
  43. package/node_modules/@aws-sdk/middleware-eventstream/dist-cjs/index.js +3 -5
  44. package/node_modules/@aws-sdk/middleware-eventstream/package.json +5 -5
  45. package/node_modules/@aws-sdk/middleware-websocket/dist-cjs/index.js +16 -18
  46. package/node_modules/@aws-sdk/middleware-websocket/package.json +6 -6
  47. package/node_modules/@aws-sdk/nested-clients/dist-cjs/index.js +0 -1
  48. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +82 -84
  49. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +158 -119
  50. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +80 -82
  51. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +80 -82
  52. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +99 -101
  53. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js +4 -1
  54. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js +70 -35
  55. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js +1 -1
  56. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js +3 -0
  57. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/endpoint/EndpointParameters.d.ts +1 -0
  58. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/enums.d.ts +12 -0
  59. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/endpoint/EndpointParameters.d.ts +1 -0
  60. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/enums.d.ts +3 -0
  61. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -13
  62. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +7 -7
  63. package/node_modules/@aws-sdk/nested-clients/package.json +9 -8
  64. package/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js +4 -6
  65. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +5 -5
  66. package/node_modules/@aws-sdk/types/dist-cjs/index.js +7 -8
  67. package/node_modules/@aws-sdk/types/package.json +4 -4
  68. package/node_modules/@aws-sdk/util-locate-window/dist-cjs/index.js +0 -2
  69. package/node_modules/@aws-sdk/util-locate-window/package.json +4 -4
  70. package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +2 -4
  71. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-external/nodable_entities.js +4 -7
  72. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.browser.js +2 -5
  73. package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +7 -10
  74. package/node_modules/@aws-sdk/xml-builder/package.json +4 -4
  75. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +162 -21
  76. package/node_modules/@smithy/core/dist-cjs/index.js +13 -15
  77. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +29 -31
  78. package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.browser.js +2 -4
  79. package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.js +7 -9
  80. package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.native.js +3 -5
  81. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +22 -23
  82. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +10 -11
  83. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +38 -39
  84. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +10 -11
  85. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +14 -17
  86. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +20 -23
  87. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +9 -11
  88. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +11 -13
  89. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +59 -60
  90. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +23 -24
  91. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +25 -26
  92. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +5 -7
  93. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +4 -6
  94. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +23 -25
  95. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +4 -6
  96. package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +2 -4
  97. package/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +1 -1
  98. package/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/httpSigningMiddleware.js +1 -1
  99. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +1 -1
  100. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js +1 -1
  101. package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
  102. package/node_modules/@smithy/core/package.json +7 -6
  103. package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +23 -24
  104. package/node_modules/@smithy/credential-provider-imds/package.json +6 -6
  105. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +6 -8
  106. package/node_modules/@smithy/fetch-http-handler/package.json +7 -7
  107. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +27 -29
  108. package/node_modules/@smithy/signature-v4/package.json +6 -6
  109. package/node_modules/@smithy/types/dist-cjs/index.js +23 -18
  110. package/node_modules/@smithy/types/package.json +4 -4
  111. package/node_modules/undici/docs/docs/api/Client.md +3 -0
  112. package/node_modules/undici/docs/docs/api/Cookies.md +27 -0
  113. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +1 -0
  114. package/node_modules/undici/lib/core/socks5-client.js +14 -4
  115. package/node_modules/undici/lib/core/socks5-utils.js +18 -4
  116. package/node_modules/undici/lib/dispatcher/agent.js +1 -1
  117. package/node_modules/undici/lib/dispatcher/balanced-pool.js +1 -1
  118. package/node_modules/undici/lib/dispatcher/client-h1.js +69 -1
  119. package/node_modules/undici/lib/dispatcher/client.js +3 -2
  120. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +19 -0
  121. package/node_modules/undici/lib/dispatcher/pool.js +1 -1
  122. package/node_modules/undici/lib/dispatcher/proxy-agent.js +2 -1
  123. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +45 -34
  124. package/node_modules/undici/lib/util/cache.js +8 -2
  125. package/node_modules/undici/lib/web/cookies/parse.js +17 -25
  126. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +13 -31
  127. package/node_modules/undici/lib/web/websocket/receiver.js +80 -23
  128. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -1
  129. package/node_modules/undici/lib/web/websocket/websocket.js +8 -1
  130. package/node_modules/undici/package.json +1 -1
  131. package/node_modules/undici/types/client.d.ts +16 -0
  132. package/package.json +2 -2
  133. package/slingshot/index.js +31 -31
  134. package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js +0 -8
@@ -39,18 +39,27 @@ class ByteParser extends Writable {
39
39
  /** @type {import('./websocket').Handler} */
40
40
  #handler
41
41
 
42
+ /** @type {number} */
43
+ #maxFragments
44
+
45
+ /** @type {number} */
46
+ #maxPayloadSize
47
+
42
48
  /**
43
49
  * @param {import('./websocket').Handler} handler
44
50
  * @param {Map<string, string>|null} extensions
51
+ * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options]
45
52
  */
46
- constructor (handler, extensions) {
53
+ constructor (handler, extensions, options = {}) {
47
54
  super()
48
55
 
49
56
  this.#handler = handler
50
57
  this.#extensions = extensions == null ? new Map() : extensions
58
+ this.#maxFragments = options.maxFragments ?? 0
59
+ this.#maxPayloadSize = options.maxPayloadSize ?? 0
51
60
 
52
61
  if (this.#extensions.has('permessage-deflate')) {
53
- this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions))
62
+ this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions, options))
54
63
  }
55
64
  }
56
65
 
@@ -66,6 +75,19 @@ class ByteParser extends Writable {
66
75
  this.run(callback)
67
76
  }
68
77
 
78
+ #validatePayloadLength () {
79
+ if (
80
+ this.#maxPayloadSize > 0 &&
81
+ !isControlFrame(this.#info.opcode) &&
82
+ this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize
83
+ ) {
84
+ failWebsocketConnection(this.#handler, 1009, 'Payload size exceeds maximum allowed size')
85
+ return false
86
+ }
87
+
88
+ return true
89
+ }
90
+
69
91
  /**
70
92
  * Runs whenever a new chunk is received.
71
93
  * Callback is called whenever there are no more chunks buffering,
@@ -154,6 +176,10 @@ class ByteParser extends Writable {
154
176
  if (payloadLength <= 125) {
155
177
  this.#info.payloadLength = payloadLength
156
178
  this.#state = parserStates.READ_DATA
179
+
180
+ if (!this.#validatePayloadLength()) {
181
+ return
182
+ }
157
183
  } else if (payloadLength === 126) {
158
184
  this.#state = parserStates.PAYLOADLENGTH_16
159
185
  } else if (payloadLength === 127) {
@@ -178,6 +204,10 @@ class ByteParser extends Writable {
178
204
 
179
205
  this.#info.payloadLength = buffer.readUInt16BE(0)
180
206
  this.#state = parserStates.READ_DATA
207
+
208
+ if (!this.#validatePayloadLength()) {
209
+ return
210
+ }
181
211
  } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
182
212
  if (this.#byteOffset < 8) {
183
213
  return callback()
@@ -200,6 +230,10 @@ class ByteParser extends Writable {
200
230
 
201
231
  this.#info.payloadLength = lower
202
232
  this.#state = parserStates.READ_DATA
233
+
234
+ if (!this.#validatePayloadLength()) {
235
+ return
236
+ }
203
237
  } else if (this.#state === parserStates.READ_DATA) {
204
238
  if (this.#byteOffset < this.#info.payloadLength) {
205
239
  return callback()
@@ -212,7 +246,9 @@ class ByteParser extends Writable {
212
246
  this.#state = parserStates.INFO
213
247
  } else {
214
248
  if (!this.#info.compressed) {
215
- this.writeFragments(body)
249
+ if (!this.writeFragments(body)) {
250
+ return
251
+ }
216
252
 
217
253
  // If the frame is not fragmented, a message has been received.
218
254
  // If the frame is fragmented, it will terminate with a fin bit set
@@ -224,29 +260,41 @@ class ByteParser extends Writable {
224
260
 
225
261
  this.#state = parserStates.INFO
226
262
  } else {
227
- this.#extensions.get('permessage-deflate').decompress(body, this.#info.fin, (error, data) => {
228
- if (error) {
229
- // Use 1009 (Message Too Big) for decompression size limit errors
230
- const code = error instanceof MessageSizeExceededError ? 1009 : 1007
231
- failWebsocketConnection(this.#handler, code, error.message)
232
- return
233
- }
234
-
235
- this.writeFragments(data)
263
+ this.#extensions.get('permessage-deflate').decompress(
264
+ body,
265
+ this.#info.fin,
266
+ (error, data) => {
267
+ if (error) {
268
+ const code = error instanceof MessageSizeExceededError ? 1009 : 1007
269
+ failWebsocketConnection(this.#handler, code, error.message)
270
+ return
271
+ }
272
+
273
+ if (!this.writeFragments(data)) {
274
+ return
275
+ }
276
+
277
+ // Check cumulative fragment size
278
+ if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {
279
+ failWebsocketConnection(this.#handler, 1009, new MessageSizeExceededError().message)
280
+ return
281
+ }
282
+
283
+ if (!this.#info.fin) {
284
+ this.#state = parserStates.INFO
285
+ this.#loop = true
286
+ this.run(callback)
287
+ return
288
+ }
289
+
290
+ websocketMessageReceived(this.#handler, this.#info.binaryType, this.consumeFragments())
236
291
 
237
- if (!this.#info.fin) {
238
- this.#state = parserStates.INFO
239
292
  this.#loop = true
293
+ this.#state = parserStates.INFO
240
294
  this.run(callback)
241
- return
242
- }
243
-
244
- websocketMessageReceived(this.#handler, this.#info.binaryType, this.consumeFragments())
245
-
246
- this.#loop = true
247
- this.#state = parserStates.INFO
248
- this.run(callback)
249
- })
295
+ },
296
+ this.#fragmentsBytes
297
+ )
250
298
 
251
299
  this.#loop = false
252
300
  break
@@ -305,8 +353,17 @@ class ByteParser extends Writable {
305
353
  }
306
354
 
307
355
  writeFragments (fragment) {
356
+ if (
357
+ this.#maxFragments > 0 &&
358
+ this.#fragments.length === this.#maxFragments
359
+ ) {
360
+ failWebsocketConnection(this.#handler, 1008, 'Too many message fragments')
361
+ return false
362
+ }
363
+
308
364
  this.#fragmentsBytes += fragment.length
309
365
  this.#fragments.push(fragment)
366
+ return true
310
367
  }
311
368
 
312
369
  consumeFragments () {
@@ -258,7 +258,14 @@ class WebSocketStream {
258
258
  #onConnectionEstablished (response, parsedExtensions) {
259
259
  this.#handler.socket = response.socket
260
260
 
261
- const parser = new ByteParser(this.#handler, parsedExtensions)
261
+ // Get options from dispatcher options
262
+ const maxFragments = this.#handler.controller.dispatcher?.webSocketOptions?.maxFragments
263
+ const maxPayloadSize = this.#handler.controller.dispatcher?.webSocketOptions?.maxPayloadSize
264
+
265
+ const parser = new ByteParser(this.#handler, parsedExtensions, {
266
+ maxFragments,
267
+ maxPayloadSize
268
+ })
262
269
  parser.on('drain', () => this.#handler.onParserDrain())
263
270
  parser.on('error', (err) => this.#handler.onParserError(err))
264
271
 
@@ -468,7 +468,14 @@ class WebSocket extends EventTarget {
468
468
  // once this happens, the connection is open
469
469
  this.#handler.socket = response.socket
470
470
 
471
- const parser = new ByteParser(this.#handler, parsedExtensions)
471
+ const webSocketOptions = this.#handler.controller.dispatcher?.webSocketOptions
472
+ const maxFragments = webSocketOptions?.maxFragments
473
+ const maxPayloadSize = webSocketOptions?.maxPayloadSize
474
+
475
+ const parser = new ByteParser(this.#handler, parsedExtensions, {
476
+ maxFragments,
477
+ maxPayloadSize
478
+ })
472
479
  parser.on('drain', () => this.#handler.onParserDrain())
473
480
  parser.on('error', (err) => this.#handler.onParserError(err))
474
481
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici",
3
- "version": "7.27.2",
3
+ "version": "7.28.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": {
@@ -107,6 +107,8 @@ export declare namespace Client {
107
107
  * @default 60000
108
108
  */
109
109
  pingInterval?: number;
110
+ /** WebSocket-specific configuration options. */
111
+ webSocket?: WebSocketOptions;
110
112
  }
111
113
  export interface SocketInfo {
112
114
  localAddress?: string
@@ -118,6 +120,20 @@ export declare namespace Client {
118
120
  bytesWritten?: number
119
121
  bytesRead?: number
120
122
  }
123
+ export interface WebSocketOptions {
124
+ /**
125
+ * Maximum number of fragments in a message. Set to 0 to disable the limit.
126
+ * @default 131072
127
+ */
128
+ maxFragments?: number;
129
+ /**
130
+ * Maximum allowed payload size in bytes for WebSocket messages.
131
+ * Applied to uncompressed messages, compressed frame payloads, and decompressed (permessage-deflate) messages.
132
+ * Set to 0 to disable the limit.
133
+ * @default 134217728 (128 MB)
134
+ */
135
+ maxPayloadSize?: number;
136
+ }
121
137
  }
122
138
 
123
139
  export default Client
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@psnext/slingcli",
3
- "version": "2.5.20260615-2",
3
+ "version": "2.5.20260617-1",
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,7 +29,7 @@
29
29
  "type": "git",
30
30
  "url": "git+https://pscode.lioncloud.net/psaiproducts/slingcli.git"
31
31
  },
32
- "slingVersion": "2.5.20260615-2",
32
+ "slingVersion": "2.5.20260617-1",
33
33
  "dependencies": {
34
34
  "@earendil-works/pi-tui": "file:../.sling-pack/earendil-works-pi-tui-0.79.3.tgz",
35
35
  "@earendil-works/pi-ai": "file:../.sling-pack/earendil-works-pi-ai-0.79.3.tgz",