trantor 0.18.140 → 0.18.141

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.140"
9
+ "version": "0.18.141"
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.140",
16
+ "version": "0.18.141",
17
17
  "author": {
18
18
  "name": "Sasha Bogojevic"
19
19
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.140",
3
+ "version": "0.18.141",
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
@@ -445,7 +445,7 @@ trantor setup | doctor | connect | profile | provider | models
445
445
  (`TRANTOR_DEV_ROOT`, else the Projects folder chosen in the app's Settings, stored as
446
446
  `projectsRoot` in `~/.agent-bus/config.json`, else `~/development`), git on main (or `--from <git-url>`, or `--adopt` an
447
447
  existing folder), installs the auto-card hook, posts the brief to the hub, and opens the first
448
- card "genesis: <name>". `--json` for machines. It never spawns a session — firing the crew
448
+ card "genesis: <name>". It asks once whether the project's agents ask before acting (the default) or act without asking (bypass); without a terminal it refuses unless `--permissions ask|bypass` is given. Change it later with `trantor project permissions <name> ask|bypass`. `--json` for machines. It never spawns a session — firing the crew
449
449
  stays your call. Two paths in: **blank** (no brief) wakes the orchestrator plainly and you work
450
450
  with it iteratively; **from a brief** (`--brief <file>`, or a PRD dropped on the app's Genesis
451
451
  sheet) stores it in `docs/PRD.md` with a small CLAUDE.md pointer, and the wake runs
package/bin/cli.mjs CHANGED
@@ -83,6 +83,24 @@ switch (cmd) {
83
83
  run("hub.mjs"); break;
84
84
  }
85
85
  case "project": {
86
+ // #14563: the per-project permission mode — the same harness dial `trantor new` asks about
87
+ // and `trantor open` launches with. Words are the user's (ask|bypass), storage is the
88
+ // autonomy dial (prompt|bypass).
89
+ if (args[0] === "permissions") {
90
+ const { resolveAutonomy, setAutonomy } = await import(join(ROOT, "lib/autonomy.mjs"));
91
+ const project = args[1];
92
+ const value = args[2];
93
+ const describe = (harness) => (harness === "bypass" ? "act without asking" : "ask before acting");
94
+ if (!project) { console.error("usage: trantor project permissions <name> [ask|bypass]"); process.exit(1); }
95
+ if (value === undefined) {
96
+ console.log(`${project}: agents ${describe(resolveAutonomy(project).harness)}`);
97
+ break;
98
+ }
99
+ if (value !== "ask" && value !== "bypass") { console.error(`value must be ask or bypass (got "${value}")`); process.exit(1); }
100
+ setAutonomy(project, { harness: value === "bypass" ? "bypass" : "prompt" });
101
+ console.log(`${project}: agents ${describe(value)}`);
102
+ break;
103
+ }
86
104
  // The checkout's identity (#6724): show where this project's name comes from, or record an id
87
105
  // in .trantor/project.json so a directory rename cannot orphan the pin, board and sessions.
88
106
  const { resolveProjectInfo, resolveHubInfo, gitRoot, readProjectId, writeProjectId, isProjectId, PROJECT_MARKER } = await import(join(ROOT, "lib/project.mjs"));
@@ -297,6 +315,7 @@ switch (cmd) {
297
315
  trantor handoff finish this session NOW: write a handoff, open a fresh session that takes over, and close this one (manual baton)
298
316
  trantor advise ask the Advisor directly (JSON on stdin; --demo to see it)
299
317
  trantor project this checkout's identity: project [<id>] — records .trantor/project.json so a directory rename cannot orphan the board, pin and sessions
318
+ project permissions <name> [ask|bypass] — whether <name>'s agents ask before acting or act without asking; no value prints it
300
319
  trantor hub run the hub in the foreground (setup installs it as a service instead)
301
320
  …or manage per-project hub pins: hub list · hub set <project> <url> · hub unset <project>
302
321
  seats: which project lives in which directory — seats · seats add · seats up · seats login install
package/bin/crew/open.mjs CHANGED
@@ -102,9 +102,11 @@ export function takeoverSessionId(ctx, id) {
102
102
  return hasPendingHandoff(ctx, id) ? randomUUID() : id;
103
103
  }
104
104
 
105
+ // #14563: bare `claude` inherits permissions.defaultMode from ~/.claude/settings.json, so a
106
+ // prompt project still ran bypass there — the dial must say its side out loud, both sides.
105
107
  function harnessFlag(ctx) {
106
108
  const result = call(process.execPath, [join(ctx.root, "bin/autonomy.mjs"), "get", "harness", "--project", ctx.project], { env: ctx.env });
107
- return result.stdout === "bypass" ? " --dangerously-skip-permissions" : "";
109
+ return result.stdout === "bypass" ? " --dangerously-skip-permissions" : " --permission-mode default";
108
110
  }
109
111
 
110
112
  function transcript(ctx, id) {
@@ -120,7 +122,8 @@ function orchestratorCommand(ctx, id) {
120
122
 
121
123
  function reportOrchestrator(ctx, pane, id) {
122
124
  const resumeArgv = ["env", ...STRIP.flatMap(name => ["-u", name]), `TRANTOR_ORCH=${ctx.project}`, "claude"];
123
- if (harnessFlag(ctx).trim()) resumeArgv.push("--dangerously-skip-permissions");
125
+ // #14563: the reported resume argv must be the SAME command the pane runs, dial included.
126
+ resumeArgv.push(...harnessFlag(ctx).trim().split(" "));
124
127
  resumeArgv.push("--resume", id);
125
128
  reportAgent(ctx, pane, "claude", { sessionId: id, resumeArgv });
126
129
  }
@@ -215,9 +218,8 @@ function hostPane(ctx, chosen, id) {
215
218
  }
216
219
 
217
220
  // #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
- // if graft isn't installed or the index already exists (the graph self-refreshes per query after the
220
- // first build). Keeps the 20MB index out of the project's git.
221
+ // opens now, the ~7s build lands in the background; a no-op if graft isn't installed or the index
222
+ // already exists. Keeps the 20MB index out of the project's git.
221
223
  // Hide graft/ through .git/info/exclude, never the user's tracked .gitignore (#14322). Returns the file written, "" when not a git checkout.
222
224
  export function excludeGraftLocally(dir) {
223
225
  try {
package/bin/new.mjs CHANGED
@@ -1,24 +1,14 @@
1
1
  #!/usr/bin/env node
2
- // trantor new — project genesis, the CLI half (#5862). One command stands a project up:
3
- //
4
- // trantor new <name> [--from <git-url>] [--brief <file>] [--dir <parent>] [--adopt] [--json]
5
- //
6
- // It makes the project directory at <parent>/<name> — --dir names the PARENT, never the project
7
- // directory itself (default parent: TRANTOR_DEV_ROOT or ~/development). The name is always
8
- // appended under it, so `--dir P` with name N creates P/N. Starts git on main (or clones --from,
9
- // or adopts an existing folder with --adopt), stores the brief in docs/PRD.md and seeds a small
10
- // CLAUDE.md pointer plus the trantor conventions block, installs the same auto-card hook as
11
- // `trantor init-hooks`, posts the brief as the hub project brief (POST /project — the same call
12
- // relay_project_brief makes), and opens the first card "genesis: <name>" on the new board.
13
- //
14
- // It NEVER spawns a session: the wake is genesis-2, the app half. A hub that is down downgrades
15
- // the genesis to a warning (card: null) — the directory is real either way, and a dead hub must
16
- // not make a made project look unmade.
2
+ // trantor new — project genesis, the CLI half (#5862): one command stands a project up:
3
+ // trantor new <name> [--from <git-url>] [--brief <file>] [--dir <parent>] [--adopt] [--permissions ask|bypass] [--json]
4
+ // It makes <parent>/<name>, starts git, seeds docs/PRD.md + CLAUDE.md + the auto-card hook, posts
5
+ // the brief + first card to the hub, and asks once whether the agents ask before acting (#14563).
17
6
  import { spawnSync } from "node:child_process";
18
7
  import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync, appendFileSync } from "node:fs";
19
8
  import { homedir } from "node:os";
20
9
  import { basename, dirname, isAbsolute, join, resolve } from "node:path";
21
10
  import { fileURLToPath } from "node:url";
11
+ import { createInterface } from "node:readline";
22
12
  import { ensureEnrolled as enrollTofu, loadIdentity, signedPost } from "../hooks/lib/api.mjs";
23
13
  import { ensureEnrolled as enrollViaOwnerInvite } from "../lib/enroll.mjs";
24
14
  import { setAutonomy } from "../lib/autonomy.mjs";
@@ -55,7 +45,7 @@ const flag = (n) => { const i = args.indexOf("--" + n); return i >= 0 ? args[i +
55
45
  const has = (n) => args.includes("--" + n);
56
46
  const json = has("json");
57
47
  const name = args.find(a => !a.startsWith("--"));
58
- if (!name) die("usage: trantor new <name> [--from <git-url>] [--brief <file>] [--dir <parent>] [--adopt] [--json] — project lands at <parent>/<name>");
48
+ if (!name) die("usage: trantor new <name> [--from <git-url>] [--brief <file>] [--dir <parent>] [--adopt] [--permissions ask|bypass] [--json] — project lands at <parent>/<name>");
59
49
  if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(name)) die(`invalid project name "${name}" — letters, digits, dot, dash, underscore`);
60
50
  const from = flag("from");
61
51
  const briefFile = flag("brief");
@@ -79,6 +69,35 @@ const existed = existsSync(dir);
79
69
  const occupied = existed && readdirSync(dir).length > 0;
80
70
  if (occupied && !adopt) die(`"${dir}" already exists and is not empty — pass --adopt to adopt it`);
81
71
  if (adopt && !existed) die(`--adopt: "${dir}" does not exist — nothing to adopt`);
72
+
73
+ // ── the permission mode (#14563): one plain question, answered before anything is created ────────
74
+ // User words are ask|bypass; the stored dial is the harness prompt|bypass. A non-TTY run must say
75
+ // the flag rather than guess — a refused genesis leaves no directory behind.
76
+ const permissionsArg = flag("permissions");
77
+ if (permissionsArg != null && permissionsArg !== "ask" && permissionsArg !== "bypass") {
78
+ die(`--permissions takes ask or bypass (got "${permissionsArg}")`);
79
+ }
80
+ let permissions;
81
+ if (permissionsArg != null) {
82
+ permissions = permissionsArg;
83
+ } else if (process.stdin.isTTY) {
84
+ const say = json ? console.error : console.log;
85
+ const rl = createInterface({ input: process.stdin, output: json ? process.stderr : process.stdout });
86
+ const choose = () => new Promise(res => rl.question("Choose [1]: ", res));
87
+ say(`How should ${name}'s agents work?`);
88
+ say(" 1) Ask before acting (recommended): they ask before commands, edits and installs");
89
+ say(" 2) Act without asking (bypass): they act on their own, as you");
90
+ let answer = (await choose()).trim();
91
+ while (answer !== "" && answer !== "1" && answer !== "2") {
92
+ say("1 = ask before acting · 2 = act without asking (bypass)");
93
+ answer = (await choose()).trim();
94
+ }
95
+ rl.close();
96
+ permissions = answer === "2" ? "bypass" : "ask";
97
+ } else {
98
+ die("no terminal to ask in; pass --permissions ask or --permissions bypass");
99
+ }
100
+
82
101
  if (!existed) mkdirSync(dir, { recursive: true });
83
102
 
84
103
  // ── git ─────────────────────────────────────────────────────────────────────────────────────────
@@ -119,9 +138,9 @@ if (existsSync(claude)) {
119
138
  const hook = spawnSync(process.execPath, [join(ROOT, "bin", "init-hooks.mjs")], { cwd: dir, encoding: "utf8" });
120
139
  if (hook.status !== 0) die(`hook install failed: ${(hook.stderr || "").trim()}`);
121
140
 
122
- // A new project is a new trust boundary. Pin its harness dial even when the machine-wide default
123
- // is bypass, so opening it can never inherit another project's permission choice.
124
- setAutonomy(name, { harness: "prompt" });
141
+ // A new project is a new trust boundary: its harness dial is the operator's explicit #14563
142
+ // answer, so opening it can never inherit another project's — or the machine default's — mode.
143
+ setAutonomy(name, { harness: permissions === "bypass" ? "bypass" : "prompt" });
125
144
 
126
145
  // ── the hub: pin + brief + first card, signed like every other client ──────────────────────────
127
146
  const hub = resolveHub(name);
@@ -134,12 +153,10 @@ const identity = loadIdentity(session);
134
153
  let card = null;
135
154
  let hubError = null;
136
155
  try {
137
- // The genesis identity is BRAND NEW — it cannot write to a project on an enforce hub until the
138
- // hub knows it. TOFU /enroll only works on a local loopback hub; a remote enforce hub refuses it
139
- // (403 "tofu enrollment refused") and the genesis silently records nothing (#6049). So enroll the
140
- // way crew seats do: the operator's owner key mints a project-scoped write invite and the genesis
141
- // identity spends it. Only when NO owner key is configured (a loopback hub with no owner identity)
142
- // do we fall back to the plain TOFU enroll.
156
+ // The genesis identity is BRAND NEW — TOFU /enroll only works on a loopback hub; a remote
157
+ // enforce hub refuses it (403) and the genesis silently records nothing (#6049). Enroll like
158
+ // crew seats: the owner key mints a project-scoped write invite, the genesis spends it; plain
159
+ // TOFU only when no owner key is configured (a loopback hub with no owner identity).
143
160
  const viaOwner = await enrollViaOwnerInvite(hub, identity, name, { timeoutMs: 8000, kind: "tool" });
144
161
  if (!viaOwner.ok && viaOwner.reason === "no-owner-key") await enrollTofu(session, identity, name, { kind: "tool" });
145
162
  else if (!viaOwner.ok) console.error(`genesis: enrollment via owner invite failed: ${viaOwner.reason}`);
@@ -169,8 +186,11 @@ try {
169
186
  // dir is the created project directory <parent>/<name>; parent is the --dir (or default) root the
170
187
  // name was appended under — the two together state the parent contract explicitly.
171
188
  if (json) {
172
- console.log(JSON.stringify({ name, parent: devRoot, dir, branch, hub, card }));
189
+ console.log(JSON.stringify({ name, parent: devRoot, dir, branch, hub, card, permissions }));
173
190
  } else {
191
+ // #14563: the artboard's confirmation — states the choice and the way to change it.
192
+ console.log(`✓ ${name} created · agents ${permissions === "bypass" ? "act without asking" : "ask before acting"} · change it with:`);
193
+ console.log(` trantor project permissions ${name} ask|bypass`);
174
194
  console.log(`✓ ${dir} (${branch}${from ? ", cloned" : adopt ? ", adopted" : ""})`);
175
195
  console.log(brief
176
196
  ? "✓ docs/PRD.md seeded from the brief; CLAUDE.md kept small"
package/kimi.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.140",
3
+ "version": "0.18.141",
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.140",
3
+ "version": "0.18.141",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "trantor": "bin/cli.mjs"
@@ -32,7 +32,7 @@ PRD.md + TDD.md. The TDD MUST define one file-set per agent (no merge conflicts)
32
32
  explicit EVENT/INTERFACE CONTRACT — cross-agent bugs come from contract drift.
33
33
 
34
34
  ## Phase 1 — board setup
35
- 0. No project yet? `trantor new <name> --brief <file>` stands one up (dir, git main, CLAUDE.md
35
+ 0. No project yet? `trantor new <name> --brief <file> --permissions ask` stands one up (`--permissions` is required without a terminal: `ask` unless the operator said bypass) (dir, git main, CLAUDE.md
36
36
  from the brief, hooks, hub brief + first card) — it never spawns a session; firing the crew
37
37
  is this phase's job.
38
38
  1. `relay_project_brief("<what + why + goal>")`