@reticlehq/server 2.2.1 → 2.4.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 (790) 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 +102 -12
  6. package/dist/bridge.test-harness.d.ts +5 -1
  7. package/dist/bridge.test-harness.js +12 -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 +47 -3
  27. package/dist/cli-parse.js +147 -13
  28. package/dist/cli-port.d.ts +3 -1
  29. package/dist/cli-port.js +21 -1
  30. package/dist/cli-verify.d.ts +0 -1
  31. package/dist/cli-verify.js +1 -2
  32. package/dist/cli.d.ts +0 -1
  33. package/dist/cli.js +88 -69
  34. package/dist/cloud/cloud-config.d.ts +0 -1
  35. package/dist/cloud/cloud-config.js +0 -1
  36. package/dist/cloud/cloud-sync.d.ts +4 -5
  37. package/dist/cloud/cloud-sync.js +0 -1
  38. package/dist/cloud-cli.d.ts +0 -1
  39. package/dist/cloud-cli.js +9 -2
  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 +36 -24
  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 -7
  99. package/dist/flows/decision.js +47 -7
  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 +2 -3
  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 +44 -14
  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 +0 -1
  139. package/dist/flows/server-verify.js +0 -1
  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/capabilities.d.ts +17 -0
  167. package/dist/init/capabilities.js +51 -0
  168. package/dist/init/cursor.d.ts +0 -1
  169. package/dist/init/cursor.js +0 -1
  170. package/dist/init/desktop-doctor.d.ts +40 -0
  171. package/dist/init/desktop-doctor.js +198 -0
  172. package/dist/init/detect.d.ts +25 -1
  173. package/dist/init/detect.js +65 -4
  174. package/dist/init/mcp.d.ts +0 -1
  175. package/dist/init/mcp.js +0 -1
  176. package/dist/init/next-patch.d.ts +41 -0
  177. package/dist/init/next-patch.js +106 -0
  178. package/dist/init/node-io.d.ts +0 -1
  179. package/dist/init/node-io.js +25 -1
  180. package/dist/init/patch-kind.d.ts +20 -0
  181. package/dist/init/patch-kind.js +10 -0
  182. package/dist/init/plan-framework.d.ts +35 -0
  183. package/dist/init/plan-framework.js +217 -0
  184. package/dist/init/plan.d.ts +55 -4
  185. package/dist/init/plan.js +130 -112
  186. package/dist/init/project-id.d.ts +0 -1
  187. package/dist/init/project-id.js +0 -1
  188. package/dist/init/run.d.ts +17 -1
  189. package/dist/init/run.js +237 -18
  190. package/dist/init/slash-command.d.ts +18 -0
  191. package/dist/init/slash-command.js +52 -0
  192. package/dist/init/snippets.d.ts +48 -3
  193. package/dist/init/snippets.js +156 -6
  194. package/dist/init/vite-config.d.ts +4 -11
  195. package/dist/init/vite-config.js +15 -8
  196. package/dist/input/driven-redaction.d.ts +15 -0
  197. package/dist/input/driven-redaction.js +76 -0
  198. package/dist/input/network-detail.d.ts +9 -4
  199. package/dist/input/network-detail.js +35 -16
  200. package/dist/input/network-mock-tools.d.ts +0 -1
  201. package/dist/input/network-mock-tools.js +3 -4
  202. package/dist/input/network-mock.d.ts +0 -1
  203. package/dist/input/network-mock.js +0 -1
  204. package/dist/input/real-input.d.ts +14 -1
  205. package/dist/input/real-input.js +45 -3
  206. package/dist/input/scroll-find.d.ts +0 -1
  207. package/dist/input/scroll-find.js +0 -1
  208. package/dist/input/scroll-tools.d.ts +0 -1
  209. package/dist/input/scroll-tools.js +0 -1
  210. package/dist/input/viewport-tools.d.ts +0 -1
  211. package/dist/input/viewport-tools.js +3 -4
  212. package/dist/journal/ambient-store.d.ts +0 -1
  213. package/dist/journal/ambient-store.js +0 -1
  214. package/dist/journal/ambient.d.ts +0 -1
  215. package/dist/journal/ambient.js +0 -1
  216. package/dist/journal/attach-journal.d.ts +0 -1
  217. package/dist/journal/attach-journal.js +0 -1
  218. package/dist/journal/deviation-report.d.ts +0 -1
  219. package/dist/journal/deviation-report.js +0 -1
  220. package/dist/journal/deviation-service.d.ts +0 -1
  221. package/dist/journal/deviation-service.js +0 -1
  222. package/dist/journal/envelope-store.d.ts +0 -1
  223. package/dist/journal/envelope-store.js +0 -1
  224. package/dist/journal/envelope.d.ts +8 -9
  225. package/dist/journal/envelope.js +0 -1
  226. package/dist/journal/journal-query.d.ts +0 -1
  227. package/dist/journal/journal-query.js +0 -1
  228. package/dist/journal/journal-recorder.d.ts +0 -1
  229. package/dist/journal/journal-recorder.js +0 -1
  230. package/dist/journal/retention.d.ts +0 -1
  231. package/dist/journal/retention.js +0 -1
  232. package/dist/journal/rollups.d.ts +0 -1
  233. package/dist/journal/rollups.js +0 -1
  234. package/dist/journal/session-end.d.ts +0 -1
  235. package/dist/journal/session-end.js +0 -1
  236. package/dist/journal/session-journal.d.ts +0 -1
  237. package/dist/journal/session-journal.js +0 -1
  238. package/dist/license/license.d.ts +0 -1
  239. package/dist/license/license.js +0 -1
  240. package/dist/log.d.ts +0 -1
  241. package/dist/log.js +0 -1
  242. package/dist/mcp-proxy.d.ts +35 -4
  243. package/dist/mcp-proxy.js +174 -28
  244. package/dist/mcp.d.ts +15 -1
  245. package/dist/mcp.js +145 -17
  246. package/dist/oracles/flow-instrument-gaps.d.ts +0 -1
  247. package/dist/oracles/flow-instrument-gaps.js +0 -1
  248. package/dist/oracles/propose-consequences.d.ts +0 -1
  249. package/dist/oracles/propose-consequences.js +0 -1
  250. package/dist/oracles/self-instrument.d.ts +0 -1
  251. package/dist/oracles/self-instrument.js +0 -1
  252. package/dist/pairing-token.d.ts +0 -1
  253. package/dist/pairing-token.js +0 -1
  254. package/dist/phenomena/phenomena.d.ts +0 -1
  255. package/dist/phenomena/phenomena.js +0 -1
  256. package/dist/pool/browser-pool.d.ts +0 -1
  257. package/dist/pool/browser-pool.js +0 -1
  258. package/dist/pool/lease-reaper.d.ts +0 -1
  259. package/dist/pool/lease-reaper.js +0 -1
  260. package/dist/pool/playwright-launcher.d.ts +0 -1
  261. package/dist/pool/playwright-launcher.js +10 -2
  262. package/dist/project/baselines.d.ts +0 -1
  263. package/dist/project/baselines.js +0 -1
  264. package/dist/project/file-lock.d.ts +2 -1
  265. package/dist/project/file-lock.js +12 -2
  266. package/dist/project/fs-port.d.ts +0 -1
  267. package/dist/project/fs-port.js +0 -1
  268. package/dist/project/project-store.d.ts +0 -1
  269. package/dist/project/project-store.js +0 -1
  270. package/dist/project/project-tools.d.ts +0 -1
  271. package/dist/project/project-tools.js +29 -4
  272. package/dist/project/reticle-dir.d.ts +0 -1
  273. package/dist/project/reticle-dir.js +0 -1
  274. package/dist/runs/build-verification-run.d.ts +0 -1
  275. package/dist/runs/build-verification-run.js +0 -1
  276. package/dist/runs/profile-redact.d.ts +0 -1
  277. package/dist/runs/profile-redact.js +0 -1
  278. package/dist/runs/render-report.d.ts +0 -1
  279. package/dist/runs/render-report.js +0 -1
  280. package/dist/runs/repair-prompt.d.ts +0 -1
  281. package/dist/runs/repair-prompt.js +0 -1
  282. package/dist/runs/replay-mapping.d.ts +0 -1
  283. package/dist/runs/replay-mapping.js +0 -1
  284. package/dist/runs/reticle-runner.d.ts +0 -1
  285. package/dist/runs/reticle-runner.js +4 -2
  286. package/dist/runs/risk-classify.d.ts +0 -1
  287. package/dist/runs/risk-classify.js +0 -1
  288. package/dist/runs/run-diff.d.ts +0 -1
  289. package/dist/runs/run-diff.js +0 -1
  290. package/dist/runs/run-store.d.ts +0 -1
  291. package/dist/runs/run-store.js +0 -1
  292. package/dist/runs/run-tools.d.ts +0 -1
  293. package/dist/runs/run-tools.js +0 -1
  294. package/dist/runs/runner-port.d.ts +0 -1
  295. package/dist/runs/runner-port.js +0 -1
  296. package/dist/runs/verification-sync.d.ts +0 -1
  297. package/dist/runs/verification-sync.js +0 -1
  298. package/dist/runs/verify-http.d.ts +0 -1
  299. package/dist/runs/verify-http.js +0 -1
  300. package/dist/runs/verify-server.d.ts +0 -1
  301. package/dist/runs/verify-server.js +0 -1
  302. package/dist/server-version.d.ts +0 -1
  303. package/dist/server-version.js +0 -1
  304. package/dist/session/command-timeout.d.ts +35 -0
  305. package/dist/session/command-timeout.js +41 -0
  306. package/dist/session/control-envelope.d.ts +2 -3
  307. package/dist/session/control-envelope.js +2 -3
  308. package/dist/session/last-act.d.ts +31 -0
  309. package/dist/session/last-act.js +24 -0
  310. package/dist/session/live-control-tools.d.ts +0 -1
  311. package/dist/session/live-control-tools.js +3 -4
  312. package/dist/session/live-control.d.ts +0 -1
  313. package/dist/session/live-control.js +0 -1
  314. package/dist/session/observed-state.d.ts +12 -2
  315. package/dist/session/observed-state.js +29 -2
  316. package/dist/session/output-budget.d.ts +0 -1
  317. package/dist/session/output-budget.js +0 -1
  318. package/dist/session/pending-commands.d.ts +12 -0
  319. package/dist/session/pending-commands.js +36 -0
  320. package/dist/session/presenter-args.d.ts +0 -1
  321. package/dist/session/presenter-args.js +0 -1
  322. package/dist/session/review-store.d.ts +0 -1
  323. package/dist/session/review-store.js +0 -1
  324. package/dist/session/session-health.d.ts +26 -2
  325. package/dist/session/session-health.js +13 -1
  326. package/dist/session/session-info.d.ts +29 -0
  327. package/dist/session/session-info.js +1 -0
  328. package/dist/session/session-lease.d.ts +25 -0
  329. package/dist/session/session-lease.js +14 -0
  330. package/dist/session/session-manager.d.ts +7 -19
  331. package/dist/session/session-manager.js +35 -2
  332. package/dist/session/session-readiness.d.ts +0 -1
  333. package/dist/session/session-readiness.js +3 -4
  334. package/dist/session/session-reaper.d.ts +0 -1
  335. package/dist/session/session-reaper.js +0 -1
  336. package/dist/session/session-recommendation.d.ts +0 -1
  337. package/dist/session/session-recommendation.js +0 -1
  338. package/dist/session/session-tools.d.ts +0 -1
  339. package/dist/session/session-tools.js +2 -3
  340. package/dist/session/session.d.ts +33 -53
  341. package/dist/session/session.js +102 -66
  342. package/dist/session/state-select.d.ts +0 -1
  343. package/dist/session/state-select.js +0 -1
  344. package/dist/telemetry/argument-shape.d.ts +41 -0
  345. package/dist/telemetry/argument-shape.js +87 -0
  346. package/dist/telemetry/bug-found.d.ts +33 -0
  347. package/dist/telemetry/bug-found.js +95 -0
  348. package/dist/telemetry/cli-telemetry.d.ts +13 -0
  349. package/dist/telemetry/cli-telemetry.js +43 -0
  350. package/dist/telemetry/connect-failure.d.ts +16 -0
  351. package/dist/telemetry/connect-failure.js +44 -0
  352. package/dist/telemetry/daemon-telemetry.d.ts +19 -0
  353. package/dist/telemetry/daemon-telemetry.js +76 -0
  354. package/dist/telemetry/dev-repo.d.ts +10 -0
  355. package/dist/telemetry/dev-repo.js +80 -0
  356. package/dist/telemetry/error-fingerprint.d.ts +24 -0
  357. package/dist/telemetry/error-fingerprint.js +88 -0
  358. package/dist/telemetry/feedback-cli.d.ts +31 -0
  359. package/dist/telemetry/feedback-cli.js +102 -0
  360. package/dist/telemetry/feedback-context.d.ts +32 -0
  361. package/dist/telemetry/feedback-context.js +143 -0
  362. package/dist/telemetry/feedback.d.ts +66 -0
  363. package/dist/telemetry/feedback.js +175 -0
  364. package/dist/telemetry/git-facts.d.ts +21 -0
  365. package/dist/telemetry/git-facts.js +109 -0
  366. package/dist/telemetry/identify.d.ts +22 -0
  367. package/dist/telemetry/identify.js +73 -0
  368. package/dist/telemetry/init-telemetry.d.ts +26 -0
  369. package/dist/telemetry/init-telemetry.js +33 -0
  370. package/dist/telemetry/machine-snapshot.d.ts +6 -0
  371. package/dist/telemetry/machine-snapshot.js +39 -0
  372. package/dist/telemetry/mcp-connection.d.ts +5 -0
  373. package/dist/telemetry/mcp-connection.js +44 -0
  374. package/dist/telemetry/project-profile.d.ts +44 -0
  375. package/dist/telemetry/project-profile.js +205 -0
  376. package/dist/telemetry/run-telemetry.d.ts +21 -0
  377. package/dist/telemetry/run-telemetry.js +62 -0
  378. package/dist/telemetry/session-metrics.d.ts +103 -0
  379. package/dist/telemetry/session-metrics.js +329 -0
  380. package/dist/telemetry/telemetry.d.ts +35 -8
  381. package/dist/telemetry/telemetry.js +105 -12
  382. package/dist/token-auth.d.ts +0 -1
  383. package/dist/token-auth.js +0 -1
  384. package/dist/tools/act-capsule.d.ts +23 -0
  385. package/dist/tools/act-capsule.js +47 -0
  386. package/dist/tools/act-danger.d.ts +7 -0
  387. package/dist/tools/act-danger.js +44 -0
  388. package/dist/tools/act-helpers.d.ts +17 -0
  389. package/dist/tools/act-helpers.js +40 -0
  390. package/dist/tools/act-tools.d.ts +8 -1
  391. package/dist/tools/act-tools.js +96 -98
  392. package/dist/tools/act-view.d.ts +7 -1
  393. package/dist/tools/act-view.js +13 -1
  394. package/dist/tools/assert-grade.d.ts +22 -1
  395. package/dist/tools/assert-grade.js +46 -1
  396. package/dist/tools/assert-verdict.d.ts +21 -0
  397. package/dist/tools/assert-verdict.js +62 -0
  398. package/dist/tools/browser-tools.d.ts +0 -1
  399. package/dist/tools/browser-tools.js +2 -2
  400. package/dist/tools/contract-tools.d.ts +0 -1
  401. package/dist/tools/contract-tools.js +0 -1
  402. package/dist/tools/coverage-tools.d.ts +9 -0
  403. package/dist/tools/coverage-tools.js +92 -0
  404. package/dist/tools/dynamic-tools.d.ts +0 -1
  405. package/dist/tools/dynamic-tools.js +21 -2
  406. package/dist/tools/error-recovery.d.ts +18 -2
  407. package/dist/tools/error-recovery.js +42 -7
  408. package/dist/tools/feedback-tools.d.ts +24 -0
  409. package/dist/tools/feedback-tools.js +180 -0
  410. package/dist/tools/invoke-tool.d.ts +0 -1
  411. package/dist/tools/invoke-tool.js +115 -5
  412. package/dist/tools/lease-tools.d.ts +0 -1
  413. package/dist/tools/lease-tools.js +6 -5
  414. package/dist/tools/merge-tools.d.ts +0 -1
  415. package/dist/tools/merge-tools.js +0 -1
  416. package/dist/tools/observe-tools.d.ts +0 -1
  417. package/dist/tools/observe-tools.js +91 -39
  418. package/dist/tools/profiles.d.ts +1 -2
  419. package/dist/tools/profiles.js +43 -16
  420. package/dist/tools/query-paginate.d.ts +0 -1
  421. package/dist/tools/query-paginate.js +0 -1
  422. package/dist/tools/read-tools.d.ts +0 -1
  423. package/dist/tools/read-tools.js +14 -8
  424. package/dist/tools/reconcile-tools.d.ts +2 -0
  425. package/dist/tools/reconcile-tools.js +111 -0
  426. package/dist/tools/snapshot-delta.d.ts +0 -1
  427. package/dist/tools/snapshot-delta.js +0 -0
  428. package/dist/tools/tool-invoker.d.ts +0 -1
  429. package/dist/tools/tool-invoker.js +0 -1
  430. package/dist/tools/tool-kit.d.ts +16 -1
  431. package/dist/tools/tool-kit.js +8 -2
  432. package/dist/tools/tool-names.d.ts +6 -1
  433. package/dist/tools/tool-names.js +6 -1
  434. package/dist/tools/tools-helpers.d.ts +0 -1
  435. package/dist/tools/tools-helpers.js +0 -1
  436. package/dist/tools/tools.d.ts +0 -1
  437. package/dist/tools/tools.js +24 -4
  438. package/dist/update/update-checker.d.ts +0 -1
  439. package/dist/update/update-checker.js +0 -1
  440. package/dist/update/update-nudge.d.ts +20 -0
  441. package/dist/update/update-nudge.js +72 -0
  442. package/dist/update/updater.d.ts +14 -1
  443. package/dist/update/updater.js +33 -2
  444. package/dist/visual/visual-diff.d.ts +0 -1
  445. package/dist/visual/visual-diff.js +0 -1
  446. package/dist/visual/visual-store.d.ts +0 -1
  447. package/dist/visual/visual-store.js +0 -1
  448. package/dist/visual/visual-tools.d.ts +0 -1
  449. package/dist/visual/visual-tools.js +103 -16
  450. package/package.json +2 -2
  451. package/dist/bridge-security.d.ts.map +0 -1
  452. package/dist/bridge-security.js.map +0 -1
  453. package/dist/bridge.d.ts.map +0 -1
  454. package/dist/bridge.js.map +0 -1
  455. package/dist/bridge.test-harness.d.ts.map +0 -1
  456. package/dist/bridge.test-harness.js.map +0 -1
  457. package/dist/capsule/capsule-store.d.ts.map +0 -1
  458. package/dist/capsule/capsule-store.js.map +0 -1
  459. package/dist/capsule/capsule.d.ts.map +0 -1
  460. package/dist/capsule/capsule.js.map +0 -1
  461. package/dist/capsule/causal-summary.d.ts.map +0 -1
  462. package/dist/capsule/causal-summary.js.map +0 -1
  463. package/dist/capsule/divergence.d.ts.map +0 -1
  464. package/dist/capsule/divergence.js.map +0 -1
  465. package/dist/capsule/minimize.d.ts.map +0 -1
  466. package/dist/capsule/minimize.js.map +0 -1
  467. package/dist/capsule/predicate-to-links.d.ts.map +0 -1
  468. package/dist/capsule/predicate-to-links.js.map +0 -1
  469. package/dist/cli-flow-commands.d.ts.map +0 -1
  470. package/dist/cli-flow-commands.js.map +0 -1
  471. package/dist/cli-launch.d.ts.map +0 -1
  472. package/dist/cli-launch.js.map +0 -1
  473. package/dist/cli-parse.d.ts.map +0 -1
  474. package/dist/cli-parse.js.map +0 -1
  475. package/dist/cli-port.d.ts.map +0 -1
  476. package/dist/cli-port.js.map +0 -1
  477. package/dist/cli-verify.d.ts.map +0 -1
  478. package/dist/cli-verify.js.map +0 -1
  479. package/dist/cli.d.ts.map +0 -1
  480. package/dist/cli.js.map +0 -1
  481. package/dist/cloud/cloud-config.d.ts.map +0 -1
  482. package/dist/cloud/cloud-config.js.map +0 -1
  483. package/dist/cloud/cloud-sync.d.ts.map +0 -1
  484. package/dist/cloud/cloud-sync.js.map +0 -1
  485. package/dist/cloud-cli.d.ts.map +0 -1
  486. package/dist/cloud-cli.js.map +0 -1
  487. package/dist/crawl/crawl-tools.d.ts.map +0 -1
  488. package/dist/crawl/crawl-tools.js.map +0 -1
  489. package/dist/crawl/crawl.d.ts.map +0 -1
  490. package/dist/crawl/crawl.js.map +0 -1
  491. package/dist/daemon-resilience.d.ts.map +0 -1
  492. package/dist/daemon-resilience.js.map +0 -1
  493. package/dist/daemon.d.ts.map +0 -1
  494. package/dist/daemon.js.map +0 -1
  495. package/dist/domain/domain-model.d.ts.map +0 -1
  496. package/dist/domain/domain-model.js.map +0 -1
  497. package/dist/domain/domain-tools.d.ts.map +0 -1
  498. package/dist/domain/domain-tools.js.map +0 -1
  499. package/dist/domain/flow-risk.d.ts.map +0 -1
  500. package/dist/domain/flow-risk.js.map +0 -1
  501. package/dist/ee/audit-log.d.ts.map +0 -1
  502. package/dist/ee/audit-log.js.map +0 -1
  503. package/dist/events/event-filters.d.ts.map +0 -1
  504. package/dist/events/event-filters.js.map +0 -1
  505. package/dist/events/predicate-eval.d.ts.map +0 -1
  506. package/dist/events/predicate-eval.js.map +0 -1
  507. package/dist/events/predicate.d.ts.map +0 -1
  508. package/dist/events/predicate.js.map +0 -1
  509. package/dist/events/reaction.d.ts.map +0 -1
  510. package/dist/events/reaction.js.map +0 -1
  511. package/dist/events/ring-buffer.d.ts.map +0 -1
  512. package/dist/events/ring-buffer.js.map +0 -1
  513. package/dist/flows/affected.d.ts.map +0 -1
  514. package/dist/flows/affected.js.map +0 -1
  515. package/dist/flows/annotate-tools.d.ts.map +0 -1
  516. package/dist/flows/annotate-tools.js.map +0 -1
  517. package/dist/flows/annotate.d.ts.map +0 -1
  518. package/dist/flows/annotate.js.map +0 -1
  519. package/dist/flows/annotation-store.d.ts.map +0 -1
  520. package/dist/flows/annotation-store.js.map +0 -1
  521. package/dist/flows/assertion-integrity.d.ts.map +0 -1
  522. package/dist/flows/assertion-integrity.js.map +0 -1
  523. package/dist/flows/assertion-tiers-store.d.ts.map +0 -1
  524. package/dist/flows/assertion-tiers-store.js.map +0 -1
  525. package/dist/flows/buddy-status.d.ts.map +0 -1
  526. package/dist/flows/buddy-status.js.map +0 -1
  527. package/dist/flows/coverage.d.ts.map +0 -1
  528. package/dist/flows/coverage.js.map +0 -1
  529. package/dist/flows/decision.d.ts.map +0 -1
  530. package/dist/flows/decision.js.map +0 -1
  531. package/dist/flows/flake-store.d.ts.map +0 -1
  532. package/dist/flows/flake-store.js.map +0 -1
  533. package/dist/flows/flake.d.ts.map +0 -1
  534. package/dist/flows/flake.js.map +0 -1
  535. package/dist/flows/flow-classify.d.ts.map +0 -1
  536. package/dist/flows/flow-classify.js.map +0 -1
  537. package/dist/flows/flow-replay-run.d.ts.map +0 -1
  538. package/dist/flows/flow-replay-run.js.map +0 -1
  539. package/dist/flows/flow-replay.d.ts.map +0 -1
  540. package/dist/flows/flow-replay.js.map +0 -1
  541. package/dist/flows/flow-report.d.ts.map +0 -1
  542. package/dist/flows/flow-report.js.map +0 -1
  543. package/dist/flows/flow-scope.d.ts.map +0 -1
  544. package/dist/flows/flow-scope.js.map +0 -1
  545. package/dist/flows/flow-sources.d.ts.map +0 -1
  546. package/dist/flows/flow-sources.js.map +0 -1
  547. package/dist/flows/flow-success.d.ts.map +0 -1
  548. package/dist/flows/flow-success.js.map +0 -1
  549. package/dist/flows/flow-tools.d.ts.map +0 -1
  550. package/dist/flows/flow-tools.js.map +0 -1
  551. package/dist/flows/flows.d.ts.map +0 -1
  552. package/dist/flows/flows.js.map +0 -1
  553. package/dist/flows/gate.d.ts.map +0 -1
  554. package/dist/flows/gate.js.map +0 -1
  555. package/dist/flows/git-changed.d.ts.map +0 -1
  556. package/dist/flows/git-changed.js.map +0 -1
  557. package/dist/flows/heal-run.d.ts.map +0 -1
  558. package/dist/flows/heal-run.js.map +0 -1
  559. package/dist/flows/heal.d.ts.map +0 -1
  560. package/dist/flows/heal.js.map +0 -1
  561. package/dist/flows/parallel-suite.d.ts.map +0 -1
  562. package/dist/flows/parallel-suite.js.map +0 -1
  563. package/dist/flows/recordings.d.ts.map +0 -1
  564. package/dist/flows/recordings.js.map +0 -1
  565. package/dist/flows/replay.d.ts.map +0 -1
  566. package/dist/flows/replay.js.map +0 -1
  567. package/dist/flows/server-verify.d.ts.map +0 -1
  568. package/dist/flows/server-verify.js.map +0 -1
  569. package/dist/flows/watch-batcher.d.ts.map +0 -1
  570. package/dist/flows/watch-batcher.js.map +0 -1
  571. package/dist/honesty/blind-spots.d.ts.map +0 -1
  572. package/dist/honesty/blind-spots.js.map +0 -1
  573. package/dist/honesty/honesty.d.ts.map +0 -1
  574. package/dist/honesty/honesty.js.map +0 -1
  575. package/dist/http-server.d.ts.map +0 -1
  576. package/dist/http-server.js.map +0 -1
  577. package/dist/idle-shutdown.d.ts.map +0 -1
  578. package/dist/idle-shutdown.js.map +0 -1
  579. package/dist/index.d.ts.map +0 -1
  580. package/dist/index.js.map +0 -1
  581. package/dist/init/agent-rules.d.ts.map +0 -1
  582. package/dist/init/agent-rules.js.map +0 -1
  583. package/dist/init/cursor.d.ts.map +0 -1
  584. package/dist/init/cursor.js.map +0 -1
  585. package/dist/init/detect.d.ts.map +0 -1
  586. package/dist/init/detect.js.map +0 -1
  587. package/dist/init/mcp.d.ts.map +0 -1
  588. package/dist/init/mcp.js.map +0 -1
  589. package/dist/init/node-io.d.ts.map +0 -1
  590. package/dist/init/node-io.js.map +0 -1
  591. package/dist/init/plan.d.ts.map +0 -1
  592. package/dist/init/plan.js.map +0 -1
  593. package/dist/init/project-id.d.ts.map +0 -1
  594. package/dist/init/project-id.js.map +0 -1
  595. package/dist/init/run.d.ts.map +0 -1
  596. package/dist/init/run.js.map +0 -1
  597. package/dist/init/snippets.d.ts.map +0 -1
  598. package/dist/init/snippets.js.map +0 -1
  599. package/dist/init/vite-config.d.ts.map +0 -1
  600. package/dist/init/vite-config.js.map +0 -1
  601. package/dist/input/network-detail.d.ts.map +0 -1
  602. package/dist/input/network-detail.js.map +0 -1
  603. package/dist/input/network-mock-tools.d.ts.map +0 -1
  604. package/dist/input/network-mock-tools.js.map +0 -1
  605. package/dist/input/network-mock.d.ts.map +0 -1
  606. package/dist/input/network-mock.js.map +0 -1
  607. package/dist/input/real-input.d.ts.map +0 -1
  608. package/dist/input/real-input.js.map +0 -1
  609. package/dist/input/scroll-find.d.ts.map +0 -1
  610. package/dist/input/scroll-find.js.map +0 -1
  611. package/dist/input/scroll-tools.d.ts.map +0 -1
  612. package/dist/input/scroll-tools.js.map +0 -1
  613. package/dist/input/viewport-tools.d.ts.map +0 -1
  614. package/dist/input/viewport-tools.js.map +0 -1
  615. package/dist/journal/ambient-store.d.ts.map +0 -1
  616. package/dist/journal/ambient-store.js.map +0 -1
  617. package/dist/journal/ambient.d.ts.map +0 -1
  618. package/dist/journal/ambient.js.map +0 -1
  619. package/dist/journal/attach-journal.d.ts.map +0 -1
  620. package/dist/journal/attach-journal.js.map +0 -1
  621. package/dist/journal/deviation-report.d.ts.map +0 -1
  622. package/dist/journal/deviation-report.js.map +0 -1
  623. package/dist/journal/deviation-service.d.ts.map +0 -1
  624. package/dist/journal/deviation-service.js.map +0 -1
  625. package/dist/journal/envelope-store.d.ts.map +0 -1
  626. package/dist/journal/envelope-store.js.map +0 -1
  627. package/dist/journal/envelope.d.ts.map +0 -1
  628. package/dist/journal/envelope.js.map +0 -1
  629. package/dist/journal/journal-query.d.ts.map +0 -1
  630. package/dist/journal/journal-query.js.map +0 -1
  631. package/dist/journal/journal-recorder.d.ts.map +0 -1
  632. package/dist/journal/journal-recorder.js.map +0 -1
  633. package/dist/journal/retention.d.ts.map +0 -1
  634. package/dist/journal/retention.js.map +0 -1
  635. package/dist/journal/rollups.d.ts.map +0 -1
  636. package/dist/journal/rollups.js.map +0 -1
  637. package/dist/journal/session-end.d.ts.map +0 -1
  638. package/dist/journal/session-end.js.map +0 -1
  639. package/dist/journal/session-journal.d.ts.map +0 -1
  640. package/dist/journal/session-journal.js.map +0 -1
  641. package/dist/license/license.d.ts.map +0 -1
  642. package/dist/license/license.js.map +0 -1
  643. package/dist/log.d.ts.map +0 -1
  644. package/dist/log.js.map +0 -1
  645. package/dist/mcp-proxy.d.ts.map +0 -1
  646. package/dist/mcp-proxy.js.map +0 -1
  647. package/dist/mcp.d.ts.map +0 -1
  648. package/dist/mcp.js.map +0 -1
  649. package/dist/oracles/flow-instrument-gaps.d.ts.map +0 -1
  650. package/dist/oracles/flow-instrument-gaps.js.map +0 -1
  651. package/dist/oracles/propose-consequences.d.ts.map +0 -1
  652. package/dist/oracles/propose-consequences.js.map +0 -1
  653. package/dist/oracles/self-instrument.d.ts.map +0 -1
  654. package/dist/oracles/self-instrument.js.map +0 -1
  655. package/dist/pairing-token.d.ts.map +0 -1
  656. package/dist/pairing-token.js.map +0 -1
  657. package/dist/phenomena/phenomena.d.ts.map +0 -1
  658. package/dist/phenomena/phenomena.js.map +0 -1
  659. package/dist/pool/browser-pool.d.ts.map +0 -1
  660. package/dist/pool/browser-pool.js.map +0 -1
  661. package/dist/pool/lease-reaper.d.ts.map +0 -1
  662. package/dist/pool/lease-reaper.js.map +0 -1
  663. package/dist/pool/playwright-launcher.d.ts.map +0 -1
  664. package/dist/pool/playwright-launcher.js.map +0 -1
  665. package/dist/project/baselines.d.ts.map +0 -1
  666. package/dist/project/baselines.js.map +0 -1
  667. package/dist/project/file-lock.d.ts.map +0 -1
  668. package/dist/project/file-lock.js.map +0 -1
  669. package/dist/project/fs-port.d.ts.map +0 -1
  670. package/dist/project/fs-port.js.map +0 -1
  671. package/dist/project/project-store.d.ts.map +0 -1
  672. package/dist/project/project-store.js.map +0 -1
  673. package/dist/project/project-tools.d.ts.map +0 -1
  674. package/dist/project/project-tools.js.map +0 -1
  675. package/dist/project/reticle-dir.d.ts.map +0 -1
  676. package/dist/project/reticle-dir.js.map +0 -1
  677. package/dist/runs/build-verification-run.d.ts.map +0 -1
  678. package/dist/runs/build-verification-run.js.map +0 -1
  679. package/dist/runs/profile-redact.d.ts.map +0 -1
  680. package/dist/runs/profile-redact.js.map +0 -1
  681. package/dist/runs/render-report.d.ts.map +0 -1
  682. package/dist/runs/render-report.js.map +0 -1
  683. package/dist/runs/repair-prompt.d.ts.map +0 -1
  684. package/dist/runs/repair-prompt.js.map +0 -1
  685. package/dist/runs/replay-mapping.d.ts.map +0 -1
  686. package/dist/runs/replay-mapping.js.map +0 -1
  687. package/dist/runs/reticle-runner.d.ts.map +0 -1
  688. package/dist/runs/reticle-runner.js.map +0 -1
  689. package/dist/runs/risk-classify.d.ts.map +0 -1
  690. package/dist/runs/risk-classify.js.map +0 -1
  691. package/dist/runs/run-diff.d.ts.map +0 -1
  692. package/dist/runs/run-diff.js.map +0 -1
  693. package/dist/runs/run-store.d.ts.map +0 -1
  694. package/dist/runs/run-store.js.map +0 -1
  695. package/dist/runs/run-tools.d.ts.map +0 -1
  696. package/dist/runs/run-tools.js.map +0 -1
  697. package/dist/runs/runner-port.d.ts.map +0 -1
  698. package/dist/runs/runner-port.js.map +0 -1
  699. package/dist/runs/verification-sync.d.ts.map +0 -1
  700. package/dist/runs/verification-sync.js.map +0 -1
  701. package/dist/runs/verify-http.d.ts.map +0 -1
  702. package/dist/runs/verify-http.js.map +0 -1
  703. package/dist/runs/verify-server.d.ts.map +0 -1
  704. package/dist/runs/verify-server.js.map +0 -1
  705. package/dist/server-version.d.ts.map +0 -1
  706. package/dist/server-version.js.map +0 -1
  707. package/dist/session/control-envelope.d.ts.map +0 -1
  708. package/dist/session/control-envelope.js.map +0 -1
  709. package/dist/session/live-control-tools.d.ts.map +0 -1
  710. package/dist/session/live-control-tools.js.map +0 -1
  711. package/dist/session/live-control.d.ts.map +0 -1
  712. package/dist/session/live-control.js.map +0 -1
  713. package/dist/session/observed-state.d.ts.map +0 -1
  714. package/dist/session/observed-state.js.map +0 -1
  715. package/dist/session/output-budget.d.ts.map +0 -1
  716. package/dist/session/output-budget.js.map +0 -1
  717. package/dist/session/presenter-args.d.ts.map +0 -1
  718. package/dist/session/presenter-args.js.map +0 -1
  719. package/dist/session/review-store.d.ts.map +0 -1
  720. package/dist/session/review-store.js.map +0 -1
  721. package/dist/session/session-health.d.ts.map +0 -1
  722. package/dist/session/session-health.js.map +0 -1
  723. package/dist/session/session-manager.d.ts.map +0 -1
  724. package/dist/session/session-manager.js.map +0 -1
  725. package/dist/session/session-readiness.d.ts.map +0 -1
  726. package/dist/session/session-readiness.js.map +0 -1
  727. package/dist/session/session-reaper.d.ts.map +0 -1
  728. package/dist/session/session-reaper.js.map +0 -1
  729. package/dist/session/session-recommendation.d.ts.map +0 -1
  730. package/dist/session/session-recommendation.js.map +0 -1
  731. package/dist/session/session-tools.d.ts.map +0 -1
  732. package/dist/session/session-tools.js.map +0 -1
  733. package/dist/session/session.d.ts.map +0 -1
  734. package/dist/session/session.js.map +0 -1
  735. package/dist/session/state-select.d.ts.map +0 -1
  736. package/dist/session/state-select.js.map +0 -1
  737. package/dist/telemetry/telemetry.d.ts.map +0 -1
  738. package/dist/telemetry/telemetry.js.map +0 -1
  739. package/dist/token-auth.d.ts.map +0 -1
  740. package/dist/token-auth.js.map +0 -1
  741. package/dist/tools/act-tools.d.ts.map +0 -1
  742. package/dist/tools/act-tools.js.map +0 -1
  743. package/dist/tools/act-view.d.ts.map +0 -1
  744. package/dist/tools/act-view.js.map +0 -1
  745. package/dist/tools/assert-grade.d.ts.map +0 -1
  746. package/dist/tools/assert-grade.js.map +0 -1
  747. package/dist/tools/browser-tools.d.ts.map +0 -1
  748. package/dist/tools/browser-tools.js.map +0 -1
  749. package/dist/tools/contract-tools.d.ts.map +0 -1
  750. package/dist/tools/contract-tools.js.map +0 -1
  751. package/dist/tools/dynamic-tools.d.ts.map +0 -1
  752. package/dist/tools/dynamic-tools.js.map +0 -1
  753. package/dist/tools/error-recovery.d.ts.map +0 -1
  754. package/dist/tools/error-recovery.js.map +0 -1
  755. package/dist/tools/invoke-tool.d.ts.map +0 -1
  756. package/dist/tools/invoke-tool.js.map +0 -1
  757. package/dist/tools/lease-tools.d.ts.map +0 -1
  758. package/dist/tools/lease-tools.js.map +0 -1
  759. package/dist/tools/merge-tools.d.ts.map +0 -1
  760. package/dist/tools/merge-tools.js.map +0 -1
  761. package/dist/tools/observe-tools.d.ts.map +0 -1
  762. package/dist/tools/observe-tools.js.map +0 -1
  763. package/dist/tools/profiles.d.ts.map +0 -1
  764. package/dist/tools/profiles.js.map +0 -1
  765. package/dist/tools/query-paginate.d.ts.map +0 -1
  766. package/dist/tools/query-paginate.js.map +0 -1
  767. package/dist/tools/read-tools.d.ts.map +0 -1
  768. package/dist/tools/read-tools.js.map +0 -1
  769. package/dist/tools/snapshot-delta.d.ts.map +0 -1
  770. package/dist/tools/snapshot-delta.js.map +0 -1
  771. package/dist/tools/tool-invoker.d.ts.map +0 -1
  772. package/dist/tools/tool-invoker.js.map +0 -1
  773. package/dist/tools/tool-kit.d.ts.map +0 -1
  774. package/dist/tools/tool-kit.js.map +0 -1
  775. package/dist/tools/tool-names.d.ts.map +0 -1
  776. package/dist/tools/tool-names.js.map +0 -1
  777. package/dist/tools/tools-helpers.d.ts.map +0 -1
  778. package/dist/tools/tools-helpers.js.map +0 -1
  779. package/dist/tools/tools.d.ts.map +0 -1
  780. package/dist/tools/tools.js.map +0 -1
  781. package/dist/update/update-checker.d.ts.map +0 -1
  782. package/dist/update/update-checker.js.map +0 -1
  783. package/dist/update/updater.d.ts.map +0 -1
  784. package/dist/update/updater.js.map +0 -1
  785. package/dist/visual/visual-diff.d.ts.map +0 -1
  786. package/dist/visual/visual-diff.js.map +0 -1
  787. package/dist/visual/visual-store.d.ts.map +0 -1
  788. package/dist/visual/visual-store.js.map +0 -1
  789. package/dist/visual/visual-tools.d.ts.map +0 -1
  790. package/dist/visual/visual-tools.js.map +0 -1
