harnery 0.36.0 → 0.37.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 (311) hide show
  1. package/dist/commander.js +4 -0
  2. package/dist/commands/agents.d.ts.map +1 -1
  3. package/dist/commands/agents.js +87 -46
  4. package/dist/commands/artifacts.d.ts.map +1 -1
  5. package/dist/commands/artifacts.js +26 -1
  6. package/dist/commands/browse.d.ts.map +1 -1
  7. package/dist/commands/browse.js +11 -0
  8. package/dist/commands/diagnostics.d.ts +4 -0
  9. package/dist/commands/diagnostics.d.ts.map +1 -0
  10. package/dist/commands/diagnostics.js +229 -0
  11. package/dist/commands/files.d.ts +12 -0
  12. package/dist/commands/files.d.ts.map +1 -1
  13. package/dist/commands/files.js +54 -1
  14. package/dist/commands/governor.d.ts.map +1 -1
  15. package/dist/commands/governor.js +4 -0
  16. package/dist/commands/ledger-v3.d.ts.map +1 -1
  17. package/dist/commands/ledger-v3.js +71 -2
  18. package/dist/commands/qa-run.d.ts +4 -0
  19. package/dist/commands/qa-run.d.ts.map +1 -0
  20. package/dist/commands/qa-run.js +141 -0
  21. package/dist/commands/resources.d.ts +4 -0
  22. package/dist/commands/resources.d.ts.map +1 -0
  23. package/dist/commands/resources.js +29 -0
  24. package/dist/commands/supervisor.d.ts +4 -0
  25. package/dist/commands/supervisor.d.ts.map +1 -0
  26. package/dist/commands/supervisor.js +101 -0
  27. package/dist/commands/web.d.ts.map +1 -1
  28. package/dist/commands/web.js +17 -0
  29. package/dist/commands/workflow.d.ts.map +1 -1
  30. package/dist/commands/workflow.js +4 -0
  31. package/dist/core/agents/cli.js +7 -3
  32. package/dist/core/agents/health.d.ts +17 -0
  33. package/dist/core/agents/health.d.ts.map +1 -0
  34. package/dist/core/agents/health.js +109 -0
  35. package/dist/core/agents/mailbox.d.ts +92 -0
  36. package/dist/core/agents/mailbox.d.ts.map +1 -0
  37. package/dist/core/agents/mailbox.js +325 -0
  38. package/dist/core/agents/reconcile-coordination-v3.d.ts +44 -0
  39. package/dist/core/agents/reconcile-coordination-v3.d.ts.map +1 -0
  40. package/dist/core/agents/reconcile-coordination-v3.js +58 -0
  41. package/dist/core/agents/render/prompt-context.d.ts +5 -0
  42. package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
  43. package/dist/core/agents/render/prompt-context.js +34 -13
  44. package/dist/core/agents/render/session-context.d.ts +8 -0
  45. package/dist/core/agents/render/session-context.d.ts.map +1 -1
  46. package/dist/core/agents/render/session-context.js +34 -3
  47. package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -1
  48. package/dist/core/agents/rules/commit-conflict.js +50 -1
  49. package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
  50. package/dist/core/agents/rules/stop-hook.js +6 -10
  51. package/dist/core/agents/session-finalizer-v3.js +4 -1
  52. package/dist/core/artifacts/index.d.ts +26 -1
  53. package/dist/core/artifacts/index.d.ts.map +1 -1
  54. package/dist/core/artifacts/index.js +146 -6
  55. package/dist/core/config.d.ts +12 -0
  56. package/dist/core/config.d.ts.map +1 -1
  57. package/dist/core/config.js +43 -0
  58. package/dist/core/diagnostics/advice.d.ts +9 -0
  59. package/dist/core/diagnostics/advice.d.ts.map +1 -0
  60. package/dist/core/diagnostics/advice.js +112 -0
  61. package/dist/core/diagnostics/bundle.d.ts +35 -0
  62. package/dist/core/diagnostics/bundle.d.ts.map +1 -0
  63. package/dist/core/diagnostics/bundle.js +874 -0
  64. package/dist/core/diagnostics/comparison.d.ts +5 -0
  65. package/dist/core/diagnostics/comparison.d.ts.map +1 -0
  66. package/dist/core/diagnostics/comparison.js +444 -0
  67. package/dist/core/diagnostics/contract.d.ts +245 -0
  68. package/dist/core/diagnostics/contract.d.ts.map +1 -0
  69. package/dist/core/diagnostics/contract.js +18 -0
  70. package/dist/core/diagnostics/identity.d.ts +3 -0
  71. package/dist/core/diagnostics/identity.d.ts.map +1 -0
  72. package/dist/core/diagnostics/identity.js +10 -0
  73. package/dist/core/diagnostics/index.d.ts +8 -0
  74. package/dist/core/diagnostics/index.d.ts.map +1 -0
  75. package/dist/core/diagnostics/index.js +7 -0
  76. package/dist/core/diagnostics/replay.d.ts +8 -0
  77. package/dist/core/diagnostics/replay.d.ts.map +1 -0
  78. package/dist/core/diagnostics/replay.js +213 -0
  79. package/dist/core/diagnostics/sanitize.d.ts +9 -0
  80. package/dist/core/diagnostics/sanitize.d.ts.map +1 -0
  81. package/dist/core/diagnostics/sanitize.js +84 -0
  82. package/dist/core/events/legacy-storage/compression.d.ts +13 -0
  83. package/dist/core/events/legacy-storage/compression.d.ts.map +1 -0
  84. package/dist/core/events/legacy-storage/compression.js +107 -0
  85. package/dist/core/events/legacy-storage/index.d.ts +1 -0
  86. package/dist/core/events/legacy-storage/index.d.ts.map +1 -1
  87. package/dist/core/events/legacy-storage/index.js +1 -0
  88. package/dist/core/events/v3/archive-retention.d.ts +33 -0
  89. package/dist/core/events/v3/archive-retention.d.ts.map +1 -0
  90. package/dist/core/events/v3/archive-retention.js +195 -0
  91. package/dist/core/events/v3/capabilities.d.ts +1 -1
  92. package/dist/core/events/v3/capabilities.d.ts.map +1 -1
  93. package/dist/core/events/v3/capabilities.js +1 -0
  94. package/dist/core/events/v3/index.d.ts +1 -0
  95. package/dist/core/events/v3/index.d.ts.map +1 -1
  96. package/dist/core/events/v3/index.js +1 -0
  97. package/dist/core/events/v3/live-routing.d.ts.map +1 -1
  98. package/dist/core/events/v3/live-routing.js +1 -0
  99. package/dist/core/events/v3/producers/hook-base.d.ts +1 -1
  100. package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -1
  101. package/dist/core/events/v3/producers/hook-base.js +13 -2
  102. package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
  103. package/dist/core/events/v3/producers/intake.js +1 -0
  104. package/dist/core/events/v3/producers/recorder.d.ts +16 -0
  105. package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
  106. package/dist/core/events/v3/producers/recorder.js +88 -1
  107. package/dist/core/hooks/adapter/output.d.ts +8 -0
  108. package/dist/core/hooks/adapter/output.d.ts.map +1 -1
  109. package/dist/core/hooks/adapter/output.js +11 -1
  110. package/dist/core/hooks/cli.js +183 -192
  111. package/dist/core/hooks/health.d.ts +59 -0
  112. package/dist/core/hooks/health.d.ts.map +1 -0
  113. package/dist/core/hooks/health.js +84 -0
  114. package/dist/core/resources/contract.d.ts +90 -0
  115. package/dist/core/resources/contract.d.ts.map +1 -0
  116. package/dist/core/resources/contract.js +2 -0
  117. package/dist/core/resources/index.d.ts +6 -0
  118. package/dist/core/resources/index.d.ts.map +1 -0
  119. package/dist/core/resources/index.js +5 -0
  120. package/dist/core/resources/sampler.d.ts +27 -0
  121. package/dist/core/resources/sampler.d.ts.map +1 -0
  122. package/dist/core/resources/sampler.js +357 -0
  123. package/dist/core/resources/service-status.d.ts +3 -0
  124. package/dist/core/resources/service-status.d.ts.map +1 -0
  125. package/dist/core/resources/service-status.js +48 -0
  126. package/dist/core/resources/service.d.ts +26 -0
  127. package/dist/core/resources/service.d.ts.map +1 -0
  128. package/dist/core/resources/service.js +292 -0
  129. package/dist/core/resources/storage.d.ts +13 -0
  130. package/dist/core/resources/storage.d.ts.map +1 -0
  131. package/dist/core/resources/storage.js +30 -0
  132. package/dist/core/storage/atomic-json.d.ts +3 -0
  133. package/dist/core/storage/atomic-json.d.ts.map +1 -0
  134. package/dist/core/storage/atomic-json.js +15 -0
  135. package/dist/core/storage/builtins.d.ts.map +1 -1
  136. package/dist/core/storage/builtins.js +45 -6
  137. package/dist/core/storage/logger.d.ts +2 -0
  138. package/dist/core/storage/logger.d.ts.map +1 -1
  139. package/dist/core/storage/logger.js +2 -0
  140. package/dist/core/storage/query.d.ts +14 -0
  141. package/dist/core/storage/query.d.ts.map +1 -1
  142. package/dist/core/storage/query.js +51 -0
  143. package/dist/core/supervisor/activity.d.ts +4 -0
  144. package/dist/core/supervisor/activity.d.ts.map +1 -0
  145. package/dist/core/supervisor/activity.js +141 -0
  146. package/dist/core/supervisor/contract.d.ts +268 -0
  147. package/dist/core/supervisor/contract.d.ts.map +1 -0
  148. package/dist/core/supervisor/contract.js +35 -0
  149. package/dist/core/supervisor/explanations.d.ts +4 -0
  150. package/dist/core/supervisor/explanations.d.ts.map +1 -0
  151. package/dist/core/supervisor/explanations.js +71 -0
  152. package/dist/core/supervisor/findings.d.ts +20 -0
  153. package/dist/core/supervisor/findings.d.ts.map +1 -0
  154. package/dist/core/supervisor/findings.js +399 -0
  155. package/dist/core/supervisor/history.d.ts +9 -0
  156. package/dist/core/supervisor/history.d.ts.map +1 -0
  157. package/dist/core/supervisor/history.js +46 -0
  158. package/dist/core/supervisor/hook-health-alerts.d.ts +14 -0
  159. package/dist/core/supervisor/hook-health-alerts.d.ts.map +1 -0
  160. package/dist/core/supervisor/hook-health-alerts.js +70 -0
  161. package/dist/core/supervisor/hook-health-storage.d.ts +5 -0
  162. package/dist/core/supervisor/hook-health-storage.d.ts.map +1 -0
  163. package/dist/core/supervisor/hook-health-storage.js +24 -0
  164. package/dist/core/supervisor/hook-health.d.ts +72 -0
  165. package/dist/core/supervisor/hook-health.d.ts.map +1 -0
  166. package/dist/core/supervisor/hook-health.js +203 -0
  167. package/dist/core/supervisor/hooks.d.ts +10 -0
  168. package/dist/core/supervisor/hooks.d.ts.map +1 -0
  169. package/dist/core/supervisor/hooks.js +28 -0
  170. package/dist/core/supervisor/index.d.ts +15 -0
  171. package/dist/core/supervisor/index.d.ts.map +1 -0
  172. package/dist/core/supervisor/index.js +14 -0
  173. package/dist/core/supervisor/log-feed.d.ts +9 -0
  174. package/dist/core/supervisor/log-feed.d.ts.map +1 -0
  175. package/dist/core/supervisor/log-feed.js +103 -0
  176. package/dist/core/supervisor/service.d.ts +29 -0
  177. package/dist/core/supervisor/service.d.ts.map +1 -0
  178. package/dist/core/supervisor/service.js +450 -0
  179. package/dist/core/supervisor/services.d.ts +11 -0
  180. package/dist/core/supervisor/services.d.ts.map +1 -0
  181. package/dist/core/supervisor/services.js +155 -0
  182. package/dist/core/supervisor/status.d.ts +3 -0
  183. package/dist/core/supervisor/status.d.ts.map +1 -0
  184. package/dist/core/supervisor/status.js +48 -0
  185. package/dist/core/supervisor/storage.d.ts +30 -0
  186. package/dist/core/supervisor/storage.d.ts.map +1 -0
  187. package/dist/core/supervisor/storage.js +73 -0
  188. package/dist/core/supervisor/timeline.d.ts +3 -0
  189. package/dist/core/supervisor/timeline.d.ts.map +1 -0
  190. package/dist/core/supervisor/timeline.js +87 -0
  191. package/dist/core/workflow/admission.d.ts +23 -0
  192. package/dist/core/workflow/admission.d.ts.map +1 -0
  193. package/dist/core/workflow/admission.js +136 -0
  194. package/dist/core/workflow/engine.d.ts.map +1 -1
  195. package/dist/core/workflow/engine.js +77 -2
  196. package/dist/core/workflow/index.d.ts +3 -2
  197. package/dist/core/workflow/index.d.ts.map +1 -1
  198. package/dist/core/workflow/index.js +2 -1
  199. package/dist/core/workflow/proof.d.ts +2 -1
  200. package/dist/core/workflow/proof.d.ts.map +1 -1
  201. package/dist/core/workflow/proof.js +39 -1
  202. package/dist/core/workflow/run-state.d.ts +3 -2
  203. package/dist/core/workflow/run-state.d.ts.map +1 -1
  204. package/dist/core/workflow/run-state.js +8 -1
  205. package/dist/core/workflow/types.d.ts +33 -1
  206. package/dist/core/workflow/types.d.ts.map +1 -1
  207. package/dist/core/workflow/types.js +2 -1
  208. package/dist/lib/browser/client.d.ts +5 -0
  209. package/dist/lib/browser/client.d.ts.map +1 -1
  210. package/dist/lib/browser/client.js +1 -0
  211. package/dist/lib/browser/index.d.ts +2 -0
  212. package/dist/lib/browser/index.d.ts.map +1 -1
  213. package/dist/lib/browser/index.js +2 -0
  214. package/dist/lib/browser/qa-run-contracts.d.ts +173 -0
  215. package/dist/lib/browser/qa-run-contracts.d.ts.map +1 -0
  216. package/dist/lib/browser/qa-run-contracts.js +226 -0
  217. package/dist/lib/browser/qa-run.d.ts +51 -0
  218. package/dist/lib/browser/qa-run.d.ts.map +1 -0
  219. package/dist/lib/browser/qa-run.js +684 -0
  220. package/dist/lib/coord-root-id.d.ts +9 -0
  221. package/dist/lib/coord-root-id.d.ts.map +1 -0
  222. package/dist/lib/coord-root-id.js +17 -0
  223. package/dist/lib/instructions/apply.d.ts +3 -1
  224. package/dist/lib/instructions/apply.d.ts.map +1 -1
  225. package/dist/lib/instructions/apply.js +74 -3
  226. package/dist/lib/instructions/templates.d.ts.map +1 -1
  227. package/dist/lib/instructions/templates.js +6 -0
  228. package/package.json +12 -1
  229. package/src/commander.ts +26 -0
  230. package/src/commands/agents.ts +102 -49
  231. package/src/commands/artifacts.ts +40 -2
  232. package/src/commands/browse.ts +15 -0
  233. package/src/commands/diagnostics.ts +271 -0
  234. package/src/commands/files.ts +102 -2
  235. package/src/commands/governor.ts +8 -0
  236. package/src/commands/ledger-v3.ts +82 -0
  237. package/src/commands/qa-run.ts +184 -0
  238. package/src/commands/resources.ts +38 -0
  239. package/src/commands/supervisor.ts +141 -0
  240. package/src/commands/web.ts +19 -0
  241. package/src/commands/workflow.ts +8 -0
  242. package/src/core/agents/cli.ts +7 -3
  243. package/src/core/agents/health.ts +142 -0
  244. package/src/core/agents/mailbox.ts +373 -0
  245. package/src/core/agents/reconcile-coordination-v3.ts +77 -0
  246. package/src/core/agents/render/prompt-context.ts +42 -12
  247. package/src/core/agents/render/session-context.ts +37 -3
  248. package/src/core/agents/rules/commit-conflict.ts +58 -1
  249. package/src/core/agents/rules/stop-hook.ts +6 -12
  250. package/src/core/agents/session-finalizer-v3.ts +4 -1
  251. package/src/core/artifacts/index.ts +196 -10
  252. package/src/core/config.ts +111 -2
  253. package/src/core/diagnostics/advice.ts +147 -0
  254. package/src/core/diagnostics/bundle.ts +1142 -0
  255. package/src/core/diagnostics/comparison.ts +565 -0
  256. package/src/core/diagnostics/contract.ts +311 -0
  257. package/src/core/diagnostics/identity.ts +11 -0
  258. package/src/core/diagnostics/index.ts +7 -0
  259. package/src/core/diagnostics/replay.ts +314 -0
  260. package/src/core/diagnostics/sanitize.ts +97 -0
  261. package/src/core/events/legacy-storage/compression.ts +130 -0
  262. package/src/core/events/legacy-storage/index.ts +1 -0
  263. package/src/core/events/v3/archive-retention.ts +251 -0
  264. package/src/core/events/v3/capabilities.ts +2 -0
  265. package/src/core/events/v3/index.ts +9 -0
  266. package/src/core/events/v3/live-routing.ts +1 -0
  267. package/src/core/events/v3/producers/hook-base.ts +14 -2
  268. package/src/core/events/v3/producers/intake.ts +1 -0
  269. package/src/core/events/v3/producers/recorder.ts +110 -1
  270. package/src/core/hooks/adapter/output.ts +12 -1
  271. package/src/core/hooks/cli.ts +192 -215
  272. package/src/core/hooks/health.ts +146 -0
  273. package/src/core/resources/contract.ts +98 -0
  274. package/src/core/resources/index.ts +5 -0
  275. package/src/core/resources/sampler.ts +458 -0
  276. package/src/core/resources/service-status.ts +62 -0
  277. package/src/core/resources/service.ts +337 -0
  278. package/src/core/resources/storage.ts +44 -0
  279. package/src/core/storage/atomic-json.ts +15 -0
  280. package/src/core/storage/builtins.ts +62 -6
  281. package/src/core/storage/logger.ts +2 -0
  282. package/src/core/storage/query.ts +58 -0
  283. package/src/core/supervisor/activity.ts +193 -0
  284. package/src/core/supervisor/contract.ts +312 -0
  285. package/src/core/supervisor/explanations.ts +104 -0
  286. package/src/core/supervisor/findings.ts +788 -0
  287. package/src/core/supervisor/history.ts +61 -0
  288. package/src/core/supervisor/hook-health-alerts.ts +108 -0
  289. package/src/core/supervisor/hook-health-storage.ts +25 -0
  290. package/src/core/supervisor/hook-health.ts +301 -0
  291. package/src/core/supervisor/hooks.ts +35 -0
  292. package/src/core/supervisor/index.ts +14 -0
  293. package/src/core/supervisor/log-feed.ts +131 -0
  294. package/src/core/supervisor/service.ts +511 -0
  295. package/src/core/supervisor/services.ts +203 -0
  296. package/src/core/supervisor/status.ts +59 -0
  297. package/src/core/supervisor/storage.ts +126 -0
  298. package/src/core/supervisor/timeline.ts +133 -0
  299. package/src/core/workflow/admission.ts +215 -0
  300. package/src/core/workflow/engine.ts +93 -1
  301. package/src/core/workflow/index.ts +10 -0
  302. package/src/core/workflow/proof.ts +54 -1
  303. package/src/core/workflow/run-state.ts +13 -1
  304. package/src/core/workflow/types.ts +39 -1
  305. package/src/lib/browser/client.ts +6 -0
  306. package/src/lib/browser/index.ts +29 -0
  307. package/src/lib/browser/qa-run-contracts.ts +380 -0
  308. package/src/lib/browser/qa-run.ts +784 -0
  309. package/src/lib/coord-root-id.ts +23 -0
  310. package/src/lib/instructions/apply.ts +81 -2
  311. package/src/lib/instructions/templates.ts +6 -0
