harnery 0.38.0 → 0.40.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 (378) hide show
  1. package/dist/commands/agents.d.ts.map +1 -1
  2. package/dist/commands/agents.js +32 -8
  3. package/dist/commands/artifacts.d.ts.map +1 -1
  4. package/dist/commands/artifacts.js +97 -6
  5. package/dist/commands/backup.d.ts +16 -0
  6. package/dist/commands/backup.d.ts.map +1 -1
  7. package/dist/commands/backup.js +239 -33
  8. package/dist/commands/browse.d.ts +8 -0
  9. package/dist/commands/browse.d.ts.map +1 -1
  10. package/dist/commands/browse.js +466 -231
  11. package/dist/commands/diagnostics.d.ts.map +1 -1
  12. package/dist/commands/diagnostics.js +6 -3
  13. package/dist/commands/ledger-v3.d.ts.map +1 -1
  14. package/dist/commands/ledger-v3.js +20 -4
  15. package/dist/commands/qa-run.d.ts.map +1 -1
  16. package/dist/commands/qa-run.js +26 -3
  17. package/dist/commands/qa-status.d.ts.map +1 -1
  18. package/dist/commands/qa-status.js +7 -2
  19. package/dist/commands/resources.d.ts.map +1 -1
  20. package/dist/commands/resources.js +23 -3
  21. package/dist/commands/review-pack.d.ts.map +1 -1
  22. package/dist/commands/review-pack.js +98 -23
  23. package/dist/commands/tunnel.d.ts.map +1 -1
  24. package/dist/commands/tunnel.js +2 -2
  25. package/dist/core/adapters/profiles.d.ts +1 -1
  26. package/dist/core/agents/canonical-emit.d.ts +3 -2
  27. package/dist/core/agents/canonical-emit.d.ts.map +1 -1
  28. package/dist/core/agents/canonical-emit.js +2 -0
  29. package/dist/core/agents/cli.js +13 -6
  30. package/dist/core/agents/live-authority-v3.d.ts.map +1 -1
  31. package/dist/core/agents/live-authority-v3.js +5 -3
  32. package/dist/core/agents/live-lifecycle-v3.d.ts +2 -2
  33. package/dist/core/agents/live-lifecycle-v3.d.ts.map +1 -1
  34. package/dist/core/agents/render/prompt-context.d.ts +7 -5
  35. package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
  36. package/dist/core/agents/render/prompt-context.js +63 -8
  37. package/dist/core/agents/session-finalizer-v3.d.ts +2 -2
  38. package/dist/core/agents/session-finalizer-v3.d.ts.map +1 -1
  39. package/dist/core/agents/state/live-coordination-view.d.ts +3 -3
  40. package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -1
  41. package/dist/core/agents/state/live-coordination-view.js +2 -1
  42. package/dist/core/agents/state/names.d.ts +35 -2
  43. package/dist/core/agents/state/names.d.ts.map +1 -1
  44. package/dist/core/agents/state/names.js +80 -5
  45. package/dist/core/agents/state/stale-sweep.d.ts +2 -1
  46. package/dist/core/agents/state/stale-sweep.d.ts.map +1 -1
  47. package/dist/core/agents/state/stale-sweep.js +23 -6
  48. package/dist/core/agents/turn-elapsed.d.ts +51 -0
  49. package/dist/core/agents/turn-elapsed.d.ts.map +1 -0
  50. package/dist/core/agents/turn-elapsed.js +91 -0
  51. package/dist/core/artifacts/activity.d.ts +14 -0
  52. package/dist/core/artifacts/activity.d.ts.map +1 -0
  53. package/dist/core/artifacts/activity.js +52 -0
  54. package/dist/core/artifacts/delivery-card.d.ts +39 -0
  55. package/dist/core/artifacts/delivery-card.d.ts.map +1 -0
  56. package/dist/core/artifacts/delivery-card.js +282 -0
  57. package/dist/core/artifacts/index.d.ts +42 -7
  58. package/dist/core/artifacts/index.d.ts.map +1 -1
  59. package/dist/core/artifacts/index.js +288 -76
  60. package/dist/core/artifacts/mutation-lock.d.ts +2 -0
  61. package/dist/core/artifacts/mutation-lock.d.ts.map +1 -0
  62. package/dist/core/artifacts/mutation-lock.js +91 -0
  63. package/dist/core/backup/host-snapshot.d.ts +18 -0
  64. package/dist/core/backup/host-snapshot.d.ts.map +1 -0
  65. package/dist/core/backup/host-snapshot.js +64 -0
  66. package/dist/core/config.d.ts +20 -5
  67. package/dist/core/config.d.ts.map +1 -1
  68. package/dist/core/config.js +44 -10
  69. package/dist/core/diagnostics/advice.d.ts +38 -3
  70. package/dist/core/diagnostics/advice.d.ts.map +1 -1
  71. package/dist/core/diagnostics/advice.js +103 -99
  72. package/dist/core/diagnostics/bundle.d.ts.map +1 -1
  73. package/dist/core/diagnostics/bundle.js +111 -47
  74. package/dist/core/diagnostics/comparison.d.ts.map +1 -1
  75. package/dist/core/diagnostics/comparison.js +3 -2
  76. package/dist/core/diagnostics/contract.d.ts +15 -31
  77. package/dist/core/diagnostics/contract.d.ts.map +1 -1
  78. package/dist/core/diagnostics/contract.js +2 -5
  79. package/dist/core/diagnostics/index.d.ts +2 -0
  80. package/dist/core/diagnostics/index.d.ts.map +1 -1
  81. package/dist/core/diagnostics/index.js +2 -0
  82. package/dist/core/diagnostics/pressure-contract.d.ts +260 -0
  83. package/dist/core/diagnostics/pressure-contract.d.ts.map +1 -0
  84. package/dist/core/diagnostics/pressure-contract.js +70 -0
  85. package/dist/core/diagnostics/pressure.d.ts +25 -0
  86. package/dist/core/diagnostics/pressure.d.ts.map +1 -0
  87. package/dist/core/diagnostics/pressure.js +1138 -0
  88. package/dist/core/diagnostics/replay.d.ts.map +1 -1
  89. package/dist/core/diagnostics/replay.js +90 -10
  90. package/dist/core/events/v3/adapter-id.d.ts +6 -0
  91. package/dist/core/events/v3/adapter-id.d.ts.map +1 -0
  92. package/dist/core/events/v3/adapter-id.js +7 -0
  93. package/dist/core/events/v3/archive-retention.d.ts.map +1 -1
  94. package/dist/core/events/v3/archive-retention.js +3 -2
  95. package/dist/core/events/v3/bootstrap.d.ts +41 -4
  96. package/dist/core/events/v3/bootstrap.d.ts.map +1 -1
  97. package/dist/core/events/v3/bootstrap.js +120 -17
  98. package/dist/core/events/v3/capabilities.d.ts +16 -9
  99. package/dist/core/events/v3/capabilities.d.ts.map +1 -1
  100. package/dist/core/events/v3/capabilities.js +37 -2
  101. package/dist/core/events/v3/capability-drift.d.ts +2 -2
  102. package/dist/core/events/v3/capability-drift.d.ts.map +1 -1
  103. package/dist/core/events/v3/control-witness.d.ts +48 -5
  104. package/dist/core/events/v3/control-witness.d.ts.map +1 -1
  105. package/dist/core/events/v3/control-witness.js +91 -36
  106. package/dist/core/events/v3/control.d.ts.map +1 -1
  107. package/dist/core/events/v3/control.js +22 -2
  108. package/dist/core/events/v3/index.d.ts +2 -1
  109. package/dist/core/events/v3/index.d.ts.map +1 -1
  110. package/dist/core/events/v3/index.js +2 -1
  111. package/dist/core/events/v3/live-feed.d.ts +7 -1
  112. package/dist/core/events/v3/live-feed.d.ts.map +1 -1
  113. package/dist/core/events/v3/live-feed.js +21 -3
  114. package/dist/core/events/v3/live-routing.d.ts.map +1 -1
  115. package/dist/core/events/v3/live-routing.js +10 -2
  116. package/dist/core/events/v3/producers/command-recorder.d.ts +2 -2
  117. package/dist/core/events/v3/producers/command-recorder.d.ts.map +1 -1
  118. package/dist/core/events/v3/producers/command-recorder.js +2 -1
  119. package/dist/core/events/v3/producers/coordination-recorder.d.ts +2 -2
  120. package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -1
  121. package/dist/core/events/v3/producers/coordination-recorder.js +2 -1
  122. package/dist/core/events/v3/producers/hook-base.d.ts +2 -2
  123. package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -1
  124. package/dist/core/events/v3/producers/hook-base.js +15 -5
  125. package/dist/core/events/v3/producers/hook.d.ts.map +1 -1
  126. package/dist/core/events/v3/producers/hook.js +17 -4
  127. package/dist/core/events/v3/producers/intake.d.ts +4 -4
  128. package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
  129. package/dist/core/events/v3/producers/intake.js +3 -2
  130. package/dist/core/events/v3/producers/producer-state-observer.d.ts.map +1 -1
  131. package/dist/core/events/v3/producers/producer-state-observer.js +2 -1
  132. package/dist/core/events/v3/producers/recorder.d.ts +16 -5
  133. package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
  134. package/dist/core/events/v3/producers/recorder.js +31 -9
  135. package/dist/core/events/v3/reader.d.ts.map +1 -1
  136. package/dist/core/events/v3/reader.js +10 -13
  137. package/dist/core/events/v3/runtime-build.d.ts.map +1 -1
  138. package/dist/core/events/v3/runtime-build.js +3 -2
  139. package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts +2 -2
  140. package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts.map +1 -1
  141. package/dist/core/events/v3/turn-telemetry.d.ts +2 -2
  142. package/dist/core/events/v3/turn-telemetry.d.ts.map +1 -1
  143. package/dist/core/hooks/adapter/output.d.ts +16 -14
  144. package/dist/core/hooks/adapter/output.d.ts.map +1 -1
  145. package/dist/core/hooks/adapter/output.js +36 -38
  146. package/dist/core/hooks/backup-schedule.d.ts +34 -0
  147. package/dist/core/hooks/backup-schedule.d.ts.map +1 -0
  148. package/dist/core/hooks/backup-schedule.js +114 -0
  149. package/dist/core/hooks/cli.js +61 -18
  150. package/dist/core/hooks/codex-wsl-bridge.d.ts +2 -0
  151. package/dist/core/hooks/codex-wsl-bridge.d.ts.map +1 -1
  152. package/dist/core/hooks/codex-wsl-bridge.js +18 -4
  153. package/dist/core/hooks/index.d.ts +1 -0
  154. package/dist/core/hooks/index.d.ts.map +1 -1
  155. package/dist/core/hooks/index.js +1 -0
  156. package/dist/core/hooks/prompt-context/contract.d.ts +61 -0
  157. package/dist/core/hooks/prompt-context/contract.d.ts.map +1 -0
  158. package/dist/core/hooks/prompt-context/contract.js +102 -0
  159. package/dist/core/hooks/prompt-context/index.d.ts +5 -0
  160. package/dist/core/hooks/prompt-context/index.d.ts.map +1 -0
  161. package/dist/core/hooks/prompt-context/index.js +2 -0
  162. package/dist/core/hooks/prompt-context/runner.d.ts +24 -0
  163. package/dist/core/hooks/prompt-context/runner.d.ts.map +1 -0
  164. package/dist/core/hooks/prompt-context/runner.js +249 -0
  165. package/dist/core/qa-artifacts.d.ts +3 -0
  166. package/dist/core/qa-artifacts.d.ts.map +1 -1
  167. package/dist/core/qa-artifacts.js +25 -3
  168. package/dist/core/resources/contract.d.ts +69 -3
  169. package/dist/core/resources/contract.d.ts.map +1 -1
  170. package/dist/core/resources/contract.js +1 -1
  171. package/dist/core/resources/index.d.ts +1 -0
  172. package/dist/core/resources/index.d.ts.map +1 -1
  173. package/dist/core/resources/index.js +1 -0
  174. package/dist/core/resources/native.d.ts +36 -0
  175. package/dist/core/resources/native.d.ts.map +1 -0
  176. package/dist/core/resources/native.js +418 -0
  177. package/dist/core/resources/sampler.d.ts +2 -0
  178. package/dist/core/resources/sampler.d.ts.map +1 -1
  179. package/dist/core/resources/sampler.js +31 -1
  180. package/dist/core/resources/status.d.ts +61 -0
  181. package/dist/core/resources/status.d.ts.map +1 -0
  182. package/dist/core/resources/status.js +536 -0
  183. package/dist/core/resources/system.d.ts +27 -0
  184. package/dist/core/resources/system.d.ts.map +1 -0
  185. package/dist/core/resources/system.js +439 -0
  186. package/dist/core/semantic/contract.d.ts +13 -13
  187. package/dist/core/semantic/service.d.ts +2 -0
  188. package/dist/core/semantic/service.d.ts.map +1 -1
  189. package/dist/core/semantic/service.js +27 -4
  190. package/dist/core/storage/builtins.js +41 -0
  191. package/dist/core/supervisor/contract.d.ts +41 -3
  192. package/dist/core/supervisor/contract.d.ts.map +1 -1
  193. package/dist/core/supervisor/contract.js +3 -2
  194. package/dist/core/supervisor/findings.d.ts +3 -0
  195. package/dist/core/supervisor/findings.d.ts.map +1 -1
  196. package/dist/core/supervisor/findings.js +88 -0
  197. package/dist/core/supervisor/history.d.ts.map +1 -1
  198. package/dist/core/supervisor/history.js +14 -0
  199. package/dist/core/supervisor/ledger-state.d.ts +55 -0
  200. package/dist/core/supervisor/ledger-state.d.ts.map +1 -0
  201. package/dist/core/supervisor/ledger-state.js +0 -0
  202. package/dist/core/supervisor/service.d.ts.map +1 -1
  203. package/dist/core/supervisor/service.js +120 -7
  204. package/dist/core/supervisor/storage.d.ts +3 -1
  205. package/dist/core/supervisor/storage.d.ts.map +1 -1
  206. package/dist/core/supervisor/storage.js +4 -0
  207. package/dist/core/workflow/admission.d.ts +3 -0
  208. package/dist/core/workflow/admission.d.ts.map +1 -1
  209. package/dist/core/workflow/admission.js +28 -16
  210. package/dist/core/workflow/engine.js +2 -2
  211. package/dist/core/workflow/live-session-v3.d.ts.map +1 -1
  212. package/dist/core/workflow/live-session-v3.js +6 -1
  213. package/dist/core/workflow/proof.d.ts.map +1 -1
  214. package/dist/core/workflow/proof.js +4 -3
  215. package/dist/lib/browser/capture-fidelity.d.ts +7 -0
  216. package/dist/lib/browser/capture-fidelity.d.ts.map +1 -1
  217. package/dist/lib/browser/capture-fidelity.js +17 -0
  218. package/dist/lib/browser/client.d.ts +9 -0
  219. package/dist/lib/browser/client.d.ts.map +1 -1
  220. package/dist/lib/browser/client.js +85 -37
  221. package/dist/lib/browser/index.d.ts +3 -1
  222. package/dist/lib/browser/index.d.ts.map +1 -1
  223. package/dist/lib/browser/index.js +2 -1
  224. package/dist/lib/browser/page-review-budget.d.ts +13 -0
  225. package/dist/lib/browser/page-review-budget.d.ts.map +1 -0
  226. package/dist/lib/browser/page-review-budget.js +251 -0
  227. package/dist/lib/browser/page-review-contracts.d.ts +127 -0
  228. package/dist/lib/browser/page-review-contracts.d.ts.map +1 -0
  229. package/dist/lib/browser/page-review-contracts.js +5 -0
  230. package/dist/lib/browser/page-review-evidence.d.ts +48 -0
  231. package/dist/lib/browser/page-review-evidence.d.ts.map +1 -0
  232. package/dist/lib/browser/page-review-evidence.js +340 -0
  233. package/dist/lib/browser/page-review-judge.d.ts +1 -1
  234. package/dist/lib/browser/page-review-judge.d.ts.map +1 -1
  235. package/dist/lib/browser/page-review-judge.js +46 -38
  236. package/dist/lib/browser/page-review-pack.d.ts +44 -22
  237. package/dist/lib/browser/page-review-pack.d.ts.map +1 -1
  238. package/dist/lib/browser/page-review-pack.js +116 -36
  239. package/dist/lib/browser/page-review-source.d.ts +12 -0
  240. package/dist/lib/browser/page-review-source.d.ts.map +1 -0
  241. package/dist/lib/browser/page-review-source.js +22 -0
  242. package/dist/lib/browser/qa-run-contracts.d.ts +35 -9
  243. package/dist/lib/browser/qa-run-contracts.d.ts.map +1 -1
  244. package/dist/lib/browser/qa-run-contracts.js +48 -14
  245. package/dist/lib/browser/qa-run.d.ts.map +1 -1
  246. package/dist/lib/browser/qa-run.js +215 -68
  247. package/dist/lib/browser/qa-snapshot.d.ts +6 -0
  248. package/dist/lib/browser/qa-snapshot.d.ts.map +1 -1
  249. package/dist/lib/browser/qa-snapshot.js +259 -48
  250. package/dist/lib/browser/review-capture-transaction.d.ts +13 -0
  251. package/dist/lib/browser/review-capture-transaction.d.ts.map +1 -0
  252. package/dist/lib/browser/review-capture-transaction.js +79 -0
  253. package/dist/lib/browser/standalone-html.d.ts.map +1 -1
  254. package/dist/lib/browser/standalone-html.js +4 -2
  255. package/dist/lib/browser/thumbnail-association.d.ts +34 -0
  256. package/dist/lib/browser/thumbnail-association.d.ts.map +1 -0
  257. package/dist/lib/browser/thumbnail-association.js +158 -0
  258. package/dist/lib/browser/tiling.d.ts +30 -0
  259. package/dist/lib/browser/tiling.d.ts.map +1 -1
  260. package/dist/lib/browser/tiling.js +38 -0
  261. package/dist/lib/docs-metadata-managed.d.ts.map +1 -1
  262. package/dist/lib/docs-metadata-managed.js +4 -1
  263. package/dist/lib/identities/assume.d.ts.map +1 -1
  264. package/dist/lib/identities/assume.js +7 -1
  265. package/dist/lib/instructions/templates.d.ts.map +1 -1
  266. package/dist/lib/instructions/templates.js +1 -0
  267. package/dist/lib/local-file-url.d.ts +12 -0
  268. package/dist/lib/local-file-url.d.ts.map +1 -1
  269. package/dist/lib/local-file-url.js +16 -2
  270. package/dist/lib/tunnel/state.d.ts +19 -4
  271. package/dist/lib/tunnel/state.d.ts.map +1 -1
  272. package/dist/lib/tunnel/state.js +53 -13
  273. package/package.json +7 -4
  274. package/schemas/config.schema.json +69 -2
  275. package/src/commands/agents.ts +42 -9
  276. package/src/commands/artifacts.ts +130 -6
  277. package/src/commands/backup.ts +287 -34
  278. package/src/commands/browse.ts +564 -267
  279. package/src/commands/diagnostics.ts +6 -3
  280. package/src/commands/ledger-v3.ts +20 -3
  281. package/src/commands/qa-run.ts +37 -3
  282. package/src/commands/qa-status.ts +11 -2
  283. package/src/commands/resources.ts +23 -3
  284. package/src/commands/review-pack.ts +165 -62
  285. package/src/commands/tunnel.ts +2 -1
  286. package/src/core/agents/canonical-emit.ts +4 -2
  287. package/src/core/agents/cli.ts +14 -6
  288. package/src/core/agents/live-authority-v3.ts +7 -3
  289. package/src/core/agents/live-lifecycle-v3.ts +2 -2
  290. package/src/core/agents/render/prompt-context.ts +68 -14
  291. package/src/core/agents/session-finalizer-v3.ts +2 -2
  292. package/src/core/agents/state/live-coordination-view.ts +4 -4
  293. package/src/core/agents/state/names.ts +92 -7
  294. package/src/core/agents/state/stale-sweep.ts +22 -8
  295. package/src/core/agents/turn-elapsed.ts +135 -0
  296. package/src/core/artifacts/activity.ts +71 -0
  297. package/src/core/artifacts/delivery-card.ts +375 -0
  298. package/src/core/artifacts/index.ts +385 -91
  299. package/src/core/artifacts/mutation-lock.ts +106 -0
  300. package/src/core/backup/host-snapshot.ts +76 -0
  301. package/src/core/config.ts +66 -13
  302. package/src/core/diagnostics/advice.ts +148 -120
  303. package/src/core/diagnostics/bundle.ts +138 -52
  304. package/src/core/diagnostics/comparison.ts +6 -2
  305. package/src/core/diagnostics/contract.ts +39 -42
  306. package/src/core/diagnostics/index.ts +2 -0
  307. package/src/core/diagnostics/pressure-contract.ts +294 -0
  308. package/src/core/diagnostics/pressure.ts +1361 -0
  309. package/src/core/diagnostics/replay.ts +116 -11
  310. package/src/core/events/v3/adapter-id.ts +12 -0
  311. package/src/core/events/v3/archive-retention.ts +3 -6
  312. package/src/core/events/v3/bootstrap.ts +163 -16
  313. package/src/core/events/v3/capabilities.ts +75 -25
  314. package/src/core/events/v3/capability-drift.ts +2 -2
  315. package/src/core/events/v3/control-witness.ts +172 -41
  316. package/src/core/events/v3/control.ts +34 -2
  317. package/src/core/events/v3/index.ts +3 -0
  318. package/src/core/events/v3/live-feed.ts +23 -5
  319. package/src/core/events/v3/live-routing.ts +14 -2
  320. package/src/core/events/v3/producers/command-recorder.ts +4 -4
  321. package/src/core/events/v3/producers/coordination-recorder.ts +4 -4
  322. package/src/core/events/v3/producers/hook-base.ts +21 -16
  323. package/src/core/events/v3/producers/hook.ts +21 -4
  324. package/src/core/events/v3/producers/intake.ts +6 -6
  325. package/src/core/events/v3/producers/producer-state-observer.ts +2 -1
  326. package/src/core/events/v3/producers/recorder.ts +50 -21
  327. package/src/core/events/v3/reader.ts +14 -13
  328. package/src/core/events/v3/runtime-build.ts +3 -2
  329. package/src/core/events/v3/runtime-telemetry-capabilities.ts +3 -3
  330. package/src/core/events/v3/turn-telemetry.ts +4 -4
  331. package/src/core/hooks/adapter/output.ts +50 -36
  332. package/src/core/hooks/backup-schedule.ts +147 -0
  333. package/src/core/hooks/cli.ts +65 -14
  334. package/src/core/hooks/codex-wsl-bridge.ts +21 -5
  335. package/src/core/hooks/index.ts +1 -0
  336. package/src/core/hooks/prompt-context/contract.ts +177 -0
  337. package/src/core/hooks/prompt-context/index.ts +22 -0
  338. package/src/core/hooks/prompt-context/runner.ts +303 -0
  339. package/src/core/qa-artifacts.ts +29 -3
  340. package/src/core/resources/contract.ts +76 -3
  341. package/src/core/resources/index.ts +1 -0
  342. package/src/core/resources/native.ts +481 -0
  343. package/src/core/resources/sampler.ts +46 -1
  344. package/src/core/resources/status.ts +717 -0
  345. package/src/core/resources/system.ts +530 -0
  346. package/src/core/semantic/service.ts +37 -3
  347. package/src/core/storage/builtins.ts +41 -0
  348. package/src/core/supervisor/contract.ts +45 -3
  349. package/src/core/supervisor/findings.ts +159 -0
  350. package/src/core/supervisor/history.ts +15 -0
  351. package/src/core/supervisor/ledger-state.ts +0 -0
  352. package/src/core/supervisor/service.ts +133 -5
  353. package/src/core/supervisor/storage.ts +7 -0
  354. package/src/core/workflow/admission.ts +33 -17
  355. package/src/core/workflow/engine.ts +2 -2
  356. package/src/core/workflow/live-session-v3.ts +6 -8
  357. package/src/core/workflow/proof.ts +4 -3
  358. package/src/lib/browser/capture-fidelity.ts +23 -0
  359. package/src/lib/browser/client.ts +96 -44
  360. package/src/lib/browser/index.ts +15 -1
  361. package/src/lib/browser/page-review-budget.ts +309 -0
  362. package/src/lib/browser/page-review-contracts.ts +129 -0
  363. package/src/lib/browser/page-review-evidence.ts +465 -0
  364. package/src/lib/browser/page-review-judge.ts +56 -40
  365. package/src/lib/browser/page-review-pack.ts +181 -43
  366. package/src/lib/browser/page-review-source.ts +30 -0
  367. package/src/lib/browser/qa-run-contracts.ts +62 -18
  368. package/src/lib/browser/qa-run.ts +259 -71
  369. package/src/lib/browser/qa-snapshot.ts +289 -48
  370. package/src/lib/browser/review-capture-transaction.ts +106 -0
  371. package/src/lib/browser/standalone-html.ts +4 -2
  372. package/src/lib/browser/thumbnail-association.ts +190 -0
  373. package/src/lib/browser/tiling.ts +63 -0
  374. package/src/lib/docs-metadata-managed.ts +4 -1
  375. package/src/lib/identities/assume.ts +12 -4
  376. package/src/lib/instructions/templates.ts +1 -0
  377. package/src/lib/local-file-url.ts +17 -2
  378. package/src/lib/tunnel/state.ts +70 -13
