gopherhole_openclaw_a2a 0.4.2 → 0.4.3
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/src/connection.js +13 -0
- package/package.json +1 -1
package/dist/src/connection.js
CHANGED
|
@@ -25,6 +25,19 @@ export class A2AConnectionManager {
|
|
|
25
25
|
async connectToGopherHole() {
|
|
26
26
|
const hubUrl = this.config.bridgeUrl || 'wss://hub.gopherhole.ai/ws';
|
|
27
27
|
const timeoutMs = this.config.requestTimeoutMs ?? 180000;
|
|
28
|
+
// Force SDK to use the 'ws' npm module instead of Node's native WebSocket.
|
|
29
|
+
// Node 22's native WebSocket uses undici which fails inside the OpenClaw gateway
|
|
30
|
+
// process context, but the 'ws' package works fine.
|
|
31
|
+
// Also set up global.require so the SDK's ESM __require can find the ws package.
|
|
32
|
+
try {
|
|
33
|
+
const { createRequire } = await import('module');
|
|
34
|
+
const req = createRequire(import.meta.url);
|
|
35
|
+
globalThis.require = req;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
// ignore
|
|
39
|
+
}
|
|
40
|
+
globalThis.WebSocket = undefined;
|
|
28
41
|
this.gopherhole = new GopherHole({
|
|
29
42
|
apiKey: this.config.apiKey,
|
|
30
43
|
hubUrl,
|