trantor 0.17.74 → 0.17.75
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.mjs +20 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trantor",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.75",
|
|
4
4
|
"description": "Trantor — the hub-world for AI agent crews: live message bus, presence, project Kanban/flow board + crew orchestration for independent AI coding agents (Claude, Codex, Gemini, Kimi, DeepSeek)",
|
|
5
5
|
"mcpServers": {
|
|
6
6
|
"relay": {
|
package/mcp.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// tools to talk to OTHER live agent sessions through the relay hub. Loaded per-session
|
|
4
4
|
// via the agent's MCP config. Identity + hub URL come from env (RELAY_SESSION, RELAY_URL).
|
|
5
5
|
// Loading this server AUTO-REGISTERS the session — so presence works on every agent.
|
|
6
|
-
import { writeFileSync, existsSync, mkdirSync } from "node:fs";
|
|
6
|
+
import { writeFileSync, readFileSync, existsSync, mkdirSync } from "node:fs";
|
|
7
7
|
import { join, basename, dirname } from "node:path";
|
|
8
8
|
import { homedir, hostname } from "node:os";
|
|
9
9
|
import { execSync, spawnSync } from "node:child_process";
|
|
@@ -113,7 +113,7 @@ const fmt = (m) => `#${m.id} [${m.from} -> ${m.to}] ${new Date(m.ts).toLocaleTim
|
|
|
113
113
|
const server = new McpServer({ name: "trantor", version: "0.1.0" });
|
|
114
114
|
|
|
115
115
|
server.tool("relay_whoami", "Show this session's relay identity, project, and the hub URL.", {}, async () => {
|
|
116
|
-
await api("POST", "/register", { session: SESSION, project: PROJECT }).catch(() => {});
|
|
116
|
+
await api("POST", "/register", { session: SESSION, project: PROJECT, hookVersion: MCP_VERSION }).catch(() => {});
|
|
117
117
|
return { content: [{ type: "text", text: `session=${SESSION}\nproject=${PROJECT}\nhub=${resolveHub(PROJECT)}` }] };
|
|
118
118
|
});
|
|
119
119
|
|
|
@@ -323,6 +323,22 @@ server.tool("relay_wait", "Block up to `timeout` seconds waiting for the next me
|
|
|
323
323
|
|
|
324
324
|
const HEARTBEAT_MS = Number(process.env.RELAY_HEARTBEAT_MS || 60 * 1000);
|
|
325
325
|
|
|
326
|
+
// This server's own plugin version, stamped on every /register. Only the tool-use heartbeat HOOK
|
|
327
|
+
// used to write hookVersion, so a fresh-but-idle session's peer row kept its DEAD predecessor's
|
|
328
|
+
// version until the first tool call — misread twice on 2026-08-19 as "wrong plugin version after
|
|
329
|
+
// restart". The MCP boots with the session and registers immediately, so it makes the row truthful
|
|
330
|
+
// from second one. Same lookup as hooks/lib/update-check.mjs: plugin.json beside this file, then
|
|
331
|
+
// package.json (running straight from the repo).
|
|
332
|
+
const MCP_VERSION = (() => {
|
|
333
|
+
for (const rel of ["./.claude-plugin/plugin.json", "./package.json"]) {
|
|
334
|
+
try {
|
|
335
|
+
const v = JSON.parse(readFileSync(new URL(rel, import.meta.url), "utf8")).version;
|
|
336
|
+
if (v) return v;
|
|
337
|
+
} catch {}
|
|
338
|
+
}
|
|
339
|
+
return "";
|
|
340
|
+
})();
|
|
341
|
+
|
|
326
342
|
// Mirror the SessionStart/PostToolUse hooks: some directories aren't project work, and
|
|
327
343
|
// auto-registering from them spawns a phantom project lane that then sits in the sidebar forever.
|
|
328
344
|
// PROJECT falls back to the cwd basename, so the directory name becomes the lane name:
|
|
@@ -341,7 +357,7 @@ const nonProjectReason = projectDir === homedir() ? "home dir"
|
|
|
341
357
|
const isHomeDirSession = !process.env.RELAY_SESSION && !process.env.RELAY_PROJECT && !!nonProjectReason;
|
|
342
358
|
|
|
343
359
|
if (!isHomeDirSession) {
|
|
344
|
-
await api("POST", "/register", { session: SESSION, project: PROJECT, status: `active in ${PROJECT}
|
|
360
|
+
await api("POST", "/register", { session: SESSION, project: PROJECT, status: `active in ${PROJECT}`, hookVersion: MCP_VERSION })
|
|
345
361
|
.catch((err) => { process.stderr.write(`[trantor-mcp] initial register failed: ${err?.message || err}\n`); });
|
|
346
362
|
|
|
347
363
|
// Heartbeat — keep this session's presence fresh for as long as the MCP process lives.
|
|
@@ -353,7 +369,7 @@ if (!isHomeDirSession) {
|
|
|
353
369
|
// hub refreshes lastSeen but preserves the session's meaningful status. setInterval pauses during
|
|
354
370
|
// sleep and fires on wake, so presence self-heals within one interval; .unref() lets the process
|
|
355
371
|
// still exit cleanly when the agent closes the stdio transport (no phantom peers).
|
|
356
|
-
setInterval(() => { api("POST", "/register", { session: SESSION, project: PROJECT }).catch(() => {}); }, HEARTBEAT_MS).unref?.();
|
|
372
|
+
setInterval(() => { api("POST", "/register", { session: SESSION, project: PROJECT, hookVersion: MCP_VERSION }).catch(() => {}); }, HEARTBEAT_MS).unref?.();
|
|
357
373
|
} else {
|
|
358
374
|
process.stderr.write(`[trantor-mcp] ${nonProjectReason} — not auto-registering on the bus (set RELAY_SESSION or RELAY_PROJECT to opt in)\n`);
|
|
359
375
|
}
|