@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
@@ -37,8 +37,21 @@ export function nextConfigManual(configFile) {
37
37
 
38
38
  export default withReticle(nextConfig);`;
39
39
  }
40
- /** The dev-only client component that connects Reticle after hydration. */
41
- export function nextReticleDevFile(port, projectId) {
40
+ /**
41
+ * The dev-only client component that connects Reticle after hydration.
42
+ *
43
+ * The token is not optional. The bridge requires a pairing token even on localhost, and unlike Vite
44
+ * (where the plugin injects it) a Next app has to carry it through `withReticle`, which publishes it
45
+ * as `NEXT_PUBLIC_RETICLE_TOKEN`. This file used to connect with only a projectId, so every Next
46
+ * setup ended at `bridge refused the connection: authentication failed` and no session ever appeared.
47
+ */
48
+ export function nextReticleDevFile(port, projectId, testids = [], stores = []) {
49
+ const base = connectArg(port, projectId);
50
+ const fields = base === '' ? '' : `${base.slice(1, -1).trim()}, `;
51
+ const ids = testids.map((t) => `'${t}'`).join(', ');
52
+ const storeBlock = stores.length === 0
53
+ ? ' // No state library detected. If you add one, register it here — see docs/usage.md.'
54
+ : stores.map((h) => ` // import your store, then: ${h}`).join('\n');
42
55
  return `'use client';
43
56
  import { useEffect } from 'react';
44
57
 
@@ -46,15 +59,131 @@ import { useEffect } from 'react';
46
59
  export function ReticleDev() {
47
60
  useEffect(() => {
48
61
  if (process.env.NODE_ENV !== 'development') return;
49
- void import('@reticlehq/react').then(({ reticle, install }) => {
62
+ void import('@reticlehq/react').then(({ reticle, install, registerCapabilities }) => {
50
63
  install();
51
- reticle.connect(${connectArg(port, projectId)});
64
+ // Both provided by withReticle() in next.config. The bridge rejects a connect with no token;
65
+ // the root makes source paths repo-relative instead of absolute.
66
+ const token = process.env.NEXT_PUBLIC_RETICLE_TOKEN;
67
+ const root = process.env.NEXT_PUBLIC_RETICLE_ROOT;
68
+ reticle.connect({ ${fields}...(token ? { token } : {}), ...(root ? { root } : {}) });
69
+
70
+ // ── Start with ONE flow. ──────────────────────────────────────────────────────────────────
71
+ // Registering a store is the highest-value line here: it lets the agent check what the app
72
+ // BELIEVES, not just what it rendered. Pass the STORE, not \`() => store.getState()\` — the store
73
+ // form wires \`subscribe\` too, so every mutation emits a diff; the getter form is read-only.
74
+ ${storeBlock}
75
+ registerCapabilities({
76
+ testids: [${ids}],${testids.length === 0 ? ' // none found — add data-testid to your key elements' : ''}
77
+ signals: [], // names you pass to reticle.signal()
78
+ stores: [], // the keys you registered above
79
+ });
52
80
  });
53
81
  }, []);
54
82
  return null;
55
83
  }
56
84
  `;
57
85
  }
