toolroll 0.9.104 → 0.9.105

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 (1519) hide show
  1. package/CHANGELOG.md +62 -5
  2. package/README.md +18 -20
  3. package/dist/accent-colors.js +0 -29
  4. package/dist/acp-agents.js +0 -3
  5. package/dist/acp-attest.js +0 -30
  6. package/dist/acp-check.js +3 -70
  7. package/dist/acp-client.js +3 -94
  8. package/dist/acp-inspect.js +1 -20
  9. package/dist/action-ledger.js +0 -8
  10. package/dist/activity-line.js +0 -14
  11. package/dist/actor.js +0 -15
  12. package/dist/advanced-schema.js +12 -0
  13. package/dist/advanced-view.js +26 -0
  14. package/dist/advanced.js +61 -0
  15. package/dist/agent-board.js +0 -117
  16. package/dist/agent-fence.js +11 -367
  17. package/dist/agent-onboard.js +12 -50
  18. package/dist/agent-pulse.js +5 -38
  19. package/dist/agent-state-words.js +0 -8
  20. package/dist/agent-state.js +1 -45
  21. package/dist/agent-turns.js +3 -17
  22. package/dist/agentconfig.js +1 -99
  23. package/dist/agents-board.js +0 -60
  24. package/dist/agents-live.js +1 -8
  25. package/dist/api-tokens.js +0 -27
  26. package/dist/approval-authority.js +0 -59
  27. package/dist/approval-password.js +0 -10
  28. package/dist/approval-policy.js +0 -29
  29. package/dist/approval-rules-ui.js +0 -9
  30. package/dist/assignment-adapters.js +0 -14
  31. package/dist/assignment-brief.js +1 -17
  32. package/dist/assignment-delivery.js +0 -22
  33. package/dist/assignment-presentation.js +0 -14
  34. package/dist/assignment-status.js +1 -30
  35. package/dist/assignment-ui.js +0 -12
  36. package/dist/assignment.js +17 -139
  37. package/dist/attest.js +0 -38
  38. package/dist/audit-cli.js +0 -9
  39. package/dist/backend.js +0 -59
  40. package/dist/backup-ui.js +0 -12
  41. package/dist/backup.js +8 -61
  42. package/dist/batch-checks.js +0 -20
  43. package/dist/batch-policy.js +0 -4
  44. package/dist/beads.js +0 -48
  45. package/dist/bin.js +0 -8
  46. package/dist/board.js +1 -36
  47. package/dist/boot-identity.js +0 -42
  48. package/dist/bounded-spawn.js +4 -28
  49. package/dist/brand-mark.js +0 -21
  50. package/dist/brief-fence.js +0 -16
  51. package/dist/browser/terminal.css +1 -1
  52. package/dist/browser/terminal.js +16 -16
  53. package/dist/browser/workspace.css +2 -2
  54. package/dist/browser/workspace.js +26 -26
  55. package/dist/browser-crew.js +0 -8
  56. package/dist/browser-shell.js +2 -15
  57. package/dist/browser-workspace.js +6 -30
  58. package/dist/budget-alerts.js +1 -4
  59. package/dist/build-review.js +2 -50
  60. package/dist/builder-restart.js +0 -13
  61. package/dist/builder.js +21 -1035
  62. package/dist/canonical-json.js +0 -12
  63. package/dist/capscan.js +1 -32
  64. package/dist/card-catalog.js +0 -12
  65. package/dist/card-cli.js +0 -1
  66. package/dist/card-render.js +0 -25
  67. package/dist/card-sources.js +0 -10
  68. package/dist/chat-acceptance.js +0 -7
  69. package/dist/chat-actions.js +5 -190
  70. package/dist/chat-admission.js +0 -7
  71. package/dist/chat-approval.js +0 -25
  72. package/dist/chat-ask.js +0 -17
  73. package/dist/chat-card-part.js +0 -3
  74. package/dist/chat-card.js +0 -6
  75. package/dist/chat-channel.js +2 -83
  76. package/dist/chat-continuity.js +0 -31
  77. package/dist/chat-controls.js +0 -7
  78. package/dist/chat-core.js +0 -55
  79. package/dist/chat-decide.js +2 -153
  80. package/dist/chat-delivery-state.js +0 -49
  81. package/dist/chat-delivery.js +2 -143
  82. package/dist/chat-display.js +0 -2
  83. package/dist/chat-evidence.js +0 -65
  84. package/dist/chat-flow.js +0 -72
  85. package/dist/chat-follow.js +0 -13
  86. package/dist/chat-inbox.js +0 -34
  87. package/dist/chat-live-schema.js +0 -14
  88. package/dist/chat-live.js +2 -87
  89. package/dist/chat-message-states.js +13 -40
  90. package/dist/chat-messages.js +0 -153
  91. package/dist/chat-migration.js +0 -57
  92. package/dist/chat-polish.js +0 -7
  93. package/dist/chat-quiet.js +0 -37
  94. package/dist/chat-review.js +0 -4
  95. package/dist/chat-rooms.js +0 -22
  96. package/dist/chat-settings-page.js +0 -4
  97. package/dist/chat-task-actions.js +0 -7
  98. package/dist/chat-terms.js +0 -21
  99. package/dist/chat-voice.js +0 -38
  100. package/dist/chat-warmth.js +1 -3
  101. package/dist/check-access.js +0 -30
  102. package/dist/check-facts.js +2 -62
  103. package/dist/check-failure.js +0 -98
  104. package/dist/check-levels-ui.js +4 -10
  105. package/dist/check-levels.js +3 -35
  106. package/dist/check-load.js +1 -49
  107. package/dist/check-only-standing.js +0 -6
  108. package/dist/check-only.js +0 -22
  109. package/dist/check-progress.js +0 -32
  110. package/dist/check-repair.js +2 -35
  111. package/dist/check-report.js +1 -108
  112. package/dist/check-stamp.js +0 -20
  113. package/dist/checkout-cleanup.js +0 -84
  114. package/dist/checkout-proof.js +1 -13
  115. package/dist/child-database.js +0 -3
  116. package/dist/claim.js +4 -508
  117. package/dist/claude-print.js +0 -10
  118. package/dist/cli-fast.js +0 -8
  119. package/dist/cli-help.js +90 -78
  120. package/dist/cli-http.js +0 -10
  121. package/dist/cli.js +26 -241
  122. package/dist/code-extract.js +0 -6
  123. package/dist/code-map-acts.js +0 -7
  124. package/dist/code-map-admission.js +2 -26
  125. package/dist/code-map-build.js +3 -24
  126. package/dist/code-map-cli.js +0 -4
  127. package/dist/code-map-main.js +0 -6
  128. package/dist/code-map-read.js +0 -12
  129. package/dist/code-map-report.js +0 -9
  130. package/dist/code-map-shape.js +0 -19
  131. package/dist/code-map-store.js +0 -26
  132. package/dist/codex-limits.js +1 -17
  133. package/dist/coding-context.js +0 -10
  134. package/dist/coding-handoff.js +0 -14
  135. package/dist/coding-provider.js +0 -39
  136. package/dist/coding-shipping-ui.js +0 -1
  137. package/dist/coding-ui.js +0 -1
  138. package/dist/coding-update.js +1 -18
  139. package/dist/coding-workspace.js +0 -27
  140. package/dist/commit-extract.js +0 -83
  141. package/dist/connect-cli.js +0 -19
  142. package/dist/console-chrome.js +1 -34
  143. package/dist/console-instance.js +2 -91
  144. package/dist/container-state.js +0 -4
  145. package/dist/containment.js +2 -105
  146. package/dist/contract-changes.js +0 -6
  147. package/dist/contracts/acceptance-terms.js +0 -7
  148. package/dist/contracts/chat-actions.js +0 -46
  149. package/dist/contracts/chat-callback-rows.js +0 -8
  150. package/dist/contracts/chat-card.js +0 -14
  151. package/dist/contracts/chat-content.js +0 -55
  152. package/dist/contracts/chat-tables.js +0 -7
  153. package/dist/contracts/cli.js +0 -59
  154. package/dist/contracts/coding-activity.js +0 -15
  155. package/dist/contracts/coding-context.js +0 -15
  156. package/dist/contracts/coding-handoff.js +0 -11
  157. package/dist/contracts/coding-workspace.js +0 -14
  158. package/dist/contracts/console-api.js +1 -54
  159. package/dist/contracts/contract-test.js +0 -14
  160. package/dist/contracts/contract.js +0 -48
  161. package/dist/contracts/decision.js +0 -20
  162. package/dist/contracts/diff-stat.js +0 -16
  163. package/dist/contracts/discord-callback.js +0 -9
  164. package/dist/contracts/flow-card.js +0 -18
  165. package/dist/contracts/flow-propose.js +0 -8
  166. package/dist/contracts/flow-send.js +0 -31
  167. package/dist/contracts/flow.js +0 -112
  168. package/dist/contracts/gateway-tools.js +0 -22
  169. package/dist/contracts/handoff.js +0 -22
  170. package/dist/contracts/integration-metadata.js +0 -39
  171. package/dist/contracts/lead-context.js +0 -14
  172. package/dist/contracts/lead-tools.js +0 -49
  173. package/dist/contracts/mcp-oauth.js +0 -12
  174. package/dist/contracts/memory-pass.js +0 -21
  175. package/dist/contracts/model-catalog.js +0 -9
  176. package/dist/contracts/observation-request.js +0 -11
  177. package/dist/contracts/plan.js +0 -16
  178. package/dist/contracts/project-knowledge.js +0 -26
  179. package/dist/contracts/project-memory.js +0 -16
  180. package/dist/contracts/project-skills.js +0 -31
  181. package/dist/contracts/proof.js +0 -23
  182. package/dist/contracts/provider.js +0 -9
  183. package/dist/contracts/recipes.js +0 -16
  184. package/dist/contracts/release-check.js +0 -61
  185. package/dist/contracts/release-terms.js +0 -27
  186. package/dist/contracts/retention.js +0 -12
  187. package/dist/contracts/review-findings.js +0 -13
  188. package/dist/contracts/route-results.js +0 -15
  189. package/dist/contracts/route.js +0 -33
  190. package/dist/contracts/scope.js +0 -29
  191. package/dist/contracts/scout-report.js +0 -34
  192. package/dist/contracts/slack-callback.js +0 -11
  193. package/dist/contracts/sort-answer.js +0 -24
  194. package/dist/contracts/stage-output.js +0 -46
  195. package/dist/contracts/storage.js +0 -8
  196. package/dist/contracts/store-json.js +0 -41
  197. package/dist/contracts/subagent-turn.js +0 -23
  198. package/dist/contracts/task-sizing.js +0 -10
  199. package/dist/contracts/teams-callback.js +0 -7
  200. package/dist/contracts/telegram-callback.js +0 -27
  201. package/dist/contracts/trigger-payloads.js +0 -41
  202. package/dist/contracts/update-journal.js +0 -47
  203. package/dist/contracts/verification-receipt.js +0 -36
  204. package/dist/contracts/verification-view.js +0 -15
  205. package/dist/contracts/youiyoux-request.js +0 -26
  206. package/dist/control-setup.js +0 -7
  207. package/dist/control-ui.js +0 -3
  208. package/dist/controller-service.js +0 -4
  209. package/dist/controller-supervisor.js +0 -15
  210. package/dist/converse.js +3 -129
  211. package/dist/coordinator-proposals.js +1 -6
  212. package/dist/coordinator.js +0 -65
  213. package/dist/credentials-ui.js +0 -6
  214. package/dist/daemon.js +0 -137
  215. package/dist/database-reclaim.js +0 -3
  216. package/dist/decision.js +0 -78
  217. package/dist/demo-chat.js +4 -15
  218. package/dist/demo-sign-in.js +77 -0
  219. package/dist/demo.js +5 -194
  220. package/dist/deploy-gate.js +0 -20
  221. package/dist/deploy-lock.js +0 -4
  222. package/dist/deploy-phase.js +0 -22
  223. package/dist/deploy-rescue.js +0 -21
  224. package/dist/deprecations.js +0 -12
  225. package/dist/design/kit.css +9 -6
  226. package/dist/design/kit.js +2 -33
  227. package/dist/desktop-access.js +0 -9
  228. package/dist/desktop-bundle.js +1 -3
  229. package/dist/desktop-host.js +0 -34
  230. package/dist/desktop-update-gate.js +0 -8
  231. package/dist/desktop-update-recovery.js +1 -18
  232. package/dist/desktop-update.js +2 -48
  233. package/dist/digest-times.js +0 -2
  234. package/dist/disclosure.js +0 -5
  235. package/dist/discord-api.js +0 -6
  236. package/dist/discord-chat.js +0 -31
  237. package/dist/discord.js +0 -7
  238. package/dist/discover.js +0 -50
  239. package/dist/dispatch.js +61 -60
  240. package/dist/dispose.js +0 -208
  241. package/dist/doctor.js +0 -48
  242. package/dist/easy-start-args.js +7 -7
  243. package/dist/easy-start.js +32 -45
  244. package/dist/egress.js +1 -63
  245. package/dist/email-settings.js +0 -8
  246. package/dist/envelope.js +50 -86
  247. package/dist/eval-gate.js +1 -37
  248. package/dist/eval-hooks.js +0 -120
  249. package/dist/eval-oracle-main.js +0 -7
  250. package/dist/eval-oracle.js +3 -42
  251. package/dist/eval-world.js +1 -23
  252. package/dist/evals.js +6 -134
  253. package/dist/evidence-pack.js +0 -29
  254. package/dist/evidence-pair.js +0 -17
  255. package/dist/evidence.js +4 -280
  256. package/dist/exec.js +19 -404
  257. package/dist/exhaustion.js +0 -30
  258. package/dist/export-ui.js +0 -7
  259. package/dist/export.js +1 -38
  260. package/dist/failing-first.js +0 -6
  261. package/dist/fallback-schema.js +0 -5
  262. package/dist/fallback.js +0 -81
  263. package/dist/fast-start.js +0 -97
  264. package/dist/fast-terms.js +0 -3
  265. package/dist/fenced-check-coverage.js +0 -11
  266. package/dist/findings.js +1 -63
  267. package/dist/first-run.js +4 -57
  268. package/dist/first-tasks-child.js +0 -5
  269. package/dist/flaky-ci.js +1 -24
  270. package/dist/flaky-cli.js +0 -4
  271. package/dist/flaky.js +0 -43
  272. package/dist/fleet-schema.js +0 -11
  273. package/dist/flow-actions.js +0 -31
  274. package/dist/flow-browser.js +0 -42
  275. package/dist/flow-cadence.js +1 -24
  276. package/dist/flow-card-task.js +0 -11
  277. package/dist/flow-changed.js +0 -16
  278. package/dist/flow-code.js +1 -45
  279. package/dist/flow-draft.js +0 -17
  280. package/dist/flow-engine.js +2 -76
  281. package/dist/flow-gallery-ui.js +0 -28
  282. package/dist/flow-gallery.js +0 -54
  283. package/dist/flow-insights.js +0 -12
  284. package/dist/flow-items.js +0 -27
  285. package/dist/flow-live.js +0 -31
  286. package/dist/flow-people.js +0 -14
  287. package/dist/flow-pull-request.js +0 -32
  288. package/dist/flow-replies.js +0 -9
  289. package/dist/flow-result-card.js +0 -8
  290. package/dist/flow-schedule.js +0 -74
  291. package/dist/flow-scripts.js +0 -13
  292. package/dist/flow-secrets.js +0 -10
  293. package/dist/flow-send.js +0 -45
  294. package/dist/flow-share.js +0 -60
  295. package/dist/flow-sort.js +1 -24
  296. package/dist/flow-starters-ui.js +0 -2
  297. package/dist/flow-starters.js +0 -13
  298. package/dist/flow-steps.js +0 -80
  299. package/dist/flow-triggers.js +2 -256
  300. package/dist/flow-unattended-words.js +0 -13
  301. package/dist/flow-unattended.js +2 -115
  302. package/dist/flows-cli.js +2 -36
  303. package/dist/flows-ui.js +0 -51
  304. package/dist/flows.js +0 -158
  305. package/dist/folder-gate.js +0 -21
  306. package/dist/folder-look.js +0 -42
  307. package/dist/follow-through-brief.js +0 -6
  308. package/dist/follow-through-cli.js +0 -5
  309. package/dist/fonts.js +0 -13
  310. package/dist/gaps.js +0 -20
  311. package/dist/gate-failure.js +0 -7
  312. package/dist/git-floor.js +0 -12
  313. package/dist/git-incident.js +2 -38
  314. package/dist/git-views.js +0 -24
  315. package/dist/git.js +0 -31
  316. package/dist/github-import.js +0 -22
  317. package/dist/github-jobs.js +0 -12
  318. package/dist/google-mail.js +2 -27
  319. package/dist/grant.js +0 -110
  320. package/dist/graph.js +0 -108
  321. package/dist/guides.js +4 -15
  322. package/dist/handover-note.js +0 -12
  323. package/dist/health-cli.js +0 -2
  324. package/dist/home-groups.js +0 -15
  325. package/dist/html.js +0 -54
  326. package/dist/install-method.js +0 -12
  327. package/dist/integrations-ui.js +0 -15
  328. package/dist/integrations.js +7 -50
  329. package/dist/invoke.js +1 -381
  330. package/dist/is-record.js +0 -1
  331. package/dist/issues.js +0 -48
  332. package/dist/jsonl-discriminants.js +0 -6
  333. package/dist/keymap.js +0 -17
  334. package/dist/keys.js +0 -56
  335. package/dist/kits-ui.js +0 -3
  336. package/dist/kits.js +1 -24
  337. package/dist/knowledge-cli.js +0 -4
  338. package/dist/knowledge-ui.js +0 -8
  339. package/dist/landed-cleanup.js +0 -119
  340. package/dist/laptop-background.js +0 -85
  341. package/dist/laptop-service.js +0 -67
  342. package/dist/latency-timeline.js +2 -23
  343. package/dist/lead-about.js +0 -7
  344. package/dist/lead-answer-eval.js +0 -39
  345. package/dist/lead-capabilities.js +0 -19
  346. package/dist/lead-cli-live.js +0 -22
  347. package/dist/lead-cli.js +0 -27
  348. package/dist/lead-commitments.js +1 -27
  349. package/dist/lead-context.js +2 -42
  350. package/dist/lead-contract.js +0 -8
  351. package/dist/lead-doors.js +0 -105
  352. package/dist/lead-follow.js +0 -41
  353. package/dist/lead-identity.js +1 -4
  354. package/dist/lead-latency-schema.js +0 -13
  355. package/dist/lead-people.js +3 -18
  356. package/dist/lead-progress.js +0 -12
  357. package/dist/lead-queue-runtime.js +0 -26
  358. package/dist/lead-queue.js +0 -35
  359. package/dist/lead-route.js +0 -33
  360. package/dist/lead-status.js +0 -37
  361. package/dist/lead-sweep.js +0 -18
  362. package/dist/lead-tools.js +0 -160
  363. package/dist/lead-voice.js +0 -54
  364. package/dist/lead.js +2 -105
  365. package/dist/learning-child.js +0 -6
  366. package/dist/learning-look.js +0 -14
  367. package/dist/ledger-chain.js +0 -34
  368. package/dist/ledger-csv.js +0 -2
  369. package/dist/ledger-view.js +0 -3
  370. package/dist/lesson-notes.js +0 -56
  371. package/dist/limits-ui.js +0 -14
  372. package/dist/link.js +0 -79
  373. package/dist/live-backup.js +3 -33
  374. package/dist/live-bus.js +7 -81
  375. package/dist/live-children-read.js +4 -47
  376. package/dist/live-children.js +4 -44
  377. package/dist/live-detail.js +0 -17
  378. package/dist/live-input.js +5 -68
  379. package/dist/live-main-read.js +1 -14
  380. package/dist/live-notes.js +0 -12
  381. package/dist/live-open.js +1 -23
  382. package/dist/live-records.js +4 -151
  383. package/dist/live-reply.js +1 -51
  384. package/dist/live-terminal.js +12 -111
  385. package/dist/live.js +4 -130
  386. package/dist/local-owner-acts.js +0 -53
  387. package/dist/local-owner.js +2 -93
  388. package/dist/log.js +0 -8
  389. package/dist/login-secrets.js +2 -38
  390. package/dist/machine-check.js +0 -2
  391. package/dist/machine-identity.js +1 -46
  392. package/dist/mailbox.js +0 -30
  393. package/dist/maintenance.js +1 -3
  394. package/dist/mcp-connect.js +0 -88
  395. package/dist/mcp-core.js +0 -45
  396. package/dist/mcp-http.js +0 -13
  397. package/dist/mcp-oauth.js +0 -37
  398. package/dist/mcp-person.js +0 -11
  399. package/dist/mcp.js +3 -73
  400. package/dist/memory-cli.js +0 -3
  401. package/dist/memory-pass.js +0 -53
  402. package/dist/memory-tidy.js +0 -55
  403. package/dist/memory-use.js +2 -24
  404. package/dist/merge-checklist.js +21 -29
  405. package/dist/metrics.js +0 -10
  406. package/dist/mobile-viewport.js +0 -6
  407. package/dist/model-catalog.js +1 -33
  408. package/dist/model-choices.js +9 -84
  409. package/dist/model-names.js +0 -9
  410. package/dist/models-cli.js +0 -13
  411. package/dist/models-ui.js +0 -17
  412. package/dist/modes.js +0 -35
  413. package/dist/monitoring-settings.js +2 -27
  414. package/dist/monitoring-ui.js +2 -14
  415. package/dist/monitoring.js +2 -38
  416. package/dist/names.js +0 -39
  417. package/dist/needs-you.js +7 -70
  418. package/dist/never-index.js +0 -9
  419. package/dist/nightly-check.js +0 -74
  420. package/dist/nightly-github.js +0 -168
  421. package/dist/notification-delivery.js +0 -3
  422. package/dist/notification-rows.js +0 -17
  423. package/dist/oauth-run-token.js +1 -37
  424. package/dist/observations.js +0 -16
  425. package/dist/oidc.js +1 -20
  426. package/dist/onboard.js +4 -57
  427. package/dist/one-step-chat-schema.js +0 -15
  428. package/dist/openrouter-models.js +0 -6
  429. package/dist/operate-remote-arguments.js +0 -17
  430. package/dist/operate-remote.js +0 -33
  431. package/dist/operate.js +227 -2326
  432. package/dist/orphan-sweep.js +3 -37
  433. package/dist/page-work-contract.js +0 -3
  434. package/dist/password-bearer.js +1 -11
  435. package/dist/passwordless.js +0 -3
  436. package/dist/peek-cli.js +0 -46
  437. package/dist/peek.js +2 -61
  438. package/dist/people-audit-ui.js +0 -6
  439. package/dist/person-proof.js +0 -6
  440. package/dist/phase-routing.js +8 -183
  441. package/dist/plain-schema.js +0 -14
  442. package/dist/plain-words.js +18 -12
  443. package/dist/plan-auto.js +0 -20
  444. package/dist/plan-login.js +0 -16
  445. package/dist/plan.js +0 -68
  446. package/dist/plane-review.js +0 -56
  447. package/dist/planner-source.js +0 -96
  448. package/dist/planner.js +0 -117
  449. package/dist/policy-ui.js +0 -8
  450. package/dist/policy.js +0 -47
  451. package/dist/prepared-evidence.js +0 -5
  452. package/dist/principal.js +0 -29
  453. package/dist/probe.js +0 -30
  454. package/dist/process-custody.js +0 -15
  455. package/dist/process-liveness.js +0 -32
  456. package/dist/process-tree.js +3 -29
  457. package/dist/project-access.js +0 -10
  458. package/dist/project-admission.js +1 -41
  459. package/dist/project-cli.js +0 -6
  460. package/dist/project-concurrency.js +0 -35
  461. package/dist/project-delete-ui.js +4 -29
  462. package/dist/project-delete.js +1 -73
  463. package/dist/project-demo.js +0 -13
  464. package/dist/project-file.js +0 -2
  465. package/dist/project-identity.js +0 -41
  466. package/dist/project-knowledge.js +0 -39
  467. package/dist/project-learning.js +3 -55
  468. package/dist/project-memory.js +2 -45
  469. package/dist/project-outcomes.js +0 -6
  470. package/dist/project-sandbox.js +0 -23
  471. package/dist/project-skills.js +0 -12
  472. package/dist/project-tools.js +6 -184
  473. package/dist/project.js +0 -48
  474. package/dist/prompt.js +0 -31
  475. package/dist/proof.js +0 -220
  476. package/dist/proposal.js +0 -50
  477. package/dist/protected-storage-look.js +0 -6
  478. package/dist/protected-storage.js +1 -84
  479. package/dist/provider-auth.js +3 -69
  480. package/dist/provider-capture.js +1 -15
  481. package/dist/provider-connection.js +0 -8
  482. package/dist/provider-home.js +0 -25
  483. package/dist/provider-limits.js +0 -14
  484. package/dist/provider.js +0 -324
  485. package/dist/public-access.js +0 -34
  486. package/dist/public-check.js +0 -16
  487. package/dist/publish.js +1 -150
  488. package/dist/pull-request-flow.js +0 -77
  489. package/dist/pull-request-schema.js +0 -4
  490. package/dist/pull-request-ui.js +0 -5
  491. package/dist/pulls.js +0 -80
  492. package/dist/push.js +5 -89
  493. package/dist/quick-start.js +1 -23
  494. package/dist/read-executor-worker.js +0 -1
  495. package/dist/read-executor.js +0 -10
  496. package/dist/read-only-request.js +0 -7
  497. package/dist/recipe-ui.js +0 -6
  498. package/dist/recipes.js +0 -13
  499. package/dist/release-adapters.js +6 -214
  500. package/dist/release-approval.js +0 -74
  501. package/dist/release-authority.js +0 -42
  502. package/dist/release-auto.js +0 -142
  503. package/dist/release-card.js +0 -100
  504. package/dist/release-carry.js +0 -132
  505. package/dist/release-ci-hold.js +0 -20
  506. package/dist/release-cli.js +0 -46
  507. package/dist/release-coverage.js +0 -16
  508. package/dist/release-gate.js +0 -30
  509. package/dist/release-git.js +0 -24
  510. package/dist/release-links.js +0 -17
  511. package/dist/release-net.js +0 -42
  512. package/dist/release-next.js +0 -25
  513. package/dist/release-recheck.js +0 -89
  514. package/dist/release-refusal.js +0 -18
  515. package/dist/release-view.js +0 -5
  516. package/dist/release.js +7 -341
  517. package/dist/releases.js +0 -49
  518. package/dist/remote-audit.js +0 -25
  519. package/dist/remote-command.js +0 -16
  520. package/dist/remote-destination.js +5 -26
  521. package/dist/remote-exec.js +1 -27
  522. package/dist/remote-main.js +1 -53
  523. package/dist/remote-run.js +0 -5
  524. package/dist/remote.js +0 -49
  525. package/dist/render.js +0 -133
  526. package/dist/reply-shape.js +0 -85
  527. package/dist/reply-voice.js +0 -7
  528. package/dist/report-summary.js +0 -5
  529. package/dist/reported-usage.js +0 -30
  530. package/dist/repos.js +9 -62
  531. package/dist/repository-context.js +1 -24
  532. package/dist/request-budget-ui.js +0 -4
  533. package/dist/request-budget.js +0 -23
  534. package/dist/restart-certification.js +0 -37
  535. package/dist/result-actions.js +0 -62
  536. package/dist/result-acts.js +0 -34
  537. package/dist/result-completion.js +0 -25
  538. package/dist/result-evidence-readers.js +0 -3
  539. package/dist/result-follow-ups.js +1 -39
  540. package/dist/result-review.js +0 -86
  541. package/dist/result-shots.js +0 -39
  542. package/dist/retention-ui.js +0 -7
  543. package/dist/retention.js +2 -46
  544. package/dist/review-context.js +0 -129
  545. package/dist/review-evidence.js +0 -4
  546. package/dist/review-switch.js +1 -7
  547. package/dist/reviewer.js +0 -35
  548. package/dist/route-change-check.js +0 -2
  549. package/dist/route-change.js +0 -16
  550. package/dist/route-hooks.js +0 -27
  551. package/dist/route-results.js +2 -58
  552. package/dist/route-rules.js +1 -106
  553. package/dist/route-savings.js +0 -36
  554. package/dist/route-store.js +1 -133
  555. package/dist/run-closeout.js +2 -50
  556. package/dist/run-efficiency.js +2 -44
  557. package/dist/run-ending.js +0 -13
  558. package/dist/runner-process.js +0 -33
  559. package/dist/runner.js +17 -189
  560. package/dist/sample-project.js +2 -27
  561. package/dist/sandbox-launch.js +4 -25
  562. package/dist/sandbox-runtime.js +1 -88
  563. package/dist/scan.js +0 -27
  564. package/dist/scope.js +4 -567
  565. package/dist/scout-browser-lock.js +0 -6
  566. package/dist/scout-browser.js +2 -68
  567. package/dist/scout-net.js +1 -32
  568. package/dist/scout-report.js +0 -22
  569. package/dist/scout.js +1 -116
  570. package/dist/secret-mint.js +0 -6
  571. package/dist/serve.js +21 -555
  572. package/dist/server/agents-computers.js +0 -10
  573. package/dist/server/agents-live-filed.js +0 -13
  574. package/dist/server/agents-live-lead.js +0 -19
  575. package/dist/server/agents-live-room.js +0 -19
  576. package/dist/server/chat.js +2 -194
  577. package/dist/server/chrome.js +17 -263
  578. package/dist/server/console.css +4 -4
  579. package/dist/server/edge-refusal.js +0 -3
  580. package/dist/server/flows.js +5 -74
  581. package/dist/server/guards.js +1 -88
  582. package/dist/server/handler-registry.js +0 -2
  583. package/dist/server/home-asks.js +1 -22
  584. package/dist/server/home.js +1 -30
  585. package/dist/server/http.js +0 -82
  586. package/dist/server/in-place.js +0 -15
  587. package/dist/server/kit-standalone.js +0 -20
  588. package/dist/server/kit.js +2 -114
  589. package/dist/server/last-checks.js +0 -2
  590. package/dist/server/live.js +1 -36
  591. package/dist/server/merge-ready-view.js +0 -6
  592. package/dist/server/mutation-key.js +3 -40
  593. package/dist/server/pages-assets.js +0 -16
  594. package/dist/server/pages.js +7 -195
  595. package/dist/server/people-tokens.js +3 -101
  596. package/dist/server/remote-hooks.js +0 -13
  597. package/dist/server/remote.js +0 -28
  598. package/dist/server/render-chat.js +8 -144
  599. package/dist/server/render-code-map.js +0 -5
  600. package/dist/server/render-flaky.js +0 -8
  601. package/dist/server/render-follow-through.js +2 -5
  602. package/dist/server/render-history.js +2 -34
  603. package/dist/server/render-new-task.js +2 -29
  604. package/dist/server/render-pages.js +1 -111
  605. package/dist/server/render-people.js +2 -46
  606. package/dist/server/render-projects.js +15 -32
  607. package/dist/server/render-release.js +1 -14
  608. package/dist/server/render-results.js +4 -355
  609. package/dist/server/render-settings.js +0 -15
  610. package/dist/server/render-tasks.js +13 -493
  611. package/dist/server/request-context.js +2 -9
  612. package/dist/server/retired-routes.js +0 -11
  613. package/dist/server/route-policy.js +0 -3
  614. package/dist/server/route-table.js +6 -135
  615. package/dist/server/runtime.js +0 -1
  616. package/dist/server/session.js +0 -28
  617. package/dist/server/settings.js +40 -246
  618. package/dist/server/signup-gate.js +0 -11
  619. package/dist/server/sweeps.js +0 -6
  620. package/dist/server/task-views.js +9 -227
  621. package/dist/server/tasks.js +5 -539
  622. package/dist/server/terminals.js +2 -46
  623. package/dist/server/welcome.js +2 -22
  624. package/dist/server-telemetry.js +0 -9
  625. package/dist/settings-groups-ui.js +50 -63
  626. package/dist/settings-kit-script.js +0 -19
  627. package/dist/settings-kit.js +0 -63
  628. package/dist/settings-proofs.js +0 -23
  629. package/dist/setup-guide.js +1 -9
  630. package/dist/shared-deps.js +9 -84
  631. package/dist/sign-in-guard.js +0 -27
  632. package/dist/skills-ui.js +0 -2
  633. package/dist/skills.js +2 -54
  634. package/dist/slack-api.js +0 -3
  635. package/dist/slack-chat.js +0 -25
  636. package/dist/slack-settings.js +0 -1
  637. package/dist/slack-socket.js +0 -5
  638. package/dist/slack.js +0 -4
  639. package/dist/sleep.js +0 -1
  640. package/dist/source-key.js +0 -10
  641. package/dist/spend-report.js +0 -29
  642. package/dist/spend-ui.js +0 -26
  643. package/dist/spend.js +0 -40
  644. package/dist/sqlite-runtime.js +0 -2
  645. package/dist/sqlite-telemetry.js +0 -9
  646. package/dist/sso-settings.js +0 -13
  647. package/dist/sso-ui.js +0 -2
  648. package/dist/staged-runtimes.js +5 -39
  649. package/dist/steer-capabilities.js +1 -7
  650. package/dist/steer-controls.js +0 -10
  651. package/dist/steer-live.js +0 -31
  652. package/dist/steer-mailbox.js +4 -65
  653. package/dist/steer-status.js +0 -7
  654. package/dist/stop-proof.js +5 -62
  655. package/dist/storage-sweep-child.js +1 -5
  656. package/dist/storage-sweep-process.js +2 -20
  657. package/dist/storage-sweep-schedule.js +0 -32
  658. package/dist/storage-sweep.js +2 -51
  659. package/dist/storage-ui.js +0 -18
  660. package/dist/storage.js +0 -31
  661. package/dist/store-baseline.js +0 -14
  662. package/dist/store.js +109 -4763
  663. package/dist/stream-scope.js +0 -16
  664. package/dist/structured-output.js +0 -39
  665. package/dist/style-asset.js +0 -2
  666. package/dist/subagent-admin.js +0 -9
  667. package/dist/subagent-desk.js +0 -29
  668. package/dist/subagent-memory.js +0 -38
  669. package/dist/subagent-question.js +0 -29
  670. package/dist/subagent-tools.js +1 -60
  671. package/dist/subagent-week.js +0 -28
  672. package/dist/subagent-work.js +1 -39
  673. package/dist/subagents-ui.js +1 -13
  674. package/dist/subagents.js +0 -40
  675. package/dist/subscription-chat.js +1 -42
  676. package/dist/summary.js +0 -19
  677. package/dist/surface.js +0 -75
  678. package/dist/sweep-gate.js +0 -2
  679. package/dist/sweep-quarantine.js +2 -13
  680. package/dist/sync.js +0 -47
  681. package/dist/tailnet.js +0 -9
  682. package/dist/tamper-scan.js +0 -15
  683. package/dist/task-activity.js +1 -16
  684. package/dist/task-aliases.js +0 -3
  685. package/dist/task-archive.js +0 -7
  686. package/dist/task-base.js +0 -18
  687. package/dist/task-composer.js +0 -2
  688. package/dist/task-control.js +0 -74
  689. package/dist/task-live.js +0 -23
  690. package/dist/task-moves.js +0 -28
  691. package/dist/task-outcome-cli.js +17 -28
  692. package/dist/task-review-brief.js +0 -7
  693. package/dist/task-sizing.js +0 -47
  694. package/dist/task-source.js +0 -23
  695. package/dist/task-status.js +0 -106
  696. package/dist/task-text.js +0 -12
  697. package/dist/team-chat-authorization.js +0 -3
  698. package/dist/team-contract.js +0 -2
  699. package/dist/team-http.js +0 -4
  700. package/dist/team-leads.js +1 -16
  701. package/dist/team-runtime.js +0 -13
  702. package/dist/team-ui.js +0 -1
  703. package/dist/team-updates.js +0 -4
  704. package/dist/teams-api.js +0 -12
  705. package/dist/teams-chat.js +0 -28
  706. package/dist/teams.js +0 -12
  707. package/dist/teardown-git.js +6 -294
  708. package/dist/telegram-flow.js +0 -51
  709. package/dist/telegram-lead.js +2 -203
  710. package/dist/telegram-live.js +1 -42
  711. package/dist/telegram-progress.js +0 -18
  712. package/dist/telegram-settings.js +0 -7
  713. package/dist/telegram-status.js +0 -46
  714. package/dist/telegram-team.js +1 -33
  715. package/dist/telegram.js +6 -454
  716. package/dist/templates.js +0 -24
  717. package/dist/terminal-catalog.js +2 -20
  718. package/dist/terminal-text.js +0 -12
  719. package/dist/test-infra.js +0 -50
  720. package/dist/test-temp.js +3 -26
  721. package/dist/text-limits.js +0 -92
  722. package/dist/tidy.js +0 -76
  723. package/dist/tier-report.js +0 -2
  724. package/dist/token-notices.js +1 -9
  725. package/dist/tokens-cli.js +0 -13
  726. package/dist/tool-broker.js +2 -53
  727. package/dist/tool-launcher.js +0 -14
  728. package/dist/tool-secret-store.js +3 -125
  729. package/dist/toolroll-update-cli.js +0 -9
  730. package/dist/toolroll-update-ui.js +0 -14
  731. package/dist/toolroll-update.js +13 -252
  732. package/dist/tools-ui.js +0 -17
  733. package/dist/transitions-recipes.js +0 -2
  734. package/dist/tree-proof.js +0 -23
  735. package/dist/tui-contract.js +0 -8
  736. package/dist/tui-source.js +16 -36
  737. package/dist/tui.js +1 -1
  738. package/dist/typed-start.js +0 -27
  739. package/dist/unfenced-test-support.js +0 -5
  740. package/dist/up-processes.js +1 -40
  741. package/dist/up-role-child.js +1 -13
  742. package/dist/update-notice.js +0 -1
  743. package/dist/vanished-retry.js +0 -40
  744. package/dist/verification-evidence.js +0 -39
  745. package/dist/version.js +0 -1
  746. package/dist/wake-hub.js +0 -28
  747. package/dist/webhook-limits.js +0 -7
  748. package/dist/webhook-readers.js +0 -30
  749. package/dist/webhook-signing.js +0 -14
  750. package/dist/webhooks.js +0 -54
  751. package/dist/welcome-facts.js +2 -14
  752. package/dist/when-html.js +0 -27
  753. package/dist/work-index.js +26 -98
  754. package/dist/work-summary.js +2 -17
  755. package/dist/workspace-motion.js +0 -2
  756. package/dist/workspace-revision.js +1 -21
  757. package/dist/workspace-ui.js +15 -135
  758. package/dist/worktree-notices.js +0 -3
  759. package/dist/worktree.js +0 -308
  760. package/dist/writes-mode.js +0 -1
  761. package/dist/youiyoux-intake.js +4 -159
  762. package/package.json +4 -3
  763. package/dist/accent-colors.d.ts +0 -51
  764. package/dist/acp-agents.d.ts +0 -43
  765. package/dist/acp-attest.d.ts +0 -44
  766. package/dist/acp-check.d.ts +0 -37
  767. package/dist/acp-client.d.ts +0 -163
  768. package/dist/acp-inspect.d.ts +0 -23
  769. package/dist/action-ledger.d.ts +0 -27
  770. package/dist/activity-line.d.ts +0 -29
  771. package/dist/actor.d.ts +0 -11
  772. package/dist/agent-board.d.ts +0 -229
  773. package/dist/agent-fence.d.ts +0 -479
  774. package/dist/agent-onboard.d.ts +0 -158
  775. package/dist/agent-pulse.d.ts +0 -43
  776. package/dist/agent-state-words.d.ts +0 -19
  777. package/dist/agent-state.d.ts +0 -65
  778. package/dist/agent-turns.d.ts +0 -52
  779. package/dist/agentconfig.d.ts +0 -191
  780. package/dist/agents-board.d.ts +0 -145
  781. package/dist/agents-live.d.ts +0 -31
  782. package/dist/api-tokens.d.ts +0 -80
  783. package/dist/approval-authority.d.ts +0 -51
  784. package/dist/approval-password.d.ts +0 -31
  785. package/dist/approval-policy.d.ts +0 -69
  786. package/dist/approval-rules-ui.d.ts +0 -40
  787. package/dist/assignment-adapters.d.ts +0 -152
  788. package/dist/assignment-brief.d.ts +0 -83
  789. package/dist/assignment-delivery.d.ts +0 -86
  790. package/dist/assignment-presentation.d.ts +0 -37
  791. package/dist/assignment-status.d.ts +0 -71
  792. package/dist/assignment-ui.d.ts +0 -68
  793. package/dist/assignment.d.ts +0 -350
  794. package/dist/attest.d.ts +0 -59
  795. package/dist/audit-cli.d.ts +0 -17
  796. package/dist/backend.d.ts +0 -97
  797. package/dist/backup-ui.d.ts +0 -32
  798. package/dist/backup.d.ts +0 -92
  799. package/dist/batch-checks.d.ts +0 -15
  800. package/dist/batch-policy.d.ts +0 -23
  801. package/dist/beads.d.ts +0 -34
  802. package/dist/bin.d.ts +0 -2
  803. package/dist/board.d.ts +0 -134
  804. package/dist/boot-identity.d.ts +0 -64
  805. package/dist/bounded-spawn.d.ts +0 -57
  806. package/dist/brand-icons.d.ts +0 -168
  807. package/dist/brand-mark.d.ts +0 -28
  808. package/dist/brief-fence.d.ts +0 -9
  809. package/dist/browser-crew.d.ts +0 -12
  810. package/dist/browser-shell.d.ts +0 -9
  811. package/dist/browser-workspace.d.ts +0 -1985
  812. package/dist/budget-alerts.d.ts +0 -19
  813. package/dist/build-review.d.ts +0 -38
  814. package/dist/builder-restart.d.ts +0 -21
  815. package/dist/builder.d.ts +0 -409
  816. package/dist/canonical-json.d.ts +0 -14
  817. package/dist/capscan.d.ts +0 -35
  818. package/dist/card-catalog.d.ts +0 -209
  819. package/dist/card-cli.d.ts +0 -43
  820. package/dist/card-render.d.ts +0 -43
  821. package/dist/card-sources.d.ts +0 -68
  822. package/dist/chat-acceptance.d.ts +0 -74
  823. package/dist/chat-actions.d.ts +0 -460
  824. package/dist/chat-admission.d.ts +0 -19
  825. package/dist/chat-approval.d.ts +0 -58
  826. package/dist/chat-ask.d.ts +0 -32
  827. package/dist/chat-card-part.d.ts +0 -11
  828. package/dist/chat-card.d.ts +0 -46
  829. package/dist/chat-channel.d.ts +0 -126
  830. package/dist/chat-continuity.d.ts +0 -32
  831. package/dist/chat-controls.d.ts +0 -117
  832. package/dist/chat-core.d.ts +0 -177
  833. package/dist/chat-decide.d.ts +0 -269
  834. package/dist/chat-delivery-state.d.ts +0 -132
  835. package/dist/chat-delivery.d.ts +0 -71
  836. package/dist/chat-display.d.ts +0 -1
  837. package/dist/chat-evidence.d.ts +0 -123
  838. package/dist/chat-flow.d.ts +0 -70
  839. package/dist/chat-follow.d.ts +0 -20
  840. package/dist/chat-inbox.d.ts +0 -57
  841. package/dist/chat-live-schema.d.ts +0 -17
  842. package/dist/chat-live.d.ts +0 -161
  843. package/dist/chat-message-states.d.ts +0 -75
  844. package/dist/chat-messages.d.ts +0 -338
  845. package/dist/chat-migration.d.ts +0 -30
  846. package/dist/chat-polish.d.ts +0 -17
  847. package/dist/chat-quiet.d.ts +0 -40
  848. package/dist/chat-review.d.ts +0 -51
  849. package/dist/chat-rooms.d.ts +0 -123
  850. package/dist/chat-settings-page.d.ts +0 -43
  851. package/dist/chat-task-actions.d.ts +0 -59
  852. package/dist/chat-terms.d.ts +0 -29
  853. package/dist/chat-voice.d.ts +0 -69
  854. package/dist/chat-warmth.d.ts +0 -21
  855. package/dist/check-access.d.ts +0 -54
  856. package/dist/check-facts.d.ts +0 -126
  857. package/dist/check-failure.d.ts +0 -113
  858. package/dist/check-levels-ui.d.ts +0 -36
  859. package/dist/check-levels.d.ts +0 -70
  860. package/dist/check-load.d.ts +0 -85
  861. package/dist/check-only-standing.d.ts +0 -36
  862. package/dist/check-only.d.ts +0 -15
  863. package/dist/check-progress.d.ts +0 -78
  864. package/dist/check-repair.d.ts +0 -47
  865. package/dist/check-report.d.ts +0 -177
  866. package/dist/check-stamp.d.ts +0 -46
  867. package/dist/checkout-cleanup.d.ts +0 -157
  868. package/dist/checkout-proof.d.ts +0 -28
  869. package/dist/child-database.d.ts +0 -12
  870. package/dist/claim.d.ts +0 -627
  871. package/dist/claude-print.d.ts +0 -12
  872. package/dist/cli-fast.d.ts +0 -8
  873. package/dist/cli-help.d.ts +0 -8
  874. package/dist/cli-http.d.ts +0 -58
  875. package/dist/cli.d.ts +0 -149
  876. package/dist/code-extract.d.ts +0 -44
  877. package/dist/code-map-acts.d.ts +0 -24
  878. package/dist/code-map-admission.d.ts +0 -52
  879. package/dist/code-map-build.d.ts +0 -63
  880. package/dist/code-map-cli.d.ts +0 -153
  881. package/dist/code-map-main.d.ts +0 -1
  882. package/dist/code-map-read.d.ts +0 -106
  883. package/dist/code-map-report.d.ts +0 -37
  884. package/dist/code-map-shape.d.ts +0 -172
  885. package/dist/code-map-store.d.ts +0 -136
  886. package/dist/codex-limits.d.ts +0 -15
  887. package/dist/coding-context.d.ts +0 -18
  888. package/dist/coding-handoff.d.ts +0 -39
  889. package/dist/coding-provider.d.ts +0 -88
  890. package/dist/coding-shipping-ui.d.ts +0 -5
  891. package/dist/coding-types.d.ts +0 -16
  892. package/dist/coding-ui.d.ts +0 -19
  893. package/dist/coding-update.d.ts +0 -28
  894. package/dist/coding-workspace.d.ts +0 -141
  895. package/dist/commit-extract.d.ts +0 -135
  896. package/dist/connect-cli.d.ts +0 -34
  897. package/dist/console-chrome.d.ts +0 -41
  898. package/dist/console-instance.d.ts +0 -157
  899. package/dist/container-state.d.ts +0 -5
  900. package/dist/containment.d.ts +0 -205
  901. package/dist/contract-changes.d.ts +0 -52
  902. package/dist/contracts/acceptance-terms.d.ts +0 -14
  903. package/dist/contracts/chat-actions.d.ts +0 -465
  904. package/dist/contracts/chat-callback-rows.d.ts +0 -59
  905. package/dist/contracts/chat-card.d.ts +0 -91
  906. package/dist/contracts/chat-content.d.ts +0 -551
  907. package/dist/contracts/chat-tables.d.ts +0 -12
  908. package/dist/contracts/cli.d.ts +0 -987
  909. package/dist/contracts/coding-activity.d.ts +0 -64
  910. package/dist/contracts/coding-context.d.ts +0 -97
  911. package/dist/contracts/coding-handoff.d.ts +0 -44
  912. package/dist/contracts/coding-workspace.d.ts +0 -165
  913. package/dist/contracts/console-api.d.ts +0 -540
  914. package/dist/contracts/contract-test.d.ts +0 -45
  915. package/dist/contracts/contract.d.ts +0 -92
  916. package/dist/contracts/decision.d.ts +0 -45
  917. package/dist/contracts/diff-stat.d.ts +0 -58
  918. package/dist/contracts/discord-callback.d.ts +0 -45
  919. package/dist/contracts/flow-card.d.ts +0 -53
  920. package/dist/contracts/flow-propose.d.ts +0 -334
  921. package/dist/contracts/flow-send.d.ts +0 -245
  922. package/dist/contracts/flow.d.ts +0 -19565
  923. package/dist/contracts/gateway-tools.d.ts +0 -472
  924. package/dist/contracts/handoff.d.ts +0 -91
  925. package/dist/contracts/health.d.ts +0 -82
  926. package/dist/contracts/integration-metadata.d.ts +0 -100
  927. package/dist/contracts/lead-context.d.ts +0 -165
  928. package/dist/contracts/lead-tools.d.ts +0 -2312
  929. package/dist/contracts/mcp-oauth.d.ts +0 -53
  930. package/dist/contracts/memory-pass.d.ts +0 -157
  931. package/dist/contracts/model-catalog.d.ts +0 -21
  932. package/dist/contracts/observation-request.d.ts +0 -37
  933. package/dist/contracts/plan.d.ts +0 -58
  934. package/dist/contracts/project-knowledge.d.ts +0 -159
  935. package/dist/contracts/project-memory.d.ts +0 -119
  936. package/dist/contracts/project-skills.d.ts +0 -120
  937. package/dist/contracts/proof.d.ts +0 -136
  938. package/dist/contracts/provider.d.ts +0 -40
  939. package/dist/contracts/recipes.d.ts +0 -166
  940. package/dist/contracts/release-check.d.ts +0 -371
  941. package/dist/contracts/release-terms.d.ts +0 -107
  942. package/dist/contracts/retention.d.ts +0 -42
  943. package/dist/contracts/review-findings.d.ts +0 -46
  944. package/dist/contracts/route-results.d.ts +0 -121
  945. package/dist/contracts/route.d.ts +0 -897
  946. package/dist/contracts/scope.d.ts +0 -105
  947. package/dist/contracts/scout-report.d.ts +0 -234
  948. package/dist/contracts/slack-callback.d.ts +0 -43
  949. package/dist/contracts/sort-answer.d.ts +0 -83
  950. package/dist/contracts/stage-output.d.ts +0 -127
  951. package/dist/contracts/storage.d.ts +0 -37
  952. package/dist/contracts/store-json.d.ts +0 -313
  953. package/dist/contracts/subagent-turn.d.ts +0 -43
  954. package/dist/contracts/task-sizing.d.ts +0 -24
  955. package/dist/contracts/teams-callback.d.ts +0 -13
  956. package/dist/contracts/telegram-callback.d.ts +0 -120
  957. package/dist/contracts/trigger-payloads.d.ts +0 -389
  958. package/dist/contracts/update-journal.d.ts +0 -254
  959. package/dist/contracts/verification-receipt.d.ts +0 -200
  960. package/dist/contracts/verification-view.d.ts +0 -102
  961. package/dist/contracts/youiyoux-request.d.ts +0 -248
  962. package/dist/control-setup.d.ts +0 -44
  963. package/dist/control-ui.d.ts +0 -37
  964. package/dist/controller-service.d.ts +0 -1
  965. package/dist/controller-supervisor.d.ts +0 -38
  966. package/dist/converse.d.ts +0 -316
  967. package/dist/coordinator-proposals.d.ts +0 -29
  968. package/dist/coordinator.d.ts +0 -186
  969. package/dist/credentials-ui.d.ts +0 -33
  970. package/dist/daemon.d.ts +0 -226
  971. package/dist/database-reclaim.d.ts +0 -4
  972. package/dist/decision.d.ts +0 -119
  973. package/dist/demo-chat.d.ts +0 -32
  974. package/dist/demo.d.ts +0 -153
  975. package/dist/deploy-gate.d.ts +0 -20
  976. package/dist/deploy-lock.d.ts +0 -8
  977. package/dist/deploy-phase.d.ts +0 -37
  978. package/dist/deploy-rescue.d.ts +0 -42
  979. package/dist/deprecations.d.ts +0 -20
  980. package/dist/design/kit.d.ts +0 -216
  981. package/dist/desktop-access.d.ts +0 -28
  982. package/dist/desktop-bundle.d.ts +0 -16
  983. package/dist/desktop-host.d.ts +0 -54
  984. package/dist/desktop-update-gate.d.ts +0 -12
  985. package/dist/desktop-update-recovery.d.ts +0 -14
  986. package/dist/desktop-update.d.ts +0 -147
  987. package/dist/digest-times.d.ts +0 -3
  988. package/dist/disclosure.d.ts +0 -6
  989. package/dist/discord-api.d.ts +0 -24
  990. package/dist/discord-chat.d.ts +0 -27
  991. package/dist/discord-settings.d.ts +0 -4
  992. package/dist/discord.d.ts +0 -10
  993. package/dist/discover.d.ts +0 -75
  994. package/dist/dispatch.d.ts +0 -123
  995. package/dist/dispose.d.ts +0 -194
  996. package/dist/doctor.d.ts +0 -67
  997. package/dist/easy-start-args.d.ts +0 -13
  998. package/dist/easy-start.d.ts +0 -77
  999. package/dist/egress.d.ts +0 -121
  1000. package/dist/email-settings.d.ts +0 -34
  1001. package/dist/envelope.d.ts +0 -47
  1002. package/dist/eval-gate.d.ts +0 -51
  1003. package/dist/eval-hooks.d.ts +0 -94
  1004. package/dist/eval-oracle-main.d.ts +0 -1
  1005. package/dist/eval-oracle.d.ts +0 -60
  1006. package/dist/eval-world.d.ts +0 -17
  1007. package/dist/evals.d.ts +0 -299
  1008. package/dist/evidence-pack.d.ts +0 -186
  1009. package/dist/evidence-pair.d.ts +0 -53
  1010. package/dist/evidence.d.ts +0 -371
  1011. package/dist/exec.d.ts +0 -355
  1012. package/dist/exhaustion.d.ts +0 -58
  1013. package/dist/export-ui.d.ts +0 -11
  1014. package/dist/export.d.ts +0 -48
  1015. package/dist/failing-first.d.ts +0 -31
  1016. package/dist/fallback-schema.d.ts +0 -8
  1017. package/dist/fallback.d.ts +0 -138
  1018. package/dist/fast-start.d.ts +0 -213
  1019. package/dist/fast-terms.d.ts +0 -9
  1020. package/dist/fenced-check-coverage.d.ts +0 -62
  1021. package/dist/findings.d.ts +0 -224
  1022. package/dist/first-run.d.ts +0 -197
  1023. package/dist/first-tasks-child.d.ts +0 -1
  1024. package/dist/flaky-ci.d.ts +0 -31
  1025. package/dist/flaky-cli.d.ts +0 -60
  1026. package/dist/flaky.d.ts +0 -83
  1027. package/dist/fleet-schema.d.ts +0 -17
  1028. package/dist/flow-actions.d.ts +0 -79
  1029. package/dist/flow-browser.d.ts +0 -103
  1030. package/dist/flow-cadence.d.ts +0 -48
  1031. package/dist/flow-card-task.d.ts +0 -11
  1032. package/dist/flow-changed.d.ts +0 -14
  1033. package/dist/flow-code.d.ts +0 -84
  1034. package/dist/flow-draft.d.ts +0 -42
  1035. package/dist/flow-engine.d.ts +0 -82
  1036. package/dist/flow-gallery-ui.d.ts +0 -73
  1037. package/dist/flow-gallery.d.ts +0 -147
  1038. package/dist/flow-insights.d.ts +0 -104
  1039. package/dist/flow-items.d.ts +0 -37
  1040. package/dist/flow-live.d.ts +0 -16
  1041. package/dist/flow-people.d.ts +0 -23
  1042. package/dist/flow-pull-request.d.ts +0 -14
  1043. package/dist/flow-replies.d.ts +0 -48
  1044. package/dist/flow-result-card.d.ts +0 -22
  1045. package/dist/flow-schedule.d.ts +0 -154
  1046. package/dist/flow-scripts.d.ts +0 -31
  1047. package/dist/flow-secrets.d.ts +0 -13
  1048. package/dist/flow-send.d.ts +0 -54
  1049. package/dist/flow-share.d.ts +0 -78
  1050. package/dist/flow-sort.d.ts +0 -63
  1051. package/dist/flow-starters-ui.d.ts +0 -15
  1052. package/dist/flow-starters.d.ts +0 -63
  1053. package/dist/flow-steps.d.ts +0 -52
  1054. package/dist/flow-triggers.d.ts +0 -303
  1055. package/dist/flow-unattended-words.d.ts +0 -48
  1056. package/dist/flow-unattended.d.ts +0 -259
  1057. package/dist/flows-cli.d.ts +0 -358
  1058. package/dist/flows-ui.d.ts +0 -70
  1059. package/dist/flows.d.ts +0 -136
  1060. package/dist/folder-gate.d.ts +0 -32
  1061. package/dist/folder-look.d.ts +0 -110
  1062. package/dist/follow-through-brief.d.ts +0 -12
  1063. package/dist/follow-through-cli.d.ts +0 -23
  1064. package/dist/fonts.d.ts +0 -19
  1065. package/dist/gaps.d.ts +0 -35
  1066. package/dist/gate-failure.d.ts +0 -40
  1067. package/dist/git-floor.d.ts +0 -16
  1068. package/dist/git-incident.d.ts +0 -65
  1069. package/dist/git-views.d.ts +0 -20
  1070. package/dist/git.d.ts +0 -54
  1071. package/dist/github-import.d.ts +0 -62
  1072. package/dist/github-jobs.d.ts +0 -25
  1073. package/dist/google-mail.d.ts +0 -59
  1074. package/dist/grant.d.ts +0 -136
  1075. package/dist/graph.d.ts +0 -164
  1076. package/dist/guides.d.ts +0 -22
  1077. package/dist/handover-note.d.ts +0 -33
  1078. package/dist/health-cli.d.ts +0 -3
  1079. package/dist/home-groups.d.ts +0 -39
  1080. package/dist/html.d.ts +0 -85
  1081. package/dist/install-method.d.ts +0 -17
  1082. package/dist/integrations-ui.d.ts +0 -17
  1083. package/dist/integrations.d.ts +0 -138
  1084. package/dist/invoke.d.ts +0 -228
  1085. package/dist/is-record.d.ts +0 -2
  1086. package/dist/issues.d.ts +0 -41
  1087. package/dist/jsonl-discriminants.d.ts +0 -11
  1088. package/dist/keymap.d.ts +0 -43
  1089. package/dist/keys.d.ts +0 -108
  1090. package/dist/kits-ui.d.ts +0 -16
  1091. package/dist/kits.d.ts +0 -88
  1092. package/dist/knowledge-cli.d.ts +0 -132
  1093. package/dist/knowledge-ui.d.ts +0 -45
  1094. package/dist/landed-cleanup.d.ts +0 -175
  1095. package/dist/laptop-background.d.ts +0 -187
  1096. package/dist/laptop-service.d.ts +0 -111
  1097. package/dist/latency-timeline.d.ts +0 -46
  1098. package/dist/lead-about.d.ts +0 -35
  1099. package/dist/lead-answer-eval.d.ts +0 -93
  1100. package/dist/lead-capabilities.d.ts +0 -57
  1101. package/dist/lead-cli-live.d.ts +0 -56
  1102. package/dist/lead-cli.d.ts +0 -58
  1103. package/dist/lead-commitments.d.ts +0 -84
  1104. package/dist/lead-context.d.ts +0 -45
  1105. package/dist/lead-contract.d.ts +0 -10
  1106. package/dist/lead-doors.d.ts +0 -122
  1107. package/dist/lead-follow.d.ts +0 -26
  1108. package/dist/lead-identity.d.ts +0 -23
  1109. package/dist/lead-latency-schema.d.ts +0 -24
  1110. package/dist/lead-people.d.ts +0 -55
  1111. package/dist/lead-progress.d.ts +0 -67
  1112. package/dist/lead-queue-runtime.d.ts +0 -46
  1113. package/dist/lead-queue.d.ts +0 -104
  1114. package/dist/lead-route.d.ts +0 -56
  1115. package/dist/lead-status.d.ts +0 -116
  1116. package/dist/lead-sweep.d.ts +0 -67
  1117. package/dist/lead-tools.d.ts +0 -167
  1118. package/dist/lead-voice.d.ts +0 -85
  1119. package/dist/lead.d.ts +0 -142
  1120. package/dist/learning-child.d.ts +0 -1
  1121. package/dist/learning-look.d.ts +0 -25
  1122. package/dist/ledger-chain.d.ts +0 -46
  1123. package/dist/ledger-csv.d.ts +0 -4
  1124. package/dist/ledger-view.d.ts +0 -27
  1125. package/dist/lesson-notes.d.ts +0 -81
  1126. package/dist/limits-ui.d.ts +0 -34
  1127. package/dist/link.d.ts +0 -72
  1128. package/dist/live-backup.d.ts +0 -39
  1129. package/dist/live-bus.d.ts +0 -141
  1130. package/dist/live-children-read.d.ts +0 -52
  1131. package/dist/live-children.d.ts +0 -73
  1132. package/dist/live-detail.d.ts +0 -27
  1133. package/dist/live-input.d.ts +0 -68
  1134. package/dist/live-main-read.d.ts +0 -19
  1135. package/dist/live-notes.d.ts +0 -20
  1136. package/dist/live-open.d.ts +0 -28
  1137. package/dist/live-records.d.ts +0 -149
  1138. package/dist/live-reply.d.ts +0 -83
  1139. package/dist/live-terminal.d.ts +0 -273
  1140. package/dist/live.d.ts +0 -152
  1141. package/dist/local-owner-acts.d.ts +0 -83
  1142. package/dist/local-owner.d.ts +0 -135
  1143. package/dist/log.d.ts +0 -7
  1144. package/dist/login-secrets.d.ts +0 -60
  1145. package/dist/machine-check.d.ts +0 -16
  1146. package/dist/machine-identity.d.ts +0 -75
  1147. package/dist/mailbox.d.ts +0 -57
  1148. package/dist/maintenance.d.ts +0 -13
  1149. package/dist/mcp-connect.d.ts +0 -181
  1150. package/dist/mcp-core.d.ts +0 -110
  1151. package/dist/mcp-http.d.ts +0 -32
  1152. package/dist/mcp-oauth.d.ts +0 -92
  1153. package/dist/mcp-person.d.ts +0 -22
  1154. package/dist/mcp.d.ts +0 -20
  1155. package/dist/memory-cli.d.ts +0 -768
  1156. package/dist/memory-pass.d.ts +0 -151
  1157. package/dist/memory-tidy.d.ts +0 -181
  1158. package/dist/memory-use.d.ts +0 -35
  1159. package/dist/merge-checklist.d.ts +0 -55
  1160. package/dist/metrics.d.ts +0 -6
  1161. package/dist/mobile-viewport.d.ts +0 -7
  1162. package/dist/model-catalog.d.ts +0 -123
  1163. package/dist/model-choices.d.ts +0 -235
  1164. package/dist/model-names.d.ts +0 -6
  1165. package/dist/models-cli.d.ts +0 -307
  1166. package/dist/models-ui.d.ts +0 -161
  1167. package/dist/modes.d.ts +0 -99
  1168. package/dist/monitoring-settings.d.ts +0 -44
  1169. package/dist/monitoring-ui.d.ts +0 -23
  1170. package/dist/monitoring.d.ts +0 -34
  1171. package/dist/names.d.ts +0 -67
  1172. package/dist/needs-you.d.ts +0 -164
  1173. package/dist/never-index.d.ts +0 -3
  1174. package/dist/nightly-check.d.ts +0 -107
  1175. package/dist/nightly-github.d.ts +0 -318
  1176. package/dist/notification-delivery.d.ts +0 -19
  1177. package/dist/notification-rows.d.ts +0 -30
  1178. package/dist/oauth-run-token.d.ts +0 -51
  1179. package/dist/observations.d.ts +0 -36
  1180. package/dist/oidc.d.ts +0 -71
  1181. package/dist/onboard.d.ts +0 -108
  1182. package/dist/one-step-chat-schema.d.ts +0 -22
  1183. package/dist/openrouter-models.d.ts +0 -34
  1184. package/dist/operate-remote-arguments.d.ts +0 -36
  1185. package/dist/operate-remote.d.ts +0 -98
  1186. package/dist/operate.d.ts +0 -401
  1187. package/dist/orphan-sweep.d.ts +0 -65
  1188. package/dist/page-work-contract.d.ts +0 -21
  1189. package/dist/password-bearer.d.ts +0 -25
  1190. package/dist/passwordless.d.ts +0 -23
  1191. package/dist/peek-cli.d.ts +0 -112
  1192. package/dist/peek.d.ts +0 -110
  1193. package/dist/people-audit-ui.d.ts +0 -16
  1194. package/dist/person-proof.d.ts +0 -2
  1195. package/dist/phase-routing.d.ts +0 -401
  1196. package/dist/plain-schema.d.ts +0 -23
  1197. package/dist/plain-words.d.ts +0 -20
  1198. package/dist/plan-auto.d.ts +0 -25
  1199. package/dist/plan-login.d.ts +0 -14
  1200. package/dist/plan.d.ts +0 -188
  1201. package/dist/plane-review.d.ts +0 -54
  1202. package/dist/planner-source.d.ts +0 -225
  1203. package/dist/planner.d.ts +0 -76
  1204. package/dist/policy-ui.d.ts +0 -22
  1205. package/dist/policy.d.ts +0 -92
  1206. package/dist/prepared-evidence.d.ts +0 -17
  1207. package/dist/principal.d.ts +0 -42
  1208. package/dist/probe.d.ts +0 -46
  1209. package/dist/process-custody.d.ts +0 -17
  1210. package/dist/process-liveness.d.ts +0 -13
  1211. package/dist/process-tree.d.ts +0 -39
  1212. package/dist/project-access.d.ts +0 -17
  1213. package/dist/project-activity.d.ts +0 -20
  1214. package/dist/project-admission.d.ts +0 -105
  1215. package/dist/project-cli.d.ts +0 -19
  1216. package/dist/project-concurrency.d.ts +0 -62
  1217. package/dist/project-delete-ui.d.ts +0 -96
  1218. package/dist/project-delete.d.ts +0 -59
  1219. package/dist/project-demo.d.ts +0 -12
  1220. package/dist/project-file.d.ts +0 -3
  1221. package/dist/project-identity.d.ts +0 -52
  1222. package/dist/project-knowledge.d.ts +0 -124
  1223. package/dist/project-learning.d.ts +0 -120
  1224. package/dist/project-memory.d.ts +0 -70
  1225. package/dist/project-outcomes.d.ts +0 -119
  1226. package/dist/project-sandbox.d.ts +0 -59
  1227. package/dist/project-skills.d.ts +0 -139
  1228. package/dist/project-tools.d.ts +0 -318
  1229. package/dist/project.d.ts +0 -65
  1230. package/dist/prompt.d.ts +0 -33
  1231. package/dist/proof.d.ts +0 -457
  1232. package/dist/proposal.d.ts +0 -70
  1233. package/dist/protected-storage-look.d.ts +0 -1
  1234. package/dist/protected-storage.d.ts +0 -98
  1235. package/dist/provider-auth.d.ts +0 -143
  1236. package/dist/provider-capture.d.ts +0 -34
  1237. package/dist/provider-connection.d.ts +0 -23
  1238. package/dist/provider-home.d.ts +0 -22
  1239. package/dist/provider-limits.d.ts +0 -37
  1240. package/dist/provider.d.ts +0 -369
  1241. package/dist/public-access.d.ts +0 -61
  1242. package/dist/public-check.d.ts +0 -37
  1243. package/dist/publish.d.ts +0 -146
  1244. package/dist/pull-request-flow.d.ts +0 -189
  1245. package/dist/pull-request-schema.d.ts +0 -5
  1246. package/dist/pull-request-ui.d.ts +0 -25
  1247. package/dist/pulls.d.ts +0 -121
  1248. package/dist/push.d.ts +0 -120
  1249. package/dist/quality.d.ts +0 -8
  1250. package/dist/quick-start.d.ts +0 -26
  1251. package/dist/read-executor-worker.d.ts +0 -1
  1252. package/dist/read-executor.d.ts +0 -66
  1253. package/dist/read-only-request.d.ts +0 -4
  1254. package/dist/recipe-ui.d.ts +0 -21
  1255. package/dist/recipes.d.ts +0 -56
  1256. package/dist/release-adapters.d.ts +0 -205
  1257. package/dist/release-approval.d.ts +0 -180
  1258. package/dist/release-authority.d.ts +0 -173
  1259. package/dist/release-auto.d.ts +0 -184
  1260. package/dist/release-card.d.ts +0 -170
  1261. package/dist/release-carry.d.ts +0 -261
  1262. package/dist/release-ci-hold.d.ts +0 -41
  1263. package/dist/release-cli.d.ts +0 -34
  1264. package/dist/release-coverage.d.ts +0 -16
  1265. package/dist/release-gate.d.ts +0 -84
  1266. package/dist/release-git.d.ts +0 -43
  1267. package/dist/release-links.d.ts +0 -29
  1268. package/dist/release-net.d.ts +0 -90
  1269. package/dist/release-next.d.ts +0 -48
  1270. package/dist/release-recheck.d.ts +0 -146
  1271. package/dist/release-refusal.d.ts +0 -32
  1272. package/dist/release-view.d.ts +0 -37
  1273. package/dist/release.d.ts +0 -806
  1274. package/dist/releases.d.ts +0 -94
  1275. package/dist/remote-audit.d.ts +0 -79
  1276. package/dist/remote-command.d.ts +0 -45
  1277. package/dist/remote-destination.d.ts +0 -36
  1278. package/dist/remote-exec.d.ts +0 -38
  1279. package/dist/remote-main.d.ts +0 -111
  1280. package/dist/remote-run.d.ts +0 -20
  1281. package/dist/remote.d.ts +0 -67
  1282. package/dist/render.d.ts +0 -64
  1283. package/dist/reply-shape.d.ts +0 -106
  1284. package/dist/reply-voice.d.ts +0 -23
  1285. package/dist/report-summary.d.ts +0 -22
  1286. package/dist/reported-usage.d.ts +0 -69
  1287. package/dist/repos.d.ts +0 -67
  1288. package/dist/repository-context-ui.d.ts +0 -3
  1289. package/dist/repository-context.d.ts +0 -66
  1290. package/dist/request-budget-ui.d.ts +0 -14
  1291. package/dist/request-budget.d.ts +0 -127
  1292. package/dist/restart-certification.d.ts +0 -133
  1293. package/dist/result-actions.d.ts +0 -36
  1294. package/dist/result-acts.d.ts +0 -112
  1295. package/dist/result-completion.d.ts +0 -39
  1296. package/dist/result-evidence-readers.d.ts +0 -42
  1297. package/dist/result-follow-ups.d.ts +0 -118
  1298. package/dist/result-review.d.ts +0 -220
  1299. package/dist/result-shots.d.ts +0 -59
  1300. package/dist/retention-ui.d.ts +0 -21
  1301. package/dist/retention.d.ts +0 -77
  1302. package/dist/review-context.d.ts +0 -245
  1303. package/dist/review-evidence.d.ts +0 -33
  1304. package/dist/review-switch.d.ts +0 -36
  1305. package/dist/reviewer.d.ts +0 -99
  1306. package/dist/route-change-check.d.ts +0 -4
  1307. package/dist/route-change.d.ts +0 -22
  1308. package/dist/route-hooks.d.ts +0 -54
  1309. package/dist/route-results.d.ts +0 -75
  1310. package/dist/route-rules.d.ts +0 -324
  1311. package/dist/route-savings.d.ts +0 -136
  1312. package/dist/route-store.d.ts +0 -300
  1313. package/dist/run-closeout.d.ts +0 -89
  1314. package/dist/run-efficiency.d.ts +0 -74
  1315. package/dist/run-ending.d.ts +0 -21
  1316. package/dist/runner-process.d.ts +0 -76
  1317. package/dist/runner.d.ts +0 -324
  1318. package/dist/sample-project.d.ts +0 -31
  1319. package/dist/sandbox-launch.d.ts +0 -1
  1320. package/dist/sandbox-runtime.d.ts +0 -128
  1321. package/dist/scan.d.ts +0 -32
  1322. package/dist/scope.d.ts +0 -1098
  1323. package/dist/scout-browser-lock.d.ts +0 -69
  1324. package/dist/scout-browser.d.ts +0 -107
  1325. package/dist/scout-net.d.ts +0 -25
  1326. package/dist/scout-report.d.ts +0 -23
  1327. package/dist/scout.d.ts +0 -142
  1328. package/dist/secret-mint.d.ts +0 -1
  1329. package/dist/serve.d.ts +0 -11
  1330. package/dist/server/agents-computers.d.ts +0 -9
  1331. package/dist/server/agents-live-filed.d.ts +0 -17
  1332. package/dist/server/agents-live-lead.d.ts +0 -47
  1333. package/dist/server/agents-live-room.d.ts +0 -23
  1334. package/dist/server/chat.d.ts +0 -39
  1335. package/dist/server/chrome.d.ts +0 -328
  1336. package/dist/server/edge-refusal.d.ts +0 -7
  1337. package/dist/server/flows.d.ts +0 -8
  1338. package/dist/server/guards.d.ts +0 -81
  1339. package/dist/server/handler-context.d.ts +0 -22
  1340. package/dist/server/handler-registry.d.ts +0 -23
  1341. package/dist/server/home-asks.d.ts +0 -45
  1342. package/dist/server/home.d.ts +0 -65
  1343. package/dist/server/http.d.ts +0 -337
  1344. package/dist/server/in-place.d.ts +0 -15
  1345. package/dist/server/kit-standalone.d.ts +0 -22
  1346. package/dist/server/kit.d.ts +0 -452
  1347. package/dist/server/last-checks.d.ts +0 -17
  1348. package/dist/server/live.d.ts +0 -74
  1349. package/dist/server/merge-ready-view.d.ts +0 -10
  1350. package/dist/server/mutation-key.d.ts +0 -70
  1351. package/dist/server/pages-assets.d.ts +0 -11
  1352. package/dist/server/pages.d.ts +0 -8
  1353. package/dist/server/people-tokens.d.ts +0 -18
  1354. package/dist/server/remote-hooks.d.ts +0 -29
  1355. package/dist/server/remote.d.ts +0 -60
  1356. package/dist/server/render-chat.d.ts +0 -439
  1357. package/dist/server/render-code-map.d.ts +0 -30
  1358. package/dist/server/render-flaky.d.ts +0 -20
  1359. package/dist/server/render-follow-through.d.ts +0 -11
  1360. package/dist/server/render-history.d.ts +0 -51
  1361. package/dist/server/render-new-task.d.ts +0 -54
  1362. package/dist/server/render-pages.d.ts +0 -236
  1363. package/dist/server/render-people.d.ts +0 -102
  1364. package/dist/server/render-projects.d.ts +0 -104
  1365. package/dist/server/render-release.d.ts +0 -19
  1366. package/dist/server/render-results.d.ts +0 -758
  1367. package/dist/server/render-settings.d.ts +0 -93
  1368. package/dist/server/render-tasks.d.ts +0 -783
  1369. package/dist/server/request-context.d.ts +0 -78
  1370. package/dist/server/retired-routes.d.ts +0 -17
  1371. package/dist/server/route-policy.d.ts +0 -18
  1372. package/dist/server/route-table.d.ts +0 -114
  1373. package/dist/server/runtime.d.ts +0 -343
  1374. package/dist/server/session.d.ts +0 -192
  1375. package/dist/server/settings.d.ts +0 -76
  1376. package/dist/server/signup-gate.d.ts +0 -9
  1377. package/dist/server/sweeps.d.ts +0 -4
  1378. package/dist/server/task-views.d.ts +0 -98
  1379. package/dist/server/tasks.d.ts +0 -108
  1380. package/dist/server/terminals.d.ts +0 -31
  1381. package/dist/server/welcome.d.ts +0 -28
  1382. package/dist/server-telemetry.d.ts +0 -87
  1383. package/dist/settings-groups-ui.d.ts +0 -286
  1384. package/dist/settings-kit-script.d.ts +0 -21
  1385. package/dist/settings-kit.d.ts +0 -173
  1386. package/dist/settings-proofs.d.ts +0 -64
  1387. package/dist/setup-guide.d.ts +0 -39
  1388. package/dist/shared-deps.d.ts +0 -115
  1389. package/dist/sign-in-guard.d.ts +0 -70
  1390. package/dist/skills-ui.d.ts +0 -12
  1391. package/dist/skills.d.ts +0 -99
  1392. package/dist/slack-api.d.ts +0 -59
  1393. package/dist/slack-chat.d.ts +0 -37
  1394. package/dist/slack-settings.d.ts +0 -4
  1395. package/dist/slack-socket.d.ts +0 -12
  1396. package/dist/slack.d.ts +0 -6
  1397. package/dist/sleep.d.ts +0 -2
  1398. package/dist/source-key.d.ts +0 -2
  1399. package/dist/spend-report.d.ts +0 -87
  1400. package/dist/spend-ui.d.ts +0 -80
  1401. package/dist/spend.d.ts +0 -142
  1402. package/dist/sqlite-runtime.d.ts +0 -3
  1403. package/dist/sqlite-telemetry.d.ts +0 -9
  1404. package/dist/sso-settings.d.ts +0 -33
  1405. package/dist/sso-ui.d.ts +0 -26
  1406. package/dist/staged-runtimes.d.ts +0 -54
  1407. package/dist/steer-capabilities.d.ts +0 -32
  1408. package/dist/steer-controls.d.ts +0 -14
  1409. package/dist/steer-live.d.ts +0 -19
  1410. package/dist/steer-mailbox.d.ts +0 -46
  1411. package/dist/steer-status.d.ts +0 -25
  1412. package/dist/stop-proof.d.ts +0 -67
  1413. package/dist/storage-sweep-child.d.ts +0 -1
  1414. package/dist/storage-sweep-process.d.ts +0 -55
  1415. package/dist/storage-sweep-schedule.d.ts +0 -30
  1416. package/dist/storage-sweep.d.ts +0 -77
  1417. package/dist/storage-ui.d.ts +0 -23
  1418. package/dist/storage.d.ts +0 -68
  1419. package/dist/store-baseline.d.ts +0 -19
  1420. package/dist/store.d.ts +0 -8613
  1421. package/dist/stream-scope.d.ts +0 -18
  1422. package/dist/structured-output.d.ts +0 -57
  1423. package/dist/style-asset.d.ts +0 -7
  1424. package/dist/subagent-admin.d.ts +0 -53
  1425. package/dist/subagent-desk.d.ts +0 -59
  1426. package/dist/subagent-memory.d.ts +0 -65
  1427. package/dist/subagent-question.d.ts +0 -59
  1428. package/dist/subagent-tools.d.ts +0 -125
  1429. package/dist/subagent-week.d.ts +0 -68
  1430. package/dist/subagent-work.d.ts +0 -76
  1431. package/dist/subagents-ui.d.ts +0 -22
  1432. package/dist/subagents.d.ts +0 -146
  1433. package/dist/subscription-chat.d.ts +0 -54
  1434. package/dist/summary.d.ts +0 -33
  1435. package/dist/surface.d.ts +0 -49
  1436. package/dist/sweep-gate.d.ts +0 -10
  1437. package/dist/sweep-quarantine.d.ts +0 -29
  1438. package/dist/sync.d.ts +0 -94
  1439. package/dist/tailnet.d.ts +0 -11
  1440. package/dist/tamper-scan.d.ts +0 -4
  1441. package/dist/task-activity.d.ts +0 -27
  1442. package/dist/task-aliases.d.ts +0 -5
  1443. package/dist/task-archive.d.ts +0 -13
  1444. package/dist/task-base.d.ts +0 -39
  1445. package/dist/task-composer.d.ts +0 -14
  1446. package/dist/task-control.d.ts +0 -159
  1447. package/dist/task-live.d.ts +0 -8
  1448. package/dist/task-moves.d.ts +0 -90
  1449. package/dist/task-outcome-cli.d.ts +0 -48
  1450. package/dist/task-review-brief.d.ts +0 -69
  1451. package/dist/task-sizing.d.ts +0 -58
  1452. package/dist/task-source.d.ts +0 -77
  1453. package/dist/task-status.d.ts +0 -324
  1454. package/dist/task-text.d.ts +0 -31
  1455. package/dist/team-chat-authorization.d.ts +0 -11
  1456. package/dist/team-contract.d.ts +0 -103
  1457. package/dist/team-http.d.ts +0 -25
  1458. package/dist/team-leads.d.ts +0 -85
  1459. package/dist/team-runtime.d.ts +0 -25
  1460. package/dist/team-ui.d.ts +0 -4
  1461. package/dist/team-updates.d.ts +0 -8
  1462. package/dist/teams-api.d.ts +0 -33
  1463. package/dist/teams-chat.d.ts +0 -36
  1464. package/dist/teams-settings.d.ts +0 -14
  1465. package/dist/teams.d.ts +0 -24
  1466. package/dist/teardown-git.d.ts +0 -164
  1467. package/dist/telegram-flow.d.ts +0 -112
  1468. package/dist/telegram-lead.d.ts +0 -151
  1469. package/dist/telegram-live.d.ts +0 -116
  1470. package/dist/telegram-progress.d.ts +0 -20
  1471. package/dist/telegram-settings.d.ts +0 -9
  1472. package/dist/telegram-status.d.ts +0 -83
  1473. package/dist/telegram-team.d.ts +0 -68
  1474. package/dist/telegram.d.ts +0 -271
  1475. package/dist/templates.d.ts +0 -69
  1476. package/dist/terminal-catalog.d.ts +0 -11
  1477. package/dist/terminal-text.d.ts +0 -11
  1478. package/dist/test-infra.d.ts +0 -34
  1479. package/dist/test-temp.d.ts +0 -40
  1480. package/dist/text-limits.d.ts +0 -297
  1481. package/dist/tidy.d.ts +0 -130
  1482. package/dist/tier-report.d.ts +0 -44
  1483. package/dist/token-notices.d.ts +0 -11
  1484. package/dist/tokens-cli.d.ts +0 -21
  1485. package/dist/tool-broker.d.ts +0 -52
  1486. package/dist/tool-launcher.d.ts +0 -1
  1487. package/dist/tool-secret-store.d.ts +0 -167
  1488. package/dist/toolroll-update-cli.d.ts +0 -15
  1489. package/dist/toolroll-update-ui.d.ts +0 -47
  1490. package/dist/toolroll-update.d.ts +0 -265
  1491. package/dist/tools-ui.d.ts +0 -51
  1492. package/dist/transitions-recipes.d.ts +0 -1
  1493. package/dist/tree-proof.d.ts +0 -34
  1494. package/dist/tui-contract.d.ts +0 -202
  1495. package/dist/tui-source.d.ts +0 -14
  1496. package/dist/typed-start.d.ts +0 -51
  1497. package/dist/unfenced-test-support.d.ts +0 -2
  1498. package/dist/up-processes.d.ts +0 -162
  1499. package/dist/up-role-child.d.ts +0 -1
  1500. package/dist/update-notice.d.ts +0 -5
  1501. package/dist/vanished-retry.d.ts +0 -30
  1502. package/dist/verification-evidence.d.ts +0 -68
  1503. package/dist/version.d.ts +0 -2
  1504. package/dist/wake-hub.d.ts +0 -72
  1505. package/dist/webhook-limits.d.ts +0 -23
  1506. package/dist/webhook-readers.d.ts +0 -56
  1507. package/dist/webhook-signing.d.ts +0 -27
  1508. package/dist/webhooks.d.ts +0 -84
  1509. package/dist/welcome-facts.d.ts +0 -18
  1510. package/dist/when-html.d.ts +0 -40
  1511. package/dist/work-index.d.ts +0 -175
  1512. package/dist/work-summary.d.ts +0 -61
  1513. package/dist/workspace-motion.d.ts +0 -4
  1514. package/dist/workspace-revision.d.ts +0 -48
  1515. package/dist/workspace-ui.d.ts +0 -385
  1516. package/dist/worktree-notices.d.ts +0 -13
  1517. package/dist/worktree.d.ts +0 -365
  1518. package/dist/writes-mode.d.ts +0 -9
  1519. package/dist/youiyoux-intake.d.ts +0 -234
