@reticlehq/server 2.2.0 → 2.3.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 (768) hide show
  1. package/README.md +1 -1
  2. package/dist/bridge-security.d.ts +0 -1
  3. package/dist/bridge-security.js +0 -1
  4. package/dist/bridge.d.ts +0 -1
  5. package/dist/bridge.js +60 -10
  6. package/dist/bridge.test-harness.d.ts +0 -1
  7. package/dist/bridge.test-harness.js +0 -1
  8. package/dist/capsule/capsule-store.d.ts +2 -3
  9. package/dist/capsule/capsule-store.js +0 -1
  10. package/dist/capsule/capsule.d.ts +0 -1
  11. package/dist/capsule/capsule.js +0 -1
  12. package/dist/capsule/causal-summary.d.ts +21 -1
  13. package/dist/capsule/causal-summary.js +20 -2
  14. package/dist/capsule/divergence.d.ts +0 -1
  15. package/dist/capsule/divergence.js +0 -1
  16. package/dist/capsule/minimize.d.ts +0 -1
  17. package/dist/capsule/minimize.js +0 -1
  18. package/dist/capsule/predicate-to-links.d.ts +0 -1
  19. package/dist/capsule/predicate-to-links.js +0 -1
  20. package/dist/cli-doctor.d.ts +6 -0
  21. package/dist/cli-doctor.js +60 -0
  22. package/dist/cli-flow-commands.d.ts +0 -1
  23. package/dist/cli-flow-commands.js +0 -1
  24. package/dist/cli-launch.d.ts +0 -1
  25. package/dist/cli-launch.js +7 -3
  26. package/dist/cli-parse.d.ts +52 -2
  27. package/dist/cli-parse.js +147 -3
  28. package/dist/cli-port.d.ts +0 -1
  29. package/dist/cli-port.js +0 -1
  30. package/dist/cli-verify.d.ts +2 -1
  31. package/dist/cli-verify.js +24 -3
  32. package/dist/cli.d.ts +2 -4
  33. package/dist/cli.js +109 -10
  34. package/dist/cloud/cloud-config.d.ts +36 -0
  35. package/dist/cloud/cloud-config.js +86 -0
  36. package/dist/cloud/cloud-sync.d.ts +96 -4
  37. package/dist/cloud/cloud-sync.js +131 -3
  38. package/dist/cloud-cli.d.ts +3 -0
  39. package/dist/cloud-cli.js +514 -0
  40. package/dist/crawl/crawl-tools.d.ts +0 -1
  41. package/dist/crawl/crawl-tools.js +1 -2
  42. package/dist/crawl/crawl.d.ts +17 -3
  43. package/dist/crawl/crawl.js +43 -4
  44. package/dist/daemon-resilience.d.ts +6 -1
  45. package/dist/daemon-resilience.js +63 -1
  46. package/dist/daemon.d.ts +23 -3
  47. package/dist/daemon.js +78 -21
  48. package/dist/domain/domain-model.d.ts +0 -1
  49. package/dist/domain/domain-model.js +1 -2
  50. package/dist/domain/domain-tools.d.ts +0 -7
  51. package/dist/domain/domain-tools.js +21 -4
  52. package/dist/domain/flow-risk.d.ts +0 -1
  53. package/dist/domain/flow-risk.js +0 -1
  54. package/dist/ee/audit-log.d.ts +0 -1
  55. package/dist/ee/audit-log.js +0 -1
  56. package/dist/events/body-failures.d.ts +4 -0
  57. package/dist/events/body-failures.js +113 -0
  58. package/dist/events/contradictions.d.ts +53 -0
  59. package/dist/events/contradictions.js +282 -0
  60. package/dist/events/echo-mismatch.d.ts +4 -0
  61. package/dist/events/echo-mismatch.js +138 -0
  62. package/dist/events/event-filters.d.ts +17 -3
  63. package/dist/events/event-filters.js +13 -3
  64. package/dist/events/json-salvage.d.ts +32 -0
  65. package/dist/events/json-salvage.js +96 -0
  66. package/dist/events/predicate-eval.d.ts +2 -1
  67. package/dist/events/predicate-eval.js +56 -9
  68. package/dist/events/predicate.d.ts +0 -1
  69. package/dist/events/predicate.js +56 -2
  70. package/dist/events/reaction.d.ts +0 -1
  71. package/dist/events/reaction.js +0 -1
  72. package/dist/events/reconcile.d.ts +39 -0
  73. package/dist/events/reconcile.js +211 -0
  74. package/dist/events/ring-buffer.d.ts +0 -1
  75. package/dist/events/ring-buffer.js +0 -1
  76. package/dist/events/stale-response.d.ts +4 -0
  77. package/dist/events/stale-response.js +139 -0
  78. package/dist/events/unit-mismatch.d.ts +16 -0
  79. package/dist/events/unit-mismatch.js +167 -0
  80. package/dist/flows/affected-tools.d.ts +18 -0
  81. package/dist/flows/affected-tools.js +52 -0
  82. package/dist/flows/affected.d.ts +0 -1
  83. package/dist/flows/affected.js +0 -1
  84. package/dist/flows/annotate-tools.d.ts +0 -1
  85. package/dist/flows/annotate-tools.js +21 -3
  86. package/dist/flows/annotate.d.ts +0 -1
  87. package/dist/flows/annotate.js +0 -1
  88. package/dist/flows/annotation-store.d.ts +0 -1
  89. package/dist/flows/annotation-store.js +0 -1
  90. package/dist/flows/assertion-integrity.d.ts +0 -1
  91. package/dist/flows/assertion-integrity.js +0 -1
  92. package/dist/flows/assertion-tiers-store.d.ts +0 -1
  93. package/dist/flows/assertion-tiers-store.js +0 -1
  94. package/dist/flows/buddy-status.d.ts +0 -1
  95. package/dist/flows/buddy-status.js +0 -1
  96. package/dist/flows/coverage.d.ts +0 -1
  97. package/dist/flows/coverage.js +0 -1
  98. package/dist/flows/decision.d.ts +0 -1
  99. package/dist/flows/decision.js +0 -1
  100. package/dist/flows/flake-store.d.ts +0 -1
  101. package/dist/flows/flake-store.js +0 -1
  102. package/dist/flows/flake.d.ts +0 -1
  103. package/dist/flows/flake.js +0 -1
  104. package/dist/flows/flow-classify.d.ts +0 -1
  105. package/dist/flows/flow-classify.js +0 -1
  106. package/dist/flows/flow-replay-run.d.ts +0 -1
  107. package/dist/flows/flow-replay-run.js +24 -8
  108. package/dist/flows/flow-replay.d.ts +20 -4
  109. package/dist/flows/flow-replay.js +9 -43
  110. package/dist/flows/flow-report.d.ts +0 -1
  111. package/dist/flows/flow-report.js +0 -1
  112. package/dist/flows/flow-scope.d.ts +0 -1
  113. package/dist/flows/flow-scope.js +0 -1
  114. package/dist/flows/flow-sources.d.ts +0 -1
  115. package/dist/flows/flow-sources.js +0 -1
  116. package/dist/flows/flow-step-runners.d.ts +23 -0
  117. package/dist/flows/flow-step-runners.js +102 -0
  118. package/dist/flows/flow-success.d.ts +0 -1
  119. package/dist/flows/flow-success.js +0 -1
  120. package/dist/flows/flow-tools.d.ts +0 -1
  121. package/dist/flows/flow-tools.js +54 -16
  122. package/dist/flows/flows.d.ts +6 -2
  123. package/dist/flows/flows.js +15 -2
  124. package/dist/flows/gate.d.ts +0 -1
  125. package/dist/flows/gate.js +0 -1
  126. package/dist/flows/git-changed.d.ts +0 -1
  127. package/dist/flows/git-changed.js +0 -1
  128. package/dist/flows/heal-run.d.ts +0 -1
  129. package/dist/flows/heal-run.js +0 -1
  130. package/dist/flows/heal.d.ts +0 -1
  131. package/dist/flows/heal.js +0 -1
  132. package/dist/flows/parallel-suite.d.ts +0 -1
  133. package/dist/flows/parallel-suite.js +0 -1
  134. package/dist/flows/recordings.d.ts +0 -1
  135. package/dist/flows/recordings.js +0 -1
  136. package/dist/flows/replay.d.ts +0 -1
  137. package/dist/flows/replay.js +71 -4
  138. package/dist/flows/server-verify.d.ts +15 -0
  139. package/dist/flows/server-verify.js +42 -0
  140. package/dist/flows/verify-change-tools.d.ts +2 -0
  141. package/dist/flows/verify-change-tools.js +187 -0
  142. package/dist/flows/watch-batcher.d.ts +0 -1
  143. package/dist/flows/watch-batcher.js +0 -1
  144. package/dist/honesty/accepted-write.d.ts +14 -0
  145. package/dist/honesty/accepted-write.js +17 -0
  146. package/dist/honesty/blind-spots.d.ts +18 -1
  147. package/dist/honesty/blind-spots.js +47 -5
  148. package/dist/honesty/honesty.d.ts +0 -1
  149. package/dist/honesty/honesty.js +0 -1
  150. package/dist/honesty/uncaptured-bodies.d.ts +19 -0
  151. package/dist/honesty/uncaptured-bodies.js +30 -0
  152. package/dist/honesty/unread-outcome.d.ts +2 -0
  153. package/dist/honesty/unread-outcome.js +50 -0
  154. package/dist/honesty/verified.d.ts +40 -0
  155. package/dist/honesty/verified.js +86 -0
  156. package/dist/http-server.d.ts +0 -1
  157. package/dist/http-server.js +5 -1
  158. package/dist/hunt/hunt-report.d.ts +50 -0
  159. package/dist/hunt/hunt-report.js +84 -0
  160. package/dist/idle-shutdown.d.ts +0 -1
  161. package/dist/idle-shutdown.js +0 -1
  162. package/dist/index.d.ts +0 -1
  163. package/dist/index.js +0 -1
  164. package/dist/init/agent-rules.d.ts +0 -1
  165. package/dist/init/agent-rules.js +4 -2
  166. package/dist/init/cursor.d.ts +0 -1
  167. package/dist/init/cursor.js +0 -1
  168. package/dist/init/desktop-doctor.d.ts +40 -0
  169. package/dist/init/desktop-doctor.js +198 -0
  170. package/dist/init/detect.d.ts +0 -1
  171. package/dist/init/detect.js +0 -1
  172. package/dist/init/mcp.d.ts +0 -1
  173. package/dist/init/mcp.js +0 -1
  174. package/dist/init/node-io.d.ts +0 -1
  175. package/dist/init/node-io.js +0 -1
  176. package/dist/init/plan.d.ts +4 -1
  177. package/dist/init/plan.js +23 -5
  178. package/dist/init/project-id.d.ts +0 -1
  179. package/dist/init/project-id.js +0 -1
  180. package/dist/init/run.d.ts +0 -1
  181. package/dist/init/run.js +31 -3
  182. package/dist/init/snippets.d.ts +5 -1
  183. package/dist/init/snippets.js +5 -1
  184. package/dist/init/vite-config.d.ts +0 -1
  185. package/dist/init/vite-config.js +0 -1
  186. package/dist/input/network-detail.d.ts +0 -1
  187. package/dist/input/network-detail.js +0 -1
  188. package/dist/input/network-mock-tools.d.ts +0 -1
  189. package/dist/input/network-mock-tools.js +3 -4
  190. package/dist/input/network-mock.d.ts +0 -1
  191. package/dist/input/network-mock.js +0 -1
  192. package/dist/input/real-input.d.ts +14 -1
  193. package/dist/input/real-input.js +45 -3
  194. package/dist/input/scroll-find.d.ts +0 -1
  195. package/dist/input/scroll-find.js +0 -1
  196. package/dist/input/scroll-tools.d.ts +0 -1
  197. package/dist/input/scroll-tools.js +0 -1
  198. package/dist/input/viewport-tools.d.ts +0 -1
  199. package/dist/input/viewport-tools.js +3 -4
  200. package/dist/journal/ambient-store.d.ts +0 -1
  201. package/dist/journal/ambient-store.js +0 -1
  202. package/dist/journal/ambient.d.ts +0 -1
  203. package/dist/journal/ambient.js +0 -1
  204. package/dist/journal/attach-journal.d.ts +0 -1
  205. package/dist/journal/attach-journal.js +0 -1
  206. package/dist/journal/deviation-report.d.ts +0 -1
  207. package/dist/journal/deviation-report.js +0 -1
  208. package/dist/journal/deviation-service.d.ts +0 -1
  209. package/dist/journal/deviation-service.js +0 -1
  210. package/dist/journal/envelope-store.d.ts +0 -1
  211. package/dist/journal/envelope-store.js +0 -1
  212. package/dist/journal/envelope.d.ts +8 -9
  213. package/dist/journal/envelope.js +0 -1
  214. package/dist/journal/journal-query.d.ts +0 -1
  215. package/dist/journal/journal-query.js +0 -1
  216. package/dist/journal/journal-recorder.d.ts +0 -1
  217. package/dist/journal/journal-recorder.js +0 -1
  218. package/dist/journal/retention.d.ts +0 -1
  219. package/dist/journal/retention.js +0 -1
  220. package/dist/journal/rollups.d.ts +0 -1
  221. package/dist/journal/rollups.js +0 -1
  222. package/dist/journal/session-end.d.ts +0 -1
  223. package/dist/journal/session-end.js +0 -1
  224. package/dist/journal/session-journal.d.ts +0 -1
  225. package/dist/journal/session-journal.js +0 -1
  226. package/dist/license/license.d.ts +0 -1
  227. package/dist/license/license.js +0 -1
  228. package/dist/log.d.ts +0 -1
  229. package/dist/log.js +0 -1
  230. package/dist/mcp-proxy.d.ts +0 -1
  231. package/dist/mcp-proxy.js +0 -1
  232. package/dist/mcp.d.ts +15 -1
  233. package/dist/mcp.js +145 -17
  234. package/dist/oracles/flow-instrument-gaps.d.ts +0 -1
  235. package/dist/oracles/flow-instrument-gaps.js +0 -1
  236. package/dist/oracles/propose-consequences.d.ts +0 -1
  237. package/dist/oracles/propose-consequences.js +0 -1
  238. package/dist/oracles/self-instrument.d.ts +0 -1
  239. package/dist/oracles/self-instrument.js +0 -1
  240. package/dist/pairing-token.d.ts +0 -1
  241. package/dist/pairing-token.js +0 -1
  242. package/dist/phenomena/phenomena.d.ts +0 -1
  243. package/dist/phenomena/phenomena.js +0 -1
  244. package/dist/pool/browser-pool.d.ts +0 -1
  245. package/dist/pool/browser-pool.js +0 -1
  246. package/dist/pool/lease-reaper.d.ts +0 -1
  247. package/dist/pool/lease-reaper.js +0 -1
  248. package/dist/pool/playwright-launcher.d.ts +2 -1
  249. package/dist/pool/playwright-launcher.js +22 -2
  250. package/dist/project/baselines.d.ts +0 -1
  251. package/dist/project/baselines.js +5 -4
  252. package/dist/project/file-lock.d.ts +2 -1
  253. package/dist/project/file-lock.js +12 -2
  254. package/dist/project/fs-port.d.ts +0 -1
  255. package/dist/project/fs-port.js +0 -1
  256. package/dist/project/project-store.d.ts +0 -1
  257. package/dist/project/project-store.js +20 -9
  258. package/dist/project/project-tools.d.ts +0 -1
  259. package/dist/project/project-tools.js +57 -9
  260. package/dist/project/reticle-dir.d.ts +0 -1
  261. package/dist/project/reticle-dir.js +0 -1
  262. package/dist/runs/build-verification-run.d.ts +0 -1
  263. package/dist/runs/build-verification-run.js +0 -1
  264. package/dist/runs/profile-redact.d.ts +0 -1
  265. package/dist/runs/profile-redact.js +0 -1
  266. package/dist/runs/render-report.d.ts +0 -1
  267. package/dist/runs/render-report.js +0 -1
  268. package/dist/runs/repair-prompt.d.ts +0 -1
  269. package/dist/runs/repair-prompt.js +0 -1
  270. package/dist/runs/replay-mapping.d.ts +0 -1
  271. package/dist/runs/replay-mapping.js +0 -1
  272. package/dist/runs/reticle-runner.d.ts +0 -1
  273. package/dist/runs/reticle-runner.js +4 -2
  274. package/dist/runs/risk-classify.d.ts +0 -1
  275. package/dist/runs/risk-classify.js +0 -1
  276. package/dist/runs/run-diff.d.ts +0 -1
  277. package/dist/runs/run-diff.js +0 -1
  278. package/dist/runs/run-store.d.ts +0 -1
  279. package/dist/runs/run-store.js +0 -1
  280. package/dist/runs/run-tools.d.ts +0 -1
  281. package/dist/runs/run-tools.js +0 -1
  282. package/dist/runs/runner-port.d.ts +0 -1
  283. package/dist/runs/runner-port.js +0 -1
  284. package/dist/runs/verification-sync.d.ts +23 -0
  285. package/dist/runs/verification-sync.js +66 -0
  286. package/dist/runs/verify-http.d.ts +0 -1
  287. package/dist/runs/verify-http.js +0 -1
  288. package/dist/runs/verify-server.d.ts +0 -1
  289. package/dist/runs/verify-server.js +0 -1
  290. package/dist/server-version.d.ts +0 -1
  291. package/dist/server-version.js +0 -1
  292. package/dist/session/command-timeout.d.ts +35 -0
  293. package/dist/session/command-timeout.js +41 -0
  294. package/dist/session/control-envelope.d.ts +2 -3
  295. package/dist/session/control-envelope.js +2 -3
  296. package/dist/session/last-act.d.ts +31 -0
  297. package/dist/session/last-act.js +24 -0
  298. package/dist/session/live-control-tools.d.ts +0 -1
  299. package/dist/session/live-control-tools.js +3 -4
  300. package/dist/session/live-control.d.ts +0 -1
  301. package/dist/session/live-control.js +0 -1
  302. package/dist/session/observed-state.d.ts +12 -2
  303. package/dist/session/observed-state.js +29 -2
  304. package/dist/session/output-budget.d.ts +0 -1
  305. package/dist/session/output-budget.js +0 -1
  306. package/dist/session/pending-commands.d.ts +12 -0
  307. package/dist/session/pending-commands.js +36 -0
  308. package/dist/session/presenter-args.d.ts +0 -1
  309. package/dist/session/presenter-args.js +0 -1
  310. package/dist/session/review-store.d.ts +0 -1
  311. package/dist/session/review-store.js +0 -1
  312. package/dist/session/session-health.d.ts +26 -2
  313. package/dist/session/session-health.js +13 -1
  314. package/dist/session/session-info.d.ts +29 -0
  315. package/dist/session/session-info.js +1 -0
  316. package/dist/session/session-lease.d.ts +25 -0
  317. package/dist/session/session-lease.js +14 -0
  318. package/dist/session/session-manager.d.ts +7 -19
  319. package/dist/session/session-manager.js +29 -2
  320. package/dist/session/session-readiness.d.ts +0 -1
  321. package/dist/session/session-readiness.js +3 -4
  322. package/dist/session/session-reaper.d.ts +0 -1
  323. package/dist/session/session-reaper.js +0 -1
  324. package/dist/session/session-recommendation.d.ts +0 -1
  325. package/dist/session/session-recommendation.js +0 -1
  326. package/dist/session/session-tools.d.ts +0 -1
  327. package/dist/session/session-tools.js +2 -3
  328. package/dist/session/session.d.ts +27 -53
  329. package/dist/session/session.js +95 -66
  330. package/dist/session/state-select.d.ts +0 -1
  331. package/dist/session/state-select.js +0 -1
  332. package/dist/telemetry/argument-shape.d.ts +41 -0
  333. package/dist/telemetry/argument-shape.js +87 -0
  334. package/dist/telemetry/bug-found.d.ts +33 -0
  335. package/dist/telemetry/bug-found.js +95 -0
  336. package/dist/telemetry/cli-telemetry.d.ts +13 -0
  337. package/dist/telemetry/cli-telemetry.js +43 -0
  338. package/dist/telemetry/connect-failure.d.ts +16 -0
  339. package/dist/telemetry/connect-failure.js +44 -0
  340. package/dist/telemetry/daemon-telemetry.d.ts +19 -0
  341. package/dist/telemetry/daemon-telemetry.js +76 -0
  342. package/dist/telemetry/dev-repo.d.ts +10 -0
  343. package/dist/telemetry/dev-repo.js +80 -0
  344. package/dist/telemetry/error-fingerprint.d.ts +24 -0
  345. package/dist/telemetry/error-fingerprint.js +88 -0
  346. package/dist/telemetry/feedback-cli.d.ts +31 -0
  347. package/dist/telemetry/feedback-cli.js +102 -0
  348. package/dist/telemetry/feedback-context.d.ts +32 -0
  349. package/dist/telemetry/feedback-context.js +143 -0
  350. package/dist/telemetry/feedback.d.ts +66 -0
  351. package/dist/telemetry/feedback.js +175 -0
  352. package/dist/telemetry/git-facts.d.ts +21 -0
  353. package/dist/telemetry/git-facts.js +109 -0
  354. package/dist/telemetry/identify.d.ts +22 -0
  355. package/dist/telemetry/identify.js +73 -0
  356. package/dist/telemetry/init-telemetry.d.ts +26 -0
  357. package/dist/telemetry/init-telemetry.js +33 -0
  358. package/dist/telemetry/machine-snapshot.d.ts +6 -0
  359. package/dist/telemetry/machine-snapshot.js +39 -0
  360. package/dist/telemetry/mcp-connection.d.ts +5 -0
  361. package/dist/telemetry/mcp-connection.js +44 -0
  362. package/dist/telemetry/project-profile.d.ts +44 -0
  363. package/dist/telemetry/project-profile.js +205 -0
  364. package/dist/telemetry/run-telemetry.d.ts +21 -0
  365. package/dist/telemetry/run-telemetry.js +62 -0
  366. package/dist/telemetry/session-metrics.d.ts +103 -0
  367. package/dist/telemetry/session-metrics.js +329 -0
  368. package/dist/telemetry/telemetry.d.ts +68 -0
  369. package/dist/telemetry/telemetry.js +313 -0
  370. package/dist/token-auth.d.ts +0 -1
  371. package/dist/token-auth.js +0 -1
  372. package/dist/tools/act-capsule.d.ts +23 -0
  373. package/dist/tools/act-capsule.js +47 -0
  374. package/dist/tools/act-danger.d.ts +7 -0
  375. package/dist/tools/act-danger.js +44 -0
  376. package/dist/tools/act-helpers.d.ts +17 -0
  377. package/dist/tools/act-helpers.js +40 -0
  378. package/dist/tools/act-tools.d.ts +8 -1
  379. package/dist/tools/act-tools.js +96 -98
  380. package/dist/tools/act-view.d.ts +7 -1
  381. package/dist/tools/act-view.js +13 -1
  382. package/dist/tools/assert-grade.d.ts +22 -1
  383. package/dist/tools/assert-grade.js +46 -1
  384. package/dist/tools/assert-verdict.d.ts +21 -0
  385. package/dist/tools/assert-verdict.js +62 -0
  386. package/dist/tools/browser-tools.d.ts +0 -1
  387. package/dist/tools/browser-tools.js +2 -2
  388. package/dist/tools/contract-tools.d.ts +0 -1
  389. package/dist/tools/contract-tools.js +0 -1
  390. package/dist/tools/coverage-tools.d.ts +9 -0
  391. package/dist/tools/coverage-tools.js +92 -0
  392. package/dist/tools/dynamic-tools.d.ts +0 -1
  393. package/dist/tools/dynamic-tools.js +21 -2
  394. package/dist/tools/error-recovery.d.ts +18 -2
  395. package/dist/tools/error-recovery.js +42 -7
  396. package/dist/tools/feedback-tools.d.ts +24 -0
  397. package/dist/tools/feedback-tools.js +180 -0
  398. package/dist/tools/invoke-tool.d.ts +0 -1
  399. package/dist/tools/invoke-tool.js +116 -2
  400. package/dist/tools/lease-tools.d.ts +0 -1
  401. package/dist/tools/lease-tools.js +6 -5
  402. package/dist/tools/merge-tools.d.ts +0 -1
  403. package/dist/tools/merge-tools.js +0 -1
  404. package/dist/tools/observe-tools.d.ts +0 -1
  405. package/dist/tools/observe-tools.js +91 -39
  406. package/dist/tools/profiles.d.ts +1 -2
  407. package/dist/tools/profiles.js +43 -16
  408. package/dist/tools/query-paginate.d.ts +0 -1
  409. package/dist/tools/query-paginate.js +0 -1
  410. package/dist/tools/read-tools.d.ts +0 -1
  411. package/dist/tools/read-tools.js +10 -8
  412. package/dist/tools/reconcile-tools.d.ts +2 -0
  413. package/dist/tools/reconcile-tools.js +111 -0
  414. package/dist/tools/snapshot-delta.d.ts +0 -1
  415. package/dist/tools/snapshot-delta.js +0 -0
  416. package/dist/tools/tool-invoker.d.ts +0 -1
  417. package/dist/tools/tool-invoker.js +0 -1
  418. package/dist/tools/tool-kit.d.ts +16 -1
  419. package/dist/tools/tool-kit.js +8 -2
  420. package/dist/tools/tool-names.d.ts +6 -1
  421. package/dist/tools/tool-names.js +6 -1
  422. package/dist/tools/tools-helpers.d.ts +0 -1
  423. package/dist/tools/tools-helpers.js +0 -1
  424. package/dist/tools/tools.d.ts +0 -1
  425. package/dist/tools/tools.js +24 -4
  426. package/dist/update/update-checker.d.ts +0 -1
  427. package/dist/update/update-checker.js +26 -2
  428. package/dist/update/update-nudge.d.ts +20 -0
  429. package/dist/update/update-nudge.js +72 -0
  430. package/dist/update/updater.d.ts +14 -1
  431. package/dist/update/updater.js +33 -2
  432. package/dist/visual/visual-diff.d.ts +0 -1
  433. package/dist/visual/visual-diff.js +0 -1
  434. package/dist/visual/visual-store.d.ts +0 -1
  435. package/dist/visual/visual-store.js +0 -1
  436. package/dist/visual/visual-tools.d.ts +0 -1
  437. package/dist/visual/visual-tools.js +103 -16
  438. package/package.json +2 -2
  439. package/dist/bridge-security.d.ts.map +0 -1
  440. package/dist/bridge-security.js.map +0 -1
  441. package/dist/bridge.d.ts.map +0 -1
  442. package/dist/bridge.js.map +0 -1
  443. package/dist/bridge.test-harness.d.ts.map +0 -1
  444. package/dist/bridge.test-harness.js.map +0 -1
  445. package/dist/capsule/capsule-store.d.ts.map +0 -1
  446. package/dist/capsule/capsule-store.js.map +0 -1
  447. package/dist/capsule/capsule.d.ts.map +0 -1
  448. package/dist/capsule/capsule.js.map +0 -1
  449. package/dist/capsule/causal-summary.d.ts.map +0 -1
  450. package/dist/capsule/causal-summary.js.map +0 -1
  451. package/dist/capsule/divergence.d.ts.map +0 -1
  452. package/dist/capsule/divergence.js.map +0 -1
  453. package/dist/capsule/minimize.d.ts.map +0 -1
  454. package/dist/capsule/minimize.js.map +0 -1
  455. package/dist/capsule/predicate-to-links.d.ts.map +0 -1
  456. package/dist/capsule/predicate-to-links.js.map +0 -1
  457. package/dist/cli-flow-commands.d.ts.map +0 -1
  458. package/dist/cli-flow-commands.js.map +0 -1
  459. package/dist/cli-launch.d.ts.map +0 -1
  460. package/dist/cli-launch.js.map +0 -1
  461. package/dist/cli-parse.d.ts.map +0 -1
  462. package/dist/cli-parse.js.map +0 -1
  463. package/dist/cli-port.d.ts.map +0 -1
  464. package/dist/cli-port.js.map +0 -1
  465. package/dist/cli-verify.d.ts.map +0 -1
  466. package/dist/cli-verify.js.map +0 -1
  467. package/dist/cli.d.ts.map +0 -1
  468. package/dist/cli.js.map +0 -1
  469. package/dist/cloud/cloud-sync.d.ts.map +0 -1
  470. package/dist/cloud/cloud-sync.js.map +0 -1
  471. package/dist/crawl/crawl-tools.d.ts.map +0 -1
  472. package/dist/crawl/crawl-tools.js.map +0 -1
  473. package/dist/crawl/crawl.d.ts.map +0 -1
  474. package/dist/crawl/crawl.js.map +0 -1
  475. package/dist/daemon-resilience.d.ts.map +0 -1
  476. package/dist/daemon-resilience.js.map +0 -1
  477. package/dist/daemon.d.ts.map +0 -1
  478. package/dist/daemon.js.map +0 -1
  479. package/dist/domain/domain-model.d.ts.map +0 -1
  480. package/dist/domain/domain-model.js.map +0 -1
  481. package/dist/domain/domain-tools.d.ts.map +0 -1
  482. package/dist/domain/domain-tools.js.map +0 -1
  483. package/dist/domain/flow-risk.d.ts.map +0 -1
  484. package/dist/domain/flow-risk.js.map +0 -1
  485. package/dist/ee/audit-log.d.ts.map +0 -1
  486. package/dist/ee/audit-log.js.map +0 -1
  487. package/dist/events/event-filters.d.ts.map +0 -1
  488. package/dist/events/event-filters.js.map +0 -1
  489. package/dist/events/predicate-eval.d.ts.map +0 -1
  490. package/dist/events/predicate-eval.js.map +0 -1
  491. package/dist/events/predicate.d.ts.map +0 -1
  492. package/dist/events/predicate.js.map +0 -1
  493. package/dist/events/reaction.d.ts.map +0 -1
  494. package/dist/events/reaction.js.map +0 -1
  495. package/dist/events/ring-buffer.d.ts.map +0 -1
  496. package/dist/events/ring-buffer.js.map +0 -1
  497. package/dist/flows/affected.d.ts.map +0 -1
  498. package/dist/flows/affected.js.map +0 -1
  499. package/dist/flows/annotate-tools.d.ts.map +0 -1
  500. package/dist/flows/annotate-tools.js.map +0 -1
  501. package/dist/flows/annotate.d.ts.map +0 -1
  502. package/dist/flows/annotate.js.map +0 -1
  503. package/dist/flows/annotation-store.d.ts.map +0 -1
  504. package/dist/flows/annotation-store.js.map +0 -1
  505. package/dist/flows/assertion-integrity.d.ts.map +0 -1
  506. package/dist/flows/assertion-integrity.js.map +0 -1
  507. package/dist/flows/assertion-tiers-store.d.ts.map +0 -1
  508. package/dist/flows/assertion-tiers-store.js.map +0 -1
  509. package/dist/flows/buddy-status.d.ts.map +0 -1
  510. package/dist/flows/buddy-status.js.map +0 -1
  511. package/dist/flows/coverage.d.ts.map +0 -1
  512. package/dist/flows/coverage.js.map +0 -1
  513. package/dist/flows/decision.d.ts.map +0 -1
  514. package/dist/flows/decision.js.map +0 -1
  515. package/dist/flows/flake-store.d.ts.map +0 -1
  516. package/dist/flows/flake-store.js.map +0 -1
  517. package/dist/flows/flake.d.ts.map +0 -1
  518. package/dist/flows/flake.js.map +0 -1
  519. package/dist/flows/flow-classify.d.ts.map +0 -1
  520. package/dist/flows/flow-classify.js.map +0 -1
  521. package/dist/flows/flow-replay-run.d.ts.map +0 -1
  522. package/dist/flows/flow-replay-run.js.map +0 -1
  523. package/dist/flows/flow-replay.d.ts.map +0 -1
  524. package/dist/flows/flow-replay.js.map +0 -1
  525. package/dist/flows/flow-report.d.ts.map +0 -1
  526. package/dist/flows/flow-report.js.map +0 -1
  527. package/dist/flows/flow-scope.d.ts.map +0 -1
  528. package/dist/flows/flow-scope.js.map +0 -1
  529. package/dist/flows/flow-sources.d.ts.map +0 -1
  530. package/dist/flows/flow-sources.js.map +0 -1
  531. package/dist/flows/flow-success.d.ts.map +0 -1
  532. package/dist/flows/flow-success.js.map +0 -1
  533. package/dist/flows/flow-tools.d.ts.map +0 -1
  534. package/dist/flows/flow-tools.js.map +0 -1
  535. package/dist/flows/flows.d.ts.map +0 -1
  536. package/dist/flows/flows.js.map +0 -1
  537. package/dist/flows/gate.d.ts.map +0 -1
  538. package/dist/flows/gate.js.map +0 -1
  539. package/dist/flows/git-changed.d.ts.map +0 -1
  540. package/dist/flows/git-changed.js.map +0 -1
  541. package/dist/flows/heal-run.d.ts.map +0 -1
  542. package/dist/flows/heal-run.js.map +0 -1
  543. package/dist/flows/heal.d.ts.map +0 -1
  544. package/dist/flows/heal.js.map +0 -1
  545. package/dist/flows/parallel-suite.d.ts.map +0 -1
  546. package/dist/flows/parallel-suite.js.map +0 -1
  547. package/dist/flows/recordings.d.ts.map +0 -1
  548. package/dist/flows/recordings.js.map +0 -1
  549. package/dist/flows/replay.d.ts.map +0 -1
  550. package/dist/flows/replay.js.map +0 -1
  551. package/dist/flows/watch-batcher.d.ts.map +0 -1
  552. package/dist/flows/watch-batcher.js.map +0 -1
  553. package/dist/honesty/blind-spots.d.ts.map +0 -1
  554. package/dist/honesty/blind-spots.js.map +0 -1
  555. package/dist/honesty/honesty.d.ts.map +0 -1
  556. package/dist/honesty/honesty.js.map +0 -1
  557. package/dist/http-server.d.ts.map +0 -1
  558. package/dist/http-server.js.map +0 -1
  559. package/dist/idle-shutdown.d.ts.map +0 -1
  560. package/dist/idle-shutdown.js.map +0 -1
  561. package/dist/index.d.ts.map +0 -1
  562. package/dist/index.js.map +0 -1
  563. package/dist/init/agent-rules.d.ts.map +0 -1
  564. package/dist/init/agent-rules.js.map +0 -1
  565. package/dist/init/cursor.d.ts.map +0 -1
  566. package/dist/init/cursor.js.map +0 -1
  567. package/dist/init/detect.d.ts.map +0 -1
  568. package/dist/init/detect.js.map +0 -1
  569. package/dist/init/mcp.d.ts.map +0 -1
  570. package/dist/init/mcp.js.map +0 -1
  571. package/dist/init/node-io.d.ts.map +0 -1
  572. package/dist/init/node-io.js.map +0 -1
  573. package/dist/init/plan.d.ts.map +0 -1
  574. package/dist/init/plan.js.map +0 -1
  575. package/dist/init/project-id.d.ts.map +0 -1
  576. package/dist/init/project-id.js.map +0 -1
  577. package/dist/init/run.d.ts.map +0 -1
  578. package/dist/init/run.js.map +0 -1
  579. package/dist/init/snippets.d.ts.map +0 -1
  580. package/dist/init/snippets.js.map +0 -1
  581. package/dist/init/vite-config.d.ts.map +0 -1
  582. package/dist/init/vite-config.js.map +0 -1
  583. package/dist/input/network-detail.d.ts.map +0 -1
  584. package/dist/input/network-detail.js.map +0 -1
  585. package/dist/input/network-mock-tools.d.ts.map +0 -1
  586. package/dist/input/network-mock-tools.js.map +0 -1
  587. package/dist/input/network-mock.d.ts.map +0 -1
  588. package/dist/input/network-mock.js.map +0 -1
  589. package/dist/input/real-input.d.ts.map +0 -1
  590. package/dist/input/real-input.js.map +0 -1
  591. package/dist/input/scroll-find.d.ts.map +0 -1
  592. package/dist/input/scroll-find.js.map +0 -1
  593. package/dist/input/scroll-tools.d.ts.map +0 -1
  594. package/dist/input/scroll-tools.js.map +0 -1
  595. package/dist/input/viewport-tools.d.ts.map +0 -1
  596. package/dist/input/viewport-tools.js.map +0 -1
  597. package/dist/journal/ambient-store.d.ts.map +0 -1
  598. package/dist/journal/ambient-store.js.map +0 -1
  599. package/dist/journal/ambient.d.ts.map +0 -1
  600. package/dist/journal/ambient.js.map +0 -1
  601. package/dist/journal/attach-journal.d.ts.map +0 -1
  602. package/dist/journal/attach-journal.js.map +0 -1
  603. package/dist/journal/deviation-report.d.ts.map +0 -1
  604. package/dist/journal/deviation-report.js.map +0 -1
  605. package/dist/journal/deviation-service.d.ts.map +0 -1
  606. package/dist/journal/deviation-service.js.map +0 -1
  607. package/dist/journal/envelope-store.d.ts.map +0 -1
  608. package/dist/journal/envelope-store.js.map +0 -1
  609. package/dist/journal/envelope.d.ts.map +0 -1
  610. package/dist/journal/envelope.js.map +0 -1
  611. package/dist/journal/journal-query.d.ts.map +0 -1
  612. package/dist/journal/journal-query.js.map +0 -1
  613. package/dist/journal/journal-recorder.d.ts.map +0 -1
  614. package/dist/journal/journal-recorder.js.map +0 -1
  615. package/dist/journal/retention.d.ts.map +0 -1
  616. package/dist/journal/retention.js.map +0 -1
  617. package/dist/journal/rollups.d.ts.map +0 -1
  618. package/dist/journal/rollups.js.map +0 -1
  619. package/dist/journal/session-end.d.ts.map +0 -1
  620. package/dist/journal/session-end.js.map +0 -1
  621. package/dist/journal/session-journal.d.ts.map +0 -1
  622. package/dist/journal/session-journal.js.map +0 -1
  623. package/dist/license/license.d.ts.map +0 -1
  624. package/dist/license/license.js.map +0 -1
  625. package/dist/log.d.ts.map +0 -1
  626. package/dist/log.js.map +0 -1
  627. package/dist/mcp-proxy.d.ts.map +0 -1
  628. package/dist/mcp-proxy.js.map +0 -1
  629. package/dist/mcp.d.ts.map +0 -1
  630. package/dist/mcp.js.map +0 -1
  631. package/dist/oracles/flow-instrument-gaps.d.ts.map +0 -1
  632. package/dist/oracles/flow-instrument-gaps.js.map +0 -1
  633. package/dist/oracles/propose-consequences.d.ts.map +0 -1
  634. package/dist/oracles/propose-consequences.js.map +0 -1
  635. package/dist/oracles/self-instrument.d.ts.map +0 -1
  636. package/dist/oracles/self-instrument.js.map +0 -1
  637. package/dist/pairing-token.d.ts.map +0 -1
  638. package/dist/pairing-token.js.map +0 -1
  639. package/dist/phenomena/phenomena.d.ts.map +0 -1
  640. package/dist/phenomena/phenomena.js.map +0 -1
  641. package/dist/pool/browser-pool.d.ts.map +0 -1
  642. package/dist/pool/browser-pool.js.map +0 -1
  643. package/dist/pool/lease-reaper.d.ts.map +0 -1
  644. package/dist/pool/lease-reaper.js.map +0 -1
  645. package/dist/pool/playwright-launcher.d.ts.map +0 -1
  646. package/dist/pool/playwright-launcher.js.map +0 -1
  647. package/dist/project/baselines.d.ts.map +0 -1
  648. package/dist/project/baselines.js.map +0 -1
  649. package/dist/project/file-lock.d.ts.map +0 -1
  650. package/dist/project/file-lock.js.map +0 -1
  651. package/dist/project/fs-port.d.ts.map +0 -1
  652. package/dist/project/fs-port.js.map +0 -1
  653. package/dist/project/project-store.d.ts.map +0 -1
  654. package/dist/project/project-store.js.map +0 -1
  655. package/dist/project/project-tools.d.ts.map +0 -1
  656. package/dist/project/project-tools.js.map +0 -1
  657. package/dist/project/reticle-dir.d.ts.map +0 -1
  658. package/dist/project/reticle-dir.js.map +0 -1
  659. package/dist/runs/build-verification-run.d.ts.map +0 -1
  660. package/dist/runs/build-verification-run.js.map +0 -1
  661. package/dist/runs/profile-redact.d.ts.map +0 -1
  662. package/dist/runs/profile-redact.js.map +0 -1
  663. package/dist/runs/render-report.d.ts.map +0 -1
  664. package/dist/runs/render-report.js.map +0 -1
  665. package/dist/runs/repair-prompt.d.ts.map +0 -1
  666. package/dist/runs/repair-prompt.js.map +0 -1
  667. package/dist/runs/replay-mapping.d.ts.map +0 -1
  668. package/dist/runs/replay-mapping.js.map +0 -1
  669. package/dist/runs/reticle-runner.d.ts.map +0 -1
  670. package/dist/runs/reticle-runner.js.map +0 -1
  671. package/dist/runs/risk-classify.d.ts.map +0 -1
  672. package/dist/runs/risk-classify.js.map +0 -1
  673. package/dist/runs/run-diff.d.ts.map +0 -1
  674. package/dist/runs/run-diff.js.map +0 -1
  675. package/dist/runs/run-store.d.ts.map +0 -1
  676. package/dist/runs/run-store.js.map +0 -1
  677. package/dist/runs/run-tools.d.ts.map +0 -1
  678. package/dist/runs/run-tools.js.map +0 -1
  679. package/dist/runs/runner-port.d.ts.map +0 -1
  680. package/dist/runs/runner-port.js.map +0 -1
  681. package/dist/runs/verify-http.d.ts.map +0 -1
  682. package/dist/runs/verify-http.js.map +0 -1
  683. package/dist/runs/verify-server.d.ts.map +0 -1
  684. package/dist/runs/verify-server.js.map +0 -1
  685. package/dist/server-version.d.ts.map +0 -1
  686. package/dist/server-version.js.map +0 -1
  687. package/dist/session/control-envelope.d.ts.map +0 -1
  688. package/dist/session/control-envelope.js.map +0 -1
  689. package/dist/session/live-control-tools.d.ts.map +0 -1
  690. package/dist/session/live-control-tools.js.map +0 -1
  691. package/dist/session/live-control.d.ts.map +0 -1
  692. package/dist/session/live-control.js.map +0 -1
  693. package/dist/session/observed-state.d.ts.map +0 -1
  694. package/dist/session/observed-state.js.map +0 -1
  695. package/dist/session/output-budget.d.ts.map +0 -1
  696. package/dist/session/output-budget.js.map +0 -1
  697. package/dist/session/presenter-args.d.ts.map +0 -1
  698. package/dist/session/presenter-args.js.map +0 -1
  699. package/dist/session/review-store.d.ts.map +0 -1
  700. package/dist/session/review-store.js.map +0 -1
  701. package/dist/session/session-health.d.ts.map +0 -1
  702. package/dist/session/session-health.js.map +0 -1
  703. package/dist/session/session-manager.d.ts.map +0 -1
  704. package/dist/session/session-manager.js.map +0 -1
  705. package/dist/session/session-readiness.d.ts.map +0 -1
  706. package/dist/session/session-readiness.js.map +0 -1
  707. package/dist/session/session-reaper.d.ts.map +0 -1
  708. package/dist/session/session-reaper.js.map +0 -1
  709. package/dist/session/session-recommendation.d.ts.map +0 -1
  710. package/dist/session/session-recommendation.js.map +0 -1
  711. package/dist/session/session-tools.d.ts.map +0 -1
  712. package/dist/session/session-tools.js.map +0 -1
  713. package/dist/session/session.d.ts.map +0 -1
  714. package/dist/session/session.js.map +0 -1
  715. package/dist/session/state-select.d.ts.map +0 -1
  716. package/dist/session/state-select.js.map +0 -1
  717. package/dist/token-auth.d.ts.map +0 -1
  718. package/dist/token-auth.js.map +0 -1
  719. package/dist/tools/act-tools.d.ts.map +0 -1
  720. package/dist/tools/act-tools.js.map +0 -1
  721. package/dist/tools/act-view.d.ts.map +0 -1
  722. package/dist/tools/act-view.js.map +0 -1
  723. package/dist/tools/assert-grade.d.ts.map +0 -1
  724. package/dist/tools/assert-grade.js.map +0 -1
  725. package/dist/tools/browser-tools.d.ts.map +0 -1
  726. package/dist/tools/browser-tools.js.map +0 -1
  727. package/dist/tools/contract-tools.d.ts.map +0 -1
  728. package/dist/tools/contract-tools.js.map +0 -1
  729. package/dist/tools/dynamic-tools.d.ts.map +0 -1
  730. package/dist/tools/dynamic-tools.js.map +0 -1
  731. package/dist/tools/error-recovery.d.ts.map +0 -1
  732. package/dist/tools/error-recovery.js.map +0 -1
  733. package/dist/tools/invoke-tool.d.ts.map +0 -1
  734. package/dist/tools/invoke-tool.js.map +0 -1
  735. package/dist/tools/lease-tools.d.ts.map +0 -1
  736. package/dist/tools/lease-tools.js.map +0 -1
  737. package/dist/tools/merge-tools.d.ts.map +0 -1
  738. package/dist/tools/merge-tools.js.map +0 -1
  739. package/dist/tools/observe-tools.d.ts.map +0 -1
  740. package/dist/tools/observe-tools.js.map +0 -1
  741. package/dist/tools/profiles.d.ts.map +0 -1
  742. package/dist/tools/profiles.js.map +0 -1
  743. package/dist/tools/query-paginate.d.ts.map +0 -1
  744. package/dist/tools/query-paginate.js.map +0 -1
  745. package/dist/tools/read-tools.d.ts.map +0 -1
  746. package/dist/tools/read-tools.js.map +0 -1
  747. package/dist/tools/snapshot-delta.d.ts.map +0 -1
  748. package/dist/tools/snapshot-delta.js.map +0 -1
  749. package/dist/tools/tool-invoker.d.ts.map +0 -1
  750. package/dist/tools/tool-invoker.js.map +0 -1
  751. package/dist/tools/tool-kit.d.ts.map +0 -1
  752. package/dist/tools/tool-kit.js.map +0 -1
  753. package/dist/tools/tool-names.d.ts.map +0 -1
  754. package/dist/tools/tool-names.js.map +0 -1
  755. package/dist/tools/tools-helpers.d.ts.map +0 -1
  756. package/dist/tools/tools-helpers.js.map +0 -1
  757. package/dist/tools/tools.d.ts.map +0 -1
  758. package/dist/tools/tools.js.map +0 -1
  759. package/dist/update/update-checker.d.ts.map +0 -1
  760. package/dist/update/update-checker.js.map +0 -1
  761. package/dist/update/updater.d.ts.map +0 -1
  762. package/dist/update/updater.js.map +0 -1
  763. package/dist/visual/visual-diff.d.ts.map +0 -1
  764. package/dist/visual/visual-diff.js.map +0 -1
  765. package/dist/visual/visual-store.d.ts.map +0 -1
  766. package/dist/visual/visual-store.js.map +0 -1
  767. package/dist/visual/visual-tools.d.ts.map +0 -1
  768. package/dist/visual/visual-tools.js.map +0 -1
