openclaw-bridge 0.4.3 → 0.4.6

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 CHANGED
@@ -216,7 +216,12 @@ ${nameMapping}
216
216
  relayClient = new MessageRelayClient(config.agentId, config.messageRelay, api.logger, machineId);
217
217
  relayClient.setAgentName(config.agentName);
218
218
  relayClient.setOnConflictRename((newAgentId, newAgentName) => {
219
- api.logger.info(`[bridge] Conflict rename: ${entry.agentId} → ${newAgentId}, ${entry.agentName} → ${newAgentName}`);
219
+ const oldAgentId = entry.agentId;
220
+ api.logger.info(`[bridge] Conflict rename: ${oldAgentId} → ${newAgentId}, ${entry.agentName} → ${newAgentName}`);
221
+ // Deregister old agentId from Hub registry before switching
222
+ registry.deregister(oldAgentId).catch((err) => {
223
+ api.logger.warn(`[bridge] Failed to deregister old agentId "${oldAgentId}": ${err.message}`);
224
+ });
220
225
  entry.agentId = newAgentId;
221
226
  entry.agentName = newAgentName;
222
227
  // Persist the renamed agentId to openclaw.json so it survives restarts
@@ -1,4 +1,14 @@
1
1
  import WebSocket from 'ws';
2
+ import { readFileSync } from 'node:fs';
3
+ import { join, dirname } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ // Read version from package.json at module load time
6
+ let BRIDGE_VERSION = 'unknown';
7
+ try {
8
+ const pkgPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json');
9
+ BRIDGE_VERSION = JSON.parse(readFileSync(pkgPath, 'utf-8')).version;
10
+ }
11
+ catch { }
2
12
  export class MessageRelayClient {
3
13
  ws = null;
4
14
  agentId;
@@ -69,6 +79,7 @@ export class MessageRelayClient {
69
79
  agentId: this.agentId,
70
80
  apiKey: this.config.apiKey,
71
81
  machineId: this.machineId,
82
+ bridgeVersion: BRIDGE_VERSION,
72
83
  }));
73
84
  });
74
85
  this.ws.on('message', (data) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-bridge",
3
- "version": "0.4.3",
3
+ "version": "0.4.6",
4
4
  "author": "Bill Zhao (https://www.linkedin.com/in/billzhaodi/)",
5
5
  "description": "OpenClaw plugin for cross-gateway communication — agent discovery, file transfer, real-time messaging, session handoff, and local process management. Install as plugin: openclaw plugins install openclaw-bridge",
6
6
  "type": "module",