@openclaw/discord 2026.6.11 → 2026.6.34

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 (152) hide show
  1. package/dist/action-runtime-api.js +1 -1
  2. package/dist/{api-4GFMoWu0.js → api-CjnGBhM3.js} +4 -1
  3. package/dist/api.js +14 -14
  4. package/dist/{approval-handler.runtime-SsFtZQA6.js → approval-handler.runtime-BWPQrzpP.js} +9 -4
  5. package/dist/{audit-CAnmyf2A.js → audit-BwJ_2OjL.js} +3 -3
  6. package/dist/{channel-YA7AbYP3.js → channel-DU4jnQgl.js} +15 -15
  7. package/dist/{channel-actions-BJ3n5Z1l.js → channel-actions-CwmIqnYN.js} +2 -2
  8. package/dist/{channel-actions.runtime-D2QTRgZ9.js → channel-actions.runtime-DvpTfaJ4.js} +5 -5
  9. package/dist/channel-plugin-api.js +1 -1
  10. package/dist/{channel.setup-B1zDEAR7.js → channel.setup-glZ5Y98a.js} +2 -2
  11. package/dist/{components-Dm4c_ce6.js → components-j6lTZBsT.js} +1 -1
  12. package/dist/{conversation-identity-DZ0BD7xO.js → conversation-identity-36FFBwm5.js} +2 -2
  13. package/dist/{directory-config-BK1OhHa3.js → directory-config-BYMFzL29.js} +1 -1
  14. package/dist/directory-contract-api.js +1 -1
  15. package/dist/{directory-live-DP3CmwGf.js → directory-live-9JtJCiu8.js} +2 -2
  16. package/dist/{handle-action.guild-admin-B2cOoU2D.js → handle-action.guild-admin-xxGYrp-I.js} +2 -2
  17. package/dist/index.js +1 -1
  18. package/dist/{manager.runtime-CPHxr9B3.js → manager.runtime-NxCd-PVt.js} +3 -3
  19. package/dist/{message-handler-CKaTgBIV.js → message-handler-cizxbaDc.js} +7 -6
  20. package/dist/{message-handler.preflight--eAiaewz.js → message-handler.preflight-CbD0u7U7.js} +10 -10
  21. package/dist/{message-handler.process-PhKAmrEd.js → message-handler.process-Do4EM591.js} +10 -10
  22. package/dist/{message-utils-O1vK3kPu.js → message-utils-CJeAoISH.js} +1 -1
  23. package/dist/{outbound-adapter-fO_7hbTh.js → outbound-adapter-Dxs6iKEq.js} +62 -131
  24. package/dist/{pluralkit-B3MzPaPU.js → pluralkit-DI6RYaVj.js} +1 -1
  25. package/dist/presence-cache-z1N8MbJ3.js +45 -0
  26. package/dist/{probe-CxnDikWm.js → probe-esE_Oqdm.js} +1 -1
  27. package/dist/{probe.runtime-DLFkSDVB.js → probe.runtime-C3Atgpvr.js} +1 -1
  28. package/dist/{provider-BJaJ20MY.js → provider-B-s93q9s.js} +76 -26
  29. package/dist/{provider-session.runtime-D6xc-60s.js → provider-session.runtime-BKMOqHpd.js} +3 -3
  30. package/dist/provider.runtime-CaTJrpnl.js +2 -0
  31. package/dist/{resolve-allowlist-common-BDpBb8dF.js → resolve-allowlist-common-3gB2Gpmm.js} +1 -1
  32. package/dist/{resolve-channels-iJIjYfRw.js → resolve-channels-B3gQf8QL.js} +3 -3
  33. package/dist/{resolve-users-_fv1mm1f.js → resolve-users-BO10y5fJ.js} +3 -3
  34. package/dist/{runtime-ywXByivr.js → runtime-CFlR3L9X.js} +8 -8
  35. package/dist/runtime-api.actions.js +2 -2
  36. package/dist/runtime-api.js +20 -20
  37. package/dist/runtime-api.lookup.js +5 -5
  38. package/dist/runtime-api.monitor-CRiBIQEI.js +6 -0
  39. package/dist/runtime-api.monitor.js +6 -5
  40. package/dist/runtime-api.send.js +5 -5
  41. package/dist/runtime-api.threads.js +3 -3
  42. package/dist/{send-Dc5uQX5H.js → send-JHxfT4Pk.js} +6 -4
  43. package/dist/{send.components-D4bl20xr.js → send.components-CN35E2Ck.js} +11 -6
  44. package/dist/{send.outbound-5axvwLkl.js → send.outbound-B-cA1Esv.js} +15 -8
  45. package/dist/{send.receipt-B21MspvT.js → send.receipt-CGecJDin.js} +10 -1
  46. package/dist/{send.shared-9082A2sO.js → send.shared-vcbfThdy.js} +107 -16
  47. package/dist/session-binding-contract-api.js +1 -1
  48. package/dist/setup-plugin-api.js +1 -1
  49. package/dist/{subagent-hooks-NTv6B4up.js → subagent-hooks-20wXhVzZ.js} +2 -2
  50. package/dist/subagent-hooks-api.js +1 -1
  51. package/dist/{system-events-BzaI1WpN.js → system-events-DR27TE7p.js} +1 -1
  52. package/dist/{target-resolver-agnOrtOU.js → target-resolver-CDi1gI90.js} +2 -2
  53. package/dist/targets-C6yd3y8R.js +3 -0
  54. package/dist/{thread-bindings-DNitaHVh.js → thread-bindings-DU4T6nDo.js} +4 -4
  55. package/dist/{thread-bindings.discord-api-CjYNuvZa.js → thread-bindings.discord-api-CYkr-3Gj.js} +4 -4
  56. package/dist/{thread-bindings.manager-PZvJ4TJx.js → thread-bindings.manager-BqWs1UE2.js} +3 -3
  57. package/dist/{transcripts-source-Bi8N6h5X.js → transcripts-source-D-lBI5ZD.js} +1 -1
  58. package/dist/transcripts-source-api.js +1 -1
  59. package/dist/{typing-BdRqXUN3.js → typing-xr05bL-r.js} +1 -1
  60. package/node_modules/undici/README.md +8 -2
  61. package/node_modules/undici/docs/docs/api/Agent.md +248 -44
  62. package/node_modules/undici/docs/docs/api/BalancedPool.md +246 -48
  63. package/node_modules/undici/docs/docs/api/CacheStorage.md +171 -13
  64. package/node_modules/undici/docs/docs/api/CacheStore.md +294 -98
  65. package/node_modules/undici/docs/docs/api/Client.md +369 -179
  66. package/node_modules/undici/docs/docs/api/ClientStats.md +80 -14
  67. package/node_modules/undici/docs/docs/api/Connector.md +118 -36
  68. package/node_modules/undici/docs/docs/api/ContentType.md +65 -25
  69. package/node_modules/undici/docs/docs/api/Cookies.md +122 -71
  70. package/node_modules/undici/docs/docs/api/Debug.md +34 -18
  71. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +364 -164
  72. package/node_modules/undici/docs/docs/api/Dispatcher.md +485 -1102
  73. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +101 -87
  74. package/node_modules/undici/docs/docs/api/Errors.md +503 -40
  75. package/node_modules/undici/docs/docs/api/EventSource.md +294 -32
  76. package/node_modules/undici/docs/docs/api/Fetch.md +680 -31
  77. package/node_modules/undici/docs/docs/api/GlobalInstallation.md +78 -98
  78. package/node_modules/undici/docs/docs/api/H2CClient.md +298 -176
  79. package/node_modules/undici/docs/docs/api/Interceptors.md +414 -0
  80. package/node_modules/undici/docs/docs/api/MockAgent.md +333 -314
  81. package/node_modules/undici/docs/docs/api/MockCallHistory.md +272 -98
  82. package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +189 -26
  83. package/node_modules/undici/docs/docs/api/MockClient.md +151 -33
  84. package/node_modules/undici/docs/docs/api/MockErrors.md +56 -5
  85. package/node_modules/undici/docs/docs/api/MockPool.md +321 -258
  86. package/node_modules/undici/docs/docs/api/Pool.md +235 -43
  87. package/node_modules/undici/docs/docs/api/PoolStats.md +119 -13
  88. package/node_modules/undici/docs/docs/api/ProxyAgent.md +179 -160
  89. package/node_modules/undici/docs/docs/api/RedirectHandler.md +238 -63
  90. package/node_modules/undici/docs/docs/api/RetryAgent.md +113 -26
  91. package/node_modules/undici/docs/docs/api/RetryHandler.md +161 -77
  92. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +166 -72
  93. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +264 -542
  94. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +162 -187
  95. package/node_modules/undici/docs/docs/api/Util.md +68 -11
  96. package/node_modules/undici/docs/docs/api/WebSocket.md +475 -80
  97. package/node_modules/undici/docs/docs/api/api-lifecycle.md +100 -32
  98. package/node_modules/undici/docs/docs/best-practices/client-certificate.md +2 -0
  99. package/node_modules/undici/docs/docs/best-practices/crawling.md +3 -1
  100. package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +6 -4
  101. package/node_modules/undici/docs/docs/best-practices/mocking-request.md +9 -7
  102. package/node_modules/undici/docs/docs/best-practices/proxy.md +3 -1
  103. package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +10 -8
  104. package/node_modules/undici/docs/docs/best-practices/writing-tests.md +2 -0
  105. package/node_modules/undici/docs/docs/{GettingStarted.md → getting-started.md} +22 -19
  106. package/node_modules/undici/docs/docs/index.md +784 -0
  107. package/node_modules/undici/docs/docs/site.json +125 -0
  108. package/node_modules/undici/docs/docs/type-map.json +79 -0
  109. package/node_modules/undici/lib/api/api-request.js +7 -1
  110. package/node_modules/undici/lib/api/readable.js +47 -2
  111. package/node_modules/undici/lib/cache/memory-cache-store.js +54 -9
  112. package/node_modules/undici/lib/cache/sqlite-cache-store.js +7 -1
  113. package/node_modules/undici/lib/core/errors.js +20 -0
  114. package/node_modules/undici/lib/core/request.js +14 -3
  115. package/node_modules/undici/lib/core/util.js +30 -2
  116. package/node_modules/undici/lib/dispatcher/agent.js +3 -3
  117. package/node_modules/undici/lib/dispatcher/client-h1.js +65 -8
  118. package/node_modules/undici/lib/dispatcher/client-h2.js +265 -142
  119. package/node_modules/undici/lib/dispatcher/proxy-agent.js +40 -6
  120. package/node_modules/undici/lib/global.js +36 -16
  121. package/node_modules/undici/lib/handler/cache-handler.js +269 -61
  122. package/node_modules/undici/lib/handler/cache-revalidation-handler.js +13 -3
  123. package/node_modules/undici/lib/handler/redirect-handler.js +6 -2
  124. package/node_modules/undici/lib/handler/retry-handler.js +87 -23
  125. package/node_modules/undici/lib/interceptor/cache.js +159 -52
  126. package/node_modules/undici/lib/interceptor/decompress.js +9 -2
  127. package/node_modules/undici/lib/mock/mock-interceptor.js +25 -7
  128. package/node_modules/undici/lib/mock/mock-utils.js +39 -10
  129. package/node_modules/undici/lib/util/cache.js +372 -68
  130. package/node_modules/undici/lib/util/date.js +23 -6
  131. package/node_modules/undici/lib/web/cookies/parse.js +3 -2
  132. package/node_modules/undici/lib/web/cookies/util.js +79 -9
  133. package/node_modules/undici/lib/web/eventsource/util.js +1 -1
  134. package/node_modules/undici/lib/web/fetch/body.js +2 -1
  135. package/node_modules/undici/lib/web/fetch/constants.js +1 -1
  136. package/node_modules/undici/lib/web/fetch/index.js +11 -2
  137. package/node_modules/undici/lib/web/fetch/response.js +1 -3
  138. package/node_modules/undici/lib/web/fetch/util.js +4 -1
  139. package/node_modules/undici/package.json +2 -2
  140. package/node_modules/undici/types/client.d.ts +3 -3
  141. package/node_modules/undici/types/cookies.d.ts +1 -1
  142. package/node_modules/undici/types/dispatcher.d.ts +3 -3
  143. package/node_modules/undici/types/errors.d.ts +10 -0
  144. package/node_modules/undici/types/handlers.d.ts +2 -0
  145. package/node_modules/undici/types/mock-interceptor.d.ts +5 -1
  146. package/node_modules/undici/types/proxy-agent.d.ts +7 -0
  147. package/npm-shrinkwrap.json +7 -7
  148. package/package.json +5 -5
  149. package/dist/gateway-registry-DPxmW0Db.js +0 -74
  150. package/dist/provider.runtime-jNlHxUSW.js +0 -2
  151. package/dist/runtime-api.monitor-Bb5AaRzg.js +0 -6
  152. package/dist/targets-ClUPljCU.js +0 -3