@@ -1,27 +1,3 @@
1
- /**
2
- * `toolroll update`: a verified, drained, undoable update of an npm-installed
3
- * Toolroll. It reuses the desktop update engine's pieces (desktop-update.ts):
4
- * the SQLite admission gate that lets running work finish, the verified
5
- * private backup (the coding catalog's inside the same reservation), the
6
- * durable journal written before every irreversible step, the OS lock that
7
- * shows whether an updater is alive, and resume after a crash. What differs
8
- * is what gets swapped: a staged npm runtime instead of an app bundle.
9
- *
10
- * verify → drain → stop and back up → rehearse → switch → restart → health
11
- *
12
- * The new release is installed from the npm registry into a Toolroll-managed
13
- * runtimes folder (`staged-upgrades/`, as deploy-browser stages), never over
14
- * the running one. npm's own signature and attestation check covers what it
15
- * installed, the installed bytes must be the ones downloaded and hashed, and
16
- * the certificate that signed their provenance must name ap9000/toolroll, its
17
- * publish workflow and GitHub Actions, checked by npm's own Sigstore verifier. The
18
- * service is stopped, and its processes seen gone, before the final backup,
19
- * so nothing written before the switch is lost. A failed health check puts
20
- * back the previous runtime, database and coding catalog on its own, keeping
21
- * what the new version wrote in a named copy. `--rollback` returns to the
22
- * previous runtime and its backups. Every update, rollback, refusal and
23
- * failure is a ledger entry.
24
- */
25
1
  import { inReadOnlyRequest } from "./read-only-request.js";
