diff --git a/CHANGELOG.md b/CHANGELOG.md index e5575df..282044e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- Add TRAE CLI (`traecli`) as an opt-in built-in agent named `trae`, usable as a reviewer (`--jury trae`) or the main agent (`--judge trae`). Reviews run in its read-only sandbox (#96). + ## 0.7.0 — 2026-09-18 ### Changed diff --git a/README.md b/README.md index 5d7012e..28b0b9d 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ It uses illustrative data and does not start agents. | | Cursor Agent CLI | `cursor` | Opt-in | | | Sourcegraph Amp | `amp` | Opt-in | | | Moonshot Kimi Code CLI | `kimi` | Opt-in | +| | TRAE CLI | `trae` | Opt-in | **Opt-in** agents are fully supported as reviewers and judges, but stay out of the default pool so a fresh install does not require every CLI to be present. Select one by name — no configuration @@ -179,6 +180,7 @@ or select installed reviewers explicitly. | `cursor` | Cursor Agent CLI | `curl https://cursor.com/install -fsS \| bash` | opt-in | | `amp` | Sourcegraph Amp | `npm i -g @sourcegraph/amp` | opt-in | | `kimi` | Moonshot Kimi Code CLI | `npm i -g @moonshot-ai/kimi-code` | opt-in | +| `trae` | TRAE CLI (`traecli`) | `sh -c "$(curl -fsSL https://trae.cn/trae-cli/install_v2.sh)"` | opt-in | **Opt-in** agents are fully supported — usable with `--reviewer`, `--jury`, `--judge` and `jury agents judge` — but stay out of the default pool, so a fresh install does not require every diff --git a/docs/configuration.md b/docs/configuration.md index 25b6b0b..04ba9d0 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -95,6 +95,7 @@ review could not start until every supported CLI was installed. | Cursor Agent (opt-in) | `cursor-agent` | ⚠️ Print mode; all tools including write and bash | `--force` | | Amp (opt-in) | `amp` | ⚠️ Execute mode; no read-only flag | Same command unless overridden | | Kimi Code (opt-in) | `kimi` | Prompt mode with the shipped `lib/agents/kimi-reviewer.md` profile: Edit and Write tools removed, only the read-only `explore` sub-agent; shell available | Prompt mode with all tools | +| TRAE CLI (opt-in, `trae`) | `traecli` | `exec` in read-only sandbox | `exec` in workspace-write sandbox | | Custom | Your `argv[0]` | Your `argv` | Your `judgeArgv`, or `argv` | ⚠️ marks agents whose CLI offers **no read-only invocation**. They still review, but only the @@ -137,7 +138,7 @@ an unrelated conversation. | Antigravity | `conversation_id` in `--output-format json` | yes | | OpenCode | `sessionID` in the JSON event stream | yes | | Kimi Code | printed at the end of the `stream-json` output | yes | -| Amp, Cursor, Copilot | — | no; replies start fresh with the finding context | +| Amp, Cursor, Copilot, TRAE CLI | — | no; replies start fresh with the finding context | Agents that do not resume lose nothing in substance: `buildReply` quotes their own prior findings back to them. The judge never resumes at all — each finding @@ -148,6 +149,7 @@ is triaged in its own session so one verdict cannot anchor the next. ```json { "agents": [{ "name": "kimi", "argv": ["kimi", "--quiet", "--work-dir", "{{worktree}}", "--prompt", "{{promptText}}"], "report": "whole", "resume": { "supported": false, "reason": "quiet mode prints no session id" } }] } ``` +- TRAE CLI: verified `traecli` 0.206.1 (TraeCode CLI 2.0) flags; install with `sh -c "$(curl -fsSL https://trae.cn/trae-cli/install_v2.sh)"` (the script is served only inside mainland China; outside it, download your platform's binary from the official release manifest `https://lf-cdn.trae.com.cn/obj/trae-com-cn/trae-cli/v2/latest.json`, check its `sha256`, gunzip it and link it as `~/.local/bin/traecli`), then run `traecli` once to log in, or use `traecli login --with-trae-pat` for headless machines. TraeCode CLI requires a TRAE Enterprise flagship plan. Reviews run `traecli exec --sandbox read-only`, and the judge uses `--sandbox workspace-write`. The prompt follows `--`, so a prompt starting with `-` is never read as a flag. Replies start fresh with finding context. - Cursor: verified `cursor-agent` 2025.10.28-0a91dc2; run `cursor-agent login`. The generic executable `agent` may belong to another product, so Jury uses `cursor-agent`. Final JSON must explicitly report success. Replies start fresh. - Copilot: verified CLI 0.0.392 flags; authenticate with interactive `/login`. A reviewer can inspect files and Git but cannot use write tools; the judge allows tools. Local permission configuration remains trusted. Replies start fresh. - Qwen: targets CLI 0.23.4 (`npm install -g @qwen-code/qwen-code`); run `qwen` and complete `/auth` before headless use. It runs in the process worktree, not merely an added access directory. Reviews use assigned UUIDs, and replies resume only that UUID; no implicit latest session. Final JSON must explicitly report success. diff --git a/lib/agents/registry.js b/lib/agents/registry.js index 60d67b4..57651d8 100644 --- a/lib/agents/registry.js +++ b/lib/agents/registry.js @@ -19,6 +19,7 @@ import copilot from "./copilot.json" with { type: "json" }; import cursor from "./cursor.json" with { type: "json" }; import amp from "./amp.json" with { type: "json" }; import kimi from "./kimi.json" with { type: "json" }; +import trae from "./trae.json" with { type: "json" }; /** * Every built-in agent, in the order `jury agents` lists them. Judge first, @@ -37,4 +38,5 @@ export const BUILTIN_AGENTS = [ cursor, amp, kimi, + trae, ]; diff --git a/lib/agents/trae.json b/lib/agents/trae.json new file mode 100644 index 0000000..4acd131 --- /dev/null +++ b/lib/agents/trae.json @@ -0,0 +1,36 @@ +{ + "name": "trae", + "product": "TRAE CLI", + "role": "reviewer", + "enabled": false, + "promptDelivery": "argv", + "cwd": "worktree", + "argv": [ + "traecli", + "exec", + "--sandbox", + "read-only", + "--skip-git-repo-check", + "--", + "{{promptText}}" + ], + "judgeArgv": [ + "traecli", + "exec", + "--sandbox", + "workspace-write", + "--skip-git-repo-check", + "--", + "{{promptText}}" + ], + "sandbox": "sandbox", + "sandboxNote": "reviews run under --sandbox read-only; judging uses workspace-write", + "resume": { + "supported": false, + "reason": "exec session ids are not documented in its output; replies start fresh with finding context" + }, + "report": "whole", + "expectSeconds": 900, + "install": "sh -c \"$(curl -fsSL https://trae.cn/trae-cli/install_v2.sh)\"", + "docs": "https://docs.trae.cn/cli_get-started-with-trae-code-cli-2" +} diff --git a/test/builtin-agents.test.js b/test/builtin-agents.test.js index 2301699..fdef4b2 100644 --- a/test/builtin-agents.test.js +++ b/test/builtin-agents.test.js @@ -85,7 +85,7 @@ test("each agent states a sandbox level, and an unsandboxed one explains itself" }); // All newly added CLIs require explicit selection, not installation by every user. -const NEW = ["opencode", "qwen", "copilot", "cursor", "amp", "kimi"]; +const NEW = ["opencode", "qwen", "copilot", "cursor", "amp", "kimi", "trae"]; test("the new agents are selectable as reviewer and as judge", async () => { // They ship opt-in, so they are absent from the default pool — but naming one diff --git a/test/new-agents.test.js b/test/new-agents.test.js index 8b59cbc..12cabe9 100644 --- a/test/new-agents.test.js +++ b/test/new-agents.test.js @@ -116,6 +116,26 @@ const cases = [ "@prompt" ], "output": "{\"type\":\"result\",\"subtype\":\"success\",\"is_error\":false,\"result\":\"NO NEW FINDINGS\"}" + }, + { + "name": "trae", + "bin": "traecli", + "review": [ + "exec", + "--sandbox", + "read-only", + "--skip-git-repo-check", + "--", + "@prompt" + ], + "judge": [ + "exec", + "--sandbox", + "workspace-write", + "--skip-git-repo-check", + "--", + "@prompt" + ] } ];