@@ -18,6 +18,26 @@ function parseHttpDate (date) {
18
18
  }
19
19
  }
20
20
 
21
+ function makeDate (year, monthIdx, day, hour, minute, second, weekday) {
22
+ const result = new Date(Date.UTC(year, monthIdx, day, hour, minute, second))
23
+
24
+ // Date.UTC treats years 0-99 as 1900-1999. Reset the full year so component
25
+ // checks below validate the HTTP date as written.
26
+ if (year >= 0 && year <= 99) {
27
+ result.setUTCFullYear(year)
28
+ }
29
+
30
+ return result.getUTCFullYear() === year &&
31
+ result.getUTCMonth() === monthIdx &&
32
+ result.getUTCDate() === day &&
33
+ result.getUTCHours() === hour &&
34
+ result.getUTCMinutes() === minute &&
35
+ result.getUTCSeconds() === second &&
36
+ result.getUTCDay() === weekday
37
+ ? result
38
+ : undefined
39
+ }
40
+
21
41
  /**
22
42
  * @see https://httpwg.org/specs/rfc9110.html#preferred.date.format
23
43
  *
@@ -224,8 +244,7 @@ function parseImfDate (date) {
224
244
  second = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number
225
245
  }
226
246
 
227
- const result = new Date(Date.UTC(year, monthIdx, day, hour, minute, second))
228
- return result.getUTCDay() === weekday ? result : undefined
247
+ return makeDate(year, monthIdx, day, hour, minute, second, weekday)
229
248
  }
230
249
 
231
250
  /**
@@ -429,8 +448,7 @@ function parseAscTimeDate (date) {
429
448
  }
430
449
  const year = (yearDigit1 - 48) * 1000 + (yearDigit2 - 48) * 100 + (yearDigit3 - 48) * 10 + (yearDigit4 - 48)
431
450
 
432
- const result = new Date(Date.UTC(year, monthIdx, day, hour, minute, second))
433
- return result.getUTCDay() === weekday ? result : undefined
451
+ return makeDate(year, monthIdx, day, hour, minute, second, weekday)
434
452
  }
435
453
 
436
454
  /**
@@ -644,8 +662,7 @@ function parseRfc850Date (date) {
644
662
  second = (code1 - 48) * 10 + (code2 - 48) // Convert ASCII codes to number
645
663
  }
646
664
 
647
- const result = new Date(Date.UTC(year, monthIdx, day, hour, minute, second))
648
- return result.getUTCDay() === weekday ? result : undefined
665
+ return makeDate(year, monthIdx, day, hour, minute, second, weekday)
649
666
  }
650
667
 
651
668
  module.exports = {
@@ -178,8 +178,9 @@ function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {})
178
178
 
179
179
  // 2. If the attribute-value failed to parse as a cookie date, ignore
180
180
  // the cookie-av.
181
-
182
- cookieAttributeList.expires = expiryTime
181
+ if (!Number.isNaN(expiryTime.getTime())) {
182
+ cookieAttributeList.expires = expiryTime
183
+ }
183
184
  } else if (attributeNameLowercase === 'max-age') {
184
185
  // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
185
186
  // If the attribute-name case-insensitively matches the string "Max-
@@ -105,7 +105,7 @@ function validateCookiePath (path) {
105
105
 
106
106
  if (
107
107
  code < 0x20 || // exclude CTLs (0-31)
108
- code === 0x7F || // DEL
108
+ code > 0x7E || // exclude non-ascii and DEL
109
109
  code === 0x3B // ;
110
110
  ) {
111
111
  throw new Error('Invalid cookie path')
@@ -114,16 +114,80 @@ function validateCookiePath (path) {
114
114
  }
115
115
 
116
116
  /**
117
- * I have no idea why these values aren't allowed to be honest,
118
- * but Deno tests these. - Khafra
117
+ * <let-dig> ::= <letter> | <digit>
118
+ *
119
+ * <letter> ::= any one of the 52 alphabetic characters A through Z in
120
+ * upper case and a through z in lower case
121
+ *
122
+ * <digit> ::= any one of the ten digits 0 through 9r
123
+ *
124
+ * @see https://www.rfc-editor.org/rfc/rfc1034#section-3.5
125
+ * @param {number} code
126
+ */
127
+ function isLetterOrDigit (code) {
128
+ return (
129
+ (code >= 0x30 && code <= 0x39) || // 0-9
130
+ (code >= 0x41 && code <= 0x5A) || // A-Z
131
+ (code >= 0x61 && code <= 0x7A) // a-z
132
+ )
133
+ }
134
+
135
+ /**
136
+ * Validates a cookie domain against the "preferred name syntax".
137
+ *
138
+ * <domain> ::= <subdomain> | " "
139
+ * <subdomain> ::= <label> | <subdomain> "." <label>
140
+ * <label> ::= <let-dig> [ [ <ldh-str> ] <let-dig> ]
141
+ * <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
142
+ * <let-dig-hyp> ::= <let-dig> | "-"
143
+ *
144
+ * @see https://www.rfc-editor.org/rfc/rfc1034#section-3.5
145
+ * @see https://www.rfc-editor.org/rfc/rfc1123#section-2.1
146
+ * @see https://www.rfc-editor.org/rfc/rfc1035#section-2.3.4
119
147
  * @param {string} domain
120
148
  */
