toolroll 0.9.108 → 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 (187) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/advanced-view.js +0 -1
  3. package/dist/agent-detect.js +244 -0
  4. package/dist/agent-fence.js +47 -5
  5. package/dist/agent-state.js +5 -2
  6. package/dist/agentconfig.js +2 -2
  7. package/dist/approval-summary.js +344 -0
  8. package/dist/assignment-ui.js +5 -5
  9. package/dist/assignment.js +5 -2
  10. package/dist/attest.js +2 -2
  11. package/dist/browser/terminal.js +1 -1
  12. package/dist/browser/workspace.css +2 -2
  13. package/dist/browser/workspace.js +37 -34
  14. package/dist/browser-crew.js +4 -4
  15. package/dist/browser-workspace.js +4 -11
  16. package/dist/builder.js +45 -3
  17. package/dist/chat-actions.js +24 -17
  18. package/dist/chat-controls.js +6 -5
  19. package/dist/chat-core.js +3 -1
  20. package/dist/chat-decide.js +102 -47
  21. package/dist/chat-delivery-state.js +2 -0
  22. package/dist/chat-delivery.js +3 -2
  23. package/dist/chat-live.js +2 -1
  24. package/dist/chat-quiet.js +3 -3
  25. package/dist/chat-task-actions.js +6 -0
  26. package/dist/chat-voice.js +2 -2
  27. package/dist/check-report.js +1 -1
  28. package/dist/cli-help.js +12 -13
  29. package/dist/cli.js +6 -3
  30. package/dist/console-chrome.js +10 -3
  31. package/dist/console-instance.js +10 -1
  32. package/dist/contracts/console-api.js +14 -8
  33. package/dist/contracts/engine-api.js +271 -0
  34. package/dist/contracts/handoff.js +4 -0
  35. package/dist/coordinator.js +2 -2
  36. package/dist/decision.js +17 -0
  37. package/dist/demo-chat.js +1 -1
  38. package/dist/demo.js +6 -0
  39. package/dist/design/kit.js +4 -3
  40. package/dist/discord-api.js +4 -3
  41. package/dist/discord-chat.js +3 -1
  42. package/dist/dispatch.js +3 -8
  43. package/dist/easy-start-args.js +7 -3
  44. package/dist/easy-start.js +25 -0
  45. package/dist/egress.js +72 -10
  46. package/dist/engine-handoff.js +34 -0
  47. package/dist/engine-reads.js +261 -0
  48. package/dist/eval-world.js +3 -2
  49. package/dist/evidence.js +2 -0
  50. package/dist/fast-start.js +55 -14
  51. package/dist/fast-terms.js +2 -2
  52. package/dist/first-run.js +10 -2
  53. package/dist/flexible-agents.js +234 -0
  54. package/dist/flexible-answers-schema.js +61 -0
  55. package/dist/flexible-answers.js +889 -0
  56. package/dist/flexible-available.js +1 -0
  57. package/dist/flexible-custody.js +494 -0
  58. package/dist/flexible-import.js +782 -0
  59. package/dist/flexible-launch-schema.js +72 -0
  60. package/dist/flexible-launch.js +331 -0
  61. package/dist/flexible-launcher.js +88 -0
  62. package/dist/flexible-levels.js +34 -0
  63. package/dist/flexible-merge-guard.js +47 -0
  64. package/dist/flexible-refs.js +47 -0
  65. package/dist/flexible-relay-cancel.js +19 -0
  66. package/dist/flexible-relay-schema.js +55 -0
  67. package/dist/flexible-relay-upstreams.js +36 -0
  68. package/dist/flexible-relay.js +1032 -0
  69. package/dist/flexible-schema.js +32 -0
  70. package/dist/flexible-session.js +732 -0
  71. package/dist/flexible-ship-schema.js +81 -0
  72. package/dist/flexible-ship.js +694 -0
  73. package/dist/flexible-start.js +80 -0
  74. package/dist/flexible-thread-schema.js +30 -0
  75. package/dist/flexible-thread.js +676 -0
  76. package/dist/flexible-turns-schema.js +69 -0
  77. package/dist/flexible-turns.js +490 -0
  78. package/dist/flexible-ui.js +44 -0
  79. package/dist/flexible.js +368 -0
  80. package/dist/flow-actions.js +6 -4
  81. package/dist/flow-steps.js +1 -1
  82. package/dist/flows-cli.js +2 -1
  83. package/dist/git-views.js +44 -41
  84. package/dist/guides.js +11 -10
  85. package/dist/install-mode.js +225 -0
  86. package/dist/keymap.js +1 -1
  87. package/dist/lead-context.js +1 -1
  88. package/dist/lead-doors.js +7 -1
  89. package/dist/limits-ui.js +8 -1
  90. package/dist/live-bus.js +70 -13
  91. package/dist/live-reply.js +6 -0
  92. package/dist/live-terminal.js +425 -29
  93. package/dist/local-owner.js +6 -0
  94. package/dist/model-choices.js +12 -6
  95. package/dist/needs-you.js +3 -3
  96. package/dist/nightly-github.js +2 -2
  97. package/dist/notification-delivery.js +11 -0
  98. package/dist/operate.js +185 -33
  99. package/dist/outbound-privacy.js +204 -0
  100. package/dist/passwordless.js +2 -1
  101. package/dist/project-delete-ui.js +2 -1
  102. package/dist/project-delete.js +15 -0
  103. package/dist/provider-auth.js +1 -1
  104. package/dist/provider-connection.js +5 -3
  105. package/dist/publish.js +5 -0
  106. package/dist/pull-request-flow.js +26 -7
  107. package/dist/push.js +5 -1
  108. package/dist/release-card.js +11 -3
  109. package/dist/release.js +11 -1
  110. package/dist/result-actions.js +3 -0
  111. package/dist/result-evidence-readers.js +8 -2
  112. package/dist/result-review.js +20 -9
  113. package/dist/route-store.js +2 -2
  114. package/dist/sandbox-launch.js +32 -8
  115. package/dist/sandbox-runtime.js +16 -7
  116. package/dist/sandbox-tools.js +176 -0
  117. package/dist/scope.js +12 -36
  118. package/dist/scout-net.js +7 -2
  119. package/dist/serve.js +90 -40
  120. package/dist/server/chat.js +9 -9
  121. package/dist/server/chrome.js +19 -17
  122. package/dist/server/console.css +33 -6
  123. package/dist/server/engine-api.js +378 -0
  124. package/dist/server/flows.js +2 -2
  125. package/dist/server/guards.js +10 -4
  126. package/dist/server/home.js +37 -5
  127. package/dist/server/http.js +11 -2
  128. package/dist/server/in-place.js +5 -4
  129. package/dist/server/kit.js +2 -2
  130. package/dist/server/link-redemption.js +52 -0
  131. package/dist/server/live.js +100 -10
  132. package/dist/server/mutation-key.js +21 -7
  133. package/dist/server/pages.js +129 -74
  134. package/dist/server/people-tokens.js +17 -41
  135. package/dist/server/render-chat.js +2 -1
  136. package/dist/server/render-history.js +18 -4
  137. package/dist/server/render-new-task.js +4 -4
  138. package/dist/server/render-pages.js +21 -39
  139. package/dist/server/render-people.js +2 -2
  140. package/dist/server/render-projects.js +5 -5
  141. package/dist/server/render-results.js +30 -14
  142. package/dist/server/render-tasks.js +155 -155
  143. package/dist/server/retired-routes.js +37 -4
  144. package/dist/server/route-policy.js +8 -0
  145. package/dist/server/route-table.js +43 -5
  146. package/dist/server/settings-computers.js +140 -0
  147. package/dist/server/settings-scripts.js +15 -0
  148. package/dist/server/settings-section-table.js +59 -0
  149. package/dist/server/settings-sections.js +291 -0
  150. package/dist/server/settings.js +247 -28
  151. package/dist/server/task-views.js +55 -15
  152. package/dist/server/tasks.js +168 -98
  153. package/dist/server/terminals.js +181 -28
  154. package/dist/server/welcome.js +40 -14
  155. package/dist/settings-groups-ui.js +26 -107
  156. package/dist/settings-proofs.js +18 -11
  157. package/dist/slack-api.js +4 -3
  158. package/dist/slack-chat.js +5 -3
  159. package/dist/spend.js +46 -12
  160. package/dist/sqlite-telemetry.js +70 -21
  161. package/dist/status-probe.js +343 -0
  162. package/dist/store.js +206 -10
  163. package/dist/task-link.js +64 -0
  164. package/dist/teams-api.js +4 -3
  165. package/dist/teams-chat.js +4 -2
  166. package/dist/telegram-lead.js +2 -1
  167. package/dist/telegram-live.js +2 -1
  168. package/dist/telegram-team.js +2 -1
  169. package/dist/telegram.js +17 -5
  170. package/dist/trusted-path.js +162 -0
  171. package/dist/tui/darwin-arm64/toolroll-tui +0 -0
  172. package/dist/tui/darwin-x64/toolroll-tui +0 -0
  173. package/dist/tui/linux-arm64/toolroll-tui +0 -0
  174. package/dist/tui/linux-x64/toolroll-tui +0 -0
  175. package/dist/tui-launch.js +282 -0
  176. package/dist/tui-source.js +5 -3
  177. package/dist/tui.js +2 -2
  178. package/dist/typed-words-schema.js +18 -0
  179. package/dist/webhooks.js +8 -4
  180. package/dist/welcome-facts.js +25 -17
  181. package/dist/work-index.js +126 -29
  182. package/dist/work-reads.js +279 -0
  183. package/dist/workspace-ui.js +5 -0
  184. package/package.json +4 -2
  185. package/scripts/crash-canary.mjs +1 -1
  186. package/scripts/pilot.mjs +1 -1
  187. package/scripts/provider-canary.mjs +5 -3
