toolroll 0.9.109 → 0.9.111

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.
Files changed (155) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +5 -1
  3. package/THIRD_PARTY_NOTICES.md +30 -0
  4. package/dist/agent-detect.js +244 -0
  5. package/dist/agent-fence.js +12 -1
  6. package/dist/agent-said-schema.js +4 -0
  7. package/dist/agent-said.js +23 -0
  8. package/dist/agentconfig.js +2 -2
  9. package/dist/approval-summary.js +375 -0
  10. package/dist/attest.js +2 -2
  11. package/dist/browser/THIRD_PARTY_NOTICES.txt +30 -0
  12. package/dist/browser/workspace.css +2 -2
  13. package/dist/browser/workspace.js +27 -27
  14. package/dist/builder.js +42 -3
  15. package/dist/chat-actions.js +24 -17
  16. package/dist/chat-core.js +3 -1
  17. package/dist/chat-decide.js +101 -46
  18. package/dist/chat-delivery-state.js +2 -0
  19. package/dist/chat-delivery.js +3 -2
  20. package/dist/chat-live.js +2 -1
  21. package/dist/chat-task-actions.js +6 -0
  22. package/dist/check-report.js +1 -1
  23. package/dist/claim.js +28 -13
  24. package/dist/cli-help.js +1 -1
  25. package/dist/cli.js +2 -0
  26. package/dist/codex-limits.js +21 -8
  27. package/dist/console-instance.js +11 -1
  28. package/dist/contracts/console-api.js +13 -7
  29. package/dist/contracts/engine-api.js +283 -0
  30. package/dist/contracts/route.js +1 -0
  31. package/dist/coordinator.js +2 -2
  32. package/dist/discord-api.js +4 -3
  33. package/dist/discord-chat.js +3 -1
  34. package/dist/dispatch.js +1 -1
  35. package/dist/dispose.js +15 -9
  36. package/dist/easy-start-args.js +7 -3
  37. package/dist/easy-start.js +40 -1
  38. package/dist/egress.js +72 -10
  39. package/dist/engine-handoff.js +34 -0
  40. package/dist/engine-reads.js +338 -0
  41. package/dist/eval-world.js +3 -2
  42. package/dist/evidence.js +2 -0
  43. package/dist/fast-start.js +68 -18
  44. package/dist/fast-terms.js +2 -2
  45. package/dist/first-run.js +10 -2
  46. package/dist/flexible-agents.js +234 -0
  47. package/dist/flexible-answers-schema.js +61 -0
  48. package/dist/flexible-answers.js +889 -0
  49. package/dist/flexible-custody.js +494 -0
  50. package/dist/flexible-import.js +782 -0
  51. package/dist/flexible-launch-schema.js +72 -0
  52. package/dist/flexible-launch.js +331 -0
  53. package/dist/flexible-launcher.js +88 -0
  54. package/dist/flexible-levels.js +34 -0
  55. package/dist/flexible-merge-guard.js +47 -0
  56. package/dist/flexible-refs.js +47 -0
  57. package/dist/flexible-relay-cancel.js +19 -0
  58. package/dist/flexible-relay-schema.js +55 -0
  59. package/dist/flexible-relay-upstreams.js +36 -0
  60. package/dist/flexible-relay.js +1032 -0
  61. package/dist/flexible-session.js +732 -0
  62. package/dist/flexible-ship-schema.js +81 -0
  63. package/dist/flexible-ship.js +694 -0
  64. package/dist/flexible-start.js +80 -0
  65. package/dist/flexible-thread.js +175 -25
  66. package/dist/flexible-turns-schema.js +69 -0
  67. package/dist/flexible-turns.js +490 -0
  68. package/dist/flexible.js +10 -1
  69. package/dist/flow-actions.js +6 -4
  70. package/dist/flow-steps.js +1 -1
  71. package/dist/flows-cli.js +2 -1
  72. package/dist/git-views.js +6 -3
  73. package/dist/install-mode.js +225 -0
  74. package/dist/integrations.js +6 -1
  75. package/dist/lead-doors.js +7 -1
  76. package/dist/limits-ui.js +7 -0
  77. package/dist/live-reply.js +6 -0
  78. package/dist/live-terminal.js +425 -29
  79. package/dist/local-owner.js +7 -0
  80. package/dist/model-choices.js +12 -6
  81. package/dist/needs-you.js +2 -0
  82. package/dist/notification-delivery.js +11 -0
  83. package/dist/operate.js +128 -37
  84. package/dist/outbound-privacy.js +204 -0
  85. package/dist/passwordless.js +2 -1
  86. package/dist/phase-routing.js +3 -1
  87. package/dist/plane-review.js +1 -1
  88. package/dist/project-delete.js +14 -0
  89. package/dist/proposal.js +2 -2
  90. package/dist/provider-connection.js +19 -5
  91. package/dist/publish.js +5 -0
  92. package/dist/pull-request-flow.js +26 -7
  93. package/dist/push.js +5 -1
  94. package/dist/release-card.js +11 -3
  95. package/dist/release.js +10 -1
  96. package/dist/route-store.js +3 -3
  97. package/dist/sandbox-launch.js +32 -8
  98. package/dist/sandbox-runtime.js +16 -7
  99. package/dist/sandbox-tools.js +176 -0
  100. package/dist/scope.js +12 -36
  101. package/dist/scout-net.js +7 -2
  102. package/dist/serve.js +62 -13
  103. package/dist/server/chrome.js +3 -1
  104. package/dist/server/console.css +33 -6
  105. package/dist/server/engine-api.js +378 -0
  106. package/dist/server/flows.js +2 -2
  107. package/dist/server/http.js +7 -0
  108. package/dist/server/link-redemption.js +52 -0
  109. package/dist/server/mutation-key.js +21 -7
  110. package/dist/server/pages.js +72 -40
  111. package/dist/server/people-tokens.js +17 -41
  112. package/dist/server/render-chat.js +1 -0
  113. package/dist/server/render-new-task.js +3 -3
  114. package/dist/server/render-results.js +4 -4
  115. package/dist/server/render-tasks.js +133 -139
  116. package/dist/server/route-table.js +32 -1
  117. package/dist/server/settings-section-table.js +6 -0
  118. package/dist/server/settings-sections.js +69 -0
  119. package/dist/server/settings.js +120 -10
  120. package/dist/server/task-views.js +8 -2
  121. package/dist/server/tasks.js +56 -12
  122. package/dist/server/terminals.js +181 -28
  123. package/dist/server/welcome.js +35 -10
  124. package/dist/settings-groups-ui.js +2 -2
  125. package/dist/settings-proofs.js +14 -9
  126. package/dist/slack-api.js +4 -3
  127. package/dist/slack-chat.js +5 -3
  128. package/dist/spend.js +46 -12
  129. package/dist/status-probe.js +343 -0
  130. package/dist/store.js +181 -12
  131. package/dist/task-sizing-schema.js +14 -0
  132. package/dist/task-sizing.js +76 -10
  133. package/dist/teams-api.js +4 -3
  134. package/dist/teams-chat.js +4 -2
  135. package/dist/telegram-lead.js +2 -1
  136. package/dist/telegram-live.js +2 -1
  137. package/dist/telegram-team.js +2 -1
  138. package/dist/telegram.js +17 -5
  139. package/dist/toolroll-update.js +3 -1
  140. package/dist/trusted-path.js +162 -0
  141. package/dist/tui/darwin-arm64/toolroll-tui +0 -0
  142. package/dist/tui/darwin-x64/toolroll-tui +0 -0
  143. package/dist/tui/linux-arm64/toolroll-tui +0 -0
  144. package/dist/tui/linux-x64/toolroll-tui +0 -0
  145. package/dist/tui-launch.js +282 -0
  146. package/dist/tui-source.js +5 -3
  147. package/dist/tui.js +1 -1
  148. package/dist/webhooks.js +14 -4
  149. package/dist/welcome-facts.js +22 -15
  150. package/dist/work-index.js +2 -2
  151. package/dist/workspace-ui.js +5 -0
  152. package/package.json +1 -1
  153. package/scripts/crash-canary.mjs +1 -1
  154. package/scripts/pilot.mjs +1 -1
  155. package/scripts/provider-canary.mjs +5 -3