121
149
  function validateCookieDomain (domain) {
122
- if (
123
- domain.startsWith('-') ||
124
- domain.endsWith('.') ||
125
- domain.endsWith('-')
126
- ) {
150
+ // <domain> ::= <subdomain> | " "
151
+ if (domain === ' ') {
152
+ return
153
+ }
154
+
155
+ if (domain.length > 255) {
156
+ throw new Error('Invalid cookie domain')
157
+ }
158
+
159
+ let labelLength = 0
160
+
161
+ for (let i = 0; i < domain.length; ++i) {
162
+ const code = domain.charCodeAt(i)
163
+
164
+ if (code === 0x2E) {
165
+ if (labelLength === 0) {
166
+ throw new Error('Invalid cookie domain')
167
+ }
168
+
169
+ if (domain.charCodeAt(i - 1) === 0x2D) { // "-"
170
+ throw new Error('Invalid cookie domain')
171
+ }
172
+
173
+ labelLength = 0
174
+ continue
175
+ }
176
+
177
+ if (labelLength === 0 && !isLetterOrDigit(code)) {
178
+ throw new Error('Invalid cookie domain')
179
+ }
180
+
181
+ if (!isLetterOrDigit(code) && code !== 0x2D) { // "-"
182
+ throw new Error('Invalid cookie domain')
183
+ }
184
+
185
+ if (++labelLength > 63) {
186
+ throw new Error('Invalid cookie domain')
187
+ }
188
+ }
189
+
190
+ if (labelLength === 0 || domain.charCodeAt(domain.length - 1) === 0x2D) { // "-"
127
191
  throw new Error('Invalid cookie domain')
128
192
  }
129
193
  }
@@ -266,7 +330,13 @@ function stringify (cookie) {
266
330
 
267
331
  const [key, ...value] = part.split('=')
268
332
 
269
- out.push(`${key.trim()}=${value.join('=')}`)
333
+ const trimmedKey = key.trim()
334
+ const joinedValue = value.join('=')
335
+
336
+ validateCookieName(trimmedKey)
337
+ validateCookieValue(joinedValue)
338
+
339
+ out.push(`${trimmedKey}=${joinedValue}`)
270
340
  }
271
341
 
272
342
  return out.join('; ')
@@ -49,7 +49,7 @@ function createPotentialCORSRequest (url, destination, corsAttributeState, sameO
49
49
  destination,
50
50
  mode,
51
51
  credentials: credentialsMode,
52
- useCredentials: true
52
+ useURLCredentials: true
53
53
  })