@@ -87,4 +87,34 @@ export declare function bandsCoveringRects(allBands: ReadonlyArray<{
87
87
  width: number;
88
88
  height: number;
89
89
  }>, maxExtra?: number): number[];
90
+ /** All native-pixel candidates, before any per-pack allocation or cropping. */
91
+ export declare function reviewCandidateRects(args: {
92
+ width: number;
93
+ height: number;
94
+ bandHeight: number;
95
+ overlap: number;
96
+ atoms?: VisualAtom[];
97
+ scopes?: Array<{
98
+ selector: string;
99
+ rects: Array<{
100
+ label: string;
101
+ x: number;
102
+ y: number;
103
+ width: number;
104
+ height: number;
105
+ }>;
106
+ }>;
107
+ }): Array<{
108
+ id: string;
109
+ index: number;
110
+ label: string;
111
+ rect: {
112
+ x: number;
113
+ y: number;
114
+ width: number;
115
+ height: number;
116
+ };
117
+ scope?: string;
118
+ gate_hits: [];
119
+ }>;
90
120
  //# sourceMappingURL=tiling.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tiling.d.ts","sourceRoot":"","sources":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K,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,EAAE,CAAC;CACf,CAAC,CA2CD"}
@@ -144,3 +144,41 @@ export function bandsCoveringRects(allBands, keptCount, rects, maxExtra = 50) {
144
144
  }
