@reticlehq/server 2.8.0 → 2.9.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 (292) hide show
  1. package/SKILL.md +130 -813
  2. package/dist/bridge/bridge.d.ts +23 -0
  3. package/dist/bridge/bridge.js +80 -2
  4. package/dist/bridge/bridge.test-harness.d.ts +5 -0
  5. package/dist/bridge/bridge.test-harness.js +6 -4
  6. package/dist/capsule/causal-summary.d.ts +16 -1
  7. package/dist/capsule/causal-summary.js +2 -1
  8. package/dist/cli/cli-doctor.js +41 -13
  9. package/dist/cli/cli-flow-commands.js +8 -8
  10. package/dist/cli/cli-launch.d.ts +0 -17
  11. package/dist/cli/cli-launch.js +0 -28
  12. package/dist/cli/cli-port.d.ts +24 -0
  13. package/dist/cli/cli-port.js +66 -35
  14. package/dist/cli/cli-verify.d.ts +21 -0
  15. package/dist/cli/cli-verify.js +45 -1
  16. package/dist/cli/config-discovery.d.ts +35 -0
  17. package/dist/cli/config-discovery.js +163 -0
  18. package/dist/cli/doctor-daemon-line.js +4 -1
  19. package/dist/cli/doctor-project-line.d.ts +37 -0
  20. package/dist/cli/doctor-project-line.js +35 -0
  21. package/dist/cli/doctor-rows.d.ts +51 -0
  22. package/dist/cli/doctor-rows.js +54 -0
  23. package/dist/cli/doctor-sessions-line.js +6 -3
  24. package/dist/cli/drive-attach.d.ts +99 -0
  25. package/dist/cli/drive-attach.js +203 -0
  26. package/dist/cli/drive-command.d.ts +13 -0
  27. package/dist/cli/drive-command.js +103 -0
  28. package/dist/cli/open-note.d.ts +20 -0
  29. package/dist/cli/open-note.js +37 -0
  30. package/dist/cli/status-next-action.d.ts +37 -0
  31. package/dist/cli/status-next-action.js +61 -0
  32. package/dist/cli.js +65 -70
  33. package/dist/events/contradictions.d.ts +32 -0
  34. package/dist/events/contradictions.js +9 -5
  35. package/dist/events/declared.d.ts +45 -0
  36. package/dist/events/declared.js +73 -0
  37. package/dist/events/echo-mismatch.d.ts +8 -2
  38. package/dist/events/echo-mismatch.js +33 -5
  39. package/dist/events/event-filters.d.ts +1 -1
  40. package/dist/events/event-filters.js +7 -4
  41. package/dist/events/predicate-eval.d.ts +17 -91
  42. package/dist/events/predicate-eval.js +85 -326
  43. package/dist/events/predicate-parse.js +31 -3
  44. package/dist/events/predicate-route.d.ts +32 -0
  45. package/dist/events/predicate-route.js +102 -0
  46. package/dist/events/predicate-schema.d.ts +99 -0
  47. package/dist/events/predicate-schema.js +309 -0
  48. package/dist/events/predicate.d.ts +8 -0
  49. package/dist/events/predicate.js +127 -5
  50. package/dist/flows/annotate-tools.js +3 -0
  51. package/dist/flows/annotate.js +18 -4
  52. package/dist/flows/coverage.d.ts +38 -5
  53. package/dist/flows/coverage.js +30 -4
  54. package/dist/flows/decision.d.ts +15 -0
  55. package/dist/flows/decision.js +1 -1
  56. package/dist/flows/flow-replay-run.js +8 -1
  57. package/dist/flows/flow-tools.js +9 -1
  58. package/dist/flows/replay.js +3 -0
  59. package/dist/honesty/accepted-write.d.ts +3 -0
  60. package/dist/honesty/accepted-write.js +8 -3
  61. package/dist/honesty/already-true.js +15 -0
  62. package/dist/honesty/blind-spots.js +4 -0
  63. package/dist/honesty/honesty.d.ts +11 -0
  64. package/dist/honesty/honesty.js +1 -0
  65. package/dist/honesty/uncaptured-bodies.d.ts +4 -2
  66. package/dist/honesty/uncaptured-bodies.js +9 -2
  67. package/dist/honesty/unread-outcome.d.ts +8 -0
  68. package/dist/honesty/unread-outcome.js +36 -9
  69. package/dist/honesty/unsettled.d.ts +9 -0
  70. package/dist/honesty/unsettled.js +7 -3
  71. package/dist/honesty/verified.d.ts +29 -3
  72. package/dist/honesty/verified.js +51 -8
  73. package/dist/http-server.d.ts +19 -0
  74. package/dist/http-server.js +202 -4
  75. package/dist/impact/impact-recorder.d.ts +23 -0
  76. package/dist/impact/impact-recorder.js +76 -0
  77. package/dist/impact/impact-store.d.ts +47 -0
  78. package/dist/impact/impact-store.js +171 -0
  79. package/dist/index.d.ts +7 -0
  80. package/dist/index.js +44 -10
  81. package/dist/init/agent-rules.d.ts +20 -0
  82. package/dist/init/agent-rules.js +36 -0
  83. package/dist/init/astro-patch.js +27 -1
  84. package/dist/init/confirm.d.ts +21 -3
  85. package/dist/init/confirm.js +32 -5
  86. package/dist/init/connect-steps.d.ts +2 -0
  87. package/dist/init/connect-steps.js +50 -0
  88. package/dist/init/csp-check.d.ts +38 -0
  89. package/dist/init/csp-check.js +92 -0
  90. package/dist/init/csp-doctor.d.ts +25 -0
  91. package/dist/init/csp-doctor.js +49 -0
  92. package/dist/init/cursor.js +6 -9
  93. package/dist/init/detect.d.ts +8 -0
  94. package/dist/init/detect.js +33 -3
  95. package/dist/init/mcp-clients.d.ts +1 -0
  96. package/dist/init/mcp-clients.js +51 -7
  97. package/dist/init/mcp.d.ts +15 -0
  98. package/dist/init/mcp.js +19 -0
  99. package/dist/init/plan-framework.d.ts +10 -0
  100. package/dist/init/plan-framework.js +25 -1
  101. package/dist/init/plan.d.ts +7 -2
  102. package/dist/init/plan.js +66 -30
  103. package/dist/init/run.js +11 -5
  104. package/dist/init/slash-command.d.ts +1 -1
  105. package/dist/init/slash-command.js +12 -4
  106. package/dist/init/snippets.d.ts +1 -1
  107. package/dist/init/snippets.js +35 -7
  108. package/dist/init/vite-config.js +24 -2
  109. package/dist/input/network-mock-tools.js +8 -1
  110. package/dist/input/scroll-find.d.ts +6 -0
  111. package/dist/input/scroll-find.js +17 -2
  112. package/dist/input/scroll-tools.js +4 -0
  113. package/dist/journal/attach-journal.d.ts +9 -1
  114. package/dist/journal/attach-journal.js +13 -2
  115. package/dist/journal/journal-query.d.ts +13 -0
  116. package/dist/journal/journal-query.js +28 -3
  117. package/dist/journal/workspace-gitignore.d.ts +10 -0
  118. package/dist/journal/workspace-gitignore.js +59 -0
  119. package/dist/mcp/mcp-proxy.d.ts +5 -66
  120. package/dist/mcp/mcp-proxy.js +180 -163
  121. package/dist/mcp/mcp.d.ts +10 -1
  122. package/dist/mcp/mcp.js +47 -27
  123. package/dist/mcp/proxy-handshake.d.ts +82 -1
  124. package/dist/mcp/proxy-handshake.js +109 -2
  125. package/dist/mcp/proxy-lifecycle.d.ts +10 -1
  126. package/dist/mcp/proxy-lifecycle.js +11 -2
  127. package/dist/mcp/proxy-log.d.ts +63 -0
  128. package/dist/mcp/proxy-log.js +132 -0
  129. package/dist/mcp/server-instructions.d.ts +17 -0
  130. package/dist/mcp/server-instructions.js +56 -0
  131. package/dist/mcp/shared-params.d.ts +27 -0
  132. package/dist/mcp/shared-params.js +36 -0
  133. package/dist/project/reticle-dir.d.ts +2 -0
  134. package/dist/project/reticle-dir.js +1 -0
  135. package/dist/session/connection-memory.d.ts +59 -0
  136. package/dist/session/connection-memory.js +108 -0
  137. package/dist/session/dev-command.d.ts +26 -0
  138. package/dist/session/dev-command.js +89 -0
  139. package/dist/session/dev-server-probe.d.ts +68 -0
  140. package/dist/session/dev-server-probe.js +102 -7
  141. package/dist/session/last-act.d.ts +26 -0
  142. package/dist/session/last-act.js +35 -1
  143. package/dist/session/live-control-tools.js +42 -5
  144. package/dist/session/no-session-diagnosis.d.ts +48 -2
  145. package/dist/session/no-session-diagnosis.js +176 -20
  146. package/dist/session/no-session-next-action.d.ts +46 -0
  147. package/dist/session/no-session-next-action.js +85 -0
  148. package/dist/session/no-session-watch.d.ts +40 -1
  149. package/dist/session/no-session-watch.js +165 -11
  150. package/dist/session/pending-commands.d.ts +12 -0
  151. package/dist/session/pending-commands.js +13 -1
  152. package/dist/session/session-manager.d.ts +4 -0
  153. package/dist/session/session-manager.js +35 -5
  154. package/dist/session/session.d.ts +10 -1
  155. package/dist/session/session.js +146 -5
  156. package/dist/telemetry/app-instrumented.d.ts +8 -0
  157. package/dist/telemetry/app-instrumented.js +10 -0
  158. package/dist/telemetry/bug-found.d.ts +18 -0
  159. package/dist/telemetry/bug-found.js +14 -0
  160. package/dist/telemetry/daemon-telemetry.js +24 -0
  161. package/dist/telemetry/install-source.d.ts +20 -0
  162. package/dist/telemetry/install-source.js +34 -0
  163. package/dist/telemetry/instrumentation-stall.d.ts +50 -0
  164. package/dist/telemetry/instrumentation-stall.js +90 -0
  165. package/dist/telemetry/session-metrics.d.ts +8 -0
  166. package/dist/telemetry/session-metrics.js +10 -0
  167. package/dist/telemetry/telemetry.d.ts +3 -1
  168. package/dist/telemetry/telemetry.js +13 -2
  169. package/dist/tools/act-tools.js +166 -29
  170. package/dist/tools/assert-verdict.js +32 -7
  171. package/dist/tools/browser-tools.js +10 -0
  172. package/dist/tools/dynamic-tools.js +16 -7
  173. package/dist/tools/error-recovery.js +9 -5
  174. package/dist/tools/invoke-tool.js +20 -3
  175. package/dist/tools/lease-hint.d.ts +30 -8
  176. package/dist/tools/lease-hint.js +65 -14
  177. package/dist/tools/lease-tools.d.ts +11 -0
  178. package/dist/tools/lease-tools.js +141 -96
  179. package/dist/tools/observe-tools.js +9 -3
  180. package/dist/tools/react-grace.d.ts +4 -0
  181. package/dist/tools/react-grace.js +6 -3
  182. package/dist/tools/read-tools.js +47 -1
  183. package/dist/tools/resolve-target.d.ts +33 -0
  184. package/dist/tools/resolve-target.js +53 -0
  185. package/dist/tools/settle-in-flight.d.ts +15 -0
  186. package/dist/tools/settle-in-flight.js +42 -2
  187. package/dist/tools/snapshot-delta.d.ts +3 -0
  188. package/dist/tools/snapshot-delta.js +67 -6
  189. package/dist/tools/tool-kit.d.ts +8 -0
  190. package/dist/tools/tool-surface.d.ts +60 -0
  191. package/dist/tools/tool-surface.js +85 -19
  192. package/dist/tools/tools.js +45 -4
  193. package/dist/tools/unadvertised-help.js +9 -6
  194. package/docs/README.md +1 -2
  195. package/docs/actions.mdx +41 -8
  196. package/docs/agent-cheatsheet.md +4 -2
  197. package/docs/architecture.md +6 -0
  198. package/docs/benchmarks.md +60 -12
  199. package/docs/best-practices.mdx +11 -6
  200. package/docs/capabilities.mdx +201 -54
  201. package/docs/cli/affected.mdx +6 -4
  202. package/docs/cli/capsules.mdx +9 -8
  203. package/docs/cli/cloud.mdx +30 -4
  204. package/docs/cli/doctor.mdx +41 -8
  205. package/docs/cli/drive.mdx +34 -15
  206. package/docs/cli/gate.mdx +6 -6
  207. package/docs/cli/help.mdx +8 -6
  208. package/docs/cli/hunt.mdx +18 -2
  209. package/docs/cli/identify.mdx +16 -2
  210. package/docs/cli/init.mdx +35 -8
  211. package/docs/cli/kill.mdx +5 -5
  212. package/docs/cli/license.mdx +1 -1
  213. package/docs/cli/open.mdx +6 -0
  214. package/docs/cli/restart.mdx +6 -6
  215. package/docs/cli/serve.mdx +10 -3
  216. package/docs/cli/status.mdx +29 -5
  217. package/docs/cli/stop.mdx +8 -0
  218. package/docs/cli/verify.mdx +20 -1
  219. package/docs/cli/version.mdx +1 -1
  220. package/docs/cli/watch.mdx +9 -2
  221. package/docs/cli.mdx +44 -22
  222. package/docs/debugging.md +3 -1
  223. package/docs/deploy-checks.md +30 -1
  224. package/docs/desktop.mdx +276 -80
  225. package/docs/docs.json +13 -12
  226. package/docs/enterprise.md +2 -0
  227. package/docs/faq.mdx +49 -35
  228. package/docs/fixtures.md +2 -0
  229. package/docs/flows.md +3 -1
  230. package/docs/for-agents.md +3 -3
  231. package/docs/frameworks.mdx +46 -7
  232. package/docs/gate-plan.md +4 -2
  233. package/docs/gates.md +7 -5
  234. package/docs/getting-started.md +53 -12
  235. package/docs/human-control.md +2 -0
  236. package/docs/index.mdx +43 -1
  237. package/docs/install-agentic.mdx +13 -4
  238. package/docs/install-manual.mdx +6 -4
  239. package/docs/instrumentation.mdx +7 -1
  240. package/docs/integration-patterns.md +3 -1
  241. package/docs/local-registry.md +4 -2
  242. package/docs/multi-agent-testing.md +3 -1
  243. package/docs/packages/babel-plugin.mdx +15 -6
  244. package/docs/packages/browser.mdx +2 -2
  245. package/docs/packages/core.mdx +26 -16
  246. package/docs/packages/electron.mdx +5 -7
  247. package/docs/packages/eslint-plugin.mdx +5 -3
  248. package/docs/packages/next.mdx +3 -5
  249. package/docs/packages/react.mdx +3 -3
  250. package/docs/packages/server.mdx +2 -2
  251. package/docs/packages/tauri.mdx +6 -6
  252. package/docs/packages/test.mdx +18 -7
  253. package/docs/packages/vite-plugin.mdx +4 -6
  254. package/docs/packages.mdx +14 -13
  255. package/docs/platform-integration.md +2 -0
  256. package/docs/predicates.mdx +76 -7
  257. package/docs/quickstart.mdx +51 -5
  258. package/docs/recipes.mdx +62 -22
  259. package/docs/skill-file.mdx +3 -1
  260. package/docs/state-management.mdx +2 -0
  261. package/docs/system-map.md +3 -1
  262. package/docs/telemetry-contract.md +16 -5
  263. package/docs/telemetry-events.mdx +63 -18
  264. package/docs/telemetry.md +8 -5
  265. package/docs/testing.md +35 -1
  266. package/docs/token-efficiency.md +8 -2
  267. package/docs/tools-act-and-wait.mdx +64 -14
  268. package/docs/tools-act-sequence.mdx +34 -17
  269. package/docs/tools-act.mdx +24 -11
  270. package/docs/tools-assert.mdx +69 -10
  271. package/docs/tools-console.mdx +11 -7
  272. package/docs/tools-inspect.mdx +11 -8
  273. package/docs/tools-navigate.mdx +41 -5
  274. package/docs/tools-network.mdx +42 -9
  275. package/docs/tools-observe.mdx +66 -10
  276. package/docs/tools-overview.mdx +26 -23
  277. package/docs/tools-query.mdx +52 -8
  278. package/docs/tools-session-and-feedback.mdx +30 -9
  279. package/docs/tools-sessions.mdx +39 -10
  280. package/docs/tools-snapshot.mdx +57 -3
  281. package/docs/tools-state.mdx +24 -1
  282. package/docs/tools-tools-and-run.mdx +40 -9
  283. package/docs/tools-wait-for.mdx +34 -15
  284. package/docs/troubleshooting.mdx +80 -10
  285. package/docs/usage.md +43 -21
  286. package/docs/vs-chrome-devtools-mcp.mdx +41 -0
  287. package/docs/vs-playwright-mcp.mdx +42 -2
  288. package/docs/vs-screenshots.mdx +42 -1
  289. package/docs/what-is-reticle.mdx +1 -1
  290. package/docs/why-reticle.mdx +3 -1
  291. package/package.json +5 -5
  292. package/docs/desktop-apps.md +0 -265
