harnery 0.36.0 → 0.38.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 (432) hide show
  1. package/dist/commander.d.ts +9 -0
  2. package/dist/commander.d.ts.map +1 -1
  3. package/dist/commander.js +10 -1
  4. package/dist/commands/admission.d.ts +21 -0
  5. package/dist/commands/admission.d.ts.map +1 -0
  6. package/dist/commands/admission.js +565 -0
  7. package/dist/commands/agents.d.ts +7 -0
  8. package/dist/commands/agents.d.ts.map +1 -1
  9. package/dist/commands/agents.js +148 -47
  10. package/dist/commands/artifacts.d.ts.map +1 -1
  11. package/dist/commands/artifacts.js +73 -2
  12. package/dist/commands/browse-ai.d.ts +2 -2
  13. package/dist/commands/browse-ai.d.ts.map +1 -1
  14. package/dist/commands/browse-ai.js +6 -4
  15. package/dist/commands/browse.d.ts.map +1 -1
  16. package/dist/commands/browse.js +360 -21
  17. package/dist/commands/diagnostics.d.ts +4 -0
  18. package/dist/commands/diagnostics.d.ts.map +1 -0
  19. package/dist/commands/diagnostics.js +229 -0
  20. package/dist/commands/fetch.js +1 -0
  21. package/dist/commands/files.d.ts +12 -0
  22. package/dist/commands/files.d.ts.map +1 -1
  23. package/dist/commands/files.js +54 -1
  24. package/dist/commands/governor.d.ts.map +1 -1
  25. package/dist/commands/governor.js +4 -0
  26. package/dist/commands/ledger-v3.d.ts.map +1 -1
  27. package/dist/commands/ledger-v3.js +71 -2
  28. package/dist/commands/qa-record.d.ts +144 -0
  29. package/dist/commands/qa-record.d.ts.map +1 -0
  30. package/dist/commands/qa-record.js +0 -0
  31. package/dist/commands/qa-run.d.ts +8 -0
  32. package/dist/commands/qa-run.d.ts.map +1 -0
  33. package/dist/commands/qa-run.js +396 -0
  34. package/dist/commands/qa-status.d.ts +71 -0
  35. package/dist/commands/qa-status.d.ts.map +1 -0
  36. package/dist/commands/qa-status.js +490 -0
  37. package/dist/commands/qa-verify.d.ts +40 -0
  38. package/dist/commands/qa-verify.d.ts.map +1 -0
  39. package/dist/commands/qa-verify.js +180 -0
  40. package/dist/commands/resources.d.ts +4 -0
  41. package/dist/commands/resources.d.ts.map +1 -0
  42. package/dist/commands/resources.js +29 -0
  43. package/dist/commands/review-pack.d.ts +4 -0
  44. package/dist/commands/review-pack.d.ts.map +1 -0
  45. package/dist/commands/review-pack.js +1001 -0
  46. package/dist/commands/supervisor.d.ts +4 -0
  47. package/dist/commands/supervisor.d.ts.map +1 -0
  48. package/dist/commands/supervisor.js +101 -0
  49. package/dist/commands/web.d.ts.map +1 -1
  50. package/dist/commands/web.js +17 -0
  51. package/dist/commands/workflow.d.ts.map +1 -1
  52. package/dist/commands/workflow.js +4 -0
  53. package/dist/core/agents/cli.js +7 -3
  54. package/dist/core/agents/health.d.ts +17 -0
  55. package/dist/core/agents/health.d.ts.map +1 -0
  56. package/dist/core/agents/health.js +109 -0
  57. package/dist/core/agents/mailbox.d.ts +92 -0
  58. package/dist/core/agents/mailbox.d.ts.map +1 -0
  59. package/dist/core/agents/mailbox.js +325 -0
  60. package/dist/core/agents/qa-signal.d.ts +111 -0
  61. package/dist/core/agents/qa-signal.d.ts.map +1 -0
  62. package/dist/core/agents/qa-signal.js +231 -0
  63. package/dist/core/agents/reconcile-coordination-v3.d.ts +44 -0
  64. package/dist/core/agents/reconcile-coordination-v3.d.ts.map +1 -0
  65. package/dist/core/agents/reconcile-coordination-v3.js +58 -0
  66. package/dist/core/agents/render/prompt-context.d.ts +5 -0
  67. package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
  68. package/dist/core/agents/render/prompt-context.js +34 -13
  69. package/dist/core/agents/render/session-context.d.ts +8 -0
  70. package/dist/core/agents/render/session-context.d.ts.map +1 -1
  71. package/dist/core/agents/render/session-context.js +34 -3
  72. package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -1
  73. package/dist/core/agents/rules/commit-conflict.js +50 -1
  74. package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
  75. package/dist/core/agents/rules/stop-hook.js +6 -10
  76. package/dist/core/agents/session-finalizer-v3.js +4 -1
  77. package/dist/core/agents/session-name-display.d.ts +20 -5
  78. package/dist/core/agents/session-name-display.d.ts.map +1 -1
  79. package/dist/core/agents/session-name-display.js +67 -7
  80. package/dist/core/agents/state/heartbeat-reader.d.ts +7 -0
  81. package/dist/core/agents/state/heartbeat-reader.d.ts.map +1 -1
  82. package/dist/core/agents/state/heartbeat-writer.d.ts +11 -0
  83. package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
  84. package/dist/core/agents/state/heartbeat-writer.js +17 -0
  85. package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -1
  86. package/dist/core/agents/state/live-coordination-view.js +1 -0
  87. package/dist/core/agents/state/live-coordination-writer.js +5 -0
  88. package/dist/core/artifacts/constants.d.ts +1 -1
  89. package/dist/core/artifacts/constants.js +1 -1
  90. package/dist/core/artifacts/index.d.ts +82 -6
  91. package/dist/core/artifacts/index.d.ts.map +1 -1
  92. package/dist/core/artifacts/index.js +410 -15
  93. package/dist/core/config.d.ts +20 -0
  94. package/dist/core/config.d.ts.map +1 -1
  95. package/dist/core/config.js +59 -0
  96. package/dist/core/diagnostics/advice.d.ts +9 -0
  97. package/dist/core/diagnostics/advice.d.ts.map +1 -0
  98. package/dist/core/diagnostics/advice.js +112 -0
  99. package/dist/core/diagnostics/bundle.d.ts +51 -0
  100. package/dist/core/diagnostics/bundle.d.ts.map +1 -0
  101. package/dist/core/diagnostics/bundle.js +968 -0
  102. package/dist/core/diagnostics/comparison.d.ts +5 -0
  103. package/dist/core/diagnostics/comparison.d.ts.map +1 -0
  104. package/dist/core/diagnostics/comparison.js +444 -0
  105. package/dist/core/diagnostics/contract.d.ts +245 -0
  106. package/dist/core/diagnostics/contract.d.ts.map +1 -0
  107. package/dist/core/diagnostics/contract.js +18 -0
  108. package/dist/core/diagnostics/identity.d.ts +3 -0
  109. package/dist/core/diagnostics/identity.d.ts.map +1 -0
  110. package/dist/core/diagnostics/identity.js +10 -0
  111. package/dist/core/diagnostics/index.d.ts +8 -0
  112. package/dist/core/diagnostics/index.d.ts.map +1 -0
  113. package/dist/core/diagnostics/index.js +7 -0
  114. package/dist/core/diagnostics/replay.d.ts +8 -0
  115. package/dist/core/diagnostics/replay.d.ts.map +1 -0
  116. package/dist/core/diagnostics/replay.js +213 -0
  117. package/dist/core/diagnostics/sanitize.d.ts +9 -0
  118. package/dist/core/diagnostics/sanitize.d.ts.map +1 -0
  119. package/dist/core/diagnostics/sanitize.js +84 -0
  120. package/dist/core/events/legacy-storage/compression.d.ts +13 -0
  121. package/dist/core/events/legacy-storage/compression.d.ts.map +1 -0
  122. package/dist/core/events/legacy-storage/compression.js +107 -0
  123. package/dist/core/events/legacy-storage/index.d.ts +1 -0
  124. package/dist/core/events/legacy-storage/index.d.ts.map +1 -1
  125. package/dist/core/events/legacy-storage/index.js +1 -0
  126. package/dist/core/events/v3/archive-retention.d.ts +33 -0
  127. package/dist/core/events/v3/archive-retention.d.ts.map +1 -0
  128. package/dist/core/events/v3/archive-retention.js +195 -0
  129. package/dist/core/events/v3/bootstrap.d.ts.map +1 -1
  130. package/dist/core/events/v3/bootstrap.js +10 -0
  131. package/dist/core/events/v3/capabilities.d.ts +1 -1
  132. package/dist/core/events/v3/capabilities.d.ts.map +1 -1
  133. package/dist/core/events/v3/capabilities.js +1 -0
  134. package/dist/core/events/v3/coordination-view.d.ts +3 -0
  135. package/dist/core/events/v3/coordination-view.d.ts.map +1 -1
  136. package/dist/core/events/v3/coordination-view.js +69 -8
  137. package/dist/core/events/v3/index.d.ts +1 -0
  138. package/dist/core/events/v3/index.d.ts.map +1 -1
  139. package/dist/core/events/v3/index.js +1 -0
  140. package/dist/core/events/v3/live-routing.d.ts.map +1 -1
  141. package/dist/core/events/v3/live-routing.js +1 -0
  142. package/dist/core/events/v3/producers/hook-base.d.ts +1 -1
  143. package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -1
  144. package/dist/core/events/v3/producers/hook-base.js +13 -2
  145. package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
  146. package/dist/core/events/v3/producers/intake.js +10 -2
  147. package/dist/core/events/v3/producers/recorder.d.ts +39 -0
  148. package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
  149. package/dist/core/events/v3/producers/recorder.js +350 -17
  150. package/dist/core/hooks/adapter/output.d.ts +8 -0
  151. package/dist/core/hooks/adapter/output.d.ts.map +1 -1
  152. package/dist/core/hooks/adapter/output.js +11 -1
  153. package/dist/core/hooks/cli.js +303 -219
  154. package/dist/core/hooks/health.d.ts +59 -0
  155. package/dist/core/hooks/health.d.ts.map +1 -0
  156. package/dist/core/hooks/health.js +84 -0
  157. package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
  158. package/dist/core/hooks/resolve/transcript.js +10 -3
  159. package/dist/core/hooks/session-name-presence.d.ts.map +1 -1
  160. package/dist/core/hooks/session-name-presence.js +4 -1
  161. package/dist/core/qa-artifacts.d.ts +20 -0
  162. package/dist/core/qa-artifacts.d.ts.map +1 -0
  163. package/dist/core/qa-artifacts.js +110 -0
  164. package/dist/core/resources/contract.d.ts +96 -0
  165. package/dist/core/resources/contract.d.ts.map +1 -0
  166. package/dist/core/resources/contract.js +2 -0
  167. package/dist/core/resources/index.d.ts +6 -0
  168. package/dist/core/resources/index.d.ts.map +1 -0
  169. package/dist/core/resources/index.js +5 -0
  170. package/dist/core/resources/sampler.d.ts +34 -0
  171. package/dist/core/resources/sampler.d.ts.map +1 -0
  172. package/dist/core/resources/sampler.js +458 -0
  173. package/dist/core/resources/service-status.d.ts +3 -0
  174. package/dist/core/resources/service-status.d.ts.map +1 -0
  175. package/dist/core/resources/service-status.js +48 -0
  176. package/dist/core/resources/service.d.ts +26 -0
  177. package/dist/core/resources/service.d.ts.map +1 -0
  178. package/dist/core/resources/service.js +292 -0
  179. package/dist/core/resources/storage.d.ts +13 -0
  180. package/dist/core/resources/storage.d.ts.map +1 -0
  181. package/dist/core/resources/storage.js +30 -0
  182. package/dist/core/storage/atomic-json.d.ts +3 -0
  183. package/dist/core/storage/atomic-json.d.ts.map +1 -0
  184. package/dist/core/storage/atomic-json.js +15 -0
  185. package/dist/core/storage/builtins.d.ts.map +1 -1
  186. package/dist/core/storage/builtins.js +45 -6
  187. package/dist/core/storage/logger.d.ts +2 -0
  188. package/dist/core/storage/logger.d.ts.map +1 -1
  189. package/dist/core/storage/logger.js +2 -0
  190. package/dist/core/storage/query.d.ts +14 -0
  191. package/dist/core/storage/query.d.ts.map +1 -1
  192. package/dist/core/storage/query.js +51 -0
  193. package/dist/core/supervisor/activity.d.ts +4 -0
  194. package/dist/core/supervisor/activity.d.ts.map +1 -0
  195. package/dist/core/supervisor/activity.js +141 -0
  196. package/dist/core/supervisor/contract.d.ts +268 -0
  197. package/dist/core/supervisor/contract.d.ts.map +1 -0
  198. package/dist/core/supervisor/contract.js +35 -0
  199. package/dist/core/supervisor/explanations.d.ts +4 -0
  200. package/dist/core/supervisor/explanations.d.ts.map +1 -0
  201. package/dist/core/supervisor/explanations.js +71 -0
  202. package/dist/core/supervisor/findings.d.ts +20 -0
  203. package/dist/core/supervisor/findings.d.ts.map +1 -0
  204. package/dist/core/supervisor/findings.js +399 -0
  205. package/dist/core/supervisor/history.d.ts +9 -0
  206. package/dist/core/supervisor/history.d.ts.map +1 -0
  207. package/dist/core/supervisor/history.js +46 -0
  208. package/dist/core/supervisor/hook-health-alerts.d.ts +14 -0
  209. package/dist/core/supervisor/hook-health-alerts.d.ts.map +1 -0
  210. package/dist/core/supervisor/hook-health-alerts.js +70 -0
  211. package/dist/core/supervisor/hook-health-storage.d.ts +5 -0
  212. package/dist/core/supervisor/hook-health-storage.d.ts.map +1 -0
  213. package/dist/core/supervisor/hook-health-storage.js +24 -0
  214. package/dist/core/supervisor/hook-health.d.ts +72 -0
  215. package/dist/core/supervisor/hook-health.d.ts.map +1 -0
  216. package/dist/core/supervisor/hook-health.js +203 -0
  217. package/dist/core/supervisor/hooks.d.ts +10 -0
  218. package/dist/core/supervisor/hooks.d.ts.map +1 -0
  219. package/dist/core/supervisor/hooks.js +28 -0
  220. package/dist/core/supervisor/index.d.ts +15 -0
  221. package/dist/core/supervisor/index.d.ts.map +1 -0
  222. package/dist/core/supervisor/index.js +14 -0
  223. package/dist/core/supervisor/log-feed.d.ts +9 -0
  224. package/dist/core/supervisor/log-feed.d.ts.map +1 -0
  225. package/dist/core/supervisor/log-feed.js +103 -0
  226. package/dist/core/supervisor/service.d.ts +29 -0
  227. package/dist/core/supervisor/service.d.ts.map +1 -0
  228. package/dist/core/supervisor/service.js +450 -0
  229. package/dist/core/supervisor/services.d.ts +11 -0
  230. package/dist/core/supervisor/services.d.ts.map +1 -0
  231. package/dist/core/supervisor/services.js +155 -0
  232. package/dist/core/supervisor/status.d.ts +3 -0
  233. package/dist/core/supervisor/status.d.ts.map +1 -0
  234. package/dist/core/supervisor/status.js +48 -0
  235. package/dist/core/supervisor/storage.d.ts +30 -0
  236. package/dist/core/supervisor/storage.d.ts.map +1 -0
  237. package/dist/core/supervisor/storage.js +73 -0
  238. package/dist/core/supervisor/timeline.d.ts +3 -0
  239. package/dist/core/supervisor/timeline.d.ts.map +1 -0
  240. package/dist/core/supervisor/timeline.js +87 -0
  241. package/dist/core/workflow/admission.d.ts +23 -0
  242. package/dist/core/workflow/admission.d.ts.map +1 -0
  243. package/dist/core/workflow/admission.js +136 -0
  244. package/dist/core/workflow/engine.d.ts.map +1 -1
  245. package/dist/core/workflow/engine.js +77 -2
  246. package/dist/core/workflow/index.d.ts +3 -2
  247. package/dist/core/workflow/index.d.ts.map +1 -1
  248. package/dist/core/workflow/index.js +2 -1
  249. package/dist/core/workflow/proof.d.ts +2 -1
  250. package/dist/core/workflow/proof.d.ts.map +1 -1
  251. package/dist/core/workflow/proof.js +39 -1
  252. package/dist/core/workflow/run-state.d.ts +3 -2
  253. package/dist/core/workflow/run-state.d.ts.map +1 -1
  254. package/dist/core/workflow/run-state.js +8 -1
  255. package/dist/core/workflow/types.d.ts +33 -1
  256. package/dist/core/workflow/types.d.ts.map +1 -1
  257. package/dist/core/workflow/types.js +2 -1
  258. package/dist/lib/admission.d.ts +71 -0
  259. package/dist/lib/admission.d.ts.map +1 -0
  260. package/dist/lib/admission.js +264 -0
  261. package/dist/lib/agent-browser/client.d.ts +1 -1
  262. package/dist/lib/agent-browser/client.d.ts.map +1 -1
  263. package/dist/lib/agent-browser/client.js +1 -5
  264. package/dist/lib/browser/capture-fidelity.d.ts +39 -0
  265. package/dist/lib/browser/capture-fidelity.d.ts.map +1 -0
  266. package/dist/lib/browser/capture-fidelity.js +84 -0
  267. package/dist/lib/browser/client.d.ts +46 -1
  268. package/dist/lib/browser/client.d.ts.map +1 -1
  269. package/dist/lib/browser/client.js +168 -9
  270. package/dist/lib/browser/critique.d.ts +38 -1
  271. package/dist/lib/browser/critique.d.ts.map +1 -1
  272. package/dist/lib/browser/critique.js +34 -6
  273. package/dist/lib/browser/index.d.ts +5 -1
  274. package/dist/lib/browser/index.d.ts.map +1 -1
  275. package/dist/lib/browser/index.js +4 -0
  276. package/dist/lib/browser/page-review-judge.d.ts +64 -0
  277. package/dist/lib/browser/page-review-judge.d.ts.map +1 -0
  278. package/dist/lib/browser/page-review-judge.js +270 -0
  279. package/dist/lib/browser/page-review-pack.d.ts +613 -0
  280. package/dist/lib/browser/page-review-pack.d.ts.map +1 -0
  281. package/dist/lib/browser/page-review-pack.js +1751 -0
  282. package/dist/lib/browser/qa-run-contracts.d.ts +377 -0
  283. package/dist/lib/browser/qa-run-contracts.d.ts.map +1 -0
  284. package/dist/lib/browser/qa-run-contracts.js +361 -0
  285. package/dist/lib/browser/qa-run.d.ts +141 -0
  286. package/dist/lib/browser/qa-run.d.ts.map +1 -0
  287. package/dist/lib/browser/qa-run.js +1283 -0
  288. package/dist/lib/browser/request-diagnostics.d.ts +13 -0
  289. package/dist/lib/browser/request-diagnostics.d.ts.map +1 -0
  290. package/dist/lib/browser/request-diagnostics.js +18 -0
  291. package/dist/lib/browser/tiling.d.ts +19 -0
  292. package/dist/lib/browser/tiling.d.ts.map +1 -1
  293. package/dist/lib/browser/tiling.js +28 -0
  294. package/dist/lib/cookies/client.d.ts +9 -0
  295. package/dist/lib/cookies/client.d.ts.map +1 -1
  296. package/dist/lib/cookies/client.js +197 -44
  297. package/dist/lib/cookies/extra.d.ts +18 -0
  298. package/dist/lib/cookies/extra.d.ts.map +1 -0
  299. package/dist/lib/cookies/extra.js +14 -0
  300. package/dist/lib/cookies/index.d.ts +2 -1
  301. package/dist/lib/cookies/index.d.ts.map +1 -1
  302. package/dist/lib/cookies/index.js +2 -1
  303. package/dist/lib/coord-root-id.d.ts +9 -0
  304. package/dist/lib/coord-root-id.d.ts.map +1 -0
  305. package/dist/lib/coord-root-id.js +17 -0
  306. package/dist/lib/durable-job.d.ts +124 -0
  307. package/dist/lib/durable-job.d.ts.map +1 -0
  308. package/dist/lib/durable-job.js +296 -0
  309. package/dist/lib/http/client.d.ts +7 -1
  310. package/dist/lib/http/client.d.ts.map +1 -1
  311. package/dist/lib/http/client.js +2 -0
  312. package/dist/lib/instructions/apply.d.ts +3 -1
  313. package/dist/lib/instructions/apply.d.ts.map +1 -1
  314. package/dist/lib/instructions/apply.js +74 -3
  315. package/dist/lib/instructions/templates.d.ts.map +1 -1
  316. package/dist/lib/instructions/templates.js +11 -2
  317. package/package.json +19 -2
  318. package/src/commander.ts +75 -1
  319. package/src/commands/admission.ts +699 -0
  320. package/src/commands/agents.ts +189 -50
  321. package/src/commands/artifacts.ts +132 -18
  322. package/src/commands/browse-ai.ts +10 -5
  323. package/src/commands/browse.ts +496 -20
  324. package/src/commands/diagnostics.ts +271 -0
  325. package/src/commands/fetch.ts +1 -0
  326. package/src/commands/files.ts +102 -2
  327. package/src/commands/governor.ts +8 -0
  328. package/src/commands/ledger-v3.ts +82 -0
  329. package/src/commands/qa-record.ts +682 -0
  330. package/src/commands/qa-run.ts +503 -0
  331. package/src/commands/qa-status.ts +608 -0
  332. package/src/commands/qa-verify.ts +238 -0
  333. package/src/commands/resources.ts +38 -0
  334. package/src/commands/review-pack.ts +1281 -0
  335. package/src/commands/supervisor.ts +141 -0
  336. package/src/commands/web.ts +19 -0
  337. package/src/commands/workflow.ts +8 -0
  338. package/src/core/agents/cli.ts +7 -3
  339. package/src/core/agents/health.ts +142 -0
  340. package/src/core/agents/mailbox.ts +373 -0
  341. package/src/core/agents/qa-signal.ts +261 -0
  342. package/src/core/agents/reconcile-coordination-v3.ts +77 -0
  343. package/src/core/agents/render/prompt-context.ts +42 -12
  344. package/src/core/agents/render/session-context.ts +37 -3
  345. package/src/core/agents/rules/commit-conflict.ts +58 -1
  346. package/src/core/agents/rules/stop-hook.ts +6 -12
  347. package/src/core/agents/session-finalizer-v3.ts +4 -1
  348. package/src/core/agents/session-name-display.ts +78 -7
  349. package/src/core/agents/state/heartbeat-reader.ts +7 -0
  350. package/src/core/agents/state/heartbeat-writer.ts +23 -0
  351. package/src/core/agents/state/live-coordination-view.ts +1 -0
  352. package/src/core/agents/state/live-coordination-writer.ts +5 -0
  353. package/src/core/artifacts/constants.ts +1 -1
  354. package/src/core/artifacts/index.ts +565 -30
  355. package/src/core/config.ts +134 -2
  356. package/src/core/diagnostics/advice.ts +147 -0
  357. package/src/core/diagnostics/bundle.ts +1250 -0
  358. package/src/core/diagnostics/comparison.ts +565 -0
  359. package/src/core/diagnostics/contract.ts +311 -0
  360. package/src/core/diagnostics/identity.ts +11 -0
  361. package/src/core/diagnostics/index.ts +7 -0
  362. package/src/core/diagnostics/replay.ts +314 -0
  363. package/src/core/diagnostics/sanitize.ts +97 -0
  364. package/src/core/events/legacy-storage/compression.ts +130 -0
  365. package/src/core/events/legacy-storage/index.ts +1 -0
  366. package/src/core/events/v3/archive-retention.ts +251 -0
  367. package/src/core/events/v3/bootstrap.ts +10 -0
  368. package/src/core/events/v3/capabilities.ts +2 -0
  369. package/src/core/events/v3/coordination-view.ts +100 -11
  370. package/src/core/events/v3/index.ts +9 -0
  371. package/src/core/events/v3/live-routing.ts +1 -0
  372. package/src/core/events/v3/producers/hook-base.ts +14 -2
  373. package/src/core/events/v3/producers/intake.ts +10 -2
  374. package/src/core/events/v3/producers/recorder.ts +420 -17
  375. package/src/core/hooks/adapter/output.ts +12 -1
  376. package/src/core/hooks/cli.ts +332 -247
  377. package/src/core/hooks/health.ts +146 -0
  378. package/src/core/hooks/resolve/transcript.ts +10 -3
  379. package/src/core/hooks/session-name-presence.ts +6 -1
  380. package/src/core/qa-artifacts.ts +126 -0
  381. package/src/core/resources/contract.ts +105 -0
  382. package/src/core/resources/index.ts +5 -0
  383. package/src/core/resources/sampler.ts +590 -0
  384. package/src/core/resources/service-status.ts +62 -0
  385. package/src/core/resources/service.ts +337 -0
  386. package/src/core/resources/storage.ts +44 -0
  387. package/src/core/storage/atomic-json.ts +15 -0
  388. package/src/core/storage/builtins.ts +62 -6
  389. package/src/core/storage/logger.ts +2 -0
  390. package/src/core/storage/query.ts +58 -0
  391. package/src/core/supervisor/activity.ts +193 -0
  392. package/src/core/supervisor/contract.ts +312 -0
  393. package/src/core/supervisor/explanations.ts +104 -0
  394. package/src/core/supervisor/findings.ts +788 -0
  395. package/src/core/supervisor/history.ts +61 -0
  396. package/src/core/supervisor/hook-health-alerts.ts +108 -0
  397. package/src/core/supervisor/hook-health-storage.ts +25 -0
  398. package/src/core/supervisor/hook-health.ts +301 -0
  399. package/src/core/supervisor/hooks.ts +35 -0
  400. package/src/core/supervisor/index.ts +14 -0
  401. package/src/core/supervisor/log-feed.ts +131 -0
  402. package/src/core/supervisor/service.ts +511 -0
  403. package/src/core/supervisor/services.ts +203 -0
  404. package/src/core/supervisor/status.ts +59 -0
  405. package/src/core/supervisor/storage.ts +126 -0
  406. package/src/core/supervisor/timeline.ts +133 -0
  407. package/src/core/workflow/admission.ts +215 -0
  408. package/src/core/workflow/engine.ts +93 -1
  409. package/src/core/workflow/index.ts +10 -0
  410. package/src/core/workflow/proof.ts +54 -1
  411. package/src/core/workflow/run-state.ts +13 -1
  412. package/src/core/workflow/types.ts +39 -1
  413. package/src/lib/admission.ts +347 -0
  414. package/src/lib/agent-browser/client.ts +2 -10
  415. package/src/lib/browser/capture-fidelity.ts +98 -0
  416. package/src/lib/browser/client.ts +212 -10
  417. package/src/lib/browser/critique.ts +62 -7
  418. package/src/lib/browser/index.ts +65 -0
  419. package/src/lib/browser/page-review-judge.ts +360 -0
  420. package/src/lib/browser/page-review-pack.ts +2384 -0
  421. package/src/lib/browser/qa-run-contracts.ts +743 -0
  422. package/src/lib/browser/qa-run.ts +1462 -0
  423. package/src/lib/browser/request-diagnostics.ts +27 -0
  424. package/src/lib/browser/tiling.ts +32 -0
  425. package/src/lib/cookies/client.ts +228 -42
  426. package/src/lib/cookies/extra.ts +28 -0
  427. package/src/lib/cookies/index.ts +2 -0
  428. package/src/lib/coord-root-id.ts +23 -0
  429. package/src/lib/durable-job.ts +407 -0
  430. package/src/lib/http/client.ts +13 -1
  431. package/src/lib/instructions/apply.ts +81 -2
  432. package/src/lib/instructions/templates.ts +11 -2