86
+ /**
87
+ * Astro connect instructions.
88
+ *
89
+ * Astro is Vite-based but SSRs its own HTML, so the plugin's index.html injection never fires, and
90
+ * `vite` is not a direct dependency — so this used to fall through to the generic HTML advice, which
91
+ * tells you to add a connect to an "entry module" Astro does not have, or to bundle the SDK with
92
+ * esbuild. Both are wrong for Astro, and following either gets you nothing.
93
+ *
94
+ * Astro bundles a page `<script>`, so the bare import resolves there. The token has to be inlined by
95
+ * the config because there is no plugin in the page's path to inject it, and `build.target` has to be
96
+ * raised or Astro down-levels the modern SDK bundle and dies on a destructuring transform.
97
+ */
98
+ export function astroManual(port, projectId) {
99
+ const extra = port !== undefined && port !== RETICLE_DEFAULT_PORT ? `\n url: '${bridgeWsUrl(port)}',` : '';
100
+ const id = projectId !== undefined && projectId.length > 0 ? `\n projectId: '${projectId}',` : '';
101
+ return `Astro renders its own HTML, so the connect goes in a page <script> and the pairing token is inlined by the config.
102
+
103
+ 1. In astro.config.mjs — inline the daemon's token and raise the build target:
104
+
105
+ import { readFileSync } from 'node:fs';
106
+ import { homedir } from 'node:os';
107
+ import { join } from 'node:path';
108
+
109
+ function reticleToken() {
110
+ const dir = process.env['RETICLE_PAIRING_TOKEN_DIR'] || join(homedir(), '.reticle');
111
+ try { return readFileSync(join(dir, 'pairing-token'), 'utf8').trim(); } catch { return ''; }
112
+ }
113
+
114
+ export default defineConfig({
115
+ vite: {
116
+ // Astro's default target down-levels the modern SDK bundle and fails on a destructuring transform.
117
+ build: { target: 'es2022' },
118
+ optimizeDeps: { esbuildOptions: { target: 'es2022' } },
119
+ define: {
120
+ __RETICLE_TOKEN__: JSON.stringify(reticleToken()),
121
+ // Without this, source pointers come back as absolute paths from YOUR machine — useless in a
122
+ // report. Every other framework gets it from its build plugin; Astro owns its Vite instance.
123
+ __RETICLE_ROOT__: JSON.stringify(process.cwd()),
124
+ },
125
+ },
126
+ });
127
+
128
+ 2. In your layout (or the page you want instrumented), inside <body>:
129
+
130
+ <script>
131
+ if (import.meta.env.DEV) {
132
+ const token = typeof __RETICLE_TOKEN__ !== 'undefined' ? __RETICLE_TOKEN__ : '';
133
+ const root = typeof __RETICLE_ROOT__ !== 'undefined' ? __RETICLE_ROOT__ : '';
134
+ const { reticle, install } = await import('@reticlehq/react');
135
+ install();
136
+ reticle.connect({${id}${extra}
137
+ ...(token.length > 0 ? { token } : {}),
138
+ ...(root.length > 0 ? { root } : {}),
139
+ });
140
+ }
141
+ </script>
142
+
143
+ Start the daemon BEFORE \`astro dev\`, so the token file exists when the config is read. Until it does the token is empty and the page reloads once the daemon is up.`;
144
+ }
145
+ /**
146
+ * The app-side dev module the Vite plugin imports by convention.
147
+ *
148
+ * `registerCapabilities` tells the agent what it can drive without guessing; `registerStore` is the
149
+ * one that matters most and the one we cannot write for you — detecting that an app depends on
150
+ * zustand is easy, knowing which module exports the store instance is not, and a wrong import here
151
+ * breaks the module everything else hangs off. So the store lines are generated COMMENTED, naming
152
+ * the libraries actually found in package.json, with the exact call to uncomment.
153
+ */
154
+ export function viteDevModuleFile(testids, stores) {
155
+ const ids = testids.map((t) => `'${t}'`).join(', ');
156
+ const storeBlock = stores.length === 0
157
+ ? ' // No state library detected. If you add one, register it here — see docs/usage.md.'
158
+ : stores.map((h) => ` // import your store, then: ${h}`).join('\n');
159
+ return `// Dev-only. Imported automatically by @reticlehq/vite-plugin — you do not need to import it.
160
+ // Self-guards on import.meta.env.DEV, so it is a no-op in a production build.
161
+ import { registerCapabilities } from '@reticlehq/react';
162
+
163
+ if (import.meta.env.DEV) {
164
+ // ── Start with ONE flow. ─────────────────────────────────────────────────────────────────────
165
+ // You do not need to describe the whole app to get value, and trying to is the slow path. Register
166
+ // the store your most important flow reads, and list the testids that flow touches. Add more later,
167
+ // when a flow you actually replay needs them.
168
+ //
169
+ // Registering a store is the highest-value line in this file: it lets the agent check what the app
170
+ // BELIEVES, not just what it rendered — the class of bug a screenshot cannot see. Pass the STORE,
171
+ // not \`() => store.getState()\`: the store form wires \`subscribe\` too, so every mutation emits a
172
+ // state diff; the getter form is read-only and silently produces empty diffs.
173
+ ${storeBlock}
174
+
175
+ registerCapabilities({
176
+ testids: [${ids}],${testids.length === 0 ? ' // none found — add data-testid to your key elements' : ''}
177
+ signals: [], // names you pass to reticle.signal()
178
+ stores: [], // the keys you registered above
179
+ });
180
+ }
181
+ `;
182
+ }
183
+ /** Where that module goes. Matches @reticlehq/vite-plugin's convention list. */
184
+ export const VITE_DEV_MODULE_PATH = 'src/reticle-dev.ts';
185
+ /** Default root-layout path, used when no layout was found on disk (reporting only). */
186
+ export const NEXT_LAYOUT_PATH = 'app/layout.tsx';
58
187
  /** Mount instruction for the root layout. */