package/dist/serve.js CHANGED
@@ -22,6 +22,9 @@ import { accessKey, countsKey, indexKey, projectSummaryOf, RevisionCache, summar
22
22
  import { usageChipOf } from './limits-ui.js';
23
23
  const BACKGROUND_CHECKS_MS = 30_000;
24
24
  const LOCAL_AGENTS_EVERY_MS = 2 * 60_000;
25
+ const LOCAL_AGENTS = ["claude", "codex"];
26
+ const SIGNED_IN_STATES = new Set(["connected", "key-works", "key-present"]);
27
+ const SIGNED_IN_HOLD_MS = 10 * 60_000;
25
28
  import { browserCrewFromIndex, browserCrewOf, browserNavigationOf, browserProjectsOf, needsYouLabelOf } from './browser-workspace.js';
26
29
  import { PAGE_WORK_HEADER, PAGE_WORK_VERSION } from './page-work-contract.js';
27
30
  import { sharedActionPayload } from './chat-actions.js';
@@ -48,7 +51,7 @@ import { createSharedGuards } from "./server/guards.js";
48
51
  import { createHandlerRegistry } from "./server/handler-registry.js";
49
52
  import {} from "./server/remote-hooks.js";
50
53
  import { createRemoteHandlers } from "./server/remote.js";
51
- import { evaluateRoutePolicy, withEdgePolicy } from "./server/route-policy.js";
54
+ import { evaluateRoutePolicy, holdsRole, routePrincipalOf, withEdgePolicy } from "./server/route-policy.js";
52
55
  import { matchRoute, ROUTES } from "./server/route-table.js";
53
56
  import { createTaskViews } from "./server/task-views.js";
54
57
  import { runActivityOf } from "./task-activity.js";
@@ -57,6 +60,8 @@ import { createTeamRuntime } from './team-runtime.js';
57
60
  import { createPersonalQueueRuntime } from './lead-queue-runtime.js';
58
61
  import {} from "./tools-ui.js";
59
62
  import { WORK_INDEX_MAX_LIMIT, workCountsByProject, workIndexPage } from "./work-index.js";
63
+ import { withWorkReads } from "./work-reads.js";
64
+ import { createEngineHandlers } from "./server/engine-api.js";
60
65
  import { WORKSPACE_MOTION_SCRIPT } from "./workspace-motion.js";
61
66
  import { prepareWorkspaceRevision, WorkspaceValidatorCache } from "./workspace-revision.js";
62
67
  import { createHash, randomBytes } from "node:crypto";
@@ -90,6 +95,9 @@ import { projectHoldings, projectRunning } from "./project-delete.js";
90
95
  import { canonicalProject, projectName, resolveCeiling, rowVisible } from "./project.js";
91
96
  import { noteSignInProbe, signInNotices } from "./provider-auth.js";
92
97
  import { createConnectionChecker } from "./provider-connection.js";
98
+ import { detectAgents } from "./agent-detect.js";
99
+ import { acpCheckedHere, firstTaskRouted } from "./welcome-facts.js";
100
+ import { BACKGROUND_STATUS_TIMEOUT_MS, givenRepos, statusProbe } from "./status-probe.js";
93
101
  import { ALL_CREDENTIAL_ENV } from "./provider.js";
94
102
  import { hstsFor, LOOPBACK_PEERS, plainHttpRefusal, requestFromThisComputer, transportOf } from "./public-access.js";
95
103
  import { attachReadExecutor, defaultReadWorkers, ReadExecutor } from "./read-executor.js";
@@ -103,7 +111,7 @@ import { instrumentRequest } from "./server-telemetry.js";
103
111
  import { createChatHandlers } from './server/chat.js';
104
112
  import { createLiveHandlers } from './server/live.js';
105
113
  import { createTerminalHandlers, terminalHostFor } from './server/terminals.js';
106
- import { passwordlessOn } from './passwordless.js';
114
+ import { declareSoloOnUpgrade, sessionStandsIn } from './install-mode.js';
107
115
  import { keepTypedFields, openProjectFor, settingsCrumbs } from './settings-kit.js';
108
116
  import { createSweepHandlers } from './server/sweeps.js';
109
117
  import { createFlowsHandlers } from './server/flows.js';
@@ -155,7 +163,7 @@ export function createDecisionServer(options) {
155
163
  get dockedConversation() { return dockedConversation; },
156
164
  get liveRefreshSeconds() { return liveRefreshSeconds; },
157
165
  });
