trantor 0.18.138 → 0.18.140

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.
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Trantor — the hub-world for AI agent crews: live message bus, presence, project Kanban/flow board + context-handoff for independent AI coding agents (Claude, Codex, Gemini, …)",
9
- "version": "0.18.138"
9
+ "version": "0.18.140"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "trantor",
14
14
  "source": "./",
15
15
  "description": "The hub-world for AI agent crews. Say \"fire up the crew\" and Claude becomes the architect: a plan-aware Advisor routes the work (solo / cheap inline calls / live crew of Codex, GLM, Kimi & DeepSeek in their own terminal windows), a Kanban/flow command center with a testing gate tracks it, and an economics brain (Scrooge) keeps the receipts. Includes the relay MCP, a SessionStart auto-discovery hook, and a PreCompact context-handoff so a fresh session can take over a full window instead of compacting.",
16
- "version": "0.18.138",
16
+ "version": "0.18.140",
17
17
  "author": {
18
18
  "name": "Sasha Bogojevic"
19
19
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.138",
3
+ "version": "0.18.140",
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/README.md CHANGED
@@ -269,7 +269,7 @@ No cmux or tmux? Crews still work — one titled Terminal window per seat, still
269
269
 
270
270
  ## The dashboard — `trantor ui`
271
271
 
272
- A live command center at `http://127.0.0.1:4477`, grouped by **project** — and a *durable,
272
+ A live command center in the Trantor desktop app, grouped by **project** — and a *durable,
273
273
  self-maintaining record*, not just a snapshot. Dead sessions self-prune (no more graveyard of
274
274
  stale boards), and the project order is **stable**: a working board updates in place instead of
275
275
  jumping to the top while you're reading it.
@@ -506,7 +506,7 @@ GLM via OpenCode is its replacement. Gemini still works as a Scrooge cheap-model
506
506
  hub.mjs ←— plain HTTP + SSE · presence/messages/board/history/lessons/learning/economics
507
507
  (Node built-ins only · state in ~/.agent-bus/bus.json · loopback by default)
508
508
  ▲
509
- dashboard (ui.html) · BOARD/FLOW/TIMELINE · 🧠 Learning · 🪙 savings · conversation lanes
509
+ dashboard (Trantor.app) · BOARD/FLOW/TIMELINE · 🧠 Learning · 🪙 savings · conversation lanes
510
510
  ```
511
511
 
512
512
  Config: `RELAY_URL` env → `~/.agent-bus/config.json` → `http://127.0.0.1:4477`.
@@ -526,7 +526,7 @@ The `relay_*` tool names and the `~/.agent-bus` state dir remain until a later r
526
526
  - You can't interrupt an agent **mid-turn**; messages land when its current turn ends (idle
527
527
  agents wake instantly via their runner).
528
528
  - Window spawning is macOS (Terminal.app); on Linux the launcher prints per-agent commands
529
- to run in your own terminals. Hub/MCP/dashboard are cross-platform.
529
+ to run in your own terminals. Hub/MCP are cross-platform.
530
530
  - The hub is deliberately tiny (in-memory + JSON file) — a coordination bus, not a message queue.
531
531
  - Each CLI's sign-in is its own (ChatGPT, Google, Kimi accounts) — the doctor detects state
532
532
  and names the fix, but can't log in for you.
package/bin/cli.mjs CHANGED
@@ -110,7 +110,6 @@ switch (cmd) {
110
110
  console.log(`${id} recorded in ${p}${current === id ? " (unchanged)" : ""} — commit it so worktrees and clones carry the identity`);
111
111
  break;
112
112
  }
113
- case "watch": run("bin/relay-watch.mjs"); break;
114
113
  case "catchup": run("bin/catchup.mjs"); break;
115
114
  case "agents": run("bin/agents.mjs"); break;
116
115
  case "gate": run("bin/gate.mjs"); break;