package/CHANGELOG.md CHANGED
@@ -4,6 +4,79 @@ Each release opens with one line on its theme, then **New**, **Changed**, **Fixe
4
4
  the ones it has). Each item is at most two lines and says where to find it. Notes for maintainers (CI, the release
5
5
  tooling) go on the GitHub release, not here. Entries before 0.9.104 use the older format.
6
6
 
7
+ ## 0.9.111 — 2026-11-16
8
+
9
+ The terminal workbench, smoothed by five rounds of first-run testing: failures say why in the agent's own words,
10
+ and you can stop, resume, cancel and retry from the keyboard. Plus a layout pass: resize, collapse, zoom, jump to
11
+ what needs you.
12
+
13
+ ### New
14
+
15
+ - **Stop, resume and cancel from the workbench.** `x` stops a task that keeps retrying and resumes it; `X` cancels.
16
+ Each asks first and refuses if the task changed since you looked.
17
+ - **What the agent said.** When an agent fails, Live and Steps show its last lines, cleaned (no paths or keys);
18
+ they never leave Toolroll in chat, push, email or webhooks.
19
+ - **Layout keys.** `<` `>` resize the list or a split, `=` evens them, `b` cycles the list full, slim rail or hidden,
20
+ `z` zooms a panel; the list can sit on the right. Your view is remembered per project.
21
+ - **Jump to what needs you** with `!` and `@` (`'` jumps back), and finished tasks keep an unread dot until opened.
22
+ - **Search and edit.** `/` searches the focused pane; `Ctrl-E` opens its text in your editor, with modelines off.
23
+ - **Settings change in the workbench** (theme, density, glyphs, notifications), saved to `tui.toml`.
24
+ - **Task sizing by a quick model call is opt-in** (Settings → General). Off, nothing calls a model before you
25
+ approve, and uncertain tasks plan first. On, the card says which model sized it.
26
+
27
+ ### Changed
28
+
29
+ - **An agent that errors stops after one failure** and shows what it said; Retry starts it again. Machine
30
+ glitches still retry on their own, with "Last build failed · reason · next try in 40s".
31
+ - **Attempts are counted per task** ("attempt 2") everywhere you read them.
32
+ - **The approval card is shorter:** your usual settings are one line, `f` shows them all.
33
+ - **A signed-out agent is never started** in the background; status says "Codex · signed out (run `codex login`)".
34
+ - **Typing in a Terminal pane stays instant** while a build streams output (was up to a second behind).
35
+
36
+ ### Fixed
37
+
38
+ - **A filed task no longer disappears** from the list while it waits to retry.
39
+ - **First run** opens on "What would you like to work on?" instead of sending you to the browser.
40
+ - **A config folder path too long for the socket** is refused at once with the fix, not after 90 seconds.
41
+ - **Confirmations never take keys before they're drawn** (a tiny window could accept unseen).
42
+ - **Upgrading from the old `standing-orders` package:** the installer removes it first; the docs lead with
43
+ `npm uninstall -g standing-orders`.
44
+
45
+ ## 0.9.110 — 2026-11-15
46
+
47
+ A real terminal screen: run `toolroll` in a terminal and watch, steer, review and accept your agents' work there, in a
48
+ calmer look. Solo installs ask for less, and first runs go straight to the agent you already have.
49
+
50
+ ### New
51
+
52
+ - **The terminal workbench.** Bare `toolroll` opens a native screen (Mac and Linux): your work list, the agent's
53
+ work live, Steer / Pause / Stop, and the diff with notes, Accept and Send back.
54
+ - **Take over a build.** On a task's Terminal tab press t for a real shell in a separate copy of its latest build;
55
+ Ctrl-] comes back and the shell keeps running.
56
+ - **Agents screen (A).** Every supported agent and what it needs: sign in through the agent's own login in a pane,
57
+ install with npm after a confirm, and pick the agent and model for planning, building and review.
58
+ - **Command palette and layouts.** `:` lists every action; key presets, split and grid layouts, resume where you left
59
+ off, and today's cost in the top bar.
60
+ - **Themes and `~/.config/toolroll/tui.toml`:** light, dark, high contrast or your terminal's own colours; density,
61
+ glyphs and notifications. Works down to 16 colours and NO_COLOR.
62
+ - **Instant start.** First run finds the coding agents you have and whether each is signed in, then sends your first
63
+ task to one you can use, or names the one sign-in command to run. It never makes a model call to check.
64
+ - **Solo and team.** A one-person install is solo: your signed-in session stands in for the password at ordinary
65
+ steps. Settings → General shows which you are; "It's just me" switches a single-person install to solo.
66
+
67
+ ### Changed
68
+
69
+ - **Approvals are shorter and exact.** One summary (goal, done when, agents, what it may touch and cost), risks under
70
+ "Before you approve", and Approve after what it approves. Revisions lead with what changed.
71
+ - **Saving a credential always asks for your password** (provider keys, the Telegram bot token, mail and Google
72
+ accounts), solo or team.
73
+ - **Messages that leave Toolroll never name a local folder or a key.** Chat apps, webhooks, push and email get a
74
+ plain "An update is ready" instead and the detail stays in Toolroll.
75
+
76
+ ### Fixed
77
+
78
+ - **A slow sign-in check no longer sends your first task to a plan** instead of the agent you have.
79
+
7
80
  ## 0.9.109 — 2026-11-14
