harnery 0.42.0 → 0.44.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 (343) hide show
  1. package/README.md +3 -3
  2. package/dist/commander.d.ts +16 -0
  3. package/dist/commander.d.ts.map +1 -1
  4. package/dist/commander.js +18 -0
  5. package/dist/commands/agents.d.ts.map +1 -1
  6. package/dist/commands/agents.js +95 -52
  7. package/dist/commands/browse.d.ts.map +1 -1
  8. package/dist/commands/browse.js +38 -11
  9. package/dist/commands/diagnostics.d.ts.map +1 -1
  10. package/dist/commands/diagnostics.js +10 -0
  11. package/dist/commands/doctor.d.ts +12 -0
  12. package/dist/commands/doctor.d.ts.map +1 -1
  13. package/dist/commands/doctor.js +22 -7
  14. package/dist/commands/governor.js +22 -10
  15. package/dist/commands/inbox.d.ts +1 -1
  16. package/dist/commands/inbox.d.ts.map +1 -1
  17. package/dist/commands/inbox.js +55 -2
  18. package/dist/commands/rm.d.ts.map +1 -1
  19. package/dist/commands/rm.js +28 -4
  20. package/dist/commands/servers.d.ts.map +1 -1
  21. package/dist/commands/servers.js +16 -1
  22. package/dist/commands/supervisor.d.ts.map +1 -1
  23. package/dist/commands/supervisor.js +7 -2
  24. package/dist/commands/toc.d.ts +14 -0
  25. package/dist/commands/toc.d.ts.map +1 -1
  26. package/dist/commands/toc.js +7 -4
  27. package/dist/commands/tunnel.d.ts +65 -0
  28. package/dist/commands/tunnel.d.ts.map +1 -1
  29. package/dist/commands/tunnel.js +290 -101
  30. package/dist/commands/web-fetch.d.ts +3 -2
  31. package/dist/commands/web-fetch.d.ts.map +1 -1
  32. package/dist/commands/web-fetch.js +25 -19
  33. package/dist/commands/web.d.ts +7 -1
  34. package/dist/commands/web.d.ts.map +1 -1
  35. package/dist/commands/web.js +9 -3
  36. package/dist/commands/workflow.js +24 -30
  37. package/dist/core/agents/live-authority-v3.d.ts +1 -0
  38. package/dist/core/agents/live-authority-v3.d.ts.map +1 -1
  39. package/dist/core/agents/live-authority-v3.js +11 -0
  40. package/dist/core/agents/live-lifecycle-v3.d.ts +4 -2
  41. package/dist/core/agents/live-lifecycle-v3.d.ts.map +1 -1
  42. package/dist/core/agents/live-lifecycle-v3.js +28 -7
  43. package/dist/core/agents/mailbox.d.ts +9 -8
  44. package/dist/core/agents/mailbox.d.ts.map +1 -1
  45. package/dist/core/agents/mailbox.js +24 -17
  46. package/dist/core/agents/render/prompt-context.d.ts +2 -0
  47. package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
  48. package/dist/core/agents/render/prompt-context.js +19 -17
  49. package/dist/core/agents/render/session-context.d.ts +2 -8
  50. package/dist/core/agents/render/session-context.d.ts.map +1 -1
  51. package/dist/core/agents/render/session-context.js +64 -43
  52. package/dist/core/agents/rules/stop-hook.js +3 -3
  53. package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
  54. package/dist/core/agents/state/heartbeat-writer.js +25 -14
  55. package/dist/core/agents/state/live-coordination-writer.d.ts.map +1 -1
  56. package/dist/core/agents/state/live-coordination-writer.js +5 -0
  57. package/dist/core/agents/state/names.d.ts +43 -3
  58. package/dist/core/agents/state/names.d.ts.map +1 -1
  59. package/dist/core/agents/state/names.js +87 -3
  60. package/dist/core/agents/state/pidmap.d.ts.map +1 -1
  61. package/dist/core/agents/state/pidmap.js +5 -0
  62. package/dist/core/agents/state/proc-start.d.ts +19 -0
  63. package/dist/core/agents/state/proc-start.d.ts.map +1 -1
  64. package/dist/core/agents/state/proc-start.js +41 -0
  65. package/dist/core/agents/state/stale-sweep.d.ts.map +1 -1
  66. package/dist/core/agents/state/stale-sweep.js +180 -70
  67. package/dist/core/agents/state/unchanged-file.d.ts +44 -0
  68. package/dist/core/agents/state/unchanged-file.d.ts.map +1 -0
  69. package/dist/core/agents/state/unchanged-file.js +390 -0
  70. package/dist/core/context/index.d.ts +22 -10
  71. package/dist/core/context/index.d.ts.map +1 -1
  72. package/dist/core/context/index.js +381 -119
  73. package/dist/core/context/observation.d.ts +26 -0
  74. package/dist/core/context/observation.d.ts.map +1 -0
  75. package/dist/core/context/observation.js +11 -0
  76. package/dist/core/diagnostics/bundle.d.ts.map +1 -1
  77. package/dist/core/diagnostics/bundle.js +25 -14
  78. package/dist/core/diagnostics/path-identity.d.ts +3 -0
  79. package/dist/core/diagnostics/path-identity.d.ts.map +1 -0
  80. package/dist/core/diagnostics/path-identity.js +12 -0
  81. package/dist/core/diagnostics/sanitize.d.ts.map +1 -1
  82. package/dist/core/diagnostics/sanitize.js +4 -3
  83. package/dist/core/events/v3/authority-outbox.d.ts.map +1 -1
  84. package/dist/core/events/v3/authority-outbox.js +29 -0
  85. package/dist/core/events/v3/generation-custody.d.ts +5 -0
  86. package/dist/core/events/v3/generation-custody.d.ts.map +1 -0
  87. package/dist/core/events/v3/generation-custody.js +50 -0
  88. package/dist/core/events/v3/producers/coordination-recorder.d.ts +1 -0
  89. package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -1
  90. package/dist/core/events/v3/producers/coordination-recorder.js +7 -0
  91. package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
  92. package/dist/core/events/v3/producers/recorder.js +77 -64
  93. package/dist/core/events/v3/support-storage/pack-reader.d.ts.map +1 -1
  94. package/dist/core/events/v3/support-storage/pack-reader.js +42 -16
  95. package/dist/core/governor/planning.d.ts.map +1 -1
  96. package/dist/core/governor/planning.js +14 -1
  97. package/dist/core/governor/service-read.d.ts +10 -2
  98. package/dist/core/governor/service-read.d.ts.map +1 -1
  99. package/dist/core/governor/service-read.js +105 -22
  100. package/dist/core/governor/service.d.ts +20 -2
  101. package/dist/core/governor/service.d.ts.map +1 -1
  102. package/dist/core/governor/service.js +72 -47
  103. package/dist/core/hooks/cli.js +120 -23
  104. package/dist/core/hooks/fork-lineage.d.ts +40 -0
  105. package/dist/core/hooks/fork-lineage.d.ts.map +1 -0
  106. package/dist/core/hooks/fork-lineage.js +62 -0
  107. package/dist/core/hooks/resolve/transcript.d.ts +16 -0
  108. package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
  109. package/dist/core/hooks/resolve/transcript.js +84 -0
  110. package/dist/core/hooks/shell-rm.d.ts +2 -0
  111. package/dist/core/hooks/shell-rm.d.ts.map +1 -0
  112. package/dist/core/hooks/shell-rm.js +105 -0
  113. package/dist/core/hooks/shell-tokens.d.ts +12 -0
  114. package/dist/core/hooks/shell-tokens.d.ts.map +1 -0
  115. package/dist/core/hooks/shell-tokens.js +97 -0
  116. package/dist/core/hooks/shell-waiter.d.ts.map +1 -1
  117. package/dist/core/hooks/shell-waiter.js +3 -93
  118. package/dist/core/inbox/contract.d.ts +2 -1
  119. package/dist/core/inbox/contract.d.ts.map +1 -1
  120. package/dist/core/inbox/index.d.ts +2 -0
  121. package/dist/core/inbox/index.d.ts.map +1 -1
  122. package/dist/core/inbox/index.js +2 -0
  123. package/dist/core/inbox/peer-messages.d.ts +37 -0
  124. package/dist/core/inbox/peer-messages.d.ts.map +1 -0
  125. package/dist/core/inbox/peer-messages.js +72 -0
  126. package/dist/core/inbox/service.d.ts +8 -1
  127. package/dist/core/inbox/service.d.ts.map +1 -1
  128. package/dist/core/inbox/service.js +67 -21
  129. package/dist/core/inbox/targets.d.ts +22 -0
  130. package/dist/core/inbox/targets.d.ts.map +1 -0
  131. package/dist/core/inbox/targets.js +108 -0
  132. package/dist/core/inbox/watcher.js +7 -3
  133. package/dist/core/journal/index.d.ts.map +1 -1
  134. package/dist/core/journal/index.js +17 -2
  135. package/dist/core/resources/contract.d.ts +3 -0
  136. package/dist/core/resources/contract.d.ts.map +1 -1
  137. package/dist/core/resources/service-status.d.ts +14 -1
  138. package/dist/core/resources/service-status.d.ts.map +1 -1
  139. package/dist/core/resources/service-status.js +23 -13
  140. package/dist/core/resources/service.d.ts +9 -1
  141. package/dist/core/resources/service.d.ts.map +1 -1
  142. package/dist/core/resources/service.js +47 -27
  143. package/dist/core/resources/status.d.ts +2 -5
  144. package/dist/core/resources/status.d.ts.map +1 -1
  145. package/dist/core/resources/status.js +36 -7
  146. package/dist/core/semantic/contract.d.ts +5 -5
  147. package/dist/core/servers/index.d.ts +24 -13
  148. package/dist/core/servers/index.d.ts.map +1 -1
  149. package/dist/core/servers/index.js +132 -92
  150. package/dist/core/servers/tunnels.d.ts +3 -5
  151. package/dist/core/servers/tunnels.d.ts.map +1 -1
  152. package/dist/core/servers/tunnels.js +3 -9
  153. package/dist/core/storage/process-log.d.ts +12 -0
  154. package/dist/core/storage/process-log.d.ts.map +1 -1
  155. package/dist/core/storage/process-log.js +10 -2
  156. package/dist/core/supervisor/contract.d.ts +12 -0
  157. package/dist/core/supervisor/contract.d.ts.map +1 -1
  158. package/dist/core/supervisor/explanations.d.ts.map +1 -1
  159. package/dist/core/supervisor/explanations.js +2 -1
  160. package/dist/core/supervisor/findings.d.ts.map +1 -1
  161. package/dist/core/supervisor/findings.js +54 -9
  162. package/dist/core/supervisor/service.d.ts +9 -1
  163. package/dist/core/supervisor/service.d.ts.map +1 -1
  164. package/dist/core/supervisor/service.js +59 -29
  165. package/dist/core/supervisor/services.d.ts.map +1 -1
  166. package/dist/core/supervisor/services.js +22 -1
  167. package/dist/core/supervisor/status.d.ts +17 -2
  168. package/dist/core/supervisor/status.d.ts.map +1 -1
  169. package/dist/core/supervisor/status.js +70 -12
  170. package/dist/core/supervisor/timeline.d.ts.map +1 -1
  171. package/dist/core/supervisor/timeline.js +2 -1
  172. package/dist/core/work/state.js +7 -7
  173. package/dist/core/workflow/engine.d.ts.map +1 -1
  174. package/dist/core/workflow/engine.js +105 -32
  175. package/dist/core/workflow/failure-evidence.d.ts +16 -0
  176. package/dist/core/workflow/failure-evidence.d.ts.map +1 -0
  177. package/dist/core/workflow/failure-evidence.js +114 -0
  178. package/dist/core/workflow/index.d.ts +1 -1
  179. package/dist/core/workflow/index.d.ts.map +1 -1
  180. package/dist/core/workflow/index.js +1 -1
  181. package/dist/core/workflow/live-session-v3.d.ts +6 -0
  182. package/dist/core/workflow/live-session-v3.d.ts.map +1 -1
  183. package/dist/core/workflow/live-session-v3.js +126 -5
  184. package/dist/core/workflow/proof.d.ts +5 -5
  185. package/dist/core/workflow/proof.d.ts.map +1 -1
  186. package/dist/core/workflow/proof.js +115 -20
  187. package/dist/core/workflow/run-state.d.ts +3 -1
  188. package/dist/core/workflow/run-state.d.ts.map +1 -1
  189. package/dist/core/workflow/run-state.js +31 -27
  190. package/dist/core/workflow/spawn-claude.d.ts.map +1 -1
  191. package/dist/core/workflow/spawn-claude.js +19 -0
  192. package/dist/core/workflow/spawn-codex.d.ts.map +1 -1
  193. package/dist/core/workflow/spawn-codex.js +13 -0
  194. package/dist/core/workflow/spawn-cursor.d.ts.map +1 -1
  195. package/dist/core/workflow/spawn-cursor.js +19 -0
  196. package/dist/core/workflow/spawn-opencode.d.ts.map +1 -1
  197. package/dist/core/workflow/spawn-opencode.js +14 -0
  198. package/dist/core/workflow/types.d.ts +64 -17
  199. package/dist/core/workflow/types.d.ts.map +1 -1
  200. package/dist/core/workflow/workspaces/index.d.ts +0 -1
  201. package/dist/core/workflow/workspaces/index.d.ts.map +1 -1
  202. package/dist/core/workflow/workspaces/index.js +0 -1
  203. package/dist/core/workflow/workspaces/leases.d.ts +3 -1
  204. package/dist/core/workflow/workspaces/leases.d.ts.map +1 -1
  205. package/dist/core/workflow/workspaces/leases.js +30 -16
  206. package/dist/core/workflow/workspaces/local-git.d.ts +6 -2
  207. package/dist/core/workflow/workspaces/local-git.d.ts.map +1 -1
  208. package/dist/core/workflow/workspaces/local-git.js +270 -6
  209. package/dist/core/workflow/workspaces/ownership.d.ts +11 -0
  210. package/dist/core/workflow/workspaces/ownership.d.ts.map +1 -0
  211. package/dist/core/workflow/workspaces/ownership.js +194 -0
  212. package/dist/core/workflow/workspaces/reclaim.d.ts +35 -0
  213. package/dist/core/workflow/workspaces/reclaim.d.ts.map +1 -1
  214. package/dist/core/workflow/workspaces/reclaim.js +14 -0
  215. package/dist/core/workflow/workspaces/recovery.d.ts.map +1 -1
  216. package/dist/core/workflow/workspaces/recovery.js +21 -13
  217. package/dist/core/workflow/workspaces/state.d.ts +1 -0
  218. package/dist/core/workflow/workspaces/state.d.ts.map +1 -1
  219. package/dist/core/workflow/workspaces/state.js +21 -1
  220. package/dist/lib/browser/windows-chrome.d.ts +100 -12
  221. package/dist/lib/browser/windows-chrome.d.ts.map +1 -1
  222. package/dist/lib/browser/windows-chrome.js +262 -73
  223. package/dist/lib/docs-links.d.ts.map +1 -1
  224. package/dist/lib/docs-links.js +45 -2
  225. package/dist/lib/guarded-remove.d.ts +7 -0
  226. package/dist/lib/guarded-remove.d.ts.map +1 -1
  227. package/dist/lib/guarded-remove.js +106 -12
  228. package/dist/lib/identities/assume.d.ts.map +1 -1
  229. package/dist/lib/identities/assume.js +4 -0
  230. package/dist/lib/tunnel/allowlist.d.ts +44 -0
  231. package/dist/lib/tunnel/allowlist.d.ts.map +1 -0
  232. package/dist/lib/tunnel/allowlist.js +204 -0
  233. package/dist/lib/tunnel/current-address.d.ts +41 -0
  234. package/dist/lib/tunnel/current-address.d.ts.map +1 -0
  235. package/dist/lib/tunnel/current-address.js +123 -0
  236. package/dist/lib/tunnel/gate.js +13 -6
  237. package/dist/lib/tunnel/processes.d.ts +39 -0
  238. package/dist/lib/tunnel/processes.d.ts.map +1 -0
  239. package/dist/lib/tunnel/processes.js +121 -0
  240. package/dist/lib/tunnel/state.d.ts +28 -3
  241. package/dist/lib/tunnel/state.d.ts.map +1 -1
  242. package/dist/lib/tunnel/state.js +98 -27
  243. package/dist/lib/zip/index.d.ts +41 -0
  244. package/dist/lib/zip/index.d.ts.map +1 -0
  245. package/dist/lib/zip/index.js +398 -0
  246. package/package.json +8 -1
  247. package/src/commander.ts +32 -0
  248. package/src/commands/agents.ts +151 -74
  249. package/src/commands/browse.ts +50 -14
  250. package/src/commands/diagnostics.ts +10 -0
  251. package/src/commands/doctor.ts +26 -7
  252. package/src/commands/governor.ts +23 -10
  253. package/src/commands/inbox.ts +52 -2
  254. package/src/commands/rm.ts +43 -4
  255. package/src/commands/servers.ts +16 -4
  256. package/src/commands/supervisor.ts +7 -2
  257. package/src/commands/toc.ts +14 -6
  258. package/src/commands/tunnel.ts +394 -116
  259. package/src/commands/web-fetch.ts +30 -19
  260. package/src/commands/web.ts +9 -3
  261. package/src/commands/workflow.ts +30 -30
  262. package/src/core/agents/live-authority-v3.ts +17 -0
  263. package/src/core/agents/live-lifecycle-v3.ts +52 -14
  264. package/src/core/agents/mailbox.ts +26 -17
  265. package/src/core/agents/render/prompt-context.ts +35 -20
  266. package/src/core/agents/render/session-context.ts +92 -48
  267. package/src/core/agents/rules/stop-hook.ts +3 -3
  268. package/src/core/agents/state/heartbeat-writer.ts +29 -12
  269. package/src/core/agents/state/live-coordination-writer.ts +29 -0
  270. package/src/core/agents/state/names.ts +117 -6
  271. package/src/core/agents/state/pidmap.ts +13 -0
  272. package/src/core/agents/state/proc-start.ts +57 -0
  273. package/src/core/agents/state/stale-sweep.ts +247 -82
  274. package/src/core/agents/state/unchanged-file.ts +456 -0
  275. package/src/core/context/index.ts +446 -136
  276. package/src/core/context/observation.ts +29 -0
  277. package/src/core/diagnostics/bundle.ts +23 -18
  278. package/src/core/diagnostics/path-identity.ts +15 -0
  279. package/src/core/diagnostics/sanitize.ts +4 -3
  280. package/src/core/events/v3/authority-outbox.ts +56 -0
  281. package/src/core/events/v3/generation-custody.ts +59 -0
  282. package/src/core/events/v3/producers/coordination-recorder.ts +15 -0
  283. package/src/core/events/v3/producers/recorder.ts +94 -68
  284. package/src/core/events/v3/support-storage/pack-reader.ts +45 -19
  285. package/src/core/governor/planning.ts +20 -8
  286. package/src/core/governor/service-read.ts +128 -20
  287. package/src/core/governor/service.ts +119 -42
  288. package/src/core/hooks/cli.ts +139 -22
  289. package/src/core/hooks/fork-lineage.ts +82 -0
  290. package/src/core/hooks/resolve/transcript.ts +88 -0
  291. package/src/core/hooks/shell-rm.ts +103 -0
  292. package/src/core/hooks/shell-tokens.ts +96 -0
  293. package/src/core/hooks/shell-waiter.ts +4 -91
  294. package/src/core/inbox/contract.ts +2 -1
  295. package/src/core/inbox/index.ts +2 -0
  296. package/src/core/inbox/peer-messages.ts +94 -0
  297. package/src/core/inbox/service.ts +88 -22
  298. package/src/core/inbox/targets.ts +148 -0
  299. package/src/core/inbox/watcher.ts +8 -9
  300. package/src/core/journal/index.ts +19 -2
  301. package/src/core/resources/contract.ts +4 -0
  302. package/src/core/resources/service-status.ts +35 -12
  303. package/src/core/resources/service.ts +71 -24
  304. package/src/core/resources/status.ts +57 -8
  305. package/src/core/servers/index.ts +177 -91
  306. package/src/core/servers/tunnels.ts +3 -11
  307. package/src/core/storage/process-log.ts +17 -2
  308. package/src/core/supervisor/contract.ts +13 -0
  309. package/src/core/supervisor/explanations.ts +4 -1
  310. package/src/core/supervisor/findings.ts +68 -10
  311. package/src/core/supervisor/service.ts +88 -26
  312. package/src/core/supervisor/services.ts +26 -8
  313. package/src/core/supervisor/status.ts +89 -12
  314. package/src/core/supervisor/timeline.ts +2 -1
  315. package/src/core/work/state.ts +7 -7
  316. package/src/core/workflow/engine.ts +131 -49
  317. package/src/core/workflow/failure-evidence.ts +141 -0
  318. package/src/core/workflow/index.ts +0 -1
  319. package/src/core/workflow/live-session-v3.ts +146 -5
  320. package/src/core/workflow/proof.ts +134 -26
  321. package/src/core/workflow/run-state.ts +31 -29
  322. package/src/core/workflow/spawn-claude.ts +18 -0
  323. package/src/core/workflow/spawn-codex.ts +13 -0
  324. package/src/core/workflow/spawn-cursor.ts +18 -0
  325. package/src/core/workflow/spawn-opencode.ts +14 -0
  326. package/src/core/workflow/types.ts +51 -17
  327. package/src/core/workflow/workspaces/index.ts +0 -1
  328. package/src/core/workflow/workspaces/leases.ts +48 -17
  329. package/src/core/workflow/workspaces/local-git.ts +315 -5
  330. package/src/core/workflow/workspaces/ownership.ts +232 -0
  331. package/src/core/workflow/workspaces/reclaim.ts +58 -0
  332. package/src/core/workflow/workspaces/recovery.ts +25 -13
  333. package/src/core/workflow/workspaces/state.ts +20 -0
  334. package/src/lib/browser/windows-chrome.ts +346 -86
  335. package/src/lib/docs-links.ts +49 -2
  336. package/src/lib/guarded-remove.ts +132 -14
  337. package/src/lib/identities/assume.ts +4 -0
  338. package/src/lib/tunnel/allowlist.ts +208 -0
  339. package/src/lib/tunnel/current-address.ts +158 -0
  340. package/src/lib/tunnel/gate.ts +16 -8
  341. package/src/lib/tunnel/processes.ts +149 -0
  342. package/src/lib/tunnel/state.ts +123 -27
  343. package/src/lib/zip/index.ts +483 -0