@@ -2,7 +2,8 @@ import { z } from 'zod';
2
2
  import { ProjectReadError, RunKind, RunStatus } from '@reticlehq/core';
3
3
  import { ReticleTool } from '../tools/tool-names.js';
4
4
  import { sessionIdShape } from '../tools/tool-kit.js';
5
- import { asString } from '../tools/tools-helpers.js';
5
+ import { asNumber, asString } from '../tools/tools-helpers.js';
6
+ import { fetchProjectRegressionFromCloud, resolveCloudConfig } from '../cloud/cloud-sync.js';
6
7
  import { RunStore } from '../runs/run-store.js';
7
8
  import { diffRuns as diffVerificationRuns, } from '../runs/run-diff.js';
8
9
  const REGRESSION_STATUSES = new Set([
@@ -28,7 +29,28 @@ function numericDelta(before, after) {
28
29
  return undefined;
29
30
  return (after ?? 0) - (before ?? 0);
30
31
  }
32
+ /**
33
+ * Pull the team's server-side regression memory when logged in. This is what keeps a context-lost or
34
+ * brand-new agent (whose local project.json may be empty) oriented: the same reticle_project call folds in
35
+ * "what's broken vs before" from the cloud. Absent creds / unreachable → undefined (agent stays local).
36
+ */
37
+ async function cloudRegression(deps, sessionId) {
38
+ const config = resolveCloudConfig(process.env);
39
+ if (config === null)
40
+ return undefined;
41
+ let projectId;
42
+ try {
43
+ projectId = deps.sessions.resolve(sessionId).projectId;
44
+ }
45
+ catch {
46
+ projectId = undefined;
47
+ }
48
+ const report = await fetchProjectRegressionFromCloud(config, projectId, (url, init) => fetch(url, init));
49
+ return report ?? undefined;
50
+ }
31
51
  /** The two most-recent runs for `name`, oldest-first, or undefined if there are fewer than two. */
52
+ /** Runs returned when the caller does not ask for a specific count. */
53
+ const DEFAULT_RUN_LIMIT = 25;
32
54
  function lastTwoFor(runs, name) {
33
55
  const matching = runs.filter((r) => r.name === name);
34
56
  const n = matching.length;
@@ -62,29 +84,54 @@ async function lastTwoRunArtifacts(deps) {
62
84
  export const PROJECT_TOOLS = [
63
85
  {
64
86
  name: ReticleTool.PROJECT,
65
- description: 'Read cross-run history from .reticle/project.json — the memory of how past runs behaved. With { name } it also returns the last run for that flow plus a diff-vs-last summary (status change, regressed flag, consoleErrors/driftSteps deltas) so you can answer "did it behave like last time?". Returns { runs, learned?, lastRun?, diff?, runDiff? } — `diff` is the lightweight status/console/drift delta vs the previous run of that NAME; `runDiff` is the per-flow duration/status delta between the two most-recent full verification artifacts ("step 3: 412ms -> 987ms (+140%), +2 requests"). Or { error, reason } when no/invalid history exists.',
87
+ description: 'Read cross-run history from .reticle/project.json — the memory of how past runs behaved. With { name } it also returns the last run for that flow plus a diff-vs-last summary (status change, regressed flag, consoleErrors/driftSteps deltas) so you can answer "did it behave like last time?". `diff` is the lightweight status/console/drift delta vs the previous run of that NAME; `runDiff` is the per-flow duration/status delta between the two most-recent full verification artifacts ("step 3: 412ms -> 987ms (+140%), +2 requests"). When logged in to Reticle Cloud, also returns `cloud`: the team\'s server-side regression report (broken/changed flows vs before) — the durable memory a fresh or context-lost agent can rely on even when local history is empty. Returns { runs, learned?, lastRun?, diff?, runDiff?, cloud? } or { error, reason, cloud? }.',
66
88
  inputSchema: {
67
89
  name: z.string().optional().describe('Filter runs by this name. Omit to return all runs.'),
90
+ limit: z
91
+ .number()
92
+ .optional()
93
+ .describe('Most-recent N runs to return. Defaults to 25 — the full history is unbounded and grows with every run (measured at ~20KB / ~5,000 tokens on a modest project), which is a large slice of an agent context for data it mostly does not read. `totalRuns` always reports the true count, so a cap is never silent.'),
68
94
  ...sessionIdShape,
69
95
  },
70
96
  outputSchema: {
71
97
  runs: z.array(z.unknown()),
98
+ totalRuns: z
99
+ .number()
100
+ .optional()
101
+ .describe('How many runs exist in total. Compare against runs.length to see if it was capped.'),
72
102
  diff: z.unknown().optional(),
73
103
  runDiff: z.unknown().optional(),
104
+ cloud: z.unknown().optional(),
74
105
  },
75
106
  handler: async (deps, args) => {
107
+ const cloud = await cloudRegression(deps, asString(args['sessionId']));
108
+ const withCloud = (obj) => cloud === undefined ? obj : { ...obj, cloud };
76
109
  const read = await deps.project.read();
77
110
  if (!read.ok) {
78
- return {
111
+ return withCloud({
79
112
  error: read.reason === ProjectReadError.MISSING
80
113
  ? 'no .reticle/project.json yet — run a flow (reticle_flow_replay) or reticle_run_record first'
81
114
  : '.reticle/project.json is malformed — it will self-heal on the next recorded run',
82
115
  reason: read.reason,
83
- };
116
+ });
84
117
  }
85
118
  const name = asString(args['name']);
119
+ // The most recent N, in the order they happened. The history is append-only and unbounded —
120
+ // measured at ~20KB (~5,000 tokens) across 176 runs on this repo — and an agent asking "how
121
+ // did this behave before" wants the recent past, not every run ever recorded. `totalRuns`
122
+ // travels with it so the cap is never silent, per the repo's no-silent-caps rule.
123
+ //
124
+ // Order is left alone deliberately. Reversing to newest-first was tried and reverted: it read
125
+ // better but broke an existing contract for no reason the bound required, and a caller relying
126
+ // on chronological order would have been silently handed the reverse.
127
+ const cap = asNumber(args['limit']) ?? DEFAULT_RUN_LIMIT;
128
+ const recent = (runs) => runs.slice(-cap);
86
129
  if (name === undefined) {
87
- return { runs: read.file.runs, learned: read.file.learned };
130
+ return withCloud({
131
+ runs: recent(read.file.runs),
132
+ totalRuns: read.file.runs.length,
133
+ learned: read.file.learned,
134
+ });
88
135
  }
89
136
  const lastRun = await deps.project.lastRun(name);
90
137
  const pair = lastTwoFor(read.file.runs, name);
@@ -94,13 +141,15 @@ export const PROJECT_TOOLS = [
94
141
  // last time?" from project.json, while `runDiff` answers "what changed between the last two full
95
142
  // verification runs?" from .reticle/runs. Best-effort: no artifacts simply means no runDiff.
96
143
  const runDiff = await lastTwoRunArtifacts(deps);
97
- return {
98
- runs: read.file.runs.filter((r) => r.name === name),
144
+ const forName = read.file.runs.filter((r) => r.name === name);
145
+ return withCloud({
146
+ runs: recent(forName),
147
+ totalRuns: forName.length,
99
148
  learned: read.file.learned,
100
149
  lastRun,
101
150
  ...(pair !== undefined ? { diff: diffRuns(pair[0], pair[1]) } : {}),
102
151
  ...(runDiff === undefined ? {} : { runDiff }),
103
- };
152
+ });
104
153
  },
105
154
  },
106
155
  {
@@ -133,4 +182,3 @@ export const PROJECT_TOOLS = [
133
182
  },
134
183
  },
135
184
  ];
136
- //# sourceMappingURL=project-tools.js.map
@@ -83,4 +83,3 @@ export type ReadContractResult = {
83
83
  };
84
84
  /** Never throws. Missing → MISSING. Bad JSON / failed schema → MALFORMED. */
85
85
  export declare function readContract(fs: FileSystemPort, root: string): Promise<ReadContractResult>;
86
- //# sourceMappingURL=reticle-dir.d.ts.map
@@ -167,4 +167,3 @@ export async function readContract(fs, root) {
167
167
  return { ok: false, reason: ContractReadError.MALFORMED };
168
168
  return { ok: true, capabilities: result.data.capabilities, generatedAt: result.data.generatedAt };
169
169
  }
170
- //# sourceMappingURL=reticle-dir.js.map
@@ -27,4 +27,3 @@ export declare function computeVerdict(input: VerificationRunInput): RunVerdict;
27
27
  * input can never escape as an "artifact".
28
28
  */
29
29
  export declare function buildVerificationRun(input: VerificationRunInput, now: () => number): ReticleVerificationRun;
30
- //# sourceMappingURL=build-verification-run.d.ts.map
@@ -68,4 +68,3 @@ export function buildVerificationRun(input, now) {
68
68
  };
69
69
  return redactForProfile(ReticleVerificationRunSchema.parse(run));
70
70
  }
71
- //# sourceMappingURL=build-verification-run.js.map
@@ -13,4 +13,3 @@ export declare const REDACTED = "[redacted:prod-preview]";
13
13
  * the repair block (source-naming) is dropped and stateAssertion values are redacted.
14
14
  */
15
15
  export declare function redactForProfile(run: ReticleVerificationRun): ReticleVerificationRun;
16
- //# sourceMappingURL=profile-redact.d.ts.map
@@ -29,4 +29,3 @@ export function redactForProfile(run) {
29
29
  void repair; // intentionally dropped — fix instructions name source files
30
30
  return { ...rest, evidence };
31
31
  }
32
- //# sourceMappingURL=profile-redact.js.map
@@ -6,4 +6,3 @@
6
6
  import { type ReticleVerificationRun } from '@reticlehq/core';
7
7
  /** Render the run as a plain-text report. Sections with no content are omitted. */
8
8
  export declare function renderRunReport(run: ReticleVerificationRun): string;
9
- //# sourceMappingURL=render-report.d.ts.map
@@ -67,4 +67,3 @@ export function renderRunReport(run) {
67
67
  }
68
68
  return out.join('\n');
69
69
  }
70
- //# sourceMappingURL=render-report.js.map
@@ -14,4 +14,3 @@ export declare function deviationHeadline(deviation: unknown): string | undefine
14
14
  export declare function buildRepairPacket(replay: FlowReplayResult): RepairPacket | undefined;
15
15
  /** Build the repair packets for a set of replays (failed ones only). */
16
16
  export declare function buildRepairPackets(replays: ReadonlyArray<FlowReplayResult>): RepairPacket[];
17
- //# sourceMappingURL=repair-prompt.d.ts.map
@@ -69,4 +69,3 @@ export function buildRepairPacket(replay) {
69
69
  export function buildRepairPackets(replays) {
70
70
  return replays.map(buildRepairPacket).filter((p) => p !== undefined);
71
71
  }
72
- //# sourceMappingURL=repair-prompt.js.map
@@ -9,4 +9,3 @@ import { ReplayStatus, RunFlowStatus, type FlowReplayResult, type RunFlowResult
9
9
  export declare function runFlowStatusOf(status: ReplayStatus): RunFlowStatus;
10
10
  /** Map one replay (plus its measured duration) into a RunFlowResult for the artifact's flows[]. */
11
11
  export declare function mapReplayToFlowResult(replay: FlowReplayResult, durationMs: number): RunFlowResult;
12
- //# sourceMappingURL=replay-mapping.d.ts.map
@@ -32,4 +32,3 @@ export function mapReplayToFlowResult(replay, durationMs) {
32
32
  ...(failureReason !== undefined ? { failureReason } : {}),
33
33
  };
34
34
  }
35
- //# sourceMappingURL=replay-mapping.js.map
@@ -45,4 +45,3 @@ export declare class ReticleRunner {
45
45
  */
46
46
  verify(opts: VerifyOptions): Promise<ReticleVerificationRun>;
47
47
  }
48
- //# sourceMappingURL=reticle-runner.d.ts.map
@@ -9,6 +9,7 @@
9
9
  * top of this — the orchestration and the verdict live here so the MCP path and the API produce the
10
10
  * same artifact byte-for-byte.
11
11
  */
12
+ import { reportRunTelemetry } from '../telemetry/run-telemetry.js';
12
13
  import { buildVerificationRun } from './build-verification-run.js';
13
14
  import { mapReplayToFlowResult } from './replay-mapping.js';
14
15
  import { buildRepairPackets } from './repair-prompt.js';
@@ -50,7 +51,8 @@ export class ReticleRunner {
50
51
  evidence: { consoleErrors: [], networkAnomalies: [], stateAssertions: [], timeline: [] },
51
52
  ...(failurePackets.length > 0 ? { repair: { failurePackets } } : {}),
52
53
  };
53
- return buildVerificationRun(input, () => this.#port.now());
54
+ const run = buildVerificationRun(input, () => this.#port.now());
55
+ reportRunTelemetry(run);
56
+ return run;
54
57
  }
55
58
  }
56
- //# sourceMappingURL=reticle-runner.js.map
@@ -24,4 +24,3 @@ export declare function classifyChangedFiles(files: ReadonlyArray<ChangedFileInp
24
24
  * severity and a gated flag driven by the policy. This is what the verdict counts as blocking.
25
25
  */
26
26
  export declare function buildRisks(changedFiles: ReadonlyArray<RunChangedFile>, policy?: RiskPolicy): RunRisk[];
27
- //# sourceMappingURL=risk-classify.d.ts.map
@@ -73,4 +73,3 @@ export function buildRisks(changedFiles, policy = {}) {
73
73
  }
74
74
  return risks;
75
75
  }
76
- //# sourceMappingURL=risk-classify.js.map
@@ -31,4 +31,3 @@ export declare const DEFAULT_NOISE_FLOOR_PCT = 10;
31
31
  * console diffs land once runs persist per-step detail.
32
32
  */
33
33
  export declare function diffRuns(before: ReticleVerificationRun, after: ReticleVerificationRun, noiseFloorPct?: number): RunDiff;
34
- //# sourceMappingURL=run-diff.d.ts.map
@@ -68,4 +68,3 @@ export function diffRuns(before, after, noiseFloorPct = DEFAULT_NOISE_FLOOR_PCT)
68
68
  };
69
69
  return { ...base, headline: headlineFor(base) };
70
70
  }
71
- //# sourceMappingURL=run-diff.js.map
@@ -42,4 +42,3 @@ export declare class RunStore {
42
42
  latestTwo(): Promise<[ReticleVerificationRun, ReticleVerificationRun] | undefined>;
43
43
  }
44
44
  export {};
45
- //# sourceMappingURL=run-store.d.ts.map
@@ -135,4 +135,3 @@ export class RunStore {
135
135
  return [previous, current];
136
136
  }
137
137
  }
138
- //# sourceMappingURL=run-store.js.map
@@ -7,4 +7,3 @@ import type { ToolDef } from '../tools/tools.js';
7
7
  * reticleRoot (it is stateless), so this needs no new ToolDeps wiring.
8
8
  */
9
9
  export declare const RUN_TOOLS: ToolDef[];
10
- //# sourceMappingURL=run-tools.d.ts.map
@@ -79,4 +79,3 @@ export const RUN_TOOLS = [
79
79
  },
80
80
  },