@@ -0,0 +1,62 @@
1
+ import { findContradictions } from '../events/contradictions.js';
2
+ import { blindSpotsFromState, buildCoverageStatement, impeachesCapture, } from '../honesty/blind-spots.js';
3
+ import { buildHonestyBlock } from '../honesty/honesty.js';
4
+ import { hasAcceptedWrite } from '../honesty/accepted-write.js';
5
+ import { hasUnreadWriteOutcome } from '../honesty/unread-outcome.js';
6
+ import { decideVerified } from '../honesty/verified.js';
7
+ import { gradeOfPredicate } from './assert-grade.js';
8
+ /**
9
+ * The honesty verdict for a plain `reticle_assert`.
10
+ *
11
+ * This is the single field an agent reads, and it was missing from the most-used verdict path.
12
+ * `act_and_wait` has always returned it; `reticle_assert` returned a bare `pass: true`.
13
+ *
14
+ * Measured on a shipments console: a dispatch answered 202 Accepted, the row rendered "dispatched"
15
+ * optimistically, an assert taken right after the click returned `pass: true` with no caveat, and the
16
+ * server reverted the write to "held" 1.2s later. The 202 machinery that exists precisely to report
17
+ * that as `verified: "unknown"` was never reached, because the tool an agent actually calls did not
18
+ * consult it. Asserting a moment earlier — while the POST was still open — is the same story with a
19
+ * different name: `request-never-settled`, also unreported.
20
+ */
21
+ export async function assertVerdict(session, predicate, pass, since) {
22
+ // Scope caveat, stated because it is a real limitation and not a bug: blind spots are tracked per
23
+ // SESSION, not per assertion window, so a cross-origin iframe seen once marks every later verdict
24
+ // in that session partial — including ones about a region it cannot affect. That errs toward
25
+ // over-warning, which is the correct direction here: the failure this guards against is a green
26
+ // that implies coverage it never had, and a needless caveat costs the agent a sentence.
27
+ const spots = blindSpotsFromState(session.blindSpots());
28
+ const statement = buildCoverageStatement(spots);
29
+ // Omitted entirely when coverage is full, so an intact page pays nothing and the field's PRESENCE
30
+ // is the warning.
31
+ const coverage = statement.coverage === 'partial'
32
+ ? {
33
+ coverage: statement.note ?? 'partial',
34
+ coverage_spots: statement.spots.map((sp) => ({ kind: sp.kind, count: sp.count })),
35
+ }
36
+ : {};
37
+ const windowEvents = await session.queryEvents({ since });
38
+ // Everything before the window, passed as LEARNING material only. A scale error disagrees with a
39
+ // value the API stated earlier in the session, which an action-scoped window can never contain —
40
+ // measured live, `observe` over a wide window reported `unit-mismatch` while `assert` on the same
41
+ // session reported none. Attribution is unchanged: findings still come only from windowEvents.
42
+ const prior = since > 0 ? (await session.queryEvents({ since: 0 })).filter((e) => e.t < since) : [];
43
+ const contradictions = findContradictions(windowEvents, { prior });
44
+ // Only a spot that IMPEACHES the capture downgrades a verdict. A structural boundary (virtualized
45
+ // rows, a cross-origin frame) is reported as coverage and must not impugn what WAS observed.
46
+ const impeaching = buildCoverageStatement(spots.filter((sp) => impeachesCapture(sp.kind)));
47
+ const outcomePending = hasAcceptedWrite(windowEvents);
48
+ const outcomeUnread = hasUnreadWriteOutcome(windowEvents);
49
+ const decision = decideVerified({
50
+ pass,
51
+ honesty: buildHonestyBlock({
52
+ grade: gradeOfPredicate(predicate),
53
+ attribution: 'window',
54
+ coveragePartial: statement.coverage === 'partial',
55
+ ...(impeaching.note === undefined ? {} : { blindSpots: [impeaching.note] }),
56
+ }),
57
+ contradictions,
58
+ ...(outcomePending ? { outcomePending } : {}),
59
+ ...(outcomeUnread ? { outcomeUnread } : {}),
60
+ });
61
+ return { decision: decision, contradictions, coverage };
62
+ }
@@ -1,3 +1,2 @@
1
1
  import type { ToolDef } from './tools.js';
