@openclaw/discord 2026.6.33 → 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.
- package/dist/api.js +1 -1
- package/dist/{channel-Ddnonoy4.js → channel-DU4jnQgl.js} +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{manager.runtime-BK6cf2Zu.js → manager.runtime-NxCd-PVt.js} +1 -1
- package/dist/{message-handler-BqpJIavO.js → message-handler-cizxbaDc.js} +3 -2
- package/dist/{message-handler.preflight-C90MxCcv.js → message-handler.preflight-CbD0u7U7.js} +2 -2
- package/dist/{message-handler.process-CeQ7Bd_3.js → message-handler.process-Do4EM591.js} +2 -2
- package/dist/{provider-C7376XFH.js → provider-B-s93q9s.js} +31 -6
- package/dist/{provider-session.runtime-CCdqogGf.js → provider-session.runtime-BKMOqHpd.js} +1 -1
- package/dist/provider.runtime-CaTJrpnl.js +2 -0
- package/dist/runtime-api.js +3 -3
- package/dist/{runtime-api.monitor-4oc58TSk.js → runtime-api.monitor-CRiBIQEI.js} +2 -2
- package/dist/runtime-api.monitor.js +3 -3
- package/node_modules/undici/README.md +8 -2
- package/node_modules/undici/docs/docs/api/Agent.md +248 -44
- package/node_modules/undici/docs/docs/api/BalancedPool.md +246 -48
- package/node_modules/undici/docs/docs/api/CacheStorage.md +171 -13
- package/node_modules/undici/docs/docs/api/CacheStore.md +294 -98
- package/node_modules/undici/docs/docs/api/Client.md +369 -179
- package/node_modules/undici/docs/docs/api/ClientStats.md +80 -14
- package/node_modules/undici/docs/docs/api/Connector.md +118 -36
- package/node_modules/undici/docs/docs/api/ContentType.md +65 -25
- package/node_modules/undici/docs/docs/api/Cookies.md +122 -71
- package/node_modules/undici/docs/docs/api/Debug.md +34 -18
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +364 -164
- package/node_modules/undici/docs/docs/api/Dispatcher.md +485 -1102
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +101 -87
- package/node_modules/undici/docs/docs/api/Errors.md +503 -40
- package/node_modules/undici/docs/docs/api/EventSource.md +294 -32
- package/node_modules/undici/docs/docs/api/Fetch.md +680 -31
- package/node_modules/undici/docs/docs/api/GlobalInstallation.md +78 -98
- package/node_modules/undici/docs/docs/api/H2CClient.md +298 -176
- package/node_modules/undici/docs/docs/api/Interceptors.md +414 -0
- package/node_modules/undici/docs/docs/api/MockAgent.md +333 -314
- package/node_modules/undici/docs/docs/api/MockCallHistory.md +272 -98
- package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +189 -26
- package/node_modules/undici/docs/docs/api/MockClient.md +151 -33
- package/node_modules/undici/docs/docs/api/MockErrors.md +56 -5
- package/node_modules/undici/docs/docs/api/MockPool.md +321 -258
- package/node_modules/undici/docs/docs/api/Pool.md +235 -43
- package/node_modules/undici/docs/docs/api/PoolStats.md +119 -13
- package/node_modules/undici/docs/docs/api/ProxyAgent.md +179 -160
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +238 -63
- package/node_modules/undici/docs/docs/api/RetryAgent.md +113 -26
- package/node_modules/undici/docs/docs/api/RetryHandler.md +161 -77
- package/node_modules/undici/docs/docs/api/RoundRobinPool.md +166 -72
- package/node_modules/undici/docs/docs/api/SnapshotAgent.md +264 -542
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +162 -187
- package/node_modules/undici/docs/docs/api/Util.md +68 -11
- package/node_modules/undici/docs/docs/api/WebSocket.md +475 -80
- package/node_modules/undici/docs/docs/api/api-lifecycle.md +100 -32
- package/node_modules/undici/docs/docs/best-practices/client-certificate.md +2 -0
- package/node_modules/undici/docs/docs/best-practices/crawling.md +3 -1
- package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +6 -4
- package/node_modules/undici/docs/docs/best-practices/mocking-request.md +9 -7
- package/node_modules/undici/docs/docs/best-practices/proxy.md +3 -1
- package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +10 -8
- package/node_modules/undici/docs/docs/best-practices/writing-tests.md +2 -0
- package/node_modules/undici/docs/docs/{GettingStarted.md → getting-started.md} +22 -19
- package/node_modules/undici/docs/docs/index.md +784 -0
- package/node_modules/undici/docs/docs/site.json +125 -0
- package/node_modules/undici/docs/docs/type-map.json +79 -0
- package/node_modules/undici/lib/api/api-request.js +7 -1
- package/node_modules/undici/lib/api/readable.js +47 -2
- package/node_modules/undici/lib/cache/memory-cache-store.js +54 -9
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +7 -1
- package/node_modules/undici/lib/core/errors.js +20 -0
- package/node_modules/undici/lib/core/request.js +14 -3
- package/node_modules/undici/lib/core/util.js +30 -2
- package/node_modules/undici/lib/dispatcher/agent.js +3 -3
- package/node_modules/undici/lib/dispatcher/client-h1.js +65 -8
- package/node_modules/undici/lib/dispatcher/client-h2.js +265 -142
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +40 -6
- package/node_modules/undici/lib/global.js +36 -16
- package/node_modules/undici/lib/handler/cache-handler.js +269 -61
- package/node_modules/undici/lib/handler/cache-revalidation-handler.js +13 -3
- package/node_modules/undici/lib/handler/redirect-handler.js +6 -2
- package/node_modules/undici/lib/handler/retry-handler.js +87 -23
- package/node_modules/undici/lib/interceptor/cache.js +159 -52
- package/node_modules/undici/lib/interceptor/decompress.js +9 -2
- package/node_modules/undici/lib/mock/mock-interceptor.js +25 -7
- package/node_modules/undici/lib/mock/mock-utils.js +39 -10
- package/node_modules/undici/lib/util/cache.js +372 -68
- package/node_modules/undici/lib/util/date.js +23 -6
- package/node_modules/undici/lib/web/cookies/parse.js +3 -2
- package/node_modules/undici/lib/web/cookies/util.js +79 -9
- package/node_modules/undici/lib/web/eventsource/util.js +1 -1
- package/node_modules/undici/lib/web/fetch/body.js +2 -1
- package/node_modules/undici/lib/web/fetch/constants.js +1 -1
- package/node_modules/undici/lib/web/fetch/index.js +11 -2
- package/node_modules/undici/lib/web/fetch/response.js +1 -3
- package/node_modules/undici/lib/web/fetch/util.js +4 -1
- package/node_modules/undici/package.json +2 -2
- package/node_modules/undici/types/client.d.ts +3 -3
- package/node_modules/undici/types/cookies.d.ts +1 -1
- package/node_modules/undici/types/dispatcher.d.ts +3 -3
- package/node_modules/undici/types/errors.d.ts +10 -0
- package/node_modules/undici/types/handlers.d.ts +2 -0
- package/node_modules/undici/types/mock-interceptor.d.ts +5 -1
- package/node_modules/undici/types/proxy-agent.d.ts +7 -0
- package/npm-shrinkwrap.json +7 -7
- package/package.json +5 -5
- package/dist/provider.runtime-D1m66kDS.js +0 -2
|
@@ -4,7 +4,7 @@ const { kProxy, kClose, kDestroy, kDispatch } = require('../core/symbols')
|
|
|
4
4
|
const Agent = require('./agent')
|
|
5
5
|
const Pool = require('./pool')
|
|
6
6
|
const DispatcherBase = require('./dispatcher-base')
|
|
7
|
-
const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require('../core/errors')
|
|
7
|
+
const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError, ProxyConnectionError } = require('../core/errors')
|
|
8
8
|
const buildConnector = require('../core/connect')
|
|
9
9
|
const Client = require('./client')
|
|
10
10
|
const { channels } = require('../core/diagnostics')
|
|
@@ -37,10 +37,15 @@ function defaultAgentFactory (origin, opts) {
|
|
|
37
37
|
return new Pool(origin, opts)
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
function shouldProxyTunnel (requestProtocol, proxyTunnel) {
|
|
41
|
+
return proxyTunnel === true || requestProtocol !== 'http:'
|
|
42
|
+
}
|
|
43
|
+
|
|
40
44
|
class Http1ProxyWrapper extends DispatcherBase {
|
|
41
45
|
#client
|
|
46
|
+
#proxyServername
|
|
42
47
|
|
|
43
|
-
constructor (proxyUrl, { headers = {}, connect, factory }) {
|
|
48
|
+
constructor (proxyUrl, { headers = {}, connect, factory, proxyServername }) {
|
|
44
49
|
if (!proxyUrl) {
|
|
45
50
|
throw new InvalidArgumentError('Proxy URL is mandatory')
|
|
46
51
|
}
|
|
@@ -48,6 +53,7 @@ class Http1ProxyWrapper extends DispatcherBase {
|
|
|
48
53
|
super()
|
|
49
54
|
|
|
50
55
|
this[kProxyHeaders] = headers
|
|
56
|
+
this.#proxyServername = proxyServername
|
|
51
57
|
if (factory) {
|
|
52
58
|
this.#client = factory(proxyUrl, { connect })
|
|
53
59
|
} else {
|
|
@@ -82,6 +88,13 @@ class Http1ProxyWrapper extends DispatcherBase {
|
|
|
82
88
|
}
|
|
83
89
|
opts.headers = { ...this[kProxyHeaders], ...headers }
|
|
84
90
|
|
|
91
|
+
// Pin the SNI/cert hostname to the proxy. Without this the underlying
|
|
92
|
+
// Client would derive it from the (rewritten) Host header, which points
|
|
93
|
+
// at the target — wrong for the TLS handshake to the proxy itself.
|
|
94
|
+
if (this.#proxyServername != null) {
|
|
95
|
+
opts.servername = this.#proxyServername
|
|
96
|
+
}
|
|
97
|
+
|
|
85
98
|
return this.#client[kDispatch](opts, handler)
|
|
86
99
|
}
|
|
87
100
|
|
|
@@ -105,7 +118,7 @@ class ProxyAgent extends DispatcherBase {
|
|
|
105
118
|
throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
|
|
106
119
|
}
|
|
107
120
|
|
|
108
|
-
const { proxyTunnel
|
|
121
|
+
const { proxyTunnel, connectTimeout } = opts
|
|
109
122
|
|
|
110
123
|
super()
|
|
111
124
|
|
|
@@ -132,6 +145,7 @@ class ProxyAgent extends DispatcherBase {
|
|
|
132
145
|
}
|
|
133
146
|
|
|
134
147
|
const connect = buildConnector({ timeout: connectTimeout, ...opts.proxyTls })
|
|
148
|
+
const connectHTTP1 = buildConnector({ timeout: connectTimeout, ...opts.proxyTls, allowH2: false })
|
|
135
149
|
this[kConnectEndpoint] = buildConnector({ timeout: connectTimeout, ...opts.requestTls })
|
|
136
150
|
this[kConnectEndpointHTTP1] = buildConnector({ timeout: connectTimeout, ...opts.requestTls, allowH2: false })
|
|
137
151
|
|
|
@@ -152,11 +166,23 @@ class ProxyAgent extends DispatcherBase {
|
|
|
152
166
|
})
|
|
153
167
|
}
|
|
154
168
|
|
|
155
|
-
if (!
|
|
169
|
+
if (!shouldProxyTunnel(protocol, this[kTunnelProxy])) {
|
|
170
|
+
const forwardConnect = this[kProxy].protocol === 'https:'
|
|
171
|
+
? (opts, cb) => connectHTTP1(opts, (err, socket) => {
|
|
172
|
+
if (err && err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
|
|
173
|
+
cb(new SecureProxyConnectionError(err))
|
|
174
|
+
} else {
|
|
175
|
+
cb(err, socket)
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
: connectHTTP1
|
|
156
179
|
return new Http1ProxyWrapper(this[kProxy].uri, {
|
|
157
180
|
headers: this[kProxyHeaders],
|
|
158
|
-
connect,
|
|
159
|
-
factory: agentFactory
|
|
181
|
+
connect: forwardConnect,
|
|
182
|
+
factory: agentFactory,
|
|
183
|
+
proxyServername: this[kProxy].protocol === 'https:'
|
|
184
|
+
? (this[kProxyTls]?.servername || proxyHostname)
|
|
185
|
+
: undefined
|
|
160
186
|
})
|
|
161
187
|
}
|
|
162
188
|
return agentFactory(origin, options)
|
|
@@ -231,6 +257,14 @@ class ProxyAgent extends DispatcherBase {
|
|
|
231
257
|
if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
|
|
232
258
|
// Throw a custom error to avoid loop in client.js#connect
|
|
233
259
|
callback(new SecureProxyConnectionError(err))
|
|
260
|
+
} else if (err.code === 'UND_ERR_SOCKET') {
|
|
261
|
+
// A socket failure while establishing the tunnel means the CONNECT
|
|
262
|
+
// never completed, so there is nothing to recover - the proxy just
|
|
263
|
+
// tore down the connection. client.js#onError treats UND_ERR_SOCKET
|
|
264
|
+
// as a recoverable error on an established connection and leaves the
|
|
265
|
+
// request queued, which makes connect() retry forever. Surface it as
|
|
266
|
+
// a non-recoverable proxy error so the request fails instead. (#3897)
|
|
267
|
+
callback(new ProxyConnectionError(err))
|
|
234
268
|
} else {
|
|
235
269
|
callback(err)
|
|
236
270
|
}
|
|
@@ -8,6 +8,9 @@ const { InvalidArgumentError } = require('./core/errors')
|
|
|
8
8
|
const Agent = require('./dispatcher/agent')
|
|
9
9
|
const Dispatcher1Wrapper = require('./dispatcher/dispatcher1-wrapper')
|
|
10
10
|
|
|
11
|
+
// Fallback storage for when globalThis is not extensible (e.g. frozen)
|
|
12
|
+
let fallbackDispatcher
|
|
13
|
+
|
|
11
14
|
if (getGlobalDispatcher() === undefined) {
|
|
12
15
|
setGlobalDispatcher(new Agent())
|
|
13
16
|
}
|
|
@@ -17,25 +20,42 @@ function setGlobalDispatcher (agent) {
|
|
|
17
20
|
throw new InvalidArgumentError('Argument agent must implement Agent')
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
try {
|
|
24
|
+
Object.defineProperty(globalThis, globalDispatcher, {
|
|
25
|
+
value: agent,
|
|
26
|
+
writable: true,
|
|
27
|
+
enumerable: false,
|
|
28
|
+
configurable: false
|
|
29
|
+
})
|
|
30
|
+
} catch (err) {
|
|
31
|
+
// globalThis is not extensible (e.g. Object.freeze(globalThis))
|
|
32
|
+
// Use fallback storage instead
|
|
33
|
+
if (err instanceof TypeError) {
|
|
34
|
+
fallbackDispatcher = agent
|
|
35
|
+
return
|
|
36
|
+
}
|
|
37
|
+
throw err
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
const legacyAgent = agent instanceof Dispatcher1Wrapper ? agent : new Dispatcher1Wrapper(agent)
|
|
42
|
+
|
|
43
|
+
Object.defineProperty(globalThis, legacyGlobalDispatcher, {
|
|
44
|
+
value: legacyAgent,
|
|
45
|
+
writable: true,
|
|
46
|
+
enumerable: false,
|
|
47
|
+
configurable: false
|
|
48
|
+
})
|
|
49
|
+
} catch (err) {
|
|
50
|
+
// globalThis is not extensible; fallback storage is already set
|
|
51
|
+
if (!(err instanceof TypeError)) {
|
|
52
|
+
throw err
|
|
53
|
+
}
|
|
54
|
+
}
|
|
35
55
|
}
|
|
36
56
|
|
|
37
57
|
function getGlobalDispatcher () {
|
|
38
|
-
return globalThis[globalDispatcher]
|
|
58
|
+
return globalThis[globalDispatcher] ?? fallbackDispatcher
|
|
39
59
|
}
|
|
40
60
|
|
|
41
61
|
// These are the globals that can be installed by undici.install().
|