toolroll 0.9.111 → 0.9.113

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 (61) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/README.md +28 -29
  3. package/dist/action-ledger.js +13 -0
  4. package/dist/agent-said.js +60 -6
  5. package/dist/bin.js +5 -1
  6. package/dist/browser/terminal.js +1 -1
  7. package/dist/browser/workspace.js +1 -1
  8. package/dist/chat-channel.js +10 -0
  9. package/dist/cli-help.js +6 -0
  10. package/dist/cli.js +2 -0
  11. package/dist/contracts/console-api.js +2 -1
  12. package/dist/contracts/engine-api.js +12 -0
  13. package/dist/contracts/lead-tools.js +28 -0
  14. package/dist/easy-start.js +8 -3
  15. package/dist/engine-reads.js +15 -0
  16. package/dist/evidence.js +6 -6
  17. package/dist/fast-terms.js +8 -4
  18. package/dist/flexible-agents.js +2 -8
  19. package/dist/flexible-answers.js +4 -26
  20. package/dist/flexible-available.js +31 -1
  21. package/dist/flexible-import.js +2 -14
  22. package/dist/flexible-launch.js +15 -3
  23. package/dist/flexible-launcher.js +0 -5
  24. package/dist/flexible-relay.js +7 -4
  25. package/dist/flexible-session.js +123 -32
  26. package/dist/flexible-setting-schema.js +10 -0
  27. package/dist/flexible-ship.js +8 -18
  28. package/dist/flexible-start.js +2 -2
  29. package/dist/flexible-thread.js +21 -27
  30. package/dist/flexible-turns.js +7 -17
  31. package/dist/flexible.js +9 -11
  32. package/dist/flow-triggers.js +4 -1
  33. package/dist/lead-tools.js +107 -1
  34. package/dist/lead.js +1 -1
  35. package/dist/ledger-view.js +2 -1
  36. package/dist/live-terminal.js +28 -0
  37. package/dist/local-owner.js +1 -0
  38. package/dist/needs-you.js +10 -2
  39. package/dist/operate.js +62 -5
  40. package/dist/outbound-privacy.js +6 -1
  41. package/dist/plain-words.js +1 -1
  42. package/dist/release.js +2 -0
  43. package/dist/serve.js +10 -1
  44. package/dist/server/chat.js +6 -1
  45. package/dist/server/engine-api.js +91 -27
  46. package/dist/server/mutation-key.js +6 -0
  47. package/dist/server/render-history.js +2 -1
  48. package/dist/server/route-table.js +3 -0
  49. package/dist/server/settings-section-table.js +3 -0
  50. package/dist/server/settings-sections.js +23 -0
  51. package/dist/server/settings.js +36 -3
  52. package/dist/server/terminals.js +3 -3
  53. package/dist/settings-proofs.js +2 -0
  54. package/dist/store.js +18 -4
  55. package/dist/tui/darwin-arm64/toolroll-tui +0 -0
  56. package/dist/tui/darwin-x64/toolroll-tui +0 -0
  57. package/dist/tui/linux-arm64/toolroll-tui +0 -0
  58. package/dist/tui/linux-x64/toolroll-tui +0 -0
  59. package/dist/view-tools.js +94 -0
  60. package/dist/work-index.js +6 -2
  61. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,68 @@ 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.113 — 2026-11-17