2
2
  export declare const BROWSER_TOOLS: ToolDef[];
3
- //# sourceMappingURL=browser-tools.d.ts.map
@@ -6,13 +6,14 @@ import { sessionIdShape, commandOrThrow } from './tool-kit.js';
6
6
  export const BROWSER_TOOLS = [
7
7
  {
8
8
  name: ReticleTool.NAVIGATE,
9
+ example: { url: '/settings' },
9
10
  description: 'Navigate the connected browser tab to a URL, or reload it in place with { reload: true } (add { hard: true } to bypass the cache). The SDK reconnects automatically after the page loads. Use reticle_sessions to confirm the new tab is connected before acting.',
10
11
  inputSchema: {
11
12
  url: z.string().optional().describe('The URL to navigate to. Omit when using reload.'),
12
13
  reload: z
13
14
  .boolean()
14
15
  .optional()
15
- .describe('Reload the current page instead of navigating (replaces reticle_refresh).'),
16
+ .describe('Reload the current page instead of navigating (replaces the former standalone refresh tool).'),
16
17
  hard: z
17
18
  .boolean()
18
19
  .optional()
@@ -73,4 +74,3 @@ export const BROWSER_TOOLS = [
73
74
  },
74
75
  },
75
76
  ];
76
- //# sourceMappingURL=browser-tools.js.map
@@ -5,4 +5,3 @@ import type { ToolDef } from './tools.js';
5
5
  * live registry to that file (pretty-printed, stable key order — diffable in PRs).
6
6
  */
7
7
  export declare const CONTRACT_TOOLS: ToolDef[];
8
- //# sourceMappingURL=contract-tools.d.ts.map
@@ -64,4 +64,3 @@ export const CONTRACT_TOOLS = [
64
64
  },
65
65
  },