59
188
  export const NEXT_LAYOUT_MANUAL = `Mount <ReticleDev /> in your root layout (app/layout.tsx), dev-only:
60
189
 
@@ -86,20 +215,42 @@ export function htmlManual(port, projectId) {
86
215
  }
87
216
  export const NEXT_RETICLE_DEV_PATH = 'app/reticle-dev.tsx';
88
217
  export const SVELTEKIT_HOOKS_PATH = 'src/hooks.client.ts';
218
+ /**
219
+ * Said to the user's face rather than discovered later. React, Next, Remix and Astro each have an
220
+ * app and a CI gate; SvelteKit has neither, so "it generated some wiring" is not evidence it works.
221
+ */
222
+ /**
223
+ * Said out loud when the app does not render through React. The SDK is framework-agnostic — DOM,
224
+ * network, console and routing all still work — but `@reticlehq/react` is a React adapter, so
225
+ * component names and source mapping do not, and no CI gate covers this stack. Reporting all-green
226
+ * here is the one thing this project exists not to do.
227
+ */
228
+ export function unverifiedUiLibraryNote(library) {
229
+ return `Detected a ${library} app. Reticle's DOM, network, console and state tools work here, but @reticlehq/react is a React adapter: component names and data-reticle-source file:line will be missing, and no CI gate covers ${library}. Gated today: Vite + React, Next.js, Remix, Astro. If something doesn't work, please open an issue.`;
230
+ }
231
+ export const UNVERIFIED_FRAMEWORK_NOTE = 'Reticle has no SvelteKit app and no CI gate for one, so this wiring is untested — it may work, but nothing proves it and nothing will tell us if it breaks. Supported and gated today: Vite + React, Next.js, Remix and Astro. If the hook does not register a session, please open an issue.';
89
232
  /**
90
233
  * Dev-only client hook that connects Reticle in a SvelteKit app. SvelteKit renders through app.html and
91
234
  * never triggers Vite's index.html injection (verified), so the standard plugin can't auto-connect —
92
235
  * a client hook is the reliable path. SvelteKit runs src/hooks.client.ts on the client at startup.
93
236
  */
94
237
  export function svelteKitHooksFile(port, projectId) {
238
+ const base = connectArg(port, projectId);
239
+ const fields = base === '' ? '' : `${base.slice(1, -1).trim()}, `;
95
240
  return `// Dev-only: connect Reticle on the client. SvelteKit renders via app.html, so the Vite-plugin
96
241
  // index.html injection doesn't fire — connect from this client hook instead.
97
242
  if (import.meta.env.DEV) {
98
243
  void import('@reticlehq/react').then(({ reticle, install }) => {
99
244
  install();
100
- reticle.connect(${connectArg(port, projectId)});
245
+ // The bridge requires the pairing token even on localhost. Nothing in a browser can read the
246
+ // file it lives in, so @reticlehq/vite-plugin inlines it here at build time. Without it the
247
+ // console reads "bridge refused the connection: authentication failed" and no session appears.
248
+ const token = typeof __RETICLE_TOKEN__ !== 'undefined' ? __RETICLE_TOKEN__ : '';
249
+ reticle.connect({ ${fields}...(token.length > 0 ? { token } : {}) });
101
250
  });
102
251
  }
