@descryy/mcp 0.11.5 → 0.11.7

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 (445) hide show
  1. package/dist/action-handshake.d.ts +38 -0
  2. package/dist/action-handshake.d.ts.map +1 -0
  3. package/dist/action-handshake.js +127 -0
  4. package/dist/action-handshake.js.map +1 -0
  5. package/dist/bin/descry-mcp.d.ts +7 -0
  6. package/dist/bin/descry-mcp.d.ts.map +1 -0
  7. package/dist/bin/descry-mcp.js +73 -0
  8. package/dist/bin/descry-mcp.js.map +1 -0
  9. package/dist/browser/auth.d.ts +84 -0
  10. package/dist/browser/auth.d.ts.map +1 -0
  11. package/dist/browser/auth.js +233 -0
  12. package/dist/browser/auth.js.map +1 -0
  13. package/dist/browser/capability-probe.d.ts +109 -0
  14. package/dist/browser/capability-probe.d.ts.map +1 -0
  15. package/dist/browser/capability-probe.js +201 -0
  16. package/dist/browser/capability-probe.js.map +1 -0
  17. package/dist/browser/driver.d.ts +591 -0
  18. package/dist/browser/driver.d.ts.map +1 -0
  19. package/dist/browser/driver.js +116 -0
  20. package/dist/browser/driver.js.map +1 -0
  21. package/dist/browser/evidence.d.ts +28 -0
  22. package/dist/browser/evidence.d.ts.map +1 -0
  23. package/dist/browser/evidence.js +82 -0
  24. package/dist/browser/evidence.js.map +1 -0
  25. package/dist/browser/fake-driver.d.ts +116 -0
  26. package/dist/browser/fake-driver.d.ts.map +1 -0
  27. package/dist/browser/fake-driver.js +416 -0
  28. package/dist/browser/fake-driver.js.map +1 -0
  29. package/dist/browser/fault-attribution.d.ts +178 -0
  30. package/dist/browser/fault-attribution.d.ts.map +1 -0
  31. package/dist/browser/fault-attribution.js +266 -0
  32. package/dist/browser/fault-attribution.js.map +1 -0
  33. package/dist/browser/graph-write.d.ts +45 -0
  34. package/dist/browser/graph-write.d.ts.map +1 -0
  35. package/dist/browser/graph-write.js +103 -0
  36. package/dist/browser/graph-write.js.map +1 -0
  37. package/dist/browser/identity-graph-write.d.ts +55 -0
  38. package/dist/browser/identity-graph-write.d.ts.map +1 -0
  39. package/dist/browser/identity-graph-write.js +45 -0
  40. package/dist/browser/identity-graph-write.js.map +1 -0
  41. package/dist/browser/page-probe.d.ts +81 -0
  42. package/dist/browser/page-probe.d.ts.map +1 -0
  43. package/dist/browser/page-probe.js +202 -0
  44. package/dist/browser/page-probe.js.map +1 -0
  45. package/dist/browser/playwright-driver.d.ts +115 -0
  46. package/dist/browser/playwright-driver.d.ts.map +1 -0
  47. package/dist/browser/playwright-driver.js +1545 -0
  48. package/dist/browser/playwright-driver.js.map +1 -0
  49. package/dist/browser/provider.d.ts +26 -0
  50. package/dist/browser/provider.d.ts.map +1 -0
  51. package/dist/browser/provider.js +14 -0
  52. package/dist/browser/provider.js.map +1 -0
  53. package/dist/browser/reach-recording-session.d.ts +44 -0
  54. package/dist/browser/reach-recording-session.d.ts.map +1 -0
  55. package/dist/browser/reach-recording-session.js +151 -0
  56. package/dist/browser/reach-recording-session.js.map +1 -0
  57. package/dist/browser/reachability.d.ts +168 -0
  58. package/dist/browser/reachability.d.ts.map +1 -0
  59. package/dist/browser/reachability.js +294 -0
  60. package/dist/browser/reachability.js.map +1 -0
  61. package/dist/browser/registry.d.ts +126 -0
  62. package/dist/browser/registry.d.ts.map +1 -0
  63. package/dist/browser/registry.js +177 -0
  64. package/dist/browser/registry.js.map +1 -0
  65. package/dist/browser/scenario-provenance.d.ts +23 -0
  66. package/dist/browser/scenario-provenance.d.ts.map +1 -0
  67. package/dist/browser/scenario-provenance.js +73 -0
  68. package/dist/browser/scenario-provenance.js.map +1 -0
  69. package/dist/browser/scenario-resolve.d.ts +28 -0
  70. package/dist/browser/scenario-resolve.d.ts.map +1 -0
  71. package/dist/browser/scenario-resolve.js +96 -0
  72. package/dist/browser/scenario-resolve.js.map +1 -0
  73. package/dist/browser/scenario-runner.d.ts +72 -0
  74. package/dist/browser/scenario-runner.d.ts.map +1 -0
  75. package/dist/browser/scenario-runner.js +353 -0
  76. package/dist/browser/scenario-runner.js.map +1 -0
  77. package/dist/browser/stack-parser.d.ts +19 -0
  78. package/dist/browser/stack-parser.d.ts.map +1 -0
  79. package/dist/browser/stack-parser.js +85 -0
  80. package/dist/browser/stack-parser.js.map +1 -0
  81. package/dist/browser/tool-support.d.ts +71 -0
  82. package/dist/browser/tool-support.d.ts.map +1 -0
  83. package/dist/browser/tool-support.js +216 -0
  84. package/dist/browser/tool-support.js.map +1 -0
  85. package/dist/browser/url-scheme.d.ts +14 -0
  86. package/dist/browser/url-scheme.d.ts.map +1 -0
  87. package/dist/browser/url-scheme.js +38 -0
  88. package/dist/browser/url-scheme.js.map +1 -0
  89. package/dist/browser/wait-target.d.ts +37 -0
  90. package/dist/browser/wait-target.d.ts.map +1 -0
  91. package/dist/browser/wait-target.js +54 -0
  92. package/dist/browser/wait-target.js.map +1 -0
  93. package/dist/cancellation.d.ts +20 -0
  94. package/dist/cancellation.d.ts.map +1 -0
  95. package/dist/cancellation.js +41 -0
  96. package/dist/cancellation.js.map +1 -0
  97. package/dist/capped.d.ts +39 -0
  98. package/dist/capped.d.ts.map +1 -0
  99. package/dist/capped.js +43 -0
  100. package/dist/capped.js.map +1 -0
  101. package/dist/credential-store.d.ts +22 -0
  102. package/dist/credential-store.d.ts.map +1 -0
  103. package/dist/credential-store.js +33 -0
  104. package/dist/credential-store.js.map +1 -0
  105. package/dist/disclosure-ledger.d.ts +14 -0
  106. package/dist/disclosure-ledger.d.ts.map +1 -0
  107. package/dist/disclosure-ledger.js +18 -0
  108. package/dist/disclosure-ledger.js.map +1 -0
  109. package/dist/evidence/observed-route-evidence.d.ts +25 -0
  110. package/dist/evidence/observed-route-evidence.d.ts.map +1 -0
  111. package/dist/evidence/observed-route-evidence.js +76 -0
  112. package/dist/evidence/observed-route-evidence.js.map +1 -0
  113. package/dist/heap.d.ts +61 -0
  114. package/dist/heap.d.ts.map +1 -0
  115. package/dist/heap.js +82 -0
  116. package/dist/heap.js.map +1 -0
  117. package/dist/heartbeat.d.ts +46 -0
  118. package/dist/heartbeat.d.ts.map +1 -0
  119. package/dist/heartbeat.js +66 -0
  120. package/dist/heartbeat.js.map +1 -0
  121. package/dist/index.d.ts +32 -0
  122. package/dist/index.d.ts.map +1 -0
  123. package/dist/index.js +19 -0
  124. package/dist/index.js.map +1 -0
  125. package/dist/module-trust.d.ts +37 -0
  126. package/dist/module-trust.d.ts.map +1 -0
  127. package/dist/module-trust.js +77 -0
  128. package/dist/module-trust.js.map +1 -0
  129. package/dist/path-confinement.d.ts +31 -0
  130. package/dist/path-confinement.d.ts.map +1 -0
  131. package/dist/path-confinement.js +44 -0
  132. package/dist/path-confinement.js.map +1 -0
  133. package/dist/planner/predict-then-propose.d.ts +134 -0
  134. package/dist/planner/predict-then-propose.d.ts.map +1 -0
  135. package/dist/planner/predict-then-propose.js +138 -0
  136. package/dist/planner/predict-then-propose.js.map +1 -0
  137. package/dist/planner/propose-journey.d.ts +75 -0
  138. package/dist/planner/propose-journey.d.ts.map +1 -0
  139. package/dist/planner/propose-journey.js +96 -0
  140. package/dist/planner/propose-journey.js.map +1 -0
  141. package/dist/protocol.d.ts +57 -0
  142. package/dist/protocol.d.ts.map +1 -0
  143. package/dist/protocol.js +90 -0
  144. package/dist/protocol.js.map +1 -0
  145. package/dist/ready-checks.d.ts +12 -0
  146. package/dist/ready-checks.d.ts.map +1 -0
  147. package/dist/ready-checks.js +43 -0
  148. package/dist/ready-checks.js.map +1 -0
  149. package/dist/registry.d.ts +103 -0
  150. package/dist/registry.d.ts.map +1 -0
  151. package/dist/registry.js +327 -0
  152. package/dist/registry.js.map +1 -0
  153. package/dist/render.d.ts +623 -0
  154. package/dist/render.d.ts.map +1 -0
  155. package/dist/render.js +968 -0
  156. package/dist/render.js.map +1 -0
  157. package/dist/runtime-registry.d.ts +22 -0
  158. package/dist/runtime-registry.d.ts.map +1 -0
  159. package/dist/runtime-registry.js +142 -0
  160. package/dist/runtime-registry.js.map +1 -0
  161. package/dist/sandbox-defaults.d.ts +41 -0
  162. package/dist/sandbox-defaults.d.ts.map +1 -0
  163. package/dist/sandbox-defaults.js +14 -0
  164. package/dist/sandbox-defaults.js.map +1 -0
  165. package/dist/scenarios/browser-run-plan-projection.d.ts +161 -0
  166. package/dist/scenarios/browser-run-plan-projection.d.ts.map +1 -0
  167. package/dist/scenarios/browser-run-plan-projection.js +264 -0
  168. package/dist/scenarios/browser-run-plan-projection.js.map +1 -0
  169. package/dist/scenarios/credential-ref.d.ts +102 -0
  170. package/dist/scenarios/credential-ref.d.ts.map +1 -0
  171. package/dist/scenarios/credential-ref.js +148 -0
  172. package/dist/scenarios/credential-ref.js.map +1 -0
  173. package/dist/scenarios/index.d.ts +7 -0
  174. package/dist/scenarios/index.d.ts.map +1 -0
  175. package/dist/scenarios/index.js +7 -0
  176. package/dist/scenarios/index.js.map +1 -0
  177. package/dist/scenarios/parse.d.ts +18 -0
  178. package/dist/scenarios/parse.d.ts.map +1 -0
  179. package/dist/scenarios/parse.js +212 -0
  180. package/dist/scenarios/parse.js.map +1 -0
  181. package/dist/scenarios/scenario.d.ts +93 -0
  182. package/dist/scenarios/scenario.d.ts.map +1 -0
  183. package/dist/scenarios/scenario.js +27 -0
  184. package/dist/scenarios/scenario.js.map +1 -0
  185. package/dist/scenarios/secret-ref.d.ts +86 -0
  186. package/dist/scenarios/secret-ref.d.ts.map +1 -0
  187. package/dist/scenarios/secret-ref.js +125 -0
  188. package/dist/scenarios/secret-ref.js.map +1 -0
  189. package/dist/scenarios/storage.d.ts +21 -0
  190. package/dist/scenarios/storage.d.ts.map +1 -0
  191. package/dist/scenarios/storage.js +103 -0
  192. package/dist/scenarios/storage.js.map +1 -0
  193. package/dist/server.d.ts +61 -0
  194. package/dist/server.d.ts.map +1 -0
  195. package/dist/server.js +642 -0
  196. package/dist/server.js.map +1 -0
  197. package/dist/session.d.ts +356 -0
  198. package/dist/session.d.ts.map +1 -0
  199. package/dist/session.js +779 -0
  200. package/dist/session.js.map +1 -0
  201. package/dist/tools/alias-kit.d.ts +29 -0
  202. package/dist/tools/alias-kit.d.ts.map +1 -0
  203. package/dist/tools/alias-kit.js +21 -0
  204. package/dist/tools/alias-kit.js.map +1 -0
  205. package/dist/tools/aliases.d.ts +42 -0
  206. package/dist/tools/aliases.d.ts.map +1 -0
  207. package/dist/tools/aliases.js +52 -0
  208. package/dist/tools/aliases.js.map +1 -0
  209. package/dist/tools/analyze-workspace.d.ts +52 -0
  210. package/dist/tools/analyze-workspace.d.ts.map +1 -0
  211. package/dist/tools/analyze-workspace.js +207 -0
  212. package/dist/tools/analyze-workspace.js.map +1 -0
  213. package/dist/tools/analyze.d.ts +163 -0
  214. package/dist/tools/analyze.d.ts.map +1 -0
  215. package/dist/tools/analyze.js +724 -0
  216. package/dist/tools/analyze.js.map +1 -0
  217. package/dist/tools/browser-click.d.ts +18 -0
  218. package/dist/tools/browser-click.d.ts.map +1 -0
  219. package/dist/tools/browser-click.js +110 -0
  220. package/dist/tools/browser-click.js.map +1 -0
  221. package/dist/tools/browser-close-session.d.ts +39 -0
  222. package/dist/tools/browser-close-session.d.ts.map +1 -0
  223. package/dist/tools/browser-close-session.js +120 -0
  224. package/dist/tools/browser-close-session.js.map +1 -0
  225. package/dist/tools/browser-fill.d.ts +18 -0
  226. package/dist/tools/browser-fill.d.ts.map +1 -0
  227. package/dist/tools/browser-fill.js +117 -0
  228. package/dist/tools/browser-fill.js.map +1 -0
  229. package/dist/tools/browser-navigate.d.ts +15 -0
  230. package/dist/tools/browser-navigate.d.ts.map +1 -0
  231. package/dist/tools/browser-navigate.js +106 -0
  232. package/dist/tools/browser-navigate.js.map +1 -0
  233. package/dist/tools/browser-read.d.ts +33 -0
  234. package/dist/tools/browser-read.d.ts.map +1 -0
  235. package/dist/tools/browser-read.js +105 -0
  236. package/dist/tools/browser-read.js.map +1 -0
  237. package/dist/tools/browser-run-scenario.d.ts +28 -0
  238. package/dist/tools/browser-run-scenario.d.ts.map +1 -0
  239. package/dist/tools/browser-run-scenario.js +238 -0
  240. package/dist/tools/browser-run-scenario.js.map +1 -0
  241. package/dist/tools/browser-save-scenario.d.ts +19 -0
  242. package/dist/tools/browser-save-scenario.d.ts.map +1 -0
  243. package/dist/tools/browser-save-scenario.js +447 -0
  244. package/dist/tools/browser-save-scenario.js.map +1 -0
  245. package/dist/tools/browser-select.d.ts +20 -0
  246. package/dist/tools/browser-select.d.ts.map +1 -0
  247. package/dist/tools/browser-select.js +120 -0
  248. package/dist/tools/browser-select.js.map +1 -0
  249. package/dist/tools/browser-snapshot.d.ts +46 -0
  250. package/dist/tools/browser-snapshot.d.ts.map +1 -0
  251. package/dist/tools/browser-snapshot.js +127 -0
  252. package/dist/tools/browser-snapshot.js.map +1 -0
  253. package/dist/tools/browser-start-session.d.ts +24 -0
  254. package/dist/tools/browser-start-session.d.ts.map +1 -0
  255. package/dist/tools/browser-start-session.js +653 -0
  256. package/dist/tools/browser-start-session.js.map +1 -0
  257. package/dist/tools/browser-submit.d.ts +18 -0
  258. package/dist/tools/browser-submit.d.ts.map +1 -0
  259. package/dist/tools/browser-submit.js +106 -0
  260. package/dist/tools/browser-submit.js.map +1 -0
  261. package/dist/tools/browser-type.d.ts +18 -0
  262. package/dist/tools/browser-type.d.ts.map +1 -0
  263. package/dist/tools/browser-type.js +115 -0
  264. package/dist/tools/browser-type.js.map +1 -0
  265. package/dist/tools/browser-wait-for.d.ts +45 -0
  266. package/dist/tools/browser-wait-for.d.ts.map +1 -0
  267. package/dist/tools/browser-wait-for.js +164 -0
  268. package/dist/tools/browser-wait-for.js.map +1 -0
  269. package/dist/tools/browser.d.ts +69 -0
  270. package/dist/tools/browser.d.ts.map +1 -0
  271. package/dist/tools/browser.js +326 -0
  272. package/dist/tools/browser.js.map +1 -0
  273. package/dist/tools/chain.d.ts +41 -0
  274. package/dist/tools/chain.d.ts.map +1 -0
  275. package/dist/tools/chain.js +101 -0
  276. package/dist/tools/chain.js.map +1 -0
  277. package/dist/tools/change-scope.d.ts +25 -0
  278. package/dist/tools/change-scope.d.ts.map +1 -0
  279. package/dist/tools/change-scope.js +103 -0
  280. package/dist/tools/change-scope.js.map +1 -0
  281. package/dist/tools/code-context.d.ts +83 -0
  282. package/dist/tools/code-context.d.ts.map +1 -0
  283. package/dist/tools/code-context.js +432 -0
  284. package/dist/tools/code-context.js.map +1 -0
  285. package/dist/tools/contracts.d.ts +74 -0
  286. package/dist/tools/contracts.d.ts.map +1 -0
  287. package/dist/tools/contracts.js +214 -0
  288. package/dist/tools/contracts.js.map +1 -0
  289. package/dist/tools/cross-pr.d.ts +178 -0
  290. package/dist/tools/cross-pr.d.ts.map +1 -0
  291. package/dist/tools/cross-pr.js +362 -0
  292. package/dist/tools/cross-pr.js.map +1 -0
  293. package/dist/tools/disclosure.d.ts +75 -0
  294. package/dist/tools/disclosure.d.ts.map +1 -0
  295. package/dist/tools/disclosure.js +325 -0
  296. package/dist/tools/disclosure.js.map +1 -0
  297. package/dist/tools/draw-conclusion.d.ts +55 -0
  298. package/dist/tools/draw-conclusion.d.ts.map +1 -0
  299. package/dist/tools/draw-conclusion.js +243 -0
  300. package/dist/tools/draw-conclusion.js.map +1 -0
  301. package/dist/tools/git-context.d.ts +39 -0
  302. package/dist/tools/git-context.d.ts.map +1 -0
  303. package/dist/tools/git-context.js +374 -0
  304. package/dist/tools/git-context.js.map +1 -0
  305. package/dist/tools/git-diff.d.ts +45 -0
  306. package/dist/tools/git-diff.d.ts.map +1 -0
  307. package/dist/tools/git-diff.js +338 -0
  308. package/dist/tools/git-diff.js.map +1 -0
  309. package/dist/tools/git-history.d.ts +16 -0
  310. package/dist/tools/git-history.d.ts.map +1 -0
  311. package/dist/tools/git-history.js +106 -0
  312. package/dist/tools/git-history.js.map +1 -0
  313. package/dist/tools/history.d.ts +34 -0
  314. package/dist/tools/history.d.ts.map +1 -0
  315. package/dist/tools/history.js +121 -0
  316. package/dist/tools/history.js.map +1 -0
  317. package/dist/tools/impact.d.ts +46 -0
  318. package/dist/tools/impact.d.ts.map +1 -0
  319. package/dist/tools/impact.js +225 -0
  320. package/dist/tools/impact.js.map +1 -0
  321. package/dist/tools/index.d.ts +59 -0
  322. package/dist/tools/index.d.ts.map +1 -0
  323. package/dist/tools/index.js +70 -0
  324. package/dist/tools/index.js.map +1 -0
  325. package/dist/tools/kit.d.ts +165 -0
  326. package/dist/tools/kit.d.ts.map +1 -0
  327. package/dist/tools/kit.js +153 -0
  328. package/dist/tools/kit.js.map +1 -0
  329. package/dist/tools/link-workspace.d.ts +24 -0
  330. package/dist/tools/link-workspace.d.ts.map +1 -0
  331. package/dist/tools/link-workspace.js +131 -0
  332. package/dist/tools/link-workspace.js.map +1 -0
  333. package/dist/tools/lookup.d.ts +19 -0
  334. package/dist/tools/lookup.d.ts.map +1 -0
  335. package/dist/tools/lookup.js +63 -0
  336. package/dist/tools/lookup.js.map +1 -0
  337. package/dist/tools/mark-incident.d.ts +28 -0
  338. package/dist/tools/mark-incident.d.ts.map +1 -0
  339. package/dist/tools/mark-incident.js +171 -0
  340. package/dist/tools/mark-incident.js.map +1 -0
  341. package/dist/tools/merged-browser.d.ts +11 -0
  342. package/dist/tools/merged-browser.d.ts.map +1 -0
  343. package/dist/tools/merged-browser.js +20 -0
  344. package/dist/tools/merged-browser.js.map +1 -0
  345. package/dist/tools/merged-context.d.ts +11 -0
  346. package/dist/tools/merged-context.d.ts.map +1 -0
  347. package/dist/tools/merged-context.js +21 -0
  348. package/dist/tools/merged-context.js.map +1 -0
  349. package/dist/tools/merged-observe.d.ts +13 -0
  350. package/dist/tools/merged-observe.d.ts.map +1 -0
  351. package/dist/tools/merged-observe.js +21 -0
  352. package/dist/tools/merged-observe.js.map +1 -0
  353. package/dist/tools/merged-workspace.d.ts +14 -0
  354. package/dist/tools/merged-workspace.d.ts.map +1 -0
  355. package/dist/tools/merged-workspace.js +21 -0
  356. package/dist/tools/merged-workspace.js.map +1 -0
  357. package/dist/tools/observe-runtime.d.ts +262 -0
  358. package/dist/tools/observe-runtime.d.ts.map +1 -0
  359. package/dist/tools/observe-runtime.js +1966 -0
  360. package/dist/tools/observe-runtime.js.map +1 -0
  361. package/dist/tools/observe-tests.d.ts +57 -0
  362. package/dist/tools/observe-tests.d.ts.map +1 -0
  363. package/dist/tools/observe-tests.js +391 -0
  364. package/dist/tools/observe-tests.js.map +1 -0
  365. package/dist/tools/observe.d.ts +28 -0
  366. package/dist/tools/observe.d.ts.map +1 -0
  367. package/dist/tools/observe.js +291 -0
  368. package/dist/tools/observe.js.map +1 -0
  369. package/dist/tools/pr-analysis.d.ts +189 -0
  370. package/dist/tools/pr-analysis.d.ts.map +1 -0
  371. package/dist/tools/pr-analysis.js +365 -0
  372. package/dist/tools/pr-analysis.js.map +1 -0
  373. package/dist/tools/pre-push.d.ts +168 -0
  374. package/dist/tools/pre-push.d.ts.map +1 -0
  375. package/dist/tools/pre-push.js +416 -0
  376. package/dist/tools/pre-push.js.map +1 -0
  377. package/dist/tools/predict-reach.d.ts +57 -0
  378. package/dist/tools/predict-reach.d.ts.map +1 -0
  379. package/dist/tools/predict-reach.js +183 -0
  380. package/dist/tools/predict-reach.js.map +1 -0
  381. package/dist/tools/propagation.d.ts +37 -0
  382. package/dist/tools/propagation.d.ts.map +1 -0
  383. package/dist/tools/propagation.js +162 -0
  384. package/dist/tools/propagation.js.map +1 -0
  385. package/dist/tools/propose-journey.d.ts +16 -0
  386. package/dist/tools/propose-journey.d.ts.map +1 -0
  387. package/dist/tools/propose-journey.js +132 -0
  388. package/dist/tools/propose-journey.js.map +1 -0
  389. package/dist/tools/prove-reach.d.ts +74 -0
  390. package/dist/tools/prove-reach.d.ts.map +1 -0
  391. package/dist/tools/prove-reach.js +274 -0
  392. package/dist/tools/prove-reach.js.map +1 -0
  393. package/dist/tools/questions.d.ts +30 -0
  394. package/dist/tools/questions.d.ts.map +1 -0
  395. package/dist/tools/questions.js +230 -0
  396. package/dist/tools/questions.js.map +1 -0
  397. package/dist/tools/refusal-fetch.d.ts +35 -0
  398. package/dist/tools/refusal-fetch.d.ts.map +1 -0
  399. package/dist/tools/refusal-fetch.js +123 -0
  400. package/dist/tools/refusal-fetch.js.map +1 -0
  401. package/dist/tools/runtime-incident.d.ts +33 -0
  402. package/dist/tools/runtime-incident.d.ts.map +1 -0
  403. package/dist/tools/runtime-incident.js +67 -0
  404. package/dist/tools/runtime-incident.js.map +1 -0
  405. package/dist/tools/runtime-journey-drive.d.ts +102 -0
  406. package/dist/tools/runtime-journey-drive.d.ts.map +1 -0
  407. package/dist/tools/runtime-journey-drive.js +247 -0
  408. package/dist/tools/runtime-journey-drive.js.map +1 -0
  409. package/dist/tools/scope.d.ts +45 -0
  410. package/dist/tools/scope.d.ts.map +1 -0
  411. package/dist/tools/scope.js +217 -0
  412. package/dist/tools/scope.js.map +1 -0
  413. package/dist/tools/similar-incidents.d.ts +43 -0
  414. package/dist/tools/similar-incidents.d.ts.map +1 -0
  415. package/dist/tools/similar-incidents.js +190 -0
  416. package/dist/tools/similar-incidents.js.map +1 -0
  417. package/dist/tools/validate.d.ts +133 -0
  418. package/dist/tools/validate.d.ts.map +1 -0
  419. package/dist/tools/validate.js +488 -0
  420. package/dist/tools/validate.js.map +1 -0
  421. package/dist/tools/verb.d.ts +46 -0
  422. package/dist/tools/verb.d.ts.map +1 -0
  423. package/dist/tools/verb.js +78 -0
  424. package/dist/tools/verb.js.map +1 -0
  425. package/dist/tools/verification-status.d.ts +38 -0
  426. package/dist/tools/verification-status.d.ts.map +1 -0
  427. package/dist/tools/verification-status.js +203 -0
  428. package/dist/tools/verification-status.js.map +1 -0
  429. package/dist/tools/verify-claim.d.ts +29 -0
  430. package/dist/tools/verify-claim.d.ts.map +1 -0
  431. package/dist/tools/verify-claim.js +218 -0
  432. package/dist/tools/verify-claim.js.map +1 -0
  433. package/dist/tools/workspace.d.ts +28 -0
  434. package/dist/tools/workspace.d.ts.map +1 -0
  435. package/dist/tools/workspace.js +94 -0
  436. package/dist/tools/workspace.js.map +1 -0
  437. package/dist/transport.d.ts +32 -0
  438. package/dist/transport.d.ts.map +1 -0
  439. package/dist/transport.js +85 -0
  440. package/dist/transport.js.map +1 -0
  441. package/dist/workspace-index.d.ts +164 -0
  442. package/dist/workspace-index.d.ts.map +1 -0
  443. package/dist/workspace-index.js +381 -0
  444. package/dist/workspace-index.js.map +1 -0
  445. package/package.json +5 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-trust.js","sourceRoot":"","sources":["../src/module-trust.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,CAAC,MAAM,0BAA0B,GAAG,mCAAmC,CAAC;AAC9E,MAAM,CAAC,MAAM,kCAAkC,GAAG,mCAAmC,CAAC;AAItF,mNAAmN;AACnN,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACrG,IAAI,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IACnD,IAAI,2BAA2B,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7D,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB,EAAE,oBAA4B;IAC/E,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,GAAG,EAAE,CAAC;IACrE,OAAO,oBAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,kBAAkB;IACzB,MAAM,KAAK,GAAG,OAAO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3C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Confines a caller-named path to a set of roots, with a disclosed, operator-set