26
2
  import { createHash, randomUUID, verify as signatureValid, X509Certificate } from "node:crypto";
27
3
  import { spawnSync } from "node:child_process";
@@ -49,36 +25,26 @@ import { isNewer, REGISTRY } from "./releases.js";
49
25
  import { markNeverIndex } from "./never-index.js";
50
26
  import { readRuntimeUpdateJournal, RUNTIME_PHASES, RUNTIME_UPDATE_STEPS, stagedStartedAt, updaterStartingOf } from "./contracts/update-journal.js";
51
27
  import { sleep } from "./sleep.js";
52
- /** Loaded on first use (as backup.ts and store.ts do), so modules that only import this one (the console,
53
- * and tests that load it in a browser-like environment) never need `node:sqlite` itself. */
54
28
  function sqlite() {
55
29
  return createRequire(import.meta.url)("node:sqlite");
56
30
  }
57
31
  export const PROVENANCE_REPOSITORY = "https://github.com/ap9000/toolroll";
58
32
  export const PROVENANCE_WORKFLOW = ".github/workflows/publish.yml";
59
33
  export const PROVENANCE_ISSUER = "https://token.actions.githubusercontent.com";
60
- /** How long a watch's `toolroll up` may take to exit once launchd stops it (controller-supervisor's shutdown). */
61
34
  const UP_EXIT_MS = 45_000;
