squad-openclaw 2026.2.1814 → 2026.2.1816

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 (2) hide show
  1. package/dist/index.js +29 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1254,14 +1254,11 @@ var RelayClient = class {
1254
1254
  }
1255
1255
  /** Route a message from the relay to the appropriate user's local WS */
1256
1256
  routeToUser(userId, innerMsg) {
1257
- const msg = innerMsg;
1257
+ let msg = innerMsg;
1258
1258
  if (msg.type === "event" && typeof msg.event === "string" && msg.event.startsWith("relay.")) {
1259
1259
  if (msg.event === "relay.user.connected") {
1260
- const existing = this.userConnections.get(userId);
1261
- if (!existing || existing.localWs.readyState >= NodeWebSocket.CLOSING) {
1262
- console.log(`[relay-client] User ${userId} connected via relay \u2014 creating local WS`);
1263
- this.createUserConnection(userId);
1264
- }
1260
+ console.log(`[relay-client] User ${userId} connected via relay \u2014 creating local WS`);
1261
+ this.createUserConnection(userId);
1265
1262
  }
1266
1263
  return;
1267
1264
  }
@@ -1277,6 +1274,19 @@ var RelayClient = class {
1277
1274
  conn = this.userConnections.get(userId);
1278
1275
  if (!conn) return;
1279
1276
  }
1277
+ if (msg._e2e && conn.e2e) {
1278
+ try {
1279
+ const plaintext = conn.e2e.decrypt({
1280
+ ciphertext: msg.ciphertext,
1281
+ iv: msg.iv,
1282
+ tag: msg.tag
1283
+ });
1284
+ msg = JSON.parse(plaintext);
1285
+ } catch (err2) {
1286
+ console.error(`[relay-client] E2E decrypt error for ${userId}:`, err2);
1287
+ return;
1288
+ }
1289
+ }
1280
1290
  if (msg.type === "req" && msg.method === "connect") {
1281
1291
  if (conn.connectHandshakeComplete) {
1282
1292
  console.log(`[relay-client] New connect from ${userId} \u2014 creating fresh local WS for handshake`);
@@ -1367,16 +1377,19 @@ var RelayClient = class {
1367
1377
  });
1368
1378
  localWs.on("close", (code, reason) => {
1369
1379
  console.log(`[relay-client] Local WS for user ${userId} closed: ${code} ${reason.toString()}`);
1370
- this.userConnections.delete(userId);
1371
- this.sendToRelay({
1372
- type: "relay.forward",
1373
- userId,
1374
- inner: {
1375
- type: "event",
1376
- event: "relay.gateway.connection.closed",
1377
- payload: { code }
1378
- }
1379
- });
1380
+ const current = this.userConnections.get(userId);
1381
+ if (current && current.localWs === localWs) {
1382
+ this.userConnections.delete(userId);
1383
+ this.sendToRelay({
1384
+ type: "relay.forward",
1385
+ userId,
1386
+ inner: {
1387
+ type: "event",
1388
+ event: "relay.gateway.connection.closed",
1389
+ payload: { code }
1390
+ }
1391
+ });
1392
+ }
1380
1393
  });
1381
1394
  localWs.on("error", (err2) => {
1382
1395
  console.error(`[relay-client] Local WS error for user ${userId}:`, err2.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squad-openclaw",
3
- "version": "2026.2.1814",
3
+ "version": "2026.2.1816",
4
4
  "description": "Entity registry, filesystem tools, and version management plugin for OpenClaw gateway",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",