squad-openclaw 2026.2.2022 → 2026.2.2024

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 +25 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -440,9 +440,28 @@ var RelayClient = class {
440
440
  }
441
441
  }
442
442
  if (msg.type === "req" && msg.method === "connect") {
443
+ const connectRequestId = typeof msg.id === "string" ? msg.id : null;
443
444
  if (conn.connectHandshakeComplete) {
445
+ if (connectRequestId && conn.lastSuccessfulConnectRequestId === connectRequestId) {
446
+ console.log(`[relay-client] Duplicate connect id for ${userId} (${connectRequestId}) \u2014 reusing existing session`);
447
+ this.sendToRelay({
448
+ type: "relay.forward",
449
+ userId,
450
+ inner: {
451
+ type: "res",
452
+ id: connectRequestId,
453
+ ok: true,
454
+ payload: { protocol: 3 }
455
+ }
456
+ });
457
+ return;
458
+ }
444
459
  console.log(`[relay-client] New connect from ${userId} \u2014 creating fresh local WS for handshake`);
445
- this.createUserConnection(userId);
460
+ this.createUserConnection(userId, {
461
+ pendingConnect: null,
462
+ pendingMessages: conn.pendingMessages,
463
+ e2e: conn.e2e
464
+ });
446
465
  conn = this.userConnections.get(userId);
447
466
  if (!conn) return;
448
467
  }
@@ -523,7 +542,8 @@ var RelayClient = class {
523
542
  connectHandshakeComplete: false,
524
543
  challengeNonce: null,
525
544
  pendingConnect: carry?.pendingConnect ?? null,
526
- pendingMessages: carry?.pendingMessages ?? []
545
+ pendingMessages: carry?.pendingMessages ?? [],
546
+ lastSuccessfulConnectRequestId: null
527
547
  };
528
548
  this.userConnections.set(userId, conn);
529
549
  localWs.on("open", () => {
@@ -609,8 +629,9 @@ Device ID: ${this.deviceKeys.deviceId}`
609
629
  }
610
630
  }
611
631
  }
612
- if (parsed.type === "res" && parsed.id === "connect-1" && parsed.ok) {
632
+ if (parsed.type === "res" && typeof parsed.id === "string" && parsed.id.startsWith("connect-") && parsed.ok) {
613
633
  conn.connectHandshakeComplete = true;
634
+ conn.lastSuccessfulConnectRequestId = parsed.id;
614
635
  if (conn.pendingMessages.length > 0) {
615
636
  console.log(`[relay-client] Flushing ${conn.pendingMessages.length} buffered messages for ${userId}`);
616
637
  for (const queued of conn.pendingMessages) {
@@ -1256,8 +1277,7 @@ function resolveGatewayLayout() {
1256
1277
  }
1257
1278
  }
1258
1279
  const resolvedWorkspaces = Array.from(deduped.values());
1259
- const mainWorkspace = resolvedWorkspaces.find((ws) => ws.agentId === "main");
1260
- const defaultFileBrowserRoot = mainWorkspace?.path ?? stateDir;
1280
+ const defaultFileBrowserRoot = stateDir;
1261
1281
  return {
1262
1282
  stateDir,
1263
1283
  configPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squad-openclaw",
3
- "version": "2026.2.2022",
3
+ "version": "2026.2.2024",
4
4
  "description": "Entity registry, filesystem tools, and version management plugin for OpenClaw gateway",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",