@openclaw/discord 2026.6.34 → 2026.6.35
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/action-runtime-api.js +1 -1
- package/dist/{api-CjnGBhM3.js → api-1GXlSrYP.js} +42 -21
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-BWPQrzpP.js → approval-handler.runtime-Dv4p7REU.js} +3 -3
- package/dist/{audit-BwJ_2OjL.js → audit-DEVi9nIs.js} +3 -3
- package/dist/{channel-DU4jnQgl.js → channel-CQIRiosn.js} +15 -15
- package/dist/{channel-actions-CwmIqnYN.js → channel-actions-JziPEcBU.js} +2 -2
- package/dist/{channel-actions.runtime-DvpTfaJ4.js → channel-actions.runtime-D7L47LY3.js} +5 -5
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-glZ5Y98a.js → channel.setup-oMeR19Cc.js} +2 -2
- package/dist/{components-j6lTZBsT.js → components-_s5UPJqU.js} +1 -1
- package/dist/{conversation-identity-36FFBwm5.js → conversation-identity-B0k94-bz.js} +2 -2
- package/dist/{directory-config-BYMFzL29.js → directory-config-CD1svkyN.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-9JtJCiu8.js → directory-live-DBTsSRxl.js} +5 -5
- package/dist/{handle-action.guild-admin-xxGYrp-I.js → handle-action.guild-admin-CYIFMxh-.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{manager.runtime-NxCd-PVt.js → manager.runtime-BZVdGX2d.js} +17 -9
- package/dist/{message-handler-cizxbaDc.js → message-handler-DZd9Bpq8.js} +6 -6
- package/dist/{message-handler.preflight-CbD0u7U7.js → message-handler.preflight-Axv9J9EO.js} +12 -11
- package/dist/{message-handler.process-Do4EM591.js → message-handler.process-CG0zFS-Z.js} +10 -10
- package/dist/{message-utils-CJeAoISH.js → message-utils-Dbuw27gd.js} +1 -1
- package/dist/{outbound-adapter-Dxs6iKEq.js → outbound-adapter-CKC_kmUN.js} +6 -6
- package/dist/pluralkit-CfTReLl3.js +40 -0
- package/dist/{probe-esE_Oqdm.js → probe-DcgZIpyF.js} +3 -2
- package/dist/{probe.runtime-C3Atgpvr.js → probe.runtime-CVwM9L5E.js} +1 -1
- package/dist/{provider-B-s93q9s.js → provider-CwwSXIIj.js} +73 -33
- package/dist/{provider-session.runtime-BKMOqHpd.js → provider-session.runtime-reBWkqHZ.js} +3 -3
- package/dist/provider.runtime-BsmTLYS_.js +2 -0
- package/dist/{resolve-allowlist-common-3gB2Gpmm.js → resolve-allowlist-common-D7bZqAw3.js} +3 -3
- package/dist/{resolve-channels-B3gQf8QL.js → resolve-channels--oE-RnO6.js} +6 -6
- package/dist/{resolve-users-BO10y5fJ.js → resolve-users-QXo8CXBU.js} +5 -5
- package/dist/{runtime-CFlR3L9X.js → runtime-CF7ramAs.js} +7 -7
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +19 -19
- package/dist/runtime-api.lookup.js +5 -5
- package/dist/runtime-api.monitor-CzF8MUl_.js +6 -0
- package/dist/runtime-api.monitor.js +5 -5
- package/dist/runtime-api.send.js +5 -5
- package/dist/runtime-api.threads.js +3 -3
- package/dist/{send-JHxfT4Pk.js → send-Bb295iHT.js} +5 -5
- package/dist/{send.components-CN35E2Ck.js → send.components-COkDUO3B.js} +4 -4
- package/dist/{send.outbound-B-cA1Esv.js → send.outbound-B_sk0hNe.js} +3 -3
- package/dist/{send.receipt-CGecJDin.js → send.receipt-Cli6_9Sn.js} +19 -7
- package/dist/{send.shared-vcbfThdy.js → send.shared-BCG7MWnP.js} +2 -2
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{subagent-hooks-20wXhVzZ.js → subagent-hooks-CtqoWK4x.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-DR27TE7p.js → system-events-BxGNk_wE.js} +1 -1
- package/dist/{target-resolver-CDi1gI90.js → target-resolver-BcoK6b0g.js} +2 -2
- package/dist/targets-Q-ZoP7K4.js +3 -0
- package/dist/{thread-bindings-DU4T6nDo.js → thread-bindings-DJ_HT6GJ.js} +4 -4
- package/dist/{thread-bindings.discord-api-CYkr-3Gj.js → thread-bindings.discord-api-OPyjvgyz.js} +4 -4
- package/dist/{thread-bindings.manager-BqWs1UE2.js → thread-bindings.manager-Cd2HAVw_.js} +3 -3
- package/dist/{transcripts-source-D-lBI5ZD.js → transcripts-source-CPf5gURy.js} +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-xr05bL-r.js → typing-DY0cwLdg.js} +1 -1
- package/node_modules/undici/docs/docs/api/Client.md +25 -8
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
- package/node_modules/undici/docs/docs/api/EventSource.md +4 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/undici/lib/api/readable.js +33 -43
- package/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
- package/node_modules/undici/lib/core/connect.js +16 -2
- package/node_modules/undici/lib/core/symbols.js +3 -0
- package/node_modules/undici/lib/dispatcher/agent.js +7 -2
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
- package/node_modules/undici/lib/dispatcher/client-h1.js +9 -1
- package/node_modules/undici/lib/dispatcher/client-h2.js +221 -12
- package/node_modules/undici/lib/dispatcher/client.js +76 -30
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
- package/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +37 -8
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
- package/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +106 -22
- package/node_modules/undici/lib/handler/cache-handler.js +29 -5
- package/node_modules/undici/lib/handler/decorator-handler.js +7 -1
- package/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
- package/node_modules/undici/lib/handler/redirect-handler.js +21 -4
- package/node_modules/undici/lib/handler/retry-handler.js +155 -32
- package/node_modules/undici/lib/interceptor/cache.js +65 -9
- package/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/mock/mock-agent.js +13 -1
- package/node_modules/undici/lib/mock/mock-utils.js +217 -27
- package/node_modules/undici/lib/util/cache.js +43 -3
- package/node_modules/undici/lib/web/cookies/parse.js +150 -147
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
- package/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/undici/lib/web/fetch/request.js +2 -3
- package/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/lib/web/websocket/websocket.js +22 -0
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/client.d.ts +50 -0
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/node_modules/undici/types/mock-agent.d.ts +11 -10
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -0
- package/npm-shrinkwrap.json +7 -7
- package/package.json +6 -5
- package/dist/pluralkit-DI6RYaVj.js +0 -24
- package/dist/provider.runtime-CaTJrpnl.js +0 -2
- package/dist/runtime-api.monitor-CRiBIQEI.js +0 -6
- package/dist/targets-C6yd3y8R.js +0 -3
|
@@ -34,9 +34,9 @@ class WebSocketStream {
|
|
|
34
34
|
/** @type {ReadableStreamDefaultController} */
|
|
35
35
|
#readableStreamController
|
|
36
36
|
|
|
37
|
-
//
|
|
38
|
-
/** @type {
|
|
39
|
-
#
|
|
37
|
+
// Retain the controller so the writable stream can be errored while locked.
|
|
38
|
+
/** @type {WritableStreamDefaultController} */
|
|
39
|
+
#writableStreamController
|
|
40
40
|
|
|
41
41
|
// Each WebSocketStream object has an associated boolean handshake aborted , which is initially false.
|
|
42
42
|
#handshakeAborted = false
|
|
@@ -300,6 +300,9 @@ class WebSocketStream {
|
|
|
300
300
|
// 12. Let writable be a new WritableStream .
|
|
301
301
|
// 13. Set up writable with writeAlgorithm , closeAlgorithm , and abortAlgorithm .
|
|
302
302
|
const writable = new WritableStream({
|
|
303
|
+
start: (controller) => {
|
|
304
|
+
this.#writableStreamController = controller
|
|
305
|
+
},
|
|
303
306
|
write: (chunk) => this.#write(chunk),
|
|
304
307
|
close: () => closeWebSocketConnection(this.#handler, null, null),
|
|
305
308
|
abort: (reason) => this.#closeUsingReason(reason)
|
|
@@ -308,9 +311,6 @@ class WebSocketStream {
|
|
|
308
311
|
// Set stream ’s readable stream to readable .
|
|
309
312
|
this.#readableStream = readable
|
|
310
313
|
|
|
311
|
-
// Set stream ’s writable stream to writable .
|
|
312
|
-
this.#writableStream = writable
|
|
313
|
-
|
|
314
314
|
// Resolve stream ’s opened promise with WebSocketOpenInfo «[ " extensions " → extensions , " protocol " → protocol , " readable " → readable , " writable " → writable ]».
|
|
315
315
|
this.#openedPromise.resolve({
|
|
316
316
|
extensions,
|
|
@@ -396,9 +396,7 @@ class WebSocketStream {
|
|
|
396
396
|
readableStreamClose(this.#readableStreamController)
|
|
397
397
|
|
|
398
398
|
// 6.2. Error stream ’s writable stream with an " InvalidStateError " DOMException indicating that a closed WebSocketStream cannot be written to.
|
|
399
|
-
|
|
400
|
-
this.#writableStream.abort(new DOMException('A closed WebSocketStream cannot be written to', 'InvalidStateError'))
|
|
401
|
-
}
|
|
399
|
+
this.#writableStreamController.error(new DOMException('A closed WebSocketStream cannot be written to', 'InvalidStateError'))
|
|
402
400
|
|
|
403
401
|
// 6.3. Resolve stream ’s closed promise with WebSocketCloseInfo «[ " closeCode " → code , " reason " → reason ]».
|
|
404
402
|
this.#closedPromise.resolve({
|
|
@@ -415,7 +413,7 @@ class WebSocketStream {
|
|
|
415
413
|
this.#readableStreamController?.error(error)
|
|
416
414
|
|
|
417
415
|
// 7.3. Error stream ’s writable stream with error .
|
|
418
|
-
this.#
|
|
416
|
+
this.#writableStreamController?.error(error)
|
|
419
417
|
|
|
420
418
|
// 7.4. Reject stream ’s closed promise with error .
|
|
421
419
|
this.#closedPromise.reject(error)
|
|
@@ -25,6 +25,9 @@ const { SendQueue } = require('./sender')
|
|
|
25
25
|
const { WebsocketFrameSend } = require('./frame')
|
|
26
26
|
const { channels } = require('../../core/diagnostics')
|
|
27
27
|
|
|
28
|
+
const kRef = Symbol.for('nodejs.ref')
|
|
29
|
+
const kUnref = Symbol.for('nodejs.unref')
|
|
30
|
+
|
|
28
31
|
function getSocketAddress (socket) {
|
|
29
32
|
if (typeof socket?.address === 'function') {
|
|
30
33
|
return socket.address()
|
|
@@ -68,6 +71,7 @@ class WebSocket extends EventTarget {
|
|
|
68
71
|
#bufferedAmount = 0
|
|
69
72
|
#protocol = ''
|
|
70
73
|
#extensions = ''
|
|
74
|
+
#refed = true
|
|
71
75
|
|
|
72
76
|
/** @type {SendQueue} */
|
|
73
77
|
#sendQueue
|
|
@@ -194,6 +198,20 @@ class WebSocket extends EventTarget {
|
|
|
194
198
|
this.#binaryType = 'blob'
|
|
195
199
|
}
|
|
196
200
|
|
|
201
|
+
[kRef] () {
|
|
202
|
+
webidl.brandCheck(this, WebSocket)
|
|
203
|
+
|
|
204
|
+
this.#refed = true
|
|
205
|
+
this.#handler.socket?.ref?.()
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
[kUnref] () {
|
|
209
|
+
webidl.brandCheck(this, WebSocket)
|
|
210
|
+
|
|
211
|
+
this.#refed = false
|
|
212
|
+
this.#handler.socket?.unref?.()
|
|
213
|
+
}
|
|
214
|
+
|
|
197
215
|
/**
|
|
198
216
|
* @see https://websockets.spec.whatwg.org/#dom-websocket-close
|
|
199
217
|
* @param {number|undefined} code
|
|
@@ -468,6 +486,10 @@ class WebSocket extends EventTarget {
|
|
|
468
486
|
// once this happens, the connection is open
|
|
469
487
|
this.#handler.socket = response.socket
|
|
470
488
|
|
|
489
|
+
if (!this.#refed) {
|
|
490
|
+
this.#handler.socket.unref?.()
|
|
491
|
+
}
|
|
492
|
+
|
|
471
493
|
// Get options from dispatcher options
|
|
472
494
|
const maxFragments = this.#handler.controller.dispatcher?.webSocketOptions?.maxFragments
|
|
473
495
|
const maxPayloadSize = this.#handler.controller.dispatcher?.webSocketOptions?.maxPayloadSize
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "undici",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.2",
|
|
4
4
|
"description": "An HTTP/1.1 client, written from scratch for Node.js",
|
|
5
5
|
"homepage": "https://undici.nodejs.org",
|
|
6
6
|
"bugs": {
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"test:websocket:autobahn": "node test/autobahn/client.js",
|
|
98
98
|
"test:websocket:autobahn:report": "node test/autobahn/report.js",
|
|
99
99
|
"test:wpt:setup": "node test/web-platform-tests/wpt-runner.mjs setup",
|
|
100
|
-
"test:wpt": "npm run test:wpt:setup && node test/web-platform-tests/wpt-runner.mjs run /fetch /mimesniff /
|
|
100
|
+
"test:wpt": "npm run test:wpt:setup && node test/web-platform-tests/wpt-runner.mjs run /fetch /mimesniff /xhr /websockets /eventsource",
|
|
101
101
|
"test:cache-tests": "node test/cache-interceptor/cache-tests.mjs --ci",
|
|
102
102
|
"coverage": "npm run coverage:clean && cross-env NODE_V8_COVERAGE=./coverage/tmp npm run test:javascript && npm run coverage:report",
|
|
103
103
|
"coverage:ci": "npm run coverage:clean && cross-env NODE_V8_COVERAGE=./coverage/tmp npm run test:javascript && npm run coverage:report:ci",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"prepare": "husky && node ./scripts/platform-shell.js"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
|
-
"@fastify/busboy": "3.2.
|
|
112
|
+
"@fastify/busboy": "3.2.2",
|
|
113
113
|
"@matteo.collina/tspl": "^0.2.0",
|
|
114
114
|
"@metcoder95/https-pem": "^1.0.0",
|
|
115
115
|
"@sinonjs/fake-timers": "^12.0.0",
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { URL } from 'node:url'
|
|
2
|
+
import { SessionOptions } from 'node:http2'
|
|
2
3
|
import Dispatcher from './dispatcher'
|
|
3
4
|
import buildConnector from './connector'
|
|
4
5
|
import TClientStats from './client-stats'
|
|
5
6
|
|
|
6
7
|
type ClientConnectOptions<TOpaque = null> = Omit<Dispatcher.ConnectOptions<TOpaque>, 'origin'>
|
|
7
8
|
|
|
9
|
+
// TODO: Pendings
|
|
10
|
+
// 1. Reflect this on Client instantiation
|
|
11
|
+
// 2. Client H2 should use this namespaced options instead.
|
|
12
|
+
|
|
8
13
|
/**
|
|
9
14
|
* A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
|
|
10
15
|
*/
|
|
@@ -75,6 +80,8 @@ export declare namespace Client {
|
|
|
75
80
|
maxResponseSize?: number;
|
|
76
81
|
/** WebSocket-specific options */
|
|
77
82
|
webSocket?: Client.WebSocketOptions;
|
|
83
|
+
/** EventSource-specific options */
|
|
84
|
+
eventSource?: Client.EventSourceOptions;
|
|
78
85
|
/** Enables a family autodetection algorithm that loosely implements section 5 of RFC 8305. */
|
|
79
86
|
autoSelectFamily?: boolean;
|
|
80
87
|
/** The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the `autoSelectFamily` option. */
|
|
@@ -87,23 +94,31 @@ export declare namespace Client {
|
|
|
87
94
|
/**
|
|
88
95
|
* @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
|
|
89
96
|
* @default 100
|
|
97
|
+
* @deprecated Use h2Options.maxConcurrentStreams instead
|
|
90
98
|
*/
|
|
91
99
|
maxConcurrentStreams?: number;
|
|
92
100
|
/**
|
|
93
101
|
* @description Sets the HTTP/2 stream-level flow-control window size (SETTINGS_INITIAL_WINDOW_SIZE).
|
|
94
102
|
* @default 262144
|
|
103
|
+
* @deprecated Use h2Options.settings.initialWindowSize instead
|
|
95
104
|
*/
|
|
96
105
|
initialWindowSize?: number;
|
|
97
106
|
/**
|
|
98
107
|
* @description Sets the HTTP/2 connection-level flow-control window size (ClientHttp2Session.setLocalWindowSize).
|
|
99
108
|
* @default 524288
|
|
109
|
+
* @deprecated Use h2Options.connectionWindowSize instead
|
|
100
110
|
*/
|
|
101
111
|
connectionWindowSize?: number;
|
|
102
112
|
/**
|
|
103
113
|
* @description Time interval between PING frames dispatch
|
|
104
114
|
* @default 60000
|
|
115
|
+
* @deprecated Use h2Options.connectionWindowSize instead
|
|
105
116
|
*/
|
|
106
117
|
pingInterval?: number;
|
|
118
|
+
/**
|
|
119
|
+
* @description HTTP/2 configuration options
|
|
120
|
+
*/
|
|
121
|
+
h2Options?: Client.H2Options;
|
|
107
122
|
}
|
|
108
123
|
export interface SocketInfo {
|
|
109
124
|
localAddress?: string
|
|
@@ -129,6 +144,41 @@ export declare namespace Client {
|
|
|
129
144
|
*/
|
|
130
145
|
maxPayloadSize?: number;
|
|
131
146
|
}
|
|
147
|
+
|
|
148
|
+
export interface H2Options extends Omit<SessionOptions, keyof buildConnector.BuildOptions> {
|
|
149
|
+
/**
|
|
150
|
+
* @description Sets the HTTP/2 connection-level flow-control window size (ClientHttp2Session.setLocalWindowSize).
|
|
151
|
+
* @default 524288
|
|
152
|
+
*/
|
|
153
|
+
connectionWindowSize?: number;
|
|
154
|
+
/**
|
|
155
|
+
* @description Time interval between PING frames dispatch
|
|
156
|
+
* @default 60000
|
|
157
|
+
*/
|
|
158
|
+
pingInterval?: number;
|
|
159
|
+
/**
|
|
160
|
+
* @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
|
|
161
|
+
* @default 100
|
|
162
|
+
*/
|
|
163
|
+
maxConcurrentStreams?: number;
|
|
164
|
+
/**
|
|
165
|
+
* @description Enable support for H2C (plain text)
|
|
166
|
+
* @default false
|
|
167
|
+
*/
|
|
168
|
+
useH2c?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* @description SETTINGS frame object. Default to 'node:http2' defaults
|
|
171
|
+
*/
|
|
172
|
+
settings?: Omit<SessionOptions['settings'], 'enablePush' | 'maxConcurrentStreams' | 'enableConnectProtocol'>
|
|
173
|
+
}
|
|
174
|
+
export interface EventSourceOptions {
|
|
175
|
+
/**
|
|
176
|
+
* Maximum allowed event size in bytes for EventSource messages.
|
|
177
|
+
* Set to 0 to disable the limit.
|
|
178
|
+
* @default buffer.kStringMaxLength
|
|
179
|
+
*/
|
|
180
|
+
maxEventSize?: number;
|
|
181
|
+
}
|
|
132
182
|
}
|
|
133
183
|
|
|
134
184
|
export default Client
|
|
@@ -12,6 +12,8 @@ declare namespace Interceptors {
|
|
|
12
12
|
export type DecompressInterceptorOpts = {
|
|
13
13
|
skipErrorResponses?: boolean
|
|
14
14
|
skipStatusCodes?: number[]
|
|
15
|
+
/** Maximum decompressed response size in bytes. @default 67108864 */
|
|
16
|
+
maxSize?: number
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export type ResponseErrorInterceptorOpts = { throwOnError: boolean }
|
|
@@ -6,10 +6,6 @@ import { MockCallHistory } from './mock-call-history'
|
|
|
6
6
|
|
|
7
7
|
export default MockAgent
|
|
8
8
|
|
|
9
|
-
interface PendingInterceptor extends MockDispatch {
|
|
10
|
-
origin: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
9
|
/** A mocked Agent class that implements the Agent API. It allows one to intercept HTTP requests made through undici and return mocked responses instead. */
|
|
14
10
|
declare class MockAgent<TMockAgentOptions extends MockAgent.Options = MockAgent.Options> extends Dispatcher {
|
|
15
11
|
constructor (options?: TMockAgentOptions)
|
|
@@ -40,17 +36,22 @@ declare class MockAgent<TMockAgentOptions extends MockAgent.Options = MockAgent.
|
|
|
40
36
|
enableCallHistory (): this
|
|
41
37
|
/** Disable call history. Any subsequence calls will then not be registered. */
|
|
42
38
|
disableCallHistory (): this
|
|
43
|
-
pendingInterceptors (): PendingInterceptor[]
|
|
39
|
+
pendingInterceptors (): MockAgent.PendingInterceptor[]
|
|
44
40
|
assertNoPendingInterceptors (options?: {
|
|
45
|
-
pendingInterceptorsFormatter?: PendingInterceptorsFormatter;
|
|
41
|
+
pendingInterceptorsFormatter?: MockAgent.PendingInterceptorsFormatter;
|
|
46
42
|
}): void
|
|
47
43
|
}
|
|
48
44
|
|
|
49
|
-
interface PendingInterceptorsFormatter {
|
|
50
|
-
format(pendingInterceptors: readonly PendingInterceptor[]): string;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
45
|
declare namespace MockAgent {
|
|
46
|
+
/** An interceptor that was registered on a mock dispatcher and has not been consumed yet. */
|
|
47
|
+
export interface PendingInterceptor extends MockDispatch {
|
|
48
|
+
origin: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface PendingInterceptorsFormatter {
|
|
52
|
+
format(pendingInterceptors: readonly PendingInterceptor[]): string;
|
|
53
|
+
}
|
|
54
|
+
|
|
54
55
|
/** MockAgent options. */
|
|
55
56
|
export interface Options extends Agent.Options {
|
|
56
57
|
/** A custom agent to be encapsulated by the MockAgent. */
|
|
@@ -21,5 +21,7 @@ declare namespace Socks5ProxyAgent {
|
|
|
21
21
|
connect?: buildConnector.connector;
|
|
22
22
|
/** TLS options for the proxy connection (for SOCKS5 over TLS) */
|
|
23
23
|
proxyTls?: buildConnector.BuildOptions;
|
|
24
|
+
/** TLS options for the end-to-end connection to the target */
|
|
25
|
+
requestTls?: buildConnector.BuildOptions;
|
|
24
26
|
}
|
|
25
27
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/discord",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.35",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/discord",
|
|
9
|
-
"version": "2026.6.
|
|
9
|
+
"version": "2026.6.35",
|
|
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.
|
|
15
|
+
"undici": "8.10.2",
|
|
16
16
|
"ws": "8.21.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"openclaw": ">=2026.6.
|
|
19
|
+
"openclaw": ">=2026.6.35"
|
|
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.
|
|
403
|
-
"resolved": "https://registry.npmjs.org/undici/-/undici-8.
|
|
404
|
-
"integrity": "sha512
|
|
402
|
+
"version": "8.10.2",
|
|
403
|
+
"resolved": "https://registry.npmjs.org/undici/-/undici-8.10.2.tgz",
|
|
404
|
+
"integrity": "sha512-/y4/bH9YNU5hi9NIrpOuvGXFcxrj3CMrV+/AYpowAYTpHn8gX/XPFjNy766FPoYY0miQhdW977JFWKGNhBdwyQ==",
|
|
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.
|
|
3
|
+
"version": "2026.6.35",
|
|
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.
|
|
15
|
+
"undici": "8.10.2",
|
|
16
16
|
"ws": "8.21.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"openclaw": ">=2026.6.
|
|
19
|
+
"openclaw": ">=2026.6.35"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"openclaw": {
|
|
@@ -63,10 +63,11 @@
|
|
|
63
63
|
"allowInvalidConfigRecovery": true
|
|
64
64
|
},
|
|
65
65
|
"compat": {
|
|
66
|
-
"pluginApi": ">=2026.6.
|
|
66
|
+
"pluginApi": ">=2026.6.35"
|
|
67
67
|
},
|
|
68
68
|
"build": {
|
|
69
|
-
"
|
|
69
|
+
"bundledDist": false,
|
|
70
|
+
"openclawVersion": "2026.6.35"
|
|
70
71
|
},
|
|
71
72
|
"release": {
|
|
72
73
|
"publishToClawHub": true,
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-CGecJDin.js";
|
|
2
|
-
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
3
|
-
import { readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
4
|
-
//#region extensions/discord/src/pluralkit.ts
|
|
5
|
-
var pluralkit_exports = /* @__PURE__ */ __exportAll({ fetchPluralKitMessageInfo: () => fetchPluralKitMessageInfo });
|
|
6
|
-
const PLURALKIT_API_BASE = "https://api.pluralkit.me/v2";
|
|
7
|
-
const PLURALKIT_ERROR_BODY_LIMIT_BYTES = 8 * 1024;
|
|
8
|
-
async function fetchPluralKitMessageInfo(params) {
|
|
9
|
-
if (!params.config?.enabled) return null;
|
|
10
|
-
const fetchImpl = resolveFetch(params.fetcher);
|
|
11
|
-
if (!fetchImpl) return null;
|
|
12
|
-
const headers = {};
|
|
13
|
-
if (params.config.token?.trim()) headers.Authorization = params.config.token.trim();
|
|
14
|
-
const res = await fetchImpl(`${PLURALKIT_API_BASE}/messages/${params.messageId}`, { headers });
|
|
15
|
-
if (res.status === 404) return null;
|
|
16
|
-
if (!res.ok) {
|
|
17
|
-
const text = await readResponseTextLimited(res, PLURALKIT_ERROR_BODY_LIMIT_BYTES).catch(() => "");
|
|
18
|
-
const detail = text.trim() ? `: ${text.trim()}` : "";
|
|
19
|
-
throw new Error(`PluralKit API failed (${res.status})${detail}`);
|
|
20
|
-
}
|
|
21
|
-
return await res.json();
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
export { pluralkit_exports as n, fetchPluralKitMessageInfo as t };
|
package/dist/targets-C6yd3y8R.js
DELETED