81
81
  ];
82
- //# sourceMappingURL=run-tools.js.map
@@ -11,4 +11,3 @@ import type { RunnerPort } from './reticle-runner.js';
11
11
  export declare function defaultRunId(): RunId;
12
12
  /** Wire a RunnerPort to the live session. Pass sessionId to disambiguate when several tabs are open. */
13
13
  export declare function createRunnerPort(deps: ToolDeps, sessionId?: string): RunnerPort;
14
- //# sourceMappingURL=runner-port.d.ts.map
@@ -20,4 +20,3 @@ export function createRunnerPort(deps, sessionId) {
20
20
  newRunId: defaultRunId,
21
21
  };
22
22
  }
23
- //# sourceMappingURL=runner-port.js.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Turn an MCP verification (a `reticle_flow_verify` suite run) into a first-class ReticleVerificationRun:
3
+ * assemble the artifact from the already-computed replays, persist it to .reticle/runs/ (so
4
+ * `reticle_run_export` and CI can read it), and — when logged in (cloud creds set) — best-effort push it
5
+ * to the cloud's `POST /v1/runs` so the team's dashboard Runs tab shows what the agent just verified.
6
+ *
7
+ * This is the artifact tier that maps to the dashboard's "Runs" (the OEM/CI-consumable verdict); the
8
+ * lighter per-flow RunRecord that feeds regression memory is synced separately in flow-replay-run.ts.
9
+ * Both are best-effort + opt-in: no creds → the artifact still lands on disk, nothing leaves the machine.
10
+ */
11
+ import { type FlowReplayResult } from '@reticlehq/core';
12
+ import type { ToolDeps } from '../tools/tools.js';
13
+ /** A replay plus the wall-clock time it took — the shape the verify handler already collects. */
14
+ export interface TimedReplay {
15
+ replay: FlowReplayResult;
16
+ durationMs: number;
17
+ }
18
+ /**
19
+ * Persist the suite's run artifact and best-effort mirror it to the cloud. Never throws into the verify
20
+ * tool — a disk or network failure is logged and swallowed so the verdict the agent asked for is
21
+ * unaffected. Returns the runId (for logging/tests); undefined if nothing was produced (empty suite).
22
+ */
23
+ export declare function persistAndSyncVerificationRun(deps: ToolDeps, timed: TimedReplay[], projectId: string | undefined): Promise<string | undefined>;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Turn an MCP verification (a `reticle_flow_verify` suite run) into a first-class ReticleVerificationRun:
3
+ * assemble the artifact from the already-computed replays, persist it to .reticle/runs/ (so
4
+ * `reticle_run_export` and CI can read it), and — when logged in (cloud creds set) — best-effort push it
5
+ * to the cloud's `POST /v1/runs` so the team's dashboard Runs tab shows what the agent just verified.
6
+ *
7
+ * This is the artifact tier that maps to the dashboard's "Runs" (the OEM/CI-consumable verdict); the
8
+ * lighter per-flow RunRecord that feeds regression memory is synced separately in flow-replay-run.ts.
9
+ * Both are best-effort + opt-in: no creds → the artifact still lands on disk, nothing leaves the machine.
10
+ */
11
+ import { RunAgentKind, RunFramework, RunProfile, RunTrigger, } from '@reticlehq/core';
12
+ import { homedir } from 'node:os';
13
+ import { buildVerificationRun } from './build-verification-run.js';
14
+ import { mapReplayToFlowResult } from './replay-mapping.js';
15
+ import { defaultRunId } from './runner-port.js';
16
+ import { RunStore } from './run-store.js';
17
+ import { syncRunToCloud, SyncOutcome } from '../cloud/cloud-sync.js';
18
+ import { resolveProjectCloud } from '../cloud/cloud-config.js';
19
+ import { log } from '../log.js';
20
+ /** Assemble the ReticleVerificationRun artifact for a verify suite (pure — no IO). */
21
+ function assembleRun(deps, timed, projectId) {
22
+ const flows = timed.map((t) => mapReplayToFlowResult(t.replay, t.durationMs));
23
+ const input = {
24
+ runId: defaultRunId(),
25
+ durationMs: flows.reduce((sum, f) => sum + f.durationMs, 0),
26
+ profile: RunProfile.DEV,
27
+ project: { name: projectId ?? 'reticle', framework: RunFramework.OTHER },
28
+ agent: { id: 'reticle-mcp', kind: RunAgentKind.CODING_AGENT },
29
+ trigger: { kind: RunTrigger.MANUAL },
30
+ changedFiles: [],
31
+ flows,
32
+ checks: [],
33
+ risks: [],
34
+ evidence: { consoleErrors: [], networkAnomalies: [], stateAssertions: [], timeline: [] },
35
+ };
36
+ return buildVerificationRun(input, () => deps.now());
37
+ }
38
+ /**
39
+ * Persist the suite's run artifact and best-effort mirror it to the cloud. Never throws into the verify
40
+ * tool — a disk or network failure is logged and swallowed so the verdict the agent asked for is
41
+ * unaffected. Returns the runId (for logging/tests); undefined if nothing was produced (empty suite).
42
+ */
43
+ export async function persistAndSyncVerificationRun(deps, timed, projectId) {
44
+ if (timed.length === 0)
45
+ return undefined;
46
+ let run;
47
+ try {
48
+ run = assembleRun(deps, timed, projectId);
49
+ await new RunStore(deps.fs, deps.reticleRoot).write(run);
50
+ }
51
+ catch (error) {
52
+ log('verification-run-persist-failed', {
53
+ error: error instanceof Error ? error.message : String(error),
54
+ });
55
+ return undefined;
56
+ }
57
+ // Per-project cloud: only push when THIS project has cloud attached AND its policy allows runs.
58
+ const cloud = await resolveProjectCloud(deps.fs, deps.reticleRoot, homedir(), process.env);
59
+ if (cloud.config === null || !cloud.policy.runs)
60
+ return run.runId; // not attached / runs disabled → local only
61
+ const result = await syncRunToCloud(run, cloud.config, (url, init) => fetch(url, init));
62
+ if (result.outcome !== SyncOutcome.SYNCED) {
63
+ log('cloud-run-sync-failed', { runId: run.runId, status: result.status, error: result.error });
64
+ }
65
+ return run.runId;
66
+ }
@@ -31,4 +31,3 @@ export interface VerifyHttpResponse {
31
31
  * and returns a status + body. No sockets, no globals — a test calls it directly.
32
32
  */
33
33
  export declare function handleVerifyRequest(req: VerifyHttpRequest, runner: ReticleRunner, expectedToken: string, persist?: (run: ReticleVerificationRun) => Promise<void>): Promise<VerifyHttpResponse>;
34
- //# sourceMappingURL=verify-http.d.ts.map
@@ -99,4 +99,3 @@ export async function handleVerifyRequest(req, runner, expectedToken, persist) {
99
99
  return { status: 500, body: { error: 'verify failed' } };
100
100
  }
101
101
  }