62
- /** The steps a person sees, in order. */
63
35
  export const UPDATE_STEPS = RUNTIME_UPDATE_STEPS;
64
36
  export const STEP_WORDS = {
65
37
  verifying: "Verify the package", draining: "Let running work finish", "backing-up": "Stop and back up",
66
38
  rehearsing: "Rehearse the migration", switching: "Switch to the new version", restarting: "Restart", health: "Health check",
67
39
  };
68
- /** How many release-* runtimes stay on disk: the running one and the one before it. */
69
40
  export const KEEP_RUNTIMES = 2;
70
- /** The one-off launchd job the console starts the updater as. */
71
41
  export const UPDATE_JOB_LABEL = "com.toolroll.update";
72
42
  const TERMINAL = ["complete", "restored", "refused", "cancelled"];
73
43
  export const runtimeUpdateTerminal = (phase) => TERMINAL.some(known => known === phase);
74
44
  const journalFile = (stateDir) => join(stateDir, "toolroll-update.json");
75
- /** The last completed update, kept apart from the journal: what `--rollback` returns from. */
76
45
  const lastUpdateFile = (stateDir) => join(stateDir, "toolroll-update.last.json");
77
46
  const cancelFile = (j) => join(j.stageDir, "cancel-request.json");
78
- /** An updater on its way to this update before it holds the lock: the console's job once launched (launchd may not
79
- * have started it yet), or a resume about to drive it. */
80
47
  const startingFile = (j) => join(j.stageDir, "updater-starting.json");
