@reticlehq/server 2.13.0 → 2.14.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 (451) hide show
  1. package/SKILL.md +8 -18
  2. package/bin/reticle.js +3 -0
  3. package/dist/bridge/auth-failure-reason.js +12 -1
  4. package/dist/bridge/bridge-security.d.ts +8 -0
  5. package/dist/bridge/bridge-security.js +6 -1
  6. package/dist/bridge/bridge.d.ts +3 -0
  7. package/dist/bridge/bridge.js +23 -1
  8. package/dist/bridge/bridge.test-harness.d.ts +10 -1
  9. package/dist/bridge/bridge.test-harness.js +7 -1
  10. package/dist/bridge/pairing-token.d.ts +17 -0
  11. package/dist/bridge/pairing-token.js +26 -0
  12. package/dist/bridge/token-auth.d.ts +7 -0
  13. package/dist/bridge/token-auth.js +7 -1
  14. package/dist/capsule/capsule-store.d.ts +4 -4
  15. package/dist/capsule/capsule.d.ts +1 -1
  16. package/dist/capsule/capsule.js +3 -3
  17. package/dist/capsule/causal-summary.d.ts +21 -1
  18. package/dist/capsule/causal-summary.js +8 -6
  19. package/dist/capsule/divergence.d.ts +1 -1
  20. package/dist/capsule/divergence.js +26 -10
  21. package/dist/chromium-launch-options.d.ts +2 -1
  22. package/dist/cli/adhoc-verdict.d.ts +58 -0
  23. package/dist/cli/adhoc-verdict.js +115 -0
  24. package/dist/cli/chromium-hint.d.ts +18 -4
  25. package/dist/cli/chromium-hint.js +54 -6
  26. package/dist/cli/cli-doctor.js +1 -2
  27. package/dist/cli/cli-flow-commands.d.ts +16 -2
  28. package/dist/cli/cli-flow-commands.js +28 -9
  29. package/dist/cli/cli-parse-feedback.js +1 -1
  30. package/dist/cli/cli-parse.d.ts +2 -1
  31. package/dist/cli/cli-parse.js +38 -0
  32. package/dist/cli/cli-port.d.ts +5 -13
  33. package/dist/cli/cli-port.js +5 -38
  34. package/dist/cli/cli-update-commands.js +4 -4
  35. package/dist/cli/cli-verify.d.ts +24 -7
  36. package/dist/cli/cli-verify.js +87 -13
  37. package/dist/cli/cloud-keystore.d.ts +2 -1
  38. package/dist/cli/cloud-login.d.ts +2 -1
  39. package/dist/cli/cloud-session.d.ts +2 -1
  40. package/dist/cli/cloud-session.js +1 -1
  41. package/dist/cli/daemon-start-options.d.ts +2 -1
  42. package/dist/cli/device-flow.d.ts +2 -2
  43. package/dist/cli/doctor-daemon-line.d.ts +2 -1
  44. package/dist/cli/doctor-project-line.d.ts +2 -1
  45. package/dist/cli/doctor-rows.d.ts +2 -1
  46. package/dist/cli/drive-attach.d.ts +4 -3
  47. package/dist/cli/gate-hook-message.d.ts +2 -1
  48. package/dist/cli/status-next-action.js +10 -11
  49. package/dist/cli.d.ts +1 -0
  50. package/dist/cli.js +21 -9
  51. package/dist/cloud/account-state.d.ts +20 -0
  52. package/dist/cloud/account-state.js +65 -0
  53. package/dist/cloud/cloud-sync.d.ts +46 -3
  54. package/dist/cloud/cloud-sync.js +116 -0
  55. package/dist/cloud/sync-cycle.d.ts +5 -4
  56. package/dist/cloud/sync-cycle.js +1 -1
  57. package/dist/cloud/sync-daemon.d.ts +3 -19
  58. package/dist/cloud/sync-daemon.js +2 -2
  59. package/dist/crawl/crawl-tools.js +1 -1
  60. package/dist/crawl/crawl.d.ts +5 -5
  61. package/dist/crawl/crawl.js +138 -4
  62. package/dist/daemon/daemon-resilience.d.ts +3 -2
  63. package/dist/daemon/daemon-resilience.js +43 -4
  64. package/dist/daemon/daemon-resolve.d.ts +0 -9
  65. package/dist/daemon/daemon-resolve.js +2 -2
  66. package/dist/daemon/dev-servers.d.ts +1 -1
  67. package/dist/daemon/dev-servers.js +1 -1
  68. package/dist/daemon/loopback-alias.d.ts +2 -1
  69. package/dist/daemon/startup-failure.d.ts +11 -0
  70. package/dist/daemon/startup-failure.js +46 -0
  71. package/dist/events/contradictions.d.ts +10 -16
  72. package/dist/events/contradictions.js +149 -17
  73. package/dist/events/declared.d.ts +13 -1
  74. package/dist/events/declared.js +59 -3
  75. package/dist/events/echo-mismatch.js +75 -6
  76. package/dist/events/lineage.d.ts +52 -0
  77. package/dist/events/lineage.js +122 -0
  78. package/dist/events/net-evidence.d.ts +21 -0
  79. package/dist/events/net-evidence.js +81 -0
  80. package/dist/events/predicate-console.d.ts +13 -0
  81. package/dist/events/predicate-console.js +138 -0
  82. package/dist/events/predicate-element.d.ts +13 -0
  83. package/dist/events/predicate-element.js +214 -0
  84. package/dist/events/predicate-eval.d.ts +15 -3
  85. package/dist/events/predicate-eval.js +128 -110
  86. package/dist/events/predicate-parse.js +34 -1
  87. package/dist/events/predicate-request-body.d.ts +50 -0
  88. package/dist/events/predicate-request-body.js +120 -0
  89. package/dist/events/predicate-route.d.ts +21 -1
  90. package/dist/events/predicate-route.js +149 -21
  91. package/dist/events/predicate-schema.d.ts +8 -1
  92. package/dist/events/predicate-schema.js +34 -0
  93. package/dist/events/predicate.d.ts +2 -0
  94. package/dist/events/predicate.js +52 -159
  95. package/dist/events/split-text-miss.d.ts +6 -4
  96. package/dist/events/split-text-miss.js +12 -5
  97. package/dist/flows/affected-tools.js +22 -9
  98. package/dist/flows/annotate.d.ts +2 -1
  99. package/dist/flows/annotate.js +19 -1
  100. package/dist/flows/coverage.d.ts +2 -2
  101. package/dist/flows/flake.d.ts +3 -3
  102. package/dist/flows/flow-expect-grammar.d.ts +33 -0
  103. package/dist/flows/flow-expect-grammar.js +155 -0
  104. package/dist/flows/flow-replay-run.d.ts +1 -1
  105. package/dist/flows/flow-replay-run.js +28 -15
  106. package/dist/flows/flow-replay.d.ts +10 -0
  107. package/dist/flows/flow-replay.js +57 -22
  108. package/dist/flows/flow-secret-field.d.ts +14 -0
  109. package/dist/flows/flow-secret-field.js +22 -0
  110. package/dist/flows/flow-step-runners.d.ts +1 -0
  111. package/dist/flows/flow-step-runners.js +91 -34
  112. package/dist/flows/flow-success.js +22 -0
  113. package/dist/flows/flow-tools.js +27 -8
  114. package/dist/flows/flow-upload-resolve.d.ts +23 -0
  115. package/dist/flows/flow-upload-resolve.js +46 -0
  116. package/dist/flows/flows.d.ts +15 -0
  117. package/dist/flows/flows.js +17 -14
  118. package/dist/flows/git-changed.d.ts +23 -4
  119. package/dist/flows/git-changed.js +32 -6
  120. package/dist/flows/heal-run.js +2 -2
  121. package/dist/flows/predicate-to-expect.d.ts +3 -2
  122. package/dist/flows/predicate-to-expect.js +11 -5
  123. package/dist/flows/recording-backtrack.d.ts +24 -0
  124. package/dist/flows/recording-backtrack.js +73 -0
  125. package/dist/flows/recordings.d.ts +6 -0
  126. package/dist/flows/replay-halt.d.ts +26 -0
  127. package/dist/flows/replay-halt.js +30 -0
  128. package/dist/flows/replay.d.ts +0 -8
  129. package/dist/flows/replay.js +15 -3
  130. package/dist/flows/suite-flakes.d.ts +2 -1
  131. package/dist/flows/verify-change-tools.js +16 -4
  132. package/dist/honesty/already-true.d.ts +14 -0
  133. package/dist/honesty/already-true.js +47 -4
  134. package/dist/honesty/blind-spots.d.ts +3 -1
  135. package/dist/honesty/blind-spots.js +24 -1
  136. package/dist/honesty/body-capture-remedy.d.ts +42 -0
  137. package/dist/honesty/body-capture-remedy.js +95 -0
  138. package/dist/honesty/feature-capture.d.ts +3 -2
  139. package/dist/honesty/feature-capture.js +1 -1
  140. package/dist/honesty/gap-ledger.d.ts +1 -1
  141. package/dist/honesty/gap-ledger.js +1 -1
  142. package/dist/honesty/instrumentation-gaps.d.ts +8 -1
  143. package/dist/honesty/instrumentation-gaps.js +12 -2
  144. package/dist/honesty/observability.d.ts +4 -3
  145. package/dist/honesty/tool-hit-rate.d.ts +3 -2
  146. package/dist/honesty/uncaptured-bodies.d.ts +3 -1
  147. package/dist/honesty/uncaptured-bodies.js +6 -2
  148. package/dist/honesty/unsettled.d.ts +9 -0
  149. package/dist/honesty/unsettled.js +45 -0
  150. package/dist/honesty/verified.d.ts +32 -1
  151. package/dist/honesty/verified.js +37 -10
  152. package/dist/impact/impact-store.d.ts +5 -14
  153. package/dist/impact/impact-store.js +49 -6
  154. package/dist/index.js +1 -1
  155. package/dist/input/network-detail.d.ts +26 -1
  156. package/dist/input/network-detail.js +44 -12
  157. package/dist/input/network-mock-tools.js +24 -17
  158. package/dist/input/real-input.js +1 -1
  159. package/dist/input/viewport-tools.js +25 -13
  160. package/dist/intent/inline-intent.d.ts +0 -10
  161. package/dist/intent/inline-intent.js +1 -1
  162. package/dist/intent/intent-shard-store.d.ts +3 -2
  163. package/dist/intent/intent-shard-store.js +1 -1
  164. package/dist/intent/intent-shard.d.ts +14 -14
  165. package/dist/intent/intent-shard.js +4 -4
  166. package/dist/intent/intent-store.d.ts +1 -1
  167. package/dist/intent/intent-store.js +1 -1
  168. package/dist/intent/intent-subject.d.ts +2 -1
  169. package/dist/intent/open-intents.d.ts +3 -2
  170. package/dist/license/license.d.ts +4 -4
  171. package/dist/license/license.js +1 -1
  172. package/dist/mcp/attach-memory.d.ts +2 -1
  173. package/dist/mcp/client-identity.d.ts +2 -1
  174. package/dist/mcp/mcp-outage.d.ts +1 -1
  175. package/dist/mcp/mcp-outage.js +1 -1
  176. package/dist/mcp/mcp-proxy.d.ts +3 -1
  177. package/dist/mcp/mcp-proxy.js +32 -7
  178. package/dist/mcp/mcp.js +3 -1
  179. package/dist/mcp/proxy-handshake.d.ts +2 -1
  180. package/dist/mcp/proxy-idle-exit.d.ts +45 -0
  181. package/dist/mcp/proxy-idle-exit.js +94 -0
  182. package/dist/mcp/server-instructions.d.ts +2 -1
  183. package/dist/memory/project-memory.d.ts +2 -3
  184. package/dist/memory/project-memory.js +1 -1
  185. package/dist/oracles/propose-consequences.js +5 -5
  186. package/dist/oracles/self-instrument.d.ts +2 -2
  187. package/dist/oracles/self-instrument.js +1 -1
  188. package/dist/platform.d.ts +3 -5
  189. package/dist/platform.js +3 -5
  190. package/dist/pool/browser-pool.d.ts +92 -0
  191. package/dist/pool/browser-pool.js +119 -5
  192. package/dist/pool/playwright-launcher.js +29 -2
  193. package/dist/pool/storage-seed.d.ts +23 -0
  194. package/dist/pool/storage-seed.js +198 -0
  195. package/dist/project/artifact-root.d.ts +2 -1
  196. package/dist/project/memory-fs.d.ts +2 -1
  197. package/dist/project/reticle-dir.js +1 -1
  198. package/dist/project/session-root.d.ts +8 -0
  199. package/dist/project/session-root.js +9 -2
  200. package/dist/runs/reticle-runner.d.ts +14 -1
  201. package/dist/runs/reticle-runner.js +39 -2
  202. package/dist/session/attachment-history.d.ts +2 -1
  203. package/dist/session/fake-session.d.ts +37 -0
  204. package/dist/session/fake-session.js +81 -0
  205. package/dist/session/lease-visibility.d.ts +2 -1
  206. package/dist/session/live-control-tools.js +6 -0
  207. package/dist/session/no-session-diagnosis.d.ts +17 -1
  208. package/dist/session/no-session-diagnosis.js +32 -6
  209. package/dist/session/no-session-next-action.d.ts +14 -0
  210. package/dist/session/no-session-next-action.js +18 -0
  211. package/dist/session/no-session-watch.js +46 -3
  212. package/dist/session/registered-projects.d.ts +54 -0
  213. package/dist/session/registered-projects.js +73 -0
  214. package/dist/session/review-store.d.ts +2 -1
  215. package/dist/session/session-health.d.ts +62 -1
  216. package/dist/session/session-health.js +82 -2
  217. package/dist/session/session-manager.d.ts +11 -1
  218. package/dist/session/session-manager.js +18 -3
  219. package/dist/session/session-replaced.d.ts +24 -0
  220. package/dist/session/session-replaced.js +29 -0
  221. package/dist/session/session-successor.js +20 -4
  222. package/dist/session/session.d.ts +13 -5
  223. package/dist/session/session.js +31 -23
  224. package/dist/setup/agent-configs.d.ts +3 -2
  225. package/dist/setup/agent-writer.d.ts +3 -2
  226. package/dist/setup/approval-migration.d.ts +2 -1
  227. package/dist/setup/approval-migration.js +1 -1
  228. package/dist/setup/auto-approve.d.ts +11 -19
  229. package/dist/setup/auto-approve.js +15 -12
  230. package/dist/{init → setup}/confirm.js +1 -1
  231. package/dist/setup/desktop-shape.d.ts +3 -2
  232. package/dist/setup/dev-server-wait.d.ts +8 -0
  233. package/dist/setup/dev-server-wait.js +3 -1
  234. package/dist/setup/drive-agent.d.ts +2 -3
  235. package/dist/setup/drive-agent.js +1 -1
  236. package/dist/setup/drive-plan.d.ts +3 -2
  237. package/dist/setup/ensure-daemon.d.ts +2 -1
  238. package/dist/setup/existing-app.d.ts +12 -0
  239. package/dist/setup/existing-app.js +13 -0
  240. package/dist/setup/init-host.d.ts +11 -0
  241. package/dist/setup/init-host.js +26 -0
  242. package/dist/setup/init-runtime.d.ts +4 -10
  243. package/dist/setup/init-runtime.js +23 -16
  244. package/dist/setup/license-key.d.ts +2 -1
  245. package/dist/setup/listeners.d.ts +2 -1
  246. package/dist/setup/loopback-probe-urls.d.ts +18 -0
  247. package/dist/setup/loopback-probe-urls.js +52 -0
  248. package/dist/setup/node-effects.d.ts +3 -0
  249. package/dist/setup/node-effects.js +26 -11
  250. package/dist/setup/page-probe.d.ts +5 -0
  251. package/dist/setup/relaunch.d.ts +2 -1
  252. package/dist/setup/run-setup.d.ts +5 -1
  253. package/dist/setup/run-setup.js +155 -48
  254. package/dist/setup/setup-command.d.ts +3 -2
  255. package/dist/setup/setup-command.js +8 -0
  256. package/dist/setup/setup-options.d.ts +5 -3
  257. package/dist/setup/setup-options.js +3 -2
  258. package/dist/setup/wait-progress.d.ts +28 -0
  259. package/dist/setup/wait-progress.js +43 -0
  260. package/dist/telemetry/app-instrumented.d.ts +2 -1
  261. package/dist/telemetry/app-instrumented.js +1 -1
  262. package/dist/telemetry/automation-hint.d.ts +1 -1
  263. package/dist/telemetry/automation-hint.js +1 -1
  264. package/dist/telemetry/cli-telemetry.js +1 -1
  265. package/dist/telemetry/connect-failure.d.ts +1 -1
  266. package/dist/telemetry/connect-failure.js +1 -1
  267. package/dist/telemetry/crash-cause.d.ts +3 -2
  268. package/dist/telemetry/crash-cause.js +1 -1
  269. package/dist/telemetry/daemon-telemetry.d.ts +3 -2
  270. package/dist/telemetry/daemon-telemetry.js +1 -1
  271. package/dist/telemetry/error-class.d.ts +3 -2
  272. package/dist/telemetry/error-class.js +1 -1
  273. package/dist/telemetry/feedback-cli.js +1 -1
  274. package/dist/telemetry/feedback-context.d.ts +3 -2
  275. package/dist/telemetry/feedback-context.js +5 -4
  276. package/dist/telemetry/feedback-local.d.ts +3 -2
  277. package/dist/telemetry/feedback.d.ts +4 -3
  278. package/dist/telemetry/feedback.js +1 -1
  279. package/dist/telemetry/git-facts.d.ts +2 -2
  280. package/dist/telemetry/git-facts.js +1 -1
  281. package/dist/telemetry/identify.d.ts +1 -1
  282. package/dist/telemetry/identify.js +1 -1
  283. package/dist/telemetry/init-telemetry.d.ts +2 -14
  284. package/dist/telemetry/init-telemetry.js +4 -13
  285. package/dist/telemetry/install-source.d.ts +7 -13
  286. package/dist/telemetry/install-source.js +7 -29
  287. package/dist/telemetry/license-activation.d.ts +3 -2
  288. package/dist/telemetry/license-activation.js +1 -1
  289. package/dist/telemetry/machine-snapshot.d.ts +1 -1
  290. package/dist/telemetry/mcp-connection.js +1 -1
  291. package/dist/telemetry/project-profile.d.ts +0 -14
  292. package/dist/telemetry/project-profile.js +1 -1
  293. package/dist/telemetry/proxy-telemetry.js +1 -1
  294. package/dist/telemetry/session-metrics.d.ts +1 -1
  295. package/dist/telemetry/session-metrics.js +1 -1
  296. package/dist/telemetry/telemetry.d.ts +1 -17
  297. package/dist/telemetry/telemetry.js +4 -4
  298. package/dist/telemetry/tool-refused.d.ts +1 -1
  299. package/dist/telemetry/tool-refused.js +1 -1
  300. package/dist/tools/act-observation.d.ts +3 -2
  301. package/dist/tools/act-preflight.js +8 -3
  302. package/dist/tools/act-target.d.ts +4 -0
  303. package/dist/tools/act-target.js +14 -5
  304. package/dist/tools/act-tools.d.ts +0 -2
  305. package/dist/tools/act-tools.js +45 -15
  306. package/dist/tools/assert-source.d.ts +30 -0
  307. package/dist/tools/assert-source.js +21 -0
  308. package/dist/tools/assert-verdict.d.ts +1 -1
  309. package/dist/tools/assert-verdict.js +14 -4
  310. package/dist/tools/browser-tools.js +28 -8
  311. package/dist/tools/complete-snapshot.d.ts +3 -2
  312. package/dist/tools/dynamic-tools.js +8 -0
  313. package/dist/tools/error-recovery.d.ts +10 -0
  314. package/dist/tools/error-recovery.js +23 -0
  315. package/dist/tools/feedback-tools.js +1 -1
  316. package/dist/tools/invoke-tool.js +2 -0
  317. package/dist/tools/lease-tools.d.ts +48 -20
  318. package/dist/tools/lease-tools.js +311 -76
  319. package/dist/tools/lineage-tools.d.ts +14 -0
  320. package/dist/tools/lineage-tools.js +64 -0
  321. package/dist/tools/merge-tools.js +1 -3
  322. package/dist/tools/navigate-arrival.d.ts +45 -1
  323. package/dist/tools/navigate-arrival.js +39 -6
  324. package/dist/tools/navigate-result.d.ts +8 -1
  325. package/dist/tools/navigate-result.js +14 -4
  326. package/dist/tools/numeric-bounds.d.ts +0 -11
  327. package/dist/tools/numeric-bounds.js +4 -4
  328. package/dist/tools/observe-tools.js +22 -26
  329. package/dist/tools/observed-nothing.d.ts +9 -0
  330. package/dist/tools/observed-nothing.js +2 -1
  331. package/dist/tools/read-tools.js +12 -17
  332. package/dist/tools/real-input-attempt.d.ts +14 -6
  333. package/dist/tools/real-input-attempt.js +75 -18
  334. package/dist/tools/reconcile-tools.js +2 -1
  335. package/dist/tools/reload-result.d.ts +6 -1
  336. package/dist/tools/reload-result.js +7 -2
  337. package/dist/tools/resolve-target.d.ts +7 -1
  338. package/dist/tools/resolve-target.js +72 -9
  339. package/dist/tools/settle-in-flight.d.ts +1 -1
  340. package/dist/tools/settle-in-flight.js +9 -2
  341. package/dist/tools/snapshot-delta.d.ts +24 -1
  342. package/dist/tools/snapshot-delta.js +66 -7
  343. package/dist/tools/tool-names.d.ts +1 -0
  344. package/dist/tools/tool-names.js +1 -0
  345. package/dist/tools/tool-surface.js +20 -2
  346. package/dist/tools/tools.js +120 -11
  347. package/dist/tools/verify-next-baton.d.ts +2 -1
  348. package/dist/update/sdk-sync.d.ts +1 -1
  349. package/dist/update/sdk-sync.js +1 -1
  350. package/dist/update/updater.js +1 -1
  351. package/dist/version/sdk-fix.d.ts +2 -1
  352. package/dist/version/version-skew.d.ts +0 -8
  353. package/dist/version/version-skew.js +1 -1
  354. package/docs/README.md +8 -6
  355. package/docs/actions.mdx +1 -1
  356. package/docs/agent-cheatsheet.md +4 -2
  357. package/docs/architecture.md +1 -1
  358. package/docs/cli/mcp.mdx +3 -1
  359. package/docs/cli/watch.mdx +1 -1
  360. package/docs/cli.mdx +1 -1
  361. package/docs/desktop.mdx +1 -1
  362. package/docs/docs.json +8 -3
  363. package/docs/faq.mdx +9 -0
  364. package/docs/first-drive.md +136 -0
  365. package/docs/frameworks.mdx +29 -7
  366. package/docs/gate-plan.md +2 -2
  367. package/docs/gates.md +19 -11
  368. package/docs/getting-started.md +7 -1
  369. package/docs/http-transport.md +164 -0
  370. package/docs/index.mdx +5 -3
  371. package/docs/install-manual.mdx +1 -1
  372. package/docs/packages/tauri.mdx +1 -1
  373. package/docs/packages.mdx +15 -3
  374. package/docs/platform-integration.md +1 -1
  375. package/docs/predicates.mdx +2 -0
  376. package/docs/system-map.md +2 -2
  377. package/docs/telemetry-contract.md +4 -4
  378. package/docs/telemetry-events.mdx +1 -1
  379. package/docs/telemetry.md +3 -3
  380. package/docs/tools-navigate.mdx +14 -6
  381. package/docs/usage.md +4 -4
  382. package/package.json +7 -4
  383. package/dist/init/agent-rules.d.ts +0 -116
  384. package/dist/init/agent-rules.js +0 -279
  385. package/dist/init/app-choice.d.ts +0 -20
  386. package/dist/init/app-choice.js +0 -25
  387. package/dist/init/astro-host.d.ts +0 -21
  388. package/dist/init/astro-host.js +0 -27
  389. package/dist/init/astro-patch.d.ts +0 -33
  390. package/dist/init/astro-patch.js +0 -300
  391. package/dist/init/capabilities.d.ts +0 -40
  392. package/dist/init/capabilities.js +0 -150
  393. package/dist/init/closing-hint.d.ts +0 -36
  394. package/dist/init/closing-hint.js +0 -120
  395. package/dist/init/connect-steps.d.ts +0 -2
  396. package/dist/init/connect-steps.js +0 -50
  397. package/dist/init/cra.d.ts +0 -79
  398. package/dist/init/cra.js +0 -178
  399. package/dist/init/csp-check.d.ts +0 -38
  400. package/dist/init/csp-check.js +0 -107
  401. package/dist/init/csp-doctor.d.ts +0 -32
  402. package/dist/init/csp-doctor.js +0 -54
  403. package/dist/init/desktop-doctor.d.ts +0 -41
  404. package/dist/init/desktop-doctor.js +0 -198
  405. package/dist/init/detect.d.ts +0 -96
  406. package/dist/init/detect.js +0 -209
  407. package/dist/init/dev-script.d.ts +0 -50
  408. package/dist/init/dev-script.js +0 -66
  409. package/dist/init/format-generated.d.ts +0 -18
  410. package/dist/init/format-generated.js +0 -39
  411. package/dist/init/install-hint.d.ts +0 -9
  412. package/dist/init/install-hint.js +0 -29
  413. package/dist/init/mcp-clients.d.ts +0 -89
  414. package/dist/init/mcp-clients.js +0 -299
  415. package/dist/init/mcp-registered.d.ts +0 -12
  416. package/dist/init/mcp-registered.js +0 -14
  417. package/dist/init/mcp.d.ts +0 -89
  418. package/dist/init/mcp.js +0 -129
  419. package/dist/init/next-patch.d.ts +0 -39
  420. package/dist/init/next-patch.js +0 -196
  421. package/dist/init/node-io.d.ts +0 -7
  422. package/dist/init/node-io.js +0 -117
  423. package/dist/init/non-js-project.d.ts +0 -27
  424. package/dist/init/non-js-project.js +0 -84
  425. package/dist/init/patch-kind.d.ts +0 -20
  426. package/dist/init/patch-kind.js +0 -10
  427. package/dist/init/plan-framework.d.ts +0 -64
  428. package/dist/init/plan-framework.js +0 -565
  429. package/dist/init/plan.d.ts +0 -242
  430. package/dist/init/plan.js +0 -703
  431. package/dist/init/preflight.d.ts +0 -28
  432. package/dist/init/preflight.js +0 -38
  433. package/dist/init/project-id.d.ts +0 -12
  434. package/dist/init/project-id.js +0 -25
  435. package/dist/init/refresh-rules.d.ts +0 -39
  436. package/dist/init/refresh-rules.js +0 -51
  437. package/dist/init/run.d.ts +0 -117
  438. package/dist/init/run.js +0 -806
  439. package/dist/init/slash-command.d.ts +0 -27
  440. package/dist/init/slash-command.js +0 -132
  441. package/dist/init/snippets.d.ts +0 -134
  442. package/dist/init/snippets.js +0 -572
  443. package/dist/init/vite-config.d.ts +0 -18
  444. package/dist/init/vite-config.js +0 -114
  445. package/dist/init/windows-quote.d.ts +0 -38
  446. package/dist/init/windows-quote.js +0 -70
  447. package/dist/init/workspace-apps.d.ts +0 -30
  448. package/dist/init/workspace-apps.js +0 -178
  449. package/dist/project/remember-project.d.ts +0 -24
  450. package/dist/project/remember-project.js +0 -40
  451. /package/dist/{init → setup}/confirm.d.ts +0 -0
