@sym-bot/mesh-channel 0.3.21 → 0.3.22
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/.claude-plugin/plugin.json +1 -1
- package/.mcp.json +1 -1
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/server.js +19 -3
package/.mcp.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.22
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Per-project identity via `$CLAUDE_PROJECT_DIR/.sym/node.json`.** A named role agent (e.g. a CTO node `claude-code-mac` on `sym-bot-team`, or `melotune-dev` on `melo-ios`) can now commit `{ "node_name": "...", "group": "..." }` to `.sym/node.json` in its repo, and the plugin reads it on start. This lets the **plugin alone** carry a stable, per-project identity — no parallel `claude-sym-mesh` MCP registration in a project `.mcp.json`, which previously produced a *second* mesh node (the project-scoped server plus the plugin-scoped server are never deduplicated). Because the identity lives in the repo, it survives a plugin reinstall. Precedence is unchanged-and-extended: `SYM_NODE_NAME`/`SYM_GROUP` env still win, then `.sym/node.json`, then the auto `claude-<repo>-<session>` default. A missing or malformed file is ignored (falls back to the auto default) — never a hard fail.
|
|
8
|
+
|
|
3
9
|
## 0.3.21
|
|
4
10
|
|
|
5
11
|
### Changed
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -232,7 +232,23 @@ function resolveNodeName(base) {
|
|
|
232
232
|
}
|
|
233
233
|
return base;
|
|
234
234
|
}
|
|
235
|
-
|
|
235
|
+
// Per-project identity (v0.3.22): a named role agent (CTO, melotune-dev, …) commits
|
|
236
|
+
// its node name + group to `$CLAUDE_PROJECT_DIR/.sym/node.json`, so the plugin alone
|
|
237
|
+
// carries a stable per-project identity — no parallel MCP registration, and it
|
|
238
|
+
// survives a plugin reinstall because the config lives in the repo, not the plugin.
|
|
239
|
+
// Env (SYM_NODE_NAME/SYM_GROUP) still wins; this only overrides the auto default.
|
|
240
|
+
// Missing/malformed file → {} → auto default; never a hard fail.
|
|
241
|
+
function projectNodeConfig() {
|
|
242
|
+
const fs = require('fs'), path = require('path');
|
|
243
|
+
const dir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
244
|
+
try {
|
|
245
|
+
const cfg = JSON.parse(fs.readFileSync(path.join(dir, '.sym', 'node.json'), 'utf8'));
|
|
246
|
+
const clean = (s) => (typeof s === 'string' && s.trim()) ? s.trim() : undefined;
|
|
247
|
+
return { node_name: clean(cfg.node_name), group: clean(cfg.group) };
|
|
248
|
+
} catch { return {}; }
|
|
249
|
+
}
|
|
250
|
+
const PROJECT_CFG = projectNodeConfig();
|
|
251
|
+
const NODE_NAME = resolveNodeName(process.env.SYM_NODE_NAME || PROJECT_CFG.node_name || defaultNodeName());
|
|
236
252
|
|
|
237
253
|
// ── Mesh group (MMP §5.8) ──────────────────────────────────
|
|
238
254
|
//
|
|
@@ -245,7 +261,7 @@ const NODE_NAME = resolveNodeName(process.env.SYM_NODE_NAME || defaultNodeName()
|
|
|
245
261
|
function resolveServiceType() {
|
|
246
262
|
const explicit = process.env.SYM_SERVICE_TYPE;
|
|
247
263
|
if (explicit) return explicit;
|
|
248
|
-
const group = process.env.SYM_GROUP;
|
|
264
|
+
const group = process.env.SYM_GROUP || PROJECT_CFG.group;
|
|
249
265
|
if (group && group !== 'default') return `_${group}._tcp`;
|
|
250
266
|
return '_sym._tcp';
|
|
251
267
|
}
|
|
@@ -253,7 +269,7 @@ function resolveServiceType() {
|
|
|
253
269
|
// Claude Code restart. Declaring as `let` rather than `const` is the
|
|
254
270
|
// smallest change that makes hot-swap possible.
|
|
255
271
|
let SERVICE_TYPE = resolveServiceType();
|
|
256
|
-
let GROUP = process.env.SYM_GROUP || (SERVICE_TYPE !== '_sym._tcp'
|
|
272
|
+
let GROUP = process.env.SYM_GROUP || PROJECT_CFG.group || (SERVICE_TYPE !== '_sym._tcp'
|
|
257
273
|
? SERVICE_TYPE.replace(/^_/, '').replace(/\._tcp$/, '')
|
|
258
274
|
: 'default');
|
|
259
275
|
let RELAY_URL = process.env.SYM_RELAY_URL || null;
|