Compare commits
2 Commits
21cb6efced
...
32fc4a0c98
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32fc4a0c98 | ||
|
|
b315b31cc9 |
@@ -345,6 +345,32 @@ A structured logging system where peers report errors, warnings, and debug info
|
||||
|
||||
**Effort:** 1-2 days.
|
||||
|
||||
### 23. Peer session persistence ("welcome back")
|
||||
|
||||
When a peer disconnects, their state is lost (groups, profile, visibility, stats, summary). On reconnect they start blank. Persist peer state so returning peers resume where they left off.
|
||||
|
||||
**What persists (keyed by meshId + memberId):**
|
||||
- Groups and roles
|
||||
- Profile (avatar, title, bio, capabilities)
|
||||
- Visibility setting
|
||||
- Last summary
|
||||
- Cumulative stats (messages, tool calls across all sessions)
|
||||
- Last seen timestamp
|
||||
|
||||
**What resets:** status (always "idle" on connect), WebSocket/presenceId (ephemeral).
|
||||
|
||||
**Reconnect flow:**
|
||||
1. Peer sends hello with same `memberId`
|
||||
2. Broker looks up `peer_state` table for (meshId, memberId)
|
||||
3. If found: restore groups, profile, visibility, stats — hello fields take precedence if explicitly set
|
||||
4. Enriched `hello_ack` includes `restored: true` and previous summary
|
||||
5. System notification: `"Welcome back, Alice! Last seen 2h ago. Restored: @frontend:lead, @devops:member"`
|
||||
6. On disconnect: upsert current state to `peer_state`
|
||||
|
||||
**Why:** AI sessions restart often (context limits, crashes, new tasks). Without persistence, every reconnect requires manual group joins and profile setup. With it, the mesh remembers who you are.
|
||||
|
||||
**Effort:** Half day.
|
||||
|
||||
---
|
||||
|
||||
## Suggested build order
|
||||
@@ -374,6 +400,7 @@ A structured logging system where peers report errors, warnings, and debug info
|
||||
| 21 | SDK (@claudemesh/sdk) | 1 day | Non-Claude-Code clients | **DONE** `7e102a2` |
|
||||
| 22 | Telegram connector | 1-2 days | Reach beyond Claude Code | **DONE** `fe92853` |
|
||||
| 23 | Mesh telemetry + debugging | 1-2 days | Self-diagnosing mesh | |
|
||||
| 24 | Peer session persistence | Half day | "Welcome back" on reconnect | |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
"start": "node dist/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@slack/web-api": "^7.0.0",
|
||||
"@slack/socket-mode": "^2.0.0",
|
||||
"ws": "^8.0.0",
|
||||
"@slack/web-api": "^7.0.0",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"tweetnacl-util": "^0.15.1"
|
||||
"tweetnacl-util": "^0.15.1",
|
||||
"ws": "8.20.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/ws": "^8.0.0",
|
||||
"@types/ws": "8.5.13",
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
"start": "node dist/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"ws": "^8.0.0",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"tweetnacl-util": "^0.15.1"
|
||||
"tweetnacl-util": "^0.15.1",
|
||||
"ws": "8.20.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/ws": "^8.0.0",
|
||||
"@types/ws": "8.5.13",
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
@@ -737,11 +737,11 @@ importers:
|
||||
specifier: ^0.15.1
|
||||
version: 0.15.1
|
||||
ws:
|
||||
specifier: ^8.0.0
|
||||
specifier: 8.20.0
|
||||
version: 8.20.0
|
||||
devDependencies:
|
||||
'@types/ws':
|
||||
specifier: ^8.0.0
|
||||
specifier: 8.5.13
|
||||
version: 8.5.13
|
||||
typescript:
|
||||
specifier: ^5.0.0
|
||||
@@ -756,11 +756,11 @@ importers:
|
||||
specifier: ^0.15.1
|
||||
version: 0.15.1
|
||||
ws:
|
||||
specifier: ^8.0.0
|
||||
specifier: 8.20.0
|
||||
version: 8.20.0
|
||||
devDependencies:
|
||||
'@types/ws':
|
||||
specifier: ^8.0.0
|
||||
specifier: 8.5.13
|
||||
version: 8.5.13
|
||||
typescript:
|
||||
specifier: ^5.0.0
|
||||
|
||||
Reference in New Issue
Block a user