66
66
  ];
67
- //# sourceMappingURL=contract-tools.js.map
@@ -0,0 +1,9 @@
1
+ import type { ToolDef } from './tools.js';
2
+ interface Control {
3
+ ref: string;
4
+ label: string;
5
+ }
6
+ /** Parse the interactive snapshot into {ref,label} controls, preserving document order. */
7
+ export declare function parseControls(tree: string): Control[];
8
+ export declare const COVERAGE_TOOLS: ToolDef[];
9
+ export {};
@@ -0,0 +1,92 @@
1
+ import { z } from 'zod';
2
+ import { ReticleCommand, SnapshotMode } from '@reticlehq/core';
3
+ import { ReticleTool } from './tool-names.js';
4
+ import { asString } from './tools-helpers.js';
5
+ import { commandOrThrow, sessionIdShape } from './tool-kit.js';
6
+ /**
7
+ * `reticle_coverage` — which interactive controls this session has driven, and which it has not.
8
+ *
9
+ * Every other read here answers a question the agent already thought to ask, which bounds
10
+ * verification by the agent's imagination — the documented weak link. This answers the one question
11
+ * that tells the agent whether to STOP: an agent that exercised 4 of 17 controls and believes it
12
+ * verified the page is exactly the confident-and-wrong case Reticle exists to prevent, and nothing
13
+ * in the tool surface previously contradicted it.
14
+ *
15
+ * Note this is NOT the existing `blindSpots` coverage, which is about what the layer could not SEE
16
+ * (closed shadow roots, cross-origin frames). This is about what the agent did not TOUCH. Both are
17
+ * honesty signals; they answer different questions and neither substitutes for the other.
18
+ *
19
+ * Unadvertised by every profile: it costs nothing per turn and is reached through `reticle_run`.
20
+ */
21
+ /** Refs as the snapshot tree spells them: `(ref=e12)`. The tree format is ours, so this is exact. */
22
+ const REF_IN_TREE = /\(ref=(e\d+)\)/g;
23
+ /** The label a tree line carries before its ref, e.g. `- button "Archive" (ref=e9)`. */
24
+ const LINE_WITH_REF = /^\s*-\s*(.+?)\s*\(ref=(e\d+)\)/;
25
+ /** Parse the interactive snapshot into {ref,label} controls, preserving document order. */
26
+ export function parseControls(tree) {
27
+ const controls = [];
28
+ const seen = new Set();
29
+ for (const line of tree.split('\n')) {
30
+ const match = LINE_WITH_REF.exec(line);
31
+ if (match === null)
32
+ continue;
33
+ const [, label, ref] = match;
34
+ if (label === undefined || ref === undefined || seen.has(ref))
35
+ continue;
36
+ seen.add(ref);
37
+ controls.push({ ref, label });
38
+ }
39
+ // A ref can appear on a line this regex does not shape (nested formatting); count it regardless,
40
+ // because under-reporting the denominator would overstate coverage — the one direction that lies.
41
+ for (const match of tree.matchAll(REF_IN_TREE)) {
42
+ const ref = match[1];
43
+ if (ref !== undefined && !seen.has(ref)) {
44
+ seen.add(ref);
45
+ controls.push({ ref, label: '' });
46
+ }
47
+ }
48
+ return controls;
49
+ }
50
+ export const COVERAGE_TOOLS = [
51
+ {
52
+ name: ReticleTool.COVERAGE,
53
+ description: 'Which interactive controls you have driven this session, and which you have NOT. Returns { total, exercised, untouched:[{ref,label}], alsoDroveGone? } over the controls currently on the page. Use it to decide whether verification is finished: an untouched list that still holds the controls your change affects means you are not done. This is about what you did not TOUCH — distinct from the `coverage` field on an action result, which reports what the layer could not SEE.',
54
+ example: {},
55
+ inputSchema: { ...sessionIdShape },
56
+ outputSchema: {
57
+ total: z.number(),
58
+ exercised: z.number(),
59
+ untouched: z.array(z.object({ ref: z.string(), label: z.string() })),
60
+ alsoDroveGone: z
61
+ .number()
62
+ .optional()
63
+ .describe('Controls you drove that are no longer on the page — usually because the action SUCCEEDED and removed them (archive/delete/submit/navigate). Counted separately so `exercised: 0` never appears immediately after real work.'),
64
+ },
65
+ handler: async (deps, args) => {
66
+ const sessionId = asString(args['sessionId']);
67
+ const session = deps.sessions.resolve(sessionId);
68
+ // INTERACTIVE mode is already the "controls only" view, so the denominator is the page's own
69
+ // notion of what can be driven rather than a second, drifting definition maintained here.
70
+ const result = await commandOrThrow(deps, sessionId, ReticleCommand.SNAPSHOT, {
71
+ mode: SnapshotMode.INTERACTIVE,
72
+ });
73
+ const tree = asString(result['tree']) ?? '';
74
+ const acted = session.actedRefs();
75
+ const controls = parseControls(tree);
76
+ const present = new Set(controls.map((control) => control.ref));
77
+ const untouched = controls.filter((control) => !acted.has(control.ref));
78
+ // Drives that landed on controls no longer in the DOM. Without this the number is biased
79
+ // against the actions that WORKED: archive, delete, submit and navigate all remove their own
80
+ // control, so clicking one and asking again reported `exercised: 0` — measured on the Electron
81
+ // demo right after a successful archive. An agent reading "0" concludes it has done nothing
82
+ // and re-drives ground it already covered.
83
+ const drovenGone = [...acted].filter((ref) => !present.has(ref)).length;
84
+ return {
85
+ total: controls.length,
86
+ exercised: controls.length - untouched.length,
87
+ untouched,
88
+ ...(drovenGone > 0 ? { alsoDroveGone: drovenGone } : {}),
89
+ };
90
+ },
91
+ },
92
+ ];
@@ -4,4 +4,3 @@ import type { ToolDef } from './tools.js';
4
4
  * `runTool` chokepoint as a direct call, so session-health splicing and every other invariant hold.