package/docs/desktop.mdx CHANGED
@@ -1,15 +1,52 @@
1
1
  ---
2
- title: Desktop apps: no browser required
2
+ title: 'Desktop apps: no browser required'
3
3
  sidebarTitle: Desktop apps
4
- description: Reticle verifies Electron and Tauri apps from inside, including the IPC boundary the renderer cannot see. No browser, no screenshot, no URL to open.
4
+ description: 'Verify Electron and Tauri apps from the inside with Reticle, including the IPC boundary the renderer cannot see. Setup, capabilities, screenshots, headless mode, and troubleshooting for both runtimes.'
5
5
  icon: display
6
6
  ---
7
7
 
8
- Ask most browser tooling to test a desktop app and the first question is "what URL do I open?".
8
+ Reticle verifies Electron and Tauri apps the same way it verifies web apps: from **inside** the app, over a localhost WebSocket. There is no URL to open, no browser to launch, and no screenshot to interpret. Your app dials the daemon, and the agent drives it with the same tools it uses on the web.
9
9
 
10
- There isn't one. That is the whole problem, and it is why desktop verification is mostly unserved.
10
+ This page is the complete desktop guide. Everything you need to wire, drive, and debug both runtimes is here.
11
11
 
12
- Reticle inverts the direction. Your app dials the local daemon, the agent drives it through the same tools it uses for the web, and the verdicts read the same. No Chromium to launch, no screenshot to interpret.
12
+ ## How you actually test a desktop app
13
+
14
+ The usual question is "it's a desktop app, so what URL does the agent open?". There isn't one, and that is the whole problem. The direction is reversed from what browser tooling trains you to expect:
15
+
16
+ ```mermaid
17
+ flowchart LR
18
+ A["coding agent"]
19
+ D["reticle daemon<br/>localhost:4400"]
20
+ W["your Electron / Tauri<br/>window + the SDK"]
21
+
22
+ A <-- "MCP over stdio" --> D
23
+ W -- "the app dials OUT<br/>over WebSocket" --> D
24
+ D -- "commands" --> W
25
+ ```
26
+
27
+ Your app **connects to the daemon**, not the other way round. So the workflow is:
28
+
29
+ 1. **Start the daemon once.**
30
+
31
+ ```bash
32
+ npx @reticlehq/server serve
33
+ ```
34
+
35
+ 2. **Start your app exactly as you always do.**
36
+
37
+ ```bash
38
+ npm run dev # or: electron . | cargo tauri dev
39
+ ```
40
+
41
+ 3. **Confirm it connected.**
42
+
43
+ ```bash
44
+ npx @reticlehq/server status
45
+ ```
46
+
47
+ Your window appears as a session, and the agent can drive it.
48
+
49
+ `reticle open` has nothing to open for a desktop app and will say so, and there is no `reticle drive` for desktop: those launch a browser, which is not what you are testing. Headless works on both runtimes, covered below.
13
50
 