8
+
9
+ The terminal workbench for people coming from herdr: a clear first screen, a build shell that can't take your keys by
10
+ mistake, approving a sent-back plan without leaving the terminal, and interactive agent threads as a beta switch.
11
+
12
+ ### New
13
+
14
+ - **Interactive agent threads (beta).** Settings → General, or `toolroll config set flexible on` (your password).
15
+ Off by default; Claude Code only for now; `T` starts a thread. Turning it off stops running threads.
16
+ - **Approve a sent-back plan in the workbench.** After you send a result back, press `a` on the revision to read its
17
+ terms and approve them; `w` still opens it in your browser.
18
+ - **Watch running tasks** from the command palette (`:`): every running task in its own panel.
19
+ - **Coming from herdr?** `docs/guide/from-herdr.md` maps the keys and says what differs.
20
+
21
+ ### Changed
22
+
23
+ - **"Take over" is now "Open build shell"** and asks first: it opens a shell in a separate copy of the build and
24
+ never controls the running agent.
25
+ - **Quitting asks** whether to stop the agents or keep them running, and prints how to reopen.
26
+ - **Panel headers lead with the task,** its state and cost; long titles wrap instead of being cut.
27
+ - **`toolroll view reset` keeps your keys** and names its backup by date; nothing is backed up when already default.
28
+ - **The README opens with the terminal loop** and a real screenshot of the workbench.
29
+
30
+ ### Fixed
31
+
32
+ - **Open build shell on a task with no saved build** refuses at once; your typing can no longer reach workbench keys.
33
+ - **A sent-back task no longer closes the workbench** with "isn't what this version expects"; one task's
34
+ unreadable steps only affect that task.
35
+ - **"Building it." clears** when a task moves on to waiting, retrying, Ready or failed.
36
+ - **The mail inbox never skips an email** when two checks overlap.
37
+ - **Threads start in a project `toolroll` added itself,** and the new-task box shows while a thread is open.
38
+ - **`tui.toml` with both `list-side` and `list_side`** reads back the same after a change (the dashed spelling wins).
39
+ - **Turning on threads without a password** tells you to set one first (`toolroll password set`), in plain words.
40
+
41
+ ## 0.9.112 — 2026-11-16
42
+
43
+ A security release: keys and folder paths in an agent's output never leave Toolroll. Plus asking your agent to restyle
44
+ the workbench, and a smoother everyday terminal: full-text export, the task's situation on Live, and a jump history.
45
+
46
+ ### Fixed
47
+
48
+ - **Keys ending in "-" are caught.** Google, GitLab, OpenAI, Telegram, Slack and Discord tokens before a space or at a
49
+ line's end slipped past the privacy check, redaction and patch scanning in 0.9.111 and earlier.
50
+ - **Folder paths in what an agent said are hidden whole,** including paths after a web address, glued paths,
51
+ `file://` and other local addresses, network shares, `$HOME`/`%USERPROFILE%` forms, and escaped or encoded paths.
52
+ - **Very long agent output can't slow the cleaning down,** and an agent's only error line is never dropped.
53
+
54
+ ### New
55
+
56
+ - **Ask your agent to restyle the workbench.** In your own chat on this computer: themes, colours, density, columns,
57
+ notifications on. Contrast and status colours are protected; keys stay yours. `toolroll view reset` undoes it.
58
+ - **Ctrl-E opens the full text** of a pane in your editor, not the cut-off screen.
59
+ - **Live shows the task's situation:** waiting to retry, on hold or failed, with what the agent said and `x` / `X`.
60
+ - **`'` remembers your last 20 jumps,** and pressing it again goes forward.
61
+
62
+ ### Changed
63
+
64
+ - **Narrow windows show the list** (`b`), with your place ("2 of 5"); the top bar is the same on every screen.
65
+ - **Search covers what's on screen,** including the agent's error; unread dots mark any change you didn't see.
66
+ - **Attempts read the same everywhere:** "attempt 3 (build #4)" in the workbench, `toolroll task show` and status.
67
+ - **The guide covers the terminal workbench,** failures and retries, task sizing and upgrading.
68
+
7
69
  ## 0.9.111 — 2026-11-16
8
70
 
9
71
  The terminal workbench, smoothed by five rounds of first-run testing: failures say why in the agent's own words,
package/README.md CHANGED
@@ -7,8 +7,15 @@
7
7
 
8
8
  ### Your agents build. You decide.
9
9
 
10
- For Claude Code, Codex and Gemini, on your own machine.<br>
11
- Approve each plan once. Get results back Ready with the diff, the check status and screenshots.
10
+ **Delegate a change. Review the diff here.**
11
+
12
+ <picture>
13
+ <source media="(prefers-color-scheme: light)" srcset="docs/media/terminal-workbench-light.png">
14
+ <img src="docs/media/terminal-workbench.png" alt="The Toolroll terminal workbench: the work list with two tasks that need you, and the Live tab following a running build" width="900">
15
+ </picture>
16
+ <sub>The terminal workbench, shown with sample tasks and output.</sub>
17
+
18
+ For Claude Code, Codex and Gemini, on your own machine.
12
19
 