package/README.md CHANGED
@@ -21,10 +21,10 @@
21
21
 
22
22
  - **Multi-agent coordination.** Per-agent heartbeats in `.harnery/active/`, claim-time and commit-time guards, the canonical event stream, councils, a decision docket, per-agent journals, and adapter adapters for Claude Code / Cursor / Codex.
23
23
  - **Cross-machine presence.** Sessions on every machine that shares a repo see each other, labeled by machine. Zero-config over the repo's own git remote (presence refs), with an optional live-socket upgrade via an end-to-end-encrypted relay: the public `relay.harnery.com`, or self-host with `harn relay serve` / the bundled Cloudflare Worker (`relay/worker/`). The relay sees only ciphertext in opaquely-named rooms.
24
- - **Coordination-aware workflows.** `harn workflow run <script>` runs bounded, schema-gated multi-subagent workflow scripts. Plain JS stages fan out to headless adapter-CLI subagents that are born coordination-registered (heartbeats, events, claim guards), and deterministic code decides the routing between stages. An optional host-owned policy gates dispatch and declared external mutations with `ALLOW`, `ASK`, and `DENY`. CLI `ASK` requests park durably for an explicit approve/deny and same-run resume; library callers stay fail-closed by default.
25
- - **Optional isolated workspaces.** Add `--isolation worktree --workspace-root <dir>` to run a workflow in a host-owned local Git worktree. Harnery freezes the allocation and provider identity, verifies the workspace before execution and resume, requires review and policy authority before fast-forward integration, and keeps cleanup conservative. Inspect with `harn workflow workspace`, then use the separate `workflow integration prepare`, `integration apply`, and `cleanup` phases. Shared execution remains the default.
24
+ - **Coordination-aware workflows.** `harn run <script>` runs bounded, schema-gated multi-subagent workflow scripts. Plain JS stages fan out to headless adapter-CLI subagents that are born coordination-registered (heartbeats, events, claim guards), and deterministic code decides the routing between stages. An optional host-owned policy gates dispatch and declared external mutations with `ALLOW`, `ASK`, and `DENY`. CLI `ASK` requests park durably for an explicit approve/deny and same-run resume; library callers stay fail-closed by default.
25
+ - **Optional isolated workspaces.** Add `--isolation worktree --workspace-root <dir>` to run a workflow in a host-owned local Git worktree. Harnery freezes the allocation and provider identity, verifies the workspace before execution and resume, requires review and policy authority before fast-forward integration, and keeps cleanup conservative. Inspect with `harn run workspace`, then use the separate `run integration prepare`, `integration apply`, and `cleanup` phases. Shared execution remains the default.
26
26
  - **Durable work above attempts.** `harn work` keeps an objective alive across bounded workflow attempts, dependencies, approval parks, failures, and review. Reusable workflow code receives the exact work ID, title, objective, acceptance criteria, and attempt identity as frozen typed context. A retry also receives the prior run's bounded error and unresolved proof criteria; retry authority and attempt ceilings stay unchanged. The manifest, proof, and append-only ledger bind the same context, and the one-shot reconciler reports the next explicit action without silently spawning, retrying, or accepting work.
