@sym-bot/mesh-channel 0.3.8 → 0.3.10

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,19 +1,19 @@
1
1
  {
2
- "name": "sym-mesh-channel",
2
+ "name": "sym-bot",
3
3
  "owner": {
4
4
  "name": "SYM.BOT",
5
5
  "email": "info@sym.bot"
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Real-time communication and collaboration among Claude Code sessions — agent-to-agent cognitive signals over Bonjour LAN or WebSocket relay, on the Mesh Memory Protocol (MMP).",
9
- "version": "0.3.8"
9
+ "version": "0.3.10"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "sym-mesh-channel",
14
14
  "source": "./",
15
15
  "description": "Real-time communication and collaboration among Claude Code sessions. Turns Claude Code into a peer node on the SYM mesh — two or more sessions discover each other via Bonjour (LAN) or a WebSocket relay (cross-network) and exchange structured cognitive signals as channel notifications. Each peer has its own Ed25519 identity, SVAF content gating, and local memory. Built on the Mesh Memory Protocol (MMP), an open peer-to-peer protocol for multi-agent collective intelligence.",
16
- "version": "0.3.8",
16
+ "version": "0.3.10",
17
17
  "author": {
18
18
  "name": "Hongwei Xu",
19
19
  "email": "hongwei@sym.bot"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sym-mesh-channel",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "Real-time Claude-to-Claude mesh. Agent-to-agent cognitive signals over Bonjour LAN or WebSocket relay.",
5
5
  "author": {
6
6
  "name": "Hongwei Xu",
package/.mcp.json CHANGED
@@ -2,7 +2,10 @@
2
2
  "mcpServers": {
3
3
  "claude-sym-mesh": {
4
4
  "command": "npx",
5
- "args": ["-y", "@sym-bot/mesh-channel@0.3.8"],
5
+ "args": [
6
+ "-y",
7
+ "@sym-bot/mesh-channel@0.3.10"
8
+ ],
6
9
  "env": {
7
10
  "SYM_RELAY_URL": "${user_config.relay_url}",
8
11
  "SYM_RELAY_TOKEN": "${user_config.relay_token}",
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  ```
8
8
  # in Claude Code — the first line is one-time setup
9
9
  /plugin marketplace add sym-bot/sym-mesh-channel
10
- /plugin install sym-mesh-channel@sym-mesh-channel
10
+ /plugin install sym-mesh-channel@sym-bot
11
11
  ```
12
12
 
13
13
  [![npm](https://img.shields.io/npm/v/@sym-bot/mesh-channel)](https://www.npmjs.com/package/@sym-bot/mesh-channel)
@@ -66,16 +66,26 @@ They're **not alternatives** — the channel is built *on* sym and speaks the sa
66
66
 
67
67
  ## Quick start
68
68
 
69
- Install the published plugin from the SYM marketplace — in Claude Code:
69
+ Install the published plugin from the **sym-bot** marketplace — in Claude Code:
70
70
 
71
71
  ```
72
72
  /plugin marketplace add sym-bot/sym-mesh-channel
73
- /plugin install sym-mesh-channel@sym-mesh-channel
73
+ /plugin install sym-mesh-channel@sym-bot
74
74
  ```
75
75
 
76
- That's the whole setup: all 11 MCP tools, plus peer messages appearing in Claude's context mid-turn with no tool call the "Claude thinks with the mesh" experience the screenshots above show. **One install covers every Claude Code session on the machine** open as many as you like (one per repo, or one planning while another codes); each picks up the mesh on resume. The first command is a one-time marketplace registration.
76
+ That gives you all **11 MCP tools no flag, no npm, nothing else to add**and **one install covers every Claude Code session on the machine**: open as many as you like (one per repo, or one planning while another codes); each gets its own mesh identity and picks up the mesh on resume. The first command is a one-time marketplace registration.
77
77
 
78
- Also in the official [Anthropic Plugin Directory](https://claude.ai/settings/plugins) — browse `/plugin` → **Discover** and search "mesh", or install from `@claude-community` after `/plugin marketplace add anthropics/claude-plugins-community`. If real-time `<channel>` notifications don't arrive, see [Troubleshooting](#channel-notifications-never-arrive-even-though-peers-are-connected).
78
+ Also in the official [Anthropic Plugin Directory](https://claude.ai/settings/plugins) — `/plugin` → **Discover** search "mesh", or `/plugin install sym-mesh-channel@claude-community` after `/plugin marketplace add anthropics/claude-plugins-community`.
79
+
80
+ ### Real-time push (the `<channel>` experience)
81
+
82
+ The tools above are pull-based. For a peer's message to **land in Claude's context mid-turn, with no tool call** — the "Claude thinks with the mesh" experience the screenshots show — Claude Code has to load this plugin's *channel*, which is currently gated behind a flag while it awaits Anthropic's approved-channels allowlist:
83
+
84
+ ```
85
+ claude --dangerously-load-development-channels plugin:sym-mesh-channel@sym-bot
86
+ ```
87
+
88
+ The flag becomes unnecessary once the channel is allowlisted — tracked in [anthropics/claude-plugins-official#1512](https://github.com/anthropics/claude-plugins-official/issues/1512).
79
89
 
80
90
  ## What you get
81
91
 
@@ -321,12 +331,12 @@ Some corporate networks block mDNS multicast entirely — try a hotspot or home
321
331
 
322
332
  ### `<channel>` notifications never arrive even though peers are connected
323
333
 
324
- The published plugin loads the channel on its own. If `<channel>` notifications still don't arrive, real-time push may not yet be enabled on your account as a fallback, launch Claude Code with the development-channels flag matching your install path:
334
+ The 11 tools work without any flag. The real-time `<channel>` **push** is separate: Claude Code only delivers channel notifications for channels on its **approved-channels allowlist**, and sym-mesh-channel isn't on it yet so push requires the development-channels flag matching your install path:
325
335
 
326
- - plugin install: `--dangerously-load-development-channels plugin:sym-mesh-channel@sym-mesh-channel`
336
+ - plugin install: `--dangerously-load-development-channels plugin:sym-mesh-channel@sym-bot`
327
337
  - npm install: `--dangerously-load-development-channels server:claude-sym-mesh`
328
338
 
329
- The tools work regardless; only the async push surface may be gated. Status tracked in [anthropics/claude-plugins-official#1512](https://github.com/anthropics/claude-plugins-official/issues/1512).
339
+ This is an Anthropic-side gate, not a bug here — once the channel is allowlisted the flag is no longer needed. Tracked in [anthropics/claude-plugins-official#1512](https://github.com/anthropics/claude-plugins-official/issues/1512).
330
340
 
331
341
  ### `sym_status` says "Relay: connected" when you didn't configure one
332
342
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sym-bot/mesh-channel",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "MCP server — real-time agent-to-agent cognition for Claude Code remote teams via the SYM mesh.",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -7,6 +7,25 @@ if (process.argv[2] === 'init') {
7
7
  return;
8
8
  }
9
9
 
10
+ // ── stdout discipline (v0.3.9) ──────────────────────────────────────────────
11
+ // MCP frames JSON-RPC on stdout. Any non-JSON write there — ours or, far more
12
+ // often, a dependency's load banner (e.g. "[encoder] Semantic encoder ready"
13
+ // from the semantic model) — corrupts the stream and makes Claude Code drop the
14
+ // connection (-32000) or log "Ignoring non-JSON line on stdout". Guard it: lines
15
+ // that look like JSON-RPC (start with '{') pass through to the real stdout;
16
+ // everything else is redirected to stderr. Installed before any require so it
17
+ // catches dependency output at load time.
18
+ const __realStdoutWrite = process.stdout.write.bind(process.stdout);
19
+ process.stdout.write = function (chunk, ...rest) {
20
+ try {
21
+ const s = typeof chunk === 'string' ? chunk : chunk.toString('utf8');
22
+ if (s.trimStart().startsWith('{')) return __realStdoutWrite(chunk, ...rest);
23
+ return process.stderr.write(chunk, ...rest);
24
+ } catch {
25
+ return __realStdoutWrite(chunk, ...rest);
26
+ }
27
+ };
28
+
10
29
  /**
11
30
  * sym-mesh-channel — MCP server that makes Claude Code a peer node on the SYM mesh.
12
31
  *
@@ -192,7 +211,26 @@ function defaultNodeName() {
192
211
  }
193
212
  return `claude-${clean(require('os').hostname())}`;
194
213
  }
195
- const NODE_NAME = process.env.SYM_NODE_NAME || defaultNodeName();
214
+ // Live-collision auto-suffix (v0.3.10): @sym-bot/sym already reclaims STALE locks
215
+ // (dead holder), so crashed sessions self-heal. But two LIVE sessions wanting the
216
+ // same name — a duplicate dev agent, or two sessions sharing a fixed SYM_NODE_NAME
217
+ // — would hard-fail with EIDENTITYLOCK. Resolve the name up front: if the base is
218
+ // held by a live process, append -2/-3/… so the second session coexists instead of
219
+ // failing. A dead or absent holder keeps the base name (sym reclaims it on start).
220
+ function resolveNodeName(base) {
221
+ const fs = require('fs'), os = require('os'), path = require('path');
222
+ const alive = (pid) => { try { process.kill(pid, 0); return true; } catch (e) { return e.code === 'EPERM'; } };
223
+ for (let i = 0; i < 64; i++) {
224
+ const name = i === 0 ? base : `${base}-${i + 1}`;
225
+ try {
226
+ const pid = parseInt(fs.readFileSync(path.join(os.homedir(), '.sym', 'nodes', name, 'lock.pid'), 'utf8').trim(), 10);
227
+ if (pid && alive(pid)) continue; // live holder → try the next suffix
228
+ } catch { /* no lock file → name is free */ }
229
+ return name; // free, or a stale lock sym will reclaim on start()
230
+ }
231
+ return base;
232
+ }
233
+ const NODE_NAME = resolveNodeName(process.env.SYM_NODE_NAME || defaultNodeName());
196
234
 
197
235
  // ── Mesh group (MMP §5.8) ──────────────────────────────────
198
236
  //