54
54
  }
55
55
 
@@ -16,6 +16,7 @@ const { serializeAMimeType } = require('./data-url')
16
16
  const { multipartFormDataParser } = require('./formdata-parser')
17
17
  const { parseJSONFromBytes } = require('../infra')
18
18
  const { utf8DecodeBytes } = require('../../encoding')
19
+ const { ReadableStreamTee } = require('node:stream/web')
19
20
 
20
21
  const textEncoder = new TextEncoder()
21
22
  function noop () {}
@@ -279,7 +280,7 @@ function cloneBody (body) {
279
280
  // https://fetch.spec.whatwg.org/#concept-body-clone
280
281
 
281
282
  // 1. Let « out1, out2 » be the result of teeing body’s stream.
282
- const { 0: out1, 1: out2 } = body.stream.tee()
283
+ const { 0: out1, 1: out2 } = ReadableStreamTee?.(body.stream, true) ?? body.stream.tee()
283
284
 
284
285
  // 2. Set body’s stream to out1.
285
286
  body.stream = out1
@@ -46,7 +46,7 @@ const referrerPolicyTokensSet = new Set(referrerPolicyTokens)
46
46
 
47
47
  const requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])
48
48
 
49
- const safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE'])
49
+ const safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE', 'QUERY'])
50
50
  const safeMethodsSet = new Set(safeMethods)
