@staix/agent-hub 0.50.0 → 0.52.0

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 (350) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +1 -1
  3. package/docs/adding-an-ai-tool.md +26 -4
  4. package/docs/agent-notes/README.md +1 -0
  5. package/docs/agent-notes/adapters.md +4 -3
  6. package/docs/agent-notes/budget.md +8 -2
  7. package/docs/agent-notes/daemon.md +13 -8
  8. package/docs/agent-notes/local-worker.md +3 -3
  9. package/docs/agent-notes/security-review.md +6 -5
  10. package/docs/agent-notes/tasks.md +10 -3
  11. package/docs/agent-notes/tests.md +4 -3
  12. package/docs/cooperbench.md +1 -1
  13. package/docs/design/adapters.md +21 -0
  14. package/docs/design/cli-output-inventory.md +165 -150
  15. package/docs/design/cli-output.md +4 -3
  16. package/docs/design/guidance-probes.md +1 -0
  17. package/docs/design/roadmap.md +3 -1
  18. package/docs/design/task-board.md +35 -0
  19. package/docs/dogfood.md +21 -3
  20. package/docs/events.md +4 -2
  21. package/docs/memory.md +5 -3
  22. package/docs/operations.md +259 -19
  23. package/docs/quickstart.md +29 -2
  24. package/docs/roadmap.json +20 -20
  25. package/docs/roadmap.md +2 -2
  26. package/docs/roles.md +1 -1
  27. package/docs/sdlc.md +29 -5
  28. package/docs/security.md +11 -5
  29. package/docs/specs/2026-09-19-agent-hub-design.md +44 -0
  30. package/docs/specs/2026-09-19-multi-project-design.md +4 -0
  31. package/docs/specs/2026-09-20-upgrade-recovery-design.md +17 -0
  32. package/docs/specs/mcp-endpoint.md +63 -0
  33. package/docs/verification/2026-11-29-agy-1.5.20.md +33 -0
  34. package/docs/verification/2026-11-29-claude-profile-hook.md +12 -0
  35. package/docs/verification/2026-11-29-idle-daemon-footprint.md +75 -0
  36. package/docs/verification/2026-11-29-kimi-281-reviewer-compat.md +38 -0
  37. package/docs/verification/2026-11-29-kimi-tui-281.md +12 -0
  38. package/docs/verification/2026-11-30-0.51.0.md +91 -0
  39. package/docs/verification/2026-11-30-account-switch-1806.md +445 -0
  40. package/docs/verification/2026-11-30-capability-listing-shape-1808.md +45 -0
  41. package/docs/verification/2026-11-30-upgrade-keep-1807.md +174 -0
  42. package/docs/verification/2026-12-01-1811-confirmation-receipt.md +19 -0
  43. package/docs/verification/2026-12-01-1811-orca-agent-list.md +20 -0
  44. package/docs/verification/2026-12-01-1811-orca-pane-key.md +21 -0
  45. package/docs/verification/2026-12-02-1819-claude-process-after-renewal.md +54 -0
  46. package/docs/verification/2026-12-02-agy-1.5.21.md +74 -0
  47. package/docs/verification/2026-12-02-claude-implementer-2.1.334.md +44 -0
  48. package/docs/verification/2026-12-02-cli-import-graph.md +33 -0
  49. package/docs/verification/2026-12-03-0.52.0.md +150 -0
  50. package/docs/verification/2026-12-03-codex-0173-reviewer-isolation.md +53 -0
  51. package/docs/verification/2026-12-03-codex-0173-reviewer-tool-call.md +34 -0
  52. package/docs/verification/2026-12-03-jcode-1.3.0.md +25 -0
  53. package/docs/verification/agy/README.md +17 -0
  54. package/docs/verification/agy/cli-surface.ts +68 -0
  55. package/docs/verification/agy/interactive-bridge.ts +92 -0
  56. package/docs/verification/agy/interactive-session.ts +131 -0
  57. package/docs/verification/agy/launcher-nonce.ts +215 -0
  58. package/docs/verification/agy/native-hooks.ts +210 -0
  59. package/docs/verification/agy/originals/agent-hub-681/cli-surface.ts +87 -0
  60. package/docs/verification/agy/originals/agent-hub-681/native-hooks-adapted.ts +91 -0
  61. package/docs/verification/agy/originals/agent-hub-681/tui-actual.ts +200 -0
  62. package/docs/verification/agy/originals/agent-hub-684/probe.ts +107 -0
  63. package/docs/verification/agy/originals.json +25 -0
  64. package/docs/verification/agy/permission-new-functions.ts +128 -0
  65. package/docs/verification/agy/run-probe.py +108 -0
  66. package/docs/verification/agy/runtime.ts +171 -0
  67. package/docs/verification/agy/tmux-helper-control.ts +6 -0
  68. package/docs/verification/agy/tmux-session.ts +235 -0
  69. package/docs/verified.json +87 -42
  70. package/package.json +3 -3
  71. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  72. package/plugins/agent-hub/compat.json +157 -0
  73. package/plugins/agent-hub/kimi-hook.js +1416 -24985
  74. package/plugins/agent-hub/server.js +17415 -32755
  75. package/scripts/check-docs.mjs +1 -1
  76. package/src/adapters/acp.ts +13 -13
  77. package/src/adapters/agy/definition.ts +9 -26
  78. package/src/adapters/agy/entry.ts +2 -0
  79. package/src/adapters/channel-peer.ts +3 -1
  80. package/src/adapters/claude-channel-evidence.ts +7 -3
  81. package/src/adapters/claude-channel.ts +38 -257
  82. package/src/adapters/claude-implementer.ts +3 -1
  83. package/src/adapters/codex-appserver.ts +77 -15
  84. package/src/adapters/compat.ts +78 -14
  85. package/src/adapters/configured-acp.ts +23 -163
  86. package/src/adapters/configured-adapter-policy.ts +160 -0
  87. package/src/adapters/configured-pull-entry.ts +53 -0
  88. package/src/adapters/configured-pull.ts +38 -0
  89. package/src/adapters/conformance/fakes/app-server.ts +9 -2
  90. package/src/adapters/declaration-catalog.ts +25 -0
  91. package/src/adapters/declaration-data.ts +342 -0
  92. package/src/adapters/declaration-resolution.ts +53 -0
  93. package/src/adapters/definitions/builtin-metadata.ts +62 -84
  94. package/src/adapters/definitions/jcode-launch.ts +13 -0
  95. package/src/adapters/definitions/native-adapter-policy.ts +390 -0
  96. package/src/adapters/definitions/native-cli-claude-launch.ts +6 -3
  97. package/src/adapters/definitions/native-cli-codex-launch.ts +2 -1
  98. package/src/adapters/definitions/native-cli-entry-claude.ts +17 -2
  99. package/src/adapters/definitions/native-cli-entry-codex.ts +2 -0
  100. package/src/adapters/definitions/native-cli-entry-jcode.ts +6 -2
  101. package/src/adapters/definitions/native-cli-entry-kimi.ts +2 -0
  102. package/src/adapters/definitions/native-cli-entry-pi.ts +2 -0
  103. package/src/adapters/definitions/native-cli-entry-qwen.ts +2 -0
  104. package/src/adapters/definitions/native-cli-entry-types.ts +12 -3
  105. package/src/adapters/definitions/native-cli-jcode-home-init.ts +1 -1
  106. package/src/adapters/definitions/native-cli-launch-common.ts +2 -2
  107. package/src/adapters/definitions/native-cli-preview-common.ts +1 -1
  108. package/src/adapters/definitions/native-cli-retained.ts +1 -1
  109. package/src/adapters/definitions/native-config-defaults.ts +1 -1
  110. package/src/adapters/definitions/native-configuration.ts +18 -0
  111. package/src/adapters/definitions/native-help.ts +24 -0
  112. package/src/adapters/definitions/native-launch-declarations.ts +34 -0
  113. package/src/adapters/definitions/native-launch-policy.ts +4 -0
  114. package/src/adapters/definitions/native-launch-settings.ts +72 -0
  115. package/src/adapters/definitions/native-light-cli.ts +18 -0
  116. package/src/adapters/definitions/native-light-preview.ts +10 -0
  117. package/src/adapters/definitions/native-wrapper-launch.ts +10 -0
  118. package/src/adapters/definitions/qwen.ts +6 -29
  119. package/src/adapters/definitions/reviewer-variants.ts +7 -8
  120. package/src/adapters/external-declarations.ts +31 -0
  121. package/src/adapters/external-modules.ts +4 -29
  122. package/src/adapters/jcode.ts +19 -12
  123. package/src/adapters/native-capabilities.ts +18 -8
  124. package/src/adapters/native-facts-hooks.ts +12 -0
  125. package/src/adapters/native-proof-ports.ts +1 -1
  126. package/src/adapters/presets.ts +136 -0
  127. package/src/adapters/qwen-dual.ts +2 -2
  128. package/src/adapters/registry-types.ts +3 -0
  129. package/src/adapters/registry.ts +20 -81
  130. package/src/adapters/reviewer-print.ts +26 -9
  131. package/src/adapters/role-eligibility.ts +2 -1
  132. package/src/cli/accounts-import.ts +72 -0
  133. package/src/cli/agents-latest-table.ts +88 -0
  134. package/src/cli/agents-latest.ts +22 -0
  135. package/src/cli/agents-output.ts +10 -0
  136. package/src/cli/agents-presets.ts +100 -0
  137. package/src/cli/agents.ts +1 -1
  138. package/src/cli/attention.ts +3 -2
  139. package/src/cli/autonomy-homes.ts +7 -2
  140. package/src/cli/autonomy-offline.ts +1 -1
  141. package/src/cli/bench.ts +1 -1
  142. package/src/cli/budget-renew-guidance.ts +129 -0
  143. package/src/cli/claude-homes.ts +9 -5
  144. package/src/cli/claude-profile-hook.ts +31 -11
  145. package/src/cli/command-context.ts +3 -0
  146. package/src/cli/command-table.ts +123 -0
  147. package/src/cli/commands/accounts.ts +8 -0
  148. package/src/cli/commands/agents.ts +18 -0
  149. package/src/cli/commands/answer.ts +28 -0
  150. package/src/cli/commands/ask.ts +17 -0
  151. package/src/cli/commands/autonomy.ts +83 -0
  152. package/src/cli/commands/backlog.ts +46 -0
  153. package/src/cli/commands/bench.ts +60 -0
  154. package/src/cli/commands/board.ts +48 -0
  155. package/src/cli/commands/broker.ts +9 -0
  156. package/src/cli/commands/budget.ts +96 -0
  157. package/src/cli/commands/capabilities.ts +12 -0
  158. package/src/cli/commands/check-path.ts +55 -0
  159. package/src/cli/commands/completion.ts +8 -0
  160. package/src/cli/commands/console.ts +12 -0
  161. package/src/cli/commands/daemon.ts +8 -0
  162. package/src/cli/commands/deliverables.ts +25 -0
  163. package/src/cli/commands/doctor.ts +249 -0
  164. package/src/cli/commands/down.ts +3 -0
  165. package/src/cli/commands/export.ts +15 -0
  166. package/src/cli/commands/facts.ts +15 -0
  167. package/src/cli/commands/goal.ts +22 -0
  168. package/src/cli/commands/guidance.ts +102 -0
  169. package/src/cli/commands/help.ts +17 -0
  170. package/src/cli/commands/host.ts +45 -0
  171. package/src/cli/commands/init.ts +121 -0
  172. package/src/cli/commands/instructed.ts +19 -0
  173. package/src/cli/commands/instruction-hook.ts +15 -0
  174. package/src/cli/commands/intake.ts +24 -0
  175. package/src/cli/commands/kill.ts +15 -0
  176. package/src/cli/commands/learn.ts +23 -0
  177. package/src/cli/commands/lineage.ts +30 -0
  178. package/src/cli/commands/logs.ts +21 -0
  179. package/src/cli/commands/manager.ts +15 -0
  180. package/src/cli/commands/memory.ts +21 -0
  181. package/src/cli/commands/model.ts +25 -0
  182. package/src/cli/commands/models.ts +40 -0
  183. package/src/cli/commands/native.ts +39 -0
  184. package/src/cli/commands/pause.ts +5 -0
  185. package/src/cli/commands/peer.ts +32 -0
  186. package/src/cli/commands/permission.ts +26 -0
  187. package/src/cli/commands/permit.ts +12 -0
  188. package/src/cli/commands/pet.ts +24 -0
  189. package/src/cli/commands/projects.ts +49 -0
  190. package/src/cli/commands/queue.ts +70 -0
  191. package/src/cli/commands/recovery-run.ts +13 -0
  192. package/src/cli/commands/recovery.ts +130 -0
  193. package/src/cli/commands/release.ts +23 -0
  194. package/src/cli/commands/releases.ts +91 -0
  195. package/src/cli/commands/remember.ts +6 -0
  196. package/src/cli/commands/report.ts +27 -0
  197. package/src/cli/commands/research.ts +53 -0
  198. package/src/cli/commands/reset.ts +89 -0
  199. package/src/cli/commands/restart.ts +5 -0
  200. package/src/cli/commands/results.ts +31 -0
  201. package/src/cli/commands/resume.ts +5 -0
  202. package/src/cli/commands/review.ts +24 -0
  203. package/src/cli/commands/roadmap.ts +21 -0
  204. package/src/cli/commands/role.ts +34 -0
  205. package/src/cli/commands/roles.ts +30 -0
  206. package/src/cli/commands/room.ts +14 -0
  207. package/src/cli/commands/roster.ts +48 -0
  208. package/src/cli/commands/route.ts +9 -0
  209. package/src/cli/commands/say.ts +21 -0
  210. package/src/cli/commands/schedule.ts +17 -0
  211. package/src/cli/commands/sdlc.ts +321 -0
  212. package/src/cli/commands/settings.ts +148 -0
  213. package/src/cli/commands/setup.ts +89 -0
  214. package/src/cli/commands/shared-refusals.ts +25 -0
  215. package/src/cli/commands/smoke.ts +44 -0
  216. package/src/cli/commands/source.ts +64 -0
  217. package/src/cli/commands/specs.ts +13 -0
  218. package/src/cli/commands/status.ts +28 -0
  219. package/src/cli/commands/stop.ts +17 -0
  220. package/src/cli/commands/structure.ts +60 -0
  221. package/src/cli/commands/study.ts +39 -0
  222. package/src/cli/commands/tail.ts +19 -0
  223. package/src/cli/commands/task.ts +114 -0
  224. package/src/cli/commands/title.ts +17 -0
  225. package/src/cli/commands/turns.ts +10 -0
  226. package/src/cli/commands/ui.ts +47 -0
  227. package/src/cli/commands/undo.ts +77 -0
  228. package/src/cli/commands/up.ts +39 -0
  229. package/src/cli/commands/upgrade.ts +5 -0
  230. package/src/cli/commands/usage.ts +33 -0
  231. package/src/cli/commands/version.ts +5 -0
  232. package/src/cli/commands/watch.ts +30 -0
  233. package/src/cli/commands/worktrees.ts +31 -0
  234. package/src/cli/conductor-recovery.ts +1 -1
  235. package/src/cli/console-state.ts +5 -138
  236. package/src/cli/console-versions.ts +1 -1
  237. package/src/cli/facts-hook.ts +11 -4
  238. package/src/cli/help.ts +44 -20
  239. package/src/cli/identity.ts +27 -4
  240. package/src/cli/init-prompt.ts +1 -1
  241. package/src/cli/init-settings.ts +4 -35
  242. package/src/cli/init.ts +1 -1
  243. package/src/cli/json-text-spans.ts +57 -0
  244. package/src/cli/launch-check.ts +156 -0
  245. package/src/cli/launch.ts +19 -70
  246. package/src/cli/light-dispatch.ts +29 -0
  247. package/src/cli/main.js +8 -1
  248. package/src/cli/main.ts +257 -2799
  249. package/src/cli/memory.ts +1 -1
  250. package/src/cli/orca-probe.ts +119 -0
  251. package/src/cli/output.ts +45 -3
  252. package/src/cli/preview.ts +11 -6
  253. package/src/cli/recovery-launch.ts +1 -1
  254. package/src/cli/recovery-version-preflight.ts +28 -9
  255. package/src/cli/replace-process.ts +22 -0
  256. package/src/cli/report-layout.ts +142 -0
  257. package/src/cli/roadmap-usage.ts +16 -0
  258. package/src/cli/roadmap.ts +3 -16
  259. package/src/cli/sdlc-doctor.ts +27 -0
  260. package/src/cli/sdlc-output.ts +55 -1
  261. package/src/cli/setup-homes.ts +2 -2
  262. package/src/cli/start-agents-run.ts +85 -7
  263. package/src/cli/start-check.ts +28 -0
  264. package/src/cli/statusline-tee.ts +25 -4
  265. package/src/cli/terminal-recovery.ts +53 -10
  266. package/src/cli/upgrade-interactive.ts +1 -0
  267. package/src/cli/upgrade-runtime.ts +12 -1
  268. package/src/cli/upgrade.ts +4 -15
  269. package/src/cli/warn-line.ts +1 -1
  270. package/src/hub/accounts.ts +148 -0
  271. package/src/hub/addons.ts +20 -0
  272. package/src/hub/agent-drift.ts +2 -1
  273. package/src/hub/budget-projection.ts +39 -7
  274. package/src/hub/budget.ts +231 -16
  275. package/src/hub/channel-project.ts +3 -3
  276. package/src/hub/ci-watch.ts +311 -79
  277. package/src/hub/conductor-peer.ts +24 -0
  278. package/src/hub/conductor.ts +2 -21
  279. package/src/hub/config-apply.ts +25 -14
  280. package/src/hub/config-edit.ts +1 -1
  281. package/src/hub/config-tier.ts +2 -0
  282. package/src/hub/config.ts +535 -0
  283. package/src/hub/control-client.ts +49 -1
  284. package/src/hub/daemon.ts +492 -569
  285. package/src/hub/delivery-public.ts +11 -0
  286. package/src/hub/events.ts +3 -0
  287. package/src/hub/home-tag.ts +12 -0
  288. package/src/hub/host.ts +217 -0
  289. package/src/hub/hub-check.ts +125 -0
  290. package/src/hub/hub-tools.ts +2 -1
  291. package/src/hub/instance-budget.ts +2 -2
  292. package/src/hub/instance-config.ts +15 -126
  293. package/src/hub/instances.ts +22 -6
  294. package/src/hub/instruction-receipt.ts +2 -2
  295. package/src/hub/kimi-usage.ts +38 -11
  296. package/src/hub/lifecycle.ts +86 -4
  297. package/src/hub/mcp-bridge-core.ts +98 -0
  298. package/src/hub/mcp-channel-push.ts +20 -0
  299. package/src/hub/mcp-endpoint-serve.ts +178 -0
  300. package/src/hub/mcp-endpoint.ts +226 -0
  301. package/src/hub/mcp-tool-call.ts +181 -0
  302. package/src/hub/operational-settings.ts +2 -0
  303. package/src/hub/orca-env.ts +6 -0
  304. package/src/hub/orca-state.ts +84 -0
  305. package/src/hub/path-policy.ts +1 -1
  306. package/src/hub/peers.ts +5 -1
  307. package/src/hub/permission-mode.ts +5 -41
  308. package/src/hub/permission-paths.ts +41 -0
  309. package/src/hub/project.ts +20 -0
  310. package/src/hub/protocol-window.ts +58 -0
  311. package/src/hub/quota-origin.ts +20 -0
  312. package/src/hub/recovery-policy.ts +1 -1
  313. package/src/hub/registry.ts +36 -2
  314. package/src/hub/releases-inventory.ts +198 -0
  315. package/src/hub/report.ts +1 -1
  316. package/src/hub/research.ts +1 -1
  317. package/src/hub/review-brief.ts +47 -2
  318. package/src/hub/roster.ts +6 -3
  319. package/src/hub/routing.ts +9 -2
  320. package/src/hub/runtime-capture-prune.ts +25 -3
  321. package/src/hub/runtime-prune-health.ts +8 -1
  322. package/src/hub/sdlc-check.ts +205 -0
  323. package/src/hub/sdlc-release-authorization.ts +42 -21
  324. package/src/hub/sdlc-release-diagnostics.ts +5 -0
  325. package/src/hub/sdlc-release-policy.ts +21 -7
  326. package/src/hub/sdlc-release.ts +80 -20
  327. package/src/hub/sdlc-sync.ts +146 -0
  328. package/src/hub/sdlc.ts +38 -5
  329. package/src/hub/settings.ts +7 -4
  330. package/src/hub/start-agents.ts +1 -1
  331. package/src/hub/start-mode.ts +11 -4
  332. package/src/hub/structure-budget.ts +131 -0
  333. package/src/hub/structure-scan.ts +149 -0
  334. package/src/hub/tasks-experiment.ts +455 -0
  335. package/src/hub/tasks-guidance.ts +606 -0
  336. package/src/hub/tasks-roadmap-plan.ts +419 -0
  337. package/src/hub/tasks-roadmap.ts +491 -0
  338. package/src/hub/tasks-study.ts +661 -0
  339. package/src/hub/tasks-survey.ts +192 -0
  340. package/src/hub/tasks.ts +457 -2584
  341. package/src/hub/terminal-open.ts +5 -3
  342. package/src/hub/tooling.ts +3 -19
  343. package/src/hub/usage-rollup.ts +9 -3
  344. package/src/local/tools.ts +5 -0
  345. package/src/ui/index.html +1 -1
  346. package/src/ui/needs.ts +17 -5
  347. package/src/ui/peer-palette.ts +2 -4
  348. package/src/ui/plugin.ts +1 -1
  349. package/templates/presets/agents.json +60 -0
  350. package/templates/presets/confirmation-matrix.json +8 -8
