toolroll 0.9.109 → 0.9.110

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 (135) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/agent-detect.js +244 -0
  3. package/dist/agent-fence.js +12 -1
  4. package/dist/agentconfig.js +2 -2
  5. package/dist/approval-summary.js +344 -0
  6. package/dist/attest.js +2 -2
  7. package/dist/browser/workspace.css +2 -2
  8. package/dist/browser/workspace.js +27 -27
  9. package/dist/builder.js +36 -2
  10. package/dist/chat-actions.js +24 -17
  11. package/dist/chat-core.js +3 -1
  12. package/dist/chat-decide.js +101 -46
  13. package/dist/chat-delivery-state.js +2 -0
  14. package/dist/chat-delivery.js +3 -2
  15. package/dist/chat-live.js +2 -1
  16. package/dist/chat-task-actions.js +6 -0
  17. package/dist/check-report.js +1 -1
  18. package/dist/cli.js +2 -0
  19. package/dist/console-instance.js +10 -1
  20. package/dist/contracts/console-api.js +10 -5
  21. package/dist/contracts/engine-api.js +271 -0
  22. package/dist/coordinator.js +2 -2
  23. package/dist/discord-api.js +4 -3
  24. package/dist/discord-chat.js +3 -1
  25. package/dist/easy-start-args.js +7 -3
  26. package/dist/easy-start.js +25 -0
  27. package/dist/egress.js +72 -10
  28. package/dist/engine-handoff.js +34 -0
  29. package/dist/engine-reads.js +261 -0
  30. package/dist/eval-world.js +3 -2
  31. package/dist/evidence.js +2 -0
  32. package/dist/fast-start.js +55 -14
  33. package/dist/fast-terms.js +2 -2
  34. package/dist/first-run.js +10 -2
  35. package/dist/flexible-agents.js +234 -0
  36. package/dist/flexible-answers-schema.js +61 -0
  37. package/dist/flexible-answers.js +889 -0
  38. package/dist/flexible-custody.js +494 -0
  39. package/dist/flexible-import.js +782 -0
  40. package/dist/flexible-launch-schema.js +72 -0
  41. package/dist/flexible-launch.js +331 -0
  42. package/dist/flexible-launcher.js +88 -0
  43. package/dist/flexible-levels.js +34 -0
  44. package/dist/flexible-merge-guard.js +47 -0
  45. package/dist/flexible-refs.js +47 -0
  46. package/dist/flexible-relay-cancel.js +19 -0
  47. package/dist/flexible-relay-schema.js +55 -0
  48. package/dist/flexible-relay-upstreams.js +36 -0
  49. package/dist/flexible-relay.js +1032 -0
  50. package/dist/flexible-session.js +732 -0
  51. package/dist/flexible-ship-schema.js +81 -0
  52. package/dist/flexible-ship.js +694 -0
  53. package/dist/flexible-start.js +80 -0
  54. package/dist/flexible-thread.js +175 -25
  55. package/dist/flexible-turns-schema.js +69 -0
  56. package/dist/flexible-turns.js +490 -0
  57. package/dist/flexible.js +10 -1
  58. package/dist/flow-actions.js +6 -4
  59. package/dist/flow-steps.js +1 -1
  60. package/dist/flows-cli.js +2 -1
  61. package/dist/git-views.js +6 -3
  62. package/dist/install-mode.js +225 -0
  63. package/dist/lead-doors.js +7 -1
  64. package/dist/limits-ui.js +7 -0
  65. package/dist/live-reply.js +6 -0
  66. package/dist/live-terminal.js +425 -29
  67. package/dist/local-owner.js +6 -0
  68. package/dist/model-choices.js +12 -6
  69. package/dist/notification-delivery.js +11 -0
  70. package/dist/operate.js +74 -30
  71. package/dist/outbound-privacy.js +204 -0
  72. package/dist/passwordless.js +2 -1
  73. package/dist/project-delete.js +14 -0
  74. package/dist/provider-connection.js +5 -3
  75. package/dist/publish.js +5 -0
  76. package/dist/pull-request-flow.js +26 -7
  77. package/dist/push.js +5 -1
  78. package/dist/release-card.js +11 -3
  79. package/dist/release.js +10 -1
  80. package/dist/route-store.js +2 -2
  81. package/dist/sandbox-launch.js +32 -8
  82. package/dist/sandbox-runtime.js +16 -7
  83. package/dist/sandbox-tools.js +176 -0
  84. package/dist/scope.js +12 -36
  85. package/dist/scout-net.js +7 -2
  86. package/dist/serve.js +58 -11
  87. package/dist/server/chrome.js +3 -1
  88. package/dist/server/console.css +33 -6
  89. package/dist/server/engine-api.js +378 -0
  90. package/dist/server/flows.js +2 -2
  91. package/dist/server/http.js +7 -0
  92. package/dist/server/link-redemption.js +52 -0
  93. package/dist/server/mutation-key.js +21 -7
  94. package/dist/server/pages.js +69 -40
  95. package/dist/server/people-tokens.js +17 -41
  96. package/dist/server/render-chat.js +1 -0
  97. package/dist/server/render-new-task.js +3 -3
  98. package/dist/server/render-results.js +4 -4
  99. package/dist/server/render-tasks.js +129 -138
  100. package/dist/server/route-table.js +30 -1
  101. package/dist/server/settings-section-table.js +3 -0
  102. package/dist/server/settings-sections.js +33 -0
  103. package/dist/server/settings.js +84 -10
  104. package/dist/server/task-views.js +8 -2
  105. package/dist/server/tasks.js +25 -8
  106. package/dist/server/terminals.js +181 -28
  107. package/dist/server/welcome.js +35 -10
  108. package/dist/settings-groups-ui.js +2 -2
  109. package/dist/settings-proofs.js +13 -9
  110. package/dist/slack-api.js +4 -3
  111. package/dist/slack-chat.js +5 -3
  112. package/dist/spend.js +46 -12
  113. package/dist/status-probe.js +343 -0
  114. package/dist/store.js +102 -5
  115. package/dist/teams-api.js +4 -3
  116. package/dist/teams-chat.js +4 -2
  117. package/dist/telegram-lead.js +2 -1
  118. package/dist/telegram-live.js +2 -1
  119. package/dist/telegram-team.js +2 -1
  120. package/dist/telegram.js +17 -5
  121. package/dist/trusted-path.js +162 -0
  122. package/dist/tui/darwin-arm64/toolroll-tui +0 -0
  123. package/dist/tui/darwin-x64/toolroll-tui +0 -0
  124. package/dist/tui/linux-arm64/toolroll-tui +0 -0
  125. package/dist/tui/linux-x64/toolroll-tui +0 -0
  126. package/dist/tui-launch.js +282 -0
  127. package/dist/tui-source.js +5 -3
  128. package/dist/tui.js +1 -1
  129. package/dist/webhooks.js +8 -4
  130. package/dist/welcome-facts.js +22 -15
  131. package/dist/workspace-ui.js +5 -0
  132. package/package.json +1 -1
  133. package/scripts/crash-canary.mjs +1 -1
  134. package/scripts/pilot.mjs +1 -1
  135. package/scripts/provider-canary.mjs +5 -3