14
51
  ## The thing nobody else does
15
52
 
@@ -42,29 +79,30 @@ The app said it loaded. One IPC call in the same window returned 500. Reticle pu
42
79
  headless on every change.
43
80
  </Note>
44
81
 
45
- ## What works, and what is proven
46
-
47
- | Capability | Electron | Tauri |
48
- | --------------------------------------------- | :------: | :---: |
49
- | sessions, snapshot, query, inspect | yes | yes |
50
- | capabilities, live store state | yes | yes |
51
- | act: click, fill, type, select | yes | yes |
52
- | **act_and_wait, wait_for, assert** | yes | yes |
53
- | console errors | yes | yes |
54
- | network over HTTP | yes | yes |
55
- | **network over IPC** | yes | yes |
56
- | route (use a hash router) | yes | yes |
57
- | storage, animations, observe, explore | yes | yes |
58
- | baselines, record and replay, crawl | yes | yes |
59
- | **screenshot and visual diff** | yes | yes |
60
- | **drivable while occluded or minimized** | yes | yes |
61
- | **headless** | yes | yes |
62
- | **a missing preload is declared, not silent** | yes | n/a |
63
- | network mocking, viewport pinning | no | no |
64
-
65
- Bold rows are re-proven by `pnpm test:e2e:desktop` on every change. The rest were measured by hand.
66
-
67
- That distinction is deliberate. This table used to report a hand-run score with nothing in the repo reproducing it, so it could go stale without anything failing.
82
+ ## What works, measured
83
+
84
+ Every tool below was run against both demo apps against a live daemon.
85
+
86
+ The rows in **bold** are re-proven by a committed battery on every change, `pnpm test:e2e:desktop`, which starts a real Electron main process and a **packaged** Tauri binary (`tauri://localhost`, not `tauri dev`) and drives them headless. The rest were measured by hand. That distinction matters: this table used to report a hand-run score with nothing in the repo that reproduced it, so it could go stale without anything failing.
87
+
88
+ | Capability | Electron | Tauri | Note |
89
+ | --- | --- | --- | --- |
90
+ | sessions, snapshot, query, inspect | yes | yes | `inspect` returns `src/App.tsx:104` in a dev build; a packaged production renderer has no source map, so it reports `n/a` |
91
+ | capabilities, state (live store) | yes | yes | `reticle_state` reads the real store |
92
+ | act (click/fill/type/select) | yes | yes | |
93
+ | **act_and_wait, wait_for, assert** | yes | yes | signal / state / route / net / console predicates |
94
+ | console errors | yes | yes | catches what the UI never shows |
95
+ | network (HTTP) | yes | yes | on `file://` a relative URL has no origin; use an absolute one |
96
+ | **network (IPC)** | yes | yes | `ipc://<channel>`, including failures. Electron: `invoke` and `sendSync` carry a verdict; a one-way `send` is recorded as `oneWay: true` with NO status, because the renderer never learns the outcome. Tauri: both the `ipc://` (macOS/Linux) and `http://ipc.localhost` (Windows) transports |
97
+ | route | yes | yes | use a **hash** router, see below |
98
+ | storage, animations, observe, explore | yes | yes | |
99
+ | baseline (semantic), record then replay, crawl | yes | yes | `crawl` found real anomalies in both |
100
+ | navigate (reload) | yes | yes | |
101
+ | **screenshot / visual_diff** | yes | yes | one line in Electron's main process, one Rust command in Tauri, both below. Reticle's own presenter panel is hidden for the shot, so a baseline records your app and not the instrument |
102
+ | **drivable while window occluded** | yes | yes | including minimized, app-hidden, and behind a fullscreen app on another Space |
103
+ | **headless** | yes | yes | Electron never shows the window; Tauri shows, loads, then hides |
104
+ | **a missing preload is DECLARED, not silent** | yes | n/a | without `@reticlehq/electron/preload` every IPC call is invisible, so verdicts carry `coverage: partial` naming the missing line instead of reading clean |
105
+ | network_mock, viewport | no | no | need a Reticle-driven browser |
68
106
 
