openclaw-bridge 0.5.1 → 0.5.2

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.
@@ -1,5 +1,14 @@
1
1
  import WebSocket from "ws";
2
- import { hostname } from "node:os";
2
+ import { hostname, homedir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { readFileSync } from "node:fs";
5
+ function readMachineId() {
6
+ try {
7
+ const id = readFileSync(join(homedir(), ".openclaw", ".machine-id"), "utf-8").trim();
8
+ if (id) return id;
9
+ } catch {}
10
+ return hostname();
11
+ }
3
12
  export class ManagerHubClient {
4
13
  hubUrl;
5
14
  apiKey;
@@ -14,7 +23,7 @@ export class ManagerHubClient {
14
23
  this.hubUrl = hubUrl;
15
24
  this.apiKey = apiKey;
16
25
  this.managerPass = managerPass;
17
- this.machineId = hostname();
26
+ this.machineId = readMachineId();
18
27
  this.logger = logger;
19
28
  }
20
29
  get connected() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-bridge",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
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",