toolroll 0.9.108 → 0.9.109

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 (88) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/advanced-view.js +0 -1
  3. package/dist/agent-fence.js +35 -4
  4. package/dist/agent-state.js +5 -2
  5. package/dist/assignment-ui.js +5 -5
  6. package/dist/assignment.js +5 -2
  7. package/dist/browser/terminal.js +1 -1
  8. package/dist/browser/workspace.css +1 -1
  9. package/dist/browser/workspace.js +37 -34
  10. package/dist/browser-crew.js +4 -4
  11. package/dist/browser-workspace.js +4 -11
  12. package/dist/builder.js +9 -1
  13. package/dist/chat-controls.js +6 -5
  14. package/dist/chat-decide.js +1 -1
  15. package/dist/chat-quiet.js +3 -3
  16. package/dist/chat-voice.js +2 -2
  17. package/dist/cli-help.js +12 -13
  18. package/dist/cli.js +4 -3
  19. package/dist/console-chrome.js +10 -3
  20. package/dist/contracts/console-api.js +4 -3
  21. package/dist/contracts/handoff.js +4 -0
  22. package/dist/decision.js +17 -0
  23. package/dist/demo-chat.js +1 -1
  24. package/dist/demo.js +6 -0
  25. package/dist/design/kit.js +4 -3
  26. package/dist/dispatch.js +3 -8
  27. package/dist/flexible-available.js +1 -0
  28. package/dist/flexible-schema.js +32 -0
  29. package/dist/flexible-thread-schema.js +30 -0
  30. package/dist/flexible-thread.js +526 -0
  31. package/dist/flexible-ui.js +44 -0
  32. package/dist/flexible.js +359 -0
  33. package/dist/git-views.js +38 -38
  34. package/dist/guides.js +11 -10
  35. package/dist/keymap.js +1 -1
  36. package/dist/lead-context.js +1 -1
  37. package/dist/limits-ui.js +1 -1
  38. package/dist/live-bus.js +70 -13
  39. package/dist/needs-you.js +3 -3
  40. package/dist/nightly-github.js +2 -2
  41. package/dist/operate.js +111 -3
  42. package/dist/project-delete-ui.js +2 -1
  43. package/dist/project-delete.js +1 -0
  44. package/dist/provider-auth.js +1 -1
  45. package/dist/release.js +1 -0
  46. package/dist/result-actions.js +3 -0
  47. package/dist/result-evidence-readers.js +8 -2
  48. package/dist/result-review.js +20 -9
  49. package/dist/serve.js +32 -29
  50. package/dist/server/chat.js +9 -9
  51. package/dist/server/chrome.js +16 -16
  52. package/dist/server/guards.js +10 -4
  53. package/dist/server/home.js +37 -5
  54. package/dist/server/http.js +4 -2
  55. package/dist/server/in-place.js +5 -4
  56. package/dist/server/kit.js +2 -2
  57. package/dist/server/live.js +100 -10
  58. package/dist/server/pages.js +79 -53
  59. package/dist/server/render-chat.js +1 -1
  60. package/dist/server/render-history.js +18 -4
  61. package/dist/server/render-new-task.js +2 -2
  62. package/dist/server/render-pages.js +21 -39
  63. package/dist/server/render-people.js +2 -2
  64. package/dist/server/render-projects.js +5 -5
  65. package/dist/server/render-results.js +26 -10
  66. package/dist/server/render-tasks.js +26 -17
  67. package/dist/server/retired-routes.js +37 -4
  68. package/dist/server/route-policy.js +8 -0
  69. package/dist/server/route-table.js +13 -4
  70. package/dist/server/settings-computers.js +140 -0
  71. package/dist/server/settings-scripts.js +15 -0
  72. package/dist/server/settings-section-table.js +56 -0
  73. package/dist/server/settings-sections.js +258 -0
  74. package/dist/server/settings.js +164 -19
  75. package/dist/server/task-views.js +47 -13
  76. package/dist/server/tasks.js +143 -90
  77. package/dist/server/welcome.js +6 -5
  78. package/dist/settings-groups-ui.js +24 -105
  79. package/dist/settings-proofs.js +5 -2
  80. package/dist/sqlite-telemetry.js +70 -21
  81. package/dist/store.js +108 -9
  82. package/dist/task-link.js +64 -0
  83. package/dist/tui.js +1 -1
  84. package/dist/typed-words-schema.js +18 -0
  85. package/dist/welcome-facts.js +3 -2
  86. package/dist/work-index.js +126 -29
  87. package/dist/work-reads.js +279 -0
  88. package/package.json +4 -2
@@ -1,12 +1,13 @@
1
1
  import { chatControlHref, chatResultHref } from './chat-controls.js';
2
2
  import { startBuilderHref } from './needs-you.js';