51
51
 
52
52
  const requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])
@@ -1431,7 +1431,16 @@ async function httpNetworkOrCacheFetch (
1431
1431
  // Otherwise:
1432
1432
 
1433
1433
  // 1. Set httpRequest to a clone of request.
1434
- httpRequest = cloneRequest(request)
1434
+ // Implementations are encouraged to avoid teeing request’s body’s stream
1435
+ // when request’s body’s source is null as only a single body is needed in
1436
+ // that case. E.g., when request’s body’s source is null, redirects and
1437
+ // authentication will end up failing the fetch.
1438
+ if (request.body?.source != null) {
1439
+ httpRequest = cloneRequest(request)
1440
+ } else {
1441
+ httpRequest = cloneRequest({ ...request, body: null })
1442
+ httpRequest.body = request.body
1443
+ }
1435
1444
 
1436
1445
  // 2. Set httpFetchParams to a copy of fetchParams.
1437
1446
  httpFetchParams = { ...fetchParams }
@@ -1560,7 +1569,7 @@ async function httpNetworkOrCacheFetch (
1560
1569
  // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
1561
1570
  if (!httpRequest.headersList.contains('accept-encoding', true)) {
1562
1571
  if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
1563
- httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true)
1572
+ httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate, zstd', true)
1564
1573
  } else {
1565
1574
  httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true)
1566
1575
  }