@@ -1,6 +1,5 @@
1
1
  import { spawnSync } from "node:child_process";
2
2
  import { writeFileSync } from "node:fs";
3
- import { mergeCookies, } from "../cookies/index.js";
4
3
  const DEFAULT_TIMEOUT_MS = 60_000;
5
4
  export class AgentBrowser {
6
5
  opts;
@@ -154,10 +153,7 @@ export class AgentBrowser {
154
153
  const cookies = parsed.data?.cookies ?? parsed.cookies ?? [];
155
154
  if (!Array.isArray(cookies) || cookies.length === 0)
156
155
  return { saved: 0 };
157
- const jar = this.opts.jar;
158
- const store = jar.load();
159
- const merged = mergeCookies(store, cookies);
160
- jar.save(merged);
156
+ this.opts.jar.merge(cookies);
161
157
  return { saved: cookies.length };
162
158
  }
163
159
  catch {
@@ -0,0 +1,39 @@
1
+ import { PNG } from "pngjs";
2
+ import type { PageReviewCaptureFidelity } from "./page-review-pack.js";
3
+ /** The band-diff reuse threshold doubles as the fidelity threshold: a probe
4
+ * that would count as "unchanged" for reuse counts as "agrees" here. */
5
+ export declare const CAPTURE_FIDELITY_MISMATCH_THRESHOLD = 0.001;
6
+ export type FidelityProbe = PageReviewCaptureFidelity["probed"][number];
7
+ /**
8
+ * Pixel-compare a band cropped from the full-page screenshot with the same
9
+ * band captured by scrolling. `mismatch_ratio` is measured over the area the
10
+ * two images share (pixelmatch, anti-aliasing tolerant, the same math as
11
+ * band-diff reuse). `size_mismatch` is set when the two differ by more than a
12
+ * rounding pixel in either dimension; the caller treats that probe as
13
+ * inconclusive rather than as proof the full page is wrong, because a page
14
+ * wider than the viewport cannot be rendered whole by scrolling.
15
+ */
16
+ export declare function compareBand(fullPageCrop: PNG, scrolledCapture: PNG, threshold?: number): {
17
+ mismatch_ratio: number;
18
+ exceeds: boolean;
19
+ size_mismatch: boolean;
20
+ };
21
+ /**
22
+ * Turn the probe results into the record the context carries. Any probe over
23
+ * the threshold means the full-page screenshot is not trustworthy for this
24
+ * context and the tiles must come from scrolled captures.
25
+ */
26
+ export declare function decideFidelity(probes: readonly FidelityProbe[], threshold?: number): PageReviewCaptureFidelity;
27
+ /**
28
+ * Join PNG pieces top to bottom into one image. The output takes the first
29
+ * piece's width; a narrower piece leaves transparent pixels on its right, a
30
+ * wider one is cropped. Used to assemble a band taller than the viewport from
31
+ * viewport-height captures (see `Browser.captureRegionByScroll`).
32
+ */
33
+ export declare function stitchPngRows(pieces: readonly Buffer[]): Buffer;
34
+ /** Width and height from a PNG header, without decoding the image. */
35
+ export declare function pngDimensions(buffer: Buffer): {
36
+ width: number;
37
+ height: number;
38
+ };
39
+ //# sourceMappingURL=capture-fidelity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-fidelity.d.ts","sourceRoot":"","sources":["../../../src/lib/browser/capture-fidelity.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAGvE;wEACwE;AACxE,eAAO,MAAM,mCAAmC,QAA+B,CAAC;AAEhF,MAAM,MAAM,aAAa,GAAG,yBAAyB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,GAAG,EACjB,eAAe,EAAE,GAAG,EACpB,SAAS,GAAE,MAA4C,GACtD;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAStE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,SAAS,GAAE,MAA4C,GACtD,yBAAyB,CAU3B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAkB/D;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAE/E"}
@@ -0,0 +1,84 @@
1
+ // Capture-fidelity probe for page review packs (pure: no browser, no src/core).
2
+ //
3
+ // A full-page screenshot of a very tall page can carry raster artifacts (a
4
+ // blank block, a callout clipped mid-sentence) that a viewport render of the
5
+ // same region does not show. While the capture browser is still open, the
6
+ // capture branch re-shoots every band by scroll-and-clip and pixel compares
7
+ // each with the crop the tiler took from the full-page image. When any band
8
+ // disagrees, the tiles are re-cut from those scrolled captures and the
9
+ // context records `capture_fidelity.source = "scrolled-bands"`.
10
+ //
11
+ // This module owns the parts that need no browser: the comparison, the
12
+ // decision, and the row stitch that joins viewport-height pieces into one
13
+ // band capture. `client.ts` owns the scroll-and-clip itself.
14
+ import { PNG } from "pngjs";
15
+ import { DEFAULT_REUSE_MISMATCH_RATIO, rectMismatch } from "./qa-reuse.js";
16
+ /** The band-diff reuse threshold doubles as the fidelity threshold: a probe
17
+ * that would count as "unchanged" for reuse counts as "agrees" here. */
18
+ export const CAPTURE_FIDELITY_MISMATCH_THRESHOLD = DEFAULT_REUSE_MISMATCH_RATIO;
19
+ /**
20
+ * Pixel-compare a band cropped from the full-page screenshot with the same
21
+ * band captured by scrolling. `mismatch_ratio` is measured over the area the
22
+ * two images share (pixelmatch, anti-aliasing tolerant, the same math as
23
+ * band-diff reuse). `size_mismatch` is set when the two differ by more than a
24
+ * rounding pixel in either dimension; the caller treats that probe as
25
+ * inconclusive rather than as proof the full page is wrong, because a page
26
+ * wider than the viewport cannot be rendered whole by scrolling.
27
+ */
28
+ export function compareBand(fullPageCrop, scrolledCapture, threshold = CAPTURE_FIDELITY_MISMATCH_THRESHOLD) {
29
+ const width = Math.min(fullPageCrop.width, scrolledCapture.width);
30
+ const height = Math.min(fullPageCrop.height, scrolledCapture.height);
31
+ const size_mismatch = Math.abs(fullPageCrop.width - scrolledCapture.width) > 1 ||
32
+ Math.abs(fullPageCrop.height - scrolledCapture.height) > 1;
33
+ if (width <= 0 || height <= 0)
34
+ return { mismatch_ratio: 1, exceeds: true, size_mismatch: true };
35
+ const cmp = rectMismatch(fullPageCrop, scrolledCapture, { x: 0, y: 0, width, height });
36
+ return { mismatch_ratio: cmp.ratio, exceeds: cmp.ratio > threshold, size_mismatch };
37
+ }
38
+ /**
39
+ * Turn the probe results into the record the context carries. Any probe over
40
+ * the threshold means the full-page screenshot is not trustworthy for this
41
+ * context and the tiles must come from scrolled captures.
42
+ */
43
+ export function decideFidelity(probes, threshold = CAPTURE_FIDELITY_MISMATCH_THRESHOLD) {
44
+ const mismatched = probes
45
+ .filter((probe) => probe.mismatch_ratio > threshold)
46
+ .map((probe) => probe.tile_id);
47
+ return {
48
+ source: mismatched.length > 0 ? "scrolled-bands" : "full-page",
49
+ probed: probes.map((probe) => ({ ...probe })),
50
+ mismatched,
51
+ mismatch_threshold: threshold,
52
+ };
53
+ }
54
+ /**
55
+ * Join PNG pieces top to bottom into one image. The output takes the first
56
+ * piece's width; a narrower piece leaves transparent pixels on its right, a
57
+ * wider one is cropped. Used to assemble a band taller than the viewport from
58
+ * viewport-height captures (see `Browser.captureRegionByScroll`).
59
+ */
60
+ export function stitchPngRows(pieces) {
61
+ const first = pieces[0];
62
+ if (!first)
63
+ throw new Error("stitchPngRows: at least one piece is required");
64
+ if (pieces.length === 1)
65
+ return first;
66
+ const decoded = pieces.map((piece) => PNG.sync.read(piece));
67
+ const width = decoded[0].width;
68
+ const height = decoded.reduce((sum, piece) => sum + piece.height, 0);
69
+ const out = new PNG({ width, height });
70
+ let row = 0;
71
+ for (const piece of decoded) {
72
+ const copyWidth = Math.min(width, piece.width);
73
+ for (let y = 0; y < piece.height; y++) {
74
+ const srcStart = y * piece.width * 4;
75
+ piece.data.copy(out.data, (row + y) * width * 4, srcStart, srcStart + copyWidth * 4);
76
+ }
77
+ row += piece.height;
78
+ }
79
+ return PNG.sync.write(out);
80
+ }
81
+ /** Width and height from a PNG header, without decoding the image. */
82
+ export function pngDimensions(buffer) {
83
+ return { width: buffer.readUInt32BE(16), height: buffer.readUInt32BE(20) };
84
+ }
@@ -1,5 +1,5 @@
1
1
  import { type Page, type Cookie as PWCookie } from "playwright";
2
- import type { CookieJar } from "../cookies/index.js";
2
+ import { type CookieJar } from "../cookies/index.js";
3
3
  import { type AssertResult, type AssertSpec } from "./asserts.js";
4
4
  import { type ContentAnnotationBox, type ContentChecksRequest, type ContentChecksResult } from "./content-checks.js";
5
5
  import { type LayoutLintRequest, type LayoutLintResult } from "./geometry.js";
@@ -33,6 +33,17 @@ export interface BrowserOptions {
33
33
  width: number;
34
34
  height: number;
35
35
  };
36
+ /**
37
+ * Device scale factor (DPR) for the context. Unset keeps Playwright's
38
+ * default of 1, so screenshots are CSS-pixel sized. A higher value renders
39
+ * every screenshot at that multiple (2 doubles both dimensions).
40
+ */
41
+ deviceScaleFactor?: number;
42
+ /**
43
+ * Emulated `prefers-color-scheme` for the context. Unset keeps Playwright's
44
+ * default (light), byte-identical to prior behavior.
45
+ */
46
+ colorScheme?: "light" | "dark";
36
47
  /** Default navigation timeout in ms. Default 30000. */
37
48
  navigationTimeout?: number;
38
49
  /**
@@ -262,6 +273,40 @@ export declare class Browser {
262
273
  width: number;
263
274
  height: number;
264
275
  }): Promise<string>;
276
+ /**
277
+ * PNG of a document-space rect captured the way a reader sees it: scroll so
278
+ * the rect's top sits at the top of the viewport, wait for the scroll to
279
+ * settle (instant scroll, then rAF frames until `scrollY` stops moving),
280
+ * and clip the viewport. Restores the scroll position afterwards.
281
+ *
282
+ * Bands are taller than the viewport. Rather than resizing the viewport to
283
+ * the band height (which reflows `vh`-sized layout, moves sticky and fixed
284
+ * elements, and so stops matching what the user sees), the rect is captured
285
+ * in viewport-height pieces at the real viewport and the pieces are
286
+ * stitched with pngjs. The final piece of a multi-piece rect is anchored to
287
+ * the viewport bottom so a fixed header, which sits at the viewport top, is
288
+ * not repeated in the middle of the band. No viewport change is made.
289
+ *
290
+ * Pixels come back at the page's device scale factor, so a rect at DPR 2
291
+ * yields an image twice the rect's CSS size, the same as a full-page
292
+ * screenshot cropped in pixel space would.
293
+ *
294
+ * Parity with the full-page screenshot: a full-page capture renders the
295
+ * whole document as one viewport, so a fixed header or a stuck sticky bar
296
+ * appears once, at its document position. Scrolled, the same element would
297
+ * ride along at the top of every piece and differ from the full-page crop
298
+ * on every band but the first. So while a piece is captured at a non-zero
299
+ * scroll, every `position: fixed`/`sticky` element that has left its
300
+ * scroll-0 document position is given `visibility: hidden` (layout kept,
301
+ * inline style restored afterwards). The result is the region as a
302
+ * full-page screenshot would show it, without the full-page raster.
303
+ */
304
+ captureRegionByScroll(rect: {
305
+ x: number;
306
+ y: number;
307
+ width: number;
308
+ height: number;
309
+ }): Promise<Buffer>;
265
310
  /** Document-space rects + labels for each element matching `selector` (semantic tiling). */
266
311
  elementTiles(selector: string): Promise<Array<{
267
312
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/lib/browser/client.ts"],"names":[],"mappings":"AAI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BAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI/E,8FAA8F;IACxF,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAIhE,uEAAuE;IACjE,eAAe,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE,wCAAwC;IAClC,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9C;;;;OAIG;IACG,eAAe,CACnB,SAAS,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,EAC/B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAc9B,gEAAgE;IAC1D,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE,sCAAsC;IAChC,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjD;;;;;;OAMG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlD,2DAA2D;IACrD,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAKpC;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAoB7B"}
@@ -3,10 +3,13 @@ import { homedir } from "node:os";
3
3
  import { dirname, resolve } from "node:path";
4
4
  import axe from "axe-core";
5
5
  import { chromium, } from "playwright";
6
+ import { CookieStoreParseError, } from "../cookies/index.js";
6
7
  import { buildAssertCheck } from "./asserts.js";
8
+ import { stitchPngRows } from "./capture-fidelity.js";
7
9
  import { buildClearContentAnnotationsScript, buildContentAnnotateScript, buildContentChecks, } from "./content-checks.js";
8
10
  import { buildClearLayoutLintAnnotationsScript, buildLayoutLintAnnotateScript, buildLayoutLintCheck, } from "./geometry.js";
9
11
  import { buildClearLayoutAnnotationsScript, buildLayoutAnnotateScript, buildOverflowCheck, buildWidthCheck, } from "./layout.js";
12
+ import { isBenignNextRscAbort } from "./request-diagnostics.js";
10
13
  import { buildClearRuntsAnnotationsScript, buildRuntsAnnotateScript, buildRuntsCheck, } from "./runts.js";
11
14
  import { buildStandaloneHtmlScript, DEFAULT_MAX_RESOURCE_BYTES, DEFAULT_MAX_TOTAL_RESOURCE_BYTES, } from "./standalone-html.js";
12
15
  import { buildClearTargetSizeAnnotationsScript, buildTargetSizeAnnotateScript, buildTargetSizeCheck, } from "./target-size.js";
@@ -81,12 +84,17 @@ export class Browser {
81
84
  * the whole sequence — not just the launch — can be retried as a unit.
82
85
  */
83
86
  async openOnce() {
87
+ const jarCookies = this.opts.jar?.list() ?? [];
84
88
  // Hold a launch slot only across the spawn itself, not the browser's life.
85
89
  await acquireLaunchSlot();
86
90
  try {
87
91
  this.context = await chromium.launchPersistentContext(this.profileDir, {
88
92
  headless: !this.opts.headed,
89
93
  viewport: this.opts.viewport ?? { width: 1280, height: 800 },
94
+ ...(this.opts.deviceScaleFactor !== undefined
95
+ ? { deviceScaleFactor: this.opts.deviceScaleFactor }
96
+ : {}),
97
+ ...(this.opts.colorScheme ? { colorScheme: this.opts.colorScheme } : {}),
90
98
  ...(this.opts.launchTimeout !== undefined ? { timeout: this.opts.launchTimeout } : {}),
91
99
  ...(this.opts.launchArgs && this.opts.launchArgs.length > 0
92
100
  ? { args: this.opts.launchArgs }
@@ -101,11 +109,8 @@ export class Browser {
101
109
  releaseLaunchSlot();
102
110
  }
103
111
  this.context.setDefaultNavigationTimeout(this.opts.navigationTimeout ?? 30_000);
104
- if (this.opts.jar) {
105
- const jarCookies = this.opts.jar.list();
106
- if (jarCookies.length > 0) {
107
- await this.context.addCookies(jarCookies.map(toPWCookie));
108
- }
112
+ if (jarCookies.length > 0) {
113
+ await this.context.addCookies(jarCookies.map(toPWCookie));
109
114
  }
110
115
  // Caller-injected extraHeaders callback (e.g., for Cloudflare-bypass
111
116
  // or custom auth headers). Per-request route handler so headers only
@@ -170,6 +175,11 @@ export class Browser {
170
175
  this.consoleEvents = [];
171
176
  this.pageErrors = [];
172
177
  this.failedRequests = [];
178
+ if (err instanceof CookieStoreParseError) {
179
+ throw new Error(`Failed to open browser during cookie-store load: ${err.message}`, {
180
+ cause: err,
181
+ });
182
+ }
173
183
  if (attempt < maxAttempts) {
174
184
  await new Promise((resolve) => setTimeout(resolve, attempt * 250));
175
185
  }
@@ -196,11 +206,16 @@ export class Browser {
196
206
  this.pageErrors.push({ message: err.message, stack: err.stack });
197
207
  });
198
208
  page.on("requestfailed", (req) => {
199
- this.failedRequests.push({
209
+ const failedRequest = {
200
210
  url: req.url(),
201
211
  method: req.method(),
202
212
  failure: req.failure()?.errorText ?? "unknown",
203
213
  resourceType: req.resourceType(),
214
+ };
215
+ if (isBenignNextRscAbort(failedRequest))
216
+ return;
217
+ this.failedRequests.push({
218
+ ...failedRequest,
204
219
  status: null,
205
220
  kind: "network",
206
221
  });
@@ -356,6 +371,152 @@ export class Browser {
356
371
  const buf = await this.currentPage.screenshot({ type: "png", clip: rect });
357
372
  return buf.toString("base64");
358
373
  }
374
+ /**
375
+ * PNG of a document-space rect captured the way a reader sees it: scroll so
376
+ * the rect's top sits at the top of the viewport, wait for the scroll to
377
+ * settle (instant scroll, then rAF frames until `scrollY` stops moving),
378
+ * and clip the viewport. Restores the scroll position afterwards.
379
+ *
380
+ * Bands are taller than the viewport. Rather than resizing the viewport to
381
+ * the band height (which reflows `vh`-sized layout, moves sticky and fixed
382
+ * elements, and so stops matching what the user sees), the rect is captured
383
+ * in viewport-height pieces at the real viewport and the pieces are
384
+ * stitched with pngjs. The final piece of a multi-piece rect is anchored to
385
+ * the viewport bottom so a fixed header, which sits at the viewport top, is
386
+ * not repeated in the middle of the band. No viewport change is made.
387
+ *
388
+ * Pixels come back at the page's device scale factor, so a rect at DPR 2
389
+ * yields an image twice the rect's CSS size, the same as a full-page
390
+ * screenshot cropped in pixel space would.
391
+ *
392
+ * Parity with the full-page screenshot: a full-page capture renders the
393
+ * whole document as one viewport, so a fixed header or a stuck sticky bar
394
+ * appears once, at its document position. Scrolled, the same element would
395
+ * ride along at the top of every piece and differ from the full-page crop
396
+ * on every band but the first. So while a piece is captured at a non-zero
397
+ * scroll, every `position: fixed`/`sticky` element that has left its
398
+ * scroll-0 document position is given `visibility: hidden` (layout kept,
399
+ * inline style restored afterwards). The result is the region as a
400
+ * full-page screenshot would show it, without the full-page raster.
401
+ */
402
+ async captureRegionByScroll(rect) {
403
+ const page = this.currentPage;
404
+ if (!(rect.width > 0) || !(rect.height > 0)) {
405
+ throw new Error(`captureRegionByScroll: rect must have a positive size (got ${rect.width}×${rect.height})`);
406
+ }
407
+ const settle = (top) => page.evaluate(async (target) => {
408
+ window.scrollTo({ left: window.scrollX, top: target, behavior: "instant" });
409
+ const frame = () => new Promise((r) => requestAnimationFrame(() => r()));
410
+ let last = Number.NaN;
411
+ for (let i = 0; i < 8; i++) {
412
+ await frame();
413
+ const now = window.scrollY;
414
+ if (now === last)
415
+ break;
416
+ last = now;
417
+ }
418
+ return {
419
+ scrollX: window.scrollX,
420
+ scrollY: window.scrollY,
421
+ innerWidth: window.innerWidth,
422
+ innerHeight: window.innerHeight,
423
+ };
424
+ }, top);
425
+ const original = await page.evaluate(() => ({ x: window.scrollX, y: window.scrollY }));
426
+ const pieces = [];
427
+ // Viewport-pinned candidates, measured at scroll 0 so each later capture
428
+ // can tell "still where the full page shows it" from "riding along".
429
+ await settle(0);
430
+ // Hiding uses opacity, not visibility: `visibility: hidden` on the pinned
431
+ // element is undone by any descendant that sets `visibility: visible`
432
+ // (a revealed brand label inside a sticky bar did exactly that), while
433
+ // opacity is a group effect no descendant can override. Transitions are
434
+ // switched off inline so the capture never lands mid-fade.
435
+ const pinned = await page.evaluateHandle(() => {
436
+ const out = [];
437
+ const all = document.querySelectorAll("body *");
438
+ const limit = Math.min(all.length, 20_000);
439
+ for (let i = 0; i < limit; i++) {
440
+ const el = all[i];
441
+ const position = getComputedStyle(el).position;
442
+ if (position !== "fixed" && position !== "sticky")
443
+ continue;
444
+ out.push({
445
+ el,
446
+ top: el.getBoundingClientRect().top + window.scrollY,
447
+ priorOpacity: el.style.getPropertyValue("opacity"),
448
+ priorOpacityPriority: el.style.getPropertyPriority("opacity"),
449
+ priorTransition: el.style.getPropertyValue("transition"),
450
+ priorTransitionPriority: el.style.getPropertyPriority("transition"),
451
+ });
452
+ }
453
+ return out;
454
+ });
455
+ const syncPinned = (mode) => page.evaluate(async ([entries, action]) => {
456
+ for (const entry of entries) {
457
+ const restore = () => {
458
+ entry.el.style.setProperty("opacity", entry.priorOpacity, entry.priorOpacityPriority);
459
+ entry.el.style.setProperty("transition", entry.priorTransition, entry.priorTransitionPriority);
460
+ };
461
+ if (action === "restore") {
462
+ restore();
463
+ continue;
464
+ }
465
+ const now = entry.el.getBoundingClientRect().top + window.scrollY;
466
+ if (Math.abs(now - entry.top) > 1) {
467
+ entry.el.style.setProperty("transition", "none", "important");
468
+ entry.el.style.setProperty("opacity", "0", "important");
469
+ }
470
+ else {
471
+ restore();
472
+ }
473
+ }
474
+ // Let the style change paint before the screenshot is taken.
475
+ await new Promise((r) => requestAnimationFrame(() => r()));
476
+ }, [pinned, mode]);
477
+ try {
478
+ const bottom = rect.y + rect.height;
479
+ let cursor = rect.y;
480
+ let first = true;
481
+ while (cursor < bottom) {
482
+ const remaining = bottom - cursor;
483
+ // Top-align the piece; a final partial piece is then re-anchored to
484
+ // the viewport bottom once the viewport height is known.
485
+ let view = await settle(cursor);
486
+ if (!first && remaining < view.innerHeight) {
487
+ view = await settle(Math.max(0, bottom - view.innerHeight));
488
+ }
489
+ await syncPinned("hide-moved");
490
+ const offset = cursor - view.scrollY;
491
+ if (offset < 0 || offset >= view.innerHeight) {
492
+ throw new Error(`captureRegionByScroll: document y ${cursor} is not reachable in the viewport ` +
493
+ `(scrollY ${view.scrollY}, innerHeight ${view.innerHeight})`);
494
+ }
495
+ const pieceHeight = Math.min(remaining, view.innerHeight - offset);
496
+ const clipX = Math.max(0, rect.x - view.scrollX);
497
+ const clipWidth = Math.min(rect.width, view.innerWidth - clipX);
498
+ if (!(clipWidth > 0)) {
499
+ throw new Error(`captureRegionByScroll: document x ${rect.x} is outside the viewport (innerWidth ${view.innerWidth})`);
500
+ }
501
+ pieces.push(await page.screenshot({
502
+ type: "png",
503
+ clip: { x: clipX, y: offset, width: clipWidth, height: pieceHeight },
504
+ }));
505
+ cursor += pieceHeight;
506
+ first = false;
507
+ }
508
+ }
509
+ finally {
510
+ try {
511
+ await syncPinned("restore");
512
+ }
513
+ finally {
514
+ await pinned.dispose();
515
+ await page.evaluate(({ x, y }) => window.scrollTo({ left: x, top: y, behavior: "instant" }), original);
516
+ }
517
+ }
518
+ return stitchPngRows(pieces);
519
+ }
359
520
  /** Document-space rects + labels for each element matching `selector` (semantic tiling). */
360
521
  async elementTiles(selector) {
361
522
  return await this.currentPage.evaluate((sel) => {
@@ -1229,9 +1390,7 @@ export class Browser {
1229
1390
  if (this.opts.jar) {
1230
1391
  try {
1231
1392
  const live = await this.context.cookies();
1232
- for (const c of live) {
1233
- this.opts.jar.set(toJarCookie(c));
1234
- }
1393
+ this.opts.jar.merge(live.map(toJarCookie));
1235
1394
  }
1236
1395
  catch {
1237
1396
  // Cookie persist is best-effort; never block close on it.
@@ -19,10 +19,26 @@ export interface CritiqueFinding {
19
19
  category: string;
20
20
  description: string;
21
21
  }
22
+ /**
23
+ * How much of the page the tiles actually cover. The tiler keeps at most
24
+ * `maxTiles` bands and drops the rest, so on a tall page `capped` is true and
25
+ * `reviewed_height_px` stops short of `page_height_px`. Callers that turn a
26
+ * critique into a verdict must read this: a pass over the first 24 bands is
27
+ * not a pass over the page.
28
+ */
29
+ export interface CritiqueCoverage {
30
+ page_height_px: number;
31
+ reviewed_height_px: number;
32
+ bands_total: number;
33
+ bands_reviewed: number;
34
+ capped: boolean;
35
+ }
22
36
  export interface CritiqueResult {
23
37
  rule: "critique";
24
38
  /** Number of tiles the page was cut into. */
25
39
  tiles: number;
40
+ /** Tile coverage of the page; absent only for results built without tiles. */
41
+ coverage?: CritiqueCoverage;
26
42
  /** Whether a provider was available. False → outcome "skipped". */
27
43
  provider: boolean;
28
44
  findings: CritiqueFinding[];
@@ -82,6 +98,15 @@ export declare function bandRects(pageHeight: number, pageWidth: number, bandHei
82
98
  * the provider would downscale. Atom coordinates must be in the same pixel
83
99
  * space as the screenshot (identical at deviceScaleFactor 1; scale them if
84
100
  * the capture DPR differs).
101
+ *
102
+ * `hitRects` (document-space rectangles a deterministic gate already flagged)
103
+ * add bands past the `maxTiles` cap: every full-page band that intersects a
104
+ * hit rect and was dropped by the cap is cut as well, labelled `hit band N`
105
+ * (N is the band's 1-based position in the full band list, and the tile's
106
+ * `index` is that position minus one), and appended after the kept bands.
107
+ * `coverage` stays honest about the kept prefix; `hitBands` counts the
108
+ * extras. Ignored for selector tiling (`elementRects`), which has no cap to
109
+ * look past in that sense.
85
110
  */
86
111
  export declare function tilesFromFullPage(fullPageBuffer: Buffer, opts: {
87
112
  elementRects?: Array<{
@@ -95,7 +120,19 @@ export declare function tilesFromFullPage(fullPageBuffer: Buffer, opts: {
95
120
  overlap?: number;
96
121
  maxTiles: number;
97
122
  atoms?: VisualAtom[];
98
- }): CritiqueTile[];
123
+ hitRects?: Array<{
124
+ x: number;
125
+ y: number;
126
+ width: number;
127
+ height: number;
128
+ }>;
129
+ /** Cap on hit bands appended past `maxTiles` (default 50). */
130
+ maxHitBands?: number;
131
+ }): {
132
+ tiles: CritiqueTile[];
133
+ coverage: CritiqueCoverage;
134
+ hitBands: number;
135
+ };
99
136
  /**
100
137
  * Validate + normalize a provider's raw output into CritiqueFindings. Tolerant
101
138
  * of a model returning a bare array or wrapping it in `{ findings: [...] }`,
@@ -1 +1 @@
1
- {"version":3,"file":"critique.d.ts","sourceRoot":"","sources":["../../../src/lib/browser/critique.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnF,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE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