5
5
  */
6
6
  export declare function buildDynamicTools(allTools: ToolDef[]): ToolDef[];
7
- //# sourceMappingURL=dynamic-tools.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { runTool } from './invoke-tool.js';
3
3
  import { ReticleTool } from './tool-names.js';
4
+ import { getSessionMetrics } from '../telemetry/session-metrics.js';
4
5
  /**
5
6
  * On-demand tool loading for MCP — the answer to the per-turn tool-definition tax.
6
7
  *
@@ -43,7 +44,7 @@ export function buildDynamicTools(allTools) {
43
44
  const byName = new Map(allTools.map((t) => [t.name, t]));
44
45
  const reticleTools = {
45
46
  name: ReticleTool.TOOLS,
46
- description: 'Discover Reticle tools on demand. Call with no arguments to list every tool (name + one-line summary); call with names:["reticle_network", …] to load full descriptions and parameters for specific tools. Then invoke them with reticle_run. This avoids paying for every tool definition on every turn. To make a verification REUSABLE (record once, replay free forever), the flow workflow lives here: reticle_record_start → act → reticle_flow_save → reticle_flow_verify (and reticle_flow_heal on drift). Load those names when you want to save or re-run a flow.',
47
+ description: 'Discover Reticle tools on demand. Call with no arguments to list every tool (name + one-line summary); call with names:["reticle_network", …] to load full descriptions and parameters for specific tools. Then invoke them with reticle_run. This avoids paying for every tool definition on every turn. To make a verification REUSABLE (record once, replay free forever), the flow workflow lives here: reticle_record{action:"start"} → act → reticle_flow_save → reticle_flow_verify (and reticle_flow_heal on drift). Load those names when you want to save or re-run a flow.',
47
48
  inputSchema: {
48
49
  names: z
49
50
  .array(z.string())
@@ -84,8 +85,27 @@ export function buildDynamicTools(allTools) {
84
85
  : {};
85
86
  const target = byName.get(name);
86
87
  if (target === undefined) {
88
+ // A non-zero count here means our advertised surface is confusing the agent — it reached for
89
+ // something it believed existed. That is a docs/naming defect, and it was invisible.
90
+ getSessionMetrics().recordUnknownTool();
87
91
  return { error: `unknown tool '${name}'`, available: allTools.map((t) => t.name) };
88
92
  }
93
+ // The escape hatch is where a typo is MOST likely, because an unadvertised tool's parameters
94
+ // are not in front of the agent at all — and it is the one path the SDK's own validation never
95
+ // sees, since `reticle_run`'s own args (`tool`, `args`) are perfectly valid. Left unchecked,
96
+ // `reticle_run { tool: "reticle_clock", args: { action: "freeze" } }` returned
97
+ // `{"frozen":false}`: a well-formed answer to a question nobody asked.
98
+ const declared = new Set(Object.keys(target.inputSchema));
99
+ const unknown = Object.keys(callArgs).filter((key) => !declared.has(key));
100
+ if (unknown.length > 0) {
101
+ return {
102
+ error: `unknown ${unknown.length === 1 ? 'parameter' : 'parameters'} for ${name}: ${unknown.join(', ')} — NOT applied, so any result would be an answer to a different question`,
103
+ tool: name,
104
+ params: paramInfo(target.inputSchema),
105
+ ...(target.example === undefined ? {} : { example: target.example }),
106
+ hint: 'fix the arguments and call reticle_run again',
107
+ };
108
+ }
89
109
  try {
90
110
  return await runTool(target, deps, callArgs);
91
111
  }
@@ -101,4 +121,3 @@ export function buildDynamicTools(allTools) {
101
121
  };
102
122
  return [reticleTools, reticleRun];
103
123
  }
104
- //# sourceMappingURL=dynamic-tools.js.map
@@ -16,16 +16,32 @@ export declare const RECOVERY: {
16
16
  readonly THROTTLED: string;
17
17
  readonly MISSING_BASELINE: string;
18
18
  readonly MISSING_RECORDING: string;
19
+ readonly STALE_REF: string;
20
+ readonly BAD_ARGUMENTS: string;
19
21
  readonly TOKEN_REQUIRED: string;
20
22
  };
21
23
  /** The actionable next move for a known error message, or undefined when none is recognized. */