8
81
 
9
82
  One Work screen, pages several times faster on a busy install, a clearer first run, and what the agent decided
package/README.md CHANGED
@@ -40,10 +40,14 @@ curl -fsSL https://raw.githubusercontent.com/ap9000/toolroll/main/install.sh | s
40
40
  or
41
41
 
42
42
  ```sh
43
- npm install -g toolroll # or: brew install ap9000/toolroll/toolroll
43
+ npm uninstall -g standing-orders 2>/dev/null; npm install -g toolroll # or: brew install ap9000/toolroll/toolroll
44
44
  toolroll
45
45
  ```
46
46
 
47
+ The first command removes Toolroll's older package, `standing-orders`, if you
48
+ have it: npm can't install over it (it stops with `EEXIST: file already
49
+ exists … bin/standing-orders`). Without it, the command does nothing.
50
+
47
51
  Toolroll opens in your terminal and runs while that window is open. No
48
52
  password and no login file: on your own computer you're already in. Started
49
53
  in a git repository, that repository is your project; press `n` for a first
@@ -585,3 +585,33 @@ distributed under the License is distributed on an "AS IS" BASIS,
585
585
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
586
586
  See the License for the specific language governing permissions and
587
587
  limitations under the License.
588
+
589
+ ## vt100 0.16.2 (Rust crate) — MIT
590
+
591
+ The terminal workbench's Terminal tab (the `toolroll-tui` binary) draws a take-over terminal through a vendored,
592
+ modified copy of vt100 0.16.2 by Jesse Luehrs (https://github.com/doy/vt100-rust), kept in `tui/vendor/vt100`. It
593
+ diverges from upstream in `grid.rs`, `row.rs` and `screen.rs` only: rows that scroll are reused and cleared only as
594
+ far as they were written, and one-row and one-column screens no longer overflow. `tui/vendor/vt100/README` lists the
595
+ exact changes.
596
+
597
+ The MIT License (MIT)
598
+
599
+ Copyright (c) 2016 Jesse Luehrs
600
+
601
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
602
+ this software and associated documentation files (the "Software"), to deal in
603
+ the Software without restriction, including without limitation the rights to
604
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
605
+ of the Software, and to permit persons to whom the Software is furnished to do
606
+ so, subject to the following conditions:
607
+
608
+ The above copyright notice and this permission notice shall be included in all
609
+ copies or substantial portions of the Software.
610
+
611
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
612
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
613
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
614
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
615
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
616
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
617
+ SOFTWARE.
@@ -0,0 +1,244 @@
1
+ import { readFileSync, statSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { delimiter, isAbsolute, join } from "node:path";
4
+ import { ACP_AGENTS, ACP_PROVIDER_IDS, isAcpProvider } from "./acp-agents.js";
5
+ import { inspectAcpAgent } from "./acp-inspect.js";
6
+ import { resolveExecutable } from "./attest.js";
7
+ import { statusProbe, STATUS_TIMEOUT_MS } from "./status-probe.js";
8
+ import { keyStatus, OWN_KEY_ENV, readAuthMode } from "./keys.js";
9
+ import { createConnectionChecker } from "./provider-connection.js";
10
+ export const DETECT_TIMEOUT_MS = STATUS_TIMEOUT_MS;
11
+ const xdg = (env, name, home, fallback) => {
12
+ const value = env[name];
13
+ return value !== undefined && isAbsolute(value) ? value : join(home, fallback);
14
+ };
15
+ const ACP_LOGIN = {
16
+ opencode: { kind: "file", path: (home, env) => join(xdg(env, "XDG_DATA_HOME", home, join(".local", "share")), "opencode", "auth.json"), how: "login file" },
17
+ qwen: { kind: "file", path: home => join(home, ".qwen", "oauth_creds.json"), how: "login file" },
18
+ goose: { kind: "file", path: (home, env) => join(xdg(env, "XDG_CONFIG_HOME", home, ".config"), "goose", "config.yaml"), how: "set up" },
19
+ cursor: { kind: "none" },
20
+ cline: { kind: "none" },
21
+ };
22
+ export const DETECTED_AGENTS = [
23
+ { id: "claude", name: "Claude Code", binary: "claude", signIn: "claude auth login", install: "npm install -g @anthropic-ai/claude-code", login: { kind: "checker" } },
24
+ { id: "codex", name: "Codex", binary: "codex", signIn: "codex login", install: "npm install -g @openai/codex", login: { kind: "checker" } },
25
+ { id: "gemini", name: "Gemini CLI", binary: "gemini", signIn: "gemini", install: null, login: { kind: "gemini" } },
26
+ { id: "openrouter", name: "OpenRouter", binary: "codex", signIn: "toolroll keys set openrouter --key-file <file>", install: null, login: { kind: "key" } },
27
+ ...ACP_PROVIDER_IDS.map((id) => ({ id, name: ACP_AGENTS[id].name, binary: ACP_AGENTS[id].binary, signIn: ACP_AGENTS[id].signIn, install: null, login: ACP_LOGIN[id] })),
28
+ ];
29
+ export const FIRST_TASK_ORDER = ["claude", "codex"];
30
+ const GEMINI_KEY_SIGN_IN = "toolroll keys set gemini --key-file <file>";
31
+ const CHOOSE_MODELS = "To give it tasks, choose its models in Settings → Models.";
32
+ const CHOOSE_AGENT = "To give it tasks, choose it in Settings → Models.";
33
+ function present(file) {
34
+ try {
35
+ const seen = statSync(file);
36
+ return seen.isFile() && seen.size > 0;
37
+ }
38
+ catch {
39
+ return false;
40
+ }
41
+ }
42
+ function keySet(provider, home, env) {
43
+ return keyStatus(provider, home).set || OWN_KEY_ENV[provider].some(name => (env[name] ?? "") !== "");
44
+ }
45
+ const SIGNED_IN = new Set(["connected", "key-present", "key-works"]);
46
+ const SIGNED_OUT = new Set(["signed-out", "missing-key", "key-refused"]);
47
+ const KEY_ANSWERS = new Set(["key-present", "key-works", "key-refused", "missing-key"]);
48
+ function within(work, ms, fallback) {
49
+ return new Promise(resolve => {
50
+ const timer = setTimeout(() => resolve(fallback), ms);
51
+ timer.unref?.();
52
+ work.then(value => { clearTimeout(timer); resolve(value); }, () => { clearTimeout(timer); resolve(fallback); });
53
+ });
54
+ }
55
+ export async function detectAgents(options = {}) {
56
+ const started = Date.now();
57
+ const env = options.env ?? process.env;
58
+ const home = options.home ?? env["HOME"] ?? homedir();
59
+ const timeoutMs = options.timeoutMs ?? DETECT_TIMEOUT_MS;
60
+ const clock = options.clock ?? (() => new Date());
61
+ const path = (env["PATH"] ?? "").split(delimiter).filter(one => one !== "" && isAbsolute(one)).join(delimiter);
62
+ const check = options.check ?? createConnectionChecker({
63
+ home, env: env, clock,
64
+ probe: statusProbe({ env, timeoutMs, ...(options.untrusted === undefined ? {} : { untrusted: options.untrusted }),
65
+ ...(options.store === undefined ? {} : { store: options.store }), ...(options.databaseFile === undefined ? {} : { databaseFile: options.databaseFile }) }),
66
+ });
67
+ const routed = options.routed ?? null;
68
+ const one = async (row) => {
69
+ const base = { id: row.id, name: row.name };
70
+ const out = (state, how = null) => ({ ...base, state, how, signIn: state === "signed-out" || state === "unknown" ? row.signIn : null, ready: false, next: null });
71
+ if (isAcpProvider(row.id)) {
72
+ if (!inspectAcpAgent(row.id, { PATH: path }).found)
73
+ return out("not-installed");
74
+ const login = row.login;
75
+ return login.kind === "file" ? present(login.path(home, env)) ? out("signed-in", login.how) : out("signed-out") : out("unknown");
76
+ }
77
+ const resolved = resolveExecutable(row.binary, path);
78
+ if (row.login.kind === "key")
79
+ return resolved !== null && keySet("openrouter", home, env) ? out("signed-in", "API key") : out("not-installed");
80
+ if (row.login.kind === "gemini") {
81
+ if (resolved === null)
82
+ return out("not-installed");
83
+ if (readAuthMode("gemini", home) === "api-key")
84
+ return keySet("gemini", home, env) ? out("signed-in", "API key") : { ...out("signed-out"), signIn: GEMINI_KEY_SIGN_IN };
85
+ return present(join(home, ".gemini", "oauth_creds.json")) ? out("signed-in", "Google account") : out("signed-out");
86
+ }
87
+ const answer = await within(check(row.id).then(value => value), timeoutMs, null);
88
+ if (answer === null)
89
+ return out(resolved === null ? "not-installed" : "unknown");
90
+ if (answer.state === "not-installed" || (KEY_ANSWERS.has(answer.state) && resolved === null))
91
+ return out("not-installed");
92
+ if (SIGNED_IN.has(answer.state))
93
+ return out("signed-in", KEY_ANSWERS.has(answer.state) ? "API key" : answer.method ?? "signed in");
94
+ return out(SIGNED_OUT.has(answer.state) ? "signed-out" : "unknown");
95
+ };
96
+ const seen = await Promise.all(DETECTED_AGENTS.map(row => one(row).catch(() => ({ id: row.id, name: row.name, state: "unknown", how: null, signIn: row.signIn, ready: false, next: null }))));
97
+ const agents = seen.map(agent => withNext(agent, routed, options.acpChecked));
98
+ return { agents, firstTask: firstTaskOf(agents, routed), routed, checkedAt: clock().toISOString(), tookMs: Date.now() - started };
99
+ }
100
+ export function withNext(agent, routed, acpChecked) {
101
+ if (agent.state === "not-installed")
102
+ return agent;
103
+ if (FIRST_TASK_ORDER.includes(agent.id)) {
104
+ const ready = agent.state === "signed-in" && (routed === null || routed === agent.id);
105
+ return { ...agent, ready, next: agent.state === "signed-in" && !ready ? CHOOSE_AGENT : null };
106
+ }
107
+ if (isAcpProvider(agent.id)) {
108
+ const checked = acpChecked?.(agent.id) ?? false;
109
+ const ready = checked && routed === agent.id && agent.state !== "signed-out";
110
+ const next = ready ? null : !checked ? `To give it tasks, check it once: run \`toolroll agents check ${agent.id} --model <model>\`.` : routed !== agent.id ? CHOOSE_MODELS : null;
111
+ return { ...agent, ready, next };
112
+ }
113
+ const ready = agent.state === "signed-in" && routed === agent.id;
114
+ return { ...agent, ready, next: ready ? null : CHOOSE_MODELS };
115
+ }
116
+ export function firstTaskOf(agents, routed) {
117
+ if (routed !== null)
118
+ return agents.find(one => one.id === routed && one.ready)?.id ?? null;
119
+ for (const id of FIRST_TASK_ORDER)
120
+ if (agents.some(one => one.id === id && one.ready))
121
+ return id;
122
+ return null;
123
+ }
124
+ export const NO_AGENT_YET = "No coding agent can take tasks on this computer yet.";
125
+ const nameOf = (id) => DETECTED_AGENTS.find(one => one.id === id)?.name ?? id;
126
+ export function firstRunAgentLines(rows, firstTask, checking = false, routed = null) {
127
+ if (firstTask !== null)
128
+ return [`Your first task goes to ${nameOf(firstTask)}.`];
129
+ if (checking)
130
+ return ["Looking for agents on this computer…"];
131
+ const installed = rows.filter(one => one.state !== "not-installed");
132
+ const install = ["Install one:", ...DETECTED_AGENTS.filter(one => one.install !== null).map(one => ` ${one.name}: run \`${one.install} && ${one.signIn}\``)];
133
+ if (installed.length === 0)
134
+ return install;
135
+ const lines = [];
136
+ const target = routed === null ? null : DETECTED_AGENTS.find(one => one.id === routed) ?? null;
137
+ if (target !== null && !installed.some(one => one.id === target.id)) {
138
+ lines.push(`Your tasks go to ${target.name}, which isn't installed here.${target.install === null ? "" : ` Install it: run \`${target.install} && ${target.signIn}\``}`);
139
+ }
140
+ for (const one of installed) {
141
+ if (one.state === "signed-in") {
142
+ if (one.next !== null)
143
+ lines.push(`${one.name} is signed in. ${one.next}`);
144
+ continue;
145
+ }
146
+ if (one.signIn !== null)
147
+ lines.push(`Sign in to ${one.name}: run \`${one.signIn}\`${one.state === "unknown" ? " (its sign-in couldn't be checked)" : ""}`);
148
+ }
149
+ return lines.length > 0 ? lines : install;
150
+ }
151
+ export function detectionLines(detection) {
152
+ return detection === null ? firstRunAgentLines([], null, true) : firstRunAgentLines(detection.agents, detection.firstTask, false, detection.routed);
153
+ }
154
+ const STATE_WORDS = { "signed-in": "signed in", "signed-out": "not signed in", unknown: "installed, sign-in unknown", "not-installed": "not installed" };
155
+ export function detectionReport(detection) {
156
+ const width = Math.max(...detection.agents.map(one => one.name.length));
157
+ return [
158
+ "Agents on this computer",
159
+ ...detection.agents.map(one => ` ${one.name.padEnd(width)} ${STATE_WORDS[one.state]}${one.state === "signed-in" && one.how !== null ? ` (${one.how})` : ""}`),
160
+ "",
161
+ ...detectionLines(detection),
162
+ ];
163
+ }
164
+ const npm = (pkg) => ({ install: `npm install -g ${pkg}`, installRun: { binary: "npm", args: ["install", "-g", pkg] } });
165
+ const ACP_CHECK = (id) => `toolroll agents check ${id} --model <model>`;
166
+ export const AGENT_SETUP = Object.freeze({
167
+ claude: { ...npm("@anthropic-ai/claude-code"), signIn: "claude auth login", signInRun: { binary: "claude", args: ["auth", "login"] }, key: null, check: null,
168
+ note: "Flexible threads (off for now) need `claude setup-token`." },
169
+ codex: { ...npm("@openai/codex"), signIn: "codex login", signInRun: { binary: "codex", args: ["login"] }, key: null, check: null, note: null },
170
+ gemini: { ...npm("@google/gemini-cli"), signIn: "gemini", signInRun: { binary: "gemini", args: [] },
171
+ key: "Or run it on an API key: switch it with `toolroll keys auth gemini api-key`, then pipe the key in with `toolroll keys set gemini < key.txt` (or paste it in Settings → Agents in the browser).", check: null,
172
+ note: "Its sign-in starts Gemini CLI: choose Login with Google, finish in the browser, then type /quit." },
173
+ openrouter: { install: null, installRun: null, signIn: null, signInRun: null,
174
+ key: "It runs on an OpenRouter key through Codex: pipe the key in with `toolroll keys set openrouter < key.txt` (or paste it in Settings → Agents in the browser), then choose its models.", check: null,
175
+ note: "Install Codex first: OpenRouter runs through it." },
176
+ opencode: { ...npm("opencode-ai"), signIn: ACP_AGENTS.opencode.signIn, signInRun: { binary: "opencode", args: ["auth", "login"] }, key: null, check: ACP_CHECK("opencode"), note: null },
177
+ cursor: { install: "curl https://cursor.com/install -fsS | bash", installRun: null, signIn: ACP_AGENTS.cursor.signIn, signInRun: { binary: "cursor-agent", args: ["login"] }, key: null, check: ACP_CHECK("cursor"), note: null },
178
+ cline: { ...npm("cline"), signIn: ACP_AGENTS.cline.signIn, signInRun: { binary: "cline", args: ["auth"] }, key: null, check: ACP_CHECK("cline"), note: null },
179
+ qwen: { ...npm("@qwen-code/qwen-code"), signIn: ACP_AGENTS.qwen.signIn, signInRun: { binary: "qwen", args: [] }, key: null, check: ACP_CHECK("qwen"),
180
+ note: "Its sign-in starts Qwen Code: type /auth and finish in the browser, then /quit." },
181
+ goose: { install: "curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | bash", installRun: null, signIn: ACP_AGENTS.goose.signIn,
182
+ signInRun: { binary: "goose", args: ["configure"] }, key: null, check: ACP_CHECK("goose"), note: null },
183
+ });
184
+ export function agentSetupOf(id) {
185
+ return Object.prototype.hasOwnProperty.call(AGENT_SETUP, id) ? AGENT_SETUP[id] : null;
186
+ }
187
+ export function npmRegistryOf(home, pkg) {
188
+ const file = join(home, ".npmrc");
189
+ try {
190
+ const seen = statSync(file);
191
+ if (!seen.isFile() || seen.size > 64 * 1024)
192
+ return { url: null, unsure: seen.isFile() };
193
+ }
194
+ catch {
195
+ return { url: null, unsure: false };
196
+ }
197
+ let text;
198
+ try {
199
+ text = readFileSync(file, "utf8");
200
+ }
201
+ catch {
202
+ return { url: null, unsure: true };
203
+ }
204
+ const scope = pkg.startsWith("@") ? pkg.split("/")[0] : null;
205
+ let scoped = null, plain = null, unsure = false;
206
+ for (const raw of text.split(/\r?\n/)) {
207
+ const line = raw.trim();
208
+ if (line === "" || line.startsWith("#") || line.startsWith(";") || line.startsWith("["))
209
+ continue;
210
+ const eq = line.indexOf("=");
211
+ if (eq < 0)
212
+ continue;
213
+ const key = line.slice(0, eq).trim(), value = line.slice(eq + 1).trim().replace(/^"(.*)"$/, "$1");
214
+ const isRegistry = key === "registry" || /^@[^:]+:registry$/.test(key);
215
+ if (!isRegistry) {
216
+ if (/registry/i.test(key) && !key.startsWith("//"))
217
+ unsure = true;
218
+ continue;
219
+ }
220
+ if (value.includes("${")) {
221
+ unsure = true;
222
+ continue;
223
+ }
224
+ if (key === "registry")
225
+ plain = value;
226
+ else if (scope !== null && key === `${scope}:registry`)
227
+ scoped = value;
228
+ }
229
+ const chosen = scoped ?? plain;
230
+ if (chosen === null)
231
+ return { url: null, unsure };
232
+ let url;
233
+ try {
234
+ url = new URL(chosen);
235
+ }
236
+ catch {
237
+ return { url: null, unsure: true };
238
+ }
239
+ if (url.protocol !== "https:" && url.protocol !== "http:")
240
+ return { url: null, unsure: true };
241
+ if (url.hostname === "registry.npmjs.org")
242
+ return { url: null, unsure };
243
+ return { url: `${url.protocol}//${url.host}${url.pathname}`.replace(/[\u0000-\u001f\u007f]/g, ""), unsure };
244
+ }
@@ -13,6 +13,7 @@ import { ensureGitViewsRoot, gitViewsRoot } from "./git-views.js";
13
13
  import { ensureRunnerProcessFolder, RUNNER_PROCESS_DIR } from "./runner-process.js";