69
107
  ## Three things that are genuinely different
70
108
 
@@ -80,68 +118,63 @@ That distinction is deliberate. This table used to report a hand-run score with
80
118
  </Card>
81
119
  </CardGroup>
82
120
 
83
- ### Why screenshots read the backing store
84
-
85
- `webContents.capturePage()` reads the window's own pixels. Capturing a screen _region_ was tried and deliberately rejected.
86
-
87
- A region capture photographs whatever is on top. An app window behind your editor yields a picture of the editor, saved as a visual baseline that a later diff would trust.
121
+ ## Electron setup
88
122
 
89
- A screenshot tool that can silently return another window's pixels manufactures exactly the false green Reticle exists to eliminate.
123
+ Two steps. The first is the ordinary web setup; the second is the only desktop-specific part.
90
124
 
91
- <Warning>
92
- One honest caveat. A fully occluded or minimized window is only partially composited, so parts of
93
- a capture may come back blank. Bring the window forward for a complete image. It is never the
94
- wrong window.
95
- </Warning>
125
+ **1. The renderer.** One line in `vite.config.ts`, exactly like a web app:
96
126
 
97
- ### Why a missing preload is not a silent pass
127
+ ```ts
128
+ import { reticle } from '@reticlehq/vite-plugin';
98
129
 
99
- Without `@reticlehq/electron/preload`, every IPC call is invisible to Reticle.
130
+ export default defineConfig({
131
+ base: './', // file:// needs relative asset paths
132
+ plugins: [react(), reticle({ desktop: true })],
133
+ });
134
+ ```
100
135
 