22
24
  export declare function recoveryFor(message: string): string | undefined;
25
+ /**
26
+ * The ask attached to errors we do NOT recognize. An unrecognized error is, by definition, the case
27
+ * where Reticle failed in a way nobody anticipated — the single highest-value moment to hear from the
28
+ * agent, and until now the moment where the agent worked around us in silence and we learned nothing.
29
+ *
30
+ * Deliberately NOT attached when a recovery hint matched: there the agent has a concrete next move,
31
+ * and diverting it into filing a report about a failure we already understand costs a turn and tells
32
+ * us nothing new.
33
+ */
34
+ export declare const FEEDBACK_ASK: string;
23
35
  /** The error envelope sent to the agent: the message, plus a recovery hint when one is known. */
24
36
  interface ErrorPayload {
25
37
  error: string;
26
38
  recovery?: string;
39
+ feedback?: string;
27
40
  }
28
- /** Build the tool-error payload spliced at the MCP boundary — `recovery` is added only when known. */
41
+ /**
42
+ * Build the tool-error payload spliced at the MCP boundary. `recovery` is added when the error is
43
+ * known; the feedback ask is added when it is NOT — the two are mutually exclusive by design, so the
44
+ * agent always gets exactly one next move.
45
+ */
29
46
  export declare function buildErrorPayload(message: string): ErrorPayload;