@@ -124,7 +123,6 @@ switch (cmd) {
124
123
  case "balances": case "balance": case "credits": run("bin/balances.mjs"); break;
125
124
  case "recost": run("bin/recost.mjs"); break;
126
125
  case "handoff": run("bin/baton.mjs"); break;
127
- case "adopt": run("bin/adopt.mjs"); break;
128
126
  case "takeover": run("bin/takeover.mjs"); break;
129
127
  case "drill": run("bin/drill-surface.mjs"); break;
130
128
  case "summarize": run("bin/summarize.mjs"); break;
@@ -247,32 +245,13 @@ switch (cmd) {
247
245
  else console.error(`Enrollment failed: ${j.error || r.statusText}`);
248
246
  break;
249
247
  }
250
- // Prefer the desktop app: it signs hub requests in Rust; the browser has no signing key.
251
- // Explain the browser's read limitation when the desktop app is unavailable.
252
248
  case "ui": {
253
- const { resolveHubInfo } = await import(join(ROOT, "lib/project.mjs"));
254
- const { resolveProject } = await import(join(ROOT, "lib/project.mjs"));
255
- const url = resolveHubInfo(resolveProject(process.cwd())).url;
256
-
257
- let authMode = "";
258
- try {
259
- const r = await fetch(`${url}/health`, { signal: AbortSignal.timeout(5000) });
260
- authMode = String((await r.json()).authMode || "");
261
- } catch { /* hub unreachable — fall through and let the browser show that */ }
262
-
263
- const hasApp = process.platform === "darwin" && existsSync("/Applications/Trantor.app");
264
- if (authMode === "enforce" && hasApp) {
249
+ if (process.platform === "darwin" && existsSync("/Applications/Trantor.app")) {
265
250
  spawn("open", ["-a", "Trantor"], { stdio: "ignore", detached: true }).unref();
266
- console.log(`dashboard → Trantor.app (${url} is auth:enforce — a browser cannot sign, so it would show an empty board)`);
267
- break;
268
- }
269
- if (authMode === "enforce") {
270
- console.log(`⚠ ${url} is auth:enforce. A browser cannot sign its requests, so the board will be EMPTY —`);
271
- console.log(` every data endpoint returns 401. Install the desktop app instead: trantor app install`);
272
- console.log(` Opening it anyway so you can see for yourself…`);
251
+ console.log("dashboard → Trantor.app");
252
+ } else {
253
+ console.log("The dashboard is the Trantor desktop app. Install it with: trantor app install");
273
254
  }
274
- spawn(process.platform === "darwin" ? "open" : "xdg-open", [url], { stdio: "ignore", detached: true }).unref();
275
- console.log(`dashboard → ${url}`);
276
255
  break;
277
256
  }
278
257
  case "version": case "-v": case "--version":
@@ -327,7 +306,6 @@ switch (cmd) {
327
306
  trantor seat-why WHY a seat is down (err file, logs, pids): seat-why <agent> [--json] — quota, auth, crash, or just no pane
328
307
  trantor seat-record the per-project seat record the advisor benches from (✓/∅/↩ per difficulty) — [--project p] [--reset <seat>] [--json]
329
308
  trantor telemetry ship send turn history to the hub — this seat's log, or every log with --all; prints stored/duplicates/dropped per file
330
- trantor watch live bus feed in the terminal
331
309
  trantor inbox THIS session's unread bus messages, signed (works under enforce) — [--all] [--consume] [--json]
332
310
  trantor policy the autonomy ladder: show | set <project> <1-4> | link <a> <b> --reason "<why>"
333
311
  trantor proposals agent-proposed permissions awaiting YOUR decision: [--all] | approve <id> [--note "…"] | deny <id> --note "…"
package/bin/connect.mjs CHANGED
@@ -19,11 +19,17 @@ const MCP = join(dirname(dirname(fileURLToPath(import.meta.url))), "mcp.mjs");
19
19
  const PROJECT_INFO = resolveProjectInfo(process.cwd());
20
20
  const PROJECT_AT_CONNECT = PROJECT_INFO.project;
21
21
  const URL_ = resolveHubInfo(PROJECT_AT_CONNECT).url;
22
- // Graft (github.com/NanoNets/context-graph-engine): local Tree-sitter dependency graph over MCP,
23
- // wired next to `relay` so a seat locates code in one call; the graph refreshes itself per query
24
- // and a project with no graft/ index simply returns empty tools. `graft build` seeds an index.
25
- const GRAFT = (() => { try { return execSync("command -v graft", { encoding: "utf8", shell: "/bin/sh" }).trim(); } catch { return "graft"; } })();
26
- const HAS_GRAFT = GRAFT !== "graft" || (() => { try { execSync("command -v graft", { stdio: "ignore", shell: "/bin/sh" }); return true; } catch { return false; } })();
22
+ // #14536: graft is no longer an agent MCP server (0 calls from Claude sessions in 30 days, a handful
23
+ // from seats, ~900 tokens of tool list per turn). The desktop app still runs the graft CLI itself.
24
+ // Connect removes the entries older versions wrote.
25
+ // The [mcp_servers.graft] table up to the next table, and the comment line connect wrote for it,
26
+ // which a later relay env refresh can leave separated from the table.
27
+ function removeCodexGraft(toml) {
28
+ return toml
29
+ .replace(/^# trantor — Graft[^\n]*\n/m, "")
30
+ .replace(/^\[mcp_servers\.graft\]\n(?:(?!\[)[^\n]*\n?)*/m, "")
31
+ .replace(/\n{3,}/g, "\n\n");
32
+ }
27
33
  const has = (cmd) => { try { execSync(`command -v ${cmd}`, { stdio: "ignore", shell: "/bin/sh" }); return true; } catch { return false; } };
28
34
  const stamp = new Date().toISOString().slice(0, 10);
29
35
  const backup = (p) => { const b = `${p}.bak-${stamp}`; if (!existsSync(b)) copyFileSync(p, b); return b; };
@@ -101,15 +107,11 @@ if (has("codex")) {
101
107
  }
102
108
  report("codex", note, p);
103
109
  }
104
- // graft alongside relay
105
- if (HAS_GRAFT) {
106
- const g = existsSync(p) ? readFileSync(p, "utf8") : "";
107
- if (g.includes("[mcp_servers.graft]")) report("codex", "graft already wired");
108
- else {
109
- const gblock = `\n# trantor — Graft code-graph tools (graft_find_code/_find_all/_trace_calls/_file_api/_repo_map)\n[mcp_servers.graft]\ncommand = "${GRAFT}"\nargs = ["mcp"]\n`;
110
- if (!DRY) { if (existsSync(p)) backup(p); writeFileSync(p, g + gblock); }
111
- report("codex", "graft wired", p);
112
- }
110
+ const g = existsSync(p) ? readFileSync(p, "utf8") : "";
111
+ const ungrafted = removeCodexGraft(g);
112
+ if (ungrafted !== g) {
113
+ if (!DRY) { backup(p); writeFileSync(p, ungrafted); }
114
+ report("codex", "graft MCP removed", p);
113
115
  }
114
116
  }
115
117
 
@@ -120,7 +122,7 @@ if (has("gemini")) {
120
122
  d.mcpServers ||= {};
121
123
  d.mcpServers.relay ||= { command: "node", args: [MCP], env: {} };
122
124
  d.mcpServers.relay.env = { ...d.mcpServers.relay.env, ...relayEnv("gemini") };
123
- if (HAS_GRAFT) d.mcpServers.graft ||= { command: GRAFT, args: ["mcp"] };
125
+ delete d.mcpServers.graft;
124
126
  }), p);
125
127
  }
126
128
 
@@ -132,7 +134,7 @@ const kimiRelay = (cli, p) => report(cli, patchJson(p, d => {
132
134
  d.mcpServers ||= {};
133
135
  d.mcpServers.relay ||= { command: "node", args: [MCP], env: {} };
134
136
  d.mcpServers.relay.env = { ...d.mcpServers.relay.env, ...relayEnv("kimi") };
135
- if (HAS_GRAFT) d.mcpServers.graft ||= { command: GRAFT, args: ["mcp"] };
137
+ delete d.mcpServers.graft;
136
138
  }), p);
137
139
  const kimiCodeHome = join(homedir(), ".kimi-code");
138
140
  const kimiPaths = [join(homedir(), ".kimi", "mcp.json"), join(kimiCodeHome, "mcp.json")];
@@ -168,7 +170,7 @@ if (has("opencode")) {
168
170
  d.$schema ||= "https://opencode.ai/config.json";
169
171
  d.mcp ||= {};
170
172
  d.mcp.relay ||= { type: "local", command: ["node", MCP], enabled: true };
171
- if (HAS_GRAFT) d.mcp.graft ||= { type: "local", command: [GRAFT, "mcp"], enabled: true };
173
+ delete d.mcp.graft;
172
174
  d.mcp.relay.environment ||= {};
173
175
  // Migrate the old generated pin too: `||=` alone left RELAY_AGENT=opencode in every existing
174
176
  // config forever, where OpenCode overlaid it on the qwen/glm/deepseek runner environment.
@@ -225,14 +227,7 @@ if (has("dsh")) {
225
227
  RELAY_AGENT: !!js process.env.RELAY_AGENT ?? 'dsh'
226
228
  RELAY_PROJECT: !!js process.env.RELAY_PROJECT ?? ''
227
229
  RELAY_SESSION: !!js process.env.RELAY_SESSION ?? ''
228
- ${HAS_GRAFT ? ` - id: trantor-graft
229
- name: '@deepseek-ai/dsh-mcp-client'
230
- config:
231
- serverName: graft
232
- transport: stdio
233
- command: ${GRAFT}
234
- args: ['mcp']
235
- ` : ""}`;
230
+ `;
236
231
  // "a profile exists" is not "a profile is current": connect grows rows over time, and an existence
237
232
  // check short-circuits on a profile written by an older connect forever. The gate is CONTENT-based:
238
233
  // every row id this connect writes must already be in the patch, else regenerate (backed up).
package/bin/crew/open.mjs CHANGED
@@ -214,8 +214,8 @@ function hostPane(ctx, chosen, id) {
214
214
  return pane;
215
215
  }
216
216
 
217
- // #6888: index the project once so its seats' Graft tools (graft_find_code, _trace_calls, …) have a
218
- // graph to serve. Non-blocking — the pane opens now, the ~7s build lands in the background; a no-op
217
+ // #6888: index the project once for the desktop's direct graft CLI reads. Non-blocking — the pane
218
+ // opens now, the ~7s build lands in the background; a no-op
219
219
  // if graft isn't installed or the index already exists (the graph self-refreshes per query after the
220
220
  // first build). Keeps the 20MB index out of the project's git.
221
221
  // Hide graft/ through .git/info/exclude, never the user's tracked .gitignore (#14322). Returns the file written, "" when not a git checkout.
@@ -251,7 +251,7 @@ export function maybeBuildGraft(dir) {
251
251
  const child = spawn("graft", ["build", dir], { cwd: dir, stdio: ["ignore", fd, fd], detached: true });
252
252
  child.on("error", () => {}); // ENOENT/EACCES: the log and the absent index are the evidence
253
253
  child.unref();
254
- console.error(`— indexing this project for the seats' Graft tools in the background (failures land in ${log}) —`);
254
+ console.error(`— indexing this project for the desktop's graft CLI in the background (failures land in ${log}) —`);
255
255
  } catch {}
256
256
  }
257
257
 
@@ -19,16 +19,16 @@ import { shellQuote } from "./crew/core.mjs";
19
19
  // One ownership map. Shared steps must finish before ANY card they cover can close.
20
20
  export const CARD_STEPS = {
21
21
  6799: { steps: ["S0", "S1", "S2", "S3", "S4", "S5"], autoClose: false },
22
- 6533: { steps: ["S6-ask"], autoClose: false, recipe: "covered by in-app Drill Mode: open a live orchestrator mid-ask, answer from Chat, and confirm the terminal advances and the card closes" },
22
+ 6533: { steps: ["S6-ask"], autoClose: false, recipe: "run TRANTOR_ASK_DRILL=trantor on the installed app, answer from Chat, and confirm the terminal advances and the card closes" },
23
23
  6668: { steps: ["S6-handoff"], autoClose: true },
24
- 6317: { steps: ["S6-key-post", "S6-key-throw"], autoClose: false, recipe: "covered by in-app Drill Mode: open a real Workspace with a live terminal pane and exercise key dispatch in the terminal and composer" },
24
+ 6317: { steps: ["S6-key-post", "S6-key-throw"], autoClose: false, recipe: "run TRANTOR_KEY_DRILL=post and TRANTOR_KEY_DRILL=throw on the installed app and verify key dispatch and exception containment" },
25
25
  6667: { steps: ["S4b", "S7"], autoClose: true },
26
26
  // P9 (#6965): the Phase-1 handoff carries a WorkingState and it carries NO credit. Never
27
27
  // auto-closes — with the flag off the step SKIPs, and a skip must not be mistaken for proof.
28
28
  6965: { steps: ["S4c"], autoClose: false, recipe: "set TRANTOR_STATE_HANDOFF=1 on a dogfood card, run `trantor drill`, and read S4c: the carried state must show 0 credited paths" },
29
29
  6587: { steps: ["S8"], autoClose: false, recipe: "needs live duty probe: operator removes the trantor/trantor-duty link, DMs the idle orchestrator, and checks for a socket nudge within 3 minutes" },
30
30
  6481: { steps: ["S9"], autoClose: true },
31
- 6483: { steps: ["S10"], autoClose: false, recipe: "covered by in-app Drill Mode (#6800): operator checks Accounts with the CLI below the app minimum, then restores the CLI" },
31
+ 6483: { steps: ["S10"], autoClose: false, recipe: "operator checks Settings › About with the CLI below the app minimum, then restores the CLI" },
32
32
  };
33
33
 
34
34
  export function findHandoff(dir, project) {
@@ -1,10 +1,21 @@
1
1
  #!/bin/bash
2
2
  # open-session.sh <dir> <command...> — open a NEW macOS Terminal window in <dir> running <command>.
3
3
  # Lets a Claude session spawn sibling terminal sessions (e.g. to test multi-session relay flows).
4
+ #
5
+ # #14531: the new window must not carry the caller's session identity. A Terminal session that
6
+ # kept HERDR_PANE_ID registered itself as the agent of a herdr pane it was not in (the app then
7
+ # attached to an empty pane), and one that kept CLAUDE_CODE_CHILD_SESSION ran with transcript
8
+ # saving off, so its conversation could never be resumed. Same list as lib/seats.mjs
9
+ # SESSION_IDENTITY_ENV, plus the rest of herdr's pane env.
4
10
  DIR="${1:-$HOME}"; shift; CMD="$*"
5
- osascript >/dev/null <<OSA
6
- tell application "Terminal"
7
- do script "cd " & quoted form of "$DIR" & " && $CMD"
8
- activate
9
- end tell
11
+ SCRUB="unset HERDR_ENV HERDR_PANE_ID HERDR_TAB_ID HERDR_WORKSPACE_ID HERDR_SOCKET_PATH TRANTOR_ORCH CLAUDECODE CLAUDE_CODE_CHILD_SESSION CLAUDE_CODE_ENTRYPOINT CLAUDE_CODE_SESSION_ID"
12
+ LINE="$SCRUB; cd $(printf '%q' "$DIR") && $CMD"
13
+ if [ "${TRANTOR_OPEN_SESSION_PRINT:-}" = "1" ]; then printf '%s\n' "$LINE"; exit 0; fi
14
+ osascript - "$LINE" >/dev/null <<'OSA'
15
+ on run argv
16
+ tell application "Terminal"
17
+ do script (item 1 of argv)
18
+ activate
19
+ end tell
20
+ end run
10
21
  OSA
@@ -490,9 +490,9 @@ try {
490
490
  // attended (default) = recap-then-WAIT; unattended = recap-then-RESUME — the handoff's OPEN
491
491
  // THREADS are the work order ("handoffs must never be a break").
492
492
  if (handoff.mode === "unattended") {
493
- additionalContext += `🔄 **You are taking over from a prior session that hit its context limit, in UNATTENDED (long-run) mode.** This is a fresh full window. Resume the work below — the prior session's summary, git state, and a pointer to its full transcript (searchable; Foundation/Gaia has it ingested) follow. Continue from "OPEN THREADS & NEXT STEPS"; do not restart from scratch.\n\n**READ BEFORE YOU BUILD (#8162).** This summary is a POINTER to the project's context, not a replacement for it. Open every file this handoff names as read-first — its memory files, its PRD and its TDD — BEFORE you touch code. Reading is not waiting, and it is not optional: three days running, successors recapped from this summary alone and went straight to code, burning a fifth of a context window rediscovering what was already written down. The ledger now checks which files you opened, not whether you replied.\n\nThen recap the task, state, and next step in at most 3 sentences, then RESUME the open threads — they are your work order. Do NOT wait for the user; keep building. Keep replies short: no status tables, no headers, no walls of text.\n\n`;
493
+ additionalContext += `🔄 **You are taking over from a prior session that hit its context limit, in UNATTENDED (long-run) mode.** This is a fresh full window. Resume the work below — the prior session's summary, git state, and a pointer to its full transcript (searchable) follow. Continue from "OPEN THREADS & NEXT STEPS"; do not restart from scratch.\n\n**READ BEFORE YOU BUILD (#8162).** This summary is a POINTER to the project's context, not a replacement for it. Open every file this handoff names as read-first — its memory files, its PRD and its TDD — BEFORE you touch code. Reading is not waiting, and it is not optional: three days running, successors recapped from this summary alone and went straight to code, burning a fifth of a context window rediscovering what was already written down. The ledger now checks which files you opened, not whether you replied.\n\nThen recap the task, state, and next step in at most 3 sentences, then RESUME the open threads — they are your work order. Do NOT wait for the user; keep building. Keep replies short: no status tables, no headers, no walls of text.\n\n`;
494
494
  } else {
495
- additionalContext += `🔄 **You are taking over from a prior session that hit its context limit.** This is a fresh full window. Resume the work below — the prior session's summary, git state, and a pointer to its full transcript (searchable; Foundation/Gaia has it ingested) follow. Continue from "OPEN THREADS & NEXT STEPS"; do not restart from scratch.\n\n**READ BEFORE YOU ANSWER (#8162).** This summary is a POINTER to the project's context, not a replacement for it. Open every file this handoff names as read-first — its memory files, its PRD and its TDD — before you recap. A 3-sentence recap is producible from this summary alone, which is exactly how three days of takeovers went straight to code without opening anything. The ledger now checks which files you opened, not whether you replied.\n\nThen recap the task, state, and next step in at most 3 sentences, then wait. Keep replies short: no status tables, no headers, no walls of text unless the user explicitly asks for detail.\n\n`;
495
+ additionalContext += `🔄 **You are taking over from a prior session that hit its context limit.** This is a fresh full window. Resume the work below — the prior session's summary, git state, and a pointer to its full transcript (searchable) follow. Continue from "OPEN THREADS & NEXT STEPS"; do not restart from scratch.\n\n**READ BEFORE YOU ANSWER (#8162).** This summary is a POINTER to the project's context, not a replacement for it. Open every file this handoff names as read-first — its memory files, its PRD and its TDD — before you recap. A 3-sentence recap is producible from this summary alone, which is exactly how three days of takeovers went straight to code without opening anything. The ledger now checks which files you opened, not whether you replied.\n\nThen recap the task, state, and next step in at most 3 sentences, then wait. Keep replies short: no status tables, no headers, no walls of text unless the user explicitly asks for detail.\n\n`;
496
496
  }
497
497
  // Verification gates FIRST — these are structured "must verify before shipping" claims the prior
498
498
  // session couldn't independently prove. They go above the summary on purpose: a safety-critical
package/hub/auth.mjs CHANGED
@@ -13,11 +13,8 @@ const BODY_CAP_DEFAULT = 4 * 1024 * 1024;
13
13
  const BODY_CAP_PROMPT = 16 * 1024 * 1024;
14
14
  // More than 100x the measured 115,194-byte desktop snapshot.
15
15
  const BODY_CAP_OWNER_CHAT = 16 * 1024 * 1024;
16
- // About 6x the measured 10,659,828-byte real state.
17
- const BODY_CAP_OWNER_IMPORT = 64 * 1024 * 1024;
18
16
  const OWNER_BODY_CAPS = new Map([
19
17
  ["/session/chat", BODY_CAP_OWNER_CHAT],
20
- ["/import", BODY_CAP_OWNER_IMPORT],
21
18
  ["/handoff", BODY_CAP_DEFAULT], ["/task", BODY_CAP_DEFAULT], ["/task/update", BODY_CAP_DEFAULT],
22
19
  ]);
23
20
  function bodyCap(P) { return P === "/session/prompt" ? BODY_CAP_PROMPT : BODY_CAP_DEFAULT; }
@@ -96,7 +93,7 @@ function cmpSemver(a, b) {
96
93
  }
97
94
  const AUTH_HEADERS = ["x-trantor-pubkey", "x-trantor-sig", "x-trantor-ts", "x-trantor-nonce"];
98
95
  const PUBLIC_ENDPOINTS = new Set(["/", "/ui", "/health", "/enroll"]);
99
- const OWNER_ENDPOINTS = new Set(["/project/delete", "/sweep", "/reconcile", "/invite", "/import", "/policy", "/session/prompts", "/session/prompt/claim", "/session/prompt/ack", "/session/attachment"]);
96
+ const OWNER_ENDPOINTS = new Set(["/project/delete", "/sweep", "/reconcile", "/invite", "/policy", "/session/prompts", "/session/prompt/claim", "/session/prompt/ack", "/session/attachment"]);
100
97
  const DEVICE_ENDPOINTS = new Set(["/device/register", "/device/unregister", "/devices"]);
101
98
  const READ_ENDPOINTS = new Set(["/peers", "/tasks", "/events", "/inbox", "/peer", "/card", "/stream", "/history", "/projects", "/catchup", "/phases", "/recent", "/handoffs", "/verify-gates", "/claims", "/proposals", "/grants", "/overseer/context", "/overseer/status", "/session/chat", "/session/prompt", "/crew/roster", "/machines/health"]);
102
99
  const roleRank = { read: 1, write: 2, approver: 3, owner: 4 };
@@ -25,7 +25,7 @@ function remoteEvidence(value, file) {
25
25
  export async function routeAdmin({ req, res, q, P, auth, ctx }) {
26
26
  const {
27
27
  state, body, json, crossProjectGuard, touch, canon, filterReadable,
28
- appendEvent, EVENT_CAP, overseer, ONLINE_MS, PEER_TTL_MS, pruneClaims, fileClaims,
28
+ appendEvent, overseer, ONLINE_MS, PEER_TTL_MS, pruneClaims, fileClaims,
29
29
  scopeAllows, duty, markDirty, HUB_VERSION, cmpSemver, prunePeers,
30
30
  filterDiscoverable, healthOf, now, canRead, AUTH_MODE, CLAIM_TTL_MS, subFp,
31
31
  } = ctx;
@@ -118,47 +118,6 @@ export async function routeAdmin({ req, res, q, P, auth, ctx }) {
118
118
  // BEFORE every file edit and the response carries any live claims by OTHER sessions, so an
119
119
  // orchestrator learns of a collision before the edit lands. Ephemeral like presence BY DESIGN.
120
120
 
121
- // --- project adoption: merge one project's rows brought from ANOTHER hub -------------------
122
- // The other half of `trantor adopt`: the CLI reads the project's rows off the machine-local hub
123
- // and POSTs them here (owner-signed). Colliding card ids get FRESH ids; idempotence is the
124
- // CALLER's contract: adopt refuses when the project already has cards here, unless forced.
125
- if (req.method === "POST" && P === "/import") {
126
- const b = await body(req);
127
- const proj = canon(String(b.project || "").slice(0, 80));
128
- if (!proj) return json(res, 400, { error: "project required" });
129
- const existing = state.tasks.filter(t => t.project === proj).length;
130
- if (existing && !b.force) return json(res, 409, { error: "project already has cards here", existing });
131
- const remap = new Map();
132
- const added = { tasks: 0, events: 0, messages: 0, remapped: 0 };
133
- const have = new Set(state.tasks.map(t => t.id));
134
- for (const t of (Array.isArray(b.tasks) ? b.tasks : [])) {
135
- let id = Number(t.id);
136
- if (!Number.isFinite(id)) continue;
137
- if (have.has(id)) { const nid = ++state.taskSeq; remap.set(id, nid); id = nid; added.remapped++; }
138
- else state.taskSeq = Math.max(state.taskSeq, id);
139
- state.tasks.push({ ...t, id, project: proj });
140
- have.add(id); added.tasks++;
141
- }
142
- for (const e of (Array.isArray(b.events) ? b.events : [])) {
143
- const last = state.events[state.events.length - 1];
144
- // Spread the incoming event FIRST, then stamp OUR id and project over it. The incoming `id`
145
- // belongs to the other hub's log and must not survive in any form: carried into the payload
146
- // it comes back on load and overwrites the real row id.
147
- state.eventSeq = Math.max(Number(state.eventSeq || 0), Number(last?.id) || 0) + 1;
148
- const ev = { ...e, id: state.eventSeq, project: proj };
149
- const taskId = ev.taskId != null ? remap.get(Number(ev.taskId)) : undefined;
150
- const importedEvent = taskId === undefined ? ev : { ...ev, taskId };
151
- state.events.push(importedEvent); added.events++;
152
- }
153
- if (state.events.length > EVENT_CAP) state.events.splice(0, state.events.length - EVENT_CAP);
154
- for (const m of (Array.isArray(b.messages) ? b.messages : [])) {
155
- state.messages.push({ ...m, id: ++state.seq, project: proj }); added.messages++;
156
- }
157
- if (state.messages.length > 5000) state.messages.splice(0, 1000);
158
- markDirty();
159
- appendEvent("project.adopted", proj, String(b.by || ""), { counts: added });
160
- return json(res, 200, { ok: true, ...added });
161
- }
162
121
  if (req.method === "GET" && P === "/policy") {
163
122
  return json(res, 200, overseerPolicy());
164
123
  }
@@ -7,7 +7,7 @@ export async function routeMessages({ req, res, q, P, auth, ctx }) {
7
7
  const {
8
8
  state, body, json, stripNulText, copyTask, crossProjectGuard, touch, pushToStreams,
9
9
  appendEvent, appendCardEvent, appendTaskLog, markDelivered, contractsFor, canUseInboxSession, inboxWindow,
10
- deliverable, inboxReadable, inboxResponse, filterReadable, canRead, streams, UI,
10
+ deliverable, inboxReadable, inboxResponse, filterReadable, canRead, streams,
11
11
  AUTH_MODE, persistHealth, duty, now, markDirty, assertNoSecrets, PEER_TTL_MS,
12
12
  CONTRACT_WINDOW_MS, PUBLIC_URL, turnTelemetry,
13
13
  } = ctx;
@@ -170,7 +170,7 @@ export async function routeMessages({ req, res, q, P, auth, ctx }) {
170
170
  return json(res, 200, { messages: filterReadable(auth, state.messages, m => m.project || "").slice(-n) });
171
171
  }
172
172
  if (req.method === "GET" && (P === "/" || P === "/ui")) {
173
- res.writeHead(200, { "content-type": "text/html; charset=utf-8" }); return res.end(UI || "<h1>trantor</h1><p>dashboard unavailable</p>");
173
+ res.writeHead(200, { "content-type": "text/html; charset=utf-8" }); return res.end("<h1>Trantor</h1><p>The dashboard is the Trantor desktop app.</p>");
174
174
  }
175
175
  // #8723: the count is a listing in aggregate — memory rows (past PEER_TTL_MS) never count.
176
176
  if (P === "/health") return json(res, 200, { ok: true, authMode: AUTH_MODE, peers: Object.values(state.peers).filter(v => (v.lastSeen || 0) >= now() - PEER_TTL_MS).length, messages: state.messages.length, streams: streams.length,
package/hub.mjs CHANGED
@@ -126,11 +126,9 @@ function recordOpOutcome(res, op) {
126
126
  };
127
127
  }
128
128
 
129
- let UI = "";
130
- try { UI = readFileSync(new URL("./ui.html", import.meta.url), "utf8"); } catch {}
131
129
  const context = {
132
130
  ...store, ...authRuntime, ...events, ...reaper, duty, overseer, derivePhases,
133
- hubSend: duty.hubSend, assertNoSecrets, UI, AUTH_MODE, ONLINE_MS, PEER_TTL_MS,
131
+ hubSend: duty.hubSend, assertNoSecrets, AUTH_MODE, ONLINE_MS, PEER_TTL_MS,
134
132
  REAP_GRACE_MS, CONTRACT_WINDOW_MS, PUBLIC_URL,
135
133
  };
136
134
  const sessionChat = createSessionRuntime({
@@ -37,7 +37,7 @@ explicit EVENT/INTERFACE CONTRACT — cross-agent bugs come from contract drift.
37
37
  2. One card per package: `relay_task_add(title, assignee, difficulty, model)` — set `model`
38
38
  to the advisor-routed model (or the CLI's default name); difficulty + model show as badges
39
39
  on the card. Assignees: `codex:<project>` etc. Keep one for yourself.
40
- 3. Open the dashboard: `trantor ui` (or `open -na "Google Chrome" --args --new-window <hub-url>`)
40
+ 3. Open the dashboard: `trantor ui` (opens the Trantor desktop app)
41
41
 
42
42
  ## Phase 2 — fire up the crew (with the Advisor's models)
43
43
  **Each crew card from `relay_advise` carries a `launch` spec — run it VERBATIM; never invent a
package/kimi.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.138",
3
+ "version": "0.18.140",
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). This manifest makes Kimi Code CLI a first-class ORCHESTRATOR, mirroring .claude-plugin/plugin.json. Hooks are the CANONICAL hooks/** executed through the kimi dialect bridge (kimi/bridge.mjs) — docs/KIMI-BRIDGE-CONTRACT.md.",
5
5
  "interface": {
6
6
  "displayName": "Trantor",
package/mcp.mjs CHANGED
@@ -257,14 +257,6 @@ server.tool("relay_task_check", "Tick (or untick) one checklist item on a card.
257
257
  return { content: [{ type: "text", text: `card #${id} checklist: [${done !== false ? "x" : " "}] "${task.checklist[index].text}" — ${n}/${task.checklist.length} done` }] };
258
258
  });
259
259
 
260
- server.tool("relay_phase_goal", "Set a phase's goal, shown as its header in the Flow view. Set it when you plan a phase. Phase keys match relay_task_add's `phase`.",
261
- { phase: z.string().describe("the phase key (e.g. 'P5', 'Auth', 'Launch')"), goal: z.string().describe("1-2 sentences: what this phase delivers + done-criteria"), project: z.string().optional().describe("board (default: this session's project)") },
262
- async ({ phase, goal, project }) => {
263
- const proj = project || PROJECT;
264
- await api("POST", "/phase", { project: proj, phase, goal, by: SESSION });
265
- return { content: [{ type: "text", text: `phase "${phase}" goal set for ${proj}` }] };
266
- });
267
-
268
260
  server.tool("relay_task_move", "Move a card: todo -> doing -> testing -> done. Never go straight to done: move to 'testing' when finished, run the tests/typecheck, then 'done' only if green, else 'failed' (relay_send what broke). blocked = waiting on something external. A move to testing or done MUST carry a `note`: what changed plus the evidence (command, pass counts).",
269
261
  { id: z.number(), status: z.enum(["todo","doing","testing","failed","done","blocked"]), note: z.string().max(2000).optional().describe("card-log entry; REQUIRED on testing/done"), drill: z.string().max(300).optional().describe("set the drill line in this call; done is refused without one") },
270
262
  async ({ id, status, note, drill }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.138",
3
+ "version": "0.18.140",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "trantor": "bin/cli.mjs"
@@ -19,10 +19,8 @@
19
19
  "hub.mjs",
20
20
  "hub/",
21
21
  "mcp.mjs",
22
- "ui.html",
23
22
  "bin/",
24
23
  "hooks/",
25
- "mods/",
26
24
  "lib/",
27
25
  "skills/",
28
26
  "deploy/",