@@ -8,7 +8,7 @@ export interface TerminalOpener {
8
8
  /** Whether a start could open a terminal now; opens nothing. */
9
9
  available(): TerminalOpened;
10
10
  /** A terminal running `argv`, which the caller assembled from fixed words: nothing here adds to it. */
11
- open(title: string, argv: readonly string[]): Promise<TerminalOpened>;
11
+ open(title: string, argv: readonly string[], worktreeRoot?: string): Promise<TerminalOpened>;
12
12
  }
13
13
 
14
14
  // ponytail: a template command still running after this long is taken to be the terminal itself, so one that fails
@@ -32,7 +32,7 @@ export function terminalOpener(opts: { template: string[]; cwd: string; stateDir
32
32
  };
33
33
  return {
34
34
  available,
35
- async open(title, argv) {
35
+ async open(title, argv, worktreeRoot) {
36
36
  const can = available();
37
37
  if (!can.ok) return can;
38
38
  // One command line, each word quoted for a POSIX shell: the terminal's shell runs exactly these words.
@@ -41,7 +41,9 @@ export function terminalOpener(opts: { template: string[]; cwd: string; stateDir
41
41
  if (can.via === "orca") {
42
42
  // The worktree comes from Orca by this project's root, never from the environment of whatever terminal started this hub (#1089).
43
43
  const orca = opts.run ? { runner: opts.run } : undefined;
44
- const target = await resolveStartTerminalWorktree(opts.cwd, orca);
44
+ // #1811: the worktree of the peer's own execution root when Orca has one, else the project root's.
45
+ const own = worktreeRoot && worktreeRoot !== opts.cwd ? await resolveStartTerminalWorktree(worktreeRoot, orca) : undefined;
46
+ const target = own?.ok ? own : await resolveStartTerminalWorktree(opts.cwd, orca);
45
47
  if (!target.ok) return target;
46
48
  await openStartTerminal(target.worktreeId, command, title, orca);
47
49
  return can;
@@ -4,17 +4,9 @@ import { accessSync, constants, statSync } from "node:fs";
4
4
  import { homedir } from "node:os";
5
5
  import { delimiter, relative, resolve, isAbsolute } from "node:path";
6
6
  import { realPath } from "./project.ts";
7
-
8
- /**
9
- * #248: which add-ons a peer works with, from a closed list. Names and versions only, read from the machine's plugin
10
- * inventory and launch settings (Claude Code's installed plugins and `enabledPlugins`, Codex's `config.toml`) and from
11
- * the executables on PATH; never a plugin's content, settings values, hooks or paths.
12
- * ponytail: the inventory is the machine's, not the session's: a session started with its own `--settings` or plugin
13
- * flags can differ. Reading the launch record of each `ahub claude` / `ahub codex` would make it exact.
14
- */
15
- export const ADDONS = ["claude-mem", "ponytail", "ripwire", "open-code-review", "codex-plugin", "dot-admit"] as const;
16
- export type AddonName = (typeof ADDONS)[number];
17
- export interface Addon { name: AddonName; version: string | null }
7
+ import { ADDONS, addonState, isAddon, type Addon, type AddonName } from "./addons.ts";
8
+ // #1778 T2b: the add-on names and their state moved to addons.ts (no registry import); re-exported so every other importer is unchanged.
9
+ export { ADDONS, addonState, isAddon, type Addon, type AddonName };
18
10
 
19
11
  /**
20
12
  * Executables any peer with a shell can run, and how each is told apart from another program of the same name: the
@@ -104,11 +96,3 @@ export async function detectTooling(peer: string, src: ToolingSources = {}): Pro
104
96
  }
105
97
  return [...found.values()].sort((a, b) => a.name.localeCompare(b.name));
106
98
  }
107
-
108
- /** `on` when any of the peers has the add-on, `off` when every peer's fingerprint is known and none has it, else unknown. */
109
- export function addonState(name: AddonName, fingerprints: (Addon[] | undefined)[]): "on" | "off" | "unknown" {
110
- if (fingerprints.some((f) => f?.some((a) => a.name === name))) return "on";
111
- return fingerprints.length && fingerprints.every((f) => f !== undefined) ? "off" : "unknown";
112
- }
113
-
114
- export const isAddon = (name: string): name is AddonName => (ADDONS as readonly string[]).includes(name);
@@ -10,7 +10,7 @@ import { segmentsOf, streamEnd } from "./log-rotation.ts";
10
10
  * - `token_rollup`: one row per day, peer and task for the hub's own `tokens` increments, which exist for every peer (Jcode and Kimi report no usage record).
11
11
  * - Issue, PR and release are never stored: they are joined from the board's current links at query time (`TaskLinks`), so a task linked later is
12
12
  * grouped under its issue for the history it already spent.
13
- * - `limit_events`: every `budget_pause`, `budget_resume` and `quota_reset` event, in order.
13
+ * - `limit_events`: every `budget_pause`, `budget_resume`, `budget_renew` and `quota_reset` event, in order.
14
14
  * - `rollup_state`: the byte offset up to which the log was folded, and the time of the first event.
15
15
  *
16
16
  * A pass reads at most `maxBytesPerPass` from the stored offset, keeps only whole lines, and commits the rows and the new offset in one
@@ -56,7 +56,7 @@ export interface UsageRow {
56
56
  /** `taskPii`: the filtered task is private, so the console shows `[pii]` for it (ids and numbers only). */
57
57
  export interface UsageResult { by: UsageGroup; since?: number; until?: number; task?: number; taskPii?: true; rows: UsageRow[]; unattributed?: UsageRow; coverage: { records: number; withUsage: number; withoutUsage: number }; throughOffset: number }
58
58
 
59
- export interface LimitRow { at: string; type: "budget_pause" | "budget_resume" | "quota_reset"; peer: string; window: string; detail: Record<string, string | number> }
59
+ export interface LimitRow { at: string; type: "budget_pause" | "budget_resume" | "budget_renew" | "quota_reset"; peer: string; window: string; detail: Record<string, string | number> }
60
60
  export interface OpenPause { peer: string; window: string; since: string; resetsAt: number }
61
61
  /** `history` is the newest `shown` of `total` events: `truncated` says so, and `omitted` is how many older ones are not in it. `open` is held by the hub now;
62
62
  * `endedUnknown` is a pause the events never closed and the hub no longer holds (cleared by `ahub reset`, which keeps the log byte for byte). */
@@ -222,7 +222,7 @@ export class UsageRollup {
222
222
  case "task": return this.foldTask(e);
223
223
  case "usage": return this.foldUsage(e);
224
224
  case "tokens": return this.foldTokens(e);
225
- case "budget_pause": case "budget_resume": case "quota_reset": return this.foldLimit(e);
225
+ case "budget_pause": case "budget_resume": case "budget_renew": case "quota_reset": return this.foldLimit(e);
226
226
  }
227
227
  }
228
228
 
@@ -275,6 +275,12 @@ export class UsageRollup {
275
275
 
276
276
  private foldLimit(e: any): void {
277
277
  if (typeof e.peer !== "string") return;
278
+ if (e.type === "budget_renew") {
279
+ if (e.by !== "person" || (e.mode !== "reset" && e.mode !== "switched")) return;
280
+ this.db.query("INSERT INTO limit_events (at, type, peer, window, detail) VALUES (?, ?, ?, ?, ?)")
281
+ .run(e.at, e.type, e.peer, "unknown", JSON.stringify({ mode: e.mode, by: "person" }));
282
+ return;
283
+ }
278
284
  const { type, at, peer, window: win, ...rest } = e;
279
285
  const detail: Record<string, string | number> = {};
280
286
  for (const [k, v] of Object.entries(rest)) if (k !== "v" && (typeof v === "number" || (typeof v === "string" && k !== "reason"))) detail[k] = v as string | number;
@@ -149,6 +149,11 @@ export function guardPath(ctx: Pick<ToolContext, "cwd" | "deny" | "readOnly" | "
149
149
  }
150
150
  const real = join(realExisting, relative(existing, abs));
151
151
  const rel = relative(root, real);
152
+ if (ctx.probe) {
153
+ // APFS can resolve a different hardlink of this inode outside the workspace.
154
+ const typedStat = lstatSync(abs, { throwIfNoEntry: false });
155
+ if (typedStat?.isFile() && typedStat.nlink !== 1) throw new ProbeToolRefusal("hardlinked_target");
156
+ }
152
157
  if (rel.startsWith("..") || resolve(root, rel) !== real) {
153
158
  if (ctx.probe) throw new ProbeToolRefusal("outside_workspace");
154
159
  throw new Error(`${path} is outside the project directory`);
package/src/ui/index.html CHANGED
@@ -1993,7 +1993,7 @@ function windowKindOf(w) { return w.kind || (w.id === 'tokens' ? 'count' : w.sou
1993
1993
  // #1513 AC2: the same sentence the console and `ahub budget` print, and never a date when the hub claims none.
1994
1994
  const PROJECTION_CAUSE = { few_points: 'too few points yet', no_burn: 'no burn yet', reset_first: 'it resets first', unknown_usage: 'no usable reading' };
1995
1995
  function projectionText(p, when) {
1996
- return p.state === 'projected' ? 'reaches its limit ' + when(p.at) + (p.basis === 'window' ? ' (rate since the window opened)' : '') : 'no forecast: ' + (PROJECTION_CAUSE[p.cause] || 'unknown');
1996
+ return p.state === 'projected' ? 'reaches its limit ' + when(p.at) + (p.basis === 'renewal' ? ' (rate since the renewal)' : p.basis === 'window' ? ' (rate since the window opened)' : '') : 'no forecast: ' + (PROJECTION_CAUSE[p.cause] || 'unknown');
1997
1997
  }
1998
1998
  function appendRoleDetails(target, peer) {
1999
1999
  if (typeof peer.form === 'string') target.append(el('p', 'Form: ' + peer.form, 'meta'));
package/src/ui/needs.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type NeedKind = "approval" | "default" | "storage" | "recovery" | "delivery" | "review" | "message" | "budget" | "offline" | "stall" | "offer" | "question" | "result";
1
+ export type NeedKind = "approval" | "default" | "storage" | "recovery" | "delivery" | "review" | "message" | "budget" | "offline" | "stall" | "offer" | "question" | "result" | "pane";
2
2
  export interface NeedItem { kind: NeedKind; level: "act" | "watch"; peer?: string; id?: string | number; until?: number; since?: number; }
3
3
  export interface NeedsInput {
4
4
  approvals?: readonly { id: string; peer?: string; expiresAt: number; since?: number }[];
@@ -9,11 +9,13 @@ export interface NeedsInput {
9
9
  tasks?: readonly { id: number; state: string; owner?: string | null; reviewer?: string | null }[];
10
10
  facts?: readonly { kind: "review" | "offline" | "stall" | "offer"; id: number; peer?: string }[];
11
11
  messages?: readonly { id?: string; peer?: string; important: boolean; since?: number }[];
12
- budget?: Readonly<Record<string, { paused?: { since?: number; resetsAt?: number } }>>;
12
+ budget?: Readonly<Record<string, { paused?: { since?: number; resetsAt?: number }; warnings?: readonly { window: string; at: number }[] }>>;
13
13
  /** #1053: the open questions a peer asked the person: the set id, the asking peer and when it was asked, never a prompt or an option. */
14
14
  questions?: readonly { set: string; peer?: string; since?: number }[];
15
15
  /** #1054: unread results, a run a person started that settled and has not been seen: the completion id, the peer and when it settled, never a prompt or a reply. */
16
16
  results?: readonly { id: string; peer?: string; since?: number }[];
17
+ /** #1811 T2: a peer whose Orca pane waits for the person: the peer, the pane's terminal handle and when it was first seen so; never the pane's text. */
18
+ panes?: readonly { peer: string; handle: string; since?: number }[];
17
19
  }
18
20
  export interface Needs { items: NeedItem[]; act: number; watch: number; state: "waiting" | "blocked" | "review" | "working" | "idle" | "sleeping"; }
19
21
  export interface NeedsSummary { act: number; watch: number; state: Needs["state"]; first?: NeedItem }
@@ -48,9 +50,19 @@ export function needs(input: NeedsInput, now: number): Needs {
48
50
  else if (fact.kind === "review") add("review", "act", undefined, fact.id);
49
51
  else if (fact.kind === "offline" && agent(fact.peer) && !offline.has(fact.peer)) { offline.add(fact.peer); add("offline", "watch", fact.peer, fact.id); }
50
52
  }
51
- for (const [peer, budget] of Object.entries(input.budget ?? {})) if (budget.paused) add("budget", "watch", peer, undefined, budget.paused.resetsAt, budget.paused.since);
53
+ for (const [peer, budget] of Object.entries(input.budget ?? {})) {
54
+ if (budget.paused) add("budget", "watch", peer, undefined, budget.paused.resetsAt, budget.paused.since);
55
+ else {
56
+ const seen = new Set<string>();
57
+ for (const warning of budget.warnings ?? []) if (id(warning.window) && time(warning.at) && warning.at >= now && !seen.has(warning.window)) {
58
+ seen.add(warning.window);
59
+ add("budget", "watch", peer, warning.window, warning.at);
60
+ }
61
+ }
62
+ }
63
+ for (const pane of input.panes ?? []) if (agent(pane.peer) && id(pane.handle)) add("pane", "act", pane.peer, pane.handle, undefined, pane.since);
52
64
  for (const result of input.results ?? []) if (id(result.id)) add("result", "watch", result.peer, result.id, undefined, result.since);
53
- const order: Record<NeedKind, number> = { approval: 0, default: 1, question: 2, storage: 3, recovery: 4, delivery: 5, review: 6, stall: 7, offer: 8, message: 9, result: 10, budget: 11, offline: 12 };
65
+ const order: Record<NeedKind, number> = { approval: 0, default: 1, question: 2, storage: 3, recovery: 4, delivery: 5, review: 6, stall: 7, pane: 7.5, offer: 8, message: 9, result: 10, budget: 11, offline: 12 };
54
66
  items.sort((a,b) => (a.level === "act" ? 0 : 1) - (b.level === "act" ? 0 : 1) || order[a.kind] - order[b.kind] || (a.kind === "approval" ? (a.until ?? Infinity) - (b.until ?? Infinity) : 0) || (a.since ?? 0) - (b.since ?? 0));
55
67
  const act = items.filter(item => item.level === "act").length, watch = items.length - act;
56
68
  const peers = Object.values(input.peers ?? {}), attached = peers.some(peer => peer.attached !== false && ["idle", "busy", "paused"].includes(peer.state ?? ""));
@@ -61,6 +73,6 @@ export function needs(input: NeedsInput, now: number): Needs {
61
73
  /** Global status never reads console-local unread messages or source text. */
62
74
  export function summarizeNeeds(input: Omit<NeedsInput, "messages">, now: number): NeedsSummary {
63
75
  const value = needs({ approvals: input.approvals, defaults: input.defaults, peers: input.peers,
64
- storageBlocked: input.storageBlocked, recovery: input.recovery, tasks: input.tasks, facts: input.facts, budget: input.budget, questions: input.questions, results: input.results }, now);
76
+ storageBlocked: input.storageBlocked, recovery: input.recovery, tasks: input.tasks, facts: input.facts, budget: input.budget, questions: input.questions, results: input.results, panes: input.panes }, now);
65
77
  return { act: value.act, watch: value.watch, state: value.state, ...(value.items[0] ? { first: value.items[0] } : {}) };
66
78
  }
@@ -1,5 +1,4 @@
1
- import { definitionOf, OFFICE_PEER_ORDER } from "../adapters/registry.ts";
2
- import type { NATIVE_DISPLAYS } from "../adapters/definitions/native-display.ts";
1
+ import { NATIVE_DISPLAYS } from "../adapters/definitions/native-display.ts";
3
2
 
4
3
  type NativePalette = { [Kind in keyof typeof NATIVE_DISPLAYS]: {
5
4
  tone: (typeof NATIVE_DISPLAYS)[Kind]["palette"]["tone"];
@@ -7,8 +6,7 @@ type NativePalette = { [Kind in keyof typeof NATIVE_DISPLAYS]: {
7
6
  css: (typeof NATIVE_DISPLAYS)[Kind]["palette"]["fg"];
8
7
  } };
9
8
  const other = { tone: "muted", ansi: "\x1b[90m", css: "#8a8f99" } as const;
10
- const nativePalette = Object.fromEntries(OFFICE_PEER_ORDER.map(kind => {
11
- const palette = definitionOf(kind)!.display.palette;
9
+ const nativePalette = Object.fromEntries(Object.entries(NATIVE_DISPLAYS).map(([kind, { palette }]) => {
12
10
  return [kind, { tone: palette.tone ?? other.tone, ansi: palette.ansi ?? other.ansi, css: palette.fg }];
13
11
  })) as NativePalette;
14
12
 
package/src/ui/plugin.ts CHANGED
@@ -590,7 +590,7 @@ export function createProvider(options: { visualPolicy?: (cwd: string) => Promis
590
590
  const before = await metadata() as { id: string; task?: number; from: string; created: number; file: VisualFile } | null;
591
591
  if (!before || before.file?.asset !== asset || before.id !== asset.split(":")[0]) return null;
592
592
  const policy = options.visualPolicy ?? (async (cwd: string): Promise<DeliverablePorts> => {
593
- const { loadConfig } = await import("../hub/daemon.ts");
593
+ const { loadConfig } = await import("../hub/config.ts");
594
594
  const config = loadConfig(cwd); return { cwd, deny: config.local.deny, private: file => matchesPolicy(cwd, file, config.pii?.paths ?? [], true) };
595
595
  });
596
596
  const initialPolicy = await policy(project.root);
@@ -0,0 +1,60 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "presets": [
4
+ {
5
+ "id": "gemini",
6
+ "displayName": "Gemini CLI",
7
+ "executable": "gemini",
8
+ "acp": { "args": ["--acp"], "identity": { "name": "gemini-cli" } },
9
+ "versionArgs": ["--version"],
10
+ "mcp": {
11
+ "add": ["gemini", "mcp", "add", "--scope", "user", "{name}", "{command}", "{args}"],
12
+ "check": { "file": "~/.gemini/settings.json", "key": "mcpServers" }
13
+ },
14
+ "recorded": "gemini 0.67.0, 2026-12-01: launch line from `gemini --help`, ACP identity from `initialize`, registration from `gemini mcp add --help`",
15
+ "status": "untested",
16
+ "receipt": null
17
+ },
18
+ {
19
+ "id": "opencode",
20
+ "displayName": "opencode",
21
+ "executable": "opencode",
22
+ "acp": { "args": ["acp"], "identity": { "name": "OpenCode" } },
23
+ "versionArgs": ["--version"],
24
+ "mcp": {
25
+ "add": null,
26
+ "check": { "file": "~/.config/opencode/opencode.json", "key": "mcp" }
27
+ },
28
+ "recorded": "opencode 1.19.5, 2026-12-01: launch line from `opencode acp --help`, ACP identity from `initialize`; `opencode mcp add` is interactive, so the registration is made in that menu or by editing the file",
29
+ "status": "untested",
30
+ "receipt": null
31
+ },
32
+ {
33
+ "id": "kiro",
34
+ "displayName": "Kiro CLI",
35
+ "executable": "kiro-cli",
36
+ "acp": { "args": ["acp"], "identity": { "name": "Kiro CLI Agent" } },
37
+ "versionArgs": ["--version"],
38
+ "mcp": {
39
+ "add": ["kiro-cli", "mcp", "add", "--name", "{name}", "--scope", "global", "--command", "{command}", "--args", "{args}"],
40
+ "check": { "file": "~/.kiro/settings/mcp.json", "key": "mcpServers" }
41
+ },
42
+ "recorded": "kiro-cli 3.7.1, 2026-12-01: launch line from `kiro-cli acp --help`, ACP identity from `initialize`, registration from `kiro-cli mcp add --help`",
43
+ "status": "untested",
44
+ "receipt": null
45
+ },
46
+ {
47
+ "id": "copilot",
48
+ "displayName": "GitHub Copilot CLI",
49
+ "executable": "copilot",
50
+ "versionArgs": ["--version"],
51
+ "mcp": {
52
+ "add": ["copilot", "mcp", "add", "{name}", "--", "{command}", "{args}"],
53
+ "check": { "file": "~/.copilot/mcp-config.json", "key": "mcpServers" }
54
+ },
55
+ "recorded": "copilot 1.0.107, 2026-12-01: `copilot --help` lists no ACP mode, so there is no headless launch line; registration from `copilot mcp add --help`",
56
+ "status": "untested",
57
+ "receipt": null
58
+ }
59
+ ]
60
+ }
@@ -227,7 +227,7 @@
227
227
  "note": "In a managed launch (ahub claude) the PreToolUse hook sees every call. ask gives no hook decision, so Claude's own rules ask. ask-when-needed lets project file tools run outside .agenthub, .git and agent configuration. never-ask returns a hook allow for every tool. A session not started by ahub claude has no hub hook, and an --unattended launch skips every permission check, hooks included: the hub sees nothing there.",
228
228
  "evidence": [
229
229
  { "file": "docs/operations.md", "needle": "Hook allow for every tool" },
230
- { "file": "src/adapters/definitions/builtin-metadata.ts", "needle": "Claude's own permission rules decide" }
230
+ { "file": "src/adapters/definitions/native-adapter-policy.ts", "needle": "Claude's own permission rules decide" }
231
231
  ]
232
232
  },
233
233
  {
@@ -276,7 +276,7 @@
276
276
  "unknowns": ["whether the confirmation appears on every ordinary ahub claude start", "whether Orca profile homes differ"],
277
277
  "evidence": [
278
278
  { "file": "docs/smoke.md", "needle": "development-channel confirmation" },
279
- { "file": "src/adapters/definitions/builtin-metadata.ts", "needle": "--dangerously-load-development-channels" }
279
+ { "file": "src/adapters/definitions/native-launch-policy.ts", "needle": "--dangerously-load-development-channels" }
280
280
  ]
281
281
  },
282
282
  {
@@ -401,7 +401,7 @@
401
401
  "askedBy": "native-tui",
402
402
  "note": "Pull-only: no hub permission mode, busy state, watchdog or console approval. The status row says Kimi approves tools in its own TUI.",
403
403
  "evidence": [
404
- { "file": "src/adapters/definitions/builtin-metadata.ts", "needle": "Kimi approves tools and selects its permission mode in its own TUI" }
404
+ { "file": "src/adapters/definitions/native-adapter-policy.ts", "needle": "Kimi approves tools and selects its permission mode in its own TUI" }
405
405
  ]
406
406
  },
407
407
  {
@@ -615,7 +615,7 @@
615
615
  "note": "permission_modes.jcode is refused by the config loader. unknown: who asks and where, in the TUI and in headless ACP. The source establishes only that the policy is unmanaged by the hub, not that a native TUI prompt appears, and in headless there is no TUI.",
616
616
  "unknowns": ["who asks and where, in the TUI form", "who asks and where, in headless ACP"],
617
617
  "evidence": [
618
- { "file": "src/adapters/definitions/builtin-metadata.ts", "needle": "Jcode native policy is unmanaged" },
618
+ { "file": "src/adapters/definitions/native-adapter-policy.ts", "needle": "Jcode native policy is unmanaged" },
619
619
  { "file": "src/hub/permission-mode.ts", "needle": "approvals belong to its native tools" }
620
620
  ]
621
621
  },
@@ -708,7 +708,7 @@
708
708
  "askedBy": "native-tui",
709
709
  "note": "Pull-only and started only by the person's own ahub agy: conductor starts are refused, so terminal.open and Orca never open it. --dangerously-skip-permissions and --unattended are refused until their native mapping is verified.",
710
710
  "evidence": [
711
- { "file": "src/adapters/agy/definition.ts", "needle": "Antigravity approves tools in its own TUI" }
711
+ { "file": "src/adapters/definitions/native-adapter-policy.ts", "needle": "Antigravity approves tools in its own TUI" }
712
712
  ]
713
713
  },
714
714
  {
@@ -722,7 +722,7 @@
722
722
  "hubSeesBeforeRun": "no",
723
723
  "askedBy": "native-tui",
724
724
  "evidence": [
725
- { "file": "src/adapters/agy/definition.ts", "needle": "unmanaged native permission policy" }
725
+ { "file": "src/adapters/definitions/native-adapter-policy.ts", "needle": "unmanaged native permission policy" }
726
726
  ]
727
727
  },
728
728
  {
@@ -814,9 +814,9 @@
814
814
  "controlledBy": ["terminal.open"],
815
815
  "hubSeesBeforeRun": "not-applicable",
816
816
  "askedBy": "none",
817
- "note": "Orca runs Claude under per-profile CLAUDE_CONFIG_DIR homes (issue #999). ahub setup does not read CLAUDE_CONFIG_DIR, so unknown: whether the hub plugin is installed in each profile home.",
818
- "unknowns": ["whether the hub plugin is installed in each Orca Claude profile home"],
817
+ "note": "Orca runs Claude under per-profile CLAUDE_CONFIG_DIR homes (issue #999). ahub setup does not read CLAUDE_CONFIG_DIR. Plugin in each profile home: unverified. The 2026-12-01 receipt verified it in one of two listed homes; the other home does not exist on that machine.",
819
818
  "evidence": [
819
+ { "file": "docs/verification/2026-12-01-1811-confirmation-receipt.md", "needle": "Unverified." },
820
820
  { "file": "src/cli/terminal-recovery.ts", "needle": "[\"terminal\", \"create\", \"--worktree\"" },
821
821
  { "file": "src/adapters/definitions/builtin-metadata.ts", "needle": "configDirEnv: \"CLAUDE_CONFIG_DIR\"" }
822
822
  ]