30
47
  export {};
31
- //# sourceMappingURL=error-recovery.d.ts.map
@@ -19,10 +19,18 @@ export const RECOVERY = {
19
19
  UNKNOWN_SESSION: 'That sessionId is not connected. Call reticle_sessions for the current ids and retry with a valid one.',
20
20
  THROTTLED: 'The target tab is backgrounded/throttled, so actions may silently no-op. Ask the human to bring ' +
21
21
  'the tab to the front, or run `reticle drive <url>` for a guaranteed scriptable context.',
22
- MISSING_BASELINE: 'That baseline does not exist yet. Call reticle_baseline_list to see saved names, or reticle_baseline_save ' +
23
- 'to capture one before diffing against it.',
24
- MISSING_RECORDING: 'No recording by that name is in progress. Start one with reticle_record_start before annotating, ' +
25
- 'stopping, or saving it.',
22
+ MISSING_BASELINE: 'That baseline does not exist yet. Call reticle_baseline { action: "list" } to see saved names, or ' +
23
+ 'reticle_baseline { action: "save", name } to capture one before diffing against it.',
24
+ MISSING_RECORDING: 'No recording by that name is in progress. Start one with reticle_record { action: "start", name } ' +
25
+ 'before annotating, stopping, or saving it.',
26
+ STALE_REF: 'That ref is stale: refs are invalidated whenever the DOM re-renders, so any action that ' +
27
+ 'navigated, opened a modal, re-sorted a list or changed the page invalidates every ref taken ' +
28
+ 'before it. Reticle refuses here rather than clicking whatever now occupies that slot. Call ' +
29
+ 'reticle_query again for a fresh ref and retry the action — and prefer reticle_act_and_wait ' +
30
+ '{ until } when an action changes the page, so the next ref is taken after it settles.',
31
+ BAD_ARGUMENTS: "That call did not match the tool's schema — the message above names the tool and the exact " +
32
+ "argument it wanted. Re-read that tool's parameters and retry with the missing or corrected " +
33
+ 'argument. This is an invalid call, not a Reticle defect: there is nothing to report.',
26
34
  TOKEN_REQUIRED: 'The bridge binds beyond localhost and requires a pairing token. Set the same token in the SDK ' +
27
35
  'init (@reticlehq/core) and the Reticle server config, then reconnect.',
28
36
  };
@@ -35,6 +43,16 @@ const RULES = [
35
43
  { match: /no baseline named/i, hint: RECOVERY.MISSING_BASELINE },
36
44
  { match: /no (?:active|compiled) recording named/i, hint: RECOVERY.MISSING_RECORDING },
37
45
  { match: /pairing token is required/i, hint: RECOVERY.TOKEN_REQUIRED },
46
+ // The commonest post-action condition there is. Unmatched, it fell through to FEEDBACK_ASK and
47
+ // told the agent a successful click's aftermath might be a bug in Reticle.
48
+ { match: /no longer resolves to an element/i, hint: RECOVERY.STALE_REF },
49
+ // A message naming a `reticle_*` tool is one WE authored about our own API — an invalid call, not
50
+ // an unanticipated failure. Left unmatched it collected the feedback ask, which pushed agents to
51
+ // file reports about their own bad arguments. Kept LAST so a specific rule above always wins.
52
+ {
53
+ match: /reticle_[a-z_]+\s*\{[^}]*\}.*\b(requires|must|expected)\b/i,
54
+ hint: RECOVERY.BAD_ARGUMENTS,
55
+ },
38
56
  ];
39
57
  /** The actionable next move for a known error message, or undefined when none is recognized. */
40
58
  export function recoveryFor(message) {
@@ -44,9 +62,26 @@ export function recoveryFor(message) {
44
62
  }
45
63
  return undefined;
46
64
  }
47
- /** Build the tool-error payload spliced at the MCP boundary — `recovery` is added only when known. */
65
+ /**
66
+ * The ask attached to errors we do NOT recognize. An unrecognized error is, by definition, the case
67
+ * where Reticle failed in a way nobody anticipated — the single highest-value moment to hear from the
68
+ * agent, and until now the moment where the agent worked around us in silence and we learned nothing.
69
+ *
70
+ * Deliberately NOT attached when a recovery hint matched: there the agent has a concrete next move,
71
+ * and diverting it into filing a report about a failure we already understand costs a turn and tells
72
+ * us nothing new.
73
+ */
74
+ export const FEEDBACK_ASK = 'This error is not one Reticle recognizes, which means it may be a defect in Reticle rather than in ' +
75
+ 'the app. If you believe Reticle misbehaved, call reticle_feedback with a root-cause analysis and ' +
76
+ 'the call trace before moving on — that report is the only way this gets fixed.';
77
+ /**
78
+ * Build the tool-error payload spliced at the MCP boundary. `recovery` is added when the error is
79
+ * known; the feedback ask is added when it is NOT — the two are mutually exclusive by design, so the
80
+ * agent always gets exactly one next move.
81
+ */
48
82
  export function buildErrorPayload(message) {
49
83
  const recovery = recoveryFor(message);
50
- return recovery !== undefined ? { error: message, recovery } : { error: message };
84
+ return recovery !== undefined
85
+ ? { error: message, recovery }
86
+ : { error: message, feedback: FEEDBACK_ASK };
51
87
  }