102
- //# sourceMappingURL=verify-http.js.map
@@ -23,4 +23,3 @@ export declare function startVerifyServer(opts: VerifyServerOptions, port: numbe
23
23
  server: http.Server;
24
24
  port: number;
25
25
  }>;
26
- //# sourceMappingURL=verify-server.d.ts.map
@@ -96,4 +96,3 @@ export function startVerifyServer(opts, port) {
96
96
  });
97
97
  });
98
98
  }
99
- //# sourceMappingURL=verify-server.js.map
@@ -5,4 +5,3 @@ export declare const SERVER_VERSION: string;
5
5
  * drift. Self-update installs THIS (never `@reticlehq/core`, which is schema-only and has no bin).
6
6
  */
7
7
  export declare const RETICLE_NPM_PACKAGE: string;
8
- //# sourceMappingURL=server-version.d.ts.map
@@ -7,4 +7,3 @@ export const SERVER_VERSION = _pkg.version;
7
7
  * drift. Self-update installs THIS (never `@reticlehq/core`, which is schema-only and has no bin).
8
8
  */
9
9
  export const RETICLE_NPM_PACKAGE = _pkg.name;
10
- //# sourceMappingURL=server-version.js.map
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Turn a bare command timeout into something the reader can act on.
3
+ *
4
+ * The default message — `command 'snapshot' timed out after 8000ms` — is eight seconds of silence
5
+ * followed by a fact with no cause. For a Tauri app the cause is usually not a bug in the app: its
6
+ * window was hidden before the webview had ever been PRESENTED, and a webview that has never been
7
+ * presented never loads its page. The session stays connected, so nothing looks wrong, and the
8
+ * developer goes hunting through their own code for a fault that is not there.
9
+ *
10
+ * This advice previously blamed occlusion — "macOS suspends an occluded or off-Space WKWebView" —
11
+ * which is false, and was the kind of wrong steer this function exists to prevent. A LOADED Tauri
12
+ * webview keeps answering while minimized, app-hidden, occluded, and on another Space.
13
+ *
14
+ * It then over-corrected: it asserted the hidden-before-load ordering as FACT. But the only evidence
15
+ * here is `hidden === true` — the ordering is never observed. Measured on a Tauri shell pointed at an
16
+ * external http origin, whose window nothing ever hid: the message confidently prescribed a fix for a
17
+ * mistake that had not been made, and two rounds of debugging went into the wrong place. A diagnostic
18
+ * that names the wrong cause is worse than a bare timeout, because the bare timeout at least sends
19
+ * the reader looking. So this now reports what is KNOWN and ranks the causes rather than picking one.
20
+ *
21
+ * The advice is ADDED, never substituted — the original fact still leads — and only for a runtime
22
+ * that can actually suffer it, since misdirecting an Electron user costs them the same hour.
23
+ */
24
+ /** What the page told us about its shell, via PAGE_HEALTH. Undefined before the first report. */
25
+ export type PageRuntime = 'electron' | 'tauri' | 'web';
26
+ export interface TimeoutContext {
27
+ url: string;
28
+ /** The page's own last visibility report. */
29
+ hidden: boolean;
30
+ /** Reported by the SDK. A URL cannot distinguish a Tauri dev server from a plain localhost app. */
31
+ runtime?: PageRuntime;
32
+ /** ms since ANY inbound message from the SDK. Small = the page is demonstrably still running. */
33
+ lastSeenMs?: number;
34
+ }
35
+ export declare function commandTimeoutMessage(name: string, timeoutMs: number, context: TimeoutContext): string;
@@ -0,0 +1,41 @@
1
+ import { isOpaqueOrigin } from '@reticlehq/core';
2
+ /**
3
+ * Inbound silence beyond this means the page may genuinely be wedged; inside it, the SDK has spoken
4
+ * recently enough that "the page is hung" is provably the wrong story. A page that is streaming
5
+ * events is executing JavaScript by definition.
6
+ */
7
+ const RECENTLY_HEARD_MS = 2000;
8
+ const ONE_WAY_ADVICE = 'The page is ALIVE — the SDK last reported to the bridge %MS%ms ago — but it is not answering ' +
9
+ 'commands. A page that is still sending is executing JavaScript, so it is not hung, hidden or ' +
10
+ 'suspended: messages are getting OUT and not back IN. Look at the bridge→page direction (a socket ' +
11
+ 'replaced mid-session, a proxy buffering one way) rather than at your app.';
12
+ const HIDDEN_ADVICE = 'The page last reported itself hidden, and this is a WKWebView (Tauri) window, so the webview is ' +
13
+ 'most likely not running the page at all. Two known causes, commonest first: (1) the window was ' +
14
+ 'hidden BEFORE its first page load — a webview that has never been presented never loads, so hide ' +
15
+ 'it from `on_page_load` instead of `setup` (see `reticle_tauri::on_page_load`, which does this for ' +
16
+ 'RETICLE_HEADLESS=1); once the page HAS loaded, hiding it is safe. (2) the window never presented ' +
17
+ 'for another reason — check that it is declared with a visible size and that the page URL actually ' +
18
+ 'loaded. If neither fits, the page is reachable but not executing, which is worth reporting.';
19
+ /** True when this session is a WebKit desktop shell — the only runtime that suffers this. */
20
+ function isWebKitDesktop(context) {
21
+ if (context.runtime === 'tauri')
22
+ return true;
23
+ // A `tauri://` origin is unambiguous even before the first health report lands.
24
+ if (context.runtime !== undefined)
25
+ return false;
26
+ return isOpaqueOrigin(context.url) && context.url.startsWith('tauri:');
27
+ }
28
+ export function commandTimeoutMessage(name, timeoutMs, context) {
29
+ const base = `command '${name}' timed out after ${String(timeoutMs)}ms`;
30
+ // Checked FIRST, and it overrides the visibility story: a page that was heard from moments ago is
31
+ // executing JavaScript, so "hidden, hung or never presented" cannot be the explanation whatever
32
+ // `hidden` says. Deduced from the invariant, not from a measured incident — the Tauri case that
33
+ // prompted it turned out to go fully silent instead, which this branch correctly does not claim.
34
+ const heard = context.lastSeenMs;
35
+ if (heard !== undefined && heard <= RECENTLY_HEARD_MS) {
36
+ return `${base}. ${ONE_WAY_ADVICE.replace('%MS%', String(heard))}`;
37
+ }
38
+ if (!context.hidden || !isWebKitDesktop(context))
39
+ return base;
40
+ return `${base}. ${HIDDEN_ADVICE}`;
41
+ }
@@ -9,9 +9,9 @@ interface ControlEnvelope {
9
9
  }
