squad-openclaw 2026.2.2024 → 2026.2.2201
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/index.js +36 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -215,6 +215,7 @@ var RelayClient = class {
|
|
|
215
215
|
localConnectAttempts = /* @__PURE__ */ new Map();
|
|
216
216
|
reconnectAttempts = 0;
|
|
217
217
|
maxReconnectAttempts = 100;
|
|
218
|
+
autoConnectCounter = 0;
|
|
218
219
|
reconnectTimer = null;
|
|
219
220
|
shouldReconnect = true;
|
|
220
221
|
destroyed = false;
|
|
@@ -482,6 +483,21 @@ var RelayClient = class {
|
|
|
482
483
|
}
|
|
483
484
|
if (!conn.connectHandshakeComplete) {
|
|
484
485
|
conn.pendingMessages.push(msg);
|
|
486
|
+
if (!conn.pendingConnect) {
|
|
487
|
+
const autoConnect = this.buildAutoConnectRequest();
|
|
488
|
+
conn.pendingConnect = autoConnect;
|
|
489
|
+
console.log(`[relay-client] Auto-starting local connect handshake for ${userId} (${String(autoConnect.id)})`);
|
|
490
|
+
if (conn.challengeNonce) {
|
|
491
|
+
const pending = conn.pendingConnect;
|
|
492
|
+
conn.pendingConnect = null;
|
|
493
|
+
if (pending) {
|
|
494
|
+
this.injectDeviceIdentity(conn, pending);
|
|
495
|
+
if (conn.localWs.readyState === NodeWebSocket.OPEN) {
|
|
496
|
+
conn.localWs.send(JSON.stringify(pending));
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
485
501
|
return;
|
|
486
502
|
}
|
|
487
503
|
if (conn.localWs.readyState === NodeWebSocket.CONNECTING) {
|
|
@@ -492,6 +508,26 @@ var RelayClient = class {
|
|
|
492
508
|
}
|
|
493
509
|
conn.localWs.send(JSON.stringify(msg));
|
|
494
510
|
}
|
|
511
|
+
buildAutoConnectRequest() {
|
|
512
|
+
return {
|
|
513
|
+
type: "req",
|
|
514
|
+
id: `connect-auto-${++this.autoConnectCounter}`,
|
|
515
|
+
method: "connect",
|
|
516
|
+
params: {
|
|
517
|
+
minProtocol: 3,
|
|
518
|
+
maxProtocol: 3,
|
|
519
|
+
client: {
|
|
520
|
+
id: "cli",
|
|
521
|
+
version: "relay-client-auto",
|
|
522
|
+
platform: "gateway",
|
|
523
|
+
mode: "ui"
|
|
524
|
+
},
|
|
525
|
+
role: "operator",
|
|
526
|
+
scopes: ["operator.admin", "operator.read", "operator.write"],
|
|
527
|
+
auth: {}
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
}
|
|
495
531
|
/**
|
|
496
532
|
* Inject auth token and device identity into a connect request.
|
|
497
533
|
*
|
package/package.json
CHANGED