14
14
  import { DEPS_FOLDER, linkedKey, readyCopy, sharedCopies } from "./shared-deps.js";
15
15
  import { SEATBELT_PROBE, sandboxRuntimeProblem, srtSpawn } from "./sandbox-runtime.js";
16
+ import { seccompHelperPath } from "./sandbox-tools.js";
16
17
  import { protectedStorageDenies, protectedStorageNames } from "./protected-storage.js";
17
18
  import { ensureSecretsDir, legacyLoginFileOf, SECRETS_DIR, secretsDirOf } from "./login-secrets.js";
18
19
  import { getDefaultWritePaths } from "@anthropic-ai/sandbox-runtime";
@@ -906,7 +907,7 @@ export function fenceFor(kind, ctx) {
906
907
  const storage = ctx.storage?.denies ?? protectedStorageDenies(ctx.home ?? homedir());
907
908
  const fence = agentFence({ databaseFile: ctx.databaseFile, worktree: ctx.worktree, ...home, boundary: ctx.boundary, binding: ctx.binding, runFolders: ctx.runFolders, extra: [...ctx.extra ?? [], ...ctx.readDeny ?? []], protectedStorage: storage });
908
909
  const found = fenceGrants({ databaseFile: ctx.databaseFile, worktree: ctx.worktree, boundary: ctx.boundary, runFolders: ctx.runFolders, linked: ctx.linked ?? null, binding: ctx.binding, ...home, poolRoots: ctx.poolRoots });
909
- const made = { ...found, readOnly: [...new Set([...found.readOnly, ...toolrollInstall(ctx.worktree, ctx.home ?? homedir(), ctx.binding?.main ?? null)])].sort() };
910
+ const made = installDenied(found, ctx.worktree, ctx.home ?? homedir(), ctx.binding?.main ?? null);
910
911
  const written = ctx.writes ?? null;
911
912
  const exact = ctx.exactFile ?? null;
912
913
  const grants = {
@@ -936,6 +937,9 @@ export function sealedScratch(poolRoots, named) {
936
937
  }
937
938
  return [...out].sort();
938
939
  }
940
+ export function installDenied(grants, worktree, home, repository = null) {
941
+ return { ...grants, readOnly: [...new Set([...grants.readOnly, ...toolrollInstall(worktree, home, repository)])].sort() };
942
+ }
939
943
  export function toolrollInstall(worktree, home, repository = null) {
940
944
  const own = worktree === null ? null : real(worktree);
941
945
  const repo = repository === null ? null : real(repository);
@@ -953,6 +957,13 @@ export function toolrollInstall(worktree, home, repository = null) {
953
957
  catch {
954
958
  runtime = [];
955
959
  }
960
+ const helper = seccompHelperPath();
961
+ if (helper !== null) {
962
+ try {
963
+ runtime.push(dirname(realpathSync(helper)));
964
+ }
965
+ catch { }
966
+ }
956
967
  const candidates = [resolve(dirname(fileURLToPath(import.meta.url)), ".."), ...runtime, dirname(dirname(real(process.execPath))), real(process.execPath)].map(real);
957
968
  const homeReal = real(home);
958
969
  return [...new Set(candidates)].filter(path => path !== dirname(path) && path !== homeReal && !inside(homeReal, path)
@@ -0,0 +1,4 @@
1
+ export const V170_ADDED_COLUMNS = Object.freeze({
2
+ run: { agent_said_json: { definition: "TEXT CHECK (agent_said_json IS NULL OR length(agent_said_json) BETWEEN 2 AND 4096)", saved: "NULL" } },
3
+ });
4
+ export const V170_STEPS = Object.freeze(["agent-said-column"]);
@@ -0,0 +1,23 @@
1
+ import { redactSecretLines, scanForSecrets } from "./evidence.js";
2
+ import { privateWords } from "./outbound-privacy.js";
3
+ export const AGENT_SAID_LINES = 8;
4
+ export const AGENT_SAID_CHARS = 200;
5
+ const ESCAPES = /\u001b\[[0-?]*[ -/]*[@-~]|\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)|\u001b[@-_]/g;
6
+ const CONTROLS = /[\u0000-\u0008\u000b-\u001f\u007f-\u009f\u200b-\u200f\u202a-\u202e\u2060-\u206f]/g;
7
+ const PATHS = /(^|[\s"'`(<[=:,])(?:(?:\/[^\s"'`)>\]/:,;]+){2,}\/?|\/[^\s"'`)>\]/:,;]*\.[^\s"'`)>\]/:,;]+|~[A-Za-z0-9._-]*\/[^\s"'`)>\]:,;]*|[A-Za-z]:[\\/][^\s"'`)>\]:,;]*)/g;
8
+ const URL_USERINFO = /\b([a-z][a-z0-9+.-]*:\/\/)[^\s/@"'`<>]+@/gi;
9
+ const URL_QUERY = /\b([a-z][a-z0-9+.-]*:\/\/[^\s?#"'`<>]*)[?#][^\s"'`<>]*/gi;
10
+ export function agentSaidTail(text) {
11
+ if (text === null || text === undefined || text.trim() === "")
12
+ return [];
13
+ const plain = text.replace(ESCAPES, "").replace(/\r\n?/g, "\n").replace(/\t/g, " ").replace(CONTROLS, "");
14
+ const addresses = plain.split("\n").map(line => line.replace(URL_USERINFO, "$1[hidden]@").replace(URL_QUERY, "$1?[hidden]")).join("\n");
15
+ const redacted = redactSecretLines(addresses, scanForSecrets(addresses));
16
+ const lines = redacted.split("\n")
17
+ .map(line => line.split(/(\b[a-z][a-z0-9+.-]*:\/\/\S*)/i).map((part, at) => at % 2 === 1 ? part : part.replace(PATHS, "$1[path]")).join(""))
18
+ .map(line => line.replace(/\s+/g, " ").trim()).filter(line => line !== "");
19
+ return lines
20
+ .map(line => line.length <= AGENT_SAID_CHARS ? line : `${line.slice(0, AGENT_SAID_CHARS - 1).trimEnd()}…`)
21
+ .filter(line => !privateWords(line))
22
+ .slice(-AGENT_SAID_LINES);
23
+ }
@@ -62,7 +62,7 @@ export function resolvePhaseAgent(store, phase, repo, flags, ref) {
62
62
  const valid = validateSpec(spec);
63
63
  return valid.ok ? { ok: true, spec, source: flags.model !== undefined ? "flag" : source } : { ok: false, problem: valid.problem };
64
64
  }
65
- export function resolveScopeProfile(store, repo, ref, flags, platform = process.platform) {
65
+ export function resolveScopeProfile(store, repo, ref, flags, platform = process.platform, options = {}) {
66
66
  const build = resolvePhaseAgent(store, "build", repo, flags, ref);
67
67
  if (!build.ok)
68
68
  return { ok: false, reason: "unknown-provider", problem: build.problem };
@@ -147,7 +147,7 @@ export function resolveScopeProfile(store, repo, ref, flags, platform = process.
147
147
  repairTimeoutSeconds: CODEX_SHAPED_LIMITS.repairTimeoutSeconds,
148
148
  repairModel,
149
149
  };
150
- const network = resolveNetwork(provider, repo === null ? PROJECT_NETWORK_DEFAULT : store.projectNetwork(repo), repo === null ? [] : repositoryEcosystems(repo));
150
+ const network = resolveNetwork(provider, repo === null ? PROJECT_NETWORK_DEFAULT : store.projectNetwork(repo), repo === null || options.walk === false ? [] : repositoryEcosystems(repo));
151
151
  const writes = repo === null ? WRITES_DEFAULT : store.projectWrites(repo);
152
152
  const checkAccess = repo === null ? "sandboxed" : checkAccessHere(store.projectCheckAccess(repo), platform);
153
153
  const sandbox = repo === null ? PROJECT_SANDBOX_DEFAULT : store.projectSandbox(repo);