10
10
  /**
11
11
  * Agent-readable hint returned when an action is refused mid-pause. Named, not free — the agent's
12
- * recovery path (address the guidance, then reticle_resume) lives here in exactly one place.
12
+ * recovery path (address the guidance, then reticle_session{action:"resume"}) lives here in exactly one place.
13
13
  */
14
- export declare const PAUSE_HINT = "Paused by the human. Address the guidance, then call reticle_resume (or wait for the human to resume).";
14
+ export declare const PAUSE_HINT = "Paused by the human. Address the guidance, then call reticle_session{action:\"resume\"} (or wait for the human to resume).";
15
15
  /** Shape returned by the short-circuit when an action tool refuses while paused. */
16
16
  interface PausedResult {
17
17
  paused: true;
@@ -54,4 +54,3 @@ export declare function pausedShortCircuit(session: Session): PausedResult | und
54
54
  */
55
55
  export declare function withControl<T extends object>(session: Session, result: T): T & ControlSpread;
56
56
  export {};
57
- //# sourceMappingURL=control-envelope.d.ts.map
@@ -2,9 +2,9 @@ import { SessionState } from '@reticlehq/core';
2
2
  import { z } from 'zod';
3
3
  /**
4
4
  * Agent-readable hint returned when an action is refused mid-pause. Named, not free — the agent's
5
- * recovery path (address the guidance, then reticle_resume) lives here in exactly one place.
5
+ * recovery path (address the guidance, then reticle_session{action:"resume"}) lives here in exactly one place.
6
6
  */
7
- export const PAUSE_HINT = 'Paused by the human. Address the guidance, then call reticle_resume (or wait for the human to resume).';
7
+ export const PAUSE_HINT = 'Paused by the human. Address the guidance, then call reticle_session{action:"resume"} (or wait for the human to resume).';
8
8
  /**
9
9
  * outputSchema fields every action tool that can short-circuit on pause MUST declare, or a validating
10
10
  * profile strips the WHOLE pause payload — and because `guidance` is drained-once, that loses the
@@ -53,4 +53,3 @@ export function withControl(session, result) {
53
53
  const control = buildControlEnvelope(session);
54
54
  return control === undefined ? result : { ...result, control };
55
55
  }
56
- //# sourceMappingURL=control-envelope.js.map
@@ -0,0 +1,31 @@
1
+ /**
2
+ * What the most recent action was, kept so a LATER tool call can judge the window it opened.
3
+ *
4
+ * Reticle's act and observe tools are separate calls by design — act returns a cursor immediately and
5
+ * the agent decides when to look. That split means the tool doing the judging holds none of the facts
6
+ * the tool doing the acting measured, and every honesty check that needs both has to bridge the gap
7
+ * somewhere. This is that somewhere.
8
+ *
9
+ * - **cursor** — the evaluation floor for wait_for/assert, so a signal buffered BEFORE the act can
10
+ * never fake a later pass.
11
+ * - **source** — where the acted control is written, for failures that have no element left to point
12
+ * at because the action unmounted it.
13
+ * - **action + mutatedWithin** — what was done and how much changed inside the target. Without these
14
+ * the "this click did nothing" check is unreachable on the ordinary act-then-observe flow: an
15
+ * empty-window test is a statement about the PAGE, and no real app has a quiet page.
16
+ */
17
+ export interface ActEffect {
18
+ action?: string | undefined;
19
+ /** DOM mutations inside the acted element's own subtree. Undefined means nobody measured. */
20
+ mutatedWithin?: number | undefined;
21
+ }
22
+ export declare class LastAct {
23
+ #private;
24
+ markCursor(cursor: number): void;
25
+ cursor(): number | undefined;
26
+ markSource(source: string | undefined): void;
27
+ source(): string | undefined;
28
+ markEffect(action: string | undefined, mutatedWithin: number | undefined): void;
29
+ /** Empty when nothing has acted — callers then fall back to checks that need no action context. */
30
+ effect(): ActEffect;
31
+ }
@@ -0,0 +1,24 @@
1
+ export class LastAct {
2
+ #cursor;
3
+ #source;
4
+ #effect;
5
+ markCursor(cursor) {
6
+ this.#cursor = cursor;
7
+ }
8
+ cursor() {
9
+ return this.#cursor;
10
+ }
11
+ markSource(source) {
12
+ this.#source = source;
13
+ }
14
+ source() {
15
+ return this.#source;
16
+ }
17
+ markEffect(action, mutatedWithin) {
18
+ this.#effect = { action, mutatedWithin };
19
+ }
20
+ /** Empty when nothing has acted — callers then fall back to checks that need no action context. */
21
+ effect() {
22
+ return this.#effect ?? {};
23
+ }
24
+ }
@@ -13,4 +13,3 @@ import type { ToolDef } from '../tools/tools.js';
13
13
  * elapsed clock at enqueue time.
14
14
  */
15
15
  export declare const LIVE_CONTROL_TOOLS: ToolDef[];
16
- //# sourceMappingURL=live-control-tools.d.ts.map
@@ -26,7 +26,7 @@ export const LIVE_CONTROL_TOOLS = [
26
26
  name: ReticleTool.END_SESSION,
27
27
  description: 'End this session for good — use ONLY when the whole task is complete. Sets state "ended" ' +
28
28
  '(calm, terminal) and shows the optional `summary` on the panel. If you are just finishing a ' +
29
- 'turn or waiting on the human, call reticle_yield instead (revivable). Idempotent.',
29
+ 'turn or waiting on the human, call reticle_session{action:"yield"} instead (revivable). Idempotent.',
30
30
  inputSchema: { summary: z.string().optional(), ...sessionIdShape },
31
31
  outputSchema: { ended: z.boolean(), sessionId: z.string() },
32
32
  handler: (deps, args) => {
@@ -43,7 +43,7 @@ export const LIVE_CONTROL_TOOLS = [
43
43
  'mode:"waiting" = you are done responding and will continue on their next message. ' +
44
44
  'mode:"ask" = you are blocked and need an answer first; put the question in `note` so it shows ' +
45
45
  'on the panel. The session is REVIVED automatically on your next tool call, so you never need to ' +
46
- 'reopen it. Use reticle_end_session instead only when the whole task is truly complete.',
46
+ 'reopen it. Use reticle_session{action:"end"} instead only when the whole task is truly complete.',
47
47
  inputSchema: {
48
48
  mode: z
49
49
  .enum([PresenterTone.WAITING, PresenterTone.ASK])
@@ -194,6 +194,5 @@ function buildFixHint(m) {
194
194
  : m.label !== undefined
195
195
  ? `Find the "${m.label}" element`
196
196
  : 'Find the flagged element';
197
- return `${where} and fix: ${m.note}. Then call reticle_review { resolve: "${m.id}" }.`;
197
+ return `${where} and fix: ${m.note}. Then call reticle_session { action: "review", resolve: "${m.id}" }.`;
198
198
  }
199
- //# sourceMappingURL=live-control-tools.js.map
@@ -35,4 +35,3 @@ export declare class LiveControl {
35
35
  */
36
36
  nextStateFor(data: HumanControlData): SessionState | undefined;
37
37
  }
38
- //# sourceMappingURL=live-control.d.ts.map