3
+ * escape hatch (A-F6). Generalizes two `observe-runtime.ts` call sites with no such
4
+ * check: `evidencePath` (relative joined onto repo root with no re-check — `..`
5
+ * escaped it) and `attach.logFilePath` (read in full every poll, unchecked). */
6
+ export type PathConfinementDecision = {
7
+ readonly allowed: true;
8
+ readonly resolved: string;
9
+ } | {
10
+ readonly allowed: false;
11
+ readonly reason: string;
12
+ };
13
+ export interface PathConfinementOptions {
14
+ /** The path as configured, absolute or relative. Relative is resolved against `process.cwd()` — callers that mean "relative to the repo" must join it themselves before calling this. */
15
+ readonly candidate: string;
16
+ /** Confined when the resolved candidate is under any of these. */
17
+ readonly allowedRoots: readonly string[];
18
+ /** Set to `"1"` or `"true"` in this server's own environment to bypass confinement. */
19
+ readonly envVar: string;
20
+ /** What the value is, for the refusal message — e.g. `"evidencePath"`. */
21
+ readonly what: string;
22
+ }
23
+ export declare function checkPathConfinement(options: PathConfinementOptions): PathConfinementDecision;
24
+ export type SensitivePathDecision = {
25
+ readonly sensitive: false;
26
+ } | {
27
+ readonly sensitive: true;
28
+ readonly reason: string;
29
+ };
30
+ export declare function checkNotSensitivePath(candidate: string, envVar: string): SensitivePathDecision;
31
+ //# sourceMappingURL=path-confinement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-confinement.d.ts","sourceRoot":"","sources":["../src/path-confinement.ts"],"names":[],"mappings":"AAAA;;;;gFAIgF;AAIhF,MAAM,MAAM,uBAAuB,GAC/B;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAOzD,MAAM,WAAW,sBAAsB;IACrC,yLAAyL;IACzL,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,uFAAuF;IACvF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,GAAG,uBAAuB,CAe7F;AAQD,MAAM,MAAM,qBAAqB,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1H,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,qBAAqB,CAY9F"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Confines a caller-named path to a set of roots, with a disclosed, operator-set
3
+ * escape hatch (A-F6). Generalizes two `observe-runtime.ts` call sites with no such
4
+ * check: `evidencePath` (relative joined onto repo root with no re-check — `..`
5
+ * escaped it) and `attach.logFilePath` (read in full every poll, unchecked). */
6
+ import { resolve, sep } from "node:path";
7
+ function isWithin(resolvedCandidate, root) {
8
+ const resolvedRoot = resolve(root);
9
+ return resolvedCandidate === resolvedRoot || resolvedCandidate.startsWith(resolvedRoot + sep);
10
+ }
11
+ export function checkPathConfinement(options) {
12
+ const resolved = resolve(options.candidate);
13
+ if (options.allowedRoots.some((root) => isWithin(resolved, root))) {
14
+ return { allowed: true, resolved };
15
+ }
16
+ if (process.env[options.envVar] === "1" || process.env[options.envVar] === "true") {
17
+ return { allowed: true, resolved };
18
+ }
19
+ return {
20
+ allowed: false,
21
+ reason: `"${options.candidate}" (${options.what}) resolves to ${resolved}, outside ` +
22
+ `${options.allowedRoots.length === 1 ? "" : "every one of "}${options.allowedRoots.join(", ")}. ` +
23
+ `Refused by default; set ${options.envVar}=1 in this server's own environment to allow it.`,
24
+ };
25
+ }
26
+ /** Name-based blocklist for logFilePath (can't root-confine — logs live anywhere),
27
+ * narrowed to the exploit's shape (`~/.ssh/id_rsa`). NOT primary defence: `redact()`
28
+ * unconditionally scans every byte first — this only stops the read itself. */
29
+ const SENSITIVE_PATH_SEGMENT = /(^|[/\\])(\.ssh|\.aws|\.gnupg|\.kube|\.netrc|\.npmrc|\.git-credentials|\.pgpass|shadow|id_rsa|id_dsa|id_ecdsa|id_ed25519|\.env(\..+)?|[^/\\]+\.pem|[^/\\]+\.key)($|[/\\])/i;
30
+ export function checkNotSensitivePath(candidate, envVar) {
31
+ const resolved = resolve(candidate);
32
+ if (!SENSITIVE_PATH_SEGMENT.test(resolved))
33
+ return { sensitive: false };
34
+ if (process.env[envVar] === "1" || process.env[envVar] === "true")
35
+ return { sensitive: false };
36
+ return {
37
+ sensitive: true,
38
+ reason: `"${candidate}" names a file shape that is never an application log (an SSH/cloud/credential ` +
39
+ `location) — refusing to read it as one. This is a narrow, name-based check, not a guarantee that ` +
40
+ `every sensitive path is caught; set ${envVar}=1 in this server's own environment if this path ` +
41
+ "genuinely is your application's log.",
42
+ };
43
+ }
44
+ //# sourceMappingURL=path-confinement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-confinement.js","sourceRoot":"","sources":["../src/path-confinement.ts"],"names":[],"mappings":"AAAA;;;;gFAIgF;AAEhF,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAMzC,SAAS,QAAQ,CAAC,iBAAyB,EAAE,IAAY;IACvD,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,iBAAiB,KAAK,YAAY,IAAI,iBAAiB,CAAC,UAAU,CAAC,YAAY,GAAG,GAAG,CAAC,CAAC;AAChG,CAAC;AAaD,MAAM,UAAU,oBAAoB,CAAC,OAA+B;IAClE,MAAM,QA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EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAC/F,OAAO;QACL,SAAS,EAAE,IAAI;QACf,MAAM,EACJ,IAAI,SAAS,iFAAiF;YAC9F,mGAAmG;YACnG,uCAAuC,MAAM,mDAAmD;YAChG,sCAAsC;KACzC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * RG-10's second half, joined to its first: predict, then propose — never
3
+ * predict, then drive. `documents/plans/runtime-gap-closure.md`'s Lane C3.
4
+ *
5
+ * The predict half is `reachablePages` (`@descryy/core`): a one-sided
6
+ * forward walk from any node — typically a `DATABASE_COLUMN` a diff touches
7
+ * — over `PROPAGATES_TO`/`READS`/`ASSIGNS`/`RETURNS`, crossing `USES_API`
8
+ * backward at an `API_ENDPOINT`, to whatever `PAGE`/`COMPONENT` the data can
9
+ * reach. That traversal already existed (Gap 8 step 3) and is untouched
10
+ * here.
11
+ *
12
+ * The propose half reuses lane journey's planner (`./propose-journey.ts`)
13
+ * exactly as `propose_journey` itself does — same function, same "propose,
14
+ * never invent" discipline, same navigate-only limitation (the graph has no
15
+ * selector, so a `PAGE` reached through the walk becomes a navigate step
16
+ * only when its own qualified name looks like a route path; everything
17
+ * else is `reachedNotProposed`, not guessed into a click). This module
18
+ * builds no second planner and no second projection — it is the join, not
19
+ * a third implementation.
20
+ *
21
+ * **This module never drives anything and never writes to a `Finding`.**
22
+ * Proving or disproving what it predicts is: a human (or an agent acting on
23
+ * a human's behalf) reviews the proposal, drives the application for real
24
+ * (`browser_start_session`, the browser primitives, `browser_save_scenario`
25
+ * to commit what actually happened), and records the outcome against the
26
+ * finding that predicted it — a step this module does not take, because
27
+ * `packages/ir/src/finding.ts` and the finding funnel are outside this
28
+ * lane's owned files. See the `predict_reach` tool's own description for
29
+ * where that handoff is named to a caller.
30
+ *
31
+ * ## `proveOrDisprove` — the join, added by the pipeline-joins lane (RG-10, §5 Lane C3)
32
+ *
33
+ * Still never drives anything. It takes evidence a caller *already*
34
+ * collected by driving an accepted scenario for real — `browser_run_scenario`'s
35
+ * own `graph: BrowserGraphWrite` (or, in a live pipeline run, the same
36
+ * `graphNodeId`-correlated evidence `descry-desktop`'s runtime execution
37
+ * already produces) — and compares it against what {@link predictThenPropose}
38
+ * predicted. `ObservedReach` is declared structurally, not imported from
39
+ * `../browser/*`, so this module (and every caller of it, including
40
+ * `descry-desktop`'s pipeline) takes no dependency on the browser package;
41
+ * a real `BrowserGraphWrite`'s resolved node ids structurally satisfy it
42
+ * without a cast.
43
+ *
44
+ * **Both directions are real answers, not just the confirming one.** A
45
+ * predicted page absent from `observed.visitedNodeIds` after the declared
46
+ * journey ran to completion is a disproof — the propagation this module
47
+ * predicted did not show up where the graph said it would — and rule 6/7
48
+ * require that to be as visible as a proof, never silently dropped in favour
49
+ * of the cases that confirmed the prediction.
50
+ */
51
+ import { type AdjacencyProvider } from "@descryy/core";
52
+ import { type JourneyCandidateNode, type JourneyPathHop, type ProposedJourney } from "./propose-journey.ts";
53
+ export interface PredictThenProposeOptions {
54
+ readonly targetUrl: string;
55
+ readonly name: string;
56
+ readonly savedAtCommit: string;
57
+ }
58
+ export interface PredictedReach {
59
+ /** Every PAGE/COMPONENT node the walk reached, in the order it found them. */
60
+ readonly reachedPages: readonly JourneyCandidateNode[];
61
+ /** Null iff `reachedPages` is empty — nothing to propose a journey toward. */
62
+ readonly proposal: ProposedJourney | null;
63
+ readonly notes: readonly string[];
64
+ }
65
+ /**
66
+ * Walks from `startNodeId` to whatever pages the data can reach, and — when
67
+ * it reaches at least one — proposes a navigate-only journey to them via
68
+ * the shared planner. Pure over `provider`: no browser, no write, no I/O.
69
+ */
70
+ export declare function predictThenPropose(provider: AdjacencyProvider, startNodeId: string, options: PredictThenProposeOptions): PredictedReach;
71
+ /**
72
+ * What a caller already observed by driving an accepted journey for real —
73
+ * never produced by this module. Structural: a real `BrowserGraphWrite`
74
+ * (`browser_run_scenario`'s own reply) or a live run's `graphNodeId`-
75
+ * correlated evidence both satisfy this without a cast; see this module's
76
+ * header.
77
+ */
78
+ export interface ObservedReach {
79
+ /** Graph node ids the real, already-driven journey's evidence actually correlated to. */
80
+ readonly visitedNodeIds: readonly string[];
81
+ }
82
+ /** One predicted page, resolved against what really happened. */
83
+ export interface ProvenReach {
84
+ /** Predicted pages the real drive's own evidence shows were actually reached. */
85
+ readonly proven: readonly JourneyCandidateNode[];
86
+ /**
87
+ * Predicted pages the declared journey ran to completion without ever
88
+ * reaching. A real disproof — not "not yet checked" (that's simply the
89
+ * absence of an `ObservedReach` at all) — see this module's header for why
90
+ * this is recorded with the same weight as `proven`.
91
+ */
92
+ readonly disproven: readonly JourneyCandidateNode[];
93
+ }
94
+ /**
95
+ * The join itself: never drives, only compares. `predicted.reachedPages`
96
+ * partitions cleanly into `proven`/`disproven` against `observed.visitedNodeIds`
97
+ * — every predicted page lands in exactly one, so a caller can never read a
98
+ * prediction as "not checked" once it has a real `ObservedReach` in hand.
99
+ */
100
+ export declare function proveOrDisprove(predicted: PredictedReach, observed: ObservedReach): ProvenReach;
101
+ /** One real edge, in the shape `@descryy/ir`'s `GraphPathHop` needs — never invented, only
102
+ * ever a copy of a hop `reachablePages` actually walked (see `queries.ts`'s `ReachPathHop`). */
103
+ export type PredictedPathHop = JourneyPathHop;
104
+ /**
105
+ * `prove_reach`'s join into the finding funnel: the real path from `startNodeId` to whichever
106
+ * predicted pages a caller names (typically the ones a real drive proved), deduplicated by
107
+ * (from, to, edgeType) and ordered by first appearance. Pure — no I/O, no re-traversal; it only
108
+ * reassembles the `path` each `JourneyCandidateNode` already carries from `predictThenPropose`.
109
+ *
110
+ * Union, not intersection or average: rule 2 says omit an edge you are unsure of, not omit one
111
+ * two pages happen to share — every hop named here is a real edge on at least one named page's
112
+ * real path, and `minimumResolution` (the caller's next step) already takes the conservative
113
+ * floor across all of them.
114
+ */
115
+ export declare function combinedGraphPath(predicted: PredictedReach, pageIds: readonly string[]): readonly PredictedPathHop[];
116
+ /** One proposed navigate step, resolved against how it actually replayed — structural, the same
117
+ * reasoning as `ObservedReach`: a real `ScenarioStepResult` (`browser/scenario-runner.ts`)
118
+ * already satisfies this without a cast, so this module still takes no dependency on the
119
+ * browser package (see this module's header). */
120
+ export interface ReplayedStep {
121
+ readonly url: string;
122
+ readonly status: "ran" | "unresolved" | "skipped";
123
+ }
124
+ /**
125
+ * Which predicted pages a real drive of the proposed scenario actually navigated to —
126
+ * `prove_reach`'s own `ObservedReach.visitedNodeIds`, built without guessing: a page counts as
127
+ * visited only when a step whose `url` is byte-identical to the exact navigate URL
128
+ * `proposeJourney` built FROM that page's own route name came back `"ran"`. A step that never
129
+ * resolved (the app was down, the route 404'd before the browser could navigate) does not count
130
+ * — reaching a URL and having the navigation actually run are the same fact here, and this
131
+ * never inflates "predicted" into "visited" for a step that did not.
132
+ */
133
+ export declare function visitedPageIds(predicted: PredictedReach, targetUrl: string, steps: readonly ReplayedStep[]): readonly string[];
134
+ //# sourceMappingURL=predict-then-propose.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predict-then-propose.d.ts","sourceRoot":"","sources":["../../src/planner/predict-then-propose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,EAAkB,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5H,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvD,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,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time-gap-closure.md`'s Lane C3.
4
+ *
5
+ * The predict half is `reachablePages` (`@descryy/core`): a one-sided
6
+ * forward walk from any node — typically a `DATABASE_COLUMN` a diff touches
7
+ * — over `PROPAGATES_TO`/`READS`/`ASSIGNS`/`RETURNS`, crossing `USES_API`
8
+ * backward at an `API_ENDPOINT`, to whatever `PAGE`/`COMPONENT` the data can
9
+ * reach. That traversal already existed (Gap 8 step 3) and is untouched
10
+ * here.
11
+ *
12
+ * The propose half reuses lane journey's planner (`./propose-journey.ts`)
13
+ * exactly as `propose_journey` itself does — same function, same "propose,
14
+ * never invent" discipline, same navigate-only limitation (the graph has no
15
+ * selector, so a `PAGE` reached through the walk becomes a navigate step
16
+ * only when its own qualified name looks like a route path; everything
17
+ * else is `reachedNotProposed`, not guessed into a click). This module
18
+ * builds no second planner and no second projection — it is the join, not
19
+ * a third implementation.
20
+ *
21
+ * **This module never drives anything and never writes to a `Finding`.**
22
+ * Proving or disproving what it predicts is: a human (or an agent acting on
23
+ * a human's behalf) reviews the proposal, drives the application for real
24
+ * (`browser_start_session`, the browser primitives, `browser_save_scenario`
25
+ * to commit what actually happened), and records the outcome against the
26
+ * finding that predicted it — a step this module does not take, because
27
+ * `packages/ir/src/finding.ts` and the finding funnel are outside this
28
+ * lane's owned files. See the `predict_reach` tool's own description for
29
+ * where that handoff is named to a caller.
30
+ *
31
+ * ## `proveOrDisprove` — the join, added by the pipeline-joins lane (RG-10, §5 Lane C3)
32
+ *
33
+ * Still never drives anything. It takes evidence a caller *already*
34
+ * collected by driving an accepted scenario for real — `browser_run_scenario`'s
35
+ * own `graph: BrowserGraphWrite` (or, in a live pipeline run, the same
36
+ * `graphNodeId`-correlated evidence `descry-desktop`'s runtime execution
37
+ * already produces) — and compares it against what {@link predictThenPropose}
38
+ * predicted. `ObservedReach` is declared structurally, not imported from
39
+ * `../browser/*`, so this module (and every caller of it, including
40
+ * `descry-desktop`'s pipeline) takes no dependency on the browser package;
41
+ * a real `BrowserGraphWrite`'s resolved node ids structurally satisfy it
42
+ * without a cast.
43
+ *
44
+ * **Both directions are real answers, not just the confirming one.** A
45
+ * predicted page absent from `observed.visitedNodeIds` after the declared
46
+ * journey ran to completion is a disproof — the propagation this module
47
+ * predicted did not show up where the graph said it would — and rule 6/7
48
+ * require that to be as visible as a proof, never silently dropped in favour
49
+ * of the cases that confirmed the prediction.
50
+ */
51
+ import { reachablePages } from "@descryy/core";
52
+ import { proposeJourney } from "./propose-journey.js";
53
+ /**
54
+ * Walks from `startNodeId` to whatever pages the data can reach, and — when
55
+ * it reaches at least one — proposes a navigate-only journey to them via
56
+ * the shared planner. Pure over `provider`: no browser, no write, no I/O.
57
+ */
58
+ export function predictThenPropose(provider, startNodeId, options) {
59
+ const reach = reachablePages(provider, startNodeId);
60
+ // `reachablePages` already restricts itself to PAGE/COMPONENT nodes (see
61
+ // its own doc); no re-filtering needed here. `path` — the real edge chain
62
+ // this walk used to reach this node — is carried through so a later caller
63
+ // (`prove_reach`) can build a real `graphPath` from it, never a guessed one.
64
+ const reachedPages = reach.data.map((r) => ({
65
+ id: r.node.id,
66
+ type: r.node.type,
67
+ name: r.node.name,
68
+ path: r.path,
69
+ }));
70
+ if (reachedPages.length === 0) {
71
+ return { reachedPages: [], proposal: null, notes: reach.notes };
72
+ }
73
+ const proposal = proposeJourney(reachedPages, options);
74
+ return { reachedPages, proposal, notes: [...reach.notes, ...proposal.notes] };
75
+ }
76
+ /**
77
+ * The join itself: never drives, only compares. `predicted.reachedPages`
78
+ * partitions cleanly into `proven`/`disproven` against `observed.visitedNodeIds`
79
+ * — every predicted page lands in exactly one, so a caller can never read a
80
+ * prediction as "not checked" once it has a real `ObservedReach` in hand.
81
+ */
82
+ export function proveOrDisprove(predicted, observed) {
83
+ const visited = new Set(observed.visitedNodeIds);
84
+ const proven = [];
85
+ const disproven = [];
86
+ for (const page of predicted.reachedPages) {
87
+ (visited.has(page.id) ? proven : disproven).push(page);
88
+ }
89
+ return { proven, disproven };
90
+ }
91
+ /**
92
+ * `prove_reach`'s join into the finding funnel: the real path from `startNodeId` to whichever
93
+ * predicted pages a caller names (typically the ones a real drive proved), deduplicated by
94
+ * (from, to, edgeType) and ordered by first appearance. Pure — no I/O, no re-traversal; it only
95
+ * reassembles the `path` each `JourneyCandidateNode` already carries from `predictThenPropose`.
96
+ *
97
+ * Union, not intersection or average: rule 2 says omit an edge you are unsure of, not omit one
98
+ * two pages happen to share — every hop named here is a real edge on at least one named page's
99
+ * real path, and `minimumResolution` (the caller's next step) already takes the conservative
100
+ * floor across all of them.
101
+ */
102
+ export function combinedGraphPath(predicted, pageIds) {
103
+ const wanted = new Set(pageIds);
104
+ const seen = new Set();
105
+ const hops = [];
106
+ for (const page of predicted.reachedPages) {
107
+ if (!wanted.has(page.id) || page.path === undefined)
108
+ continue;
109
+ for (const hop of page.path) {
110
+ const key = `${hop.from}::${hop.to}::${hop.edgeType}`;
111
+ if (seen.has(key))
112
+ continue;
113
+ seen.add(key);
114
+ hops.push(hop);
115
+ }
116
+ }
117
+ return hops;
118
+ }
119
+ /**
120
+ * Which predicted pages a real drive of the proposed scenario actually navigated to —
121
+ * `prove_reach`'s own `ObservedReach.visitedNodeIds`, built without guessing: a page counts as
122
+ * visited only when a step whose `url` is byte-identical to the exact navigate URL
123
+ * `proposeJourney` built FROM that page's own route name came back `"ran"`. A step that never
124
+ * resolved (the app was down, the route 404'd before the browser could navigate) does not count
125
+ * — reaching a URL and having the navigation actually run are the same fact here, and this
126
+ * never inflates "predicted" into "visited" for a step that did not.
127
+ */
128
+ export function visitedPageIds(predicted, targetUrl, steps) {
129
+ const base = targetUrl.endsWith("/") ? targetUrl.slice(0, -1) : targetUrl;
130
+ const ranUrls = new Set(steps.filter((s) => s.status === "ran").map((s) => s.url));
131
+ const visited = [];
132
+ for (const page of predicted.reachedPages) {
133
+ if (ranUrls.has(`${base}${page.name}`))
134
+ visited.push(page.id);
135
+ }
136
+ return visited;
137
+ }
138
+ //# sourceMappingURL=predict-then-propose.js.map
@@ -0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;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,SAAyB,EAAE,SAAiB,EAAE,KAA8B;IACzG,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1E,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnF,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,YAAY,EAAE,CAAC;QAC1C,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * The planner — proposes, never invents. Lane A1, item 5 of
3
+ * `documents/plans/runtime-gap-closure.md`, closing the rest of RG-1.
4
+ *
5
+ * ## What this is and is not
6
+ *
7
+ * Takes the `PAGE`/`COMPONENT` nodes a diff-scope traversal already found
8
+ * (the same `scopeChange` the `scope` tool calls — this module receives its
9
+ * output, it does not recompute it) and turns them into a **proposed**
10
+ * `Scenario` — a value returned to the caller, never written to disk. Rule 1
11
+ * ("never fabricate input") is the whole shape of this module: the code
12
+ * graph has no DOM. It can name a route a `PAGE` node's own qualified path
13
+ * spells out; it has no selector, no accessible name, no evidence a button
14
+ * exists at all. So the proposal is **navigate-only** — one step per
15
+ * page-shaped route the scope touched — and every `COMPONENT` node (and
16
+ * every `PAGE` node with no path-shaped name to navigate to) is listed as
17
+ * *reached but not exercised*, disclosed rather than guessed into a `click`
18
+ * step this module cannot back with a real selector.
19
+ *
20
+ * ## Why this can never execute anything
21
+ *
22
+ * The only way a `Scenario` becomes replayable is `writeScenario`
23
+ * (`scenarios/storage.ts`), and the only caller in this codebase that calls
24
+ * it is `browser_save_scenario` — which requires a **live, already-driven
25
+ * browser session** and independently verifies every step actually
26
+ * resolves before it writes anything (`collectUnresolvedTargets`). This
27
+ * module never imports `writeScenario` and never touches a browser session.
28
+ * A proposal from here is data in a tool reply; nothing runs until a human
29
+ * (or an agent acting on a human's behalf) drives the app for real and
30
+ * calls `browser_save_scenario` — the acceptance act — which is what
31
+ * produces the one artifact (`descry/scenarios/*.scenario.json`) that
32
+ * `browser_run_scenario` can replay. See `propose-journey.test.ts`'s
33
+ * "nothing executes without an acceptance record" case.
34
+ */
35
+ import type { EdgeType, ResolutionLevel } from "@descryy/ir";
36
+ import { type Scenario } from "../scenarios/index.ts";
37
+ /** One real, stored edge — see `@descryy/core`'s `ReachPathHop` (same shape, this planner takes
38
+ * no dependency on that package's query layer to declare it). Field-compatible with
39
+ * `@descryy/ir`'s `GraphPathHop` too, so a real array of these already satisfies it without a cast. */
40
+ export interface JourneyPathHop {
41
+ readonly from: string;
42
+ readonly to: string;
43
+ readonly edgeType: EdgeType;
44
+ readonly resolution: ResolutionLevel;
45
+ }
46
+ export interface JourneyCandidateNode {
47
+ readonly id: string;
48
+ readonly type: string;
49
+ readonly name: string;
50
+ /** The real edge chain `reachablePages` walked to reach this node, when the caller has one
51
+ * (`predictThenPropose` sets it; a plain diff-scope caller of this planner does not). Optional
52
+ * so this planner's own, unrelated callers are unaffected — it is never read here, only
53
+ * carried through for `prove_reach`'s join into the finding funnel. */
54
+ readonly path?: readonly JourneyPathHop[];
55
+ }
56
+ export interface ProposedJourney {
57
+ /** A `Scenario`-shaped proposal. `assertions` is always empty: this module has no evidence to assert against, and inventing one would be a confident false claim about a page it never observed. */
58
+ readonly scenario: Scenario;
59
+ /** `PAGE` nodes in scope whose name did not look like a navigable path, and every `COMPONENT` node — real graph hits, listed rather than guessed into a step. */
60
+ readonly reachedNotProposed: readonly JourneyCandidateNode[];
61
+ readonly notes: readonly string[];
62
+ }
63
+ /**
64
+ * Builds a proposed journey from the `PAGE`/`COMPONENT` nodes a diff scope
65
+ * already found. `nodes` is typically `[...scoped.changed, ...scoped.affected]`
66
+ * mapped to their graph node — the caller (the MCP tool) owns fetching that;
67
+ * this function is pure over the result so it is exhaustively testable
68
+ * without a graph.
69
+ */
70
+ export declare function proposeJourney(nodes: readonly JourneyCandidateNode[], options: {
71
+ readonly targetUrl: string;
72
+ readonly name: string;
73
+ readonly savedAtCommit: string;
74
+ }): ProposedJourney;
75
+ //# sourceMappingURL=propose-journey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propose-journey.d.ts","sourceRoot":"","sources":["../../src/planner/propose-journey.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE/E;;wGAEwG;AACxG,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;CACtC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;4EAGwE;IACxE,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,eAAe;IAC9B,oMAAoM;IACpM,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,iKAAiK;IACjK,QAAQ,CAAC,kBAAkB,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC7D,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAOD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,oBAAoB,EAAE,EACtC,OAAO,EAAE;IACP,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC,GACA,eAAe,CAwDjB"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * The planner — proposes, never invents. Lane A1, item 5 of
3
+ * `documents/plans/runtime-gap-closure.md`, closing the rest of RG-1.
4
+ *
5
+ * ## What this is and is not
6
+ *
7
+ * Takes the `PAGE`/`COMPONENT` nodes a diff-scope traversal already found
8
+ * (the same `scopeChange` the `scope` tool calls — this module receives its
9
+ * output, it does not recompute it) and turns them into a **proposed**
10
+ * `Scenario` — a value returned to the caller, never written to disk. Rule 1
11
+ * ("never fabricate input") is the whole shape of this module: the code
12
+ * graph has no DOM. It can name a route a `PAGE` node's own qualified path
13
+ * spells out; it has no selector, no accessible name, no evidence a button
14
+ * exists at all. So the proposal is **navigate-only** — one step per
15
+ * page-shaped route the scope touched — and every `COMPONENT` node (and
16
+ * every `PAGE` node with no path-shaped name to navigate to) is listed as
17
+ * *reached but not exercised*, disclosed rather than guessed into a `click`
18
+ * step this module cannot back with a real selector.
19
+ *
20
+ * ## Why this can never execute anything
21
+ *
22
+ * The only way a `Scenario` becomes replayable is `writeScenario`
23
+ * (`scenarios/storage.ts`), and the only caller in this codebase that calls
24
+ * it is `browser_save_scenario` — which requires a **live, already-driven
25
+ * browser session** and independently verifies every step actually
26
+ * resolves before it writes anything (`collectUnresolvedTargets`). This
27
+ * module never imports `writeScenario` and never touches a browser session.
28
+ * A proposal from here is data in a tool reply; nothing runs until a human
29
+ * (or an agent acting on a human's behalf) drives the app for real and
30
+ * calls `browser_save_scenario` — the acceptance act — which is what
31
+ * produces the one artifact (`descry/scenarios/*.scenario.json`) that
32
+ * `browser_run_scenario` can replay. See `propose-journey.test.ts`'s
33
+ * "nothing executes without an acceptance record" case.
34
+ */
35
+ import { SCENARIO_SCHEMA_VERSION } from "../scenarios/index.js";
36
+ /** A qualified symbol name that looks like a route path: starts with `/`, single line, no whitespace. Deliberately conservative — false negatives (a real route this misses) fall through to `reachedNotProposed`, which is the safe direction (rule 2: when in doubt, omit). */
37
+ function looksLikeRoutePath(name) {
38
+ return name.startsWith("/") && !/\s/.test(name) && !name.includes("\n");
39
+ }
40
+ /**
41
+ * Builds a proposed journey from the `PAGE`/`COMPONENT` nodes a diff scope
42
+ * already found. `nodes` is typically `[...scoped.changed, ...scoped.affected]`
43
+ * mapped to their graph node — the caller (the MCP tool) owns fetching that;
44
+ * this function is pure over the result so it is exhaustively testable
45
+ * without a graph.
46
+ */
47
+ export function proposeJourney(nodes, options) {
48
+ const pages = nodes.filter((n) => n.type === "PAGE");
49
+ const components = nodes.filter((n) => n.type === "COMPONENT");
50
+ const routable = [];
51
+ const unroutable = [];
52
+ for (const page of pages)
53
+ (looksLikeRoutePath(page.name) ? routable : unroutable).push(page);
54
+ const base = options.targetUrl.endsWith("/") ? options.targetUrl.slice(0, -1) : options.targetUrl;
55
+ // Deduplicated and ordered — two PAGE nodes for the same route (a layout
56
+ // and a leaf, say) must not become two identical navigate steps.
57
+ const seenPaths = new Set();
58
+ const steps = [];
59
+ for (const page of routable) {
60
+ if (seenPaths.has(page.name))
61
+ continue;
62
+ seenPaths.add(page.name);
63
+ steps.push({ action: "navigate", url: `${base}${page.name}`, target: null, text: null });
64
+ }
65
+ const notes = [];
66
+ if (steps.length === 0) {
67
+ notes.push("No node in scope named a path-shaped route, so this proposal has no steps to offer. This is not a " +
68
+ "claim that nothing changed — it is a claim that nothing in scope looked like a navigable page from " +
69
+ "the graph alone. A human exploring the application directly (browser_start_session, then " +
70
+ "browser_save_scenario) is how a real journey gets declared from here.");
71
+ }
72
+ notes.push("Every step here is navigate-only: the code graph has no selector, no accessible name and no evidence " +
73
+ "an element exists, so this proposal never invents a click, a type or a submit. A human who accepts " +
74
+ "this proposal drives the rest of the journey for real and saves it with browser_save_scenario — that " +
75
+ "save is what turns a proposal into something replayable, and this module never calls it itself.");
76
+ if (unroutable.length + components.length > 0) {
77
+ notes.push(`${unroutable.length + components.length} node(s) in scope (${unroutable.length} page(s) with no ` +
78
+ `path-shaped name, ${components.length} component(s)) are reached but not proposed as a step — listed ` +
79
+ "in reachedNotProposed rather than guessed into one.");
80
+ }
81
+ return {
82
+ scenario: {
83
+ schemaVersion: SCENARIO_SCHEMA_VERSION,
84
+ name: options.name,
85
+ description: "Proposed by the planner from a diff scope's PAGE nodes — not accepted, not saved, not runnable until a human reviews it.",
86
+ targetUrl: steps[0]?.url ?? options.targetUrl,
87
+ savedAt: new Date().toISOString(),
88
+ savedAtCommit: options.savedAtCommit,
89
+ steps,
90
+ assertions: [],
91
+ },
92
+ reachedNotProposed: [...unroutable, ...components],
93
+ notes,
94
+ };
95
+ }
96
+ //# sourceMappingURL=propose-journey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propose-journey.js","sourceRoot":"","sources":["../../src/planner/propose-journey.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAIH,OAAO,EAAE,uBAAuB,EAAiB,MAAM,uBAAuB,CAAC;AA+B/E,iRAAiR;AACjR,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,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IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CACR,oGAAoG;YAClG,qGAAqG;YACrG,2FAA2F;YAC3F,uEAAuE,CAC1E,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CACR,uGAAuG;QACrG,qGAAqG;QACrG,uGAAuG;QACvG,iGAAiG,CACpG,CAAC;IACF,IAAI,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9C,KAAK,CAAC,IAAI,CACR,GAAG,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,sBAAsB,UAAU,CAAC,MAAM,mBAAmB;YAChG,qBAAqB,UAAU,CAAC,MAAM,iEAAiE;YACvG,qDAAqD,CACxD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,QAAQ,EAAE;YACR,aAAa,EAAE,uBAAuB;YACtC,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,0HAA0H;YACvI,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,OAAO,CAAC,SAAS;YAC7C,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACjC,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,KAAK;YACL,UAAU,EAAE,EAAE;SACf;QACD,kBAAkB,EAAE,CAAC,GAAG,UAAU,EAAE,GAAG,UAAU,CAAC;QAClD,KAAK;KACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * JSON-RPC 2.0 + the MCP slice this server speaks — hand-written, not the SDK:
3
+ * v1.30.0 pulls 17 deps, nearly all for HTTP/OAuth transports this stdio-only
4
+ * server never opens (same call as `node:sqlite`, `node --test`, `tsc` elsewhere).
5
+ * Spec-drift risk is mitigated by a pinned `PROTOCOL_VERSION` and exact-frame tests. */
6
+ /** JSON-RPC 2.0 ids: string or number, never null in a request. */
7
+ export type RpcId = string | number;
8
+ export interface RpcRequest {
9
+ readonly jsonrpc: "2.0";
10
+ readonly id: RpcId;
11
+ readonly method: string;
12
+ readonly params?: Record<string, unknown>;
13
+ }
14
+ export interface RpcNotification {
15
+ readonly jsonrpc: "2.0";
16
+ readonly method: string;
17
+ readonly params?: Record<string, unknown>;
18
+ }
19
+ export interface RpcError {
20
+ readonly code: number;
21
+ readonly message: string;
22
+ readonly data?: unknown;
23
+ }
24
+ export interface RpcResponse {
25
+ readonly jsonrpc: "2.0";
26
+ readonly id: RpcId;
27
+ readonly result?: unknown;
28
+ readonly error?: RpcError;
29
+ }
30
+ export type RpcMessage = RpcRequest | RpcNotification;
31
+ /** Standard JSON-RPC codes. MCP adds none of its own at this layer. */
32
+ export declare const RPC_PARSE_ERROR = -32700;
33
+ export declare const RPC_INVALID_REQUEST = -32600;
34
+ export declare const RPC_METHOD_NOT_FOUND = -32601;
35
+ export declare const RPC_INVALID_PARAMS = -32602;
36
+ export declare const RPC_INTERNAL_ERROR = -32603;
37
+ /** The version this server implements. Negotiation echoes the client's version if
38
+ * it's on `SUPPORTED_PROTOCOL_VERSIONS`, else answers with this — never claims
39
+ * compatibility with an unchecked client version. */
40
+ export declare const PROTOCOL_VERSION = "2025-06-18";
41
+ export declare const SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
42
+ export declare function negotiateVersion(requested: unknown): string;
43
+ /** A frame that couldn't be understood well enough to answer. Distinct from a
44
+ * merely-wrong request — JSON-RPC says a message with no usable id gets no
45
+ * response; replying with a fabricated id would be uncorrelatable. */
46
+ export declare class ProtocolError extends Error {
47
+ readonly code: number;
48
+ /** Null when the frame carried no usable id and must therefore go unanswered. */
49
+ readonly id: RpcId | null;
50
+ constructor(code: number, message: string, id: RpcId | null);
51
+ }
52
+ /** Parse one line into a request or notification, or throw `ProtocolError`. */
53
+ export declare function parseMessage(line: string): RpcMessage;
54
+ export declare function isRequest(message: RpcMessage): message is RpcRequest;
55
+ export declare function ok(id: RpcId, result: unknown): RpcResponse;
56
+ export declare function fail(id: RpcId, code: number, message: string, data?: unknown): RpcResponse;
57
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;wFAIwF;AAExF,mEAAmE;AACnE,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,eAAe,CAAC;AAEtD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