158
- const { authenticateApprover, authenticateCredential, authorizeMutation, projectOf, projectRequestAllowed, identify, lookupSession, restricted, visible, admissionList, codingActorAllowed, codingProjectAllowed, workAccess, familyOf, taskRepoOf, runVisible } = createSharedGuards({
166
+ const { authenticateApprover, authenticateCredential, authorizeMutation, projectOf, projectRequestAllowed, identify, lookupSession, restricted, visible, visibleNow, admissionList, codingActorAllowed, codingProjectAllowed, workAccess, familyOf, taskRepoOf, runVisible } = createSharedGuards({
159
167
  get store() { return store; },
160
168
  get liveCeiling() { return liveCeiling; },
161
169
  identities,
@@ -174,6 +182,7 @@ export function createDecisionServer(options) {
174
182
  get browserKeys() { return browserKeys; },
175
183
  });
176
184
  const { store, evidenceRoot } = options;
185
+ declareSoloOnUpgrade(store, new Date());
177
186
  let coding = options.codingWorkspace ?? null;
178
187
  let codingProblem;
179
188
  if (coding === null && options.localRunner !== undefined && !store.isDemo()) {
@@ -223,7 +232,8 @@ export function createDecisionServer(options) {
223
232
  const workspaceIncarnation = randomBytes(16).toString('hex');
224
233
  const workspaceValidators = new WorkspaceValidatorCache();
225
234
  const providerHome = options.connectionHome ?? homedir();
226
- const checkConnection = createConnectionChecker({ home: providerHome, clock, ...(options.connectionProbe === undefined ? {} : { probe: options.connectionProbe }) });
235
+ const checkConnection = createConnectionChecker({ home: providerHome, clock,
236
+ probe: options.connectionProbe ?? statusProbe({ store, untrusted: givenRepos(options), timeoutMs: BACKGROUND_STATUS_TIMEOUT_MS }) });
227
237
  const fenceHere = options.fenceAvailable === undefined ? macosFenceAvailable() || linuxFenceAvailable() : false;
228
238
  if (options.telegramTokenFile !== undefined) {
229
239
  try {
@@ -373,10 +383,10 @@ export function createDecisionServer(options) {
373
383
  const managedRepos = () => {
374
384
  const seen = new Set();
375
385
  const repos = [];
376
- const gone = goneRepos();
386
+ const gone = goneRepos(), shown = visibleNow();
377
387
  for (const path of [...exactRepos(), ...(options.currentRepos?.() ?? [])]) {
378
388
  const canonical = identities.hot(path);
379
- if (seen.has(canonical) || !visible(canonical) || gone.has(canonical))
389
+ if (seen.has(canonical) || !shown(canonical) || gone.has(canonical))
380
390
  continue;
381
391
  seen.add(canonical);
382
392
  repos.push(canonical);
@@ -523,8 +533,8 @@ export function createDecisionServer(options) {
523
533
  return presentsPassword(request) ? passwordAccountBudget.admit(actor.name) : { ok: true };
524
534
  };
525
535
  const consoleProjects = () => {
526
- const gone = goneRepos();
527
- return [...new Set([...(admissionList() ?? []), ...managedRepos(), ...store.knownRepos()])].filter(one => visible(one) && !gone.has(one));
536
+ const gone = goneRepos(), shown = visibleNow();
537
+ return [...new Set([...(admissionList() ?? []), ...managedRepos(), ...store.knownRepos()])].filter(one => shown(one) && !gone.has(one));
528
538
  };
529
539
  const server = createServer((request, response) => {
530
540
  instrumentRequest(store.telemetry, request, response);
@@ -585,7 +595,7 @@ export function createDecisionServer(options) {
585
595
  const flushBudget = () => { try {
586
596
  requestBudget.flush();
587
597
  }
588
- catch { } };
598
+ catch { } engineHandlers.upkeep(); };
589
599
  const timer = setInterval(flushBudget, REQUEST_BUDGET_FLUSH_MS);
590
600
  timer.unref?.();
591
601
  server.on("close", () => { clearInterval(timer); flushBudget(); });
@@ -612,6 +622,7 @@ export function createDecisionServer(options) {
612
622
  return null;
613
623
  return address.address === "127.0.0.1" ? `127.0.0.1:${port}` : address.address === "::1" ? `[::1]:${port}` : null;
614
624
  },
625
+ servedPort,
615
626
  });
616
627
  const consoleCommand = (change) => {
617
628
  const port = servedPort() ?? 4180;
@@ -640,11 +651,14 @@ export function createDecisionServer(options) {
640
651
  const held = approvalNonces.get(nonce);
641
652
  if (held === undefined)
642
653
  return false;
654
+ if (held.expiresAt < Date.now()) {
655
+ approvalNonces.delete(nonce);
656
+ return false;
657
+ }
658
+ if (held.name !== name || held.taskId !== taskId || held.digest !== digest)
659
+ return false;
643
660
  approvalNonces.delete(nonce);
644
- return (held.name === name &&
645
- held.taskId === taskId &&
646
- held.digest === digest &&
647
- held.expiresAt >= Date.now());
661
+ return true;
648
662
  }
649
663
  const hookContext = { store, clock, options };
650
664
  async function handle(request, response) {
@@ -700,7 +714,8 @@ export function createDecisionServer(options) {
700
714
  const workspaceRead = method === "GET" && url.searchParams.get('format') === 'workspace';
701
715
  const purpose = workspaceRead ? readPurpose(request.headers['x-toolroll-read']) : 'poll';
702
716
  const noTouch = edgeRoute?.domain === 'live' || (fragmentName !== null && NO_TOUCH_FRAGMENTS.has(fragmentName)) || /^\/code\/[a-f0-9]{32}\/state$/.test(url.pathname) || url.pathname === '/term/state'
703
- || url.pathname === '/agents/live' || /^\/agents\/live\/[0-9]{1,15}$/.test(url.pathname) || (url.pathname === '/agents' && url.searchParams.get('view') === 'live');
717
+ || url.pathname === '/agents/live' || /^\/agents\/live\/[0-9]{1,15}$/.test(url.pathname) || (url.pathname === '/agents' && url.searchParams.get('view') === 'live')
718
+ || /^\/agents\/live\/(?:run\/[0-9]{1,15}|thread\/[0-9a-f]{32})$/.test(url.pathname);
704
719
  const touch = !(method === "GET" && (noTouch || (workspaceRead && purpose !== 'navigate')));
705
720
  if (purpose === 'prefetch' && (request.headers.authorization !== undefined || !prefetchRoute(matchedRoute?.id, url))) {
706
721
  request.resume();
@@ -759,7 +774,7 @@ export function createDecisionServer(options) {
759
774
  returnTo: safeReturn(url.pathname + url.search),
760
775
  appOrigins: [consoleOrigin(request.headers.host), publicOrigin?.origin ?? null, options.configDir === undefined ? null : loadConsoleUrl(process.env, options.configDir)],
761
776
  browser: who.via === 'cookie',
762
- passwordless: who.via === 'cookie' && passwordlessOn(store),
777
+ passwordless: who.via === 'cookie' && who.authority !== 'local-owner' && sessionStandsIn(store),
763
778
  advanced: advancedShownFor(store, who.name),
764
779
  openProject: who.via === 'cookie' ? who.session.project : null,
765
780
  sso: who.via === 'cookie' && who.session.sso !== undefined ? { label: ssoSettings()?.label ?? "your identity provider",
@@ -777,6 +792,7 @@ export function createDecisionServer(options) {
777
792
  ...(who.via === "cookie" && who.authority === "local-owner" && store.accountOf(who.name)?.passwordSet === false
778
793
  ? { localStepUp: localOwnerRefusal(false, method === "GET" ? passwordSetNext(pagePathOf(url)) : "/").href } : {}),
779
794
  reconnect: browserKeys.stale(who, method === "GET" ? safeReturn(pagePathOf(url)) : "/"),
795
+ ...(method === "POST" && who.via === "cookie" && request.headers["x-toolroll-act"] === "in-place" && request.headers["x-toolroll-client"] === "terminal" ? { terminalAct: true } : {}),
780
796
  };
781
797
  if (purpose !== 'prefetch')
782
798
  response.once("finish", () => keepSlowRequest(store, timeline, matchedRoute?.id ?? "unmatched", response.statusCode, clock()));
@@ -796,7 +812,7 @@ export function createDecisionServer(options) {
796
812
  request.resume();
797
813
  return refuseLocalOwner(response, who, method, url, request.headers.accept);
798
814
  }
799
- const policy = evaluateRoutePolicy(route, { caller: who.via, capability: who.via === "bearer" && who.principal !== undefined ? who.principal.scope : who.role === "approver" ? "act" : "read", viewer: who.role === "viewer", token: who.via === "bearer" && who.principal !== undefined }, source => projectRequestAllowed(route, source, url, who, request, response, body));
815
+ const policy = evaluateRoutePolicy(route, routePrincipalOf(who), source => projectRequestAllowed(route, source, url, who, request, response, body));
800
816
  if (!policy.ok) {
801
817
  if (policy.reason === "project")
802
818
  return;
@@ -836,7 +852,7 @@ export function createDecisionServer(options) {
836
852
  if (!projectRequestAllowed(route, route.project, url, who, request, response, null))
837
853
  return;
838
854
  }
839
- return handleGet(route, url, who, request, response);
855
+ return withWorkReads(() => handleGet(route, url, who, request, response));
840
856
  }
841
857
  return handlePost(route, url, who, request, response, body);
842
858
  };
@@ -949,7 +965,7 @@ export function createDecisionServer(options) {
949
965
  const namedProject = url.searchParams.get("project");
950
966
  if (url.searchParams.getAll("result").length !== 1 || url.searchParams.getAll("run").length > 1 || url.searchParams.getAll("project").length > 1 ||
951
967
  (namedProject !== null && (ref === null || !visible(ref.repo) || namedProject !== ref.repo))) {
952
- return refuse(response, who, 404, "No such result in your projects.", "/tasks");
968
+ return refuse(response, who, 404, "No such result in your projects.", "/");
953
969
  }
954
970
  if (who.via === "cookie" && ref !== null && visible(ref.repo))
955
971
  project = ref.repo;
@@ -977,21 +993,52 @@ export function createDecisionServer(options) {
977
993
  }
978
994
  let localSignIn = null;
979
995
  let localSignInChecking = null;
996
+ let localAgents = null;
980
997
  let leadRecheckedAt = 0;
998
+ const signedInSeen = new Map();
999
+ function heldSignIn(agent, value, at) {
1000
+ if (value !== null && SIGNED_IN_STATES.has(value.state)) {
1001
+ signedInSeen.set(agent, { at, value });
1002
+ return value;
1003
+ }
1004
+ const seen = signedInSeen.get(agent);
1005
+ if (value === null || value.state === "unverified")
1006
+ return seen !== undefined && at - seen.at < SIGNED_IN_HOLD_MS ? seen.value : value;
1007
+ signedInSeen.delete(agent);
1008
+ return value;
1009
+ }
981
1010
  function checkLocalAgents(fresh = false) {
982
1011
  if (localSignInChecking !== null)
983
1012
  return localSignInChecking;
984
- localSignInChecking = Promise.all(["claude", "codex"].map(one => connectionCheck(one, fresh).then(value => value.state, () => "unverified")))
985
- .then(([claude, codex]) => {
986
- localSignIn = { at: Date.now(), signedIn: [claude, codex].some(state => state === "connected" || state === "key-works" || state === "key-present"), states: { claude: claude, codex: codex } };
1013
+ const ask = (again) => Promise.all(LOCAL_AGENTS.map(one => connectionCheck(one, again).catch(() => null)));
1014
+ localSignInChecking = ask(fresh)
1015
+ .then(first => first.some(one => one !== null && SIGNED_IN_STATES.has(one.state)) || !first.some(one => one === null || one.state === "unverified") ? first : ask(true))
1016
+ .then(async (answers) => {
1017
+ const at = clock().getTime();
1018
+ const [claudeSeen, codexSeen] = answers.map((value, index) => heldSignIn(LOCAL_AGENTS[index], value, at));
1019
+ const claude = claudeSeen?.state ?? "unverified", codex = codexSeen?.state ?? "unverified";
1020
+ localSignIn = { at: Date.now(), signedIn: [claude, codex].some(state => SIGNED_IN_STATES.has(state)), states: { claude, codex } };
987
1021
  leadByDefault();
988
1022
  if (options.leadByDefault === true && !store.isDemo())
989
1023
  fillRoutingOnSignIn(store, localSignIn.states, clock());
1024
+ const held = { ...(claudeSeen ? { claude: claudeSeen } : {}), ...(codexSeen ? { codex: codexSeen } : {}) };
1025
+ const check = (provider, again) => { const kept = held[provider]; return kept !== undefined ? Promise.resolve(kept) : checkConnection(provider, again); };
1026
+ localAgents = await detectAgents({ check, home: providerHome, clock, routed: firstTaskRouted(store), acpChecked: acpCheckedHere(store) });
1027
+ const pick = localAgents.firstTask;
1028
+ if ((pick === "claude" || pick === "codex") && options.leadByDefault === true && !store.isDemo())
1029
+ fillDefaultRouting(store, pick, "toolroll", { kind: "detected" }, clock());
990
1030
  })
991
1031
  .catch(() => { })
992
1032
  .finally(() => { localSignInChecking = null; });
993
1033
  return localSignInChecking;
994
1034
  }
1035
+ function localAgentsSettled(maxMs) {
1036
+ const checking = localSignInChecking;
1037
+ if (checking === null)
1038
+ return Promise.resolve();
1039
+ let timer;
1040
+ return Promise.race([checking, new Promise(done => { timer = setTimeout(done, maxMs); timer.unref?.(); })]).finally(() => clearTimeout(timer));
1041
+ }
995
1042
  function localAgentSignedIn() {
996
1043
  return localSignIn?.signedIn ?? null;
997
1044
  }
@@ -1195,15 +1242,15 @@ export function createDecisionServer(options) {
1195
1242
  function paletteIndexTag(project) {
1196
1243
  const admitted = project === null ? admissionList() : null;
1197
1244
  const entries = [
1198
- { label: "tasks", href: "/tasks" },
1199
- { label: "needs you", href: "/tasks?view=needs-you" },
1245
+ { label: "tasks", href: "/" },
1246
+ { label: "needs you", href: "/?view=needs-you" },
1200
1247
  { label: "home", href: "/" },
1201
- { label: "board", href: "/tasks?view=board&scope=all" },
1248
+ { label: "board", href: "/?view=board" },
1202
1249
  { label: "queue", href: QUEUE_VIEW },
1203
- { label: "every project", href: "/tasks?scope=all" },
1250
+ { label: "every project", href: "/" },
1204
1251
  { label: "flows", href: "/flows" },
1205
- { label: "finished", href: "/tasks?view=done" },
1206
- { label: "ready for review", href: "/tasks?view=ready" },
1252
+ { label: "finished", href: "/?view=done" },
1253
+ { label: "ready for review", href: "/?view=ready" },
1207
1254
  { label: "fleet", href: "/fleet" },
1208
1255
  { label: "activity", href: "/activity" },
1209
1256
  { label: "action ledger", href: "/ledger" },
@@ -1218,8 +1265,8 @@ export function createDecisionServer(options) {
1218
1265
  entries.push({ label: `${one.id} — ${one.title}`, href: `/t/${encodeURIComponent(one.id)}` });
1219
1266
  }
1220
1267
  const saturated = open.length > 200;
1221
- const safeEntries = restricted() ? entries.filter(one => ["/tasks", "/tasks?view=needs-you", "/", "/tasks?view=board", "/flows", "/tasks?view=done", "/tasks?view=ready", "/runs", "/projects", "/ledger"].includes(one.href) || one.href.startsWith("/t/")) : entries;
1222
- return jsonScript(saturated ? [...safeEntries, { label: "… more in Tasks", href: "/tasks" }] : safeEntries, { id: "palette-index" });
1268
+ const safeEntries = restricted() ? entries.filter(one => ["/", "/?view=needs-you", "/", "/?view=board", "/flows", "/?view=done", "/?view=ready", "/runs", "/projects", "/ledger"].includes(one.href) || one.href.startsWith("/t/")) : entries;
1269
+ return jsonScript(saturated ? [...safeEntries, { label: "… more in Work", href: "/" }] : safeEntries, { id: "palette-index" });
1223
1270
  }
1224
1271
  const paletteCache = new Map();
1225
1272
  function paletteTagCached(project) {
@@ -1373,11 +1420,11 @@ export function createDecisionServer(options) {
1373
1420
  catchUpHtml: extras.catchUpHtml === undefined ? '' : htmlString(extras.catchUpHtml), controlsHtml: extras.controlsHtml === undefined ? '' : htmlString(extras.controlsHtml), notices, view: extras.view ?? null,
1374
1421
  ...(s.chrome.demo ? { demo: { text: DEMO_BANNER, short: DEMO_BANNER_SHORT } } : {}),
1375
1422
  pageHtml: extras.pageHtml === undefined ? (conversation === null ? pageHtml : null) : extras.pageHtml === null ? null : htmlString(extras.pageHtml),
1376
- navigation: browserNavigationOf(currentPath, s.chrome.project, needsYou, tasksProject, s.chrome.inboxLabel, requestFacts.advanced !== false),
1423
+ navigation: browserNavigationOf(currentPath, needsYou, s.chrome.inboxLabel),
1377
1424
  ...(requestFacts.advanced === false ? { advanced: false } : {}),
1378
1425
  needsYou: { count: needsYou, saturated: s.chrome.inboxSaturated === true, scope: tasksProject ?? null,
1379
1426
  label: s.chrome.inboxLabel ?? `${needsYou} ${needsYou === 1 ? 'needs' : 'need'} you`,
1380
- href: tasksProject === null ? '/tasks?scope=all&view=needs-you' : `/tasks?project=${encodeURIComponent(tasksProject)}&view=needs-you` },
1427
+ href: tasksProject === null ? '/?view=needs-you' : `/?project=${encodeURIComponent(tasksProject)}&view=needs-you` },
1381
1428
  chats,
1382
1429
  ...(() => { if (sensitive)
1383
1430
  return {}; try {
@@ -1446,11 +1493,12 @@ export function createDecisionServer(options) {
1446
1493
  function sidebarProjects() {
1447
1494
  const seen = new Set();
1448
1495
  const rows = [];
1496
+ const shown = visibleNow();
1449
1497
  for (const one of [
1450
1498
  ...store.listProjects().map(one => ({ path: one.path, name: one.name })),
1451
1499
  ...managedRepos().map(path => ({ path, name: projectName(path) })),
1452
1500
  ]) {
1453
- if (seen.has(one.path) || !visible(one.path) || goneRepos().has(one.path))
1501
+ if (seen.has(one.path) || !shown(one.path) || goneRepos().has(one.path))
1454
1502
  continue;
1455
1503
  seen.add(one.path);
1456
1504
  rows.push(one);
@@ -1467,7 +1515,7 @@ export function createDecisionServer(options) {
1467
1515
  const access = workAccess();
1468
1516
  return JSON.stringify({ projects: sidebarProjects().map(one => one.path).sort(), access: { ...access, repos: access.repos === null ? null : [...access.repos].sort() } });
1469
1517
  });
1470
- const projectSummaryFor = (account, scope) => projectScopeFor(account) !== scope ? null : requestContext.run({ csrf: '', returnTo: '/', actor: account }, () => JSON.stringify(projectSummary()));
1518
+ const projectSummaryFor = (account, scope) => projectScopeFor(account) !== scope ? null : requestContext.run({ csrf: '', returnTo: '/', actor: account }, () => withWorkReads(() => JSON.stringify(projectSummary())));
1471
1519
  function chromeFor(project, active, listPane, scope) {
1472
1520
  if (restricted() && !visible(project))
1473
1521
  project = null;
@@ -1759,7 +1807,7 @@ export function createDecisionServer(options) {
1759
1807
  liveHandlers.close();
1760
1808
  detachReads();
1761
1809
  liveFollower.close();
1762
- void Promise.all([closeCoding(), terminalClosing.close?.().then(problem => { terminalClosing.problem = problem; }), bounded(team.close()), bounded(personalQueue.close()), bounded(leadMaintenance?.stop()), bounded(backgroundChecks?.stop()), bounded(reads?.close())])
1810
+ void Promise.all([closeCoding(), terminalClosing.close?.().then(problem => { terminalClosing.problem = problem; }), bounded(team.close()), bounded(personalQueue.close()), bounded(leadMaintenance?.stop()), bounded(backgroundChecks?.stop()), bounded(reads?.close()), bounded(engineHandlers.close())])
1763
1811
  .then(() => closeServer(error => callback?.(error ?? terminalClosing.problem ?? undefined))).catch(error => {
1764
1812
  if (callback)
1765
1813
  callback(error instanceof Error ? error : Error('Coding session shutdown failed.'));
@@ -1839,6 +1887,7 @@ export function createDecisionServer(options) {
1839
1887
  get leadRecheckedAt() { return leadRecheckedAt; },
1840
1888
  set leadRecheckedAt(value) { leadRecheckedAt = value; },
1841
1889
  get checkLocalAgents() { return checkLocalAgents; },
1890
+ get localAgentsSettled() { return localAgentsSettled; },
1842
1891
  get localSignIn() { return localSignIn; },
1843
1892
  set localSignIn(value) { localSignIn = value; },
1844
1893
  get agentSignInCommand() { return agentSignInCommand; },
@@ -1923,9 +1972,11 @@ export function createDecisionServer(options) {
1923
1972
  get keyEpoch() { return keyEpoch; },
1924
1973
  get browserKeys() { return browserKeys; },
1925
1974
  get outsideAdmissions() { return outsideAdmissions; },
1975
+ get localAgents() { return localAgents; },
1926
1976
  };
1927
1977
  const tasksHandlers = createTasksHandlers(handlerRuntime);
1928
- const pagesHandlers = createPagesHandlers(handlerRuntime);
1978
+ const pagesHandlers = createPagesHandlers(handlerRuntime, { listFor: tasksHandlers.workListFor, showOrder: tasksHandlers.showOrder });
1979
+ const engineHandlers = createEngineHandlers(handlerRuntime);
1929
1980
  const flowsHandlers = createFlowsHandlers(handlerRuntime);
1930
1981
  const chatHandlers = createChatHandlers(handlerRuntime);
1931
1982
  const settingsHandlers = createSettingsHandlers(handlerRuntime);
@@ -1958,20 +2009,19 @@ export function createDecisionServer(options) {
1958
2009
  };
1959
2010
  const liveHandlers = createLiveHandlers(handlerRuntime, { bus: liveBus, workspaceRevision, chatProjectOf: chatHandlers.chatProjectOf, projectSummaryFor, projectScopeFor });
1960
2011
  liveTurnStarted = liveHandlers.turnStarted;
1961
- const terminalHandlers = createTerminalHandlers(handlerRuntime, { ...terminals, bus: liveBus, allowedHost, publicOrigin, forwardedSourceOf, server });
2012
+ const terminalHandlers = createTerminalHandlers(handlerRuntime, { ...terminals, bus: liveBus, allowedHost, publicOrigin, forwardedSourceOf, server,
2013
+ ...(options.agentCommandEnv === undefined ? {} : { agentEnv: options.agentCommandEnv }) });
1962
2014
  terminalClosing.close = terminalHandlers.close;
1963
2015
  const remoteHandlers = createRemoteHandlers(remoteRuntime);
1964
2016
  const registry = createHandlerRegistry([
1965
2017
  ...tasksHandlers.registrations, ...flowsHandlers.registrations, ...chatHandlers.registrations,
1966
2018
  ...settingsHandlers.registrations, ...peopleHandlers.registrations, ...pagesHandlers.registrations,
1967
2019
  ...remoteHandlers.registrations, ...liveHandlers.registrations, ...terminalHandlers.registrations, ...createSweepHandlers(handlerRuntime).registrations,
1968
- ...createWelcomeHandlers(handlerRuntime).registrations,
2020
+ ...createWelcomeHandlers(handlerRuntime).registrations, ...engineHandlers.registrations,
1969
2021
  ]);
1970
2022
  function dispatchConsole(route, ctx) {
1971
2023
  const { who, response } = ctx;
1972
- const held = route.role === "any" || ((!route.roleBrowser || who.via === "cookie") &&
1973
- (route.role === "approver" ? who.role === "approver" : store.isInstanceOperator(who.name)));
1974
- if (!held) {
2024
+ if (!holdsRole(route, who, name => store.isInstanceOperator(name))) {
1975
2025
  ctx.request.resume();
1976
2026
  const refusal = route.roleRefusal;
1977
2027
  return Promise.resolve("message" in refusal ? refuse(response, who, 403, refusal.message, refusal.back) : respond(response, refusal.status, refusal.type, refusal.body));
@@ -40,7 +40,7 @@ import { WORK_INDEX_MAX_LIMIT, workIndexPage } from "../work-index.js";
40
40
  import { html, htmlString, postForm, reauth } from "../html.js";
41
41
  import { requestContext } from "./request-context.js";
42
42
  import { refuse, screen, whenTime } from "./chrome.js";
43
- import { chatResultHref, chatReturnWithLatest, chatRefusal, chatReturnWithSaid, projectChatHref, redirect, respond, safeChatReturn, safeReturn, taskChatHref, taskHref } from "./http.js";
43
+ import { chatPanelResultHref, chatReturnWithLatest, chatRefusal, chatReturnWithSaid, projectChatHref, redirect, respond, safeChatReturn, safeReturn, taskChatHref, taskHref } from "./http.js";
44
44
  import { chatAckPage, chatPage, NOT_STARTED_SESSION, coordinatorProposalsSection, decisionsFor, leadAfterComposerHtml, leadChatVersion, leadMintCard, leadPage, leadThreadHtml, PHONE_CARD_FACT, TASK_COMPOSER_MODES, taskChatLiveRegion, teamProposalCardParts } from "./render-chat.js";
45
45
  import {} from "./render-pages.js";
46
46
  import { completionForm, hardBlockerOf, homePhaseWords, owedAcceptanceOf, resultPanelHtml } from "./render-results.js";
@@ -151,7 +151,7 @@ export function createChatHandlers(runtime) {
151
151
  const requestedRevision = url.searchParams.get("revision");
152
152
  if (requestedRevision !== null) {
153
153
  if (focusTask === null || !focusTask.family.versions.some(one => one.id === requestedRevision) || url.searchParams.has("result")) {
154
- return refuse(response, who, 404, "That revision is not available for this task.", "/tasks");
154
+ return refuse(response, who, 404, "That revision is not available for this task.", "/");
155
155
  }
156
156
  if (requestedRevision !== focusTask.executionId)
157
157
  return redirect(response, `${taskHref(focusTask.id)}?version=${encodeURIComponent(requestedRevision)}`);
@@ -180,8 +180,8 @@ export function createChatHandlers(runtime) {
180
180
  user: who.name,
181
181
  noted: url.searchParams.get("noted") !== null,
182
182
  requestToken: randomBytes(16).toString("hex"),
183
- hrefFor: one => resultLink(chatResultHref(focusTask?.id ?? "", resultRun.id, one)),
184
- returnTo: resultLink(chatResultHref(focusTask?.id ?? "", resultRun.id)),
183
+ hrefFor: one => resultLink(chatPanelResultHref(focusTask?.id ?? "", resultRun.id, one)),
184
+ returnTo: resultLink(chatPanelResultHref(focusTask?.id ?? "", resultRun.id)),
185
185
  back: { href: roomId ? "/chat?conversation=" + encodeURIComponent(roomId) : taskChatHref(focusTask?.id ?? ""), label: "Back to chat" },
186
186
  finishes,
187
187
  })}${finishes && focusTask?.assignment?.receipt != null
@@ -1297,10 +1297,10 @@ export function createChatHandlers(runtime) {
1297
1297
  const all = view("all"), needs = view("needs-you"), done = view("completed");
1298
1298
  const weekAgo = new Date(now.getTime() - 7 * 86_400_000).toISOString();
1299
1299
  const counts = [
1300
- { key: "working", label: "Working now", value: agents.length, href: "/tasks?view=running" },
1301
- { key: "waiting", label: "Waiting on you", value: needs.items.filter(one => one.status.label !== "Ready for review").length, href: "/tasks?view=needs-you" },
1302
- { key: "ready", label: "Ready to review", value: needs.items.filter(one => one.status.label === "Ready for review").length, href: "/tasks?view=needs-you" },
1303
- { key: "done", label: "Done this week", value: done.items.filter(one => (one.completion?.at ?? one.updatedAt) >= weekAgo).length, href: "/tasks?view=completed" },
1300
+ { key: "working", label: "Working now", value: agents.length, href: "/?view=running" },
1301
+ { key: "waiting", label: "Waiting on you", value: needs.items.filter(one => one.status.label !== "Ready for review").length, href: "/?view=needs-you" },
1302
+ { key: "ready", label: "Ready to review", value: needs.items.filter(one => one.status.label === "Ready for review").length, href: "/?view=needs-you" },
1303
+ { key: "done", label: "Done this week", value: done.items.filter(one => (one.completion?.at ?? one.updatedAt) >= weekAgo).length, href: "/?view=completed" },
1304
1304
  ];
1305
1305
  const tabOf = (one) => one.assignmentState === "ready-to-check" ? one.status.label === "Ready for review" ? "ready" : "needs-you"
1306
1306
  : one.assignmentState === "needs-decision" ? "needs-you" : one.assignmentState === "working" || one.assignmentState === "checking" ? "running" : "finished";
@@ -1318,7 +1318,7 @@ export function createChatHandlers(runtime) {
1318
1318
  const lead = activity === null ? null : { name: activity.name, doing: activity.doing, at: activity.at,
1319
1319
  href: leadTask == null || !admitted(leadTask.repo) ? null : taskHref(familyOf(activity.taskId)?.root.id ?? activity.taskId) };
1320
1320
  return {
1321
- agents, counts, catchUp, allHref: "/tasks", ...(lead === null ? {} : { lead }),
1321
+ agents, counts, catchUp, allHref: "/", ...(lead === null ? {} : { lead }),
1322
1322
  planUse: (windows?.tiles ?? []).map(one => ({ name: one.name, window: one.window, percent: one.percent, detail: one.detail, tone: one.tone })),
1323
1323
  };
1324
1324
  }
@@ -57,7 +57,7 @@ import { readFileSync } from "node:fs";
57
57
  import { join } from "node:path";
58
58
  import {} from "node:http";
59
59
  import { attributes, html, joinHtml, postForm, scriptElement, styleElement } from "../html.js";
60
- import { page, respond } from "./http.js";
60
+ import { page, refusedInPlace, respond } from "./http.js";
61
61
  import {} from "./render-pages.js";
62
62
  import {} from "./session.js";
63
63
  export function consoleSpend(summary) {
@@ -86,10 +86,12 @@ export function refuse(response, who, status, message, backHref = "/", act) {
86
86
  if (who === null || who.via === "bearer") {
87
87
  return respond(response, status, "text/plain; charset=utf-8", message);
88
88
  }
89
+ if (refusedInPlace(response, status, message))
90
+ return;
89
91
  const path = new URL(requestContext.getStore()?.returnTo ?? "/", "http://standing-orders.local").pathname;
90
92
  const generic = /^there'?s no page at this address\.?$/i.test(message.replace("\u2019", "'"));
91
93
  const body = html `<div class="k-refusal">${status === 404
92
- ? kitNotFound(path, generic ? {} : { title: message, text: "Home has what needs you; Tasks has every task." })
94
+ ? kitNotFound(path, generic ? {} : { title: message, text: "Work has every task and what needs you." })
93
95
  : kitDoc(kitDocHeader({ title: "Request refused", back: [backHref, "Back"] }), kitNotice(message), kitActs(act === undefined ? kitBtn("Go back", { href: backHref }) : kitBtn(act.label, { href: act.href, variant: "primary" })))}</div>`;
94
96
  const framed = requestContext.getStore()?.refusal;
95
97
  if (framed !== undefined && who.via === "cookie")
@@ -97,7 +99,7 @@ export function refuse(response, who, status, message, backHref = "/", act) {
97
99
  return page(response, status, shell(status === 404 ? "Not found" : "Request refused", outPage({
98
100
  brand: BRAND_HTML, title: status === 404 ? "Not found" : "Request refused",
99
101
  body: html `<div class="k-refusal">${kitNotice(status === 404 && generic ? `There\u2019s no page at ${path}.` : message)}</div>`,
100
- foot: act === undefined ? html `<a class="k-link" href="${status === 404 ? "/" : backHref}">${status === 404 ? "Go to Home" : "Go back"}</a>` : html `<a class="k-link" href="${act.href}">${act.label}</a>`,
102
+ foot: act === undefined ? html `<a class="k-link" href="${status === 404 ? "/" : backHref}">${status === 404 ? "Go to Work" : "Go back"}</a>` : html `<a class="k-link" href="${act.href}">${act.label}</a>`,
101
103
  })));
102
104
  }
103
105
  export const DEMO_BANNER = `Demo: a scripted chat and sample projects. Nothing calls a model, reaches outside or costs anything. For your own project, run ${START_COMMAND} in its folder.`;
@@ -349,8 +351,8 @@ ${count !== undefined && count > 0 ? html ` <span class="count badge badge-open"
349
351
  const scopeStatus = peekCounts === null
350
352
  ? null
351
353
  : html `<span class="scope-status">\
352
- ${peekCounts.waiting > 0 ? html `<a class="hot" href="/tasks?view=needs-you">${peekCounts.waiting} needs you</a>` : html `<a href="/tasks?view=needs-you">0 needs you</a>`}\
353
- <a href="/runs">${peekCounts.running} live</a><a href="/tasks?view=order">${peekCounts.queued} queued</a></span>`;
354
+ ${peekCounts.waiting > 0 ? html `<a class="hot" href="/?view=needs-you">${peekCounts.waiting} needs you</a>` : html `<a href="/?view=needs-you">0 needs you</a>`}\
355
+ <a href="/runs">${peekCounts.running} live</a><a href="/?view=order">${peekCounts.queued} queued</a></span>`;
354
356
  const scopeName = effectiveScope === "project" && chrome.project !== null ? projectName(chrome.project) : "All projects";
355
357
  const canSwitch = options.sensitive !== true && chrome.csrf !== undefined && chrome.csrf !== "" && chrome.projects !== undefined;
356
358
  const switcherMenu = (foot) => {
@@ -380,14 +382,14 @@ ${scopeStatus}</div>`;
380
382
  ${count !== undefined && count > 0 ? html ` <span${chrome.inboxLabel === undefined ? "" : html ` aria-label="${chrome.inboxLabel}" title="${chrome.inboxLabel}"`} class="count badge badge-open">${count}${chrome.inboxSaturated ? "+" : ""}</span>` : ""}</a>`;
381
383
  const side = joinHtml([
382
384
  html `<aside class="side">`,
383
- html `<div class="side-head"><a class="brand" href="${chrome.chat === true ? "/chat" : "/tasks"}"><span class="brand-long">Toolroll</span><span class="brand-short">T</span></a>`,
385
+ html `<div class="side-head"><a class="brand" href="${chrome.chat === true ? "/chat" : "/"}"><span class="brand-long">Toolroll</span><span class="brand-short">T</span></a>`,
384
386
  ...(options.sidebarToggle === true
385
387
  ? [html `<button type="button" class="side-toggle" aria-label="collapse sidebar" aria-expanded="true" title="collapse sidebar">${strokeIcon(html `<path d="m15 18-6-6 6-6"/>`)}</button>`]
386
388
  : []),
387
389
  html `</div>`,
388
390
  html `<nav>`,
389
391
  ...(chrome.chat ? [primaryItem("chat", "/chat", "Chat")] : []),
390
- primaryItem("work", "/tasks", "Tasks", chrome.inboxCount),
392
+ primaryItem("work", "/", "Tasks", chrome.inboxCount),
391
393
  ...(advanced ? [primaryItem("flows", "/flows", "Flows")] : []),
392
394
  primaryItem("projects", "/projects", "Projects"),
393
395
  html `</nav>`,
@@ -417,7 +419,7 @@ ${postForm(update.dismissHref, html `<button type="submit">Dismiss</button>`, {
417
419
  </div></div>`;
418
420
  const mobileTop = joinHtml([
419
421
  html `<header class="mobile-top">`,
420
- html `<a class="brand-mini" href="${chrome.chat === true ? "/chat" : "/tasks"}">T</a>`,
422
+ html `<a class="brand-mini" href="${chrome.chat === true ? "/chat" : "/"}">T</a>`,
421
423
  canSwitch
422
424
  ? html `<details class="project-pill switcher"><summary><span class="name">${scopeName}${CHEVRON_ICON}</span>${scopeCounts === null ? "" : html `<span class="pill-status">${scopeCounts}</span>`}</summary>${switcherMenu(html `<a class="manage" href="/projects">manage projects</a>`)}</details>`
423
425
  : html `<a class="project-pill" href="/projects"><span class="name">${scopeName}</span>${scopeCounts === null ? "" : html `<span class="pill-status">${scopeCounts}</span>`}</a>`,
@@ -437,7 +439,7 @@ ${count !== undefined && count > 0 ? html `<span class="dot-badge" role="img" ar
437
439
  const tabbar = joinHtml([
438
440
  html `<nav class="tabbar">`,
439
441
  ...(chrome.chat ? [tab("chat", "/chat", "Chat")] : []),
440
- tab("work", "/tasks", "Tasks", chrome.inboxCount),
442
+ tab("work", "/", "Tasks", chrome.inboxCount),
441
443
  ...(advanced ? [tab("flows", "/flows", "Flows")] : []),
442
444
  tab("projects", "/projects", "Projects"),
443
445
  html `</nav>`,
@@ -483,7 +485,7 @@ export const GRIP_ICON = html `<svg viewBox="0 0 24 24" fill="currentColor" aria
483
485
  export const TO_FRONT_ICON = html `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\
484
486
  <path d="M12 19V5"/><path d="m5 12 7-7 7 7"/></svg>`;
485
487
  export const strokeIcon = (paths) => html `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${paths}</svg>`;
486
- export const QUEUE_VIEW = "/tasks?view=order";
488
+ export const QUEUE_VIEW = "/?view=order";
487
489
  export const FOLDER_PATHS = html `<path d="M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z"/>`;
488
490
  export const CHAT_PATHS = html `<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>`;
489
491
  export const WORK_PATHS = html `<path d="M9 6h11"/><path d="M9 12h11"/><path d="M9 18h11"/><path d="m4 6 1 1 2-2"/><path d="m4 12 1 1 2-2"/><path d="m4 18 1 1 2-2"/>`;
@@ -498,10 +500,10 @@ export function workToolRows(scoped = false, _offersChat = false, offersCode = f
498
500
  const rows = [
499
501
  ...(offersCode && advanced ? [{ key: "code", href: "/term", label: "Live", hint: "your own terminals: Claude Code, Codex or a shell" }] : []),
500
502
  { key: "inbox", href: "/", label: "Home", hint: "what needs you, what runs, and what waits" },
501
- { key: "board", href: "/tasks?view=board", label: "Board", hint: "lanes by state, with the order view" },
502
- { key: "tasks", href: "/tasks", label: "Task list", hint: "everything, filterable by state" },
503
+ { key: "board", href: "/?view=board", label: "Board", hint: "lanes by state, with the order view" },
504
+ { key: "tasks", href: "/", label: "Task list", hint: "everything, filterable by state" },
503
505
  { key: "recipes", href: "/recipes", label: "Recipes", hint: "choose, customize, and reuse a workflow" },
504
- { key: "workbench", href: "/tasks?scope=all", label: "Every project", hint: "every project's tasks in one list" },
506
+ { key: "workbench", href: "/", label: "Every project", hint: "every project's tasks in one list" },
505
507
  { key: "ledger", href: "/ledger", label: "Audit log", hint: "who acted, what happened, and the result" },
506
508
  { key: "spend", href: "/spend", label: "Spend", hint: "what agent work cost, and monthly budgets" },
507
509
  ];
@@ -511,13 +513,13 @@ export function workToolRows(scoped = false, _offersChat = false, offersCode = f
511
513
  export function settingsRows(scoped = false, offersSettings = false, advanced = true) {
512
514
  const rows = [
513
515
  ...(offersSettings ? [{ key: "settings", href: "/settings", label: "Settings", hint: "agent defaults, alerts, credentials" }] : []),
514
- { key: "fleet", href: "/fleet", label: "Fleet", hint: "who is working, and on what" },
516
+ { key: "fleet", href: "/settings/computers", label: "Computers", hint: "the computers that build, and connecting one" },
515
517
  { key: "caps", href: "/caps", label: "Requirements", hint: "tools and credentials builds need" },
516
518
  { key: "people", href: "/people", label: "People", hint: "who can sign in, and what they have done" },
517
519
  { key: "mode", href: "/mode", label: "Operating mode", hint: "how much this project may do without asking" },
518
520
  { key: "system", href: "/system", label: "System", hint: "workers, providers, and grants" },
519
521
  ];
520
- const shown = advanced ? rows : rows.filter(row => row.key !== "fleet" && row.key !== "mode");
522
+ const shown = advanced ? rows : rows.filter(row => row.key !== "mode");
521
523
  return scoped ? shown.filter(row => row.key === "people" || row.key === "settings") : shown;
522
524
  }
523
525
  export const TOOL_KEYS = new Set(["code", "inbox", "board", "queue", "tasks", "workbench", "recipes", "ledger", "spend"]);
@@ -525,8 +527,8 @@ export const SETTINGS_KEYS = new Set(["settings", "fleet", "caps", "people", "mo
525
527
  export function buildsViews(current) {
526
528
  const views = [
527
529
  ["builds", "/runs", "builds"],
528
- ["done", "/tasks?view=done", "done"],
529
- ["review", "/tasks?view=ready", "review"],
530
+ ["done", "/?view=done", "done"],
531
+ ["review", "/?view=ready", "review"],
530
532
  ["activity", "/activity", "activity"],
531
533
  ];
532
534
  return html `<p class="meta board-view">${joinHtml(views.map(([key, href, label]) => (key === current ? html `<strong>${label}</strong>` : html `<a href="${href}">${label}</a>`)), " \u00b7 ")}</p>`;