101
- A tool that just reported clean there would be telling you the IPC layer is fine when it never looked. Instead verdicts carry `coverage: partial` and name the missing line.
136
+ `desktop: true` does the two things a desktop shell needs and a web app must never get: the plugin also runs for `vite build` (a packaged renderer is a production build with **no dev server**, so the default serve-only gating would ship an app with no `connect()` at all), and `connect()` is called with `allowInProduction` so the SDK's production backstop does not refuse to start. Keep it behind your own dev-only build so an instrumented bundle can never reach a release binary.
102
137
 
103
- ## Getting started
138
+ Nothing to add in your app code. You can still call `reticle.connect()` by hand and pass `inject: false` if you want control.
104
139
 
105
- The workflow has no browser step in it at all.
140
+ **2. The preload.** One line, before you expose anything:
106
141
 
107
- 1. **Start the daemon once.**
142
+ ```bash
143
+ npm i -D @reticlehq/electron
144
+ ```
108
145
 
109
- ```bash
110
- npx @reticlehq/server serve
111
- ```
146
+ ```js
147
+ // electron/preload.cjs
148
+ require('@reticlehq/electron/preload');
112
149
 
113
- 2. **Start your app exactly as you always do.**
150
+ const { contextBridge, ipcRenderer } = require('electron');
151
+ contextBridge.exposeInMainWorld('api', {
152
+ loadTodos: () => ipcRenderer.invoke('todos:load'),
153
+ });
154
+ ```
114
155
 
115
- ```bash
116
- npm run dev # or: electron . | cargo tauri dev
117
- ```
156
+ That line is what makes your main-process calls visible. It has to live in the preload, and it is not a stylistic choice: `contextBridge.exposeInMainWorld` hands the renderer a **deeply frozen, non-configurable** object, so nothing running in the page can instrument `window.api`. The preload is the last point where `ipcRenderer.invoke` is still an ordinary, writable function. Patching there covers every channel you go on to expose, whatever you named it.
118
157
 
119
- 3. **Confirm it connected.**
158
+ **Preload sandboxing.** A sandboxed preload cannot resolve `node_modules`, so the bare `require` above fails with `module not found: @reticlehq/electron/preload`. Either bundle your preload (electron-vite and Electron Forge do this by default; the require is inlined at build time and sandboxing stays on), or set `sandbox: false` in `webPreferences`.
120
159
 
121
- ```bash
122
- npx @reticlehq/server status
123
- ```
160
+ **Packaged renderers.** An app that loads its renderer with `loadFile` runs on `file://`, which is a production Vite build. Pass `allowInProduction: true` to `connect()` for that mode, or keep the SDK gated behind `import.meta.env.DEV` so it never enters the shipped binary at all.
124
161
 
