@wipcomputer/wip-ldm-os 0.4.37 → 0.4.38
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/SKILL.md +1 -1
- package/bin/ldm.js +17 -0
- package/docs/bridge/README.md +12 -2
- package/docs/bridge/TECHNICAL.md +27 -1
- package/package.json +1 -1
package/SKILL.md
CHANGED
package/bin/ldm.js
CHANGED
|
@@ -363,6 +363,23 @@ async function cmdInit() {
|
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
+
// Deploy backup + restore scripts (#119)
|
|
367
|
+
const backupSrc = join(__dirname, '..', 'scripts', 'ldm-backup.sh');
|
|
368
|
+
const backupDest = join(LDM_ROOT, 'bin', 'ldm-backup.sh');
|
|
369
|
+
if (existsSync(backupSrc)) {
|
|
370
|
+
mkdirSync(join(LDM_ROOT, 'bin'), { recursive: true });
|
|
371
|
+
cpSync(backupSrc, backupDest);
|
|
372
|
+
chmodSync(backupDest, 0o755);
|
|
373
|
+
console.log(` + ldm-backup.sh deployed to ~/.ldm/bin/`);
|
|
374
|
+
}
|
|
375
|
+
const restoreSrc = join(__dirname, '..', 'scripts', 'ldm-restore.sh');
|
|
376
|
+
const restoreDest = join(LDM_ROOT, 'bin', 'ldm-restore.sh');
|
|
377
|
+
if (existsSync(restoreSrc)) {
|
|
378
|
+
cpSync(restoreSrc, restoreDest);
|
|
379
|
+
chmodSync(restoreDest, 0o755);
|
|
380
|
+
console.log(` + ldm-restore.sh deployed to ~/.ldm/bin/`);
|
|
381
|
+
}
|
|
382
|
+
|
|
366
383
|
console.log('');
|
|
367
384
|
console.log(` LDM OS v${PKG_VERSION} initialized at ${LDM_ROOT}`);
|
|
368
385
|
console.log('');
|
package/docs/bridge/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## Your AIs talk to each other.
|
|
6
6
|
|
|
7
|
-
Cross-platform agent communication. Bridge (MCP), Agent Client Protocol (ACP-Client, Zed Industries), and Agent Communication Protocol (ACP-Comm, IBM/Linux Foundation). Three protocols, one system.
|
|
7
|
+
Cross-platform agent communication. Claude Code talks to Claude Code. Claude Code talks to OpenClaw. OpenClaw talks back. Bridge (MCP), Agent Client Protocol (ACP-Client, Zed Industries), and Agent Communication Protocol (ACP-Comm, IBM/Linux Foundation). Three protocols, one system.
|
|
8
8
|
|
|
9
9
|
## Three Protocols, One System
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ LDM OS uses three complementary protocols. Bridge is one of them.
|
|
|
16
16
|
| **Protocol** | MCP (JSON-RPC over stdio) | JSON-RPC over stdio + WebSocket | REST/HTTP |
|
|
17
17
|
| **Built by** | WIP Computer | Zed Industries | IBM / Linux Foundation |
|
|
18
18
|
| **In LDM OS** | Core (v0.3.0+) | Available via OpenClaw | Planned (Cloud Relay) |
|
|
19
|
-
| **What it connects** |
|
|
19
|
+
| **What it connects** | CC <-> CC + CC <-> OpenClaw agents | IDEs (Zed, VS Code) <-> agents | Cloud agents <-> each other |
|
|
20
20
|
| **Memory access** | Yes (search + read across agents) | No | No |
|
|
21
21
|
| **Skill sharing** | Yes (OpenClaw skills as MCP tools) | No | No |
|
|
22
22
|
| **Where it runs** | Localhost only | Localhost (stdio) + remote (WebSocket) | Cloud (HTTP endpoints) |
|
|
@@ -37,13 +37,23 @@ All three are Apache 2.0 compatible with our MIT + AGPL license. See [ACP docs](
|
|
|
37
37
|
| `oc_skills_list` | List all OpenClaw skills. |
|
|
38
38
|
| `oc_skill_*` | Run any OpenClaw skill with scripts. |
|
|
39
39
|
|
|
40
|
+
## Session Discovery
|
|
41
|
+
|
|
42
|
+
Multiple Claude Code sessions can discover each other via the Agent Register. On boot, Recall registers each session at `~/.ldm/sessions/`. Any session can list all running sessions with `ldm sessions`.
|
|
43
|
+
|
|
44
|
+
The registry tracks agent ID (cc-mini, cc-air), PID, working directory, and start time. Stale sessions (dead PIDs) are auto-cleaned on read. See `lib/sessions.mjs`.
|
|
45
|
+
|
|
40
46
|
## Message Flow
|
|
41
47
|
|
|
48
|
+
**CC <-> OpenClaw:**
|
|
42
49
|
```
|
|
43
50
|
CC --lesa_send_message--> OpenClaw Gateway (localhost:18789) --> Lesa
|
|
44
51
|
CC <--lesa_check_inbox--- HTTP Inbox (localhost:18790) <-- Lesa
|
|
45
52
|
```
|
|
46
53
|
|
|
54
|
+
**CC <-> CC:**
|
|
55
|
+
Multiple Claude Code sessions communicate via the file-based message bus and session registry at `~/.ldm/sessions/`. Each session registers on boot and can discover peers. No broker daemon required.
|
|
56
|
+
|
|
47
57
|
Both directions are live. Everything is localhost. No cloud.
|
|
48
58
|
|
|
49
59
|
## Part of LDM OS
|
package/docs/bridge/TECHNICAL.md
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
## Architecture
|
|
4
4
|
|
|
5
5
|
```
|
|
6
|
-
Claude Code CLI
|
|
6
|
+
Claude Code CLI (cc-mini, cc-air, or any CC session)
|
|
7
|
+
|
|
|
8
|
+
|-- On boot --> registerSession() --> ~/.ldm/sessions/{name}.json (session discovery)
|
|
7
9
|
|
|
|
8
10
|
|-- MCP stdio --> wip-bridge MCP server (single process)
|
|
9
11
|
| |
|
|
@@ -22,6 +24,13 @@ Claude Code CLI
|
|
|
22
24
|
| |-- lesa_memory_search --> filesystem (workspace/*.md)
|
|
23
25
|
| |
|
|
24
26
|
| |-- oc_skill_* --> exec scripts in ~/.openclaw/extensions/*/skills/
|
|
27
|
+
|
|
28
|
+
CC <-> CC (multi-session):
|
|
29
|
+
CC session A --> registerSession() --> ~/.ldm/sessions/a.json
|
|
30
|
+
CC session B --> registerSession() --> ~/.ldm/sessions/b.json
|
|
31
|
+
CC session A --> listSessions() --> discovers session B (agent ID, PID, cwd)
|
|
32
|
+
CC session B --> listSessions() --> discovers session A
|
|
33
|
+
Communication via file-based message bus at ~/.ldm/sessions/
|
|
25
34
|
```
|
|
26
35
|
|
|
27
36
|
## MCP Tools
|
|
@@ -65,6 +74,22 @@ Bridge starts a localhost-only HTTP server on port 18790:
|
|
|
65
74
|
|
|
66
75
|
Messages are held in memory. `lesa_check_inbox` drains the queue.
|
|
67
76
|
|
|
77
|
+
## Session Discovery
|
|
78
|
+
|
|
79
|
+
On boot, Recall registers the session via `registerSession()` from `lib/sessions.mjs`. Each session writes a JSON file to `~/.ldm/sessions/{name}.json` containing:
|
|
80
|
+
|
|
81
|
+
- `name` — session identifier
|
|
82
|
+
- `agentId` — agent identity (e.g. `cc-mini`, `cc-air`)
|
|
83
|
+
- `pid` — process ID (used for liveness checks)
|
|
84
|
+
- `startTime` — ISO timestamp
|
|
85
|
+
- `cwd` — working directory
|
|
86
|
+
|
|
87
|
+
`listSessions()` reads all session files, validates PID liveness (signal 0 probe), and auto-cleans stale entries. Filter by `agentId` to find specific agents. `sessionCount()` returns a quick count of live sessions.
|
|
88
|
+
|
|
89
|
+
CLI: `ldm sessions` lists all active sessions.
|
|
90
|
+
|
|
91
|
+
This enables CC-to-CC awareness without a broker daemon. Any session can discover any other session on the machine.
|
|
92
|
+
|
|
68
93
|
## Key Files
|
|
69
94
|
|
|
70
95
|
| File | What |
|
|
@@ -72,6 +97,7 @@ Messages are held in memory. `lesa_check_inbox` drains the queue.
|
|
|
72
97
|
| `src/bridge/core.ts` | Pure logic: config, messaging, search, skills |
|
|
73
98
|
| `src/bridge/mcp-server.ts` | MCP server: tool registration, inbox HTTP server |
|
|
74
99
|
| `src/bridge/cli.ts` | CLI wrapper (`lesa` command) |
|
|
100
|
+
| `lib/sessions.mjs` | Session registration, discovery, PID liveness |
|
|
75
101
|
| `dist/bridge/` | Compiled output (ships with npm package) |
|
|
76
102
|
|
|
77
103
|
## Node Communication (Future)
|