openclaw-bridge 0.3.2 → 0.4.0

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 (52) hide show
  1. package/README.md +43 -16
  2. package/dist/cli.d.ts +2 -0
  3. package/dist/cli.js +809 -0
  4. package/dist/config.d.ts +3 -0
  5. package/dist/config.js +64 -0
  6. package/dist/discovery.d.ts +4 -0
  7. package/dist/discovery.js +6 -0
  8. package/dist/file-ops.d.ts +22 -0
  9. package/dist/file-ops.js +253 -0
  10. package/dist/heartbeat.d.ts +21 -0
  11. package/dist/heartbeat.js +152 -0
  12. package/dist/index.d.ts +9 -0
  13. package/dist/index.js +624 -0
  14. package/dist/manager/hub-client.d.ts +18 -0
  15. package/dist/manager/hub-client.js +89 -0
  16. package/dist/manager/local-manager.d.ts +12 -0
  17. package/dist/manager/local-manager.js +117 -0
  18. package/dist/manager/pm2-bridge.d.ts +17 -0
  19. package/dist/manager/pm2-bridge.js +113 -0
  20. package/dist/message-relay.d.ts +32 -0
  21. package/dist/message-relay.js +229 -0
  22. package/dist/permissions.d.ts +3 -0
  23. package/dist/permissions.js +14 -0
  24. package/dist/registry.d.ts +13 -0
  25. package/dist/registry.js +103 -0
  26. package/dist/restart.d.ts +15 -0
  27. package/dist/restart.js +107 -0
  28. package/dist/router.d.ts +11 -0
  29. package/dist/router.js +18 -0
  30. package/dist/session.d.ts +11 -0
  31. package/dist/session.js +21 -0
  32. package/dist/types.d.ts +90 -0
  33. package/dist/types.js +1 -0
  34. package/openclaw.plugin.json +6 -92
  35. package/package.json +15 -5
  36. package/src/cli.ts +0 -842
  37. package/src/config.ts +0 -72
  38. package/src/discovery.ts +0 -17
  39. package/src/file-ops.ts +0 -320
  40. package/src/heartbeat.ts +0 -196
  41. package/src/index.ts +0 -681
  42. package/src/manager/hub-client.ts +0 -114
  43. package/src/manager/local-manager.ts +0 -121
  44. package/src/manager/pm2-bridge.ts +0 -125
  45. package/src/message-relay.ts +0 -184
  46. package/src/permissions.ts +0 -18
  47. package/src/registry.ts +0 -107
  48. package/src/restart.ts +0 -137
  49. package/src/router.ts +0 -40
  50. package/src/session.ts +0 -33
  51. package/src/types.ts +0 -100
  52. package/tsconfig.json +0 -14