125
- Your window appears as a session, and the agent can drive it.
162
+ Working example: [`apps/electron-smoke`](https://github.com/reticlehq/reticle/tree/main/apps/electron-smoke).
126
163
 
127
- ### Electron
164
+ ## Tauri setup
128
165
 
129
- Screenshots are one line in the main process:
166
+ Frontend side, nothing desktop-specific:
130
167
 
131
- ```js
132
- const { installReticleCapture } = require('@reticlehq/electron/main');
168
+ ```ts
169
+ // src/main.tsx
170
+ import { reticle } from '@reticlehq/browser';
133
171
 
134
- const win = new BrowserWindow({
135
- /* … */
136
- });
137
- installReticleCapture(win);
172
+ if (import.meta.env.DEV) reticle.connect();
138
173
  ```
139
174
 
140
- No CDP flag, no extra packages, and it works on a packaged `file://` renderer.
141
-
142
- ### Tauri
175
+ Nothing else is needed for IPC. A Tauri `invoke` travels as a real `fetch` to Tauri's `ipc://` custom protocol, so Reticle already sees it; every `invoke('load_todos')` shows up as `ipc://load_todos`. Reticle also reads Tauri's `Tauri-Response` header, because the transport answers **HTTP 200 whether the Rust command returned `Ok` or `Err`**. Without that translation a failed command would be recorded as a successful request.
143
176
 
144
- The frontend is identical to any web app. The CSP is not optional:
177
+ The one required step is **CSP**. Tauri ships a restrictive default that blocks the bridge WebSocket before it opens, and the failure is silent from the app's side. In `src-tauri/tauri.conf.json`:
145
178
 
146
179
  ```json
147
180
  {
@@ -154,16 +187,30 @@ The frontend is identical to any web app. The CSP is not optional:
154
187
  ```
155
188
 
156
189
  <Warning>
157
- Tauri's default CSP blocks the bridge WebSocket **before it opens**. Your app runs perfectly and
158
- simply never connects, with no error to go on.
190
+ Tauri's default CSP blocks the bridge WebSocket **before it opens**. Your app runs perfectly and
191
+ simply never connects, with no error to go on. Keep `ipc: http://ipc.localhost` in `connect-src`,
192
+ because Tauri v2 needs it for `invoke` itself. Add your dev-server origin too if you use `devUrl`.
193
+ This is a dev-only config, so drop the `ws://` entries from your release config.
194
+ </Warning>
159
195
 
160
- Keep `ipc: http://ipc.localhost` in `connect-src`, because Tauri v2 needs it for `invoke` itself. Drop the `ws://` entries from your release config.
196
+ Working example: [`apps/tauri-smoke`](https://github.com/reticlehq/reticle/tree/main/apps/tauri-smoke).
161
197
 
162
- </Warning>
198
+ ## Screenshots
199
+
200
+ **Electron: one line in the main process.**
201
+
202
+ ```js
203
+ const { installReticleCapture } = require('@reticlehq/electron/main');
163
204
 
164
- IPC observation needs nothing on the Rust side. An `invoke('load_todos')` already reaches Reticle as `ipc://load_todos`.
205
+ const win = new BrowserWindow({/* ... */});
206
+ installReticleCapture(win);
207
+ ```
208
+
209
+ That is all: no CDP flag, no extra packages, and it works on a packaged `file://` renderer. `reticle_screenshot` and `reticle_visual_diff` then work on your app.
210
+
211
+ Alternatively, since an Electron renderer _is_ Chromium, `--remote-debugging-port=9222` plus `RETICLE_CDP_URL=http://127.0.0.1:9222` also works and additionally enables `fullPage` (the main-process route captures the window as composited, so it cannot scroll-stitch).
165
212
 
166
- Screenshots and headless mode need the crate, which is versioned independently of the npm packages:
213
+ **Tauri: one Rust command.** The crate is versioned independently of the npm packages:
167
214
 
168
215
  ```toml
169
216
  [dependencies]
@@ -176,13 +223,162 @@ tauri::Builder::default()
176
223
  .on_page_load(reticle_tauri::on_page_load)
177
224
  ```
178
225
 
179
- ## Keep reading
226
+ Nothing on the JavaScript side: the SDK invokes the command through Tauri's own internals, because Tauri has no preload stage where a shim could be installed.
227
+
228
+ ### Why the backing store, and not a screen capture
229
+
230
+ `webContents.capturePage()` reads the window's own backing store. Capturing a screen _region_ instead was tried and deliberately rejected: it photographs whatever is on top, so an app window behind your editor yields a picture of the editor, saved as a visual baseline that a later diff would trust. A screenshot tool that can silently return another window's pixels manufactures exactly the false green Reticle exists to eliminate.
231
+
232
+ `reticle_capture` on Tauri renders the webview for the same reason, so it needs no screen-recording permission, cannot return another window's pixels, and is correct with nothing on screen at all. Each platform uses its own webview API:
233
+
234
+ | Platform | API | Status |
235
+ | --- | --- | --- |
236
+ | macOS | `WKWebView.takeSnapshot` | Verified against a running app |
237
+ | Linux, BSD | WebKitGTK `webkit_web_view_get_snapshot` | Snapshot plus PNG encoding verified under `xvfb`, not yet driven through a full Tauri app |
238
+ | Windows | WebView2 `CapturePreview` | **Untested: compiles, never executed** |
239
+
240
+ The Windows path is written and type-checked against the real `webview2-com` API (which caught two genuine type errors), but nobody has run it on Windows. CI re-checks it against that target on every PR (`cargo check --target x86_64-pc-windows-msvc`), so "compiles" is a gate rather than a claim. Executed is still a different word from compiled: it is shipped rather than withheld so it can be tried, and labelled rather than listed flatly so that trying it is a choice. If it works for you, say so and this row changes; treat a green from it as unconfirmed until then.
241
+
242
+ All three capture the visible viewport by default, so a baseline taken on a developer's Mac is comparable against the same app in Linux CI. On a platform with no webview API to call, capture reports no-provider rather than returning a plausible wrong image.
243
+
244
+ **`{ fullPage: true }` works on Tauri/Linux only.** WebKitGTK can render the whole document offscreen; `takeSnapshot` (macOS) and `CapturePreview` (Windows) only give what is composited, and Electron's `capturePage()` is the same. Asked for a full page they cannot produce, all of them return `{ ok: false, reason: 'full-page-unsupported' }` rather than quietly handing back the viewport, which would be a baseline that omits everything below the fold while every later diff of it reports green about a region that was never captured. No baseline is written on a refusal.
245
+
246
+ An app that already has its own capture can expose `window.__reticleIpc.capture()` returning a PNG path instead; the SDK prefers it over the built-in command.
247
+
248
+ <Warning>
249
+ One honest caveat. A fully occluded or minimized window is only partially composited, so parts of
250
+ a capture may come back blank. Bring the window forward for a complete image. It is never the
251
+ wrong window.
252
+ </Warning>
253
+
254
+ ## Headless
255
+
256
+ **Electron: yes.** `show: false` plus `backgroundThrottling: false` in `webPreferences`. The second one is load-bearing: Chromium runs an unshown window's timers in slow motion, which turns every settle wait into a flake. Screenshots still work, because `capturePage` reads the backing store rather than the screen. Verified with a full tool drive against a window that was never shown.
257
+
258
+ **Tauri: yes. Show, load, then hide.**
259
+
260
+ ```rust
261
+ .on_page_load(reticle_tauri::on_page_load) // hides the window when RETICLE_HEADLESS=1
262
+ ```
263
+
264
+ Run with `RETICLE_HEADLESS=1 pnpm tauri dev`. Nothing ends up on screen, and screenshots keep working because the capture renders the webview rather than the screen.
265
+
266
+ The ordering is the whole trick. Hiding the window during `setup` hides it before the webview has ever been presented, and a webview that has never been presented never loads its page, which is what made headless Tauri look impossible. Hiding it after its first page load leaves everything running. Verified with a full 43-tool drive plus a screenshot and a visual diff against a window that is not on screen.
267
+
268
+ `xvfb-run -a pnpm tauri dev` also works on Linux and needs no app-side change at all.
269
+
270
+ ### A correction worth recording: the Tauri macOS "liveness constraint" was wrong
271
+
272
+ Earlier versions of this document said a Tauri app on macOS is only drivable while its window is on the active Space and unoccluded, and that hiding it suspends the webview. **That is not true, and the mistake is worth recording because it cost three features.**
273
+
274
+ Re-measured against the live app, a loaded Tauri webview answers Reticle commands at full speed while minimized, app-hidden with Cmd-H, fully occluded, on another Space behind a fullscreen app, and with no window on screen at all. A full 43-tool drive passes in every one of those states.
275
+
276
+ What actually failed was narrower: **a webview that has never been presented never loads its page.** Every "suspension" experiment hid or moved the window from `setup`, meaning before the first present, so the page never ran and every command timed out at 8s. The timeouts were real; the diagnosis was not. The `alwaysOnTop` workaround was then built to fix a problem that did not exist, measured as "still broken" for the same reason, and deleted.
277
+
278
+ The lesson generalises past this document: four experiments agreeing does not make a conclusion controlled, if all four share the same confound.
279
+
280
+ ## Routing: use a hash router
281
+
282
+ A packaged renderer runs on `file://`, where `pushState('/settings')` rewrites the URL to `file:///settings`, a path that does not exist, so the next reload lands on a blank page and the app is gone. This is why HashRouter is the standard choice for packaged Electron and Tauri apps. Reticle's route observer handles both, and a `{ kind: 'route', contains: ... }` assertion matches the fragment.
283
+
284
+ ## What IPC looks like to an agent
285
+
286
+ A desktop app reaches its backend over IPC, not HTTP. `fetch`/`XHR` patching cannot see that, so without the IPC observer every backend call in your app is a blind spot: `reticle_network` returns nothing, `act_and_wait` has no in-flight request to settle on, and `assert { net }` is vacuously true. That is a false green by construction.
287
+
288
+ Reticle records each IPC call as an ordinary request, so the tools you already use work unchanged:
289
+
290
+ ```jsonc
291
+ // reticle_network { urlContains: "ipc://" }
292
+ {
293
+ "calls": [
294
+ { "method": "ipc", "url": "ipc://todos:load", "status": 200, "ms": 134 },
295
+ { "method": "ipc", "url": "ipc://todos:archive", "status": 500, "ms": 83 },
296
+ ],
297
+ }
298
+ ```
299
+
300
+ IPC has no status code. `200`/`500` are synthetic, mapped from whether the call succeeded or failed, precisely so that `reticle_network { status: 500 }` and `assert { kind: "net", status: 500 }` keep working. On Tauri you will see `status: 500` next to `statusText: "OK"`. That is not a bug: the transport really did answer 200, and the 500 is the command's own verdict. `ok` is authoritative, and on Electron `error` carries the message your main process returned:
301
+
302
+ ```jsonc
303
+ // reticle_assert { predicate: { kind: "net", urlContains: "ipc://todos:archive", status: 500 } }
304
+ {
305
+ "pass": true,
306
+ "evidence": {
307
+ "url": "ipc://todos:archive",
308
+ "ok": false,
309
+ "status": 500,
310
+ "error": "archive is not implemented in the backend",
311
+ },
312
+ }
313
+ ```
314
+
315
+ Both example apps ship a planted false green: an Archive button that updates the UI optimistically and swallows the rejection. The screen says "archived", a screenshot agrees, a DOM assertion agrees. Only the IPC record disagrees. That is the case desktop support exists for.
316
+
317
+ ### Why a missing preload is not a silent pass
318
+
319
+ Without `@reticlehq/electron/preload`, every IPC call is invisible to Reticle. A tool that just reported clean there would be telling you the IPC layer is fine when it never looked. Instead verdicts carry `coverage: partial` and name the missing line.
320
+
321
+ ## How it compares to Playwright MCP
322
+
323
+ Both attached to the same running Electron app, same task ("archive a todo, then verify it worked"):
324
+
325
+ | tool | ~tokens | ms | verdict |
326
+ | ----------------------- | ------- | ------- | ----------------------------------------- |
327
+ | reticle (lean) | **350** | 1364 | caught the failure |
328
+ | playwright-mcp | 1069 | **980** | blind to it: no network/IPC in its output |
329
+ | playwright-mcp to Tauri | n/a | n/a | cannot attach (no CDP in WKWebView) |
330
+
331
+ Playwright MCP is faster. It is also structurally unable to see an IPC failure, because its channel is the accessibility tree.
332
+
333
+ ## Troubleshooting
334
+
335
+ **`reticle status` shows no session.** Check the app's console. On Electron open devtools, or forward `console-message` to your terminal, since a desktop renderer has no visible console otherwise. A refused connect always logs why.
336
+
337
+ **Tauri: nothing connects and the app console shows a CSP violation.** The `connect-src` above is missing, or does not include your daemon's port. See [Tauri setup](#tauri-setup).
338
+
339
+ **Electron: `module not found: @reticlehq/electron/preload`.** The preload is sandboxed. Bundle it, or set `sandbox: false`. See [Electron setup](#electron-setup).
340
+
341
+ **IPC calls do not appear, but the app works.** On Electron the shim's `require` must run _before_ your preload captures its own reference to `ipcRenderer`, so put it on the first line. On Tauri, `invoke` imported from `@tauri-apps/api/core` is observed; a hand-rolled `postMessage` protocol is not, and neither is Tauri's `postMessage` transport fallback on platforms where the `ipc://` custom protocol is unavailable.
342
+
343
+ **`reticle open` says there is nothing to open.** That is correct for a desktop app. There is no URL, and there is no `reticle drive` for desktop either. Both launch a browser, which is not what you are testing.
344
+
345
+ **A screenshot came back partly blank.** The window is occluded or minimized, so it is only partially composited. Bring it forward and capture again.
346
+
347
+ **`{ ok: false, reason: 'full-page-unsupported' }`.** You asked for `fullPage: true` on a platform that cannot render offscreen. Only Tauri on Linux (WebKitGTK) can. Capture the viewport instead, or scroll and capture in sections.
348
+
349
+ ## FAQ
350
+
351
+ <AccordionGroup>
352
+ <Accordion title="Do I need a browser installed to verify a desktop app?">
353
+ No. Reticle never launches Chromium for a desktop app. Your app connects to the local daemon,
354
+ and the agent drives that connection.
355
+ </Accordion>
356
+ <Accordion title="Does my app have to be visible on screen?">
357
+ No. A loaded window is drivable while minimized, app-hidden, occluded, or on another Space. The
358
+ one requirement is that the window was presented at least once, because a webview that has never
359
+ been presented never loads its page.
360
+ </Accordion>
361
+ <Accordion title="Can Playwright do this instead?">
362
+ For Electron, partly: it attaches over CDP and sees the accessibility tree, but not IPC. For
363
+ Tauri, no: WKWebView exposes no CDP endpoint, so Playwright cannot attach at all.
364
+ </Accordion>
365
+ <Accordion title="Does the SDK end up in my shipped binary?">
366
+ Only if you put it there. Keep the plugin behind a dev-only build, or gate `connect()` on
367
+ `import.meta.env.DEV`. `desktop: true` exists because a packaged renderer is a production build,
368
+ so it opts that one build into instrumentation deliberately.
369
+ </Accordion>
370
+ <Accordion title="Why does a Tauri response show status 500 with statusText OK?">
371
+ The IPC transport really did answer HTTP 200. The 500 is Reticle translating the Rust command's
372
+ own `Err` result so that `status: 500` filters and assertions keep working. `ok` is
373
+ authoritative.
374
+ </Accordion>
375
+ </AccordionGroup>
180
376
 
181
377
  <CardGroup cols={2}>
182
- <Card title="Full desktop guide" icon="book" href="/desktop-apps">
183
- Every capability in detail, what IPC looks like to an agent, and desktop troubleshooting.
378
+ <Card title="Electron package" icon="cube" href="/packages/electron">
379
+ `@reticlehq/electron`: the preload shim and the main-process capture.
184
380
  </Card>
185
- <Card title="Manual install" icon="screwdriver-wrench" href="/install-manual">
186
- The wiring for both runtimes, step by step.
381
+ <Card title="Tauri package" icon="cube" href="/packages/tauri">
382
+ `reticle-tauri`: the Rust crate for capture and headless mode.
187
383
  </Card>
188
384
  </CardGroup>
package/docs/docs.json CHANGED
@@ -32,7 +32,7 @@
32
32
  "navigation": {
33
33
  "versions": [
34
34
  {
35
- "version": "2.8.0",
35
+ "version": "2.9.0",
36
36
  "default": true,
37
37
  "tabs": [
38
38
  {
@@ -161,8 +161,8 @@
161
161
  "tab": "Desktop",
162
162
  "groups": [
163
163
  {
164
- "group": "Desktop apps",
165
- "pages": ["desktop", "desktop-apps"]
164
+ "group": "Electron and Tauri",
165
+ "pages": ["desktop"]
166
166
  }
167
167
  ]
168
168
  },
@@ -192,15 +192,11 @@
192
192
  "groups": [
193
193
  {
194
194
  "group": "Working on Reticle",
195
- "pages": [
196
- "gates",
197
- "gate-plan",
198
- "system-map",
199
- "telemetry-contract",
200
- "telemetry-events",
201
- "fixtures",
202
- "local-registry"
203
- ]
195
+ "pages": ["gates", "gate-plan", "fixtures", "local-registry"]
196
+ },
197
+ {
198
+ "group": "Internals",
199
+ "pages": ["system-map", "telemetry-contract", "telemetry-events"]
204
200
  }
205
201
  ]
206
202
  }
@@ -319,6 +315,11 @@
319
315
  "source": "/README",
320
316
  "destination": "/getting-started",
321
317
  "permanent": true
318
+ },
319
+ {
320
+ "source": "/desktop-apps",
321
+ "destination": "/desktop",
322
+ "permanent": true
322
323
  }
323
324
  ],
324
325
  "contextual": {
@@ -4,6 +4,8 @@ description: 'Premium access and activation, what is gated, the security and dat
4
4
  icon: building
5
5
  ---
6
6
 
7
+ Enterprise features ship inside the open package and are unlocked by a signed license key you set as `RETICLE_LICENSE_KEY`. Activation is verified locally with Ed25519 and makes **no network call**, so nothing about your usage leaves your machine. Run `npx @reticlehq/server license` to see whether you are `active`, `eval`, `missing` or `expired`.
8
+
7
9
  > Premium access (how you get + activate it), what's gated, the security/data-handling posture, and the licensing model. Integration mechanics live in [`platform-integration.md`](./platform-integration.md).
8
10
 
9
11
  ## How premium access works (offline, no phone-home)