package/CHANGELOG.md CHANGED
@@ -4,6 +4,41 @@ 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.110 — 2026-11-15
8
+
9
+ A real terminal screen: run `toolroll` in a terminal and watch, steer, review and accept your agents' work there, in a
10
+ calmer look. Solo installs ask for less, and first runs go straight to the agent you already have.
11
+
12
+ ### New
13
+
14
+ - **The terminal workbench.** Bare `toolroll` opens a native screen (Mac and Linux): your work list, the agent's
15
+ work live, Steer / Pause / Stop, and the diff with notes, Accept and Send back.
16
+ - **Take over a build.** On a task's Terminal tab press t for a real shell in a separate copy of its latest build;
17
+ Ctrl-] comes back and the shell keeps running.
18
+ - **Agents screen (A).** Every supported agent and what it needs: sign in through the agent's own login in a pane,
19
+ install with npm after a confirm, and pick the agent and model for planning, building and review.
20
+ - **Command palette and layouts.** `:` lists every action; key presets, split and grid layouts, resume where you left
21
+ off, and today's cost in the top bar.
22
+ - **Themes and `~/.config/toolroll/tui.toml`:** light, dark, high contrast or your terminal's own colours; density,
23
+ glyphs and notifications. Works down to 16 colours and NO_COLOR.
24
+ - **Instant start.** First run finds the coding agents you have and whether each is signed in, then sends your first
25
+ task to one you can use, or names the one sign-in command to run. It never makes a model call to check.
26
+ - **Solo and team.** A one-person install is solo: your signed-in session stands in for the password at ordinary
27
+ steps. Settings → General shows which you are; "It's just me" switches a single-person install to solo.
28
+
29
+ ### Changed
30
+
31
+ - **Approvals are shorter and exact.** One summary (goal, done when, agents, what it may touch and cost), risks under
32
+ "Before you approve", and Approve after what it approves. Revisions lead with what changed.
33
+ - **Saving a credential always asks for your password** (provider keys, the Telegram bot token, mail and Google
34
+ accounts), solo or team.
35
+ - **Messages that leave Toolroll never name a local folder or a key.** Chat apps, webhooks, push and email get a
36
+ plain "An update is ready" instead and the detail stays in Toolroll.
37
+
38
+ ### Fixed
39
+
40
+ - **A slow sign-in check no longer sends your first task to a plan** instead of the agent you have.
41
+
7
42
  ## 0.9.109 — 2026-11-14
8
43
 
9
44
  One Work screen, pages several times faster on a busy install, a clearer first run, and what the agent decided
@@ -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 bill your Claude plan through Toolroll's relay, which needs a long-lived token: run `claude setup-token` in your own terminal (it prints the token, so Toolroll never runs it for you)." },
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)
@@ -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);