@@ -45,9 +45,7 @@ class Response {
45
45
  static json (data, init = undefined) {
46
46
  webidl.argumentLengthCheck(arguments, 1, 'Response.json')
47
47
 
48
- if (init !== null) {
49
- init = webidl.converters.ResponseInit(init)
50
- }
48
+ init = webidl.converters.ResponseInit(init)
51
49
 
52
50
  // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
53
51
  const bytes = textEncoder.encode(
@@ -1195,7 +1195,10 @@ function simpleRangeHeaderValue (value, allowWhitespace) {
1195
1195
  // 18. If rangeStartValue and rangeEndValue are numbers, and rangeStartValue is
1196
1196
  // greater than rangeEndValue, then return failure.
1197
1197
  // Note: ... when can they not be numbers?
1198
- if (rangeStartValue > rangeEndValue) {
1198
+ // Note: rangeStartValue or rangeEndValue may be null for open-ended ranges
1199
+ // such as `bytes=5-` or `bytes=-5`. A null value must not be coerced to 0
1200
+ // in the comparison, so this check only applies when both are numbers.
1201
+ if (rangeStartValue !== null && rangeEndValue !== null && rangeStartValue > rangeEndValue) {
1199
1202
  return 'failure'
1200
1203
  }
1201
1204
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici",
3
- "version": "8.5.0",
3
+ "version": "8.9.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": {
@@ -116,7 +116,7 @@
116
116
  "@types/node": "^22.0.0",
117
117
  "abort-controller": "^3.0.0",
118
118
  "borp": "^1.0.0",
119
- "c8": "^11.0.0",
119
+ "c8": "^12.0.0",
120
120
  "cross-env": "^10.0.0",
121
121
  "dns-packet": "^5.4.0",
122
122
  "esbuild": "^0.28.0",
@@ -33,7 +33,7 @@ export declare namespace Client {
33
33
  export interface Options {
34
34
  /** The maximum length of request headers in bytes. Default: Node.js' `--max-http-header-size` or `16384` (16KiB). */
35
35
  maxHeaderSize?: number;
36
- /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: `300e3` milliseconds (300s). */
36
+ /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: `300e3` milliseconds (300s). HTTP/1.1 parser timeouts are not guaranteed to fire with exact millisecond precision: delays up to 1000ms use native timers, while larger delays use lower-overhead fast timers with a target resolution around 500ms. */
37
37
  headersTimeout?: number;
38
38
  /** @deprecated unsupported socketTimeout, use headersTimeout & bodyTimeout instead */
39
39
  socketTimeout?: never;
@@ -41,7 +41,7 @@ export declare namespace Client {
41
41
  requestTimeout?: never;
42
42
  /** The timeout for establishing a socket connection, in milliseconds. Use `0` to disable it entirely. Default: `10e3` milliseconds (10s). */
43
43
  connectTimeout?: number;
44
- /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Default: `300e3` milliseconds (300s). */
44
+ /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Default: `300e3` milliseconds (300s). HTTP/1.1 parser timeouts are not guaranteed to fire with exact millisecond precision: delays up to 1000ms use native timers, while larger delays use lower-overhead fast timers with a target resolution around 500ms. */
45
45
  bodyTimeout?: number;
46
46
  /** @deprecated unsupported idleTimeout, use keepAliveTimeout instead */
47
47
  idleTimeout?: never;
@@ -57,7 +57,7 @@ export declare namespace Client {
57
57
  keepAliveTimeoutThreshold?: number;
58
58
  /** An IPC endpoint, either a Unix domain socket or Windows named pipe. Default: `null`. */
59
59
  socketPath?: string;
60
- /** The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Default: `1`. */
60
+ /** The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Only enable values greater than `1` when the remote server is trusted. Default: `1`. */
61
61
  pipelining?: number;
62
62
  /** @deprecated use the connect option instead */
63
63
  tls?: never;
@@ -18,7 +18,7 @@ export interface Cookie {
18
18
  export function deleteCookie (
19
19
  headers: Headers,
20
20
  name: string,
21
- attributes?: { name?: string, domain?: string }
21
+ attributes?: { path?: string, domain?: string }
22
22
  ): void
23
23
 
24
24
  export function getCookies (headers: Headers): Record<string, string>
@@ -111,13 +111,13 @@ declare namespace Dispatcher {
111
111
  idempotent?: boolean;
112
112
  /** Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received. Defaults to `method !== 'HEAD'`. */
113
113
  blocking?: boolean;
114
- /** The IP Type of Service (ToS) value for the request socket. Must be an integer between 0 and 255. Default: `0` */
114
+ /** The IP Type of Service (ToS) value for the request socket. Must be an integer between 0 and 255. */
115
115
  typeOfService?: number | null;
116
116
  /** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */
117
117
  upgrade?: boolean | string | null;
118
- /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. */
118
+ /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. HTTP/1.1 parser timeouts are not guaranteed to fire with exact millisecond precision: delays up to 1000ms use native timers, while larger delays use lower-overhead fast timers with a target resolution around 500ms. */
119
119
  headersTimeout?: number | null;
120
- /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use 0 to disable it entirely. Defaults to 300 seconds. */
120
+ /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use 0 to disable it entirely. Defaults to 300 seconds. HTTP/1.1 parser timeouts are not guaranteed to fire with exact millisecond precision: delays up to 1000ms use native timers, while larger delays use lower-overhead fast timers with a target resolution around 500ms. */
121
121
  bodyTimeout?: number | null;
122
122
  /** Whether the request should stablish a keep-alive or not. Default `false` */
123
123
  reset?: boolean;
@@ -154,6 +154,16 @@ declare namespace Errors {
154
154
  code: 'UND_ERR_PRX_TLS'
155
155
  }
156
156
 
157
+ export class ProxyConnectionError extends UndiciError {
158
+ constructor (
159
+ cause?: Error,
160
+ message?: string,
161
+ options?: Record<any, any>
162
+ )
163
+ name: 'ProxyConnectionError'
164
+ code: 'UND_ERR_PRX_CONN'
165
+ }
166
+
157
167
  export class MaxOriginsReachedError extends UndiciError {
158
168
  name: 'MaxOriginsReachedError'
159
169
  code: 'UND_ERR_MAX_ORIGINS_REACHED'
@@ -1,6 +1,8 @@
1
1
  import Dispatcher from './dispatcher'
2
2
 
3
3
  export declare class RedirectHandler implements Dispatcher.DispatchHandler {
4
+ static buildDispatch (dispatcher: Dispatcher, maxRedirections: number): Dispatcher.Dispatch
5
+
4
6
  constructor (
5
7
  dispatch: Dispatcher.Dispatch,
6
8
  maxRedirections: number,
@@ -75,9 +75,13 @@ declare namespace MockInterceptor {
75
75
  opts: MockResponseCallbackOptions
76
76
  ) => TData | Buffer | string
77
77
 
78
+ export type MockReplyOptions<TData extends object = object> = {
79
+ statusCode: number, data?: TData | Buffer | string, responseOptions?: MockResponseOptions
80
+ }
81
+
78
82
  export type MockReplyOptionsCallback<TData extends object = object> = (
79
83
  opts: MockResponseCallbackOptions
80
- ) => { statusCode: number, data?: TData | Buffer | string, responseOptions?: MockResponseOptions }
84
+ ) => MockReplyOptions<TData> | Promise<MockReplyOptions<TData>>
81
85
  }
82
86
 
83
87
  interface Interceptable extends Dispatcher {
@@ -24,6 +24,13 @@ declare namespace ProxyAgent {
24
24
  requestTls?: buildConnector.BuildOptions;
25
25
  proxyTls?: buildConnector.BuildOptions;
26
26
  clientFactory?(origin: URL, opts: object): Dispatcher;
27
+ /**
28
+ * Undici tunnels via CONNECT when the target endpoint uses HTTPS, and
29
+ * forwards (HTTP/1.1 absolute-form request-target, per RFC 9112 §3.2.2)
30
+ * otherwise, regardless of whether the proxy URL is HTTP or HTTPS. The
31
+ * non-tunneled forwarding path does not negotiate HTTP/2 with the proxy.
32
+ * Set to true to force tunneling for plain HTTP requests as well.
33
+ */
27
34
  proxyTunnel?: boolean;
28
35
  }
29
36
  }
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@openclaw/discord",
3
- "version": "2026.6.11",
3
+ "version": "2026.6.34",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/discord",
9
- "version": "2026.6.11",
9
+ "version": "2026.6.34",
10
10
  "dependencies": {
11
11
  "@discordjs/voice": "0.19.2",
12
12
  "discord-api-types": "0.38.48",
13
13
  "libopus-wasm": "0.2.0",
14
14
  "typebox": "1.1.39",
15
- "undici": "8.5.0",
15
+ "undici": "8.9.0",
16
16
  "ws": "8.21.0"
17
17
  },
18
18
  "peerDependencies": {
19
- "openclaw": ">=2026.6.11"
19
+ "openclaw": ">=2026.6.34"
20
20
  },
21
21
  "peerDependenciesMeta": {
22
22
  "openclaw": {
@@ -399,9 +399,9 @@
399
399
  "license": "MIT"
400
400
  },
401
401
  "node_modules/undici": {
402
- "version": "8.5.0",
403
- "resolved": "https://registry.npmjs.org/undici/-/undici-8.5.0.tgz",
404
- "integrity": "sha512-xamtWoB1EshgjpmlXd7GGm2VfdDtw1+rD8uhry8pSNW3If6S8E0m2T2+orSKeZXEn/aPJMviCpDBA65WJt8zhg==",
402
+ "version": "8.9.0",
403
+ "resolved": "https://registry.npmjs.org/undici/-/undici-8.9.0.tgz",
404
+ "integrity": "sha512-aWZpUj7XoGonMClx4gdDRfgBjqeA+F473aDmROQQbM9n6PRfK/u1q/a0X4wMTgcHfT8H6fpbt98PFuDUwFg2YA==",
405
405
  "license": "MIT",
406
406
  "engines": {
407
407
  "node": ">=22.19.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/discord",
3
- "version": "2026.6.11",
3
+ "version": "2026.6.34",
4
4
  "description": "OpenClaw Discord channel plugin for channels, DMs, commands, and app events.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,11 +12,11 @@
12
12
  "discord-api-types": "0.38.48",
13
13
  "libopus-wasm": "0.2.0",
14
14
  "typebox": "1.1.39",
15
- "undici": "8.5.0",
15
+ "undici": "8.9.0",
16
16
  "ws": "8.21.0"
17
17
  },
18
18
  "peerDependencies": {
19
- "openclaw": ">=2026.6.11"
19
+ "openclaw": ">=2026.6.34"
20
20
  },
21
21
  "peerDependenciesMeta": {
22
22
  "openclaw": {
@@ -63,10 +63,10 @@
63
63
  "allowInvalidConfigRecovery": true
64
64
  },
65
65
  "compat": {
66
- "pluginApi": ">=2026.6.11"
66
+ "pluginApi": ">=2026.6.34"
67
67
  },
68
68
  "build": {
69
- "openclawVersion": "2026.6.11"
69
+ "openclawVersion": "2026.6.34"
70
70
  },
71
71
  "release": {
72
72
  "publishToClawHub": true,
@@ -1,74 +0,0 @@
1
- //#region extensions/discord/src/monitor/presence-cache.ts
2
- /**
3
- * In-memory cache of Discord user presence data.
4
- * Populated by PRESENCE_UPDATE gateway events when the GuildPresences intent is enabled.
5
- * Per-account maps are capped to prevent unbounded growth (#4948).
6
- */
7
- const MAX_PRESENCE_PER_ACCOUNT = 5e3;
8
- const presenceCache = /* @__PURE__ */ new Map();
9
- function resolveAccountKey$1(accountId) {
10
- return accountId ?? "default";
11
- }
12
- /** Update cached presence for a user. */
13
- function setPresence(accountId, userId, data) {
14
- const accountKey = resolveAccountKey$1(accountId);
15
- let accountCache = presenceCache.get(accountKey);
16
- if (!accountCache) {
17
- accountCache = /* @__PURE__ */ new Map();
18
- presenceCache.set(accountKey, accountCache);
19
- }
20
- accountCache.set(userId, data);
21
- if (accountCache.size > MAX_PRESENCE_PER_ACCOUNT) {
22
- const oldest = accountCache.keys().next().value;
23
- if (oldest !== void 0) accountCache.delete(oldest);
24
- }
25
- }
26
- /** Get cached presence for a user. Returns undefined if not cached. */
27
- function getPresence(accountId, userId) {
28
- return presenceCache.get(resolveAccountKey$1(accountId))?.get(userId);
29
- }
30
- /** Clear cached presence data. */
31
- function clearPresences(accountId) {
32
- if (accountId) {
33
- presenceCache.delete(resolveAccountKey$1(accountId));
34
- return;
35
- }
36
- presenceCache.clear();
37
- }
38
- /** Get the number of cached presence entries. */
39
- function presenceCacheSize() {
40
- let total = 0;
41
- for (const accountCache of presenceCache.values()) total += accountCache.size;
42
- return total;
43
- }
44
- //#endregion
45
- //#region extensions/discord/src/monitor/gateway-registry.ts
46
- /**
47
- * Module-level registry of active Discord GatewayPlugin instances.
48
- * Bridges the gap between agent tool handlers (which only have REST access)
49
- * and the gateway WebSocket (needed for operations like updatePresence).
50
- * Follows the same pattern as presence-cache.ts.
51
- */
52
- const gatewayRegistry = /* @__PURE__ */ new Map();
53
- const DEFAULT_ACCOUNT_KEY = "\0__default__";
54
- function resolveAccountKey(accountId) {
55
- return accountId ?? DEFAULT_ACCOUNT_KEY;
56
- }
57
- /** Register a GatewayPlugin instance for an account. */
58
- function registerGateway(accountId, gateway) {
59
- gatewayRegistry.set(resolveAccountKey(accountId), gateway);
60
- }
61
- /** Unregister a GatewayPlugin instance for an account. */
62
- function unregisterGateway(accountId) {
63
- gatewayRegistry.delete(resolveAccountKey(accountId));
64
- }
65
- /** Get the GatewayPlugin for an account. Returns undefined if not registered. */
66
- function getGateway(accountId) {
67
- return gatewayRegistry.get(resolveAccountKey(accountId));
68
- }
69
- /** Clear all registered gateways (for testing). */
70
- function clearGateways() {
71
- gatewayRegistry.clear();
72
- }
73
- //#endregion
74
- export { clearPresences as a, setPresence as c, unregisterGateway as i, getGateway as n, getPresence as o, registerGateway as r, presenceCacheSize as s, clearGateways as t };
@@ -1,2 +0,0 @@
1
- import { t as monitorDiscordProvider } from "./provider-BJaJ20MY.js";
2
- export { monitorDiscordProvider };
@@ -1,6 +0,0 @@
1
- import "./allow-list-C-MqM-B_.js";
2
- import "./timeouts-C5TBc_9x.js";
3
- import "./provider-BJaJ20MY.js";
4
- import "./message-utils-O1vK3kPu.js";
5
- import "./message-handler-CKaTgBIV.js";
6
- export {};
@@ -1,3 +0,0 @@
1
- import "./send.receipt-B21MspvT.js";
2
- import "./target-resolver-agnOrtOU.js";
3
- export {};