3
+ import { taskLinkOf } from './task-link.js';
3
4
  export function browserWorkActionHref(item) {
4
5
  const action = item.primaryAction;
5
6
  if (action === null)
6
7
  return null;
7
8
  const { taskId, runId, decisionId } = action.target;
8
9
  if (action.code === 'inspect-findings')
9
- return `/t/${encodeURIComponent(taskId)}#findings`;
10
+ return taskLinkOf({ task: taskId, anchor: 'findings' });
10
11
  if (decisionId !== null)
11
12
  return `/d/${decisionId}`;
12
13
  if (action.code === 'inspect-decisions')
@@ -21,9 +22,8 @@ export function browserWorkActionHref(item) {
21
22
  return chatResultHref(taskId, runId);
22
23
  if (action.code === 'open-pr' && /^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/pull\/\d+$/.test(item.publicationUrl ?? ''))
23
24
  return item.publicationUrl;
24
- if (runId !== null && (action.code === 'open-pr' || action.code === 'retry-review')) {
25
- return `/review?result=${encodeURIComponent(taskId)}&run=${runId}`;
26
- }
25
+ if (runId !== null && (action.code === 'open-pr' || action.code === 'retry-review'))
26
+ return taskLinkOf({ task: taskId, run: runId });
27
27
  if (runId !== null && (action.code === 'inspect-run' || action.code === 'reconcile-run'))
28
28
  return `/r/${runId}`;
29
29
  if (action.code === 'start-worker')
@@ -67,24 +67,17 @@ export function browserProjectsOf(projects) {
67
67
  if (seen.has(project.path))
68
68
  return [];
69
69
  seen.add(project.path);
70
- return [{ name: project.name, path: project.path, href: `/tasks?project=${encodeURIComponent(project.path)}`,
70
+ return [{ name: project.name, path: project.path, href: `/?project=${encodeURIComponent(project.path)}`,
71
71
  knowledgeHref: `/settings/knowledge?repo=${encodeURIComponent(project.path)}` }];
72
72
  });
73
73
  }
74
- export function browserNavigationOf(path, project = null, needsYou = 0, tasksProject = project, needsYouLabel, advanced = true) {
74
+ export function browserNavigationOf(path, needsYou = 0, needsYouLabel) {
75
75
  const pathname = path.split('?')[0].split('#')[0];
76
76
  const under = (...roots) => roots.some(root => pathname === root || pathname.startsWith(`${root}/`));
77
77
  return [
78
- { label: 'Home', href: '/', active: pathname === '/' || under('/d', '/activity', '/morning'),
78
+ { label: 'Work', href: '/', active: pathname === '/' || under('/tasks', '/t', '/r', '/review', '/d', '/activity', '/morning'),
79
79
  ...(needsYou > 0 ? { count: needsYou, ...(needsYouLabel === undefined ? {} : { countLabel: needsYouLabel }) } : {}) },
80
80
  { label: 'Chat', href: '/chat', active: under('/chat') },
81
- { label: 'Tasks', href: `/tasks${tasksProject === null ? '' : `?project=${encodeURIComponent(tasksProject)}`}`,
82
- active: under('/tasks', '/t', '/r', '/review') },
83
- ...(advanced ? [
84
- { label: 'Flows', href: '/flows', active: under('/flows', '/recipes', '/kits', '/routines') },
85
- { label: 'Agents', href: '/agents', active: under('/agents', '/peek', '/term', '/fleet', '/system', '/runs') },
86
- ] : []),
87
- { label: 'Projects', href: '/projects', active: under('/projects') },
88
- { label: 'Settings', href: '/settings', active: under('/settings', '/spend', '/mode', '/people', '/ledger', '/menu', ...(advanced ? [] : ['/flows', '/recipes', '/kits', '/routines', '/agents', '/peek', '/term', '/fleet', '/system', '/runs'])) },
81
+ { label: 'Settings', href: '/settings', active: under('/settings', '/spend', '/mode', '/people', '/ledger', '/menu', '/flows', '/recipes', '/kits', '/routines', '/agents', '/peek', '/term', '/fleet', '/system', '/runs') },
89
82
  ];
90
83
  }
package/dist/builder.js CHANGED
@@ -38,7 +38,7 @@ import { missingCapability } from "./dispatch.js";
38
38
  import { heartbeat as runnerHeartbeat, RUNNER_HEARTBEAT_MS } from "./runner.js";
39
39
  import { keepCheckTimeline } from "./latency-timeline.js";
40
40
  import { MARKER as LEASE_MARKER } from "./worktree.js";
41
- import { parseDecision, parseHandoff, repairPrompt, HEADLESS_RULE, HANDOFF_CONCLUSION_CAP, HANDOFF_ITEM_CAP, HANDOFF_LIST_CAP, HANDOFF_PAYLOAD_CAP } from "./decision.js";
41
+ import { parseDecision, parseHandoff, repairPrompt, HEADLESS_RULE, HANDOFF_CONCLUSION_CAP, HANDOFF_ITEM_CAP, HANDOFF_LIST_CAP, HANDOFF_REPORT_CAP, handoffReportOf, HANDOFF_PAYLOAD_CAP } from "./decision.js";
42
42
  import { createHash, randomBytes, randomUUID } from "node:crypto";
43
43
  import { fencedCommands, invokeAgent } from "./invoke.js";
44
44
  import { TELEGRAM_TOKEN_ENVS } from "./names.js";
@@ -1309,6 +1309,7 @@ export async function settleProviderOutcome(captured, result) {
1309
1309
  changes: handoff.changes,
1310
1310
  verification: handoff.verification,
1311
1311
  followUps: handoff.followUps,
1312
+ ...handoffReportOf(handoff),
1312
1313
  freshness: { stampedAt: clock().toISOString(), currentAsOf: baseRevision },
1313
1314
  }, clock());
1314
1315
  if (observation) {
@@ -1388,6 +1389,7 @@ export async function settleProviderOutcome(captured, result) {
1388
1389
  changes: handoff.changes,
1389
1390
  verification: handoff.verification,
1390
1391
  followUps: handoff.followUps,
1392
+ ...handoffReportOf(handoff),
1391
1393
  freshness: { stampedAt: clock().toISOString(), currentAsOf: head },
1392
1394
  }, clock());
1393
1395
  try {
@@ -2676,6 +2678,12 @@ function brief(scope, branch, mailbox, done, proof, answers = [], planDocument =
2676
2678
  ` at most ${HANDOFF_LIST_CAP} items each, ${HANDOFF_ITEM_CAP} characters per item. The conclusion is the operator's`,
2677
2679
  " compact result, not a transcript: never include a preamble, file dump,",
2678
2680
  " or repeated explanation. The machine stores full diffs separately.",
2681
+ " Also tell the person who reviews this what they can't see in the diff,",
2682
+ ` in four optional lists of at most ${HANDOFF_REPORT_CAP} short lines each: "decisions" (choices`,
2683
+ ' you made that they might have made differently), "assumptions" (what you',
2684
+ ' took as true without checking), "notDone" (what the goal asked for that',
2685
+ ' you left out) and "risks" (what could go wrong). Leave a list out rather',
2686
+ " than pad it; the person sees these before deciding, labelled as yours.",
2679
2687
  ` The whole file must be under ${HANDOFF_PAYLOAD_CAP} bytes, and the conclusion and every`,
2680
2688
  " list item is ONE line of plain text — a newline or other control",
2681
2689
  " character in any of them refuses the whole file, not just that field.",
@@ -1,3 +1,4 @@
1
+ import { taskLinkOf } from "./task-link.js";
1
2
  export const CHAT_CONTROLS = {
2
3
  task: { label: "Open task", target: "task" },
3
4
  approval: { label: "Review & start", target: "task" },
@@ -11,7 +12,7 @@ export const CHAT_CONTROLS = {
11
12
  projects: { label: "Manage projects", href: "/projects" },
12
13
  flows: { label: "Open flows", href: "/flows" },
13
14
  recipes: { label: "Browse workflows", href: "/recipes" },
14
- workers: { label: "Manage workers", href: "/fleet" },
15
+ workers: { label: "Manage computers", href: "/settings/computers?section=builders" },
15
16
  slack: { label: "Manage Slack", href: "/settings/slack" },
16
17
  discord: { label: "Manage Discord", href: "/settings/discord" },
17
18
  lead: { label: "Name your lead", href: "/settings/lead" },
@@ -30,7 +31,7 @@ export function isChatControl(value) {
30
31
  return typeof value === "string" && Object.hasOwn(CHAT_CONTROLS, value);
31
32
  }
32
33
  export function chatResultHref(task, run, tab = "summary") {
33
- return `/chat?task=${encodeURIComponent(task)}&result=${run}${tab === "summary" ? "" : `&tab=${tab}`}`;
34
+ return taskLinkOf({ task, run, section: tab });
34
35
  }
35
36
  export function chatControlHref(control, task, run, project) {
36
37
  const entry = CHAT_CONTROLS[control];
@@ -39,13 +40,13 @@ export function chatControlHref(control, task, run, project) {
39
40
  if ("href" in entry)
40
41
  return entry.href;
41
42
  if (control === "acceptance")
42
- return `/review?result=${encodeURIComponent(task)}&run=${Number.isSafeInteger(run) && Number(run) > 0 ? run : 0}&tab=checks`;
43
+ return taskLinkOf({ task, run: Number.isSafeInteger(run) && Number(run) > 0 ? Number(run) : null, section: "checks", anchor: "result-decision" });
43
44
  if (control === "result" && Number.isSafeInteger(run) && Number(run) > 0)
44
45
  return chatResultHref(task, Number(run));
45
46
  const base = "/chat?task=" + encodeURIComponent(task);
46
47
  if (control === "cancel" || control === "recovery" || control === "publish")
47
- return "/t/" + encodeURIComponent(task);
48
+ return taskLinkOf({ task });
48
49
  if (control === "findings")
49
- return `/t/${encodeURIComponent(task)}#findings`;
50
+ return taskLinkOf({ task, anchor: "findings" });
50
51
  return base + (control === "approval" || control === "planning" ? "#task-chat-action" : "");
51
52
  }
@@ -683,7 +683,7 @@ export function applyDecideTap(store, seat, input) {
683
683
  }
684
684
  if (row.act === "not-now") {
685
685
  spend();
686
- return { ack: "Okay, it waits.", edit: { text: `${body}\n\nNot now. It waits for you in Tasks.`,
686
+ return { ack: "Okay, it waits.", edit: { text: `${body}\n\nNot now. It waits for you in Work.`,
687
687
  rows: [[{ label: DECIDE_LABELS.edit, link: { label: DECIDE_LABELS.edit, path: chatControlHref("approval", row.taskId) } }]], tokens: [] } };
688
688
  }
689
689
  if (row.act === "approve" && row.digest.startsWith(RELEASE_DIGEST)) {
@@ -84,7 +84,7 @@ export function quietCardView(store, taskRefs, now, root, viewer) {
84
84
  const heading = `${lines.length} tasks`;
85
85
  const projects = [...new Set(lines.map(one => projectLabel(one.project)))];
86
86
  const text = [heading, ...lines.map(one => `${one.icon} ${phoneText(one.title, 60)} · ${one.status}`), "", projects.join(", ")].join("\n");
87
- return { text, entities: [{ type: "bold", offset: 0, length: heading.length }], link: { label: "Open tasks", path: "/tasks" } };
87
+ return { text, entities: [{ type: "bold", offset: 0, length: heading.length }], link: { label: "Open Work", path: "/" } };
88
88
  }
89
89
  const OWN_MESSAGE_KINDS = new Set(["security-release", "secret-detected", "flow-decision", "flow-card", "acceptance-ready", "acceptance-evidence", YOUIYOUX_CARD_KIND]);
90
90
  export function joinsBatch(row) {
@@ -147,7 +147,7 @@ export function finishedView(store, batch, now, root, viewer) {
147
147
  return null;
148
148
  const text = batchLine(lines.map(one => one.fact));
149
149
  if (lines.length > 1)
150
- return { text, entities: [], link: { label: "Open", path: "/tasks" } };
150
+ return { text, entities: [], link: { label: "Open", path: "/" } };
151
151
  const target = lines[0].target ?? null;
152
152
  return { text, entities: [], link: lines[0].link, ...(lines[0].also.length === 0 ? {} : { also: lines[0].also }), ...(target === null ? {} : { target }) };
153
153
  }
@@ -207,7 +207,7 @@ export function enqueueEveningDigests(store, now, root) {
207
207
  if (body === null)
208
208
  return;
209
209
  if (store.enqueueNotification({ dedupeKey: `digest:evening:${person.account}:${day}`, kind: "evening-digest", subject: "Evening digest", body,
210
- link: "/tasks", source: { installation: true }, recipient: person.account }, now))
210
+ link: "/", source: { installation: true }, recipient: person.account }, now))
211
211
  queued++;
212
212
  });
213
213
  }
@@ -136,11 +136,11 @@ export function chatText(text, tasks = []) {
136
136
  return out;
137
137
  }
138
138
  export function factLinkLabel(path) {
139
- if (/^\/review\?result=[^&]+&run=\d+&tab=checks$/.test(path))
139
+ if (/^\/review\?result=[^&]+&run=\d+&tab=checks$/.test(path) || /^\/t\/[^?#]+\?tab=result&run=\d+&section=checks#result-decision$/.test(path))
140
140
  return "Inspect result";
141
141
  if (/^\/t\/[^?#]+#merge$/.test(path))
142
142
  return "Merge";
143
- if (/^\/chat\?task=[^&]+&result=/.test(path))
143
+ if (/^\/chat\?task=[^&]+&result=/.test(path) || /^\/t\/[^?#]+\?tab=result\b/.test(path))
144
144
  return "Open result";
145
145
  if (/^\/(?:chat\?task=|t\/)/.test(path))
146
146
  return "Open task";
package/dist/cli-help.js CHANGED
@@ -1,17 +1,16 @@
1
1
  import { DEFAULT_MAX_DEPTH } from "./scan.js";
2
- export const HELP = `toolroll — hand coding work to agents, approve each plan, accept what comes back Ready
3
-
4
- toolroll start Toolroll here and open it in this terminal (--web: in the browser)
5
- In it: n new task · a approve its plan · c accept a Ready result
6
- b send it back · Enter open a task · ? every key
7
- toolroll repos add <folder> add a project (in a repository, \`toolroll\` adds that one)
8
- toolroll demo try it first: sample tasks, no model calls, no cost
9
- toolroll update update to the latest release (shows what changes first)
10
-
11
- toolroll task add "<what should change>" add a task from a shell; approve its plan in Toolroll
12
- toolroll task show <id> where a task is, and its result once it's Ready
13
-
14
- More: toolroll task --help (every task command) · toolroll internals (everything else)`;
2
+ export const HELP = `Toolroll — your agents build. You decide.
3
+
4
+ toolroll start here, in this terminal (--web: in the browser)
5
+ keys: n new task · a approve · c accept · b send back · ? all
6
+ toolroll demo try it first: sample tasks, no model calls, no cost
7
+ toolroll repos add <folder> add another project
8
+ toolroll task add "<change>" --repo .
9
+ add a task to this project from a shell
10
+ toolroll task show <id> where a task is, and its result once it's Ready
11
+ toolroll update update to the latest release
12
+
13
+ More: toolroll task --help · toolroll internals (everything else)`;
15
14
  export const SCAN_HELP = `toolroll scan [path...] — report what is in flight below a folder
16
15
 
17
16
  toolroll scan [path...] report what is in flight (also bare \`toolroll\` outside a repository)
package/dist/cli.js CHANGED
@@ -612,7 +612,8 @@ async function addToRepos(admission, targets, write, said, remoteUrl) {
612
612
  }
613
613
  projects.push({ repo: admitted.repo, name: admitted.name, added: admitted.added, remoteUrl: admitted.remote.url });
614
614
  write(addedWords(admitted.name, admitted.added, running));
615
- write(`Recorded remote: ${admitted.remote.url ?? "None. Use repos add <project> --remote <url> to record one."}`);
615
+ if (admitted.remote.url !== null)
616
+ write(`Remote: ${admitted.remote.url}`);
616
617
  }
617
618
  said.projects = projects;
618
619
  return 0;
@@ -1189,7 +1190,7 @@ async function runDemoCommand(argv, write, seams = {}) {
1189
1190
  write(envelopeJson({ ok: true, command: "demo", url, sandbox, login: { name: seed.login.name, passwordFile }, keep }));
1190
1191
  }
1191
1192
  else {
1192
- write("Demo sandbox is up. A scripted lead answers Chat: no model, no key, no spend, nothing leaves this machine.");
1193
+ write("Demo sandbox is up. Chat answers from a script: no model, no key, no cost, nothing leaves this machine.");
1193
1194
  write("");
1194
1195
  write(` open ${url}`);
1195
1196
  write(` login ${seed.login.name} / ${seed.login.password}`);
@@ -1232,7 +1233,7 @@ async function runDemoCommand(argv, write, seams = {}) {
1232
1233
  }
1233
1234
  else if (!json) {
1234
1235
  write(`Sandbox kept at ${sandbox} — reopen it any time: toolroll serve --db ${join(sandbox, "orders.db")}`);
1235
- write("Ready for your own repository? `toolroll up --repo <path>` starts the real thing.");
1236
+ write("For your own project, run `toolroll` in its folder.");
1236
1237
  }
1237
1238
  return 0;
1238
1239
  }
@@ -2,6 +2,7 @@ import { createHash } from "node:crypto";
2
2
  import { NO_COUNTS, projectStates, STATE_WORDS } from "./agent-state.js";
3
3
  import { boundProjectSummary } from "./browser-workspace.js";
4
4
  import { WORK_INDEX_MAX_LIMIT, workIndexPage } from "./work-index.js";
5
+ import { workReadsOf } from "./work-reads.js";
5
6
  const RAIL_TASKS = 6;
6
7
  const ASKS_PER_PROJECT = 100;
7
8
  export function projectSummaryOf(store, now, access, actor, projects, evidenceRoot) {
@@ -21,10 +22,16 @@ export function projectSummaryOf(store, now, access, actor, projects, evidenceRo
21
22
  ...(state?.families ?? []).flatMap(one => one.ask === undefined ? [] : [{ at: one.ask.at, ask: { key: keyOf("task", one.rootId, one.ask.version), task: one.rootId, run: one.ask.run, at: one.ask.at } }]),
22
23
  ...(state?.flowAsks ?? []).map(one => ({ at: one.at, ask: { key: keyOf("flow", one.card, one.stage, one.entry), task: null, run: null, at: one.at } })),
23
24
  ].sort((a, b) => b.at.localeCompare(a.at)).slice(0, ASKS_PER_PROJECT).map(one => one.ask);
25
+ const reads = workReadsOf(store), reader = reads?.store ?? store;
26
+ if (reads !== null) {
27
+ const ids = [...new Set([...states.values()].flatMap(one => one.families.slice(0, RAIL_TASKS).map(family => family.rootId)))];
28
+ const found = new Map(store.handle.prepare("SELECT * FROM task WHERE id IN (SELECT value FROM json_each(?))").all(JSON.stringify(ids)).map(row => [String(row["id"]), row]));
29
+ reads.seed("SELECT * FROM task WHERE id = ?", "get", ids.map(id => [[id], found.get(id)]));
30
+ }
24
31
  const railOf = (state) => {
25
32
  const families = state?.families ?? [];
26
33
  const tasks = families.slice(0, RAIL_TASKS).flatMap((one) => {
27
- const task = store.getTask(one.rootId);
34
+ const task = reader.getTask(one.rootId);
28
35
  const line = one.state === "needs-you" || one.state === "failed" ? needWords.get(one.rootId) ?? null : one.line;
29
36
  return task === null ? [] : [{ id: one.rootId, title: task.title, href: `/t/${encodeURIComponent(one.rootId)}`, state: one.state, line: line ?? STATE_WORDS[one.state] }];
30
37
  });
@@ -32,11 +39,11 @@ export function projectSummaryOf(store, now, access, actor, projects, evidenceRo
32
39
  };
33
40
  const rows = projects.map(one => {
34
41
  const state = states.get(one.path);
35
- return { path: one.path, name: one.name, href: `/tasks?project=${encodeURIComponent(one.path)}`, state: state?.state ?? "idle", counts: state?.counts ?? { ...NO_COUNTS }, ...railOf(state) };
42
+ return { path: one.path, name: one.name, href: `/?project=${encodeURIComponent(one.path)}`, state: state?.state ?? "idle", counts: state?.counts ?? { ...NO_COUNTS }, ...railOf(state) };
36
43
  });
37
44
  const unplaced = states.get(null);
38
45
  if (unplaced !== undefined && unplaced.state !== "idle")
39
- rows.push({ path: null, name: "No project", href: "/tasks", state: unplaced.state, counts: unplaced.counts, ...railOf(unplaced) });
46
+ rows.push({ path: null, name: "No project", href: "/", state: unplaced.state, counts: unplaced.counts, ...railOf(unplaced) });
40
47
  return boundProjectSummary(rows);
41
48
  }
42
49
  export function accessKey(access) {
@@ -50,6 +50,7 @@ export const CONSOLE_FORMS = {
50
50
  passwordless: formContract("POST /settings/passwordless", ["action", "password"]),
51
51
  localModeOff: formContract("POST /settings/local-mode/off", ["password"]),
52
52
  releaseApproval: formContract("POST /settings/release-approval", ["repo", "action", "password"]),
53
+ projectFlexible: formContract("POST /settings/project/flexible", ["repo", "action", "max", "digest", "password"]),
53
54
  term: formContract("POST /term/start, /term/<terminal>/close, /term/<terminal>/remove", ["repo", "program", "password"]),
54
55
  skillsRevise: formContract("POST /settings/skills/revise", ["run", "repo", "feedback", "nonce"]),
55
56
  skillsChange: formContract("POST /settings/skills/import, /settings/skills/change", ["repo", "identity", "revision", "method", "content", "files", "url", "action", "sha", "sample", "nonce", "restore"]),
@@ -126,7 +127,7 @@ export const CONSOLE_FORMS = {
126
127
  releaseGoOn: formContract("POST /t/<id>/release/go-on", ["password"]),
127
128
  tasksAdd: formContract("POST /tasks/add", ["projectRevision", "plain", "from", "from-head", "from-read", "id", "title", "repo", "goal", "not", "touches", "scout", "permission-mode", "quality-mode", "after", "acceptance", "planning-policy", "plan-first"]),
128
129
  queue: formContract("POST /queue/move, /queue/note", ["runner", "note", "from", "projectRevision", "respond", "task", "column", "before", "queueRevision"]),
129
- runnerRegister: formContract("POST /fleet/runner/register", ["token", "name", "capacity"]),
130
+ runnerRegister: formContract("POST /fleet/runner/register", ["token", "name", "capacity", "nonce"]),
130
131
  mode: formContract("POST /mode/confirm, /mode/sign", ["name", "days", "auto-approve", "plan-auto", "chat-approve", "publication", "expiry", "nonce", "digest", "token", "review-auto", "review-retry-auto", "repair-auto"]),
131
132
  peopleProjects: formContract("POST /people/projects", ["token", "name", "access", "projects"]),
132
133
  peopleInvite: formContract("POST /people/invite", ["token", "role", "access", "projects"]),
@@ -163,7 +164,7 @@ export const CONSOLE_FORMS = {
163
164
  chatAck: formContract("POST /chat/ack/<id>", ["token", "nonce"]),
164
165
  recipes: formContract("POST /recipes/prepare, /recipes/preview, /recipes/import, /recipes/launch, /recipes/save", ["repo", "projectRevision", "recipe", "recipeRevision", "document", "purpose", "source", "sourceRevision", "preview", "next"]),
165
166
  runNote: formContract("POST /r/<run>/note", ["note"]),
166
- diffComment: formContract("POST /r/<run>/comment", ["return", "tab", "intent", "batch", "source", "note", "path", "line", "request", "image", "comment"]),
167
+ diffComment: formContract("POST /r/<run>/comment", ["return", "tab", "intent", "batch", "source", "context", "note", "path", "line", "request", "image", "comment"]),
167
168
  editorLinks: formContract("POST /session/editor-links", ["on", "return"]),
168
169
  revise: formContract("POST /r/<run>/revise", ["return", "batch", "source"]),
169
170
  followUp: formContract("POST /r/<run>/checks|add-tests", ["return", "level"]),
@@ -178,7 +179,7 @@ export const CONSOLE_FORMS = {
178
179
  taskRepairDependency: formContract("POST /t/<task>/repair-dependency", ["blocker", "operation", "replacement"]),
179
180
  taskNext: formContract("POST /t/<task>/next", ["undo"]),
180
181
  taskReopen: formContract("POST /t/<task>/reopen", ["token"]),
181
- taskRequeue: formContract("POST /t/<task>/requeue", ["note", "return", "run", "digest"]),
182
+ taskRequeue: formContract("POST /t/<task>/requeue", ["context", "note", "return", "run", "digest"]),
182
183
  taskPlan: formContract("POST /t/<task>/plan", ["source"]),
183
184
  taskFollowUp: formContract("POST /t/<task>/follow-up", ["index"]),
184
185
  taskPlanEdit: formContract("POST /t/<task>/plan-edit", ["saw-plan", "plan-document"]),
@@ -28,6 +28,10 @@ export const handoffSchema = versioned(HANDOFF_VERSION, {
28
28
  changes: z.array(z.string()).optional(),
29
29
  verification: z.array(z.string()).optional(),
30
30
  followUps: z.array(z.string()).optional(),
31
+ decisions: z.array(z.string()).optional(),
32
+ assumptions: z.array(z.string()).optional(),
33
+ notDone: z.array(z.string()).optional(),
34
+ risks: z.array(z.string()).optional(),
31
35
  freshness: z.strictObject({
32
36
  stampedAt: z.string(),
33
37
  currentAsOf: z.string(),
package/dist/decision.js CHANGED
@@ -154,6 +154,8 @@ export const HANDOFF_CONCLUSION_CAP = 600;
154
154
  export const HANDOFF_PAYLOAD_CAP = 16 * 1024;
155
155
  export const HANDOFF_LIST_CAP = 8;
156
156
  export const HANDOFF_ITEM_CAP = 240;
157
+ export const HANDOFF_REPORT_CAP = 5;
158
+ export const HANDOFF_REPORT_FIELDS = ["decisions", "assumptions", "notDone", "risks"];
157
159
  function compactHandoffText(value, cap) {
158
160
  const clean = value.replace(/\s+/g, " ").trim();
159
161
  if (clean.length <= cap)
@@ -173,6 +175,17 @@ function handoffList(value) {
173
175
  .slice(0, HANDOFF_LIST_CAP)
174
176
  .map(one => compactHandoffText(one, HANDOFF_ITEM_CAP));
175
177
  }
178
+ export function handoffReportList(value) {
179
+ if (!Array.isArray(value))
180
+ return [];
181
+ return value
182
+ .filter((one) => typeof one === "string" && one.trim() !== "" && !hasDisguisedText(one))
183
+ .slice(0, HANDOFF_REPORT_CAP)
184
+ .map(one => compactHandoffText(one, HANDOFF_ITEM_CAP));
185
+ }
186
+ export function handoffReportOf(handoff) {
187
+ return Object.fromEntries(HANDOFF_REPORT_FIELDS.filter(field => handoff[field].length > 0).map(field => [field, [...handoff[field]]]));
188
+ }
176
189
  export function parseHandoff(raw) {
177
190
  if (Buffer.byteLength(raw, "utf8") > HANDOFF_PAYLOAD_CAP) {
178
191
  return { ok: false, problems: [{ reason: "too-large", message: `the handoff is over ${HANDOFF_PAYLOAD_CAP} bytes` }] };
@@ -226,6 +239,10 @@ export function parseHandoff(raw) {
226
239
  changes: handoffList(body["changes"]),
227
240
  verification: handoffList(body["verification"]),
228
241
  followUps: handoffList(body["followUps"]),
242
+ decisions: handoffReportList(body["decisions"]),
243
+ assumptions: handoffReportList(body["assumptions"]),
244
+ notDone: handoffReportList(body["notDone"]),
245
+ risks: handoffReportList(body["risks"]),
229
246
  },
230
247
  };
231
248
  }
package/dist/demo-chat.js CHANGED
@@ -39,7 +39,7 @@ function resultCard(exchange, result) {
39
39
  const summary = html `${result.files} file${result.files === 1 ? "" : "s"} changed · +${result.additions} −${result.deletions} · <span class="${passed ? "demo-pass" : "demo-fail"}">${result.checks.detail}</span>`;
40
40
  const actions = exchange.state === "ready"
41
41
  ? html `<div class="demo-actions">${postForm(`/chat/demo/${exchange.id}/complete`, html `<button type="submit" class="demo-primary">Complete</button>`)}<details class="demo-more"><summary>Request changes</summary>${postForm(`/chat/demo/${exchange.id}/revise`, html `<label for="demo-revise-${exchange.id}">What should change?</label><textarea id="demo-revise-${exchange.id}" name="note" rows="2" maxlength="500" required></textarea><button type="submit">Send back</button>`)}</details></div>`
42
- : html `<p class="meta"><a href="${result.taskHref}">Open in Tasks</a></p>`;
42
+ : html `<p class="meta"><a href="${result.taskHref}">Open the task</a></p>`;
43
43
  return html `<section class="card demo-result" id="demo-${exchange.id}-work" aria-label="Result"><p class="demo-state">${status}<span class="meta">${exchange.plan.project}</span></p><h2>${exchange.plan.title}</h2><p>${exchange.plan.conclusion}</p><p class="meta">${summary}</p>${actions}${result.diff === null ? "" : html `<details class="demo-evidence"${exchange.state === "ready" ? html ` open` : ""}><summary>Changes</summary><pre class="demo-diff">${diffHtml(result.diff)}</pre></details>`}${result.checkLog === null ? "" : html `<details class="demo-evidence"><summary>Check log</summary><pre class="demo-log">${result.checkLog}</pre></details>`}${result.screenshot === null ? "" : html `<details class="demo-evidence"><summary>Screenshot</summary><figure><img src="${result.screenshot.href}" alt="${result.screenshot.caption}" width="960" height="600"><figcaption class="meta">${result.screenshot.caption}</figcaption></figure></details>`}</section>`;
44
44
  }
45
45
  export function demoThreadHtml(exchanges, resultOf) {
package/dist/demo.js CHANGED
@@ -74,6 +74,9 @@ const DEMO_HANDOFF = {
74
74
  ],
75
75
  verification: ["All 214 tests pass, including the new rounding boundary cases."],
76
76
  followUps: [],
77
+ decisions: ["Rounded each line at cent precision in settle(), not when the total is displayed."],
78
+ assumptions: ["The ledger fixtures cover every currency payouts are made in."],
79
+ risks: ["Totals for settlements already paid at the old precision are not recalculated."],
77
80
  decisionsIncorporated: [],
78
81
  };
79
82
  const DEMO_FAILED_PATCH = `diff --git a/src/payout.ts b/src/payout.ts
@@ -169,6 +172,9 @@ const DEMO_COPY_HANDOFF = {
169
172
  changes: ["Replaced the empty-state body copy in src/inbox-copy.ts."],
170
173
  verification: ["Opened the inbox pane with zero items and read the new copy."],
171
174
  followUps: [],
175
+ decisions: ["Kept the copy to one sentence and a link to filters, with no illustration."],
176
+ assumptions: ["An empty inbox usually means a filter is on, not that there is no mail."],
177
+ notDone: ["The copy is English only; the other locales still show the old line."],
172
178
  decisionsIncorporated: [],
173
179
  };
174
180
  const DEMO_COPY_PROOF = {
@@ -130,23 +130,24 @@ export const KIT_ICONS = {
130
130
  list: [path("M8 6h13"), path("M8 12h13"), path("M8 18h13"), path("M3 6h.01"), path("M3 12h.01"), path("M3 18h.01")],
131
131
  board: [["rect", { x: 3, y: 3, width: 18, height: 18, rx: 2 }], path("M9 3v18"), path("M15 3v18")],
132
132
  panel: [["rect", { x: 3, y: 3, width: 18, height: 18, rx: 2 }], path("M15 3v18")],
133
+ server: [["rect", { x: 2, y: 2, width: 20, height: 8, rx: 2 }], ["rect", { x: 2, y: 14, width: 20, height: 8, rx: 2 }], path("M6 6h.01"), path("M6 18h.01")],
133
134
  };
134
135
  export const SETTINGS_GROUPS = [
135
136
  ["General", "general", "/settings/general"],
136
137
  ["Agents and models", "agents", "/settings/agents"],
138
+ ["Computers", "computers", "/settings/computers"],
137
139
  ["Chat apps and alerts", "alerts", "/settings/alerts"],
138
140
  ["Approvals and safety", "approval", "/settings/approval"],
139
141
  ["Projects", "projects", "/settings/projects"],
140
142
  ["People and sign-in", "access", "/settings/access"],
141
143
  ["Spend", "spend", "/spend"],
142
144
  ["System", "system", "/settings/system"],
143
- ["Advanced", "advanced", "/settings/advanced"],
144
145
  ];
145
146
  export const SETTINGS_GROUP_ICONS = {
146
- general: "sun", agents: "cpu", alerts: "bell", approval: "shield", projects: "folder", access: "people", spend: "coin", system: "monitor", advanced: "settings",
147
+ general: "sun", agents: "cpu", computers: "server", alerts: "bell", approval: "shield", projects: "folder", access: "people", spend: "coin", system: "monitor",
147
148
  };
148
149
  export const needsWords = (n) => n === 1 ? "1 item needs you" : `${n} items need you`;
149
150
  export const NOT_FOUND = {
150
151
  title: (path) => `There’s no page at ${path}.`,
151
- text: "It may have moved. Home has what needs you; Tasks has every task.",
152
+ text: "It may have moved. Work has every task and what needs you.",
152
153
  };
package/dist/dispatch.js CHANGED
@@ -253,7 +253,7 @@ export function diagnoseTaskDispatch(store, taskId, now, readableRepos = null) {
253
253
  const role = dispatchRoleFor(store, ref.id, now);
254
254
  const scope = store.getScope(taskId);
255
255
  if (ref.repo === null)
256
- return answer("needs-project", "waiting", "Needs a project", "Choose a project for this task so a builder can start it.", { action: "place-task", role });
256
+ return answer("needs-project", "waiting", "Needs a project", "Choose a project for this task so it can start.", { action: "place-task", role });
257
257
  if (role !== "planner") {
258
258
  if (scope === null)
259
259
  return answer("needs-scope", "waiting", "Needs a plan", "Write the plan, or ask the planner to draft it.", { action: "write-scope", role });
@@ -321,7 +321,7 @@ export function withDispatchDiagnoses(store, snapshot, now) {
321
321
  tasks: snapshot.tasks.map(one => ({ ...one, dispatch: diagnoseTaskDispatch(store, one.id, now) })),
322
322
  };
323
323
  }
324
- export function retryWhenWords(until, now) {
324
+ export function retryWhenWords(until, now, zone = viewerZone()) {
325
325
  const ms = Date.parse(until) - now.getTime();
326
326
  if (Number.isNaN(ms))
327
327
  return "soon";
@@ -330,12 +330,7 @@ export function retryWhenWords(until, now) {
330
330
  const minutes = Math.ceil(ms / 60_000);
331
331
  if (minutes < 60)
332
332
  return `in ${minutes} minutes`;
333
- const at = shortWhen(until, now, "UTC", true);
334
- if (/^\d/.test(at))
335
- return `at ${at} UTC`;
336
- if (at.startsWith("Tomorrow "))
337
- return `tomorrow at ${at.slice("Tomorrow ".length)} UTC`;
338
- return `on ${at} UTC`;
333
+ return resetWhenWords(until, now, zone);
339
334
  }
340
335
  export const NO_AGENT_TITLE = "No coding agent is signed in";
341
336
  export const noAgentWords = (command, modelsCleared = false) => modelsCleared
@@ -0,0 +1 @@
1
+ export const FLEXIBLE_AVAILABLE = false;
@@ -0,0 +1,32 @@
1
+ export const V161_SCHEMA = `
2
+ CREATE TABLE IF NOT EXISTS flexible_terms (
3
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
4
+ repo TEXT NOT NULL,
5
+ terms_json TEXT NOT NULL CHECK (length(terms_json) <= 16384),
6
+ digest TEXT NOT NULL,
7
+ signed_terms_json TEXT NOT NULL CHECK (length(signed_terms_json) <= 16384),
8
+ signed_digest TEXT NOT NULL,
9
+ signed_by TEXT NOT NULL,
10
+ signed_at TEXT NOT NULL,
11
+ proof TEXT NOT NULL CHECK (proof IN ('password-now', 'sso-now')),
12
+ changed_by TEXT NOT NULL,
13
+ changed_at TEXT NOT NULL,
14
+ derived_from INTEGER,
15
+ ended_at TEXT,
16
+ ended_by TEXT,
17
+ end_reason TEXT CHECK (end_reason IS NULL OR end_reason IN ('off', 'lowered', 'replaced', 'lapsed')),
18
+ end_detail TEXT,
19
+ CHECK ((ended_at IS NULL) = (end_reason IS NULL) AND (ended_at IS NULL) = (ended_by IS NULL))
20
+ );
21
+ CREATE UNIQUE INDEX IF NOT EXISTS flexible_terms_live ON flexible_terms (repo) WHERE ended_at IS NULL;
22
+ CREATE TRIGGER IF NOT EXISTS flexible_terms_written_once BEFORE UPDATE ON flexible_terms
23
+ WHEN OLD.ended_at IS NOT NULL OR NEW.repo IS NOT OLD.repo OR NEW.terms_json IS NOT OLD.terms_json OR NEW.digest IS NOT OLD.digest
24
+ OR NEW.signed_terms_json IS NOT OLD.signed_terms_json OR NEW.signed_digest IS NOT OLD.signed_digest OR NEW.signed_by IS NOT OLD.signed_by
25
+ OR NEW.signed_at IS NOT OLD.signed_at OR NEW.proof IS NOT OLD.proof OR NEW.changed_by IS NOT OLD.changed_by
26
+ OR NEW.changed_at IS NOT OLD.changed_at OR NEW.derived_from IS NOT OLD.derived_from OR NEW.id IS NOT OLD.id
27
+ BEGIN
28
+ SELECT RAISE(ABORT, 'flexible terms are written once and end once');
29
+ END;
30
+ `;
31
+ export const V161_TABLES = Object.freeze(["flexible_terms"]);
32
+ export const V161_STEPS = Object.freeze(["flexible-terms"]);
@@ -0,0 +1,30 @@
1
+ export const V162_SCHEMA = `
2
+ CREATE TABLE IF NOT EXISTS flexible_thread (
3
+ id TEXT PRIMARY KEY CHECK (length(id) = 32 AND id NOT GLOB '*[^0-9a-f]*'),
4
+ repo TEXT NOT NULL,
5
+ base_sha TEXT NOT NULL CHECK (length(base_sha) IN (40, 64) AND base_sha NOT GLOB '*[^0-9a-f]*'),
6
+ keep_ref TEXT NOT NULL CHECK (keep_ref = 'refs/toolroll/threads/' || id || '/base'),
7
+ folder TEXT NOT NULL,
8
+ created_by TEXT NOT NULL,
9
+ created_at TEXT NOT NULL,
10
+ state TEXT NOT NULL CHECK (state IN ('preparing', 'ready', 'removing', 'removed', 'failed')),
11
+ ended_at TEXT,
12
+ end_detail TEXT CHECK (end_detail IS NULL OR length(end_detail) <= 2000),
13
+ live_pid INTEGER CHECK (live_pid IS NULL OR live_pid > 0),
14
+ live_since TEXT,
15
+ CHECK ((live_pid IS NULL) = (live_since IS NULL)),
16
+ CHECK ((ended_at IS NULL) = (state IN ('preparing', 'ready', 'removing')))
17
+ );
18
+ CREATE INDEX IF NOT EXISTS flexible_thread_repo ON flexible_thread (repo, state);
19
+ CREATE TRIGGER IF NOT EXISTS flexible_thread_written_once BEFORE UPDATE ON flexible_thread
20
+ WHEN NEW.id IS NOT OLD.id OR NEW.repo IS NOT OLD.repo OR NEW.base_sha IS NOT OLD.base_sha OR NEW.keep_ref IS NOT OLD.keep_ref
21
+ OR NEW.folder IS NOT OLD.folder OR NEW.created_by IS NOT OLD.created_by OR NEW.created_at IS NOT OLD.created_at
22
+ OR OLD.state IN ('removed', 'failed')
23
+ OR (OLD.state = 'removing' AND NEW.state NOT IN ('removing', 'removed', 'failed'))
24
+ OR (OLD.state = 'ready' AND NEW.state = 'preparing')
25
+ BEGIN
26
+ SELECT RAISE(ABORT, 'a flexible thread''s repository is written once and its state only moves forward');
27
+ END;
28
+ `;
29
+ export const V162_TABLES = Object.freeze(["flexible_thread"]);
30
+ export const V162_STEPS = Object.freeze(["flexible-thread"]);