145
145
  return out;
146
146
  }
147
+ /** All native-pixel candidates, before any per-pack allocation or cropping. */
148
+ export function reviewCandidateRects(args) {
149
+ const opts = { bandHeight: args.bandHeight, overlap: args.overlap };
150
+ const bands = args.atoms?.length
151
+ ? snappedBandRects(0, args.height, 0, args.width, args.atoms, opts).rects
152
+ : Array.from({
153
+ length: Math.ceil(Math.max(0, args.height - args.bandHeight) /
154
+ Math.max(1, args.bandHeight - args.overlap)) + 1,
155
+ }, (_, i) => {
156
+ const y = i * Math.max(1, args.bandHeight - args.overlap);
157
+ return { x: 0, y, width: args.width, height: Math.min(args.bandHeight, args.height - y) };
158
+ });
159
+ const out = bands.map((r, i) => ({
160
+ id: `band-${i + 1}`,
161
+ index: i,
162
+ label: `band ${i + 1}`,
163
+ rect: { x: r.x, y: r.y, width: r.width, height: r.height },
164
+ gate_hits: [],
165
+ }));
166
+ for (const [scopeIndex, scope] of (args.scopes ?? []).entries()) {
167
+ const expanded = scope.rects.flatMap((r) => bandOversizedRect(r, args.atoms ?? [], opts));
168
+ for (const [i, r] of expanded.entries()) {
169
+ const x = Math.max(0, Math.round(r.x)), y = Math.max(0, Math.round(r.y));
170
+ const width = Math.min(Math.round(r.width), args.width - x), height = Math.min(Math.round(r.height), args.height - y);
171
+ if (width <= 0 || height <= 0)
172
+ continue;
173
+ out.push({
174
+ id: `scope-${scopeIndex + 1}-${i + 1}`,
175
+ index: out.length,
176
+ label: r.label,
177
+ scope: scope.selector,
178
+ rect: { x, y, width, height },
179
+ gate_hits: [],
180
+ });
181
+ }
182
+ }
183
+ return out;
184
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"docs-metadata-managed.d.ts","sourceRoot":"","sources":["../../src/lib/docs-metadata-managed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAwC,MAAM,uBAAuB,CAAC;AAMpG;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUhE;AAmBD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,cAAc,EAAE,OAAO,GACtB,gBAAgB,GAAG,IAAI,CAczB;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,cAAc,EAAE,OAAO,GACtB,OAAO,CAIT"}
1
+ {"version":3,"file":"docs-metadata-managed.d.ts","sourceRoot":"","sources":["../../src/lib/docs-metadata-managed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAwC,MAAM,uBAAuB,CAAC;AAMpG;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAahE;AAmBD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,cAAc,EAAE,OAAO,GACtB,gBAAgB,GAAG,IAAI,CAczB;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,cAAc,EAAE,OAAO,GACtB,OAAO,CAIT"}
@@ -15,7 +15,10 @@ export function isExcludedDocsMetadataPath(path) {
15
15
  // Dashboard surfaces render from copies of other repositories' documents.
16
16
  /(?:^|\/)content\/dashboards\//.test(rel) ||
17
17
  /(?:^|\/)docs\/shopify\/admin-api\//.test(rel) ||
18
- /(?:^|\/)docs\/templates\//.test(rel));
18
+ // Template skeletons carry placeholder frontmatter by design. Hosts keep
19
+ // them under docs/templates/ or another documentation root such as
20
+ // meta-docs/templates/, so match the directory name rather than one root.
21
+ /(?:^|\/)templates\//.test(rel));
19
22
  }
20
23
  function lifecycleType(path) {
21
24
  const rel = normalized(path);
@@ -1 +1 @@
1
- {"version":3,"file":"assume.d.ts","sourceRoot":"","sources":["../../../src/lib/identities/assume.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAuBH,MAAM,MAAM,uBAAuB,GAC/B,eAAe,GACf,iBAAiB,GACjB,sBAAsB,GACtB,oBAAoB,GACpB,kBAAkB,GAClB,oBAAoB,GACpB,aAAa,GACb,mBAAmB,CAAC;AAExB,qBAAa,mBAAoB,SAAQ,KAAK;aAE1B,IAAI,EAAE,uBAAuB;gBAA7B,IAAI,EAAE,uBAAuB,EAC7C,OAAO,EAAE,MAAM;CAKlB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OAAO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IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,+DAA+D;IAC/D,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAOD;+EAC+E;AAC/E,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,KAAK,SAAa,EAClB,mBAAmB,GAAE,WAAW,CAAC,MAAM,CAAa,GACnD,gBAAgB,GAAG,IAAI,CA6BzB;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAyCT;AA0ED,gEAAgE;AAChE,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,GACjC,oBAAoB,CAyHtB"}
@@ -179,6 +179,8 @@ function adapterOf(platform) {
179
179
  return "cursor";
180
180
  if (platform === "codex")
181
181
  return "codex";
182
+ if (platform === "openclaw")
183
+ return "openclaw";
182
184
  return "claude-code";
183
185
  }
184
186
  /** Assume `target` for one live main session. Safe to retry. */
@@ -238,11 +240,15 @@ export function assumeIdentity(coordRoot, instanceId, target, opts) {
238
240
  reclaimed_instance_id: reclaimedInstanceId,
239
241
  };
240
242
  }
243
+ const adapter = adapterOf(hb.platform);
244
+ if (adapter === "openclaw") {
245
+ throw new IdentityAssumeError("not_session", "identity assumption is unavailable for observer-only OpenClaw generations");
246
+ }
241
247
  const emitted = recordLiveIdentityChangeV3({
242
248
  coordRoot,
243
249
  owner: instanceId,
244
250
  nativeSessionId: hb.native_session_id ?? hb.session_id,
245
- adapter: adapterOf(hb.platform),
251
+ adapter,
246
252
  name: identity.name,
247
253
  identityId: identity.agent_id,
248
254
  });
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/lib/instructions/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,+DAA+D;AAC/D,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,sEAAsE;AACtE,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AAEpD,2EAA2E;AAC3E,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,MAAM,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,2CAA2C;IAC3C,GAAG,EAAE,OAAO,CAAC;IACb,4CAA4C;IAC5C,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,WAAoE,GAC3E,MAAM,CAgHR;AAID,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CACrC;AAsVD,eAAO,MAAM,MAAM,EAAE,aAAa,EAiDjC,CAAC"}
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/lib/instructions/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,+DAA+D;AAC/D,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,sEAAsE;AACtE,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AAEpD,2EAA2E;AAC3E,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,MAAM,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,2CAA2C;IAC3C,GAAG,EAAE,OAAO,CAAC;IACb,4CAA4C;IAC5C,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,WAAoE,GAC3E,MAAM,CAiHR;AAID,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CACrC;AAsVD,eAAO,MAAM,MAAM,EAAE,aAAa,EAiDjC,CAAC"}
@@ -128,6 +128,7 @@ Use it for anything future-you or a peer will need to pick up your thread.
128
128
  and other untracked files that must survive a session, create a managed workspace
129
129
  with \`${b} artifacts create <slug> --purpose "<why>"\`. Write files under the
130
130
  returned path, then run \`${b} artifacts release <id>\` when active work is done.
131
+ After review, use \`${b} artifacts discard <id> --reason "<why no longer needed>"\` for disposable or superseded evidence: it releases ownership and shortens retention to at most 60 minutes (\`--minutes\` overrides). Keep unresolved failures, handoffs, final evidence, and files awaiting review; use a hold when needed. A passing check cannot establish whether another reader needs the files, so the reviewing agent decides. For known short-lived work, \`${b} artifacts create --minutes <n>\` sets the initial window.
131
132
  Do not create a repo-root temp directory; \`${b} artifacts clean\` previews
132
133
  expired cleanup and requires \`--yes\` to delete anything.
133
134
 
@@ -2,6 +2,18 @@
2
2
  export declare const DEFAULT_WEB_PORT = 4276;
3
3
  /** Cookie-isolated host for navigable repo files. */
4
4
  export declare const FILES_ORIGIN_HOST = "harnery-files.localhost";
5
+ /**
6
+ * Percent-encode one URL component so the finished URL is safe as a bare
7
+ * Markdown destination.
8
+ *
9
+ * encodeURIComponent leaves parentheses raw, and a raw ")" ends a `[text](url)`
10
+ * destination early. The alternative is the angle-bracket destination form,
11
+ * which is valid CommonMark but is not implemented by every renderer, and one
12
+ * that skips it can style the text as a link while dropping the href, leaving
13
+ * something that looks clickable and does nothing. These URLs are written into
14
+ * Markdown for humans to click, so encode the parentheses instead.
15
+ */
16
+ export declare function encodeLinkSafeComponent(value: string): string;
5
17
  /** Encode each repo-path segment while preserving slash-based URL resolution. */
6
18
  export declare function encodedRepoPath(relPath: string): string;
7
19
  export declare function localFilesOriginUrl(relPath: string, port?: number | string, protocol?: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"local-file-url.d.ts","sourceRoot":"","sources":["../../src/lib/local-file-url.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,4BAA4B,CAAC;AAE3D,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,GAAG,MAAyB,EACxC,QAAQ,SAAU,GACjB,MAAM,CAGR;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,GAAG,MAAyB,GACvC,MAAM,CAER"}
1
+ {"version":3,"file":"local-file-url.d.ts","sourceRoot":"","sources":["../../src/lib/local-file-url.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,4BAA4B,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,GAAG,MAAyB,EACxC,QAAQ,SAAU,GACjB,MAAM,CAGR;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,GAAG,MAAyB,GACvC,MAAM,CAER"}
@@ -2,13 +2,27 @@
2
2
  export const DEFAULT_WEB_PORT = 4276;
3
3
  /** Cookie-isolated host for navigable repo files. */
4
4
  export const FILES_ORIGIN_HOST = "harnery-files.localhost";
5
+ /**
6
+ * Percent-encode one URL component so the finished URL is safe as a bare
7
+ * Markdown destination.
8
+ *
9
+ * encodeURIComponent leaves parentheses raw, and a raw ")" ends a `[text](url)`
10
+ * destination early. The alternative is the angle-bracket destination form,
11
+ * which is valid CommonMark but is not implemented by every renderer, and one
12
+ * that skips it can style the text as a link while dropping the href, leaving
13
+ * something that looks clickable and does nothing. These URLs are written into
14
+ * Markdown for humans to click, so encode the parentheses instead.
15
+ */
16
+ export function encodeLinkSafeComponent(value) {
17
+ return encodeURIComponent(value).replace(/[()]/g, (char) => (char === "(" ? "%28" : "%29"));
18
+ }
5
19
  /** Encode each repo-path segment while preserving slash-based URL resolution. */
6
20
  export function encodedRepoPath(relPath) {
7
21
  return relPath
8
22
  .replace(/^\/+/, "")
9
23
  .split("/")
10
24
  .filter(Boolean)
11
- .map((segment) => encodeURIComponent(segment))
25
+ .map((segment) => encodeLinkSafeComponent(segment))
12
26
  .join("/");
13
27
  }
14
28
  export function localFilesOriginUrl(relPath, port = DEFAULT_WEB_PORT, protocol = "http:") {
@@ -16,5 +30,5 @@ export function localFilesOriginUrl(relPath, port = DEFAULT_WEB_PORT, protocol =
16
30
  return `${protocol}//${FILES_ORIGIN_HOST}${portPart}/${encodedRepoPath(relPath)}`;
17
31
  }
18
32
  export function localFileViewerUrl(relPath, port = DEFAULT_WEB_PORT) {
19
- return `http://localhost:${port}/files?path=${encodeURIComponent(relPath)}`;
33
+ return `http://localhost:${port}/files?path=${encodeLinkSafeComponent(relPath)}`;
20
34
  }
@@ -27,15 +27,30 @@ export interface TunnelState {
27
27
  }
28
28
  export declare function readConfig(): TunnelConfig;
29
29
  export declare function writeConfig(cfg: TunnelConfig): void;
30
- export declare function readState(name?: string): TunnelState | null;
31
- export declare function writeState(state: TunnelState): void;
32
- export declare function clearState(name?: string): void;
30
+ export declare function readState(name?: string, root?: string): TunnelState | null;
31
+ export declare function writeState(state: TunnelState, root?: string): void;
32
+ export declare function clearState(name?: string, root?: string): void;
33
33
  /**
34
34
  * Every persisted tunnel instance, newest-started first. Reads every
35
35
  * `state*.json` under `.cache/tunnel/`; tolerates missing/corrupt files.
36
36
  */
37
- export declare function listStates(): TunnelState[];
37
+ export declare function listStates(root?: string): TunnelState[];
38
38
  export declare function isProcessAlive(pid: number): boolean;
39
+ export type ProcessAliveCheck = (pid: number) => boolean;
40
+ /** True when both the local gate and its provider-side process are live. */
41
+ export declare function isTunnelStateLive(state: TunnelState, processAlive?: ProcessAliveCheck): boolean;
42
+ /**
43
+ * Newest live tunnel that serves `vhost` on the requested local web port.
44
+ *
45
+ * The port alone does not identify a tunnel. Several tunnels can forward to one
46
+ * upstream port and be told apart only by the Host header they send, and a
47
+ * server that routes on Host then serves each of them a different site. Picking
48
+ * by port alone returns whichever such tunnel started last, so a caller that
49
+ * builds a URL for one site can hand back a host that serves another and every
50
+ * link 400s. Matching the vhost too keeps the returned tunnel the one that
51
+ * actually serves the caller's origin.
52
+ */
53
+ export declare function findLiveTunnelForOrigin(port: number, vhost: string, root?: string, processAlive?: ProcessAliveCheck): TunnelState | null;
39
54
  /**
40
55
  * Ensure cloudflared is on PATH or installed at ~/.local/bin/cloudflared.
41
56
  * Auto-downloads on Linux; throws on other platforms with brew hint.
@@ -1 +1 @@
1
- {"version":3,"file":"state.d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EAAE,MAAM,CAAC;CAC/B;AAOD,wBAAgB,UAAU,IAAI,YAAY,CAWzC;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAEnD;AAED,wBAAgB,SAAS,CACvB,IAAI,GAAE,MAAyB,EAC/B,IAAI,GAAE,MAAsB,GAC3B,WAAW,GAAG,IAAI,CAQpB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,GAAE,MAAsB,GAAG,IAAI,CAEjF;AAED,wBAAgB,UAAU,CAAC,IAAI,GAAE,MAAyB,EAAE,IAAI,GAAE,MAAsB,GAAG,IAAI,CAG9F;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,GAAE,MAAsB,GAAG,WAAW,EAAE,CAWtE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAOnD;AAED,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;AAEzD,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,WAAW,EAClB,YAAY,GAAE,iBAAkC,GAC/C,OAAO,CAKT;AAeD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,MAAsB,EAC5B,YAAY,GAAE,iBAAkC,GAC/C,WAAW,GAAG,IAAI,CASpB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAuB1C"}
@@ -1,11 +1,12 @@
1
- // Tunnel config + state persistence + provider helpers. Lives under
1
+ // Tunnel config + state persistence + provider helpers. Commands default to
2
2
  // <cwd>/.cache/tunnel/; gitignored, so the allowlist is per-machine.
3
3
  import { execSync } from "node:child_process";
4
4
  import { existsSync, mkdirSync, readdirSync, readFileSync, unlinkSync, writeFileSync, } from "node:fs";
5
5
  import { resolve } from "node:path";
6
- // Inline cachePath: tunnel state under <cwd>/.cache/tunnel/.
7
- function cachePath(tool, filename) {
8
- const dir = resolve(process.cwd(), ".cache", tool);
6
+ // Tunnel state lives under <root>/.cache/tunnel/. Root defaults to cwd for the
7
+ // command surface and can be supplied by callers that already resolved a repo.
8
+ function cachePath(tool, filename, root = process.cwd()) {
9
+ const dir = resolve(root, ".cache", tool);
9
10
  if (!existsSync(dir))
10
11
  mkdirSync(dir, { recursive: true });
11
12
  return resolve(dir, filename);
@@ -65,8 +66,8 @@ export function readConfig() {
65
66
  export function writeConfig(cfg) {
66
67
  writeFileSync(cachePath("tunnel", CONFIG_FILE), JSON.stringify(cfg, null, 2));
67
68
  }
68
- export function readState(name = DEFAULT_INSTANCE) {
69
- const p = cachePath("tunnel", stateFile(name));
69
+ export function readState(name = DEFAULT_INSTANCE, root = process.cwd()) {
70
+ const p = cachePath("tunnel", stateFile(name), root);
70
71
  if (!existsSync(p))
71
72
  return null;
72
73
  try {
@@ -76,11 +77,11 @@ export function readState(name = DEFAULT_INSTANCE) {
76
77
  return null;
77
78
  }
78
79
  }
79
- export function writeState(state) {
80
- writeFileSync(cachePath("tunnel", stateFile(state.name)), JSON.stringify(state, null, 2));
80
+ export function writeState(state, root = process.cwd()) {
81
+ writeFileSync(cachePath("tunnel", stateFile(state.name), root), JSON.stringify(state, null, 2));
81
82
  }
82
- export function clearState(name = DEFAULT_INSTANCE) {
83
- const p = cachePath("tunnel", stateFile(name));
83
+ export function clearState(name = DEFAULT_INSTANCE, root = process.cwd()) {
84
+ const p = cachePath("tunnel", stateFile(name), root);
84
85
  if (existsSync(p))
85
86
  unlinkSync(p);
86
87
  }
@@ -88,8 +89,8 @@ export function clearState(name = DEFAULT_INSTANCE) {
88
89
  * Every persisted tunnel instance, newest-started first. Reads every
89
90
  * `state*.json` under `.cache/tunnel/`; tolerates missing/corrupt files.
90
91
  */
91
- export function listStates() {
92
- const dir = resolve(process.cwd(), ".cache", "tunnel");
92
+ export function listStates(root = process.cwd()) {
93
+ const dir = resolve(root, ".cache", "tunnel");
93
94
  if (!existsSync(dir))
94
95
  return [];
95
96
  const out = [];
@@ -97,7 +98,7 @@ export function listStates() {
97
98
  const name = nameFromStateFile(file);
98
99
  if (name === null)
99
100
  continue;
100
- const state = readState(name);
101
+ const state = readState(name, root);
101
102
  if (state)
102
103
  out.push(state);
103
104
  }
@@ -112,6 +113,45 @@ export function isProcessAlive(pid) {
112
113
  return false;
113
114
  }
114
115
  }
116
+ /** True when both the local gate and its provider-side process are live. */
117
+ export function isTunnelStateLive(state, processAlive = isProcessAlive) {
118
+ if (!processAlive(state.gate_pid))
119
+ return false;
120
+ if (state.provider === "tailscale")
121
+ return true;
122
+ const providerPid = state.cloudflared_pid ?? state.provider_pid;
123
+ return typeof providerPid === "number" && processAlive(providerPid);
124
+ }
125
+ function tunnelTargetPort(state) {
126
+ const value = /^[a-z][a-z\d+.-]*:\/\//i.test(state.target)
127
+ ? state.target
128
+ : `http://${state.target}`;
129
+ try {
130
+ const url = new URL(value);
131
+ if (url.port)
132
+ return Number.parseInt(url.port, 10);
133
+ return url.protocol === "https:" ? 443 : 80;
134
+ }
135
+ catch {
136
+ return null;
137
+ }
138
+ }
139
+ /**
140
+ * Newest live tunnel that serves `vhost` on the requested local web port.
141
+ *
142
+ * The port alone does not identify a tunnel. Several tunnels can forward to one
143
+ * upstream port and be told apart only by the Host header they send, and a
144
+ * server that routes on Host then serves each of them a different site. Picking
145
+ * by port alone returns whichever such tunnel started last, so a caller that
146
+ * builds a URL for one site can hand back a host that serves another and every
147
+ * link 400s. Matching the vhost too keeps the returned tunnel the one that
148
+ * actually serves the caller's origin.
149
+ */
150
+ export function findLiveTunnelForOrigin(port, vhost, root = process.cwd(), processAlive = isProcessAlive) {
151
+ return (listStates(root).find((state) => tunnelTargetPort(state) === port &&
152
+ state.vhost === vhost &&
153
+ isTunnelStateLive(state, processAlive)) ?? null);
154
+ }
115
155
  /**
116
156
  * Ensure cloudflared is on PATH or installed at ~/.local/bin/cloudflared.
117
157
  * Auto-downloads on Linux; throws on other platforms with brew hint.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harnery",
3
- "version": "0.38.0",
3
+ "version": "0.40.0",
4
4
  "description": "Multi-agent coordination for AI coding agents - Claude Code, Cursor, and Codex.",
5
5
  "license": "MIT",
6
6
  "author": "Ryan Kelly",
@@ -238,16 +238,17 @@
238
238
  "packageManager": "bun@1.4.0",
239
239
  "scripts": {
240
240
  "build": "npm run clean && tsc -p tsconfig.build.json && node scripts/rewrite-dts-extensions.mjs",
241
+ "build:openclaw-plugin": "mkdir -p openclaw-plugin/dist && bun build openclaw-plugin/src/index.ts openclaw-plugin/src/record-worker.ts --target=node --format=esm --external openclaw --outdir openclaw-plugin/dist --entry-naming '[name].js' && cp openclaw-plugin/package.json openclaw-plugin/openclaw.plugin.json openclaw-plugin/dist/",
241
242
  "clean": "rm -rf dist",
242
243
  "prepublishOnly": "npm run build",
243
244
  "typecheck": "bun x tsc --noEmit",
244
- "lint": "bun x @biomejs/biome check src",
245
+ "lint": "bun x @biomejs/biome check src openclaw-plugin",
245
246
  "check:portability": "bun run scripts/check-portability.ts",
246
247
  "check:public-surface": "bun run scripts/check-public-surface.ts",
247
248
  "check:layering": "bun run scripts/check-layering.ts",
248
249
  "probe:supervisor-budget": "bun run scripts/probe-supervisor-budget.ts",
249
- "lint:fix": "bun x @biomejs/biome check --write src",
250
- "format": "bun x @biomejs/biome format --write src",
250
+ "lint:fix": "bun x @biomejs/biome check --write src openclaw-plugin",
251
+ "format": "bun x @biomejs/biome format --write src openclaw-plugin",
251
252
  "test": "bun run scripts/test.mjs",
252
253
  "test:list": "bun run scripts/test.mjs --list",
253
254
  "test:web": "cd web && bun install && bun test",
@@ -259,6 +260,8 @@
259
260
  "verify:contracts": "bun run scripts/sync-verified-contracts.ts",
260
261
  "verify:contracts:check": "bun run scripts/sync-verified-contracts.ts --check",
261
262
  "generate:event-v3": "bun run scripts/generate-event-v3-contract.ts",
263
+ "fixtures:openclaw:intake": "bun run openclaw-plugin/scripts/intake-fixtures.ts",
264
+ "test:openclaw-node24": "node openclaw-plugin/scripts/test-node24.mjs",
262
265
  "check:event-v3": "bun run scripts/generate-event-v3-contract.ts --check && bun run scripts/check-event-v3-reader-boundary.ts",
263
266
  "generate:docs-metadata-v2": "bun run scripts/generate-docs-metadata-v2-schema.ts",
264
267
  "check:docs-metadata-v2": "bun run scripts/generate-docs-metadata-v2-schema.ts --check"
@@ -308,6 +308,37 @@
308
308
  }
309
309
  }
310
310
  },
311
+ "hooks": {
312
+ "type": "object",
313
+ "additionalProperties": false,
314
+ "description": "Optional project-owned hook extensions. User-global values cannot enable project executables.",
315
+ "properties": {
316
+ "promptContext": {
317
+ "type": "object",
318
+ "additionalProperties": false,
319
+ "required": ["enabled"],
320
+ "description": "Run scripts/hooks/harness/extensions/prompt-context through the normalized prompt hook. Disabled by default and project config only.",
321
+ "properties": {
322
+ "enabled": {
323
+ "type": "boolean",
324
+ "default": false
325
+ },
326
+ "timeoutMs": {
327
+ "type": "integer",
328
+ "minimum": 1,
329
+ "maximum": 120000,
330
+ "default": 15000
331
+ },
332
+ "maxOutputBytes": {
333
+ "type": "integer",
334
+ "minimum": 1,
335
+ "maximum": 4194304,
336
+ "default": 65536
337
+ }
338
+ }
339
+ }
340
+ }
341
+ },
311
342
  "instructions": {
312
343
  "type": "object",
313
344
  "additionalProperties": false,
@@ -345,7 +376,7 @@
345
376
  "backup": {
346
377
  "type": "object",
347
378
  "additionalProperties": false,
348
- "description": "`harn backup` (restic) defaults. Env overrides: HARNERY_RESTIC_REPO, HARNERY_RESTIC_PASSWORD_FILE. `harn backup` is manual (init/snapshot/prune/...); there is no auto-snapshot scheduler.",
379
+ "description": "`harn backup` (restic) defaults. Env overrides: HARNERY_RESTIC_REPO, HARNERY_RESTIC_PASSWORD_FILE. Set backup.schedule to run a non-blocking, freshness-gated snapshot from SessionStart.",
349
380
  "properties": {
350
381
  "repo": {
351
382
  "type": "string",
@@ -353,7 +384,43 @@
353
384
  },
354
385
  "password_file": {
355
386
  "type": "string",
356
- "description": "File holding the restic repo password. Default: ~/.config/harnery/restic-password (autogenerated on `harn backup init`)."
387
+ "description": "File holding the restic repo password. Relative paths resolve from the coordination root. Default: ~/.config/harnery/restic-password (autogenerated on `harn backup init`)."
388
+ },
389
+ "include": {
390
+ "type": "array",
391
+ "default": [],
392
+ "items": { "type": "string", "minLength": 1 },
393
+ "description": "Extra .harnery-relative paths to add to the catalog-derived default snapshot set."
394
+ },
395
+ "exclude": {
396
+ "type": "array",
397
+ "default": [],
398
+ "items": { "type": "string", "minLength": 1 },
399
+ "description": "Catalog family IDs or .harnery-relative paths to remove from the snapshot set."
400
+ },
401
+ "max_bytes": {
402
+ "type": "integer",
403
+ "minimum": 1,
404
+ "default": 52428800,
405
+ "description": "Maximum logical bytes selected by snapshot before --allow-large is required."
406
+ },
407
+ "schedule": {
408
+ "type": "object",
409
+ "additionalProperties": false,
410
+ "required": ["if_stale"],
411
+ "description": "Optional SessionStart snapshot schedule. Absence disables scheduled snapshots.",
412
+ "properties": {
413
+ "if_stale": {
414
+ "type": "string",
415
+ "pattern": "^[1-9][0-9]*(ms|s|m|h|d)$",
416
+ "description": "Run only when this host's newest snapshot is older than the duration, such as 24h."
417
+ },
418
+ "tags": {
419
+ "type": "array",
420
+ "default": [],
421
+ "items": { "type": "string", "minLength": 1 }
422
+ }
423
+ }
357
424
  },
358
425
  "keep_daily": {
359
426
  "type": "integer",