27
- - **Bounded goal supervision.** `harn supervisor` freezes a mission or existing root graph, specialist team, and safety limits, then runs scheduling cycles until reviewed mission success, human attention, no progress, or budget exhaustion. Its optional planner can create the first milestone, reassess accepted milestone proof, or recover a terminal graph using only a frozen workflow-template catalog. Plans can require independent bounded specialist review before ordinary approval or auto-apply authority. Old generations stay immutable evidence, and all attempts still consume the goal budget. Use explicit foreground ticks or enroll goals in the optional heartbeat-backed background service.
27
+ - **Bounded goal supervision.** `harn governor` freezes a mission or existing root graph, specialist team, and safety limits, then runs scheduling cycles until reviewed mission success, human attention, no progress, or budget exhaustion. Its optional planner can create the first milestone, reassess accepted milestone proof, or recover a terminal graph using only a frozen workflow-template catalog. Plans can require independent bounded specialist review before ordinary approval or auto-apply authority. Old generations stay immutable evidence, and all attempts still consume the goal budget. Use explicit foreground ticks or enroll goals in the optional heartbeat-backed background service.
28
28
  - **Standalone web UI.** `harn web up` boots a local Next.js dashboard for the coord layer, councils, per-project state, and a local coding-agent status view (Claude Code / Codex / Cursor usage, backed by `harn devtools`). Ships with the git clone, not the npm package (see [Install](#install)).
29
29
  - **Backup + sync.** `harn backup` snapshots `.harnery/` via [restic](https://restic.net/); `harn sync` keeps a curated subset live across machines via [rclone](https://rclone.org/) (Google Drive or any rclone remote).
30
30
 
@@ -204,5 +204,21 @@ export interface HarneryLogStorageCommandOptions extends Pick<HarneryContextOpts
204
204
  commands?: readonly ("storage" | "logs")[];
205
205
  }
206
206
  export declare function registerHarneryLogStorageCommands(parent: Command, options?: HarneryLogStorageCommandOptions): Promise<Command>;
207
+ export interface HarneryTunnelCommandOptions {
208
+ emit?: EmitContext;
209
+ context?: HarneryProgramContext;
210
+ }
211
+ /**
212
+ * Mount `tunnel` under `parent`, for a host whose own program does not come
213
+ * from `createHarneryProgram` (a host CLI that exposes the tunnel as one of its
214
+ * command families).
215
+ */
216
+ export declare function registerHarneryTunnelCommand(parent: Command, options?: HarneryTunnelCommandOptions): Promise<Command>;
217
+ export type { RefreshCurrentOptions, RefreshCurrentResult } from "./commands/tunnel.js";
218
+ /**
219
+ * `tunnel allow add --current` as a function: allow this machine's public
220
+ * addresses and optionally reload running gates, keeping their URLs.
221
+ */
222
+ export declare function refreshTunnelCurrentAddress(options: import("./commands/tunnel.js").RefreshCurrentOptions): Promise<import("./commands/tunnel.js").RefreshCurrentResult>;
207
223
  export declare function createHarneryProgram(opts?: HarneryContextOpts): Command;
208
224
  //# sourceMappingURL=commander.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commander.d.ts","sourceRoot":"","sources":["../src/commander.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB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AAE,2BAAgC,GACxC,OAAO,CAAC,OAAO,CAAC,CAIlB;AAED,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAExF;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,OAAO,sBAAsB,EAAE,qBAAqB,GAC5D,OAAO,CAAC,OAAO,sBAAsB,EAAE,oBAAoB,CAAC,CAG9D;AAED,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAiB3E"}
package/dist/commander.js CHANGED
@@ -67,6 +67,24 @@ export async function registerHarneryLogStorageCommands(parent, options = {}) {
67
67
  }
68
68
  return parent;
69
69
  }
70
+ /**
71
+ * Mount `tunnel` under `parent`, for a host whose own program does not come
72
+ * from `createHarneryProgram` (a host CLI that exposes the tunnel as one of its
73
+ * command families).
74
+ */
75
+ export async function registerHarneryTunnelCommand(parent, options = {}) {
76
+ const { registerTunnelCommand } = await import("./commands/tunnel.js");
77
+ registerTunnelCommand(parent, options.emit ?? defaultEmit, options.context);
78
+ return parent;
79
+ }
80
+ /**
81
+ * `tunnel allow add --current` as a function: allow this machine's public
82
+ * addresses and optionally reload running gates, keeping their URLs.
83
+ */
84
+ export async function refreshTunnelCurrentAddress(options) {
85
+ const { refreshCurrentAddress } = await import("./commands/tunnel.js");
86
+ return refreshCurrentAddress(options);
87
+ }
70
88
  export function createHarneryProgram(opts = {}) {
71
89
  const program = new Command();
72
90
  const emit = opts.emit ?? defaultEmit;
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAcH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAS1E,OAAO,EAGL,qBAAqB,EAMtB,MAAM,yBAAyB,CAAC;AAejC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@ -20,7 +20,6 @@ import { coordBinPath } from "../core/agents/coord-bin.js";
20
20
  import { checkGitFinalization, formatGitFinalizationFailure, readSessionWriteClaims, } from "../core/agents/finalization.js";
21
21
  import { emitEventV3, monorepoRoot, nativeSessionIdentity, normalizeAdapter, resolveOwner, resolveOwnerBySessionEnv, resolveOwnerWithSource, sessionIdentityFromEnv, } from "../core/agents/index.js";
22
22
  import { bootstrapLiveCoordinationAuthorityV3, LiveCoordinationAuthorityV3Error, reopenLiveCoordinationGenerationV3, } from "../core/agents/live-authority-v3.js";
23
- import { isAddressableName, MailboxCapacityError, queueMailboxMessage, suggestNames, } from "../core/agents/mailbox.js";
24
23
  import { qaSignalStatusRow } from "../core/agents/qa-signal.js";
25
24
  import { reconcileCoordinationV3 } from "../core/agents/reconcile-coordination-v3.js";
26
25
  import { listSessionFinalizationRequestsV3, observeHostDisappearedV3, reconcileSessionFinalizationV3, requestSessionEndExplicitV3, } from "../core/agents/session-finalizer-v3.js";
@@ -28,6 +27,7 @@ import { SESSION_NAME_DISPLAY_NOTE, sessionNameDisplayPending, } from "../core/a
28
27
  import { agentDisplayName } from "../core/agents/state/activity-log.js";
29
28
  import { buildLifecycleSuggestedName, buildSuggestedName, readHeartbeat as readHeartbeatCache, } from "../core/agents/state/heartbeat-writer.js";
30
29
  import { describeLiveAuthorityBlockV3, liveAuthorityBlockHintV3, liveAuthorityBlockV3, readLiveCoordinationRow, readLiveCoordinationRows, } from "../core/agents/state/live-coordination-view.js";
30
+ import { forkRelationLabels, resolveForkAncestry } from "../core/agents/state/names.js";
31
31
  import { foldSessionState, } from "../core/agents/state/session-state.js";
32
32
  import { turnChangesStatusRow } from "../core/agents/turn-changes.js";
33
33
  import { turnElapsedStatusRow } from "../core/agents/turn-elapsed.js";
@@ -35,6 +35,7 @@ import { coordFreshnessSeconds, resolveBinName, sessionFinalizationConfig, } fro
35
35
  import { EVENT_ADAPTER_IDS_V3, normalizeEventAdapterIdV3, } from "../core/events/v3/adapter-id.js";
36
36
  import { readEventV3ControlState } from "../core/events/v3/control.js";
37
37
  import { projectCoordinationViewV3, readCoordinationViewV3, } from "../core/events/v3/coordination-view.js";
38
+ import { nativeInstanceIdV3 } from "../core/events/v3/live-route-observer.js";
38
39
  import { liveInstanceIdV3 } from "../core/events/v3/live-routing.js";
39
40
  import { countSummarizedSinceV3, listDiagnosticSummariesV3, } from "../core/events/v3/producers/diagnostic-summaries.js";
40
41
  import { listHookIntakeGroupsV3, listHookIntakeRecordsV3, } from "../core/events/v3/producers/intake.js";
@@ -43,9 +44,12 @@ import { readLedgerV3 } from "../core/events/v3/reader.js";
43
44
  import { EVENT_V3_LEDGER_RELATIVE_ROOT } from "../core/events/v3/writer.js";
44
45
  import { evaluateRunQualityIfDue } from "../core/guard/index.js";
45
46
  import { readRuntimeContextTelemetry, readRuntimeContextUsage, } from "../core/hooks/adapter/runtime-telemetry.js";
47
+ import { HarneryInboxCapacityError } from "../core/inbox/contract.js";
48
+ import { peerInbox, sendPeerMessage } from "../core/inbox/peer-messages.js";
46
49
  import { readRemoteMachines } from "../core/presence/index.js";
47
50
  import { formatResourceSummary, readResourceStatus } from "../core/resources/status.js";
48
51
  import { registerContextCommand } from "./context.js";
52
+ import { registerInboxCommand } from "./inbox.js";
49
53
  function readCurrentCoordinationRow(instanceId) {
50
54
  const root = monorepoRoot();
51
55
  return root ? readLiveCoordinationRow(root, instanceId) : null;
@@ -145,6 +149,12 @@ export function registerAgentsCommand(program, emitParam, programContext, binNam
145
149
  .command("agents")
146
150
  .description("The live agent sessions in this project: who is running now, what they hold, and their coordination state (whoami / list / status / health).");
147
151
  registerContextCommand(cmd, emitParam, programContext);
152
+ registerInboxCommand(cmd, emitParam, peerInbox(monorepoRoot() ?? process.cwd()), () => {
153
+ const owner = resolveOwner();
154
+ if (!owner)
155
+ throw new Error("recipient instance is required outside an agent session");
156
+ return owner;
157
+ });
148
158
  cmd
149
159
  .command("whoami")
150
160
  .description("Print the current agent's name + instance_id + files claimed")
@@ -227,6 +237,7 @@ export function registerAgentsCommand(program, emitParam, programContext, binNam
227
237
  .description("Declare this session's task lifecycle: active, blocked, or done")
228
238
  .option("--reason <text>", "Explain the lifecycle declaration")
229
239
  .option("--session-id <id>", "Target the heartbeat with this session_id directly, bypassing the ppid walk.")
240
+ .option("--force-ancestor", "Allow a fork to change its fork ancestor's lifecycle (only on explicit operator instruction)")
230
241
  .action((state, opts) => {
231
242
  runLifecycle(state, opts);
232
243
  });
@@ -236,6 +247,7 @@ export function registerAgentsCommand(program, emitParam, programContext, binNam
236
247
  .option("--session-id <id>", "Native adapter session id to finalize")
237
248
  .option("--instance-id <id>", "Canonical V3 instance id to finalize")
238
249
  .option("--outcome <outcome>", "succeeded | failed | cancelled | timed_out | denied | interrupted | unknown", "succeeded")
250
+ .option("--force-ancestor", "Allow a fork to finalize its fork ancestor's session (only on explicit operator instruction)")
239
251
  .action((opts) => {
240
252
  runEndSession(opts);
241
253
  });
@@ -277,10 +289,11 @@ export function registerAgentsCommand(program, emitParam, programContext, binNam
277
289
  });
278
290
  cmd
279
291
  .command("ping <name> <message...>")
280
- .description("Send a message to another agent by name. Works whether or not that agent " +
281
- "is running: a live peer sees it on their next prompt, and a name with no " +
282
- "live session gets it queued until a session of that name next starts. " +
283
- "Only an unknown name is refused.")
292
+ .description("Queue a durable message for one known task instance by name. Stale or " +
293
+ "done tasks receive it when that same task resumes. Ambiguous names " +
294
+ "require an exact instance; receipts do not confirm attention.")
295
+ .option("--instance-id <id>", "Select the exact known recipient instance")
296
+ .option("--require-live", "Refuse a recipient outside live presence")
284
297
  .option("--json", "JSON output")
285
298
  .action((name, message, opts) => {
286
299
  runPing(name, message.join(" "), opts);
@@ -361,6 +374,30 @@ const SESSION_OUTCOMES = new Set([
361
374
  "interrupted",
362
375
  "unknown",
363
376
  ]);
377
+ /**
378
+ * Refuse when the calling session targets one of its recorded fork ancestors.
379
+ * A fork's transcript is full of its parent's name, task, and claims, so a
380
+ * fork that "cleans up its earlier self" is usually cutting off a live parent
381
+ * (2026-10-07: a fork offered to close its running parent). Returns the
382
+ * refusal message, or null when the call may proceed.
383
+ */
384
+ function forkAncestorRefusal(root, targetIds, force, action) {
385
+ if (force)
386
+ return null;
387
+ const ids = new Set(targetIds.filter((id) => !!id));
388
+ if (ids.size === 0)
389
+ return null;
390
+ const self = resolveOwner() ?? sessionIdentityFromEnv();
391
+ if (!self || ids.has(self))
392
+ return null;
393
+ const ancestor = resolveForkAncestry(root, self).find((a) => ids.has(a.instance_id));
394
+ if (!ancestor)
395
+ return null;
396
+ const label = ancestor.name ? `agent-${ancestor.name}` : ancestor.instance_id;
397
+ return (`${label} is this session's fork ancestor: this conversation was branched from it, so its ` +
398
+ `name, task, and files in your context are its own, and it may still be running. Refusing to ` +
399
+ `${action} it. Rerun with --force-ancestor only when the operator explicitly asked for that.`);
400
+ }
364
401
  function runEndSession(opts) {
365
402
  const root = monorepoRoot();
366
403
  if (!root)
@@ -386,6 +423,11 @@ function runEndSession(opts) {
386
423
  return failCommand("session_identity_missing", "live V3 generation disappeared");
387
424
  }
388
425
  const state = record.state;
426
+ if (opts.instanceId || opts.sessionId) {
427
+ const refusal = forkAncestorRefusal(root, [target, state.session_id, nativeInstanceIdV3(state.instance_id)], opts.forceAncestor, "finalize");
428
+ if (refusal)
429
+ return failCommand("session_is_fork_ancestor", refusal);
430
+ }
389
431
  if (state.delegations.length > 0) {
390
432
  return failCommand("session_work_open", `cannot finalize while ${state.delegations.length} delegated child(ren) remain open`);
391
433
  }
@@ -1472,6 +1514,14 @@ function runLifecycle(rawState, opts) {
1472
1514
  }
1473
1515
  if (!opts.sessionId)
1474
1516
  ensureAdapterSession(root);
1517
+ if (opts.sessionId) {
1518
+ const refusal = forkAncestorRefusal(root, [opts.sessionId], opts.forceAncestor, "change the lifecycle of");
1519
+ if (refusal) {
1520
+ emit.error({ code: "session_is_fork_ancestor", message: refusal });
1521
+ process.exitCode = 1;
1522
+ return;
1523
+ }
1524
+ }
1475
1525
  const myOwner = opts.sessionId ?? resolveOwner() ?? sessionIdentityFromEnv();
1476
1526
  if (!myOwner) {
1477
1527
  emit.error(sessionResolutionFailure(root, "not in an agent session; ppid walk found no pid-map entry (pass --session-id to bypass)"));
@@ -1790,8 +1840,16 @@ function runStatus(opts) {
1790
1840
  ? Math.max(0, Math.floor((Date.now() - startedAtMs) / 1000))
1791
1841
  : 0;
1792
1842
  const { livePeers, stale: peersStale } = collectStatusPeerHealth(root, myOwner);
1793
- // Sort: file-holders first (by file count desc), then idle peers by recency.
1843
+ // Recorded fork relations label the parent and forks so a fork cannot read
1844
+ // its live parent as its own earlier session; they sort first.
1845
+ const relations = forkRelationLabels(root, myOwner, new Set(livePeers.map((p) => p.instance_id)));
1846
+ // Sort: related sessions, then file-holders (by file count desc), then idle
1847
+ // peers by recency.
1794
1848
  livePeers.sort((a, b) => {
1849
+ const ar = relations.has(a.instance_id) ? 1 : 0;
1850
+ const br = relations.has(b.instance_id) ? 1 : 0;
1851
+ if (ar !== br)
1852
+ return br - ar;
1795
1853
  const af = a.files_touched?.length ?? 0;
1796
1854
  const bf = b.files_touched?.length ?? 0;
1797
1855
  if (af !== bf)
@@ -1802,7 +1860,7 @@ function runStatus(opts) {
1802
1860
  const filesStr = formatList(filesHeld.map((p) => basename(p)), 4, "0 held");
1803
1861
  // Cross-machine presence (ADR 0016): sessions on other machines, advisory.
1804
1862
  const remoteMachines = readRemoteMachines(root);
1805
- const peersStr = formatPeers(livePeers, 4, peersStale, remoteMachines);
1863
+ const peersStr = formatPeers(livePeers, 4, peersStale, remoteMachines, relations);
1806
1864
  const ctxUsage = readContextUsage(hb.native_session_id ?? hb.session_id, hb.platform);
1807
1865
  let ctxStr;
1808
1866
  if (!ctxUsage) {
@@ -1971,14 +2029,15 @@ function formatList(items, cap, emptyLabel) {
1971
2029
  const shown = items.slice(0, cap).join(", ");
1972
2030
  return `${shown}, +${items.length - cap} more`;
1973
2031
  }
1974
- function formatPeers(peers, cap, staleCount, remoteMachines = []) {
2032
+ function formatPeers(peers, cap, staleCount, remoteMachines = [], relations = new Map()) {
1975
2033
  if (peers.length === 0 && staleCount === 0 && remoteMachines.length === 0)
1976
2034
  return "none";
1977
2035
  const labels = peers.map((p) => {
1978
2036
  const name = p.name || "unnamed";
1979
2037
  const plat = formatPlatformLabel(p.platform);
1980
2038
  const files = p.files_touched?.length ?? 0;
1981
- const base = `${name} (${plat})`;
2039
+ const relation = relations.get(p.instance_id);
2040
+ const base = relation ? `${name} (${plat}, ${relation})` : `${name} (${plat})`;
1982
2041
  return files > 0 ? `${base}, ${files} files` : base;
1983
2042
  });
1984
2043
  let main;
@@ -3803,48 +3862,34 @@ function runPing(name, message, opts) {
3803
3862
  });
3804
3863
  process.exit(1);
3805
3864
  }
3806
- const coordRoot = monorepoRoot();
3807
- const peerOwner = resolveOwnerByName(name);
3808
- // A name with no live session is the common case, not an error: the agent it
3809
- // refers to may have ended minutes ago and may come back under the same name.
3810
- // Refuse only a name that no agent has ever held, which is a typo — queueing
3811
- // that would swallow the message silently.
3812
- if (!peerOwner && coordRoot && !isAddressableName(coordRoot, name)) {
3813
- const suggestions = suggestNames(coordRoot, name);
3814
- emit.error({
3815
- code: "unknown_agent",
3816
- message: `no agent has ever been named "${name}". ` +
3817
- (suggestions.length > 0 ? `Did you mean ${suggestions.join(", ")}? ` : "") +
3818
- `Run \`${resolveBinName()} agents list\` for live sessions.`,
3819
- });
3820
- process.exit(1);
3821
- }
3865
+ const coordRoot = monorepoRoot() ?? process.cwd();
3822
3866
  const myHb = readCurrentCoordinationRow(myOwner);
3823
3867
  const fromName = myHb?.name ?? "anonymous";
3824
- const body = `from agent-${fromName}: ${message.trim()}`;
3825
- // A live recipient gets the journal entry immediately, so a peer reading
3826
- // their own journal mid-session sees it without waiting for a prompt. A
3827
- // dormant recipient has no journal to write to yet; the drain writes it into
3828
- // whichever session picks the message up.
3829
- const doc = peerOwner ? appendEntry(peerOwner, "handoff", body) : null;
3830
- let queued;
3868
+ let sent;
3831
3869
  try {
3832
- queued = queueMailboxMessage({
3833
- coordRoot: coordRoot ?? process.cwd(),
3834
- toName: name,
3835
- fromName,
3836
- fromInstanceId: myOwner,
3870
+ sent = sendPeerMessage({
3871
+ coordRoot,
3872
+ target: { name, instanceId: opts.instanceId, requireLive: opts.requireLive },
3873
+ senderName: fromName,
3874
+ senderInstanceId: myOwner,
3837
3875
  body: message.trim(),
3838
- journaled: Boolean(peerOwner),
3839
3876
  });
3840
3877
  }
3841
3878
  catch (error) {
3842
- if (error instanceof MailboxCapacityError) {
3843
- emit.error({ code: `mailbox_${error.reason_code}`, message: error.message });
3879
+ if (error instanceof HarneryInboxCapacityError) {
3880
+ emit.error({ code: `inbox_${error.reason_code}`, message: error.message });
3844
3881
  process.exit(1);
3845
3882
  }
3846
3883
  throw error;
3847
3884
  }
3885
+ if (!sent.ok) {
3886
+ emit.error({
3887
+ code: sent.code,
3888
+ message: sent.message,
3889
+ ...(sent.candidates ? { candidates: sent.candidates } : {}),
3890
+ });
3891
+ process.exit(1);
3892
+ }
3848
3893
  // Canonical delivery record: sender is the envelope owner, recipient rides
3849
3894
  // in data, so read-only observers can render the communication without
3850
3895
  // joining journal files.
@@ -3855,20 +3900,19 @@ function runPing(name, message, opts) {
3855
3900
  observation: {
3856
3901
  event_type: "coord.message_observed",
3857
3902
  direction: "sent",
3858
- subject: peerOwner ?? `name:${queued.message.to_name}`,
3903
+ subject: sent.target.instance_id,
3904
+ message_id: sent.message_id,
3859
3905
  body: message.trim(),
3860
3906
  },
3861
3907
  });
3862
3908
  const data = {
3863
- peer: queued.message.to_name,
3864
- peer_instance_id: peerOwner,
3865
- delivery: peerOwner ? "live" : "queued",
3866
- message_id: queued.message.message_id,
3867
- pending: queued.pending,
3909
+ peer: sent.target.name,
3910
+ peer_instance_id: sent.target.instance_id,
3911
+ state: sent.state,
3912
+ message_id: sent.message_id,
3913
+ synced: sent.synced,
3914
+ body_bytes: sent.body_bytes,
3868
3915
  from: fromName,
3869
- body,
3870
- journal_path: doc?.path ?? null,
3871
- journal_bytes: doc?.bytes ?? null,
3872
3916
  };
3873
3917
  if (opts.json) {
3874
3918
  emit.config({ format: "json" });
@@ -3876,9 +3920,8 @@ function runPing(name, message, opts) {
3876
3920
  return;
3877
3921
  }
3878
3922
  emit.data(data);
3879
- emit.text(peerOwner
3880
- ? `delivered to agent-${data.peer} (live; they see it on their next prompt): "${truncate(message.trim(), 80)}"\n`
3881
- : `queued for agent-${data.peer} (no live session; delivered when a session of that name next starts): "${truncate(message.trim(), 80)}"\n`);
3923
+ emit.text(`${data.state} for agent-${data.peer} (${data.peer_instance_id}); ` +
3924
+ `stored as ${data.message_id}, pending until surfaced to that task.\n`);
3882
3925
  }
3883
3926
  async function runWait(name, opts) {
3884
3927
  const timeoutMs = parseDurationToMs(opts.timeout);
@@ -1 +1 @@
1
- {"version":3,"file":"browse.d.ts","sourceRoot":"","sources":["../../src/commands/browse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAmE1E,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC9B,MAAM,yCAAyC,CAAC;AA0FjD,UAAU,UAAU;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,4BAA4B,CAAC,EAAE,2BAA2B,CAAC;IAC3D,kBAAkB,CAAC,EAAE;QACnB,QAAQ,EAAE,KAAK,CAAC;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,aAAa,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC7F,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IAC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}
@@ -22,7 +22,7 @@ import { startBrowserSessionServer, } from "../lib/browser/session-control.js";
22
22
  import { captureThumbnailFingerprint, registerCaptureThumbnail, } from "../lib/browser/thumbnail-association.js";
23
23
  import { reviewCandidateRects } from "../lib/browser/tiling.js";
24
24
  import { diffAgainstBaseline, saveBaseline, } from "../lib/browser/visual-diff.js";
25
- import { harvestDomain, harvestWindowsChromeCookies, stopWindowsChromeProfile, windowsChromePath, windowsLocalAppData, windowsPlainProfile, wslPathToWindows, } from "../lib/browser/windows-chrome.js";
25
+ import { harvestDomain, harvestWindowsChromeCookies, keepWindowsChromeSession, stopWindowsChromeProfile, windowsChromePath, windowsLocalAppData, windowsPlainProfile, wslPathToWindows, } from "../lib/browser/windows-chrome.js";
26
26
  import { applyExtraCookies, CookieJar, mergeCookies } from "../lib/cookies/index.js";
27
27
  import { commandPaceGate } from "../lib/pace/index.js";
28
28
  /**
@@ -2371,9 +2371,12 @@ function useWindowsPlainLogin() {
2371
2371
  }
2372
2372
  /**
2373
2373
  * The WSL form of `--login`: the person signs in through the Windows
2374
- * Chrome on a dedicated Windows profile with nothing attached. When the window
2375
- * closes, the profile's cookies for the sign-in site are read and merged into
2376
- * the shared cookie store, which later `browse` runs attach.
2374
+ * Chrome on a dedicated Windows profile with nothing attached. Before the
2375
+ * window opens, the profile is set to continue where it left off, so Chrome
2376
+ * keeps browser-session cookies when the window closes. When the window
2377
+ * closes, the profile's cookies for the sign-in site are read and merged
2378
+ * into the shared cookie store, which later `browse` runs attach, and the
2379
+ * last page open on that site is reported so an agent can resume from it.
2377
2380
  */
2378
2381
  async function runWindowsPlainLogin(url, storePath, loginCloseFile, emit) {
2379
2382
  const chromeLinux = windowsChromePath();
@@ -2383,6 +2386,10 @@ async function runWindowsPlainLogin(url, storePath, loginCloseFile, emit) {
2383
2386
  }
2384
2387
  const chromeWindows = wslPathToWindows(chromeLinux);
2385
2388
  const profileWindows = windowsPlainProfile(localAppData);
2389
+ const keep = keepWindowsChromeSession({ chromeWindows, profileWindows });
2390
+ if (!keep.kept) {
2391
+ emit.log("[--login] Could not set the sign-in profile to keep browser-session cookies. A sign-in that relies on them survives only if you end it from the terminal instead of closing the window.", "warn");
2392
+ }
2386
2393
  const child = spawn(chromeLinux, [`--user-data-dir=${profileWindows}`, "--no-first-run", "--no-default-browser-check", url], { stdio: "ignore" });
2387
2394
  const exited = new Promise((resolveExit) => {
2388
2395
  child.once("exit", () => resolveExit());
@@ -2397,18 +2404,38 @@ async function runWindowsPlainLogin(url, storePath, loginCloseFile, emit) {
2397
2404
  : waitForTerminalEnter(lifecycleAbort.signal));
2398
2405
  await Promise.race(waits);
2399
2406
  lifecycleAbort.abort();
2400
- stopWindowsChromeProfile(profileWindows);
2407
+ const stop = stopWindowsChromeProfile(profileWindows);
2408
+ if (stop.forced > 0) {
2409
+ emit.log("[--login] Chrome did not close when asked and was stopped. Cookies set in its last 30 seconds may be missing; run the sign-in again if later pages are signed out.", "warn");
2410
+ }
2401
2411
  await Promise.race([exited, new Promise((r) => setTimeout(r, 5000))]);
2402
2412
  const domain = harvestDomain(url);
2403
- const cookies = harvestWindowsChromeCookies({ chromeWindows, profileWindows, domain });
2413
+ const { cookies, pages } = harvestWindowsChromeCookies({ chromeWindows, profileWindows, domain });
2414
+ const lastPage = pages[0] ?? null;
2415
+ const names = [...new Set(cookies.map((cookie) => cookie.name))].sort();
2416
+ const sessionCookies = cookies.filter((cookie) => cookie.expires <= 0).length;
2404
2417
  if (cookies.length === 0) {
2405
2418
  emit.log(`[--login] No ${domain} cookies were found in the Windows profile; the sign-in may not have completed.`, "warn");
2406
- return;
2407
2419
  }
2408
- const jar = new CookieJar({ path: storePath, source: "harn-browse" });
2409
- jar.save(mergeCookies(jar.load(), cookies));
2410
- const names = [...new Set(cookies.map((cookie) => cookie.name))].sort().join(", ");
2411
- emit.log(`[--login] Copied ${cookies.length} ${domain} cookies into ${storePath}: ${names}.`, "info");
2420
+ else {
2421
+ const jar = new CookieJar({ path: storePath, source: "harn-browse" });
2422
+ jar.save(mergeCookies(jar.load(), cookies));
2423
+ emit.log(`[--login] Copied ${cookies.length} ${domain} cookies (${sessionCookies} browser-session) into ${storePath}: ${names.join(", ")}.`, "info");
2424
+ }
2425
+ if (lastPage) {
2426
+ emit.log(`[--login] Last page: ${lastPage} (the last page you had open on ${domain}; open it to continue where the sign-in left off, since its address may carry a sign-in token that cookies alone do not replace).`, "info");
2427
+ }
2428
+ emit.data({
2429
+ login: {
2430
+ domain,
2431
+ store: storePath,
2432
+ cookies: cookies.length,
2433
+ sessionCookies,
2434
+ names,
2435
+ lastPage,
2436
+ pages,
2437
+ },
2438
+ });
2412
2439
  }
2413
2440
  async function waitForLoginCloseFile(path, signal) {
2414
2441
  while (!existsSync(path) && !signal?.aborted) {
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/commands/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AA0B1E,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAmKN"}
1
+ {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/commands/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AA0B1E,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAsKN"}
@@ -23,6 +23,7 @@ export function registerDiagnosticsCommand(program, emit, context) {
23
23
  findings,
24
24
  bundles,
25
25
  capability,
26
+ supervisor: readSupervisorStatus(repoRoot),
26
27
  total_findings: findings.length,
27
28
  total_bundles: bundles.length,
28
29
  });
@@ -40,6 +41,7 @@ export function registerDiagnosticsCommand(program, emit, context) {
40
41
  schema_version: DIAGNOSTIC_COMMAND_SCHEMA_VERSION,
41
42
  kind: "diagnostic_finding",
42
43
  finding,
44
+ supervisor: readSupervisorStatus(repoRoot),
43
45
  timeline: readSupervisorTimeline(repoRoot, finding.id) ?? buildSupervisorTimeline(finding),
44
46
  explanation: readSupervisorExplanation(repoRoot, finding.id) ?? explainSupervisorFinding(finding),
45
47
  });
@@ -88,6 +90,7 @@ export function registerDiagnosticsCommand(program, emit, context) {
88
90
  schema_version: DIAGNOSTIC_COMMAND_SCHEMA_VERSION,
89
91
  kind: "diagnostic_advice",
90
92
  source: { mode: "live" },
93
+ supervisor: readSupervisorStatus(repoRoot),
91
94
  advice: buildDiagnosticAdvice({
92
95
  assessment: published.assessment,
93
96
  priorHysteresis: published.prior_hysteresis,
@@ -171,6 +174,13 @@ function liveFindingsCapability(repoRoot, reportPresent) {
171
174
  const status = readSupervisorStatus(repoRoot);
172
175
  if (status.running)
173
176
  return { source_kind: "supervisor.findings", state: "supported" };
177
+ if (status.liveness === "unknown")
178
+ return {
179
+ source_kind: "supervisor.findings",
180
+ state: "error",
181
+ reason_code: "supervisor_generation_unknown",
182
+ detail: status.build_status,
183
+ };
174
184
  return {
175
185
  source_kind: "supervisor.findings",
176
186
  state: "expired",
@@ -36,5 +36,17 @@ export declare function codexWindowsBridgeCheck(coordRoot: string | null): Check
36
36
  * now does not hide an intermittent Codex-to-WSL identity drop. */
37
37
  export declare function countRecentCodexMidFlightOnboardings(coordRoot: string, nowMs?: number, windowMs?: number): number;
38
38
  export declare function codexAuthorizationCheck(result: CodexHookAuthorizationResult): Check;
39
+ /**
40
+ * Report the `node` on PATH, which is what Node-based tools run. Under Bun,
41
+ * `process.versions.node` is the Node version Bun emulates, not an installed
42
+ * Node, so it is used only when doctor itself runs on Node and PATH has none.
43
+ */
44
+ export declare function nodeCheck(onPath: {
45
+ ok: boolean;
46
+ out: string;
47
+ }, runtime: {
48
+ node: string;
49
+ bun?: string;
50
+ }): Check;
39
51
  export {};
40
52
  //# sourceMappingURL=doctor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AASnD,OAAO,EACL,KAAK,4BAA4B,EAElC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,mCAAmC,CAAC;AAY3C,KAAK,QAAQ,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvC,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAOD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAmD/E;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC,CA+BlD;AAgCD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,oBAAoB,GAAG,IAAI,EACnC,oBAAoB,SAAI,GACvB,KAAK,GAAG,IAAI,CAed;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,KAAK,SAAa,EAClB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GACjC,KAAK,GAAG,IAAI,CAad;AAED,sFAAsF;AACtF,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG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F;AACtF,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAmB9E;AAID;mEACmE;AACnE,wBAAgB,oCAAoC,CAClD,SAAS,EAAE,MAAM,EACjB,KAAK,SAAa,EAClB,QAAQ,SAAqC,GAC5C,MAAM,CA0CR;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,4BAA4B,GAAG,KAAK,CAoBnF;AAgHD;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACpC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtC,KAAK,CAmBP"}
@@ -345,15 +345,30 @@ function checkWorkflowAdapter(adapter) {
345
345
  return { check: { name, severity: "ok", detail: `${r.out} — ${billing}` }, installed: true };
346
346
  }
347
347
  function checkNode() {
348
- const v = process.versions.node;
348
+ return nodeCheck(whichVersion("node"), process.versions);
349
+ }
350
+ /**
351
+ * Report the `node` on PATH, which is what Node-based tools run. Under Bun,
352
+ * `process.versions.node` is the Node version Bun emulates, not an installed
353
+ * Node, so it is used only when doctor itself runs on Node and PATH has none.
354
+ */
355
+ export function nodeCheck(onPath, runtime) {
356
+ const hint = "https://nodejs.org/en/download";
357
+ let v = onPath.ok ? onPath.out.replace(/^v/, "") : "";
358
+ if (!v) {
359
+ if (runtime.bun) {
360
+ return {
361
+ name: "node",
362
+ severity: "warn",
363
+ detail: "not on PATH (Bun runs harnery; Node-based tools need it)",
364
+ hint,
365
+ };
366
+ }
367
+ v = runtime.node;
368
+ }
349
369
  const major = Number.parseInt(v.split(".")[0], 10);
350
370
  if (Number.isNaN(major) || major < 20) {
351
- return {
352
- name: "node",
353
- severity: "fail",
354
- detail: `${v} (need ≥ 20)`,
355
- hint: "https://nodejs.org/en/download",
356
- };
371
+ return { name: "node", severity: "fail", detail: `${v} (need ≥ 20)`, hint };
357
372
  }
358
373
  return { name: "node", severity: "ok", detail: v };
359
374
  }