13
20
  [![npm](https://img.shields.io/npm/v/toolroll?color=171717)](https://www.npmjs.com/package/toolroll)
14
21
  [![CI](https://github.com/ap9000/toolroll/actions/workflows/ci.yml/badge.svg)](https://github.com/ap9000/toolroll/actions/workflows/ci.yml)
@@ -18,13 +25,6 @@ Approve each plan once. Get results back Ready with the diff, the check status a
18
25
 
19
26
  **[Website](https://toolroll.dev)** · [Docs](docs/guide/README.md) · [For agents](docs/agents.md) · [Use cases](https://toolroll.dev/use-cases) · [Changelog](CHANGELOG.md)
20
27
 
21
- <picture>
22
- <source media="(prefers-color-scheme: dark)" srcset="docs/media/ui/tasks-dark.png">
23
- <img src="docs/media/ui/tasks-light.png" alt="The Tasks page in Toolroll: tasks grouped by what they need from you (approve a plan, open a result, unblock), each with one button." width="920">
24
- </picture>
25
-
26
- <sub>Every task across every project, and the one thing each needs from you. (Demo workspace.)</sub>
27
-
28
28
  </div>
29
29
 
30
30
  ## Quick start
@@ -48,36 +48,35 @@ The first command removes Toolroll's older package, `standing-orders`, if you
48
48
  have it: npm can't install over it (it stops with `EEXIST: file already
49
49
  exists … bin/standing-orders`). Without it, the command does nothing.
50
50
 
51
- Toolroll opens in your terminal and runs while that window is open. No
51
+ Toolroll opens in your terminal. On quit, choose whether agents keep running. No
52
52
  password and no login file: on your own computer you're already in. Started
53
53
  in a git repository, that repository is your project; press `n` for a first
54
- task, approve the plan, and the result comes back **Ready**. Elsewhere, press
54
+ task and describe the change. Enter chooses **Just code**; Tab switches to
55
+ **Plan first**, then Enter submits. Review any proposed build terms before
56
+ starting. The result comes back **Ready**: review the diff with Enter, then
57
+ press `a` to accept (confirm after reading), or `r` to request a revision. Elsewhere, press
55
58
  `s` to try a small sample project, add your own with
56
59
  `toolroll repos add <folder>`, or open the browser (press `w`, or run
57
60
  `toolroll --web`). To look around
58
61
  first, `toolroll demo` opens a seeded sandbox with no model calls and no spend.
59
62
  More: [Getting started](docs/guide/getting-started.md).
60
63
 
61
- ## How it works
64
+ ## The terminal loop
62
65
 
63
- ```
64
- describe ─▶ plan ─▶ approve ─▶ build ─▶ check ─▶ Ready ─▶ you decide
65
- you agent exact diff Complete,
66
- commit + checks send back or merge
67
- ```
66
+ **Install → `toolroll` → `n` → describe → Enter → build → review diff → accept.**
67
+
68
+ Enter in the new-task composer chooses **Just code** by default. Tab toggles
69
+ **Plan first**; Enter then submits that choice. Just code skips planning, not
70
+ the build terms or safety checks. Plan first drafts a scope for you to review
71
+ and approve before building.
72
+
73
+ Agents work on their own branches. A judgement call becomes a question for
74
+ you. A result becomes **Ready**, awaiting your review, with its diff and actual
75
+ check status. Accept marks it Complete; publishing and merging need their own
76
+ approvals. Set your project's check to verify the exact result.
68
77
 
69
- 1. **Describe** the outcome in Chat, the terminal or your phone.
70
- 2. **Plan.** Toolroll reads the repository and drafts the goal, what's out of
71
- bounds, the requirements, and the exact agent and model.
72
- 3. **Approve** once. Nothing spends until you do; changing the terms asks again.
73
- 4. **Build.** An agent works on its own branch. A judgement call
74
- becomes a question for you, not a guess.
75
- 5. **Check.** Once you set your project's check, it runs on the exact commit.
76
- 6. **Ready.** The diff, the check log and screenshots. Mark it Complete, send
77
- it back with what to change, or merge through the pull request.
78
-
79
- Approving work you start on this computer needs no password. Hands-off modes,
80
- merging, releasing and most settings ask you to set one first: `toolroll password set`.
78
+ [Coming from herdr](docs/guide/from-herdr.md) ·
79
+ [Terminal keys and layouts](docs/guide/getting-started.md#the-terminal-workbench)
81
80
 
82
81
  ## Use cases
83
82
 
@@ -1,4 +1,17 @@
1
1
  export const LEDGER_SOURCES = ["work", "request", "access", "sign-in", "policy", "api", "mcp"];
2
+ export const RECORD_WHOLE_MAX = 16_384;
3
+ export function recordActionWhole(db, entry, detail) {
4
+ const text = JSON.stringify(detail);
5
+ if (text === undefined || text.length > RECORD_WHOLE_MAX || /[\u0000-\u001f\u007f]/.test(text))
6
+ throw new Error("Ledger detail is not storable");
7
+ const row = db.prepare("INSERT INTO action_ledger(at,actor,repo,task_id,run_id,action,outcome,source,detail) VALUES (?,?,?,?,?,?,?,?,?)")
8
+ .run(entry.at, entry.actor, entry.repo, entry.taskId, entry.runId, entry.action, entry.outcome, entry.source, text);
9
+ return Number(row.lastInsertRowid);
10
+ }
11
+ export const DETAIL_SHOWN = 300;
12
+ export function detailShown(detail) {
13
+ return detail.length <= DETAIL_SHOWN ? detail : `${detail.slice(0, DETAIL_SHOWN - 1)}…`;
14
+ }
2
15
  export const LEDGER_V99_TABLE = (name) => `CREATE TABLE ${name} (
3
16
  id INTEGER PRIMARY KEY AUTOINCREMENT,
4
17
  at TEXT NOT NULL, actor TEXT NOT NULL, repo TEXT,
@@ -3,21 +3,75 @@ import { privateWords } from "./outbound-privacy.js";
3
3
  export const AGENT_SAID_LINES = 8;
4
4
  export const AGENT_SAID_CHARS = 200;
5
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;
6
+ const CONTROLS = /[\u0000-\u0008\u000b-\u001f\u007f-\u009f\u061c\u200b-\u200f\u202a-\u202e\u2060-\u206f]/g;
7
+ const STARTS = String.raw `\s"'` + "`" + String.raw `(<[=:,`;
8
+ const START = `(^|[${STARTS}])`;
9
+ const ENDS = String.raw `\s"'` + "`" + String.raw `)>\]:,;`;
10
+ const HOME_VARIABLE = String.raw `(?:\$HOME|\$\{HOME\}|%USERPROFILE%|%HOMEPATH%|\$env:USERPROFILE)[\\/]`;
11
+ const NEW_ROOT = String.raw `(?![A-Za-z]:[\\/]|~[A-Za-z0-9._-]*\/|\\\\(?![\\${ENDS}])|(?<=[${STARTS}])${HOME_VARIABLE})`;
12
+ const PART = `(?:${NEW_ROOT}[^${ENDS}/])`;
13
+ const TAIL = `(?:${NEW_ROOT}[^${ENDS}])`;
14
+ const ROOTED = [
15
+ `(?:\\/${PART}+){2,}\\/?`,
16
+ `\\/${PART}*\\.${PART}+`,
17
+ `~[A-Za-z0-9._-]*\\/${TAIL}*`,
18
+ `[A-Za-z]:[\\\\/]${TAIL}*`,
19
+ `\\\\\\\\(?![\\\\${ENDS}])${TAIL}+`,
20
+ `${HOME_VARIABLE}${TAIL}*`,
21
+ `(?:\\\\\\/(?:${NEW_ROOT}[^${ENDS}/\\\\])+){2,}`,
22
+ ].join("|");
23
+ const PATHS = new RegExp(`${START}((?:${ROOTED})+)`, "g");
24
+ const ROOTED_ANYWHERE = new RegExp(`(?:^|[^A-Za-z0-9])(?:${ROOTED})`);
25
+ const NETWORK = /(\b(?:https?|wss?|ftp|ssh|git):\/\/[^\s"'`<>]*)/i;
26
+ const OTHER_ADDRESS = /\b(?!(?:https?|wss?|ftp|ssh|git):\/\/)[a-z][a-z0-9+.-]*:\/\/([^\s"'`<>]*)/gi;
27
+ const otherAddress = (whole, rest) => /[\\/]/.test(rest) ? "[path]" : whole;
28
+ const WORDS = /([\s"'`<>]+)/;
29
+ const ESCAPED = /%[0-9A-Fa-f]{2}/;
30
+ const DECODE_AT_MOST = 2048;
31
+ function encodedWords(text) {
32
+ return text.split(WORDS).map((word, at) => {
33
+ if (at % 2 === 1 || !ESCAPED.test(word))
34
+ return word;
35
+ if (word.length > DECODE_AT_MOST)
36
+ return "[path]";
37
+ const decoded = word.replace(/%([0-9A-Fa-f]{2})/g, (_, hex) => String.fromCharCode(Number.parseInt(hex, 16)));
38
+ return ROOTED_ANYWHERE.test(` ${decoded}`) ? "[path]" : word;
39
+ }).join("");
40
+ }
41
+ const READ_AT_MOST = 64 * 1024;
42
+ const LINE_AT_MOST = 4096;
43
+ const cutStart = (line) => `… ${line.replace(/^[^\s"'`<>]*[\s"'`<>]?/, "")}`;
44
+ const capped = (line) => line.length <= LINE_AT_MOST ? line : cutStart(line.slice(-(LINE_AT_MOST - 2)));
8
45
  const URL_USERINFO = /\b([a-z][a-z0-9+.-]*:\/\/)[^\s/@"'`<>]+@/gi;
9
46
  const URL_QUERY = /\b([a-z][a-z0-9+.-]*:\/\/[^\s?#"'`<>]*)[?#][^\s"'`<>]*/gi;
47
+ const ADDRESS_QUERY = /\b[a-z][a-z0-9+.-]*:\/\/[^\s?#"'`<>]*([?#][^\s"'`<>]*)?/gi;
48
+ function shortened(line) {
49
+ if (line.length <= AGENT_SAID_CHARS)
50
+ return line;
51
+ let end = AGENT_SAID_CHARS - 1;
52
+ if (/[\ud800-\udbff]/.test(line[end - 1] ?? ""))
53
+ end -= 1;
54
+ let kept = line.slice(0, end).trimEnd();
55
+ const last = [...kept.matchAll(ADDRESS_QUERY)].at(-1);
56
+ if (last?.[1] !== undefined && last.index + last[0].length === kept.length)
57
+ kept = kept.slice(0, kept.length - last[1].length).trimEnd();
58
+ return `${kept}…`;
59
+ }
10
60
  export function agentSaidTail(text) {
11
61
  if (text === null || text === undefined || text.trim() === "")
12
62
  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");
63
+ const sliced = text.length > READ_AT_MOST && text[text.length - READ_AT_MOST - 1] !== "\n";
64
+ const tail = text.length <= READ_AT_MOST ? text : text.slice(-READ_AT_MOST);
65
+ const plain = tail.replace(ESCAPES, "").replace(/\r\n?/g, "\n").replace(/\t/g, " ").replace(CONTROLS, "");
66
+ const bounded = plain.split("\n").map((line, at) => capped(at === 0 && sliced ? cutStart(line) : line));
67
+ const addresses = bounded.map(line => line.replace(URL_USERINFO, "$1[hidden]@").replace(URL_QUERY, "$1?[hidden]")).join("\n");
15
68
  const redacted = redactSecretLines(addresses, scanForSecrets(addresses));
16
69
  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(""))
70
+ .map(line => line.replace(OTHER_ADDRESS, otherAddress).split(NETWORK)
71
+ .map((part, at) => at % 2 === 1 ? part : encodedWords(part).replace(PATHS, "$1[path]")).join(""))
18
72
  .map(line => line.replace(/\s+/g, " ").trim()).filter(line => line !== "");
19
73
  return lines
20
- .map(line => line.length <= AGENT_SAID_CHARS ? line : `${line.slice(0, AGENT_SAID_CHARS - 1).trimEnd()}…`)
74
+ .map(shortened)
21
75
  .filter(line => !privateWords(line))
22
76
  .slice(-AGENT_SAID_LINES);
23
77
  }
package/dist/bin.js CHANGED
@@ -41,6 +41,11 @@ async function sqliteHasFts5() {
41
41
  }
42
42
  }
43
43
  const argv = process.argv.slice(2);
44
+ export const STARTING_SAID = Symbol.for("toolroll.starting-said");
45
+ if (argv.length === 0 && process.stdout.isTTY === true && process.stdin.isTTY === true) {
46
+ process.stdout.write("Starting Toolroll…\n");
47
+ globalThis[STARTING_SAID] = true;
48
+ }
44
49
  const { quickAnswer } = await import("./cli-fast.js");
45
50
  const quick = quickAnswer(argv);
46
51
  if (quick !== null) {
@@ -54,4 +59,3 @@ else {
54
59
  const { runCliProcess } = await import("./cli.js");
55
60
  await runCliProcess(argv);
56
61
  }
57
- export {};