81
- /** How long a launched or resuming updater is expected to take to start and hold the lock. */
82
48
  export const UPDATER_START_MS = 2 * 60_000;
83
49
  function markStarting(j, state, now) {
84
50
  durableJson(startingFile(j), { id: j.id, state, at: now.toISOString() });
@@ -121,14 +87,10 @@ export function readRuntimeUpdate(stateDir, file = journalFile(stateDir)) {
121
87
  throw Error("The saved update record is invalid. Preserve it and its backups; nothing was changed.");
122
88
  return j;
123
89
  }
124
- /** The update `--rollback` returns from: the last one that completed, whatever was attempted since. */
125
90
  export function lastCompletedUpdate(stateDir) {
126
91
  const kept = existsSync(lastUpdateFile(stateDir)) ? readRuntimeUpdate(stateDir, lastUpdateFile(stateDir)) : readRuntimeUpdate(stateDir);
127
92
  return kept?.kind === "update" && kept.phase === "complete" ? kept : null;
128
93
  }
129
- /** Before a new attempt replaces the saved journal: a completed update is kept as what `--rollback` returns from.
130
- * 0.8.0 and older never wrote `.last.json`, so the update that brought this version would otherwise be lost to the
131
- * first refused or failed attempt. */
132
94
  function keepCompletedUpdate(stateDir) {
133
95
  const saved = readRuntimeUpdate(stateDir);
134
96
  if (saved?.kind !== "update" || saved.phase !== "complete")
@@ -138,7 +100,6 @@ function keepCompletedUpdate(stateDir) {
138
100
  return;
139
101
  durableJson(lastUpdateFile(stateDir), saved);
140
102
  }
141
- /** A null phase saves progress without changing the saved phase, including one a newer release wrote. */
142
103
  function save(j, phase, detail, now) {
143
104
  if (phase !== null) {
144
105
  if (j.phase !== phase)
@@ -152,10 +113,7 @@ function save(j, phase, detail, now) {
152
113
  durableJson(join(j.stageDir, "update.json"), j);
153
114
  durableJson(journalFile(j.stateDir), j);
154
115
  }
155
- /** Every update, rollback, refusal and failure. Plain SQL any build can run,
156
- * written after any database restore so the restore cannot erase it. */
157
116
  function ledger(databaseFile, now, actor, action, outcome, detail) {
158
- // Never an empty database where the live one should be.
159
117
  if (!existsSync(databaseFile))
160
118
  throw Error("The database is not in place.");
161
119
  const db = new (sqlite().DatabaseSync)(databaseFile);
@@ -168,7 +126,6 @@ function ledger(databaseFile, now, actor, action, outcome, detail) {
168
126
  db.close();
169
127
  }
170
128
  }
171
- /** Running work by name, for a refusal a person can act on. */
172
129
  export function runningWorkWords(db) {
173
130
  const active = activeUpdateWork(db);
174
131
  if (Object.values(active).every(n => n === 0))
@@ -180,9 +137,7 @@ export function runningWorkWords(db) {
180
137
  const parts = [...(runs.length ? [`running ${runs.join(", ")}${more > 0 ? ` and ${more} more` : ""}`] : []), ...other];
181
138
  return parts.join("; ");
182
139
  }
183
- /** Sigstore's certificate extensions (Fulcio's OID registry) and subjectAltName. */
184
140
  const OID = { issuerV1: "1.3.6.1.4.1.57264.1.1", repositoryV1: "1.3.6.1.4.1.57264.1.5", issuer: "1.3.6.1.4.1.57264.1.8", buildSigner: "1.3.6.1.4.1.57264.1.9", sourceRepository: "1.3.6.1.4.1.57264.1.12", subjectAltName: "2.5.29.17" };
185
- /** One DER element at `at`: its tag and where its contents start and end. */
186
141
  function derAt(der, at) {
187
142
  let length = der[at + 1] ?? 0, start = at + 2;
188
143
  if (length & 0x80) {
@@ -219,7 +174,6 @@ function oidText(bytes) {
219
174
  }
220
175
  return parts.join(".");
221
176
  }
222
- /** A certificate's extensions by OID: each one's value octets. Node's X509Certificate does not expose them. */
223
177
  function certificateExtensions(der) {
224
178
  const tbs = derChildren(der, derAt(der, 0))[0];
225
179
  const found = new Map();
@@ -234,7 +188,6 @@ function certificateExtensions(der) {
234
188
  }
235
189
  return found;
236
190
  }
237
- /** The signing certificate's own words: who asked Sigstore for it (issuer), which repository and which workflow. */
238
191
  function certificateIdentity(der) {
239
192
  const extensions = certificateExtensions(der);
240
193
  const utf8 = (oid) => { const value = extensions.get(oid); if (!value)
@@ -245,10 +198,6 @@ function certificateIdentity(der) {
245
198
  const uris = san ? derChildren(san, derAt(san, 0)).filter(name => name.tag === 0x86).map(name => san.subarray(name.start, name.end).toString("ascii")) : [];
246
199
  return { issuer: utf8(OID.issuer) ?? raw(OID.issuerV1), repository: utf8(OID.sourceRepository), repositoryV1: raw(OID.repositoryV1), signer: utf8(OID.buildSigner), uris };
247
200
  }
248
- /** The npm provenance for exactly these bytes of Toolroll itself must be signed by a certificate that names the
249
- * Toolroll repository, its publish workflow and GitHub Actions as the issuer. The statement's own claims name
250
- * nobody: only the certificate, whose key must have signed the statement. Sigstore's chain and transparency log are
251
- * then checked by npm's own verifier (UpdateSystem.sigstore) for the identity returned here. */
252
201
  export function checkProvenance(attestations, version, sha512Hex) {
253
202
  const list = attestations?.attestations;
254
203
  if (!Array.isArray(list) || list.length === 0)
@@ -269,7 +218,6 @@ export function checkProvenance(attestations, version, sha512Hex) {
269
218
  catch {
270
219
  throw new Refusal(`Toolroll ${version}'s provenance could not be read. Nothing was changed.`);
271
220
  }
272
- // DSSE: the signature covers the pre-authentication encoding of the payload and its type.
273
221
  const signed = Buffer.concat([Buffer.from(`DSSEv1 ${Buffer.byteLength(payloadType)} ${payloadType} ${payload.length} `), payload]);
274
222
  const signatures = envelope.signatures ?? [];
275
223
  let valid = false;
@@ -296,7 +244,6 @@ export function checkProvenance(attestations, version, sha512Hex) {
296
244
  }
297
245
  return { repository: PROVENANCE_REPOSITORY, workflow: PROVENANCE_WORKFLOW, issuer: who.issuer, identity, bundle };
298
246
  }
299
- /** Headlines of this version's changelog section: its bold lead phrases. */
300
247
  export function releaseNotes(changelog, version) {
301
248
  const lines = changelog.split("\n");
302
249
  const start = lines.findIndex(line => new RegExp(`^## ${version.replaceAll(".", "\\.")}( |$)`).test(line));
@@ -306,7 +253,6 @@ export function releaseNotes(changelog, version) {
306
253
  const section = lines.slice(start + 1, end < 0 ? undefined : end).join("\n");
307
254
  return [...section.matchAll(/^- \*\*(.+?)\*\*/gm)].map(m => m[1].replace(/\.$/, "")).slice(0, 6);
308
255
  }
309
- // ---- durable files ----------------------------------------------------------
310
256
  function fsyncPath(path) {
311
257
  const fd = openSync(path, "r");
312
258
  try {
@@ -316,36 +262,17 @@ function fsyncPath(path) {
316
262
  closeSync(fd);
317
263
  }
318
264
  }
319
- /** Every rename here: what is renamed is flushed first (a file itself, a link
320
- * by its directory), and the directory after, so a crash never leaves a torn
321
- * database, catalog or command. */
322
265
  export function durableRename(temp, target) {
323
266
  fsyncPath(lstatSync(temp).isSymbolicLink() ? dirname(temp) : temp);
324
267
  renameSync(temp, target);
325
268
  if (process.platform !== "win32")
326
269
  fsyncPath(dirname(target));
327
270
  }
328
- // ---- database: snapshot, rehearse, restore --------------------------------
329
- /** How a rehearsed migration may change each saved table. An unlisted table keeps every column, its row count and
330
- * its last rowid (a WITHOUT ROWID table, all small, keeps the hash of its rows). `appendOnly`: every row through the
331
- * last one before hashes the same, in rowid order; new rows may follow. `dropped`: columns the new schema may remove
332
- * only when every saved value is null, or, with `carried`, when the receiving table gained exactly one receipt under
333
- * that destination per row holding a value, and as many non-null values per column as the dropped columns held.
334
- * `receives`: the only rows the table may gain are those receipts. `compacted`: rows may go only into summary rows,
335
- * whose `sum` grows by exactly as many. `summarizes`: old summaries stay identical by run key; new ones account for
336
- * that run's compacted witnesses, even below the previous maximum key. `retired`: a removed feature's table, which may go whole. `fromRoutines`: rows
337
- * kept as they were, and the only rows the table may gain are one per saved routine, moved into a scheduled flow (its
338
- * flow, or its schedule trigger naming that routine) — on only when the routine was approved and running. `moved`:
339
- * the table may go only when every row it had (or the ones `rows` counts) arrived in `into`: the rows there that
340
- * `where` picks grew by exactly that many. */
341
271
  const LEGACY_DESTINATION = "legacy:single-destination";
342
- /** v116: every old per-app chat table into the shared chat tables, keyed by provider (chat-migration.ts). Several old
343
- * tables fan into one shared table; each picks out only its own rows there, so every count is checked on its own. */
344
272
  const TELEGRAM_MOVES = {
345
273
  telegram_binding: { into: "chat_binding", where: "1" },
346
274
  telegram_pairing: { into: "chat_pair", where: "1" },
347
275
  telegram_team_chat: { into: "chat_room", where: "1" },
348
- // An applied update is a receipt; a pushed one still waiting is queued (one already applied was spent with it).
349
276
  telegram_update: { into: "chat_event", where: "kind = 'update' AND state = 'done'" },
350
277
  telegram_inbox: { into: "chat_event", where: "kind = 'update' AND state = 'queued'", rows: "update_id NOT IN (SELECT update_id FROM telegram_update)" },
351
278
  telegram_conversation: { into: "chat_event", where: "kind = 'message'" },
@@ -362,7 +289,6 @@ const TELEGRAM_MOVES = {
362
289
  telegram_task_message: { into: "chat_message_ref", where: "kind = 'task'" },
363
290
  telegram_outbound_message: { into: "chat_message_ref", where: "kind = 'notification'" },
364
291
  telegram_note_draft: { into: "chat_note_draft", where: "1" },
365
- // A bot's lease and its rate-limit wait share its one runtime row.
366
292
  bridge_lease: { into: "chat_runtime", where: "lease_until IS NOT NULL" },
367
293
  telegram_retry: { into: "chat_runtime", where: "retry_at IS NOT NULL" },
368
294
  telegram_digest: { into: "chat_digest", where: "1", rows: "id = 1" },
@@ -373,7 +299,6 @@ export const CHAT_MOVES = {
373
299
  ...Object.fromEntries(Object.entries(TELEGRAM_MOVES).map(([table, move]) => [table, { ...move, where: `provider = 'telegram' AND (${move.where})` }])),
374
300
  ...Object.fromEntries(["slack", "discord", "teams"].flatMap(app => APP_TABLES.map(suffix => [`${app}_${suffix}`, { into: `chat_${suffix}`, where: `provider = '${app}'` }]))),
375
301
  };
376
- /** Each table's added columns across versions, merged: a table two versions both extend keeps every column. */
377
302
  function addedColumns(...versions) {
378
303
  const rules = {};
379
304
  for (const version of versions) {
@@ -383,67 +308,30 @@ function addedColumns(...versions) {
383
308
  }
384
309
  return rules;
385
310
  }
386
- /** Rules on tables that later gained declared columns (addedColumns merges into these instead of replacing them). */
387
311
  const EARLIER_RULES = { flow_trigger: { fromRoutines: "trigger" },
388
- // v114: a finished run whose process witnesses have all exited keeps one summary row in place of them (v150 adds
389
- // their machine id).
390
312
  run_process: { compacted: { into: "run_process_summary", sum: "witnesses" } } };
391
313
  const HISTORY_RULES = {
392
314
  ...Object.fromEntries(Object.entries(CHAT_MOVES).map(([table, moved]) => [table, { moved }])),
393
315
  action_ledger: { appendOnly: true }, ledger_seal: { appendOnly: true }, ledger_checkpoint: { appendOnly: true },
394
- // v114: a finished run whose process witnesses have all exited keeps one summary row in place of them (the
395
- // run_process rule is in EARLIER_RULES, under its v150 column).
396
316
  run_process: EARLIER_RULES["run_process"], run_process_summary: { summarizes: "run_process" },
397
- // v114: single-destination delivery columns may be dropped only once their values are legacy receipts.
398
317
  notification: { dropped: ["attempts", "last_attempt_at", "last_error", "delivered_at", "receipt", "claim_owner", "claim_expires_at"], carried: { into: "notification_delivery", destination: LEGACY_DESTINATION } },
399
318
  notification_delivery: { receives: LEGACY_DESTINATION },
400
- // v115: contests, held sessions, fallback chains and routines are removed; their tables go whole.
401
319
  tournament_terms: { retired: true }, contest: { retired: true }, contestant: { retired: true },
402
320
  routine: { retired: true }, routine_fire: { retired: true },
403
321
  attended_authorization: { retired: true }, session_turn: { retired: true }, held_session: { retired: true },
404
322
  fallback_config: { retired: true }, fallback_cycle: { retired: true }, fallback_transition: { retired: true },
405
- // v115: each routine becomes one scheduled flow and its schedule trigger.
406
323
  flow: { fromRoutines: "flow" }, flow_trigger: { fromRoutines: "trigger" },
407
- // v117 (D5): the lead's and the subagents' tables keep every row under their new names (mate_* → lead_*, teammate* →
408
- // subagent*); a column renamed in a table that keeps its name keeps its values under the new one.
409
324
  ...Object.fromEntries(Object.entries(V117_RENAMED_TABLES).map(([old, now]) => [old, { moved: { into: now, where: "1" } }])),
410
325
  ...Object.fromEntries(V117_RENAMED_COLUMNS.filter(([table]) => !Object.values(V117_RENAMED_TABLES).includes(table)).map(([table, from, to]) => [table, { renamed: { [from]: to } }])),
411
- // v118 (D7): every API token, coordinator and lead token arrives in the one credential table under its kind.
412
326
  ...Object.fromEntries(Object.entries(V118_MERGED_TABLES).map(([table, kind]) => [table, { moved: { into: "credential", where: `kind = '${kind}'` } }])),
413
- // v119: planning generations and a question's closure reason are new columns; every row saved before them reads
414
- // the declared value (generation 0, no closure reason).
415
- // v120: a steering note's mailing and acknowledgement, and a run's steering folder, are new columns; every row
416
- // saved before them reads none.
417
- // v121: live steering's columns and a run's attempt key read none, and no sends, the same way.
418
- // v122: a project's recorded remote reads none the same way.
419
- // v123: a plan authorization's basis reads the operating mode, and a trigger firing reads not on time and no script ran.
420
- // v126: a receipt's state, acceptance time and held item, a trigger's credential generation and turned-away count,
421
- // and who made a card read none, 0, or none. A table with an earlier rule (flow_trigger's v115 move) keeps it too.
422
- // v128: a lead message's pending flag reads waiting exactly for a team queue's unadmitted operator message.
423
- // v147: an account's password flag reads set (1), a browser session reads full with no local binding or key, and the
424
- // console record reads no key epoch.
425
- // v148: a run's execution class and a revision's origin read none (NULL), and a project's suggestion switch reads on.
426
- // v149 adds tables only (the learning-loops records): no saved row changes, so no rule is needed for it.
427
- // v150: a saved process witness reads no machine id (NULL), and is matched by host name as before.
428
- // v151: a saved cleanup setting's idle limit reads none (NULL): the default.
429
- // v152: a saved project's code map reads on, with no enrollment yet; the code map's tables are new.
430
- // v153: a saved task reads no fast start and a saved project no fast-start setting (NULL); its tables are new.
431
- // v154 adds a table only (check_stamp): no saved row changes, so no rule is needed for it.
432
- // v155 adds tables only (fleet-schema.ts): no saved row changes, so no rule is needed for it.
433
- // v156 adds tables only (fallback chains): likewise.
434
- // v158 (after v157's chat-app tables): a saved lead step reads no tool names and no failure detail, and a saved reply no route and no failure detail
435
- // (NULL); the quick-answer switch is a new table.
436
- // v159: a saved fast-start preview reads no lead turn (NULL); a typed yes's record is a new table.
437
327
  ...Object.fromEntries(Object.entries(addedColumns(V119_ADDED_COLUMNS, V120_ADDED_COLUMNS, V121_ADDED_COLUMNS, V122_ADDED_COLUMNS, V123_ADDED_COLUMNS, V125_ADDED_COLUMNS, V126_ADDED_COLUMNS, V128_ADDED_COLUMNS, V129_ADDED_COLUMNS, V134_ADDED_COLUMNS, V135_ADDED_COLUMNS, V138_ADDED_COLUMNS, V143_ADDED_COLUMNS, V147_ADDED_COLUMNS, V148_ADDED_COLUMNS, V150_ADDED_COLUMNS, V151_ADDED_COLUMNS, V152_ADDED_COLUMNS, V153_ADDED_COLUMNS, V158_ADDED_COLUMNS, V159_ADDED_COLUMNS))
438
328
  .map(([table, rule]) => [table, { ...EARLIER_RULES[table], ...rule }])),
439
329
  };
440
- /** The tables a migration may remove whole (v115's removed features). */
441
330
  export const RETIRED_TABLES = Object.freeze(Object.keys(HISTORY_RULES).filter(name => HISTORY_RULES[name].retired));
442
331
  const tableColumns = (db, name) => db.prepare("PRAGMA table_info(" + quote(name) + ")").all().map(r => String(r["name"]));
443
332
  const plainValue = (_, v) => v instanceof Uint8Array ? Buffer.from(v).toString("hex") : typeof v === "bigint" ? String(v) : v;
444
333
  const rowHash = (row) => createHash("sha256").update(JSON.stringify(Object.values(row), plainValue)).digest("hex");
445
334
  const summaryRows = (db, name, columns) => db.prepare("SELECT " + columns.map(quote).join(",") + " FROM " + quote(name) + " ORDER BY run").iterate();
446
- /** Keep every saved summary byte-identical. A new key must replace all witnesses saved for that same run. */
447
335
  function keptSummaries(db, name, before, source) {
448
336
  const saved = new Map(before?.summaries?.map(row => [row.run, row.hash]));
449
337
  const witnesses = new Map(source?.compactedRuns?.map(row => [row.run, row.count]));
@@ -462,7 +350,6 @@ function keptSummaries(db, name, before, source) {
462
350
  }
463
351
  return saved.size === 0;
464
352
  }
465
- /** Rows streamed into a sha256, never held together: through a rowid in rowid order, or a WITHOUT ROWID table whole. */
466
353
  function rowsHash(db, name, columns, through) {
467
354
  const select = "SELECT " + (through === undefined ? "" : 'rowid AS "rowid:", ') + columns.map(quote).join(",") + " FROM " + quote(name);
468
355
  const key = () => db.prepare("SELECT name FROM pragma_table_info(?) WHERE pk > 0 ORDER BY pk").all(name).map(r => quote(String(r["name"]))).join(",");
@@ -475,16 +362,12 @@ function rowsHash(db, name, columns, through) {
475
362
  }
476
363
  return { count, hash: hash.digest("hex") };
477
364
  }
478
- /** Rows under one receipt destination, and each column's non-null values among them: counted, never read. */
479
365
  function receipts(db, name, destination, columns) {
480
366
  const r = db.prepare("SELECT count(*) AS n" + columns.map(column => ",count(" + quote(column) + ") AS " + quote(column)).join("") + " FROM " + quote(name) + " WHERE destination = ?").get(destination);
481
367
  return { count: Number(r["n"]), nonNull: Object.fromEntries(columns.map(column => [column, Number(r[column])])) };
482
368
  }
483
- /** The rows a moved table's rule picks out in its destination (none while there is no such table). */
484
369
  const arrived = (db, move) => db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?").get(move.into) ? Number(db.prepare("SELECT count(*) AS n FROM " + quote(move.into) + " WHERE " + move.where).get()["n"]) : 0;
485
370
  const summed = (db, into) => db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?").get(into.into) ? Number(db.prepare("SELECT coalesce(sum(" + quote(into.sum) + "),0) AS n FROM " + quote(into.into)).get()["n"]) : 0;
486
- /** Each saved table's columns, row count and last rowid; the append-only ones hashed (deploy-browser's rehearsal check).
487
- * Bounded: only the ledger and small tables are read row by row. */
488
371
  export function historySnapshot(db) {
489
372
  return db.prepare("SELECT name, wr FROM pragma_table_list WHERE schema='main' AND type IN ('table','shadow') AND name NOT LIKE 'sqlite_%' AND name <> 'schema_version' ORDER BY name").all()
490
373
  .map(row => {
@@ -518,7 +401,6 @@ export function historySnapshot(db) {
518
401
  return t;
519
402
  });
520
403
  }
521
- /** Each saved routine (none when the table is gone or was never made), and whether it was approved and running. */
522
404
  function savedRoutines(db) {
523
405
  if (!db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='routine'").get())
524
406
  return [];
@@ -528,7 +410,6 @@ function savedRoutines(db) {
528
410
  return db.prepare("SELECT id, repo, name, " + live + " AS live FROM routine ORDER BY id").all()
529
411
  .map(r => ({ id: Number(r["id"]), repo: String(r["repo"]), name: String(r["name"]), live: Number(r["live"]) === 1 }));
530
412
  }
531
- /** Whether a table's rows past its saved last rowid are exactly the flows (or schedule triggers) its saved routines became. */
532
413
  function movedRoutines(db, t, before) {
533
414
  const routines = t.routines ?? [];
534
415
  if (HISTORY_RULES[t.name].fromRoutines === "flow") {
@@ -537,7 +418,6 @@ function movedRoutines(db, t, before) {
537
418
  return added.length === routines.length && added.every(r => r["state"] === "active")
538
419
  && JSON.stringify(added.map(r => key(r["repo"], r["name"])).sort()) === JSON.stringify(routines.map(r => key(r.repo, r.name)).sort());
539
420
  }
540
- // A trigger names its routine in its order, and belongs to a flow the move added for that same routine.
541
421
  const flows = before.find(one => one.name === "flow");
542
422
  if (flows === undefined)
543
423
  return false;
@@ -553,10 +433,8 @@ function movedRoutines(db, t, before) {
553
433
  return r["repo"] === routine.repo && r["name"] === routine.name && (r["state"] === "paused" || (r["state"] === "active" && routine.live));
554
434
  });
555
435
  }
556
- /** The tables whose saved history the migration changed beyond what HISTORY_RULES declares. */
557
436
  export function changedHistory(db, before) {
558
437
  const tables = new Set(db.prepare("SELECT name FROM sqlite_master WHERE type='table'").all().map(r => String(r["name"])));
559
- // Receipts each receiving table gained, and the dropped values a carrying table owes it.
560
438
  const gained = new Map(), owed = new Map();
561
439
  for (const t of before) {
562
440
  if (t.received && tables.has(t.name)) {
@@ -589,7 +467,6 @@ export function changedHistory(db, before) {
589
467
  if (t.columns.some(c => !kept(c) && (!rule?.dropped?.includes(c) || (t.nonNull?.[c] !== 0 && !accounted(rule, t)))))
590
468
  return true;
591
469
  const columns = t.columns.filter(c => present.has(c));
592
- // A declared new column: every row saved before it reads its declared value.
593
470
  const added = Object.entries(rule?.added ?? {}).filter(([c]) => !t.columns.includes(c) && present.has(c));
594
471
  if (t.rowid && added.some(([c, saved]) => Number(db.prepare("SELECT count(*) AS n FROM " + quote(t.name) + " WHERE rowid <= ? AND " + quote(c) + " IS NOT " + saved).get(t.last)["n"]) > 0))
595
472
  return true;
@@ -610,7 +487,6 @@ export function changedHistory(db, before) {
610
487
  const r = db.prepare("SELECT count(*) AS n, coalesce(max(rowid),0) AS last FROM " + quote(t.name)).get(), count = Number(r["n"]), last = Number(r["last"]);
611
488
  if (rule?.compacted)
612
489
  return count > t.count || last > t.last || t.count - count !== summed(db, rule.compacted) - (t.summed ?? 0)
613
- // A newly created summary table has no digest of its own; check its keys here too.
614
490
  || (!before.some(one => one.name === rule.compacted.into) && tables.has(rule.compacted.into) && !keptSummaries(db, rule.compacted.into, undefined, t));
615
491
  if (rule?.receives) {
616
492
  const added = gained.get(t.name)?.count ?? 0;
@@ -625,8 +501,6 @@ async function rehearse(j, system, source) {
625
501
  chmodSync(copy, 0o600);
626
502
  try {
627
503
  let db = new (sqlite().DatabaseSync)(copy, { readOnly: true });
628
- // Rows already pointing nowhere before the update are the install's own; only ones the migration makes refuse. (By
629
- // today's table names: a renamed table's old orphan is the same row under its new name, orphanKey.)
630
504
  const orphans = () => new Set([...db.prepare("PRAGMA foreign_key_check").iterate()].map(row => orphanKey(row)));
631
505
  const before = historySnapshot(db), orphaned = orphans();
632
506
  db.close();
@@ -651,8 +525,6 @@ async function rehearse(j, system, source) {
651
525
  rmSync(copy + suffix, { force: true });
652
526
  }
653
527
  }
654
- /** Put a verified backup in place of a live SQLite file. Only once the service's processes are gone. The live file
655
- * is replaced only by a complete copy: a copy that fails leaves it as it was. */
656
528
  function restoreFile(live, backup, hash, what) {
657
529
  if (fileHash(backup) !== hash)
658
530
  throw Error(`The retained ${what} backup changed. It was not put back.`);
@@ -668,8 +540,6 @@ function restoreFile(live, backup, hash, what) {
668
540
  rmSync(temp, { force: true });
669
541
  }
670
542
  }
671
- /** Before anything is moved or replaced: every backup is still the one recorded, and there is room for the copy
672
- * kept aside and for the backups put back. */
673
543
  function assertRestorable(j, from, system) {
674
544
  if (fileHash(from.path) !== from.hash)
675
545
  throw Error("The retained database backup changed. Nothing was put back; the live database is as it was.");
@@ -698,20 +568,16 @@ function freeBytes(dir) {
698
568
  return Number(fs.bavail) * Number(fs.bsize);
699
569
  }
700
570
  const megabytes = (bytes) => `${Math.ceil(bytes / 1_048_576)} MB`;
701
- /** The database and, when one was backed up, the coding catalog, then this run's coding gate lifted. */
702
571
  function restoreDatabase(j, from) {
703
572
  restoreFile(j.databaseFile, from.path, from.hash, "database");
704
573
  if (from.codingPath && from.codingHash)
705
574
  restoreFile(codingFile(j.databaseFile), from.codingPath, from.codingHash, "coding catalog");
706
575
  ungateCoding(j);
707
576
  }
708
- /** SQLite's own answer for a file it cannot read as a database: corrupt, or not a database at all. Anything else
709
- * (busy, a full disk, a permission) is not a reason to move the live database. */
710
577
  function unreadableDatabase(error) {
711
578
  const code = error.errcode;
712
579
  return typeof code === "number" && [11, 26].includes(code & 0xff);
713
580
  }
714
- /** The kept-aside copies a journal names, oldest first; a journal written by 0.8.1 names only its newest. */
715
581
  function keptOf(j) {
716
582
  return j.kept ?? (j.keptAside ? [{ path: j.keptAside, unreadable: j.keptAsideUnreadable === true }] : []);
717
583
  }
@@ -738,12 +604,7 @@ function forgetKept(j, path) {
738
604
  delete j.keptAsideUnreadable;
739
605
  }
740
606
  }
741
- /** A private copy of the live database before a restore replaces it: what the new version wrote is kept, and named.
742
- * Only a database SQLite says is corrupt or not a database is moved aside whole, with its WAL; any other failure
743
- * stops the restore with the live database where it was. Returns what was moved, so a failed restore moves it back. */
744
607
  async function keepAside(j) {
745
- // Nothing at the live path: an earlier attempt moved it aside and stopped before putting the backup back. That
746
- // copy stays named in `kept`.
747
608
  if (!existsSync(j.databaseFile))
748
609
  return [];
749
610
  const id = randomUUID().slice(0, 8), kept = join(j.stageDir, `orders.kept.${id}.db`);
@@ -782,22 +643,15 @@ async function keepAside(j) {
782
643
  recordKept(j, unreadable, true);
783
644
  return moved;
784
645
  }
785
- /** Undo keepAside's moves: the live database goes back where it was, never leaving the path empty. */
786
646
  function moveBack(moved) {
787
647
  for (const one of [...moved].reverse())
788
648
  if (!existsSync(one.from) && existsSync(one.to))
789
649
  durableRename(one.to, one.from);
790
650
  }
791
- // ---- the service: stop, and see it gone -------------------------------------
792
- /** The service and watch daemons this run stops, switches and restarts: once switched, the ones it switched. */
793
651
  function unitsOf(j) {
794
652
  return { main: j.switched?.unit?.path ?? j.service?.unit ?? null, watches: j.switched?.watches?.map(w => w.path) ?? j.watches?.map(w => w.unit) ?? [] };
795
653
  }
796
- /** The watch daemons launchd had loaded before the update: the only ones stopped and started again. One a person
797
- * unloaded stays unloaded (its definition is still switched, so it starts the new version when they load it). */
798
654
  const loadedWatches = (j, watches) => watches.filter(unit => j.watches?.find(w => w.unit === unit)?.loaded !== false);
799
- /** Stop the service and every loaded watch daemon, and wait until every process they ran has exited: only then may
800
- * a file they write be replaced. */
801
655
  async function stopServices(j, system, main, watches) {
802
656
  if (!main && watches.length === 0)
803
657
  return;
@@ -807,7 +661,6 @@ async function stopServices(j, system, main, watches) {
807
661
  const watching = [];
808
662
  for (const unit of watches) {
809
663
  const earlier = j.watches?.find(w => w.unit === unit);
810
- // Recorded once, before the first stop: a resumed run must not read its own stop as the person's choice.
811
664
  const loaded = earlier ? earlier.loaded !== false : await system.serviceLoaded(unit);
812
665
  watching.push({ unit, pids: loaded ? await pidsOf(unit, earlier?.pids ?? []) : [], loaded });
813
666
  }
@@ -828,13 +681,11 @@ async function stopServices(j, system, main, watches) {
828
681
  await system.sleep(250);
829
682
  }
830
683
  }
831
- // ---- runtime switch: service definition and commands ----------------------
832
684
  function pointLink(path, target) {
833
685
  const temp = join(dirname(path), `.${basename(path)}.${randomUUID().slice(0, 8)}`);
834
686
  symlinkSync(target, temp);
835
687
  durableRename(temp, path);
836
688
  }
837
- /** What runs the current version: its service definition and every command on PATH. */
838
689
  function switchable(j, system) {
839
690
  const unit = system.serviceUnit(j.from), watches = system.watchUnits(j.from), links = system.commands(j.from);
840
691
  if (!unit && watches.length === 0 && links.length === 0)
@@ -852,7 +703,6 @@ function switchable(j, system) {
852
703
  const target = real(link);
853
704
  if (target === null || !target.startsWith(root + sep))
854
705
  throw new Refusal(`${link} runs a different Toolroll (${target ?? "a missing file"}), not ${j.from.version}, so it cannot be switched. Remove it, then update again. Nothing was changed.`);
855
- // A link is replaced by a rename beside it: its folder must take one, or the switch would stop halfway.
856
706
  try {
857
707
  accessSync(dirname(link), constants.W_OK);
858
708
  }
@@ -865,10 +715,7 @@ function switchable(j, system) {
865
715
  throw new Refusal("The service definition does not name the current runtime. Nothing was changed.");
866
716
  return { unit, watches, links };
867
717
  }
868
- /** Every change is recorded before it is made; `revert` undoes exactly those.
869
- * A rollback puts the earlier database back only once the service is gone. */
870
718
  async function switchRuntime(j, system) {
871
- // A resumed switch keeps what it first recorded, so a revert still reaches the original.
872
719
  if (!j.switched) {
873
720
  const { unit, watches, links } = switchable(j, system);
874
721
  j.switched = { links: links.map(path => ({ path, previous: readlinkSync(path) })), unit: null, watches: [] };
@@ -900,7 +747,6 @@ async function switchRuntime(j, system) {
900
747
  for (const link of j.switched.links)
901
748
  pointLink(link.path, join(j.to.dist, "bin.js"));
902
749
  }
903
- /** Put back every definition and command it can; one it cannot write is skipped and named, so the restore goes on. */
904
750
  function revertSwitch(j) {
905
751
  const stuck = [];
906
752
  for (const one of [j.switched?.unit, ...j.switched?.watches ?? []]) {
@@ -934,8 +780,6 @@ function gate(j) {
934
780
  db.close();
935
781
  }
936
782
  }
937
- /** Lift this run's admission pause, in the database and the coding catalog. A restored database has no pause of
938
- * its own (its backup dropped it), so the catalog's is lifted on its own. */
939
783
  function ungate(j) {
940
784
  const db = new (sqlite().DatabaseSync)(j.databaseFile);
941
785
  try {
@@ -962,9 +806,6 @@ function ungateCoding(j) {
962
806
  db.close();
963
807
  }
964
808
  }
965
- /** A foreground `toolroll up` holds a live watch lease; the runtime or database under it must not be replaced.
966
- * (A watch daemon releases its lease when it is stopped.) `restoring`: checked right before a backup is put back,
967
- * where a database that cannot be read has no watch on it to protect. */
968
809
  function refuseWhileWatching(j, system, restoring = false) {
969
810
  let row;
970
811
  try {
@@ -1006,7 +847,6 @@ function assertNoneActive(stateDir) {
1006
847
  if (existing && !runtimeUpdateTerminal(existing.phase))
1007
848
  throw new Refusal(`An update to ${existing.to.version} is already ${existing.phase === "scheduled" ? "scheduled" : "under way"} (${existing.detail}) Cancel it with toolroll update --cancel, or resume it with toolroll update --resume.`);
1008
849
  }
1009
- /** Record an update without running it: the console's job resumes exactly this journal id. */
1010
850
  export function prepareRuntimeUpdate(o, now) {
1011
851
  if (!/^\d+\.\d+\.\d+$/.test(o.version))
1012
852
  return { refused: `${o.version} is not a release version (x.y.z).` };
@@ -1026,7 +866,6 @@ export function prepareRuntimeUpdate(o, now) {
1026
866
  ledger(j.databaseFile, now, j.actor, "toolroll update scheduled", "scheduled", `${j.from.version} → ${j.to.version} at ${at}`);
1027
867
  return j;
1028
868
  }
1029
- /** Start an update: stage, verify, then run the journaled steps. */
1030
869
  export async function startRuntimeUpdate(o, system) {
1031
870
  if (o.version === o.current.version)
1032
871
  return { ok: true, phase: "complete", message: `Toolroll ${o.version} is current.`, journal: null };
@@ -1035,7 +874,6 @@ export async function startRuntimeUpdate(o, system) {
1035
874
  return { ok: false, phase: "refused", message: j.refused, journal: null };
1036
875
  return driveRuntimeUpdate(j, system);
1037
876
  }
1038
- /** Return to the runtime and database backup an update replaced. */
1039
877
  export async function startRuntimeRollback(o, system) {
1040
878
  let last;
1041
879
  try {
@@ -1055,8 +893,6 @@ export async function startRuntimeRollback(o, system) {
1055
893
  j.restoreFrom = { path: last.backupPath, hash: last.backupHash, updateId: last.id, ...(last.codingBackupPath && last.codingBackupHash ? { codingPath: last.codingBackupPath, codingHash: last.codingBackupHash } : {}) };
1056
894
  return driveRuntimeUpdate(j, system);
1057
895
  }
1058
- /** Continue a saved update after a crash, where it left off. With `id` (the console's job), only that update:
1059
- * a job never starts a fresh one, and a finished, replaced or rolled-back one is left alone. */
1060
896
  export async function resumeRuntimeUpdate(stateDir, system, id) {
1061
897
  const j = readRuntimeUpdate(stateDir);
1062
898
  if (id !== undefined && j?.id !== id)
@@ -1066,14 +902,12 @@ export async function resumeRuntimeUpdate(stateDir, system, id) {
1066
902
  markStarting(j, "resuming", system.now());
1067
903
  return driveRuntimeUpdate(j, system);
1068
904
  }
1069
- /** A prepared update whose job could not start. */
1070
905
  export function abandonRuntimeUpdate(stateDir, id, why, now) {
1071
906
  const j = readRuntimeUpdate(stateDir);
1072
907
  if (j?.id === id && j.phase === "scheduled")
1073
908
  save(j, "refused", why, now);
1074
909
  }
1075
910
  const CANCELLABLE = ["scheduled", "verifying", "draining"];
1076
- /** `locked`: a test's seam, called once the updater's lock is held and before the journal is read again. */
1077
911
  export function requestRuntimeUpdateCancel(stateDir, now = new Date(), seams = {}) {
1078
912
  const j = readRuntimeUpdate(stateDir);
1079
913
  if (!j || runtimeUpdateTerminal(j.phase))
@@ -1081,7 +915,6 @@ export function requestRuntimeUpdateCancel(stateDir, now = new Date(), seams = {
1081
915
  const tooLate = (at) => `The update to ${at.to.version} is past the point it can be cancelled (${at.phase}); it will finish or restore on its own.`;
1082
916
  if (!CANCELLABLE.some(phase => phase === j.phase))
1083
917
  return tooLate(j);
1084
- // No updater is running to see the request: cancel here, so the admission pause does not outlive it.
1085
918
  const lock = sqliteLock(join(j.stageDir, "worker.sqlite"));
1086
919
  if (!lock) {
1087
920
  durableJson(cancelFile(j), { id: j.id, action: "cancel" });
@@ -1089,7 +922,6 @@ export function requestRuntimeUpdateCancel(stateDir, now = new Date(), seams = {
1089
922
  }
1090
923
  try {
1091
924
  seams.locked?.();
1092
- // An updater may have moved on, finished or been replaced between the first read and the lock.
1093
925
  const held = readRuntimeUpdate(stateDir);
1094
926
  if (!held || runtimeUpdateTerminal(held.phase))
1095
927
  return "No update is in progress.";
@@ -1101,7 +933,7 @@ export function requestRuntimeUpdateCancel(stateDir, now = new Date(), seams = {
1101
933
  try {
1102
934
  ungate(held);
1103
935
  }
1104
- catch { /* no pause yet */ }
936
+ catch { }
1105
937
  if (held.kind === "update")
1106
938
  rmSync(join(held.stageDir, "runtime"), { recursive: true, force: true });
1107
939
  const noun = held.kind === "update" ? "update" : "rollback";
@@ -1109,7 +941,7 @@ export function requestRuntimeUpdateCancel(stateDir, now = new Date(), seams = {
1109
941
  try {
1110
942
  ledger(held.databaseFile, now, held.actor, `toolroll ${noun} cancelled`, "cancelled", `${held.from.version} → ${held.to.version}`);
1111
943
  }
1112
- catch { /* the journal still says what happened */ }
944
+ catch { }
1113
945
  return `Cancelled the ${noun} to ${held.to.version}. Nothing was switched; new work resumes.`;
1114
946
  }
1115
947
  finally {
@@ -1121,7 +953,6 @@ async function driveRuntimeUpdate(j, system) {
1121
953
  const lock = sqliteLock(join(j.stageDir, "worker.sqlite"), 1000);
1122
954
  if (!lock)
1123
955
  return { ok: false, phase: j.phase, message: `An updater is already working on the update to ${j.to.version}.`, journal: j };
1124
- // What was read before the lock may be out of date: a stalled update released, or a cancel, in between.
1125
956
  let saved = null;
1126
957
  try {
1127
958
  saved = readRuntimeUpdate(j.stateDir);
@@ -1136,7 +967,6 @@ async function driveRuntimeUpdate(j, system) {
1136
967
  }
1137
968
  Object.assign(j, saved);
1138
969
  }
1139
- // The lock now says an updater is here; the starting mark has done its job.
1140
970
  rmSync(startingFile(j), { force: true });
1141
971
  const at = (phase) => UPDATE_STEPS.findIndex(step => step === phase);
1142
972
  const step = (phase, detail) => { save(j, phase, detail, system.now()); system.checkpoint?.(phase); };
@@ -1147,11 +977,10 @@ async function driveRuntimeUpdate(j, system) {
1147
977
  try {
1148
978
  ledger(j.databaseFile, system.now(), j.actor, action, outcome, detail);
1149
979
  }
1150
- catch { /* the journal still says what happened */ }
980
+ catch { }
1151
981
  return { ok, phase, message, journal: j };
1152
982
  };
1153
983
  try {
1154
- // Scheduled: wait for the time, still cancellable.
1155
984
  if (j.phase === "scheduled" && j.at) {
1156
985
  while (system.now() < new Date(j.at)) {
1157
986
  if (cancelRequested(j))
@@ -1159,7 +988,6 @@ async function driveRuntimeUpdate(j, system) {
1159
988
  await system.sleep(Math.min(60_000, new Date(j.at).getTime() - system.now().getTime()));
1160
989
  }
1161
990
  }
1162
- // Resumed past the switch: the only question left is whether the new runtime is healthy.
1163
991
  const resumedAt = at(j.phase);
1164
992
  if (j.phase === "rolling-back" || j.phase === "needs-attention")
1165
993
  return await restore(j, system, finish, verb, j.error ?? "An earlier attempt stopped.");
@@ -1182,13 +1010,11 @@ async function driveRuntimeUpdate(j, system) {
1182
1010
  return finish(true, "cancelled", `The ${noun} to ${j.to.version} was cancelled. Nothing changed; new work resumed.`, `toolroll ${noun} cancelled`, "cancelled", verb);
1183
1011
  }
1184
1012
  }
1185
- // The service stops before the backup, so nothing it writes afterwards can be lost by a restore.
1186
1013
  step("backing-up", unit || watches.length > 0 ? "Stopping the background service, then backing up the database." : "Backing up the database.");
1187
1014
  await stopServices(j, system, unit, watches);
1188
1015
  refuseWhileWatching(j, system);
1189
1016
  const db = new (sqlite().DatabaseSync)(j.databaseFile, { readOnly: true });
1190
1017
  try {
1191
- // An older runtime killed before its close left its owner record behind: released once its processes are proved gone.
1192
1018
  const released = releaseStaleCodingOwner(db, [...j.service?.pids ?? [], ...(j.watches ?? []).flatMap(w => w.pids)], (pid, group) => system.processAlive(pid) || processMayBeAlive(pid, group));
1193
1019
  if (released !== null) {
1194
1020
  j.codingOwnerReleased = released;
@@ -1200,8 +1026,6 @@ async function driveRuntimeUpdate(j, system) {
1200
1026
  db.close();
1201
1027
  }
1202
1028
  const backup = join(j.stageDir, existsSync(join(j.stageDir, "orders.backup.db")) ? `orders.backup.${randomUUID()}.db` : "orders.backup.db");
1203
- // A database one or more update-safe migrations behind is backed up as it is: the rehearsal below proves the
1204
- // migration on a copy, and the new runtime runs it. Any other schema needs the separate migration procedure.
1205
1029
  j.backupHash = await verifiedDatabaseBackup(j.databaseFile, backup, j.id, async () => { await codingBackup(j); }, undefined, updateSafeSchema);
1206
1030
  j.backupPath = backup;
1207
1031
  save(j, "backing-up", "Database and coding catalog backed up.", system.now());
@@ -1233,19 +1057,17 @@ async function driveRuntimeUpdate(j, system) {
1233
1057
  const done = j.kind === "update"
1234
1058
  ? finish(true, "complete", `Toolroll ${j.to.version} is running. Your previous version (${j.from.version}) and its backup are kept; toolroll update --rollback returns to them.`, "toolroll updated", "complete", verb)
1235
1059
  : finish(true, "complete", `Back on Toolroll ${j.to.version} with the database from before the update. The records made since are kept in ${basename(j.backupPath ?? "")}.`, "toolroll rolled back", "complete", verb);
1236
- // What --rollback returns from, kept apart from the journal a later refused or failed attempt replaces.
1237
- // The update is done: failing to write this must never send it back through the restore below.
1238
1060
  try {
1239
1061
  if (j.kind === "update")
1240
1062
  durableJson(lastUpdateFile(j.stateDir), j);
1241
1063
  else
1242
1064
  rmSync(lastUpdateFile(j.stateDir), { force: true });
1243
1065
  }
1244
- catch { /* the journal still holds it until the next attempt */ }
1066
+ catch { }
1245
1067
  try {
1246
1068
  pruneRuntimes(j.stateDir, [j.to.dist, j.from.dist]);
1247
1069
  }
1248
- catch { /* an old runtime left on disk is harmless */ }
1070
+ catch { }
1249
1071
  return done;
1250
1072
  }
1251
1073
  catch (error) {
@@ -1257,11 +1079,9 @@ async function driveRuntimeUpdate(j, system) {
1257
1079
  try {
1258
1080
  ungate(j);
1259
1081
  }
1260
- catch { /* no gate yet, or the database is unreadable */ }
1261
- // Nothing uses a refused download; the database backup is kept.
1082
+ catch { }
1262
1083
  if (j.kind === "update")
1263
1084
  rmSync(join(j.stageDir, "runtime"), { recursive: true, force: true });
1264
- // A service and watch daemons stopped for the backup start again, unchanged.
1265
1085
  let restarted = "";
1266
1086
  for (const unit of [j.service?.unit, ...(j.watches ?? []).filter(w => w.loaded !== false).map(w => w.unit)]) {
1267
1087
  if (!unit)
@@ -1282,7 +1102,6 @@ async function driveRuntimeUpdate(j, system) {
1282
1102
  lock.close();
1283
1103
  }
1284
1104
  }
1285
- /** The coding catalog, backed up inside the database's write reservation (as the desktop update does). */
1286
1105
  async function codingBackup(j) {
1287
1106
  const source = codingFile(j.databaseFile);
1288
1107
  if (!codingCatalogExists(source))
@@ -1292,14 +1111,11 @@ async function codingBackup(j) {
1292
1111
  j.codingBackupPath = target;
1293
1112
  j.codingBackupHash = fileHash(target);
1294
1113
  }
1295
- /** Put back the previous runtime, then this run's own backups of the database and coding catalog, keeping what
1296
- * was written since in a named copy. */
1297
1114
  async function restore(j, system, finish, verb, why) {
1298
1115
  const noun = j.kind === "update" ? "update" : "rollback";
1299
1116
  try {
1300
1117
  save(j, "rolling-back", `${why} Restoring ${j.from.version} and the database backup.`, system.now());
1301
1118
  system.checkpoint?.("rolling-back");
1302
- // The commands go back first, so a stop that fails never leaves them on the failed version.
1303
1119
  const stuck = revertSwitch(j);
1304
1120
  const { main, watches } = unitsOf(j);
1305
1121
  await stopServices(j, system, main, watches);
@@ -1308,10 +1124,7 @@ async function restore(j, system, finish, verb, why) {
1308
1124
  if (!j.restoredDatabase) {
1309
1125
  refuseWhileWatching(j, system, true);
1310
1126
  const from = { path: j.backupPath, hash: j.backupHash, ...(j.codingBackupPath && j.codingBackupHash ? { codingPath: j.codingBackupPath, codingHash: j.codingBackupHash } : {}) };
1311
- // Nothing moves until the backups are the ones recorded and there is room to put them back.
1312
1127
  assertRestorable(j, from, system);
1313
- // A fresh copy before EVERY attempt that is about to replace the database, not only the first: a retry
1314
- // after a failure earlier in the restore must not overwrite writes made since without keeping them.
1315
1128
  const moved = await keepAside(j);
1316
1129
  save(j, "rolling-back", j.detail, system.now());
1317
1130
  try {
@@ -1319,7 +1132,6 @@ async function restore(j, system, finish, verb, why) {
1319
1132
  restoreDatabase(j, from);
1320
1133
  }
1321
1134
  catch (error) {
1322
- // The backup did not go in: the live database comes back to its own path, and is no longer named as kept.
1323
1135
  if (moved.length > 0 && !existsSync(j.databaseFile)) {
1324
1136
  moveBack(moved);
1325
1137
  forgetKept(j, j.keptAside);
@@ -1372,7 +1184,6 @@ async function verify(j, system) {
1372
1184
  j.notes = [];
1373
1185
  }
1374
1186
  }
1375
- /** Served over HTTPS by the registry itself, as the package is. */
1376
1187
  function onRegistry(url) {
1377
1188
  try {
1378
1189
  const at = new URL(url), registry = new URL(REGISTRY);
@@ -1410,7 +1221,6 @@ async function drain(j, system) {
1410
1221
  if (cancelRequested(j))
1411
1222
  return;
1412
1223
  const idle = Object.values(activeUpdateWork(db)).every(n => n === 0);
1413
- // The same settling reconcile the background worker runs, so a leftover record it can prove never holds this up.
1414
1224
  if (idle)
1415
1225
  settleLeftoverRecords(db, system.now());
1416
1226
  const lingering = idle ? lingeringRun(db) : null;
@@ -1422,7 +1232,6 @@ async function drain(j, system) {
1422
1232
  delete j.waiting;
1423
1233
  else if (j.waiting?.run !== lingering.run || j.waiting.on !== lingering.on)
1424
1234
  j.waiting = { ...lingering, since: system.now().toISOString() };
1425
- // Waiting longer on a finished run proves nothing more: stop, let new work resume, and say what clears it.
1426
1235
  if (j.waiting && system.now().getTime() - Date.parse(j.waiting.since) >= LINGERING_LIMIT_MS)
1427
1236
  throw new Refusal(stoppedWaitingWords(j.waiting));
1428
1237
  save(j, "draining", lingering ? `New work is paused. Waiting for run #${lingering.run}: ${lingeringWords(lingering)}` : `New work is paused. Waiting for ${runningWorkWords(db) ?? "running work"} to finish. Nothing is being cancelled.`, system.now());
@@ -1433,24 +1242,20 @@ async function drain(j, system) {
1433
1242
  db.close();
1434
1243
  }
1435
1244
  }
1436
- /** Keep the newest release-* runtimes (and any in `keep`), at most KEEP_RUNTIMES; deploy-browser's browser-* and
1437
- * the rollback-* records are not this updater's to remove. */
1438
1245
  export function pruneRuntimes(stateDir, keep) {
1439
1246
  const root = join(stateDir, "staged-upgrades");
1440
- // A partial or older stage file still says when it started; one that is not JSON (or is null) falls back to the mtime.
1441
1247
  const started = (dir) => { try {
1442
1248
  const at = stagedStartedAt(JSON.parse(readFileSync(join(dir, "update.json"), "utf8")));
1443
1249
  if (at !== null)
1444
1250
  return at;
1445
1251
  }
1446
- catch { /* below */ } return statSync(dir).mtime.toISOString(); };
1252
+ catch { } return statSync(dir).mtime.toISOString(); };
1447
1253
  const releases = readdirSync(root, { withFileTypes: true }).filter(entry => entry.isDirectory() && entry.name.startsWith("release-"))
1448
1254
  .map(entry => join(root, entry.name)).sort((a, b) => started(b).localeCompare(started(a)));
1449
1255
  const kept = new Set(releases.filter(dir => keep.some(dist => dist !== "" && dist.startsWith(dir + sep))));
1450
1256
  for (const dir of releases)
1451
1257
  if (kept.size < KEEP_RUNTIMES)
1452
1258
  kept.add(dir);
1453
- // A database a failed update kept aside is the only copy of what was written then: never pruned.
1454
1259
  const holdsKeptAside = (dir) => { try {
1455
1260
  return readdirSync(dir).some(name => /^orders\.(?:kept|unreadable)\./.test(name));
1456
1261
  }
@@ -1500,10 +1305,6 @@ export function updateWaitingOf(stateDir, inTheWay) {
1500
1305
  return null;
1501
1306
  return updateWaitingWords({ app: false, version, stopped: true, lingering: j.waiting });
1502
1307
  }
1503
- /** An updater that ended while letting work finish (a crash, a kill, the Mac restarting) leaves new work paused with
1504
- * nobody left to lift the pause. With no updater holding the update, the pause is lifted here and the update says it
1505
- * stopped. Nothing was switched before the backup, so nothing else needs putting back. The background worker's
1506
- * reconcile, `toolroll status` and the console run this. Returns what it said, or null. */
1507
1308
  export function releaseStalledUpdate(stateDir, now) {
1508
1309
  let j;
1509
1310
  try {
@@ -1518,17 +1319,15 @@ export function releaseStalledUpdate(stateDir, now) {
1518
1319
  if (!lock)
1519
1320
  return null;
1520
1321
  try {
1521
- // An updater may have moved on, or a resumed one replaced it, between the first read and the lock.
1522
1322
  const held = readRuntimeUpdate(stateDir);
1523
1323
  if (!held || held.id !== j.id || held.phase !== "draining")
1524
1324
  return null;
1525
- // A job launched or a resume under way has not taken the lock yet: it continues this update; nothing is lifted under it.
1526
1325
  if (updaterStarting(held, now))
1527
1326
  return null;
1528
1327
  try {
1529
1328
  ungate(held);
1530
1329
  }
1531
- catch { /* no pause yet, or the database is unreadable: the journal still says it stopped */ }
1330
+ catch { }
1532
1331
  if (held.kind === "update")
1533
1332
  rmSync(join(held.stageDir, "runtime"), { recursive: true, force: true });
1534
1333
  const noun = held.kind === "update" ? "update" : "rollback";
@@ -1537,23 +1336,20 @@ export function releaseStalledUpdate(stateDir, now) {
1537
1336
  try {
1538
1337
  ledger(held.databaseFile, now, held.actor, `toolroll ${noun} stopped`, "refused", `${held.from.version} → ${held.to.version}: the updater ended while draining`);
1539
1338
  }
1540
- catch { /* the journal still says what happened */ }
1339
+ catch { }
1541
1340
  return words;
1542
1341
  }
1543
1342
  finally {
1544
1343
  lock.close();
1545
1344
  }
1546
1345
  }
1547
- /** What `toolroll status` and the console show: a stalled `toolroll update` released first, then this installation's
1548
- * waiting update, `toolroll update`'s or the desktop app's. */
1549
1346
  export function waitingUpdate(databaseFile, inTheWay, now, desktopStates) {
1550
1347
  const stateDir = dirname(databaseFile);
1551
- // A page visit only reads (docs/plans/get-side-effects.md): the console's background pass releases a stalled update.
1552
1348
  if (!inReadOnlyRequest()) {
1553
1349
  try {
1554
1350
  releaseStalledUpdate(stateDir, now);
1555
1351
  }
1556
- catch { /* an unreadable record is shown as it is */ }
1352
+ catch { }
1557
1353
  }
1558
1354
  return updateWaitingOf(stateDir, inTheWay) ?? desktopUpdateWaitingOf(databaseFile, inTheWay, desktopStates);
1559
1355
  }
@@ -1585,15 +1381,12 @@ function processAlive(pid) {
1585
1381
  return error.code === "EPERM";
1586
1382
  }
1587
1383
  }
1588
- /** The Sigstore verifier npm itself ships (npm install and npm audit signatures use it): no dependency of Toolroll's.
1589
- * It checks the certificate chain, the transparency log entry and that the certificate names this identity. */
1590
1384
  const SIGSTORE_SCRIPT = `const input = JSON.parse(require("node:fs").readFileSync(0, "utf8"));
1591
1385
  require(input.verifier).verify(input.bundle, { certificateIssuer: input.issuer, certificateIdentityURI: input.identity })
1592
1386
  .then(() => process.exit(0), error => { process.stderr.write(String(error && error.message || error)); process.exit(1); });`;
1593
1387
  export function machineSystem(home = homedir(), env = process.env, seams = {}) {
1594
1388
  const sh = seams.exec ?? exec;
1595
1389
  const supervise = seams.run ?? (async (file, args, options) => (await import("./exec.js")).run(file, args, options));
1596
- // Linux: the laptop service is a systemd user unit; nothing else here runs under systemd (watches use launchd's road).
1597
1390
  if ((seams.platform ?? process.platform) === "linux")
1598
1391
  return { ...machineSystem(home, env, { ...seams, platform: "darwin" }), ...systemdLaptopService(home, sh, supervise, seams) };
1599
1392
  const unitFor = (from) => {
@@ -1628,8 +1421,6 @@ export function machineSystem(home = homedir(), env = process.env, seams = {}) {
1628
1421
  },
1629
1422
  attestations: url => json(url),
1630
1423
  install: async (runtime, release) => {
1631
- // From the registry by name, so npm's signature and attestation check covers the package itself (a local
1632
- // tarball is not checked), and the lockfile records exactly which bytes were installed.
1633
1424
  writeFileSync(join(runtime, "package.json"), JSON.stringify({ name: `${NAME}-runtime`, private: true, dependencies: { [NAME]: release.version } }, null, 2));
1634
1425
  const registry = `--registry=${REGISTRY}/`;
1635
1426
  const installed = sh("npm", ["install", "--omit=dev", "--ignore-scripts", "--no-audit", "--no-fund", "--no-color", registry], { cwd: runtime });
@@ -1667,7 +1458,7 @@ export function machineSystem(home = homedir(), env = process.env, seams = {}) {
1667
1458
  lstatSync(path);
1668
1459
  found.add(path);
1669
1460
  }
1670
- catch { /* not here */ }
1461
+ catch { }
1671
1462
  }
1672
1463
  }
1673
1464
  return [...found];
@@ -1707,15 +1498,12 @@ export function machineSystem(home = homedir(), env = process.env, seams = {}) {
1707
1498
  const pid = Number(printed.stdout.match(/\n\s*pid = (\d+)/)?.[1]);
1708
1499
  if (printed.code !== 0 || !(pid > 1))
1709
1500
  return [];
1710
- // Its `up` child too: the process that owns the coding catalog, so its exit is proved as well.
1711
1501
  const children = await supervise("pgrep", ["-P", String(pid)]);
1712
1502
  return [pid, ...(children.code === 0 ? children.stdout.trim().split(/\s+/).map(Number).filter(one => Number.isSafeInteger(one) && one > 1) : [])];
1713
1503
  },
1714
1504
  stopService: async (unit) => {
1715
- // As long as a watch's toolroll up takes to exit.
1716
1505
  const stopped = await stopLaunchdService(definition(unit), supervise, { waitMs: UP_EXIT_MS, ...(seams.sleep ? { sleep: seams.sleep } : {}) });
1717
1506
  if (!stopped.ok) {
1718
- // The stop disabled the label: enabled again before anything kickstarts it, or it could never start.
1719
1507
  await supervise("launchctl", ["enable", `${domain}/${labelOf(unit)}`]);
1720
1508
  throw Error(`${stopped.message}. Nothing was replaced.`);
1721
1509
  }
@@ -1756,9 +1544,6 @@ export function machineSystem(home = homedir(), env = process.env, seams = {}) {
1756
1544
  },
1757
1545
  };
1758
1546
  }
1759
- /** npm's own Sigstore verifier. Found from npm itself (the `npm` on PATH, then the one beside node), never only from
1760
- * `npm root --global`: with a custom global prefix (npm's advice for permission errors) that folder holds the global
1761
- * packages, not npm. */
1762
1547
  export function findSigstoreVerifier(o) {
1763
1548
  const npmPackage = (start) => {
1764
1549
  for (let dir = dirname(start); dir !== dirname(dir); dir = dirname(dir)) {
@@ -1766,7 +1551,7 @@ export function findSigstoreVerifier(o) {
1766
1551
  if (JSON.parse(readFileSync(join(dir, "package.json"), "utf8")).name === "npm")
1767
1552
  return dir;
1768
1553
  }
1769
- catch { /* not the package folder yet */ }
1554
+ catch { }
1770
1555
  }
1771
1556
  return null;
1772
1557
  };
@@ -1789,13 +1574,6 @@ export function findSigstoreVerifier(o) {
1789
1574
  return null;
1790
1575
  }
1791
1576
  const jobUnit = (home) => join(home, "Library", "LaunchAgents", `${UPDATE_JOB_LABEL}.plist`);
1792
- /** The console starts the updater for one prepared journal as its own one-off
1793
- * launchd job, so the service it restarts is not its parent. The job resumes
1794
- * that id only; it does not run at login (no RunAtLoad: launchd starts it
1795
- * with a kickstart) and removes its definition when it finishes. Elsewhere it
1796
- * is a detached process. */
1797
- /** Where npm puts global commands (`npm prefix --global`/bin), or null when npm does not say. Asked without blocking:
1798
- * the console's request handler starts the job. */
1799
1577
  async function npmPrefixBin(run) {
1800
1578
  const answered = await run("npm", ["prefix", "--global", "--no-color"], { timeoutMs: 30_000 }).catch(() => null);
1801
1579
  const prefix = answered?.code === 0 ? answered.stdout.trim() : "";
@@ -1805,7 +1583,6 @@ export async function launchRuntimeUpdate(args, seams = {}) {
1805
1583
  const dist = args.dist ?? dirname(fileURLToPath(import.meta.url));
1806
1584
  const command = [process.execPath, join(dist, "bin.js"), "update", "--resume", "--id", args.id, "--db", args.databaseFile];
1807
1585
  const stateDir = dirname(args.databaseFile);
1808
- // Pending until launchd starts the job and it holds the lock: nothing releases the update meanwhile.
1809
1586
  const saved = readRuntimeUpdate(stateDir);
1810
1587
  if (saved?.id === args.id && !runtimeUpdateTerminal(saved.phase))
1811
1588
  markStarting(saved, "launched", (seams.now ?? (() => new Date()))());
@@ -1813,7 +1590,6 @@ export async function launchRuntimeUpdate(args, seams = {}) {
1813
1590
  if ((seams.platform ?? process.platform) === "darwin") {
1814
1591
  const home = seams.home ?? homedir();
1815
1592
  const run = seams.run ?? (await import("./exec.js")).run;
1816
- // Everywhere a toolroll command is usually linked: the job switches every one it finds on this PATH.
1817
1593
  const npmBin = await (seams.npmBin ?? (() => npmPrefixBin(run)))();
1818
1594
  const pathEnv = [...new Set([dirname(process.execPath), ...(npmBin ? [npmBin] : []), join(home, ".local", "bin"), join(home, "bin"), join(home, "Library", "pnpm"), "/usr/local/bin", "/opt/homebrew/bin", "/usr/bin", "/bin", "/usr/sbin", "/sbin"])].join(":");
1819
1595
  const unit = launchdPlist({ label: UPDATE_JOB_LABEL, command, workingDirectory: stateDir, logPath: log, pathEnv, keepAlive: false, runAtLoad: false });
@@ -1826,23 +1602,14 @@ export async function launchRuntimeUpdate(args, seams = {}) {
1826
1602
  const out = openSync(log, "a", 0o600);
1827
1603
  spawn(command[0], command.slice(1), { detached: true, stdio: ["ignore", out, out], cwd: stateDir }).unref();
1828
1604
  }
1829
- /** The job's last act: its definition goes, so nothing can start it again. Only the definition for this id. */
1830
1605
  export function retireUpdateJob(id, home = homedir()) {
1831
1606
  const unit = jobUnit(home);
1832
1607
  try {
1833
1608
  if (readFileSync(unit, "utf8").includes(`<string>${id}</string>`))
1834
1609
  rmSync(unit, { force: true });
1835
1610
  }
1836
- catch { /* none */ }
1611
+ catch { }
1837
1612
  }
1838
- // ---- the laptop service under systemd (easy-start D) --------------------------------------------------------------
1839
- /**
1840
- * The parts of the update's machine that differ for toolroll-up.service, the laptop service on Linux: finding the
1841
- * unit, which processes it runs, stopping it and proving its controller exited through the controller's own signed
1842
- * process record (by start identity, never a pid alone), starting it again, and the health check (the unit active,
1843
- * running the new runtime, and its console proved live at the new version). Every outside effect is `supervise`
1844
- * (systemctl), `sh` (ps) or a seam, so a test scripts all of it.
1845
- */
1846
1613
  function systemdLaptopService(home, sh, supervise, seams) {
1847
1614
  const unitPath = join(home, ".config", "systemd", "user", `${LAPTOP_LABEL_LINUX}.service`);
1848
1615
  const name = `${LAPTOP_LABEL_LINUX}.service`;
@@ -1854,8 +1621,6 @@ function systemdLaptopService(home, sh, supervise, seams) {
1854
1621
  return shown.code === 0 && pid > 1 ? pid : null;
1855
1622
  };
1856
1623
  const active = async () => (await supervise("systemctl", ["--user", "is-active", name])).stdout.trim() === "active";
1857
- /** The processes the controller's signed record names, when that record is authentic for its registration and its
1858
- * `up` is the unit's main process by start identity. Null: no such proof (the stop then waits on the pid alone). */
1859
1624
  const recorded = (unit, pid) => {
1860
1625
  const db = unitFlag(readFileSync(unit, "utf8"), "linux", "--db");
1861
1626
  if (db === null || !isAbsolute(db))
@@ -1900,7 +1665,6 @@ function systemdLaptopService(home, sh, supervise, seams) {
1900
1665
  catch {
1901
1666
  return null;
1902
1667
  } },
1903
- // `daemon install` watches keep launchd's road; on Linux the update switches only the laptop service.
1904
1668
  watchUnits: () => [],
1905
1669
  serviceLoaded: async () => active(),
1906
1670
  servicePids: async () => {
@@ -1918,7 +1682,6 @@ function systemdLaptopService(home, sh, supervise, seams) {
1918
1682
  throw Error(`systemctl could not stop ${LAPTOP_LABEL_LINUX}: ${(stopped.stderr || `exit ${stopped.code}`).trim().split("\n")[0]}. Nothing was replaced.`);
1919
1683
  if (processes === null)
1920
1684
  return;
1921
- // The controller drains and exits; every process its record names must be proved gone before anything is replaced.
1922
1685
  for (let waited = 0;; waited += 250) {
1923
1686
  const left = processes.filter(one => !processGone(one, probe));
1924
1687
  if (left.length === 0)
@@ -1929,7 +1692,6 @@ function systemdLaptopService(home, sh, supervise, seams) {
1929
1692
  }
1930
1693
  },
1931
1694
  restartService: async () => {
1932
- // The switch rewrote the unit on disk: systemd reads it again before starting it.
1933
1695
  const reload = await supervise("systemctl", ["--user", "daemon-reload"]);
1934
1696
  if (reload.code !== 0)
1935
1697
  throw Error(`systemctl daemon-reload failed: ${(reload.stderr || `exit ${reload.code}`).trim()}`);
@@ -1961,7 +1723,6 @@ function systemdLaptopService(home, sh, supervise, seams) {
1961
1723
  },
1962
1724
  };
1963
1725
  }
1964
- /** The database's console is proved live (socket and HTTP) and says it is `version`. */
1965
1726
  async function liveConsoleAt(databaseFile, version) {
1966
1727
  const { proveLiveConsole } = await import("./console-instance.js");
1967
1728
  const handle = new (sqlite().DatabaseSync)(databaseFile, { readOnly: true });