@@ -1,279 +0,0 @@
1
- /**
2
- * `reticle init` writes a behavioral rule into the coding agent's instruction file so the agent
3
- * VERIFIES a feature with Reticle after building it — not only when the user remembers to say "test
4
- * it with reticle". Registering the MCP server (mcp.ts / mcp-clients.ts) only makes the tools AVAILABLE;
5
- * this is the piece that makes the agent reach for them, every session, unprompted.
6
- *
7
- * It carries a SECOND standing instruction, and that one is not about this project at all: send
8
- * feedback to the Reticle maintainers, from the moment instrumentation starts. The agent is the party
9
- * that experiences Reticle, and the only one who can say what it cost — and by the time anyone would
10
- * think to ask, the context that knew is gone. Written into the same block, because the moment the
11
- * rule lands (init, before any framework wiring) is the moment the setup itself is being lived
12
- * through, which is when the reports we hear least about are actually generated.
13
- *
14
- * The rule is framed as a definition-of-done (WHEN to verify, HOW, and the anti-reward-hacking guard),
15
- * written into whichever instruction file the detected agent reads: `CLAUDE.md` (Claude Code),
16
- * `.cursor/rules/reticle.mdc` (Cursor, `alwaysApply` so it stays in context), or `AGENTS.md` as the
17
- * cross-agent fallback. Idempotent via a marker block — safe to append to an existing file and a
18
- * re-run is a no-op. Mirrors the apply/already result shape used across init (see mcp-clients.ts).
19
- */
20
- import { NPX } from './mcp.js';
21
- import { RETICLE_NPM_PACKAGE } from '../version/server-version.js';
22
- /** Project-root instruction files the agent re-reads every session. */
23
- export const CLAUDE_MD_PATH = 'CLAUDE.md';
24
- export const AGENTS_MD_PATH = 'AGENTS.md';
25
- /**
26
- * The full rules, written once and pointed at from every always-loaded file.
27
- *
28
- * Two problems it solves at the same time. The rule text is dense and most of it is REFERENCE (what
29
- * to do when the tools are missing, what a `version_skew` field means, how to file feedback), which
30
- * an agent needs on the turn it hits that situation and never before — so carrying all of it in
31
- * `CLAUDE.md` taxed every session for text almost every session did not read. And `AGENTS.md` was
32
- * only written when NO agent was detected, so a repo set up on a Claude Code machine told Codex,
33
- * Copilot, Amp and every other agent nothing at all.
34
- *
35
- * So: the operative rules (when to verify, WHEN NOT TO, how, and the honesty guards) go in the files
36
- * that load every turn, and this file holds the rest, one hop away and named in that block.
37
- */
38
- export const RETICLE_MD_PATH = 'RETICLE.md';
39
- /** Cursor project rule; the frontmatter `alwaysApply` keeps it in context on every turn. */
40
- export const CURSOR_RULE_PATH = '.cursor/rules/reticle.mdc';
41
- /** Markers delimiting the managed block so a re-run is idempotent and the block stays updatable. */
42
- const RULE_BEGIN = '<!-- reticle:begin (managed by `reticle init` — edit outside these markers) -->';
43
- const RULE_END = '<!-- reticle:end -->';
44
- /**
45
- * Does this file already carry the managed block?
46
- *
47
- * Exported so callers cannot invent their own looser test. The begin marker carries explanatory
48
- * text inside the comment, so a substring check for `reticle:begin` matches files that
49
- * `mergeMarkedInstruction` would treat as having NO block — and the two disagreeing means a refresh
50
- * silently appends a second copy instead of updating the first.
51
- */
52
- export function hasManagedBlock(text) {
53
- return text.includes(RULE_BEGIN);
54
- }
55
- /**
56
- * How the agent must INVOKE the CLI.
57
- *
58
- * `reticle init` installs the SDK packages, never the server — so there is no `reticle` on the
59
- * agent's PATH, and every bare `reticle <cmd>` this rule named was an instruction that could not be
60
- * followed. Reported from a field sweep: three of them, in the file the agent re-reads every session.
61
- *
62
- * `npx @reticlehq/server` is the same invocation the MCP registration uses, and it is derived from
63
- * the package's own name so the two can never drift apart.
64
- */
65
- export const CLI = `${NPX} ${RETICLE_NPM_PACKAGE}`;
66
- /**
67
- * Who starts the dev server, stated once and rendered everywhere it is needed.
68
- *
69
- * The old rule was "Reticle never starts the dev server for you — that's your job", and agents obeyed
70
- * it exactly: they read it, declined to start anything, and ended the turn with nothing verified. An
71
- * instruction that reliably produces no verification is a defect in the instruction.
72
- *
73
- * The AGENT starts it, not the daemon. A daemon that spawns a build process is invisible to the
74
- * person whose machine it is running on, was never consented to, and orphans when the daemon exits.
75
- * The agent already has shell access in this repo, already runs install and build commands, and runs
76
- * inside a host that asks the human for permission — so a dev server it starts is visible in the
77
- * transcript, attributable, and stoppable.
78
- *
79
- * The guards are the whole reason this is safe, so no renderer may drop them: one server at a time,
80
- * read the command rather than invent one, never kill anything you did not start, and leave the
81
- * permission prompt to the host. "Background it and say so" is no longer among them because the
82
- * branch above now states it at the point of action, and this text is read every turn — a rule
83
- * stated twice costs every agent tokens forever and is the first thing to drift.
84
- *
85
- * The RESTART branch outranks the rest and is stated first. It used to be an aside, while "if a dev
86
- * server is already listening, use it" was a numbered guard — so an agent resolving the two
87
- * reasonably reused a server started before `init` edited the build config, served a bundle with no
88
- * SDK in it, and landed on an empty session list with every other step done correctly.
89
- *
90
- * Exported because slash-command.ts renders the same rule; there must not be two versions of it.
91
- */
92
- export const DEV_SERVER_POLICY = `**A dev server already running when \`reticle init\` ran does not have Reticle in its bundle.** It read the build config at boot; \`init\` edited it afterwards. It serves the old bundle and no session appears. In order:
93
-
94
- 1. **A dev server was already running?** Restart it, then hard-reload the tab. "Something is listening" does not mean the right bundle is served.
95
- 2. **Nothing was running?** Start it in the BACKGROUND and say so in one line. \`reticle_sessions\` gives you this project's own dev command in \`next_action\`; use that, never compose one. Started after \`init\`, it needs no restart.
96
-
97
- Stopping to ask is how a verification turn ends with nothing verified.
98
-
99
- Four guards, none optional:
100
-
101
- 1. **Never run two at once.** One dev server on the app's port. Restarting a stale one means stopping it first, not starting a second alongside it.
102
- 2. **Never guess the command.** It comes from \`package.json\` scripts. No recognisable dev script means say so and stop, not invent one.
103
- 3. **Never kill anything you did not start**, and never a daemon or a port holder. The one exception is the restart above, and say in one line that you did it.
104
- 4. **The permission prompt belongs to your host.** Never bypass, suppress or auto-approve it, and take a refusal as the answer.`;
105
- /**
106
- * The operative rules, carried by every file that loads on every turn.
107
- *
108
- * Short on purpose. This is the text that has to CHANGE BEHAVIOUR, so it states when to verify, when
109
- * NOT to, how, and the guards against calling something proven when it is not. Everything an agent
110
- * needs only at the moment it hits a specific situation lives in RETICLE.md, named at the end.
111
- */
112
- export const RULE_BODY = `## Verifying with Reticle
113
-
114
- This app is instrumented by **Reticle**, an in-app verification layer exposed as \`reticle_*\` MCP tools and the \`${CLI}\` CLI (always through npx: Reticle's server is not installed into this project). Verifying is part of "done", not an optional extra.
115
-
116
- **Verify when you have changed something a user can see or do.** A component, a form, a route, a request, a piece of state that reaches the screen. Do it BEFORE telling the user it is complete. Reading the diff proves nothing and unit tests do not run the app.
117
-
118
- **Do not reach for Reticle when the change cannot show up in the running app.** It costs tool calls and the user's patience, and a verdict over an unrelated flow proves nothing about what you changed. Skip it for: documentation, comments, tests, build config, CI, dependency bumps with no user-facing effect, backend or CLI work with no UI surface, and any change to a project that is not a running web app. Say in one line that you skipped verification and why, rather than silently not doing it.
119
-
120
- **How to verify:**
121
-
122
- - Drive the flow with \`reticle_act_and_wait({ ref, action, until })\`. It names the consequence you expect BEFORE the action, which is the difference between a check and a rationalisation.
123
- - Batch a multi-step journey (a login, a form) into one \`reticle_act_sequence\` rather than one round trip per field.
124
- - Read the surrounding evidence with \`reticle_snapshot\`, \`reticle_state\`, \`reticle_network\`, \`reticle_console\`.
125
- - **Only \`reticle_act_and_wait\` and \`reticle_assert\` produce a verdict.** \`reticle_act\` and everything else move or read the app and prove nothing, so a session ending without one of those two has no result however many tools it used.
126
- - Covered flows: \`${CLI} gate\` reports which recorded flows the changed files affect and whether they still pass.
127
-
128
- **Setting Reticle up, or just restarted? You are mid-sequence — do not stop until a verdict exists.**
129
- The whole of it is: instrument the app → get a dev server running → open the app in a browser →
130
- drive one flow → report the verdict. Every step is yours to do, and none of them needs the user.
131
- The ONE legitimate pause is a client restart, because a client reads its server list at startup;
132
- when you come back, you are not finished, you are on the next step — resume it without being asked.
133
- Stopping anywhere else leaves an app that looks installed and can verify nothing, which is the
134
- single commonest way this goes wrong. \`/reticle\` carries the full recovery ladder when a step
135
- does not work; use it rather than guessing, and never report the install as finished without a
136
- verdict to point at.
137
-
138
- **Nothing connected? Get the app running.**
139
-
140
- ${DEV_SERVER_POLICY}
141
-
142
- A dev server that is already running does not pick up an edited build config or a newly created plugin file — restart it and hard-reload the tab. And if a server IS listening and still nothing connects, the cause is the SDK not loading in the page, not a missing dev server; do not tell the user to start one they are already running.
143
-
144
- **Finish \`src/reticle-dev.ts\` before you claim setup is done.** \`init\` writes it and cannot always fill it in: a store that needs an argument only reading the code supplies (Jotai atoms, an XState actor, a TanStack \`queryClient\`) is left as a commented \`registerStore\` line. A file that registers nothing looks exactly like a finished one, and \`reticle_state\` then returns empty forever — which is indistinguishable from an app that has nothing to report, so it reads as success. Uncomment the line, complete it, and prove it by driving one flow and seeing your keys come back. If \`init\` told you to restart your client, this is the job waiting for you on the other side of that restart.
145
-
146
- **Verify each feature as you finish it, not all of them at the end.** Asked for four, build one, drive it, get a verdict, then start the second. A red verdict after four builds has four suspects; after one it has none.
147
-
148
- **Capture what a change is FOR while you are building it, not afterwards.** \`reticle_intent\` records the business outcome a change is meant to produce, and the only moment anybody knows it is while the change is being made. Pass \`intent\` when you save a flow, so the saved flow carries the reason it exists. A flow without one replays for months and then reports "step 3 failed" instead of what stopped being true for a user.
149
-
150
- **Honesty, which is the whole point:**
151
-
152
- - **\`verified: "unknown"\` is not a pass.** It means Reticle drove the app and could not tell what happened; \`verifiedReason\` says which clause decided that. Report it as unknown, never as working.
153
- - **\`verified: "no-fault"\` is not a pass either.** It means nothing was DECLARED to prove: the page settled and no channel complained, but you asserted nothing, so there is no verification. You get it whenever \`until\` is omitted. Name a consequence the action changes — a signal, a request, a route, or store state — and call again.
154
- - **Never weaken a check to make it green.** Downgrading, skipping or deleting an assertion is a finding, not a fix.
155
- - **If Reticle cannot run** (no daemon, or this is not a running web app), say so. Do not skip verification silently.
156
- - **Setup is not finished until one real flow has been driven and produced a verdict.** \`init\` exiting 0, the tools appearing, and a session being listed are all things that happen before anything has been verified.
157
-
158
- **The \`/reticle\` skill runs this whole loop for you** — detect, connect, drive one flow, report. If your client does not have it, install it once: \`/plugin marketplace add reticlehq/reticle\` then \`/plugin install reticle@reticlehq\` in Claude Code, or \`npx skills add reticlehq/reticle\` anywhere the skills CLI works.
159
-
160
- **A tool you need is missing? It exists.** The default surface advertises a subset; reach any other by name with \`reticle_run { tool, args }\`, and list them with \`reticle_tools\`. Two worth knowing: \`reticle_context\` returns this run's own memory — what is established, what is proven, what is still unverified — which is what you want after a compaction or when picking up work you did not start; \`reticle_intent\` records what a change was MEANT to do, while somebody still knows.
161
-
162
- **Report Reticle's own defects with \`reticle_feedback\` the moment you notice**, then carry on with your task. You are the user Reticle is built for and the only one who can say what it cost you, and that knowledge is gone when your context is.
163
-
164
- 📄 **The rest is in [RETICLE.md](./${RETICLE_MD_PATH}): what to do when the tools are missing, when a result carries \`version_skew\` or \`update_available\`, when \`reticle_state\` comes back empty, and how to write a feedback report that can be acted on. Read it when you hit one of those, not before.**`;
165
- /**
166
- * The reference half. Fetched when a situation calls for it rather than carried every turn.
167
- *
168
- * Every section here answers a question an agent only has once it is already stuck, and each one was
169
- * written because the absence of it cost somebody a session: tools that were never loaded read as a
170
- * broken install, a `version_skew` field went unread while its green verdicts were trusted, an empty
171
- * `reticle_state` was reported as a clean setup, and a defect in Reticle was worked around in silence.
172
- */
173
- const RETICLE_MD_BODY = `# Reticle: the full rules
174
-
175
- The short version lives in your agent instruction file (\`CLAUDE.md\` / \`AGENTS.md\` / \`.cursor/rules/reticle.mdc\`) and loads every turn. This file is the reference: read the section that matches the situation you are in.
176
-
177
- ## The tools are missing entirely
178
-
179
- They have not been loaded yet, which is not the same as broken. \`init\` registers the MCP server, but a client reads its server list at startup and does not re-read it, and no slash command reloads it (\`/mcp\` only manages servers already loaded).
180
-
181
- Ask the human to RESTART their client: restart Claude Code, reload the window in Cursor, or hit Start in \`.vscode/mcp.json\` in VS Code. Then wait and carry on. This is once per machine, because Reticle is registered globally and later projects already have the tools. \`${CLI} status\` works meanwhile and says whether the daemon is up and whether the app has connected.
182
-
183
- ## A result carries \`verify_next\`
184
-
185
- You have driven this page several times without asking for a verdict, so nothing you have done so far is proven. Do what the field says next.
186
-
187
- ## A result carries \`version_skew\`
188
-
189
- Act on it before trusting anything else. Two pieces of Reticle are on different wire contracts, so tools can misbehave in ways neither side reports, and a green is not evidence. The field names the pair that disagrees and the exact fix: run \`${CLI} stop\` and retry when the DAEMON is stale, or tell the human to install the matching SDK and restart their dev server when the PAGE is. Then redo whatever you were verifying.
190
-
191
- ## A result carries \`update_available\`
192
-
193
- Reticle checked npm and a newer version exists. Tell the human the version numbers and offer to run \`${CLI} update\`, between tasks and never mid-verification, because it restarts the daemon and drops the session. Finish what you are doing first.
194
-
195
- ## \`reticle_state\` comes back empty
196
-
197
- The generated \`reticle-dev\` file registers nothing. Say so. \`init\` registers every store it could prove from your source; the ones needing an argument only reading the code supplies (Jotai atoms, an XState actor, a TanStack \`queryClient\`) are left commented, and a file that registers nothing is indistinguishable from a working one until you read the state back.
198
-
199
- Finish that file when you see it. It is what lets you check what the app BELIEVES, not only what it rendered, which is the class of bug a screenshot cannot show. Never report a clean setup over an empty state read. It blocks nothing else: DOM, network, console and source pointers all work without it.
200
-
201
- ## Sending feedback to the Reticle team
202
-
203
- **Reporting your experience is part of using Reticle, from the moment you start wiring it in.** Reticle is built FOR agents, which makes you its actual user and the only one who can see what it costs you.
204
-
205
- - **Send it with \`reticle_feedback\` the moment you notice.** One call, then carry straight on. Do not batch reports, do not wait until the task is done, and do not decide something is too minor. The small awkward things are what nobody ever reports, so they never get fixed.
206
- - **Everything counts, in both directions.** A tool that returned something wrong (\`bug\`), something Reticle could not observe at all (\`gap\`), a verdict you could not act on (\`ambiguity\`), something you wished existed (\`feature_request\`), something that works but costs too many calls (\`improvement\`).
207
- - **Setup and installation count too, and are the easiest to lose.** Anything that went wrong while installing, wiring, or starting Reticle: a step in the docs that did not match reality, a plugin that had to be added by hand, a daemon that would not start, an OS-specific detour. You hit these before any verification runs, which is exactly why they go unreported.
208
- - **When the tools are not reachable yet**, file the same report from the shell: \`${CLI} feedback --agent --kind <bug|gap|ambiguity|feature_request|improvement> "what happened"\`. It needs no daemon and no working install, so a Reticle that broke before it started can still be reported.
209
- - **Write it so it can be acted on.** For a failure: what you called, what you expected, what you got, and the call trail in \`trace\`. For a request: the GOAL in \`need\` (not your guess at the solution), what improves in \`impact\`, and how you work around it today in \`currentApproach\`. That workaround is usually the most useful line in the report. Set \`model\` to the model you are running.
210
- - **Working around a Reticle defect in silence is the one thing not to do.** A silent workaround is how the same defect survives to the next user.
211
- - **Report defects in *Reticle*, not in the app under test.** A bug you find in this app is Reticle working as intended; that one belongs in your report to the user.
212
- - **Never include app source, secrets, user data, or customer records** in a report.
213
-
214
- ## More
215
-
216
- The docs are built to be fetched rather than browsed: \`https://docs.reticle.sh/llms.txt\` lists every page, and appending \`.md\` to any page URL returns its source with no site chrome.
217
- `;
218
- /** The full-rules file, written verbatim (no markers: `init` owns this file entirely). */
219
- export function reticleMdFile() {
220
- return RETICLE_MD_BODY;
221
- }
222
- export const AgentRuleStatus = {
223
- APPLY: 'apply',
224
- ALREADY: 'already',
225
- };
226
- /** The marker-wrapped block appended to a CLAUDE.md / AGENTS.md instruction file. */
227
- export function markedBlock() {
228
- return `${RULE_BEGIN}\n${RULE_BODY}\n${RULE_END}\n`;
229
- }
230
- /**
231
- * Merge the managed block into a marker-delimited instruction file. Already present ⇒ no change
232
- * (idempotent re-run). Absent/empty ⇒ the block alone. Otherwise append the block, preserving the
233
- * existing content and a clean separating blank line.
234
- */
235
- export function mergeMarkedInstruction(existing) {
236
- if (existing !== null && existing !== undefined && existing.includes(RULE_BEGIN)) {
237
- // A block that can never be updated is not managed. Returning ALREADY on sight of the marker
238
- // meant a project that ran init once kept that release's rule text forever, so every improvement
239
- // reached only new projects — and a rule about a field introduced later (`version_skew`) could
240
- // never arrive at all. The markers promise the inside is ours; idempotence comes from comparing
241
- // CONTENT instead of presence.
242
- return refreshMarkedBlock(existing);
243
- }
244
- const block = markedBlock();
245
- if (null === existing || existing === undefined || 0 === existing.trim().length) {
246
- return { status: AgentRuleStatus.APPLY, content: block };
247
- }
248
- const separator = existing.endsWith('\n') ? '\n' : '\n\n';
249
- return { status: AgentRuleStatus.APPLY, content: `${existing}${separator}${block}` };
250
- }
251
- /**
252
- * Swap the managed block for the current one, leaving every character outside the markers alone.
253
- *
254
- * A malformed file — a begin marker with no end — is left untouched and reported ALREADY. Rewriting
255
- * from a marker to end-of-file would eat whatever the human wrote after it, and silently destroying
256
- * someone's instruction file is far worse than a stale rule.
257
- */
258
- function refreshMarkedBlock(existing) {
259
- const start = existing.indexOf(RULE_BEGIN);
260
- const endAt = existing.indexOf(RULE_END, start);
261
- if (-1 === endAt)
262
- return { status: AgentRuleStatus.ALREADY, content: existing };
263
- const current = existing.slice(start, endAt + RULE_END.length);
264
- const wanted = markedBlock().trimEnd();
265
- if (current === wanted)
266
- return { status: AgentRuleStatus.ALREADY, content: existing };
267
- const content = `${existing.slice(0, start)}${wanted}${existing.slice(endAt + RULE_END.length)}`;
268
- return { status: AgentRuleStatus.APPLY, content };
269
- }
270
- /** The Cursor rule file (.mdc): `alwaysApply` keeps the rule in every turn's context. */
271
- export function cursorRuleFile() {
272
- return `---
273
- description: Verify web features with Reticle after building them, and report Reticle problems back to its maintainers
274
- alwaysApply: true
275
- ---
276
-
277
- ${RULE_BODY}
278
- `;
279
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * Which app in a workspace `reticle init` should wire, when the caller says.
3
- *
4
- * Refusing to guess between several apps is right — instrumenting one silently would leave the rest
5
- * unverified while reporting success. But "re-run inside the one you want" is not an answer a
6
- * script, a CI step, or an agent that cannot change directory can act on, so the refusal was a dead
7
- * end for exactly the callers most likely to hit it.
8
- *
9
- * A name that is not one of the discovered apps is refused rather than trusted: it is almost always
10
- * a typo or a stale path, and wiring a directory that is not an app writes files nothing compiles.
11
- */
12
- type AppChoice = {
13
- ok: true;
14
- app: string | undefined;
15
- } | {
16
- ok: false;
17
- message: string;
18
- };
19
- export declare function chooseWorkspaceApp(requested: string | undefined, apps: readonly string[]): AppChoice;
20
- export {};
@@ -1,25 +0,0 @@
1
- /**
2
- * Which app in a workspace `reticle init` should wire, when the caller says.
3
- *
4
- * Refusing to guess between several apps is right — instrumenting one silently would leave the rest
5
- * unverified while reporting success. But "re-run inside the one you want" is not an answer a
6
- * script, a CI step, or an agent that cannot change directory can act on, so the refusal was a dead
7
- * end for exactly the callers most likely to hit it.
8
- *
9
- * A name that is not one of the discovered apps is refused rather than trusted: it is almost always
10
- * a typo or a stale path, and wiring a directory that is not an app writes files nothing compiles.
11
- */
12
- export function chooseWorkspaceApp(requested, apps) {
13
- if (requested === undefined || '' === requested)
14
- return { ok: true, app: undefined };
15
- // Tab-completion adds a trailing slash; the discovered names never carry one.
16
- const wanted = requested.replace(/\/+$/, '');
17
- if (apps.includes(wanted))
18
- return { ok: true, app: wanted };
19
- return {
20
- ok: false,
21
- message: 0 === apps.length
22
- ? `--app ${requested} was given, but no app was found in this workspace`
23
- : `--app ${requested} is not one of the apps found here: ${apps.join(', ')}`,
24
- };
25
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * Which Astro file owns the document, and therefore where the SDK script belongs.
3
- *
4
- * The previous rule was "exactly one `.astro` file in `src/layouts/`". Measured on two real Astro
5
- * projects, it fired on neither: one has no `src/layouts/` at all and renders from
6
- * `src/pages/index.astro`; the other has three files there, two of which are partials. Both got a
7
- * printed recipe instead of a working install.
8
- *
9
- * A file COUNT cannot tell a layout from a partial, and a directory NAME cannot tell you where the
10
- * document shell is. `</body>` can — the file that closes the body is the one every page renders
11
- * through, and the only place a script reaches the whole app.
12
- *
13
- * Ambiguity is still refused rather than guessed. Two document shells means two entry points, and
14
- * silently instrumenting one of them would leave half the app unverified while reporting success.
15
- */
16
- interface AstroCandidate {
17
- path: string;
18
- source: string;
19
- }
20
- export declare function pickAstroHost(candidates: readonly AstroCandidate[]): AstroCandidate | undefined;
21
- export {};
@@ -1,27 +0,0 @@
1
- /**
2
- * Which Astro file owns the document, and therefore where the SDK script belongs.
3
- *
4
- * The previous rule was "exactly one `.astro` file in `src/layouts/`". Measured on two real Astro
5
- * projects, it fired on neither: one has no `src/layouts/` at all and renders from
6
- * `src/pages/index.astro`; the other has three files there, two of which are partials. Both got a
7
- * printed recipe instead of a working install.
8
- *
9
- * A file COUNT cannot tell a layout from a partial, and a directory NAME cannot tell you where the
10
- * document shell is. `</body>` can — the file that closes the body is the one every page renders
11
- * through, and the only place a script reaches the whole app.
12
- *
13
- * Ambiguity is still refused rather than guessed. Two document shells means two entry points, and
14
- * silently instrumenting one of them would leave half the app unverified while reporting success.
15
- */
16
- /** Tolerant of whitespace and casing: `</body>`, `</BODY >`, `</body\n>`. */
17
- const CLOSES_BODY = /<\/\s*body\s*>/i;
18
- /** Layout files win over pages: a page shell is one route, a layout shell is what routes inherit. */
19
- const LAYOUT_DIR = 'layouts/';
20
- export function pickAstroHost(candidates) {
21
- const owners = candidates.filter((c) => CLOSES_BODY.test(c.source));
22
- if (0 === owners.length)
23
- return undefined;
24
- const layouts = owners.filter((c) => c.path.includes(LAYOUT_DIR));
25
- const preferred = layouts.length > 0 ? layouts : owners;
26
- return 1 === preferred.length ? preferred[0] : undefined;
27
- }
@@ -1,33 +0,0 @@
1
- /**
2
- * Pure, conservative patchers for an Astro app: the config gets the token/root `define` and the
3
- * raised build target, one layout gets the dev-only connect `<script>`.
4
- *
5
- * Astro was the last gated framework where `init` printed a correct recipe and applied none of it —
6
- * the only ⚠ left on a supported stack, and the user's first session was two hand-copied snippets
7
- * away. Astro is Vite-based but renders its own HTML, so the Vite plugin's injection never fires and
8
- * there is no entry module to wire: the connect has to live in a page or layout `<script>`, and the
9
- * token has to be inlined by the config because nothing else is in the page's path to inject it.
10
- *
11
- * Both patchers bail to `manual` (the printed recipe) on any shape they do not fully recognise.
12
- * Half-editing a build config is worse than a documented manual step.
13
- */
14
- import { type SourcePatch } from './patch-kind.js';
15
- import { UiLibrary } from './detect.js';
16
- export declare function patchAstroConfig(source: string): SourcePatch;
17
- export declare function patchAstroLayout(source: string, port: number | undefined, projectId: string | undefined, uiLibrary?: UiLibrary): SourcePatch;
18
- /** Where Astro keeps ambient types — `create-astro` ships this file. */
19
- export declare const ASTRO_ENV_DTS_PATH = "src/env.d.ts";
20
- /**
21
- * The declarations `astro check` needs for the Vite `define` names (#677).
22
- *
23
- * Matching SvelteKit's `hooks.client.ts` typing: `string | undefined`, because the define can be
24
- * absent when the pairing token file is missing.
25
- */
26
- export declare const ASTRO_ENV_DTS_DECLARES: string;
27
- /**
28
- * Append the Vite-define ambient declarations to `src/env.d.ts`, or create the file.
29
- *
30
- * Without this, `create-astro`'s default `"astro check && astro build"` fails with four
31
- * `ts(2304) Cannot find name '__RETICLE_TOKEN__'` errors after a clean init (#677).
32
- */
33
- export declare function patchAstroEnvDts(existing: string | null): SourcePatch;