package/dist/commander.js CHANGED
@@ -105,6 +105,7 @@ function harneryCommandBundles({ emit, context, binName, }) {
105
105
  lazy("files", "Mint browser links for files served by the local dashboard", async (program) => (await import("./commands/files.js")).registerFilesCommand(program, emit, context)),
106
106
  lazy("read [html-file]", `Extract clean readable markdown from HTML. Reads from file or stdin (use '-'). Pair with \`${binName} fetch\` or \`${binName} browse\` for scrape-to-markdown.`, async (program) => (await import("./commands/read.js")).registerReadCommand(program, emit, binName), { hasOptions: true }),
107
107
  lazy("browse <url>", "Headless Chromium with persistent profile + cookie jar. Default writes a trio of files (last.png, last.html, last.json) for the LLM iteration loop; --snapshot/--html/--json switch to stdout-print mode.", async (program) => (await import("./commands/browse.js")).registerBrowseCommand(program, emit, context, binName), { hasOptions: true }),
108
+ lazy("qa-run <target>", `Run the whole page-QA matrix in one command (planner, deterministic gates per context, interactions, critique, snapshot) via child \`${binName} browse\` processes; writes page-qa-result.json with a fail-closed verdict.`, async (program) => (await import("./commands/qa-run.js")).registerQaRunCommand(program, emit), { hasOptions: true }),
108
109
  lazy("browse-session", "Control an opted-in headed browse session through an owner-only descriptor", async (program) => (await import("./commands/browse-session.js")).registerBrowseSessionCommand(program, emit)),
109
110
  lazy("browse-ai <url>", `agent-browser (Vercel Labs) wrapper: accessibility-tree snapshots with element refs (@e1, @e2) for LLM consumption. Daemon-mode: successive calls reuse the same browser instance. Sister to ${binName} browse (Playwright).`, async (program) => (await import("./commands/browse-ai.js")).registerBrowseAiCommand(program, emit), { hasOptions: true }),
110
111
  {
@@ -133,6 +134,9 @@ function harneryCommandBundles({ emit, context, binName, }) {
133
134
  lazy("journal", "Per-agent markdown journal: append-only timestamped entries. Survives in-session compaction, archived at session end, pruned after 7 days.", async (program) => (await import("./commands/journal.js")).registerJournalCommand(program, emit)),
134
135
  lazy("ledger-v3", "Inspect or initialize the universal event-ledger V3 epoch", async (program) => (await import("./commands/ledger-v3.js")).registerLedgerV3Command(program, emit, context)),
135
136
  lazy("semantic", "Build and inspect evidence-cited semantic readings of active V3 generations", async (program) => (await import("./commands/semantic.js")).registerSemanticCommand(program, emit, context)),
137
+ lazy("resources", "Observe local CPU and memory pressure by agent and process tree", async (program) => (await import("./commands/resources.js")).registerResourcesCommand(program, emit, context)),
138
+ lazy("supervisor", "Run Harnery's optional local diagnostic supervisor", async (program) => (await import("./commands/supervisor.js")).registerSupervisorCommand(program, emit, context)),
139
+ lazy("diagnostics", "Inspect, capture, and replay bounded local diagnostic findings", async (program) => (await import("./commands/diagnostics.js")).registerDiagnosticsCommand(program, emit, context), { hasOptions: true }),
136
140
  lazy("storage", "Inspect registered Harnery storage without reading file bodies", async (program) => (await import("./commands/storage.js")).registerStorageCommand(program, emit, context)),
137
141
  lazy("logs", "List and query bounded Harnery log families", async (program) => (await import("./commands/logs.js")).registerLogsCommand(program, emit, context)),
138
142
  lazy("inbox", "Inspect private coordination inbox state", async (program) => (await import("./commands/inbox.js")).registerInboxCommand(program, emit, context?.coordinationInbox)),
@@ -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;AAQ1E,OAAO,EAGL,qBAAqB,EAMtB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAKL,K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E,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,KAAK,SAAa,EAClB,QAAQ,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,qBAAqB,EAA6B,EAC9E,gBAAgB,SAAwB,GACvC,wBAAwB,CA0C1B;AAED,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,mBAAmB,GAAG,WAAW,CAAC;AAEhF,wFAAwF;AACxF,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAC,EACrD,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,mBAAmB,GAAG,IAAI,CAO5B"}
@@ -20,6 +20,8 @@ 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
+ import { reconcileCoordinationV3 } from "../core/agents/reconcile-coordination-v3.js";
23
25
  import { listSessionFinalizationRequestsV3, observeHostDisappearedV3, reconcileSessionFinalizationV3, requestSessionEndExplicitV3, } from "../core/agents/session-finalizer-v3.js";
24
26
  import { SESSION_NAME_DISPLAY_NOTE, sessionNameDisplayPending, } from "../core/agents/session-name-display.js";
25
27
  import { agentDisplayName } from "../core/agents/state/activity-log.js";
@@ -232,7 +234,8 @@ export function registerAgentsCommand(program, emitParam, programContext, binNam
232
234
  });
233
235
  cmd
234
236
  .command("reconcile")
235
- .description("Reconcile archive, idle, parent/run completion, stale, superseded, and host lifecycle signals into V3 session finalization.")
237
+ .description("Sweep the stale coordination cache, then reconcile archive, idle, parent/run " +
238
+ "completion, stale, superseded, and host lifecycle signals into V3 session finalization.")
236
239
  .option("--watch", "Keep reconciling until interrupted")
237
240
  .option("--interval-seconds <n>", "Watch interval in seconds")
238
241
  .option("--json", "JSON output")
@@ -267,9 +270,10 @@ export function registerAgentsCommand(program, emitParam, programContext, binNam
267
270
  });
268
271
  cmd
269
272
  .command("ping <name> <message...>")
270
- .description("Append a 'handoff' entry to a peer agent's journal. Body prefixed with " +
271
- "`from agent-<me>:`. Use to leave actionable coordination notes for peers " +
272
- "currently holding files you need.")
273
+ .description("Send a message to another agent by name. Works whether or not that agent " +
274
+ "is running: a live peer sees it on their next prompt, and a name with no " +
275
+ "live session gets it queued until a session of that name next starts. " +
276
+ "Only an unknown name is refused.")
273
277
  .option("--json", "JSON output")
274
278
  .action((name, message, opts) => {
275
279
  runPing(name, message.join(" "), opts);
@@ -299,7 +303,7 @@ export function registerAgentsCommand(program, emitParam, programContext, binNam
299
303
  cmd
300
304
  .command("health")
301
305
  .description("One-screen coord-layer health rollup: heal events, council activity, " +
302
- "zombie detection, and anomalies. Designed for " +
306
+ "heartbeat cache issues, and findings. Designed for " +
303
307
  "daily glance + dashboard ingestion. Reads .harnery/.")
304
308
  .option("--since <window>", "Window (Nh | Nd). Default: 24h.", "24h")
305
309
  .option("--json", "JSON envelope output")
@@ -431,7 +435,7 @@ async function runSessionReconcile(opts) {
431
435
  }
432
436
  let stopped = false;
433
437
  do {
434
- emit.data(reconcileSessionFinalizationV3(root));
438
+ emit.data(reconcileCoordinationV3(root));
435
439
  if (!opts.watch || stopped)
436
440
  return;
437
441
  await new Promise((resolvePromise) => {
@@ -3091,8 +3095,8 @@ function runHealth(opts) {
3091
3095
  // Heartbeat cache issues: files in active/ that are unparseable, nameless,
3092
3096
  // invalidly timestamped, or stale. Old parseable timestamps are ordinary
3093
3097
  // staleness, not evidence of epoch-like timestamp corruption.
3094
- let zombieCount = 0;
3095
- const zombieSamples = [];
3098
+ let cacheIssueCount = 0;
3099
+ const cacheIssueSamples = [];
3096
3100
  const STALE_HEARTBEAT_AGE_MS = 24 * 60 * 60 * 1000;
3097
3101
  if (existsSync(activeDir)) {
3098
3102
  for (const file of readdirSync(activeDir)) {
@@ -3107,16 +3111,16 @@ function runHealth(opts) {
3107
3111
  hb = null;
3108
3112
  }
3109
3113
  if (!hb || typeof hb.instance_id !== "string") {
3110
- zombieCount++;
3111
- if (zombieSamples.length < 5)
3112
- zombieSamples.push(`${idFromFile.slice(0, 12)} (unparseable/no-id)`);
3114
+ cacheIssueCount++;
3115
+ if (cacheIssueSamples.length < 5)
3116
+ cacheIssueSamples.push(`${idFromFile.slice(0, 12)} (unparseable/no-id)`);
3113
3117
  continue;
3114
3118
  }
3115
3119
  const cacheIssue = classifyHeartbeatCacheIssue(hb, nowMs, STALE_HEARTBEAT_AGE_MS);
3116
3120
  if (cacheIssue) {
3117
- zombieCount++;
3118
- if (zombieSamples.length < 5) {
3119
- zombieSamples.push(`${idFromFile.slice(0, 12)} (${cacheIssue})`);
3121
+ cacheIssueCount++;
3122
+ if (cacheIssueSamples.length < 5) {
3123
+ cacheIssueSamples.push(`${idFromFile.slice(0, 12)} (${cacheIssue})`);
3120
3124
  }
3121
3125
  }
3122
3126
  }
@@ -3132,11 +3136,11 @@ function runHealth(opts) {
3132
3136
  activeCouncils++;
3133
3137
  }
3134
3138
  }
3135
- // Anomaly detection.
3136
- const anomalies = [];
3139
+ // Finding detection.
3140
+ const findings = [];
3137
3141
  for (const { agent, count } of healTopAgents) {
3138
3142
  if (count >= 5) {
3139
- anomalies.push(`${agent} self-healed ${count}x in ${opts.since}; possible idle-prune loop or PID instability`);
3143
+ findings.push(`${agent} self-healed ${count}x in ${opts.since}; possible idle-prune loop or PID instability`);
3140
3144
  }
3141
3145
  }
3142
3146
  if (activeAgents.stale > 0) {
@@ -3144,35 +3148,37 @@ function runHealth(opts) {
3144
3148
  const action = activeAgents.source === "event-ledger-v3"
3145
3149
  ? "lifecycle reconciliation may be delayed"
3146
3150
  : "heal mechanism may not be firing";
3147
- anomalies.push(`${activeAgents.stale} active ${noun}(s) without activity for ${Math.floor(freshnessCutoffSecs() / 60)}min; ${action}`);
3151
+ findings.push(`${activeAgents.stale} active ${noun}(s) without activity for ${Math.floor(freshnessCutoffSecs() / 60)}min; ${action}`);
3148
3152
  }
3149
3153
  const expectedSchema = "v3";
3150
3154
  const unexpectedSchemas = Object.keys(activeAgents.by_schema_version).filter((schema) => schema !== expectedSchema);
3151
3155
  if (unexpectedSchemas.length > 0) {
3152
- anomalies.push(`Unexpected active-agent schema versions in use: ${unexpectedSchemas.join(", ")} (expected ${expectedSchema})`);
3156
+ findings.push(`Unexpected active-agent schema versions in use: ${unexpectedSchemas.join(", ")} (expected ${expectedSchema})`);
3153
3157
  }
3154
- // Only recent hook failures are active anomalies. Historical rows remain in
3158
+ // Only recent hook failures are active findings. Historical rows remain in
3155
3159
  // the report with exact error signatures and their latest timestamp.
3156
3160
  if (hookErrors.last1h > 0) {
3157
3161
  const top = hookErrors.recentTopErrors[0];
3158
3162
  const detail = top ? `: top '${top.error.slice(0, 80)}' x${top.count} (${top.phase})` : "";
3159
- anomalies.push(`agent-hook errored ${hookErrors.last1h}x in the last hour${detail}`);
3163
+ findings.push(`agent-hook errored ${hookErrors.last1h}x in the last hour${detail}`);
3160
3164
  }
3161
3165
  if (stream.cursor_backlog > 500) {
3162
- anomalies.push(`projection cursor is ${stream.cursor_backlog} events behind; drain lagging (stop projection may be failing)`);
3166
+ findings.push(`projection cursor is ${stream.cursor_backlog} events behind; drain lagging (stop projection may be failing)`);
3163
3167
  }
3164
- // Raw V3 stream size is not an anomaly; catalog rotation bounds readers.
3168
+ // Raw V3 stream size is not a finding; catalog rotation bounds readers.
3165
3169
  if ((sweptByReason.unparseable ?? 0) > 0) {
3166
- anomalies.push(`${sweptByReason.unparseable} heartbeat(s) swept as unparseable in ${opts.since}; possible corruption or a non-atomic writer`);
3170
+ findings.push(`${sweptByReason.unparseable} heartbeat(s) swept as unparseable in ${opts.since}; possible corruption or a non-atomic writer`);
3167
3171
  }
3168
- if (zombieCount > 0) {
3169
- anomalies.push(`${zombieCount} heartbeat cache issue(s) in active/ (${zombieSamples.join(", ")}); stale or malformed files the sweep isn't reaping`);
3172
+ if (cacheIssueCount > 0) {
3173
+ findings.push(`${cacheIssueCount} heartbeat cache issue(s) in active/ (${cacheIssueSamples.join(", ")}); ` +
3174
+ "rows the last sweep deliberately kept (malformed but mtime-fresh, or neither audit " +
3175
+ "write could persist), or that aged past the freshness cutoff since it ran");
3170
3176
  }
3171
3177
  if (stopRemediation.total > 0) {
3172
3178
  const who = stopRemediation.sessions.length > 0
3173
3179
  ? ` (sessions: ${stopRemediation.sessions.map((s) => s.slice(0, 8)).join(", ")})`
3174
3180
  : "";
3175
- anomalies.push(`stop-hook remediation cap exhausted ${stopRemediation.total}x in ${opts.since}${who}; these sessions ended turns without the end-of-turn ritual — check why their evidence never lands`);
3181
+ findings.push(`stop-hook remediation cap exhausted ${stopRemediation.total}x in ${opts.since}${who}; these sessions ended turns without the end-of-turn ritual — check why their evidence never lands`);
3176
3182
  }
3177
3183
  if (eventLedger.state === "live") {
3178
3184
  // Open spans whose generation has no open turn: the turn ended without its
@@ -3180,13 +3186,13 @@ function runHealth(opts) {
3180
3186
  const orphanGenerations = eventLedger.open_spans.generations.filter((generation) => !generation.turn_open);
3181
3187
  if (orphanGenerations.length > 0) {
3182
3188
  const orphanSpans = orphanGenerations.reduce((sum, generation) => sum + generation.span_count, 0);
3183
- anomalies.push(`${orphanSpans} open tool span(s) across ${orphanGenerations.length} generation(s) with no open turn; orphaned spans block clean session end`);
3189
+ findings.push(`${orphanSpans} open tool span(s) across ${orphanGenerations.length} generation(s) with no open turn; orphaned spans block clean session end`);
3184
3190
  }
3185
3191
  for (const pressure of eventLedger.span_pressure) {
3186
- anomalies.push(`${pressure.instance_id} (${pressure.generation_id}) holds ${pressure.span_count} open spans (soft watermark ${SPAN_PRESSURE_SOFT_WATERMARK}; the reader's 256-span cap makes the state unreadable)`);
3192
+ findings.push(`${pressure.instance_id} (${pressure.generation_id}) holds ${pressure.span_count} open spans (soft watermark ${SPAN_PRESSURE_SOFT_WATERMARK}; the reader's 256-span cap makes the state unreadable)`);
3187
3193
  }
3188
3194
  for (const collectionError of eventLedger.collection_errors) {
3189
- anomalies.push(`event-ledger health: ${collectionError}`);
3195
+ findings.push(`event-ledger health: ${collectionError}`);
3190
3196
  }
3191
3197
  }
3192
3198
  const report = {
@@ -3230,14 +3236,14 @@ function runHealth(opts) {
3230
3236
  recent_top_errors: hookErrors.recentTopErrors,
3231
3237
  },
3232
3238
  stream,
3233
- zombies: { count: zombieCount, samples: zombieSamples },
3239
+ heartbeat_cache_issues: { count: cacheIssueCount, samples: cacheIssueSamples },
3234
3240
  event_ledger: eventLedger,
3235
3241
  stop_remediation: {
3236
3242
  total: stopRemediation.total,
3237
3243
  latest_at: stopRemediation.latestAt,
3238
3244
  sessions: stopRemediation.sessions,
3239
3245
  },
3240
- anomalies,
3246
+ findings,
3241
3247
  };
3242
3248
  if (opts.json) {
3243
3249
  emit.data(report);
@@ -3316,19 +3322,19 @@ function renderHealthBox(report) {
3316
3322
  ["event ledger", ledgerStr],
3317
3323
  [
3318
3324
  "cache issues",
3319
- report.zombies.count === 0
3325
+ report.heartbeat_cache_issues.count === 0
3320
3326
  ? "0"
3321
- : `${report.zombies.count} (${report.zombies.samples.join(", ")})`,
3327
+ : `${report.heartbeat_cache_issues.count} (${report.heartbeat_cache_issues.samples.join(", ")})`,
3322
3328
  ],
3323
3329
  ["councils", councilParts.join(", ")],
3324
- ["anomalies", report.anomalies.length === 0 ? "(clean)" : `${report.anomalies.length} flagged`],
3330
+ ["findings", report.findings.length === 0 ? "(clean)" : `${report.findings.length} flagged`],
3325
3331
  ];
3326
3332
  const localTime = formatLocalTime(new Date(report.generated_at));
3327
3333
  const title = `Coord Health (${localTime})`;
3328
3334
  process.stdout.write(`${formatBox(title, rows)}\n`); // lint-ok-emission: chat-paste path; mirrors runStatus's direct write so the box surfaces in both TTY + harn-session-teed contexts
3329
- if (report.anomalies.length > 0) {
3335
+ if (report.findings.length > 0) {
3330
3336
  process.stdout.write("\n"); // lint-ok-emission: same chat-paste path
3331
- for (const a of report.anomalies) {
3337
+ for (const a of report.findings) {
3332
3338
  process.stdout.write(` ! ${a}\n`); // lint-ok-emission: same
3333
3339
  }
3334
3340
  }
@@ -3708,18 +3714,48 @@ function runPing(name, message, opts) {
3708
3714
  });
3709
3715
  process.exit(1);
3710
3716
  }
3717
+ const coordRoot = monorepoRoot();
3711
3718
  const peerOwner = resolveOwnerByName(name);
3712
- if (!peerOwner) {
3719
+ // A name with no live session is the common case, not an error: the agent it
3720
+ // refers to may have ended minutes ago and may come back under the same name.
3721
+ // Refuse only a name that no agent has ever held, which is a typo — queueing
3722
+ // that would swallow the message silently.
3723
+ if (!peerOwner && coordRoot && !isAddressableName(coordRoot, name)) {
3724
+ const suggestions = suggestNames(coordRoot, name);
3713
3725
  emit.error({
3714
- code: "no_peer",
3715
- message: `no live agent named "${name}" (case-insensitive). Run \`${resolveBinName()} agents list\` to see who's active.`,
3726
+ code: "unknown_agent",
3727
+ message: `no agent has ever been named "${name}". ` +
3728
+ (suggestions.length > 0 ? `Did you mean ${suggestions.join(", ")}? ` : "") +
3729
+ `Run \`${resolveBinName()} agents list\` for live sessions.`,
3716
3730
  });
3717
3731
  process.exit(1);
3718
3732
  }
3719
3733
  const myHb = readCurrentCoordinationRow(myOwner);
3720
3734
  const fromName = myHb?.name ?? "anonymous";
3721
3735
  const body = `from agent-${fromName}: ${message.trim()}`;
3722
- const doc = appendEntry(peerOwner, "handoff", body);
3736
+ // A live recipient gets the journal entry immediately, so a peer reading
3737
+ // their own journal mid-session sees it without waiting for a prompt. A
3738
+ // dormant recipient has no journal to write to yet; the drain writes it into
3739
+ // whichever session picks the message up.
3740
+ const doc = peerOwner ? appendEntry(peerOwner, "handoff", body) : null;
3741
+ let queued;
3742
+ try {
3743
+ queued = queueMailboxMessage({
3744
+ coordRoot: coordRoot ?? process.cwd(),
3745
+ toName: name,
3746
+ fromName,
3747
+ fromInstanceId: myOwner,
3748
+ body: message.trim(),
3749
+ journaled: Boolean(peerOwner),
3750
+ });
3751
+ }
3752
+ catch (error) {
3753
+ if (error instanceof MailboxCapacityError) {
3754
+ emit.error({ code: `mailbox_${error.reason_code}`, message: error.message });
3755
+ process.exit(1);
3756
+ }
3757
+ throw error;
3758
+ }
3723
3759
  // Canonical delivery record: sender is the envelope owner, recipient rides
3724
3760
  // in data, so read-only observers can render the communication without
3725
3761
  // joining journal files.
@@ -3730,17 +3766,20 @@ function runPing(name, message, opts) {
3730
3766
  observation: {
3731
3767
  event_type: "coord.message_observed",
3732
3768
  direction: "sent",
3733
- subject: peerOwner,
3769
+ subject: peerOwner ?? `name:${queued.message.to_name}`,
3734
3770
  body: message.trim(),
3735
3771
  },
3736
3772
  });
3737
3773
  const data = {
3738
- peer: name,
3774
+ peer: queued.message.to_name,
3739
3775
  peer_instance_id: peerOwner,
3776
+ delivery: peerOwner ? "live" : "queued",
3777
+ message_id: queued.message.message_id,
3778
+ pending: queued.pending,
3740
3779
  from: fromName,
3741
3780
  body,
3742
- journal_path: doc.path,
3743
- journal_bytes: doc.bytes,
3781
+ journal_path: doc?.path ?? null,
3782
+ journal_bytes: doc?.bytes ?? null,
3744
3783
  };
3745
3784
  if (opts.json) {
3746
3785
  emit.config({ format: "json" });
@@ -3748,7 +3787,9 @@ function runPing(name, message, opts) {
3748
3787
  return;
3749
3788
  }
3750
3789
  emit.data(data);
3751
- emit.text(`pinged agent-${name}: "${truncate(message.trim(), 80)}"\n`);
3790
+ emit.text(peerOwner
3791
+ ? `delivered to agent-${data.peer} (live; they see it on their next prompt): "${truncate(message.trim(), 80)}"\n`
3792
+ : `queued for agent-${data.peer} (no live session; delivered when a session of that name next starts): "${truncate(message.trim(), 80)}"\n`);
3752
3793
  }
3753
3794
  async function runWait(name, opts) {
3754
3795
  const timeoutMs = parseDurationToMs(opts.timeout);
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/commands/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAc1E,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAmGN"}
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/commands/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAe1E,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAiIN"}
@@ -1,6 +1,6 @@
1
1
  import { monorepoRoot, resolveOwner } from "../core/agents/index.js";
2
2
  import { readLiveCoordinationRow } from "../core/agents/state/live-coordination-view.js";
3
- import { cleanArtifacts, createArtifact, inventoryArtifacts, releaseArtifact, renewArtifact, showArtifact, } from "../core/artifacts/index.js";
3
+ import { adoptUnmanagedArtifactFiles, cleanArtifacts, createArtifact, inventoryArtifacts, releaseArtifact, renewArtifact, showArtifact, } from "../core/artifacts/index.js";
4
4
  import { artifactDefaultRetentionDays, coordFreshnessSeconds } from "../core/config.js";
5
5
  export function registerArtifactsCommand(program, emit, context) {
6
6
  const root = program
@@ -12,6 +12,7 @@ export function registerArtifactsCommand(program, emit, context) {
12
12
  .description("Create one managed artifact workspace and print its path.")
13
13
  .requiredOption("--purpose <text>", "What the files are for")
14
14
  .option("--days <n>", "Retention in days (default from artifacts.default_retention_days)")
15
+ .option("--big", "Acknowledge that this workspace may exceed the per-bundle size ceiling")
15
16
  .action((slug, opts) => {
16
17
  run(emit, () => {
17
18
  const repoRoot = requireRepoRoot(context);
@@ -24,6 +25,7 @@ export function registerArtifactsCommand(program, emit, context) {
24
25
  purpose: opts.purpose,
25
26
  retentionDays,
26
27
  actor,
28
+ big: opts.big,
27
29
  });
28
30
  emit.data({
29
31
  path: created.path,
@@ -33,6 +35,27 @@ export function registerArtifactsCommand(program, emit, context) {
33
35
  });
34
36
  });
35
37
  });
38
+ root
39
+ .command("adopt-unmanaged")
40
+ .description("Preview loose direct-child files, or move them into one managed workspace.")
41
+ .option("--purpose <text>", "Why the adopted files are being retained", "Adopt legacy loose artifact files")
42
+ .option("--days <n>", "Retention in days (default from artifacts.default_retention_days)")
43
+ .option("--big", "Acknowledge an adopted bundle above the per-bundle size ceiling")
44
+ .option("--yes", "Move the exact previewed regular files into a managed workspace")
45
+ .action((opts) => {
46
+ run(emit, () => {
47
+ const repoRoot = requireRepoRoot(context);
48
+ emit.data(adoptUnmanagedArtifactFiles(repoRoot, {
49
+ yes: opts.yes,
50
+ big: opts.big,
51
+ purpose: opts.purpose,
52
+ retentionDays: opts.days
53
+ ? parseDays(opts.days)
54
+ : artifactDefaultRetentionDays(repoRoot),
55
+ actor: currentActor(repoRoot),
56
+ }));
57
+ });
58
+ });
36
59
  root
37
60
  .command("list")
38
61
  .description("Inventory every artifact workspace with its cleanup classification.")
@@ -125,9 +148,11 @@ function summarize(rows) {
125
148
  }
126
149
  return {
127
150
  total: rows.length,
151
+ bytes: rows.reduce((sum, row) => sum + (row.bytes ?? 0), 0),
128
152
  classifications,
129
153
  would_delete: rows.filter((row) => row.action === "would-delete").length,
130
154
  deleted: rows.filter((row) => row.action === "deleted").length,
155
+ would_delete_bytes: rows.reduce((sum, row) => sum + (row.action === "would-delete" ? (row.bytes ?? 0) : 0), 0),
131
156
  };
132
157
  }
133
158
  function run(emit, fn) {
@@ -1 +1 @@
1
- {"version":3,"file":"browse.d.ts","sourceRoot":"","sources":["../../src/commands/browse.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAgO1E,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,WAAW,EACtB,OAAO,CAAC,EAAE,qBAAqB,EAC/B,OAAO,SAAmB,GACzB,IAAI,CA+cN"}
1
+ {"version":3,"file":"browse.d.ts","sourceRoot":"","sources":["../../src/commands/browse.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAiO1E,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,WAAW,EACtB,OAAO,CAAC,EAAE,qBAAqB,EAC/B,OAAO,SAAmB,GACzB,IAAI,CAqdN"}
@@ -64,6 +64,9 @@ export function registerBrowseCommand(program, emitParam, context, binName = res
64
64
  'Example: `--batch "click button; wait 1500; reload; wait 3000"`. `reload` preserves sessionStorage + cookies, which is how to repro sessionStorage-restored UI state.')
65
65
  .option("--network-har <path>", "Record network traffic to a HAR file (finalized on close)")
66
66
  .option("--viewport <preset|WxH>", "Viewport: mobile (390x844), tablet (820x1180), desktop (1280x800), hd (1920x1080), or explicit '1920x1080'", "desktop")
67
+ .option("--color-scheme <scheme>", "Emulate prefers-color-scheme for the whole session: light | dark. " +
68
+ "Renders theme-aware pages in that scheme without page-specific toggles. " +
69
+ "Absent = browser default (unchanged behavior).")
67
70
  .option("--login", "Headed mode for one-time auth flow (cookies persist in profile)")
68
71
  .option("--login-close-file <path>", "With --login, wait for this file instead of terminal Enter, then remove it and close cleanly")
69
72
  .option("--control-file <path>", "With --login, publish an owner-only descriptor for repeated browse-session control")
@@ -265,6 +268,13 @@ async function runBrowse(url, opts, context) {
265
268
  : new CookieJar({ path: opts.store ?? DEFAULT_STORE, source: "harn-browse" });
266
269
  const headed = opts.login || opts.headed;
267
270
  const viewport = parseViewport(opts.viewport ?? "desktop");
271
+ let colorScheme;
272
+ if (opts.colorScheme !== undefined) {
273
+ if (opts.colorScheme !== "light" && opts.colorScheme !== "dark") {
274
+ throw new Error(`--color-scheme must be light or dark (got: ${opts.colorScheme}).`);
275
+ }
276
+ colorScheme = opts.colorScheme;
277
+ }
268
278
  const proxy = opts.proxyFromEnv ? browserProxyFromEnv() : undefined;
269
279
  const proxyGate = opts.proxyFromEnv ? browserProxyGateFromEnv() : null;
270
280
  if (opts.loginCloseFile && !opts.login) {
@@ -282,6 +292,7 @@ async function runBrowse(url, opts, context) {
282
292
  headed,
283
293
  jar,
284
294
  viewport,
295
+ ...(colorScheme ? { colorScheme } : {}),
285
296
  navigationTimeout: Number.parseInt(opts.timeout, 10),
286
297
  waitUntil: opts.waitUntil,
287
298
  recordHarPath: opts.networkHar ? resolve(opts.networkHar) : undefined,
@@ -0,0 +1,4 @@
1
+ import type { Command } from "commander";
2
+ import type { EmitContext, HarneryProgramContext } from "../commander.js";
3
+ export declare function registerDiagnosticsCommand(program: Command, emit: EmitContext, context?: HarneryProgramContext): void;
4
+ //# sourceMappingURL=diagnostics.d.ts.map
@@ -0,0 +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;AAyB1E,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAiKN"}