52
- //# sourceMappingURL=error-recovery.js.map
@@ -0,0 +1,24 @@
1
+ import type { ToolDef } from './tools.js';
2
+ export declare const FEEDBACK_TOOLS: ToolDef[];
3
+ /**
4
+ * The human-facing prompt, delivered to the agent so it can relay the ask at the natural moment —
5
+ * right after a verification lands, when the experience is fresh. MCP has no channel from the server
6
+ * to the person, so the agent is the channel.
7
+ *
8
+ * Delivered ONCE per server process. A prompt on every verification would be nagging, and a nagged
9
+ * user opts out of telemetry entirely, which costs us the counters too.
10
+ */
11
+ export declare const FEEDBACK_PROMPT: {
12
+ readonly ask: "Ask the human, in your own words and only once: how did this verification go, and what would have made Reticle more useful? If they answer, file it with `reticle feedback` (they run it) or relay it yourself.";
13
+ readonly command: "reticle feedback";
14
+ };
15
+ /** Tools whose completion means "a verification just happened" — the only moment worth asking at. */
16
+ export declare const VERIFICATION_TOOLS: ReadonlySet<string>;
17
+ /**
18
+ * The human prompt, when one is due. Resettable for tests.
19
+ *
20
+ * Silent when the channel is off. Asking someone for feedback we have already been told not to
21
+ * collect is worse than not asking: it spends their attention on a message with nowhere to go.
22
+ */
23
+ export declare function takeFeedbackPrompt(toolName: string): typeof FEEDBACK_PROMPT | undefined;
24
+ export declare function resetFeedbackPrompt(): void;
@@ -0,0 +1,180 @@
1
+ /**
2
+ * `reticle_feedback` — the agent's return path.
3
+ *
4
+ * Reticle is built for agents, but the agent has always been the one party that knows a verification
5
+ * went wrong and has had no way to say so. It sees the tool that returned nonsense, the observer that
6
+ * missed the event, the verdict it could not act on — and then that context is discarded at the end of
7
+ * the turn. This tool is where that knowledge goes instead.
8
+ *
9
+ * It is deliberately shaped to demand an RCA rather than a complaint. `text` asks what the agent
10
+ * expected, what it got, and why it believes Reticle is at fault; `trace` asks for the call trail that
11
+ * proves it. A report we cannot reproduce is a report we cannot fix, so the description spends its
12
+ * tokens on that and not on politeness.
13
+ */
14
+ import { z } from 'zod';
15
+ import { FeedbackKind, FeedbackSource } from '@reticlehq/core';
16
+ import { ReticleTool } from './tool-names.js';
17
+ import { asString } from './tools-helpers.js';
18
+ import { submitFeedback, feedbackDisabled } from '../telemetry/feedback.js';
19
+ import { getTelemetry } from '../telemetry/telemetry.js';
20
+ /** One optional string arg, present only when the agent actually supplied it. */
21
+ function optionalText(args, key) {
22
+ const value = asString(args[key]);
23
+ return value !== undefined && value !== '' ? { [key]: value } : {};
24
+ }
25
+ /** Read the connected session's self-reported facts, or nothing when no app is attached. */
26
+ function sessionFacts(deps, sessionId) {
27
+ const driven = deps.realInput !== undefined;
28
+ try {
29
+ const session = deps.sessions.resolve(sessionId);
30
+ return {
31
+ ...(session.runtime !== undefined ? { runtime: session.runtime } : {}),
32
+ ...(session.engine !== undefined ? { engine: session.engine } : {}),
33
+ driven,
34
+ };
35
+ }
36
+ catch {
37
+ // Feedback about "no session could ever connect" is some of the most valuable feedback there is.
38
+ // Refusing to file it without a session would silence exactly the failure we most need to hear.
39
+ return { driven };
40
+ }
41
+ }
42
+ export const FEEDBACK_TOOLS = [
43
+ {
44
+ name: ReticleTool.FEEDBACK,
45
+ description: "Tell the Reticle maintainers something — a failure, OR a feature you wish existed. Reticle is built FOR agents, so your experience is the one that decides what gets built, and this is the only channel that reaches us. File a `bug` when a tool returned something wrong, a `gap` when Reticle could not observe what you needed, an `ambiguity` when a verdict was not decidable, a `feature_request` when you thought 'I wish Reticle could do X', or an `improvement` when something works but is awkward (too many calls, a confusing shape, a slow path). Do not save these up or judge them as too minor — file it the moment you notice, then carry on with your task. For a failure, write `text` as a root-cause analysis (what you called, expected, got). For a request, write what you want and use `need` for the GOAL behind it, `impact` for what gets better, and `currentApproach` for how you are working around it today — that workaround is usually the most useful thing in the report. Set `model` to the model you are running. Never include app source, secrets, user data, or customer records. Do NOT use this for bugs you found in the app under test — that is a successful verification, which is Reticle working.",
46
+ inputSchema: {
47
+ kind: z
48
+ .enum([
49
+ FeedbackKind.BUG,
50
+ FeedbackKind.GAP,
51
+ FeedbackKind.AMBIGUITY,
52
+ FeedbackKind.FEATURE_REQUEST,
53
+ FeedbackKind.IMPROVEMENT,
54
+ ])
55
+ .describe('bug = a Reticle tool returned a wrong or broken result; gap = Reticle could not observe something you needed at all; ambiguity = the verification ran but you could not tell pass from fail; feature_request = something that does not exist and would have helped; improvement = something that exists but is awkward or inefficient.'),
56
+ text: z
57
+ .string()
58
+ .min(1)
59
+ .describe('For a failure: the root-cause analysis — the call you made, what you expected, what you got, and why Reticle is at fault. For a request: what you want, in your own words.'),
60
+ need: z
61
+ .string()
62
+ .optional()
63
+ .describe('The GOAL behind a request, not the request itself. "I need to know the page stopped changing before I assert" is a requirement we can solve; "add a waitForIdle tool" is a guess at the solution that may already have an answer.'),
64
+ impact: z
65
+ .string()
66
+ .optional()
67
+ .describe('What measurably improves — fewer tool calls, fewer retries, a verdict that stops being ambiguous, a flow you currently cannot verify at all.'),
68
+ currentApproach: z
69
+ .string()
70
+ .optional()
71
+ .describe('How you work around it TODAY. Usually the most useful field in the report: it proves the need is real, and often shows a cheaper fix than the feature being asked for.'),
72
+ model: z
73
+ .string()
74
+ .optional()
75
+ .describe('The model you are running (e.g. "claude-opus-4", "gpt-5"). We cannot detect this — MCP tells us the client name but has no concept of a model — and it changes how a report is read: a limitation that blocks a smaller model is often a docs problem, while the same one from a frontier model means the surface is genuinely short.'),
76
+ trace: z
77
+ .string()
78
+ .optional()
79
+ .describe('The literal tool calls and responses that led here, so the failure can be reproduced without guessing.'),
80
+ sessionId: z
81
+ .string()
82
+ .optional()
83
+ .describe('Only to attach a specific tab s runtime/engine context. Omit it — a report about a session that never connected is still worth filing.'),
84
+ },
85
+ outputSchema: {
86
+ sent: z.boolean(),
87
+ reason: z.string().optional(),
88
+ redacted: z.array(z.string()),
89
+ context: z.unknown(),
90
+ note: z.string(),
91
+ },
92
+ example: {
93
+ kind: FeedbackKind.FEATURE_REQUEST,
94
+ text: 'A way to assert that no request fired at all during an action.',
95
+ need: 'Verifying that a debounced search does NOT call the API on every keystroke.',
96
+ currentApproach: 'Calling reticle_network before and after and diffing the counts by hand.',
97
+ model: 'claude-opus-4',
98
+ },
99
+ handler: async (deps, args) => {
100
+ const receipt = await submitFeedback({
101
+ source: FeedbackSource.AGENT,
102
+ kind: asString(args['kind']),
103
+ text: asString(args['text']) ?? '',
104
+ ...optionalText(args, 'trace'),
105
+ ...optionalText(args, 'need'),
106
+ ...optionalText(args, 'impact'),
107
+ ...optionalText(args, 'currentApproach'),
108
+ ...optionalText(args, 'model'),
109
+ }, { session: sessionFacts(deps, asString(args['sessionId'])) });
110
+ return {
111
+ ...receipt,
112
+ note: receipt.sent
113
+ ? 'Filed — thank you. Continue your task; do not retry a failing call just to re-report it.'
114
+ : 'NOT sent (see reason). Tell the human what you found so it is not lost.',
115
+ };
116
+ },
117
+ },
118
+ ];
119
+ /**
120
+ * The human-facing prompt, delivered to the agent so it can relay the ask at the natural moment —
121
+ * right after a verification lands, when the experience is fresh. MCP has no channel from the server
122
+ * to the person, so the agent is the channel.
123
+ *
124
+ * Delivered ONCE per server process. A prompt on every verification would be nagging, and a nagged
125
+ * user opts out of telemetry entirely, which costs us the counters too.
126
+ */
127
+ export const FEEDBACK_PROMPT = {
128
+ ask: 'Ask the human, in your own words and only once: how did this verification go, and what would have made Reticle more useful? If they answer, file it with `reticle feedback` (they run it) or relay it yourself.',
129
+ command: 'reticle feedback',
130
+ };
131
+ /** Tools whose completion means "a verification just happened" — the only moment worth asking at. */
132
+ export const VERIFICATION_TOOLS = new Set([
133
+ ReticleTool.ASSERT,
134
+ ReticleTool.FLOW_VERIFY,
135
+ ReticleTool.VERIFY_CHANGE,
136
+ ReticleTool.RECONCILE,
137
+ ]);
138
+ /**
139
+ * Verifications between re-offers of the prompt, and how many times we will ever offer it.
140
+ *
141
+ * Strictly-once was the first design and it was too fragile. A daemon lives for days; the prompt
142
+ * lands on the FIRST verification, which is often several hours before the human is in a position to
143
+ * answer, and if the agent does not relay it in that turn it is gone for the rest of the process.
144
+ * The signal quietly went to zero and nothing would have told us.
145
+ *
146
+ * Re-arming after a run of verifications fixes that without becoming nagging, and the hard cap is
147
+ * what keeps it honest: at most three asks per daemon, ever. A tool that pesters gets muted, and a
148
+ * muted tool collects nothing — the same outcome as never asking, reached more annoyingly.
149
+ */
150
+ const PROMPT_REARM_AFTER_VERIFICATIONS = 25;
151
+ const MAX_PROMPTS_PER_PROCESS = 3;
152
+ let promptsDelivered = 0;
153
+ let verificationsSincePrompt = 0;
154
+ /**
155
+ * The human prompt, when one is due. Resettable for tests.
156
+ *
157
+ * Silent when the channel is off. Asking someone for feedback we have already been told not to
158
+ * collect is worse than not asking: it spends their attention on a message with nowhere to go.
159
+ */
160
+ export function takeFeedbackPrompt(toolName) {
161
+ if (!VERIFICATION_TOOLS.has(toolName))
162
+ return undefined;
163
+ if (feedbackDisabled() || !getTelemetry().enabled)
164
+ return undefined;
165
+ if (promptsDelivered >= MAX_PROMPTS_PER_PROCESS)
166
+ return undefined;
167
+ // The very first verification asks immediately; later ones only after another run of work, so the
168
+ // ask always arrives attached to something the human just saw happen.
169
+ if (promptsDelivered > 0 && verificationsSincePrompt < PROMPT_REARM_AFTER_VERIFICATIONS) {
170
+ verificationsSincePrompt += 1;
171
+ return undefined;
172
+ }
173
+ promptsDelivered += 1;
174
+ verificationsSincePrompt = 0;
175
+ return FEEDBACK_PROMPT;
176
+ }
177
+ export function resetFeedbackPrompt() {
178
+ promptsDelivered = 0;
179
+ verificationsSincePrompt = 0;
180
+ }
@@ -20,4 +20,3 @@ export declare const SESSION_EXEMPT_TOOLS: ReadonlySet<string>;
20
20
  * (handlers that already add health are left untouched) and never alters non-object results.
21
21
  */
22
22
  export declare function runTool(tool: ToolDef, deps: ToolDeps, args: Record<string, unknown>): Promise<unknown>;
23
- //# sourceMappingURL=invoke-tool.d.ts.map