package/README.md CHANGED
@@ -9,27 +9,48 @@ The all-in-one client plugin for [OpenClaw](https://github.com/nicepkg/openclaw)
9
9
  - **CLI Tools** — Setup, status, start/stop/restart, log viewing, backup, agent creation, diagnostics
10
10
  - **Auto-Config** — Automatically patches missing settings on first run
11
11
 
12
- ## Quick Start
12
+ ## Installation
13
+
14
+ ### As OpenClaw Plugin (cross-gateway communication)
13
15
 
14
16
  ```bash
15
- # 1. Install globally
16
- npm install -g openclaw-bridge
17
+ openclaw plugins install openclaw-bridge
18
+ ```
17
19
 
18
- # 2. Interactive setup (Hub URL, API key, manager password)
19
- openclaw-bridge setup
20
+ Then configure in your `openclaw.json` see [Plugin Configuration](#plugin-configuration) below.
21
+
22
+ ### As CLI Tool (PM2 process management, optional)
20
23
 
21
- # 3. Check your environment
24
+ ```bash
25
+ npm install -g openclaw-bridge
26
+ openclaw-bridge setup
22
27
  openclaw-bridge doctor
28
+ ```
29
+
30
+ ### Both (recommended)
23
31
 
24
- # 4. Start all gateway instances
25
- openclaw-bridge start
32
+ The plugin provides bridge tools (discover, send_file, handoff, etc.) inside OpenClaw conversations. The CLI provides ops management (start/stop/restart agents, backup, diagnostics). They are independent and do not conflict.
26
33
 
27
- # 5. Verify everything is running
28
- openclaw-bridge status
34
+ ### Upgrading
35
+
36
+ ```bash
37
+ openclaw-bridge upgrade # updates both plugin and CLI automatically
29
38
  ```
30
39
 
31
40
  **Prerequisites:** [openclaw-bridge-hub](https://www.npmjs.com/package/openclaw-bridge-hub) running on a server, PM2 installed globally (`npm install -g pm2`), Node.js 18+.
32
41
 
42
+ ## What's New in v0.4.0
43
+
44
+ ### Multi-Device Support
45
+ - **Automatic agentId Conflict Resolution** — If two machines use the same `agentId`, the second machine automatically renames to `agentId@hostname` (e.g., `main@MacBookPro`). No manual config change needed.
46
+ - **Proper Plugin Packaging** — Now ships compiled JavaScript. Installs correctly via `openclaw plugins install`.
47
+ - **Upgrade Command** — Run `openclaw-bridge upgrade` to update both plugin and CLI in one step.
48
+
49
+ ### 多设备支持 (v0.4.0)
50
+ - **agentId 冲突自动解决** — 两台机器用相同 agentId 时,第二台自动改名为 `agentId@主机名`(如 `main@MacBookPro`),无需手动改配置。
51
+ - **规范打包** — 现在发布编译后的 JavaScript,通过 `openclaw plugins install` 正确安装。
52
+ - **一键升级** — 运行 `openclaw-bridge upgrade` 同时更新插件和 CLI。
53
+
33
54
  ## CLI Commands
34
55
 
35
56
  | Command | Description |
@@ -44,6 +65,7 @@ openclaw-bridge status
44
65
  | `clean-sessions` | Remove old/deleted session files to free disk space |
45
66
  | `add-agent` | Wizard to create a new agent instance |
46
67
  | `doctor` | Diagnose environment issues (PM2, Node, ports, Hub) |
68
+ | `upgrade` | Upgrade openclaw-bridge (plugin + CLI) |
47
69
 
48
70
  ### Adding a New Agent
49
71
 
@@ -194,14 +216,18 @@ openclaw-bridge 是 [OpenClaw](https://github.com/nicepkg/openclaw) 的一站式
194
216
  - **CLI 工具** — 设置、状态查看、启停重启、日志、备份、创建 Agent、环境诊断
195
217
  - **自动配置** — 首次启动自动补全推荐配置
196
218
 
197
- ### 快速开始
219
+ ### 安装
198
220
 
199
221
  ```bash
200
- npm install -g openclaw-bridge # 安装
201
- openclaw-bridge setup # 配置 Hub 连接
202
- openclaw-bridge doctor # 检查环境
203
- openclaw-bridge start # 启动所有实例
204
- openclaw-bridge status # 查看状态
222
+ # 作为 OpenClaw 插件安装(跨网关通信)
223
+ openclaw plugins install openclaw-bridge
224
+
225
+ # 作为 CLI 工具安装(可选,用于 PM2 进程管理)
226
+ npm install -g openclaw-bridge
227
+ openclaw-bridge setup
228
+
229
+ # 一键升级
230
+ openclaw-bridge upgrade
205
231
  ```
206
232
 
207
233
  ### CLI 命令
@@ -218,6 +244,7 @@ openclaw-bridge status # 查看状态
218
244
  | `clean-sessions` | 清理旧会话文件 |
219
245
  | `add-agent` | 向导式创建新 agent |
220
246
  | `doctor` | 环境诊断 |
247
+ | `upgrade` | 一键升级 openclaw-bridge(插件 + CLI) |
221
248
 
222
249
  ### 使用场景
223
250
 
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};