252
+
253
+ declare const __RETICLE_TOKEN__: string | undefined;
103
254
  `;
104
255
  }
105
256
  /**
@@ -114,4 +265,3 @@ export function reticleConfigContent(framework, port, projectId) {
114
265
  fields['port'] = port;
115
266
  return `${JSON.stringify(fields, null, 2)}\n`;
116
267
  }
117
- //# sourceMappingURL=snippets.js.map
@@ -4,22 +4,15 @@
4
4
  * bails to a `manual` result so we never half-edit a build config (a broken config is worse than a
5
5
  * documented manual step).
6
6
  */
7
+ import { PatchKind, type SourcePatch } from './patch-kind.js';
7
8
  export declare const VITE_IMPORT = "import { reticle } from '@reticlehq/vite-plugin';";
9
+ /** Alias kept so existing call sites read in Vite terms; the vocabulary is shared (see patch-kind). */
8
10
  export declare const VitePatchKind: {
9
11
  readonly APPLY: "apply";
10
12
  readonly ALREADY: "already";
11
13
  readonly MANUAL: "manual";
12
14
  };
13
- export type VitePatchKind = (typeof VitePatchKind)[keyof typeof VitePatchKind];
14
- type VitePatch = {
15
- kind: typeof VitePatchKind.APPLY;
16
- code: string;
17
- } | {
18
- kind: typeof VitePatchKind.ALREADY;
19
- } | {
20
- kind: typeof VitePatchKind.MANUAL;
21
- reason: string;
22
- };
15
+ export type VitePatchKind = PatchKind;
16
+ type VitePatch = SourcePatch;
23
17
  export declare function patchViteConfig(source: string, port?: number): VitePatch;
24
18
  export {};
25
- //# sourceMappingURL=vite-config.d.ts.map
@@ -4,6 +4,7 @@
4
4
  * bails to a `manual` result so we never half-edit a build config (a broken config is worse than a
5
5
  * documented manual step).
6
6
  */
7
+ import { PatchKind } from './patch-kind.js';
7
8
  export const VITE_IMPORT = "import { reticle } from '@reticlehq/vite-plugin';";
8
9
  const RETICLE_MARKER = '@reticlehq/vite-plugin';
9
10
  /** The `reticle...)` call — carries the bridge port so the injected connect targets it. */
@@ -14,11 +15,8 @@ function reticlePluginCall(port) {
14
15
  const PLUGINS_ARRAY = /plugins\s*:\s*\[/;
15
16
  /** Matches an ES import statement (used to place our import after the last one). */
16
17
  const IMPORT_LINE = /^import\s.+from\s+['"][^'"]+['"];?\s*$/gm;
17
- export const VitePatchKind = {
18
- APPLY: 'apply',
19
- ALREADY: 'already',
20
- MANUAL: 'manual',
21
- };
18
+ /** Alias kept so existing call sites read in Vite terms; the vocabulary is shared (see patch-kind). */
19
+ export const VitePatchKind = PatchKind;
22
20
  const NO_PLUGINS_REASON = "couldn't find a `plugins: [...]` array to extend";
23
21
  function insertImport(source) {
24
22
  const matches = [...source.matchAll(IMPORT_LINE)];
@@ -29,9 +27,19 @@ function insertImport(source) {
29
27
  const end = last.index + last[0].length;
30
28
  return `${source.slice(0, end)}\n${VITE_IMPORT}${source.slice(end)}`;
31
29
  }
30
+ /**
31
+ * Insert right after the opening `[` of the plugins array, spaced the way the surrounding line is.
32
+ *
33
+ * A multi-line array puts a newline next, and `[reticle(), \n` leaves trailing whitespace — exactly
34
+ * what a formatter rewrites, turning a one-line install into a diff against the user's own style. A
35
+ * single-line array needs the space, or the result reads `[reticle(),react()]`.
36
+ */
32
37
  function insertPlugin(source, port) {
33
- // Insert right after the opening `[` of the plugins array.
34
- return source.replace(PLUGINS_ARRAY, (match) => `${match}${reticlePluginCall(port)}, `);
38
+ return source.replace(PLUGINS_ARRAY, (match, _g, offset) => {
39
+ const next = source[offset + match.length] ?? '';
40
+ const separator = next === '' || /\s/.test(next) ? '' : ' ';
41
+ return `${match}${reticlePluginCall(port)},${separator}`;
42
+ });
35
43
  }
36
44
  export function patchViteConfig(source, port) {
37
45
  if (source.includes(RETICLE_MARKER)) {
@@ -42,4 +50,3 @@ export function patchViteConfig(source, port) {
42
50
  }
43
51
  return { kind: VitePatchKind.APPLY, code: insertImport(insertPlugin(source, port)) };
44
52
  }
45
- //# sourceMappingURL=vite-config.js.map
@@ -0,0 +1,15 @@
1
+ import { type RedactionPolicy } from '@reticlehq/core';
2
+ /** Record what a session declared sensitive. Called when its hello lands. */
3
+ export declare function declareDrivenRedactionKeys(sessionId: string, keys: readonly string[]): void;
4
+ /** Drop a session's declarations when it disconnects, so a closed tab stops widening the union. */
5
+ export declare function forgetDrivenRedactionKeys(sessionId: string): void;
6
+ /** Every key declared by any connected session, sorted so the memo signature is stable. */
7
+ export declare function drivenRedactionKeys(): string[];
8
+ /**
9
+ * The rule in force for driven-path captures: the built-in rule plus every declared key. Identical
10
+ * to the built-in rule when no session declared anything, which is the overwhelmingly common case
11
+ * and the one that must stay byte-identical to before this feature existed.
12
+ */
13
+ export declare function drivenRedactionPolicy(): RedactionPolicy;
14
+ /** Test seam: drop every declaration. Not used in production — sessions unregister themselves. */
15
+ export declare function resetDrivenRedaction(): void;
@@ -0,0 +1,76 @@
1
+ import { buildRedactionPolicy } from '@reticlehq/core';
2
+ /**
3
+ * The redaction rule the DRIVEN path uses — the one place in the daemon that redacts a payload the
4
+ * browser SDK never saw.
5
+ *
6
+ * ## Why this exists at all
7
+ *
8
+ * `connect({ redact: { keys } })` is configured in the page, and the SDK redacts everything it
9
+ * observes. But a driven session's request bodies and response headers are captured by the daemon
10
+ * straight from the network stack (`page.on('response')`), so they never pass through the SDK. An app
11
+ * that declared `licenceKey` sensitive would see it redacted everywhere the developer looked, and
12
+ * find it in cleartext in the on-disk journal — a leak on precisely the path they cannot inspect.
13
+ * So a session's declared keys are announced in its hello and land here.
14
+ *
15
+ * ## Why a daemon-wide UNION rather than a per-session rule
16
+ *
17
+ * A NET_DETAIL is redacted at capture time and only routed to a session afterwards, by `pageUrl`.
18
+ * At the moment of redaction there is no session in hand, and there is a real window in which there
19
+ * is no session at all yet. Resolving one first would mean either delaying redaction (holding a raw
20
+ * credential in memory until routing succeeds) or dropping the detail.
21
+ *
22
+ * The union sidesteps that, and is only safe because of an asymmetry that is enforced upstream:
23
+ * declared keys can ONLY add redaction. The worst case is that one local app's declared key
24
+ * over-redacts a same-named field in another local app on the same daemon — an inconvenience, in the
25
+ * safe direction, between two apps belonging to the same developer on the same machine. The
26
+ * dangerous direction is closed by construction: `allow` never crosses the bridge, so nothing a page
27
+ * sends can lower this floor below the built-in rule.
28
+ */
29
+ /** Declared keys per session id, so a disconnect narrows the union back down. */
30
+ const declaredBySession = new Map();
31
+ /** Memoized policy + the key set it was built from, so the hot path does not rebuild per response. */
32
+ let cached;
33
+ function invalidate() {
34
+ cached = undefined;
35
+ }
36
+ /** Record what a session declared sensitive. Called when its hello lands. */
37
+ export function declareDrivenRedactionKeys(sessionId, keys) {
38
+ if (keys.length === 0) {
39
+ if (declaredBySession.delete(sessionId))
40
+ invalidate();
41
+ return;
42
+ }
43
+ declaredBySession.set(sessionId, [...keys]);
44
+ invalidate();
45
+ }
46
+ /** Drop a session's declarations when it disconnects, so a closed tab stops widening the union. */
47
+ export function forgetDrivenRedactionKeys(sessionId) {
48
+ if (declaredBySession.delete(sessionId))
49
+ invalidate();
50
+ }
51
+ /** Every key declared by any connected session, sorted so the memo signature is stable. */
52
+ export function drivenRedactionKeys() {
53
+ const all = new Set();
54
+ for (const keys of declaredBySession.values())
55
+ for (const key of keys)
56
+ all.add(key);
57
+ return [...all].sort();
58
+ }
59
+ /**
60
+ * The rule in force for driven-path captures: the built-in rule plus every declared key. Identical
61
+ * to the built-in rule when no session declared anything, which is the overwhelmingly common case
62
+ * and the one that must stay byte-identical to before this feature existed.
63
+ */
64
+ export function drivenRedactionPolicy() {
65
+ const keys = drivenRedactionKeys();
66
+ const signature = keys.join('\u0000');
67
+ if (cached?.signature !== signature) {
68
+ cached = { signature, policy: buildRedactionPolicy({ keys }) };
69
+ }
70
+ return cached.policy;
71
+ }
72
+ /** Test seam: drop every declaration. Not used in production — sessions unregister themselves. */
73
+ export function resetDrivenRedaction() {
74
+ declaredBySession.clear();
75
+ invalidate();
76
+ }
@@ -1,4 +1,4 @@
1
- import { type ReticleEvent } from '@reticlehq/core';
1
+ import { type RedactionPolicy, type ReticleEvent } from '@reticlehq/core';
2
2
  /**
3
3
  * CDP-authoritative network detail. Wherever the daemon has a CDP connection — whether it launched
4
4
  * the browser or attached to one someone else started — `page.on('response')` sees the FULL response:
@@ -34,7 +34,13 @@ export interface NetworkDetail {
34
34
  */
35
35
  pageUrl?: string;
36
36
  }
37
- /** Shape a raw authoritative response into a NET_DETAIL payload (lower-cased headers). */
37
+ /**
38
+ * Shape a raw authoritative response into a NET_DETAIL payload (lower-cased headers).
39
+ *
40
+ * `policy` defaults to the built-in rule so this stays a PURE builder — the driven-path union is
41
+ * resolved by `attachNetworkDetail`, at the glue layer, where reading process state is not a lie
42
+ * about the function's inputs.
43
+ */
38
44
  export declare function buildNetworkDetail(raw: {
39
45
  url: string;
40
46
  method?: string;
@@ -43,7 +49,7 @@ export declare function buildNetworkDetail(raw: {
43
49
  resourceType?: string;
44
50
  requestBody?: string;
45
51
  pageUrl?: string;
46
- }): NetworkDetail;
52
+ }, policy?: RedactionPolicy): NetworkDetail;
47
53
  /**
48
54
  * Fold each NET_DETAIL onto the matching in-page NET_REQUEST (by method+url), enriching it with the
49
55
  * authoritative headers/resourceType the page-side wrapper couldn't see — WITHOUT clobbering fields the
@@ -71,4 +77,3 @@ export interface PageLike {
71
77
  * over Playwright's event surface — the daemon routes `emit` to the driven session's pushEvent.
72
78
  */
73
79
  export declare function attachNetworkDetail(page: PageLike, emit: (detail: NetworkDetail) => void): void;
74
- //# sourceMappingURL=network-detail.d.ts.map
@@ -1,6 +1,16 @@
1
- import { EventType, REDACTED_VALUE, isSensitiveKey, scrubKnownSecrets, } from '@reticlehq/core';
1
+ import { EventType, REDACTED_VALUE, defaultIsSensitiveKey, scrubKnownSecrets, } from '@reticlehq/core';
2
+ import { drivenRedactionPolicy } from './driven-redaction.js';
2
3
  /** Bound on a captured wire body — matches the in-page capture so the two are comparable. */
3
4
  const MAX_WIRE_BODY_CHARS = 8192;
5
+ /**
6
+ * The rule this module redacts by.
7
+ *
8
+ * `defaultIsSensitiveKey`, never the ambient `isSensitiveKey`: a daemon serves many sessions in one
9
+ * process, so an ambient policy here would let one app's config decide another app's redaction.
10
+ * Callers that have a session's declarations pass a policy explicitly; everything else gets the
11
+ * built-in floor, which is exactly what this module did before the rule became configurable.
12
+ */
13
+ const DEFAULT_POLICY = { isSensitiveKey: defaultIsSensitiveKey };
4
14
  /**
5
15
  * Redact a sensitive key's value whatever its TYPE — string, number, array, or a nested object.
6
16
  *
@@ -8,19 +18,19 @@ const MAX_WIRE_BODY_CHARS = 8192;
8
18
  * SDK's sanitizer (Playwright hands it over raw), so its redaction has to be as strong as the SDK's,
9
19
  * which is key-based over a parsed object — not string-shaped.
10
20
  */
11
- function redactByKey(value) {
21
+ function redactByKey(value, policy) {
12
22
  if (Array.isArray(value))
13
- return value.map(redactByKey);
23
+ return value.map((v) => redactByKey(v, policy));
14
24
  if (value !== null && typeof value === 'object') {
15
25
  const out = {};
16
26
  for (const [k, v] of Object.entries(value)) {
17
- out[k] = isSensitiveKey(k) ? REDACTED_VALUE : redactByKey(v);
27
+ out[k] = policy.isSensitiveKey(k) ? REDACTED_VALUE : redactByKey(v, policy);
18
28
  }
19
29
  return out;
20
30
  }
21
31
  return value;
22
32
  }
23
- function projectWireBody(raw) {
33
+ function projectWireBody(raw, policy) {
24
34
  const bounded = raw.length > MAX_WIRE_BODY_CHARS ? raw.slice(0, MAX_WIRE_BODY_CHARS) : raw;
25
35
  const byShape = scrubKnownSecrets(bounded);
26
36
  // Prefer a STRUCTURAL pass. A sensitive key must be redacted regardless of its value type — a
@@ -29,7 +39,7 @@ function projectWireBody(raw) {
29
39
  // straight to the agent's context and the on-disk journal. Parsing and walking redacts them by key
30
40
  // whatever the shape.
31
41
  try {
32
- return JSON.stringify(redactByKey(JSON.parse(byShape)));
42
+ return JSON.stringify(redactByKey(JSON.parse(byShape), policy));
33
43
  }
34
44
  catch {
35
45
  // Not JSON (a truncated capture, or a form-encoded body — the shape a login form actually POSTs).
@@ -37,8 +47,8 @@ function projectWireBody(raw) {
37
47
  // truncated body still contains, and the `key=value` pair of `application/x-www-form-urlencoded`,
38
48
  // which neither the JSON path nor the old regex ever touched — so `password=hunter2` leaked.
39
49
  return byShape
40
- .replace(/"([^"]+)"\s*:\s*"([^"]*)"/g, (whole, key) => isSensitiveKey(key) ? `"${key}":"${REDACTED_VALUE}"` : whole)
41
- .replace(/([^&?=\s]+)=([^&\s]*)/g, (whole, key) => isSensitiveKey(key) ? `${key}=${REDACTED_VALUE}` : whole);
50
+ .replace(/"([^"]+)"\s*:\s*"([^"]*)"/g, (whole, key) => policy.isSensitiveKey(key) ? `"${key}":"${REDACTED_VALUE}"` : whole)
51
+ .replace(/([^&?=\s]+)=([^&\s]*)/g, (whole, key) => policy.isSensitiveKey(key) ? `${key}=${REDACTED_VALUE}` : whole);
42
52
  }
43
53
  }
44
54
  /**
@@ -50,25 +60,31 @@ function projectWireBody(raw) {
50
60
  * credential HEADER is redacted whole by key; any other header value is still swept for known secret
51
61
  * SHAPES (a JWT echoed in a custom header), matching how request bodies are handled.
52
62
  */
53
- function projectHeaders(headers) {
63
+ function projectHeaders(headers, policy) {
54
64
  const out = {};
55
65
  for (const [k, v] of Object.entries(headers)) {
56
66
  const key = k.toLowerCase();
57
- out[key] = isSensitiveKey(key) ? REDACTED_VALUE : scrubKnownSecrets(v);
67
+ out[key] = policy.isSensitiveKey(key) ? REDACTED_VALUE : scrubKnownSecrets(v);
58
68
  }
59
69
  return out;
60
70
  }
61
- /** Shape a raw authoritative response into a NET_DETAIL payload (lower-cased headers). */
62
- export function buildNetworkDetail(raw) {
71
+ /**
72
+ * Shape a raw authoritative response into a NET_DETAIL payload (lower-cased headers).
73
+ *
74
+ * `policy` defaults to the built-in rule so this stays a PURE builder — the driven-path union is
75
+ * resolved by `attachNetworkDetail`, at the glue layer, where reading process state is not a lie
76
+ * about the function's inputs.
77
+ */
78
+ export function buildNetworkDetail(raw, policy = DEFAULT_POLICY) {
63
79
  return {
64
80
  url: raw.url,
65
81
  ...(raw.method === undefined ? {} : { method: raw.method }),
66
82
  status: raw.status,
67
- headers: projectHeaders(raw.headers),
83
+ headers: projectHeaders(raw.headers, policy),
68
84
  ...(raw.resourceType === undefined ? {} : { resourceType: raw.resourceType }),
69
85
  ...(raw.requestBody === undefined || raw.requestBody.length === 0
70
86
  ? {}
71
- : { requestBody: projectWireBody(raw.requestBody) }),
87
+ : { requestBody: projectWireBody(raw.requestBody, policy) }),
72
88
  ...(raw.pageUrl === undefined || raw.pageUrl.length === 0 ? {} : { pageUrl: raw.pageUrl }),
73
89
  };
74
90
  }
@@ -148,7 +164,11 @@ export function attachNetworkDetail(page, emit) {
148
164
  ...(resourceType === undefined ? {} : { resourceType }),
149
165
  ...(postData === null ? {} : { requestBody: postData }),
150
166
  pageUrl: page.url(),
151
- }));
167
+ },
168
+ // Resolved per response, not per attachment: a session declaring extra keys can connect
169
+ // after the listener is attached, and capturing the policy once would leave every
170
+ // already-driven page redacting by the rule that was in force before the app said so.
171
+ drivenRedactionPolicy()));
152
172
  });
153
173
  // `response.headers()` REJECTS when the page/CDP session is closing — precisely when responses race
154
174
  // teardown (navigation, tab close). Without this catch the rejection floats; on the daemon path a
@@ -157,4 +177,3 @@ export function attachNetworkDetail(page, emit) {
157
177
  void detailPromise.catch(() => undefined);
158
178
  });
159
179
  }
160
- //# sourceMappingURL=network-detail.js.map
@@ -1,3 +1,2 @@
1
1
  import type { ToolDef } from '../tools/tools.js';
2
2
  export declare const NETWORK_MOCK_TOOLS: ToolDef[];
3
- //# sourceMappingURL=network-mock-tools.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { VISUAL_NO_PROVIDER_RECOMMENDATION, VisualReason } from '@reticlehq/core';
2
+ import { CDP_NO_PROVIDER_REASON, CDP_NO_PROVIDER_RECOMMENDATION } from '@reticlehq/core';
3
3
  import { ReticleTool } from '../tools/tool-names.js';
4
4
  import { sessionIdShape } from '../tools/tool-kit.js';
5
5
  import { asString } from '../tools/tools-helpers.js';
@@ -75,8 +75,8 @@ export const NETWORK_MOCK_TOOLS = [
75
75
  applied: false,
76
76
  count: 0,
77
77
  ok: false,
78
- reason: VisualReason.NO_PROVIDER,
79
- recommendation: VISUAL_NO_PROVIDER_RECOMMENDATION,
78
+ reason: CDP_NO_PROVIDER_REASON,
79
+ recommendation: CDP_NO_PROVIDER_RECOMMENDATION,
80
80
  };
81
81
  }
82
82
  const session = deps.sessions.resolve(asString(args['sessionId']));
@@ -86,4 +86,3 @@ export const NETWORK_MOCK_TOOLS = [
86
86
  },
87
87
  },
88
88
  ];
89
- //# sourceMappingURL=network-mock-tools.js.map
@@ -52,4 +52,3 @@ export declare function applyOutcome(route: Route, outcome: MockOutcome, sleep:
52
52
  */
53
53
  export declare function installNetworkMocks(page: Page, rules: MockRule[], sleep?: (ms: number) => Promise<void>): Promise<void>;
54
54
  export {};
55
- //# sourceMappingURL=network-mock.d.ts.map
@@ -59,4 +59,3 @@ export async function installNetworkMocks(page, rules, sleep = realSleep) {
59
59
  void applyOutcome(route, outcome, sleep);
60
60
  });
61
61
  }
62
- //# sourceMappingURL=network-mock.js.map
@@ -183,6 +183,20 @@ export declare class LaunchedRealInputProvider implements OwnedRealInputProvider
183
183
  perform(_sessionUrl: string, action: ActionType, box: ElementBox, args: RealInputArgs): Promise<RealInputResult>;
184
184
  /** PNG of the owned page, or undefined before navigate / after dispose. */
185
185
  screenshot(_sessionUrl: string, opts: ScreenshotOpts): Promise<Uint8Array | undefined>;
186
+ /**
187
+ * Pin the owned page's viewport; false before navigate / after dispose.
188
+ *
189
+ * `CdpRealInputProvider` has had this since it shipped and THIS provider did not, so
190
+ * `reticle_viewport` refused with `no-cdp-provider` under `reticle drive` — while recommending
191
+ * `reticle drive` as the fix. Same for `setMocks` below. A driven browser was attached and taking
192
+ * screenshots the whole time; only these two methods were missing.
193
+ */
194
+ setViewport(_sessionUrl: string, size: {
195
+ width: number;
196
+ height: number;
197
+ }): Promise<boolean>;
198
+ /** Apply network-mock rules to the owned page; false before navigate / after dispose. */
199
+ setMocks(_sessionUrl: string, rules: MockRule[]): Promise<boolean>;
186
200
  /** Close the owned browser once. Idempotent and safe before navigate. */
187
201
  dispose(): Promise<void>;
188
202
  }
@@ -204,4 +218,3 @@ export declare function selectPage<T extends {
204
218
  url(): string;
205
219
  }>(pages: readonly T[], sessionUrl: string): T | undefined;
206
220
  export {};
207
- //# sourceMappingURL=real-input.d.ts.map