@descryy/mcp 0.11.3 → 0.11.5

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 (441) hide show
  1. package/package.json +20 -20
  2. package/dist/action-handshake.d.ts +0 -38
  3. package/dist/action-handshake.d.ts.map +0 -1
  4. package/dist/action-handshake.js +0 -127
  5. package/dist/action-handshake.js.map +0 -1
  6. package/dist/bin/descry-mcp.d.ts +0 -7
  7. package/dist/bin/descry-mcp.d.ts.map +0 -1
  8. package/dist/bin/descry-mcp.js +0 -72
  9. package/dist/bin/descry-mcp.js.map +0 -1
  10. package/dist/browser/auth.d.ts +0 -84
  11. package/dist/browser/auth.d.ts.map +0 -1
  12. package/dist/browser/auth.js +0 -233
  13. package/dist/browser/auth.js.map +0 -1
  14. package/dist/browser/capability-probe.d.ts +0 -109
  15. package/dist/browser/capability-probe.d.ts.map +0 -1
  16. package/dist/browser/capability-probe.js +0 -201
  17. package/dist/browser/capability-probe.js.map +0 -1
  18. package/dist/browser/driver.d.ts +0 -570
  19. package/dist/browser/driver.d.ts.map +0 -1
  20. package/dist/browser/driver.js +0 -116
  21. package/dist/browser/driver.js.map +0 -1
  22. package/dist/browser/evidence.d.ts +0 -28
  23. package/dist/browser/evidence.d.ts.map +0 -1
  24. package/dist/browser/evidence.js +0 -82
  25. package/dist/browser/evidence.js.map +0 -1
  26. package/dist/browser/fake-driver.d.ts +0 -116
  27. package/dist/browser/fake-driver.d.ts.map +0 -1
  28. package/dist/browser/fake-driver.js +0 -416
  29. package/dist/browser/fake-driver.js.map +0 -1
  30. package/dist/browser/fault-attribution.d.ts +0 -178
  31. package/dist/browser/fault-attribution.d.ts.map +0 -1
  32. package/dist/browser/fault-attribution.js +0 -266
  33. package/dist/browser/fault-attribution.js.map +0 -1
  34. package/dist/browser/graph-write.d.ts +0 -45
  35. package/dist/browser/graph-write.d.ts.map +0 -1
  36. package/dist/browser/graph-write.js +0 -103
  37. package/dist/browser/graph-write.js.map +0 -1
  38. package/dist/browser/identity-graph-write.d.ts +0 -55
  39. package/dist/browser/identity-graph-write.d.ts.map +0 -1
  40. package/dist/browser/identity-graph-write.js +0 -45
  41. package/dist/browser/identity-graph-write.js.map +0 -1
  42. package/dist/browser/page-probe.d.ts +0 -81
  43. package/dist/browser/page-probe.d.ts.map +0 -1
  44. package/dist/browser/page-probe.js +0 -202
  45. package/dist/browser/page-probe.js.map +0 -1
  46. package/dist/browser/playwright-driver.d.ts +0 -114
  47. package/dist/browser/playwright-driver.d.ts.map +0 -1
  48. package/dist/browser/playwright-driver.js +0 -1479
  49. package/dist/browser/playwright-driver.js.map +0 -1
  50. package/dist/browser/provider.d.ts +0 -26
  51. package/dist/browser/provider.d.ts.map +0 -1
  52. package/dist/browser/provider.js +0 -14
  53. package/dist/browser/provider.js.map +0 -1
  54. package/dist/browser/reach-recording-session.d.ts +0 -44
  55. package/dist/browser/reach-recording-session.d.ts.map +0 -1
  56. package/dist/browser/reach-recording-session.js +0 -143
  57. package/dist/browser/reach-recording-session.js.map +0 -1
  58. package/dist/browser/reachability.d.ts +0 -168
  59. package/dist/browser/reachability.d.ts.map +0 -1
  60. package/dist/browser/reachability.js +0 -294
  61. package/dist/browser/reachability.js.map +0 -1
  62. package/dist/browser/registry.d.ts +0 -126
  63. package/dist/browser/registry.d.ts.map +0 -1
  64. package/dist/browser/registry.js +0 -177
  65. package/dist/browser/registry.js.map +0 -1
  66. package/dist/browser/scenario-provenance.d.ts +0 -23
  67. package/dist/browser/scenario-provenance.d.ts.map +0 -1
  68. package/dist/browser/scenario-provenance.js +0 -73
  69. package/dist/browser/scenario-provenance.js.map +0 -1
  70. package/dist/browser/scenario-resolve.d.ts +0 -28
  71. package/dist/browser/scenario-resolve.d.ts.map +0 -1
  72. package/dist/browser/scenario-resolve.js +0 -96
  73. package/dist/browser/scenario-resolve.js.map +0 -1
  74. package/dist/browser/scenario-runner.d.ts +0 -72
  75. package/dist/browser/scenario-runner.d.ts.map +0 -1
  76. package/dist/browser/scenario-runner.js +0 -353
  77. package/dist/browser/scenario-runner.js.map +0 -1
  78. package/dist/browser/stack-parser.d.ts +0 -19
  79. package/dist/browser/stack-parser.d.ts.map +0 -1
  80. package/dist/browser/stack-parser.js +0 -85
  81. package/dist/browser/stack-parser.js.map +0 -1
  82. package/dist/browser/tool-support.d.ts +0 -71
  83. package/dist/browser/tool-support.d.ts.map +0 -1
  84. package/dist/browser/tool-support.js +0 -216
  85. package/dist/browser/tool-support.js.map +0 -1
  86. package/dist/browser/url-scheme.d.ts +0 -14
  87. package/dist/browser/url-scheme.d.ts.map +0 -1
  88. package/dist/browser/url-scheme.js +0 -38
  89. package/dist/browser/url-scheme.js.map +0 -1
  90. package/dist/browser/wait-target.d.ts +0 -37
  91. package/dist/browser/wait-target.d.ts.map +0 -1
  92. package/dist/browser/wait-target.js +0 -54
  93. package/dist/browser/wait-target.js.map +0 -1
  94. package/dist/cancellation.d.ts +0 -20
  95. package/dist/cancellation.d.ts.map +0 -1
  96. package/dist/cancellation.js +0 -41
  97. package/dist/cancellation.js.map +0 -1
  98. package/dist/capped.d.ts +0 -17
  99. package/dist/capped.d.ts.map +0 -1
  100. package/dist/capped.js +0 -15
  101. package/dist/capped.js.map +0 -1
  102. package/dist/credential-store.d.ts +0 -22
  103. package/dist/credential-store.d.ts.map +0 -1
  104. package/dist/credential-store.js +0 -33
  105. package/dist/credential-store.js.map +0 -1
  106. package/dist/disclosure-ledger.d.ts +0 -14
  107. package/dist/disclosure-ledger.d.ts.map +0 -1
  108. package/dist/disclosure-ledger.js +0 -18
  109. package/dist/disclosure-ledger.js.map +0 -1
  110. package/dist/evidence/observed-route-evidence.d.ts +0 -25
  111. package/dist/evidence/observed-route-evidence.d.ts.map +0 -1
  112. package/dist/evidence/observed-route-evidence.js +0 -76
  113. package/dist/evidence/observed-route-evidence.js.map +0 -1
  114. package/dist/heap.d.ts +0 -61
  115. package/dist/heap.d.ts.map +0 -1
  116. package/dist/heap.js +0 -82
  117. package/dist/heap.js.map +0 -1
  118. package/dist/heartbeat.d.ts +0 -46
  119. package/dist/heartbeat.d.ts.map +0 -1
  120. package/dist/heartbeat.js +0 -66
  121. package/dist/heartbeat.js.map +0 -1
  122. package/dist/index.d.ts +0 -32
  123. package/dist/index.d.ts.map +0 -1
  124. package/dist/index.js +0 -19
  125. package/dist/index.js.map +0 -1
  126. package/dist/module-trust.d.ts +0 -37
  127. package/dist/module-trust.d.ts.map +0 -1
  128. package/dist/module-trust.js +0 -77
  129. package/dist/module-trust.js.map +0 -1
  130. package/dist/path-confinement.d.ts +0 -31
  131. package/dist/path-confinement.d.ts.map +0 -1
  132. package/dist/path-confinement.js +0 -44
  133. package/dist/path-confinement.js.map +0 -1
  134. package/dist/planner/predict-then-propose.d.ts +0 -134
  135. package/dist/planner/predict-then-propose.d.ts.map +0 -1
  136. package/dist/planner/predict-then-propose.js +0 -138
  137. package/dist/planner/predict-then-propose.js.map +0 -1
  138. package/dist/planner/propose-journey.d.ts +0 -75
  139. package/dist/planner/propose-journey.d.ts.map +0 -1
  140. package/dist/planner/propose-journey.js +0 -96
  141. package/dist/planner/propose-journey.js.map +0 -1
  142. package/dist/protocol.d.ts +0 -57
  143. package/dist/protocol.d.ts.map +0 -1
  144. package/dist/protocol.js +0 -90
  145. package/dist/protocol.js.map +0 -1
  146. package/dist/registry.d.ts +0 -103
  147. package/dist/registry.d.ts.map +0 -1
  148. package/dist/registry.js +0 -319
  149. package/dist/registry.js.map +0 -1
  150. package/dist/render.d.ts +0 -580
  151. package/dist/render.d.ts.map +0 -1
  152. package/dist/render.js +0 -867
  153. package/dist/render.js.map +0 -1
  154. package/dist/runtime-registry.d.ts +0 -22
  155. package/dist/runtime-registry.d.ts.map +0 -1
  156. package/dist/runtime-registry.js +0 -142
  157. package/dist/runtime-registry.js.map +0 -1
  158. package/dist/sandbox-defaults.d.ts +0 -41
  159. package/dist/sandbox-defaults.d.ts.map +0 -1
  160. package/dist/sandbox-defaults.js +0 -14
  161. package/dist/sandbox-defaults.js.map +0 -1
  162. package/dist/scenarios/browser-run-plan-projection.d.ts +0 -161
  163. package/dist/scenarios/browser-run-plan-projection.d.ts.map +0 -1
  164. package/dist/scenarios/browser-run-plan-projection.js +0 -264
  165. package/dist/scenarios/browser-run-plan-projection.js.map +0 -1
  166. package/dist/scenarios/credential-ref.d.ts +0 -102
  167. package/dist/scenarios/credential-ref.d.ts.map +0 -1
  168. package/dist/scenarios/credential-ref.js +0 -148
  169. package/dist/scenarios/credential-ref.js.map +0 -1
  170. package/dist/scenarios/index.d.ts +0 -7
  171. package/dist/scenarios/index.d.ts.map +0 -1
  172. package/dist/scenarios/index.js +0 -7
  173. package/dist/scenarios/index.js.map +0 -1
  174. package/dist/scenarios/parse.d.ts +0 -18
  175. package/dist/scenarios/parse.d.ts.map +0 -1
  176. package/dist/scenarios/parse.js +0 -212
  177. package/dist/scenarios/parse.js.map +0 -1
  178. package/dist/scenarios/scenario.d.ts +0 -93
  179. package/dist/scenarios/scenario.d.ts.map +0 -1
  180. package/dist/scenarios/scenario.js +0 -27
  181. package/dist/scenarios/scenario.js.map +0 -1
  182. package/dist/scenarios/secret-ref.d.ts +0 -86
  183. package/dist/scenarios/secret-ref.d.ts.map +0 -1
  184. package/dist/scenarios/secret-ref.js +0 -125
  185. package/dist/scenarios/secret-ref.js.map +0 -1
  186. package/dist/scenarios/storage.d.ts +0 -21
  187. package/dist/scenarios/storage.d.ts.map +0 -1
  188. package/dist/scenarios/storage.js +0 -103
  189. package/dist/scenarios/storage.js.map +0 -1
  190. package/dist/server.d.ts +0 -61
  191. package/dist/server.d.ts.map +0 -1
  192. package/dist/server.js +0 -541
  193. package/dist/server.js.map +0 -1
  194. package/dist/session.d.ts +0 -243
  195. package/dist/session.d.ts.map +0 -1
  196. package/dist/session.js +0 -602
  197. package/dist/session.js.map +0 -1
  198. package/dist/tools/alias-kit.d.ts +0 -29
  199. package/dist/tools/alias-kit.d.ts.map +0 -1
  200. package/dist/tools/alias-kit.js +0 -21
  201. package/dist/tools/alias-kit.js.map +0 -1
  202. package/dist/tools/aliases.d.ts +0 -42
  203. package/dist/tools/aliases.d.ts.map +0 -1
  204. package/dist/tools/aliases.js +0 -52
  205. package/dist/tools/aliases.js.map +0 -1
  206. package/dist/tools/analyze-workspace.d.ts +0 -52
  207. package/dist/tools/analyze-workspace.d.ts.map +0 -1
  208. package/dist/tools/analyze-workspace.js +0 -207
  209. package/dist/tools/analyze-workspace.js.map +0 -1
  210. package/dist/tools/analyze.d.ts +0 -163
  211. package/dist/tools/analyze.d.ts.map +0 -1
  212. package/dist/tools/analyze.js +0 -724
  213. package/dist/tools/analyze.js.map +0 -1
  214. package/dist/tools/browser-click.d.ts +0 -18
  215. package/dist/tools/browser-click.d.ts.map +0 -1
  216. package/dist/tools/browser-click.js +0 -110
  217. package/dist/tools/browser-click.js.map +0 -1
  218. package/dist/tools/browser-close-session.d.ts +0 -39
  219. package/dist/tools/browser-close-session.d.ts.map +0 -1
  220. package/dist/tools/browser-close-session.js +0 -120
  221. package/dist/tools/browser-close-session.js.map +0 -1
  222. package/dist/tools/browser-fill.d.ts +0 -18
  223. package/dist/tools/browser-fill.d.ts.map +0 -1
  224. package/dist/tools/browser-fill.js +0 -117
  225. package/dist/tools/browser-fill.js.map +0 -1
  226. package/dist/tools/browser-navigate.d.ts +0 -15
  227. package/dist/tools/browser-navigate.d.ts.map +0 -1
  228. package/dist/tools/browser-navigate.js +0 -104
  229. package/dist/tools/browser-navigate.js.map +0 -1
  230. package/dist/tools/browser-read.d.ts +0 -33
  231. package/dist/tools/browser-read.d.ts.map +0 -1
  232. package/dist/tools/browser-read.js +0 -113
  233. package/dist/tools/browser-read.js.map +0 -1
  234. package/dist/tools/browser-run-scenario.d.ts +0 -28
  235. package/dist/tools/browser-run-scenario.d.ts.map +0 -1
  236. package/dist/tools/browser-run-scenario.js +0 -206
  237. package/dist/tools/browser-run-scenario.js.map +0 -1
  238. package/dist/tools/browser-save-scenario.d.ts +0 -19
  239. package/dist/tools/browser-save-scenario.d.ts.map +0 -1
  240. package/dist/tools/browser-save-scenario.js +0 -447
  241. package/dist/tools/browser-save-scenario.js.map +0 -1
  242. package/dist/tools/browser-select.d.ts +0 -20
  243. package/dist/tools/browser-select.d.ts.map +0 -1
  244. package/dist/tools/browser-select.js +0 -120
  245. package/dist/tools/browser-select.js.map +0 -1
  246. package/dist/tools/browser-snapshot.d.ts +0 -46
  247. package/dist/tools/browser-snapshot.d.ts.map +0 -1
  248. package/dist/tools/browser-snapshot.js +0 -127
  249. package/dist/tools/browser-snapshot.js.map +0 -1
  250. package/dist/tools/browser-start-session.d.ts +0 -24
  251. package/dist/tools/browser-start-session.d.ts.map +0 -1
  252. package/dist/tools/browser-start-session.js +0 -622
  253. package/dist/tools/browser-start-session.js.map +0 -1
  254. package/dist/tools/browser-submit.d.ts +0 -18
  255. package/dist/tools/browser-submit.d.ts.map +0 -1
  256. package/dist/tools/browser-submit.js +0 -106
  257. package/dist/tools/browser-submit.js.map +0 -1
  258. package/dist/tools/browser-type.d.ts +0 -18
  259. package/dist/tools/browser-type.d.ts.map +0 -1
  260. package/dist/tools/browser-type.js +0 -115
  261. package/dist/tools/browser-type.js.map +0 -1
  262. package/dist/tools/browser-wait-for.d.ts +0 -45
  263. package/dist/tools/browser-wait-for.d.ts.map +0 -1
  264. package/dist/tools/browser-wait-for.js +0 -150
  265. package/dist/tools/browser-wait-for.js.map +0 -1
  266. package/dist/tools/browser.d.ts +0 -69
  267. package/dist/tools/browser.d.ts.map +0 -1
  268. package/dist/tools/browser.js +0 -386
  269. package/dist/tools/browser.js.map +0 -1
  270. package/dist/tools/chain.d.ts +0 -41
  271. package/dist/tools/chain.d.ts.map +0 -1
  272. package/dist/tools/chain.js +0 -105
  273. package/dist/tools/chain.js.map +0 -1
  274. package/dist/tools/change-scope.d.ts +0 -25
  275. package/dist/tools/change-scope.d.ts.map +0 -1
  276. package/dist/tools/change-scope.js +0 -110
  277. package/dist/tools/change-scope.js.map +0 -1
  278. package/dist/tools/code-context.d.ts +0 -83
  279. package/dist/tools/code-context.d.ts.map +0 -1
  280. package/dist/tools/code-context.js +0 -416
  281. package/dist/tools/code-context.js.map +0 -1
  282. package/dist/tools/contracts.d.ts +0 -74
  283. package/dist/tools/contracts.d.ts.map +0 -1
  284. package/dist/tools/contracts.js +0 -196
  285. package/dist/tools/contracts.js.map +0 -1
  286. package/dist/tools/cross-pr.d.ts +0 -178
  287. package/dist/tools/cross-pr.d.ts.map +0 -1
  288. package/dist/tools/cross-pr.js +0 -321
  289. package/dist/tools/cross-pr.js.map +0 -1
  290. package/dist/tools/disclosure.d.ts +0 -75
  291. package/dist/tools/disclosure.d.ts.map +0 -1
  292. package/dist/tools/disclosure.js +0 -288
  293. package/dist/tools/disclosure.js.map +0 -1
  294. package/dist/tools/draw-conclusion.d.ts +0 -55
  295. package/dist/tools/draw-conclusion.d.ts.map +0 -1
  296. package/dist/tools/draw-conclusion.js +0 -259
  297. package/dist/tools/draw-conclusion.js.map +0 -1
  298. package/dist/tools/git-context.d.ts +0 -39
  299. package/dist/tools/git-context.d.ts.map +0 -1
  300. package/dist/tools/git-context.js +0 -364
  301. package/dist/tools/git-context.js.map +0 -1
  302. package/dist/tools/git-diff.d.ts +0 -45
  303. package/dist/tools/git-diff.d.ts.map +0 -1
  304. package/dist/tools/git-diff.js +0 -338
  305. package/dist/tools/git-diff.js.map +0 -1
  306. package/dist/tools/git-history.d.ts +0 -16
  307. package/dist/tools/git-history.d.ts.map +0 -1
  308. package/dist/tools/git-history.js +0 -86
  309. package/dist/tools/git-history.js.map +0 -1
  310. package/dist/tools/history.d.ts +0 -34
  311. package/dist/tools/history.d.ts.map +0 -1
  312. package/dist/tools/history.js +0 -121
  313. package/dist/tools/history.js.map +0 -1
  314. package/dist/tools/impact.d.ts +0 -46
  315. package/dist/tools/impact.d.ts.map +0 -1
  316. package/dist/tools/impact.js +0 -225
  317. package/dist/tools/impact.js.map +0 -1
  318. package/dist/tools/index.d.ts +0 -59
  319. package/dist/tools/index.d.ts.map +0 -1
  320. package/dist/tools/index.js +0 -70
  321. package/dist/tools/index.js.map +0 -1
  322. package/dist/tools/kit.d.ts +0 -165
  323. package/dist/tools/kit.d.ts.map +0 -1
  324. package/dist/tools/kit.js +0 -153
  325. package/dist/tools/kit.js.map +0 -1
  326. package/dist/tools/link-workspace.d.ts +0 -24
  327. package/dist/tools/link-workspace.d.ts.map +0 -1
  328. package/dist/tools/link-workspace.js +0 -131
  329. package/dist/tools/link-workspace.js.map +0 -1
  330. package/dist/tools/lookup.d.ts +0 -19
  331. package/dist/tools/lookup.d.ts.map +0 -1
  332. package/dist/tools/lookup.js +0 -63
  333. package/dist/tools/lookup.js.map +0 -1
  334. package/dist/tools/mark-incident.d.ts +0 -28
  335. package/dist/tools/mark-incident.d.ts.map +0 -1
  336. package/dist/tools/mark-incident.js +0 -188
  337. package/dist/tools/mark-incident.js.map +0 -1
  338. package/dist/tools/merged-browser.d.ts +0 -11
  339. package/dist/tools/merged-browser.d.ts.map +0 -1
  340. package/dist/tools/merged-browser.js +0 -20
  341. package/dist/tools/merged-browser.js.map +0 -1
  342. package/dist/tools/merged-context.d.ts +0 -11
  343. package/dist/tools/merged-context.d.ts.map +0 -1
  344. package/dist/tools/merged-context.js +0 -21
  345. package/dist/tools/merged-context.js.map +0 -1
  346. package/dist/tools/merged-observe.d.ts +0 -13
  347. package/dist/tools/merged-observe.d.ts.map +0 -1
  348. package/dist/tools/merged-observe.js +0 -21
  349. package/dist/tools/merged-observe.js.map +0 -1
  350. package/dist/tools/merged-workspace.d.ts +0 -14
  351. package/dist/tools/merged-workspace.d.ts.map +0 -1
  352. package/dist/tools/merged-workspace.js +0 -21
  353. package/dist/tools/merged-workspace.js.map +0 -1
  354. package/dist/tools/observe-runtime.d.ts +0 -250
  355. package/dist/tools/observe-runtime.d.ts.map +0 -1
  356. package/dist/tools/observe-runtime.js +0 -1753
  357. package/dist/tools/observe-runtime.js.map +0 -1
  358. package/dist/tools/observe-tests.d.ts +0 -57
  359. package/dist/tools/observe-tests.d.ts.map +0 -1
  360. package/dist/tools/observe-tests.js +0 -368
  361. package/dist/tools/observe-tests.js.map +0 -1
  362. package/dist/tools/observe.d.ts +0 -28
  363. package/dist/tools/observe.d.ts.map +0 -1
  364. package/dist/tools/observe.js +0 -330
  365. package/dist/tools/observe.js.map +0 -1
  366. package/dist/tools/pr-analysis.d.ts +0 -189
  367. package/dist/tools/pr-analysis.d.ts.map +0 -1
  368. package/dist/tools/pr-analysis.js +0 -299
  369. package/dist/tools/pr-analysis.js.map +0 -1
  370. package/dist/tools/pre-push.d.ts +0 -168
  371. package/dist/tools/pre-push.d.ts.map +0 -1
  372. package/dist/tools/pre-push.js +0 -416
  373. package/dist/tools/pre-push.js.map +0 -1
  374. package/dist/tools/predict-reach.d.ts +0 -57
  375. package/dist/tools/predict-reach.d.ts.map +0 -1
  376. package/dist/tools/predict-reach.js +0 -159
  377. package/dist/tools/predict-reach.js.map +0 -1
  378. package/dist/tools/propagation.d.ts +0 -37
  379. package/dist/tools/propagation.d.ts.map +0 -1
  380. package/dist/tools/propagation.js +0 -162
  381. package/dist/tools/propagation.js.map +0 -1
  382. package/dist/tools/propose-journey.d.ts +0 -16
  383. package/dist/tools/propose-journey.d.ts.map +0 -1
  384. package/dist/tools/propose-journey.js +0 -121
  385. package/dist/tools/propose-journey.js.map +0 -1
  386. package/dist/tools/prove-reach.d.ts +0 -74
  387. package/dist/tools/prove-reach.d.ts.map +0 -1
  388. package/dist/tools/prove-reach.js +0 -286
  389. package/dist/tools/prove-reach.js.map +0 -1
  390. package/dist/tools/questions.d.ts +0 -30
  391. package/dist/tools/questions.d.ts.map +0 -1
  392. package/dist/tools/questions.js +0 -232
  393. package/dist/tools/questions.js.map +0 -1
  394. package/dist/tools/refusal-fetch.d.ts +0 -35
  395. package/dist/tools/refusal-fetch.d.ts.map +0 -1
  396. package/dist/tools/refusal-fetch.js +0 -103
  397. package/dist/tools/refusal-fetch.js.map +0 -1
  398. package/dist/tools/runtime-incident.d.ts +0 -33
  399. package/dist/tools/runtime-incident.d.ts.map +0 -1
  400. package/dist/tools/runtime-incident.js +0 -67
  401. package/dist/tools/runtime-incident.js.map +0 -1
  402. package/dist/tools/runtime-journey-drive.d.ts +0 -102
  403. package/dist/tools/runtime-journey-drive.d.ts.map +0 -1
  404. package/dist/tools/runtime-journey-drive.js +0 -247
  405. package/dist/tools/runtime-journey-drive.js.map +0 -1
  406. package/dist/tools/scope.d.ts +0 -45
  407. package/dist/tools/scope.d.ts.map +0 -1
  408. package/dist/tools/scope.js +0 -186
  409. package/dist/tools/scope.js.map +0 -1
  410. package/dist/tools/similar-incidents.d.ts +0 -43
  411. package/dist/tools/similar-incidents.d.ts.map +0 -1
  412. package/dist/tools/similar-incidents.js +0 -179
  413. package/dist/tools/similar-incidents.js.map +0 -1
  414. package/dist/tools/validate.d.ts +0 -133
  415. package/dist/tools/validate.d.ts.map +0 -1
  416. package/dist/tools/validate.js +0 -442
  417. package/dist/tools/validate.js.map +0 -1
  418. package/dist/tools/verb.d.ts +0 -46
  419. package/dist/tools/verb.d.ts.map +0 -1
  420. package/dist/tools/verb.js +0 -78
  421. package/dist/tools/verb.js.map +0 -1
  422. package/dist/tools/verification-status.d.ts +0 -38
  423. package/dist/tools/verification-status.d.ts.map +0 -1
  424. package/dist/tools/verification-status.js +0 -203
  425. package/dist/tools/verification-status.js.map +0 -1
  426. package/dist/tools/verify-claim.d.ts +0 -29
  427. package/dist/tools/verify-claim.d.ts.map +0 -1
  428. package/dist/tools/verify-claim.js +0 -220
  429. package/dist/tools/verify-claim.js.map +0 -1
  430. package/dist/tools/workspace.d.ts +0 -28
  431. package/dist/tools/workspace.d.ts.map +0 -1
  432. package/dist/tools/workspace.js +0 -101
  433. package/dist/tools/workspace.js.map +0 -1
  434. package/dist/transport.d.ts +0 -32
  435. package/dist/transport.d.ts.map +0 -1
  436. package/dist/transport.js +0 -85
  437. package/dist/transport.js.map +0 -1
  438. package/dist/workspace-index.d.ts +0 -164
  439. package/dist/workspace-index.d.ts.map +0 -1
  440. package/dist/workspace-index.js +0 -381
  441. package/dist/workspace-index.js.map +0 -1
package/dist/server.js DELETED
@@ -1,541 +0,0 @@
1
- /**
2
- * The MCP server: handshake, tool listing, tool calls, streaming narration.
3
- *
4
- * ## The layering that makes this testable without a pipe
5
- *
6
- * `dispatch` takes a line of text and a `send`, and that is the whole surface.
7
- * The stdio transport is a loop around it; a test is a call to it. So the
8
- * handshake, the error frames and the progress notifications are all covered by
9
- * ordinary unit tests rather than by spawning a process and hoping.
10
- *
11
- * ## Streaming narration — §22.2's primary UX, at the protocol level
12
- *
13
- * A developer asking a question in their editor and watching the work happen is
14
- * the most-used delivery path in the architecture. MCP's mechanism is
15
- * `notifications/progress`, sent only when the request carried a
16
- * `_meta.progressToken`. Tools call `ctx.progress(...)` unconditionally and this
17
- * layer decides whether anyone is listening — the alternative, tools checking
18
- * first, is how narration ends up in some code paths and not others.
19
- *
20
- * ## Every tool failure is a *tool* result, not a protocol error
21
- *
22
- * The spec is explicit and the reason is practical: a JSON-RPC error is for a
23
- * malformed request, and an agent that receives one has nothing to reason about.
24
- * A bad argument, a missing graph, an unreadable repository — those come back as
25
- * content with `isError`, which the model can read and act on. Only genuinely
26
- * broken protocol produces an error frame.
27
- */
28
- import { randomUUID } from "node:crypto";
29
- import { resolveActionDispatch } from "./action-handshake.js";
30
- import { TOOL_ALIASES } from "./tools/aliases.js";
31
- import { fail, isRequest, negotiateVersion, ok, parseMessage, ProtocolError, RPC_INTERNAL_ERROR, RPC_INVALID_PARAMS, RPC_METHOD_NOT_FOUND, } from "./protocol.js";
32
- import { renderAnswer, renderFailed, renderHandshake, renderRefusedInput, renderTimedOut, renderToolError, TOOL_OUTPUT_SCHEMA, } from "./render.js";
33
- import { createDisclosureLedger } from "./disclosure-ledger.js";
34
- import { checkConfigDrift, ConfigError } from "./session.js";
35
- import { TOOLS, TOOLS_BY_NAME, ToolInputError, } from "./tools/index.js";
36
- /** Every call's declared budget (§6). Fixed today; per-trigger budgets are P26/P28 work. */
37
- const CALL_BUDGET_MS = 15 * 60 * 1000;
38
- function isAbort(error) {
39
- return ((error instanceof Error && error.name === "AbortError") ||
40
- (typeof DOMException !== "undefined" && error instanceof DOMException && error.name === "TimeoutError"));
41
- }
42
- /**
43
- * The stored graph's stamp, for a caller that has no `result` to read it from
44
- * — a refusal, a failure, a timeout, or a handshake mint (F3, UAT Phase 5).
45
- *
46
- * Read defensively, never folded into `renderOptions()` unconditionally: a
47
- * graph in a state `baseStamp()` cannot read (a stale schema version, MK-4)
48
- * must not turn a graceful refusal into a thrown error. `try`/`catch` to
49
- * `undefined` here, exactly as `renderHandshake`'s call site already did
50
- * before this helper existed, so `renderRefusedInput`/`renderFailed`/
51
- * `renderTimedOut` can stop hardcoding "no graph" regardless of what is
52
- * actually stored, without reopening that already-reverted failure mode.
53
- */
54
- function readGraphStampSafely(session) {
55
- try {
56
- return session.provider().baseStamp();
57
- }
58
- catch {
59
- return undefined;
60
- }
61
- }
62
- /** A schema's own declared top-level argument names — empty when it has none, or when the
63
- * schema isn't the `{ properties: {...} }` shape every tool's `inputSchema` actually is. */
64
- function declaredTopLevelProperties(schema) {
65
- const props = schema["properties"];
66
- return typeof props === "object" && props !== null ? Object.keys(props) : [];
67
- }
68
- /** UAT phase 5, F12: which top-level keys in `args` this schema does not declare. Only meaningful
69
- * when the schema opts into `additionalProperties: false` — the promise every tool's `SCHEMA`
70
- * already makes (asserted across the registry by `tool-input-schema-gate.test.ts`) and that
71
- * nothing enforced before this check existed. Shape only: whether a key exists, never what it
72
- * means — a tool's own `requiredString`/`optionalEnum`/etc. still reads and validates the value. */
73
- function unknownArgumentKeys(schema, args) {
74
- if (schema["additionalProperties"] !== false)
75
- return [];
76
- const known = new Set(declaredTopLevelProperties(schema));
77
- return Object.keys(args).filter((key) => !known.has(key));
78
- }
79
- /**
80
- * Does this frame have to jump the transport's ordering queue?
81
- *
82
- * True for `notifications/cancelled` and nothing else. Exported because the
83
- * stdio runner needs the answer and the knowledge of what MCP methods mean
84
- * belongs here, not in a module that otherwise only knows about bytes. Never
85
- * throws — a line that will not parse is the dispatcher's to reject, with the
86
- * error frame it already knows how to build.
87
- */
88
- export function isOutOfBand(line) {
89
- try {
90
- const message = JSON.parse(line);
91
- if (typeof message !== "object" || message === null || Array.isArray(message))
92
- return false;
93
- const frame = message;
94
- // A *request* named `notifications/cancelled` is malformed, not a
95
- // cancellation. Letting it jump the queue would answer it out of order,
96
- // which is the exact hazard the ordering exists to prevent.
97
- return frame["method"] === "notifications/cancelled" && frame["id"] === undefined;
98
- }
99
- catch {
100
- return false;
101
- }
102
- }
103
- const SERVER_INSTRUCTIONS = "Descry reads the repository's source into a code graph and answers questions about it.\n\n" +
104
- "Call `analyze` first — every other tool queries the graph it builds, and a stale graph " +
105
- "answers about code that has changed.\n\n" +
106
- "Every reply has a `state`, one of five, and they are different claims: `ok` (found " +
107
- "something), `empty` (looked completely, found nothing — a fact about your code), `refused` " +
108
- "(could not look — a fact about Descry, never about your code), `failed` (something broke) " +
109
- "and `timed_out` (ran out of its time budget, partial answer). A tool that answered `[]` for " +
110
- "both \"nothing matched\" and \"I could not look\" would teach a false fact with no way to " +
111
- "detect it — that is why these are distinct. Never read `refused` as \"clean\" or `empty` as " +
112
- "\"broken\".\n\n" +
113
- "**One case is not an answer at all and has its own shape**: a call naming no tool this " +
114
- "server has — `name` is not a string, or names nothing in the registry — comes back with " +
115
- "`isError: true` and `{ tool, status: \"error\", message }`, carrying no `state`, no `graph` " +
116
- "and no `disclosures`. There is no `state` because there is no tool to say `state` about. " +
117
- "This is narrower than it once was: a *resolved* tool given bad input — a missing required " +
118
- "field, a value of the wrong type — is a fact about that tool's call and comes back as a " +
119
- "real `state: \"refused\"` reply instead, with `disclosures` naming what was wrong. Branch " +
120
- "on `isError` before reading `state` regardless — a caller that only ever sees the second, " +
121
- "unresolved-tool shape in testing will still be surprised by it in production.\n\n" +
122
- "Every reply also carries a `disclosures` list, a `resolutionFloor` and a `reliabilityCap` " +
123
- "(A, B or C) inside `graph`. `resolutionFloor` is how much tooling actually ran under the " +
124
- "weakest evidence behind the answer, R0 through R4: R0 is syntax only, nothing resolved; R1 " +
125
- "adds module/import resolution; R2 adds cross-file reference resolution (which symbol a name " +
126
- "refers to, but no type checker); R3 adds a type checker, so claims about shapes are provable; " +
127
- "R4 means the fact was observed at runtime rather than inferred. `reliabilityCap` is what that " +
128
- "floor permits the claim to be relayed as: C means the claim is a behavioural prediction that " +
129
- "has not been confirmed by running anything, and must not be relayed as fact. B means the " +
130
- "claim rests on structural or reference resolution — a name, an import, a call target — real " +
131
- "evidence, but not yet a confirmed behaviour. A means the claim is as strong as this graph can " +
132
- "make it: a name-level fact resolved at R2 or better, a shape-level fact backed by a type " +
133
- "checker (R3), or anything witnessed at runtime (R4, unconditional). Read the disclosures " +
134
- "before summarising — they say what the answer does *not* cover.\n\n" +
135
- "Coverage is a separate question from confidence: call `verification_status` with a list of " +
136
- "node ids or file paths from an earlier reply to learn which of them the graph actually " +
137
- "reached, and at what resolution, rather than assuming silence means untested. `refusal_fetch` " +
138
- "gives the graph's full ledger of things an adapter could not resolve — call it with no " +
139
- "arguments for a one-line summary and a handle, then again with that handle to page through " +
140
- "every row; never assume the summary's one exemplar is the only refusal.\n\n" +
141
- "`class` on each tool (`read`, `stateful-read` or `action`) says whether it is safe to retry. " +
142
- "The one `action`-class tool (`questions`, when answering) takes a two-call handshake: the " +
143
- "first call performs nothing and returns a confirmation token; only a second call presenting " +
144
- "that exact token performs the write.\n\n" +
145
- "`tier` on each tool is `conclusion` for the three that already state a verdict about your " +
146
- "code (`validate`, `contracts`, `cross_pr` — quote their `headline` verbatim rather than " +
147
- "rephrasing it) or `evidence` for the other thirteen, which return graph facts for you to " +
148
- "reason over yourself. Every reply also carries `reportCategory` — one of `confirmed`, " +
149
- "`strongly supported`, `unconfirmed`, `not analysable`, `unsupported`, or `null` where no " +
150
- "claim applies. It is `null` on every `conclusion`-tier reply (the `headline` already states " +
151
- "the verdict in plain words). On an `evidence`-tier reply it follows that reply's own " +
152
- "`resolutionFloor`: `unconfirmed` below R4, where nothing was observed, and `strongly " +
153
- "supported` at R4, where every hop behind the answer was witnessed in a real run — " +
154
- "`observe_runtime` and `observe_tests` are what write those edges. `confirmed` never appears " +
155
- "here — that word is reserved for results that passed the full governance pipeline, and its " +
156
- "absence is honest, not a bug.\n\n" +
157
- "Beside it, `existenceCategory` answers a different question, and the two are not " +
158
- "interchangeable. `reportCategory` says how strongly the *cause* may be stated and is capped " +
159
- "by how well the code resolved; `existenceCategory` says how strongly the evidence shows the " +
160
- "failure is *real*, and never reads the resolution at all. They separate exactly where it " +
161
- "matters: a reply that witnessed a failure on three channels but resolved no code path " +
162
- "reports `unconfirmed` for the cause and `strongly supported` for the failure. Read that as " +
163
- "*something is wrong and we could not tell you where* — not as *nothing is wrong*. It is " +
164
- "`null` wherever no evidence reading was taken at all: conclusion-tier replies, faults, and " +
165
- "refusals, since a refusal is a fact about Descry rather than about your code. `provenance` names " +
166
- "this surface explicitly (`adjudicatedBy: \"descry\"`, `presentedBy: \"host-agent\"`) so a " +
167
- "reply from here is never mistaken for one the app itself adjudicated and presented.\n\n" +
168
- "In agent mode, Descry gives you high-reliability facts about your code. It does not give you " +
169
- "confirmed behaviour, because it did not run your application — `descry-runtime`'s live loop " +
170
- "does not execute inside an MCP call, at any resolution level or however careful the static " +
171
- "analysis was. `confirmed` and `strongly supported` are the desktop app's differentiator, not " +
172
- "this surface's; treat every reply here as a strong lead to verify, never as a closed case.\n\n" +
173
- "Descry cannot enforce any of this once you leave this server: nothing stops you from adding " +
174
- "your own claims on top of what a tool returned (the fact boundary), and nothing stops you " +
175
- "from investigating paths no tool surfaced or suggested (the candidate boundary) — this text " +
176
- "cannot make you not do either. The fields above exist so you do not have to guess.";
177
- export function createMcpServer(options) {
178
- const session = options.session;
179
- const serverName = options.name ?? "descry";
180
- const serverVersion = options.version ?? "0.0.0";
181
- // One per connection, living exactly as long as this server — see
182
- // `disclosure-ledger.ts` for why it is not shared across connections.
183
- const disclosureLedger = createDisclosureLedger();
184
- let initialized = false;
185
- const tools = options.tools ?? TOOLS;
186
- const toolsByName = options.tools === undefined
187
- ? TOOLS_BY_NAME
188
- : new Map(options.tools.map((tool) => [tool.name, tool]));
189
- /**
190
- * In-flight `tools/call`s, by request id, so `notifications/cancelled` has
191
- * something to act on. Entries live exactly as long as the call: added
192
- * before `tool.run`, removed in the `finally` that also drops the call's
193
- * progress tick.
194
- */
195
- const pending = new Map();
196
- async function handleRequest(request, transport) {
197
- const { id, method } = request;
198
- const params = request.params ?? {};
199
- switch (method) {
200
- case "initialize": {
201
- transport.send(ok(id, {
202
- protocolVersion: negotiateVersion(params["protocolVersion"]),
203
- // `listChanged: false` is honest: the tool set is fixed at startup,
204
- // so the server will never send a list-changed notification and
205
- // should not claim it might.
206
- capabilities: { tools: { listChanged: false } },
207
- serverInfo: { name: serverName, version: serverVersion },
208
- instructions: SERVER_INSTRUCTIONS,
209
- }));
210
- return;
211
- }
212
- case "ping": {
213
- transport.send(ok(id, {}));
214
- return;
215
- }
216
- case "tools/list": {
217
- transport.send(ok(id, {
218
- tools: tools.map((tool) => ({
219
- name: tool.name,
220
- title: tool.title,
221
- description: tool.description,
222
- inputSchema: tool.inputSchema,
223
- // ai-tool-contract.md §8: every endpoint declares a class, and an
224
- // external client has no other way to read it — §6's retry table
225
- // (read=retryable, stateful-read=idempotent-retryable,
226
- // action=no-retry+handshake-required) is meaningless without this
227
- // on the wire.
228
- class: tool.class,
229
- // MK-5: whether this tool's output is a conclusion about the
230
- // user's code or a fact about the graph — same "no other way to
231
- // read it" reasoning as `class`, one line up.
232
- tier: tool.tier,
233
- toolVersion: tool.version,
234
- // Every reply this server sends carries a `structuredContent`
235
- // envelope, and without this a host has no way to validate one.
236
- // Shared across all tools because the envelope is: see
237
- // `TOOL_OUTPUT_SCHEMA`, including why `data` is left open.
238
- outputSchema: TOOL_OUTPUT_SCHEMA,
239
- })),
240
- }));
241
- return;
242
- }
243
- case "tools/call": {
244
- const result = await callTool(id, params, transport);
245
- // `null` means the call was cancelled while it ran. MCP forbids a
246
- // response to a cancelled request, so the only correct frame here is
247
- // no frame at all.
248
- if (result !== null)
249
- transport.send(ok(id, result));
250
- return;
251
- }
252
- default:
253
- transport.send(fail(id, RPC_METHOD_NOT_FOUND, `unknown method: ${method}`));
254
- }
255
- }
256
- async function callTool(id, params, transport) {
257
- const name = params["name"];
258
- if (typeof name !== "string") {
259
- return renderToolError("tools/call", '"name" must be a string');
260
- }
261
- // A retired name is resolved here and nowhere else: `tools/list` never
262
- // offered it (see `tools/aliases.ts`), so only a caller holding an old
263
- // name in a config or a script can arrive with one. `aliasedTo` is
264
- // threaded into `renderOptions` so the reply says which name answered.
265
- const direct = toolsByName.get(name);
266
- const alias = direct === undefined ? TOOL_ALIASES.get(name) : undefined;
267
- const tool = direct ?? (alias === undefined ? undefined : toolsByName.get(alias.to));
268
- if (tool === undefined) {
269
- return renderToolError(name, `no such tool. Available: ${tools.map((t) => t.name).join(", ")}.`);
270
- }
271
- // `tool` is resolved from here on, so any input failure below has a real
272
- // `ToolDefinition` to render a `state: "refused"` envelope from
273
- // (`renderRefusedInput`) rather than `renderToolError`'s bare shape —
274
- // minted here, ahead of the args check, so both that check and a
275
- // `ToolInputError` thrown later out of `tool.run` share the one
276
- // `renderOptions()`. Same precedent as B10's `callId`: a call that never
277
- // reaches `tool.run` still gets one minted (`renderFailed`/`renderTimedOut`
278
- // already do this for every call but `verify_claim`), and is never passed
279
- // to `session.recordCallWithId` below, so no gap opens in what a citation
280
- // can resolve.
281
- const started = Date.now();
282
- const callId = name === "verify_claim" ? randomUUID() : session.allocateCallId();
283
- // 13.3.16 (N2) steps 2-3: checked once per call, ahead of dispatch, so every
284
- // reply this call produces — ok, refused, failed or timed out — carries the
285
- // same disclosure and the same `configStale` flag, not only `analyze`'s.
286
- const configDrift = await checkConfigDrift(session);
287
- const renderOptions = () => ({
288
- toolVersion: tool.version,
289
- toolClass: tool.class,
290
- toolTier: tool.tier,
291
- elapsedMs: Date.now() - started,
292
- limitMs: CALL_BUDGET_MS,
293
- disclosureLedger,
294
- callId,
295
- configDrift,
296
- ...(alias === undefined ? {} : { aliasedFrom: name, aliasedTo: tool.name }),
297
- });
298
- const rawArgs = params["arguments"];
299
- if (rawArgs !== undefined && (typeof rawArgs !== "object" || rawArgs === null || Array.isArray(rawArgs))) {
300
- const graphStamp = readGraphStampSafely(session);
301
- return renderRefusedInput(name, '"arguments" must be an object', {
302
- ...renderOptions(),
303
- ...(graphStamp === undefined ? {} : { graphStamp }),
304
- });
305
- }
306
- const rewritten = (rawArgs ?? {});
307
- // The old call shape becomes the new one before any gate reads it, so the
308
- // schema check below is run against the tool that will actually answer.
309
- const args = alias?.args === undefined ? rewritten : alias.args(rewritten);
310
- // UAT phase 5, F12: `inputSchema` is advertised in `tools/list` and never read
311
- // again — every tool hand-reads the keys it knows, so an unknown argument was
312
- // silently ignored rather than refused (`contracts({ symbol: ... })` returning
313
- // the whole-repo report; `browser_start_session({ profile: ... })` issuing the
314
- // wrong consent because the tool reads `environment`). Checked here, once, for
315
- // every tool that declares `additionalProperties: false` — which is all of
316
- // them (asserted by tool-input-schema-gate.test.ts) — before dispatch, so a
317
- // typo'd or misremembered key refuses loudly instead of vanishing. This is
318
- // shape only: which keys exist, not what they mean — each tool's own
319
- // `requiredString`/`optionalEnum`/etc. still checks that.
320
- const unknownArgs = unknownArgumentKeys(tool.inputSchema, args);
321
- if (unknownArgs.length > 0) {
322
- const known = declaredTopLevelProperties(tool.inputSchema);
323
- return renderRefusedInput(name, `unknown argument(s): ${unknownArgs.map((k) => `"${k}"`).join(", ")}. ` +
324
- (known.length > 0 ? `${name} accepts: ${known.join(", ")}.` : `${name} takes no arguments.`), renderOptions());
325
- }
326
- const meta = params["_meta"];
327
- const token = typeof meta === "object" && meta !== null
328
- ? meta["progressToken"]
329
- : undefined;
330
- const progress = typeof token === "string" || typeof token === "number"
331
- ? (message, current, total) => {
332
- transport.send({
333
- jsonrpc: "2.0",
334
- method: "notifications/progress",
335
- params: {
336
- progressToken: token,
337
- // `progress` is required by the spec and must increase. When a
338
- // tool narrates without a count, the message is the payload and
339
- // the number is a monotonic tick rather than a fake percentage.
340
- progress: current ?? nextTick(id),
341
- ...(total === undefined ? {} : { total }),
342
- message,
343
- },
344
- });
345
- }
346
- : () => { };
347
- // Two ways a call ends early, composed into the one signal the tool sees:
348
- // its own budget running out, and the client asking for it to stop.
349
- //
350
- // **What this does and does not buy.** Aborting here stops the *server*
351
- // waiting and suppresses the response the client is no longer listening
352
- // for, which is the protocol's requirement and is met. It stops the actual
353
- // work only in a tool that reads the signal it is handed, and today that is
354
- // exactly one of thirty-three — `analyze`, which passes `ctx.signal` down. The
355
- // other thirty-two, `browser_run_scenario` and `observe_runtime` among
356
- // them, take the signal and never look at it, so a cancelled call there
357
- // leaves a real browser or a real application process running until it
358
- // finishes on its own. That is a disclosed gap, filed as
359
- // `DEC-NEXT-cancellation-reaches-one-tool-in-thirty.md`, not something this
360
- // layer can fix from here — threading the signal is each tool's own work.
361
- const controller = new AbortController();
362
- pending.set(id, controller);
363
- const ctx = {
364
- session,
365
- progress,
366
- signal: AbortSignal.any([controller.signal, AbortSignal.timeout(CALL_BUDGET_MS)]),
367
- };
368
- // B10: `started`/`callId`/`renderOptions` are minted above, ahead of the
369
- // `arguments` shape check, so every envelope this call can produce
370
- // (refused, handshake, failed, timed-out, or a real answer) carries the
371
- // exact id `recordCallWithId` will file the record under below — a
372
- // caller reading `callId` off the reply and citing it in `verify_claim`
373
- // is citing the id that call is actually recorded as.
374
- //
375
- // `verify_claim` itself is the one exception, on the same reasoning as
376
- // its exclusion from recording just below: it produces no fact for a
377
- // later claim to cite, so its own `callId` is not drawn from the
378
- // session's call-id sequence at all — `session.allocateCallId()` is
379
- // reserved for calls that will actually be recorded under the id it
380
- // returns. Reusing it here would consume a real id `verify_claim` never
381
- // gets recorded under, opening a gap in the sequence a caller relies on
382
- // corresponding exactly to recorded calls.
383
- try {
384
- // §7's two-call handshake. Decided before any real work starts — a mint
385
- // has no I/O to time out on — so this sits outside the try/catch's
386
- // failure/timeout handling below, which is for `tool.run` alone.
387
- const dispatch = await resolveActionDispatch(tool, args, ctx);
388
- if (dispatch.kind === "handshake") {
389
- // A handshake mint has done no I/O yet, so falling back to "no stamp
390
- // known" on a read failure is exactly `renderHandshake`'s original,
391
- // already-correct behaviour, not a new silent failure — see
392
- // `readGraphStampSafely`'s own doc for why this is never folded into
393
- // `renderOptions()` unconditionally.
394
- const graphStamp = readGraphStampSafely(session);
395
- return renderHandshake(name, dispatch.token, dispatch.willDo, {
396
- ...renderOptions(),
397
- ...(graphStamp === undefined ? {} : { graphStamp }),
398
- });
399
- }
400
- const outcome = await tool.run(dispatch.args, ctx);
401
- // Cancelled while it was running, and it finished anyway — the client
402
- // stopped listening for this id, so the answer is dropped rather than
403
- // sent late. Not recorded on the session either: a fact the caller never
404
- // received must not become one a later `verify_claim` can cite.
405
- if (controller.signal.aborted)
406
- return null;
407
- // Re-checked here, not reused from the `configDrift` captured before
408
- // dispatch: `tool.run` is the one place `session.reloadConfig()` can be
409
- // called (§0 gap 2's `analyze({ reload: true })`), and a call that just
410
- // reloaded must not still report itself as stale — the drift it would
411
- // be reporting no longer exists by the time this line runs.
412
- const rendered = renderAnswer(name, outcome, {
413
- ...renderOptions(),
414
- configDrift: await checkConfigDrift(session),
415
- // Rule 7 on the redemption path: the handshake decided which arguments ran, so it is the
416
- // only thing that knows which of the caller's were dropped. Omitted entirely when nothing
417
- // was, so a correct two-call redemption reads exactly as it did before.
418
- ...(dispatch.discardedArgs === undefined ? {} : { discardedArgs: dispatch.discardedArgs }),
419
- });
420
- // MK-12: recorded after rendering, from the exact structuredContent the
421
- // host receives — not the pre-render outcome, which the host never
422
- // sees. `verify_claim` itself is excluded: it produces no fact for a
423
- // later claim to cite, only a verdict about other calls' facts.
424
- //
425
- // Recorded under `callId` — the same id `rendered.structuredContent`
426
- // already carries as `callId` — rather than a freshly minted one
427
- // (B10): the two must be the same value for a citation read off this
428
- // reply to resolve.
429
- if (name !== "verify_claim") {
430
- // B1: a tool that can be handed a credential says how it wants to be
431
- // remembered (`ToolDefinition.redactArgs`). Every other tool is
432
- // recorded exactly as it was called, as before.
433
- session.recordCallWithId(callId, name, tool.redactArgs === undefined ? args : tool.redactArgs(args), rendered.structuredContent);
434
- }
435
- return rendered;
436
- }
437
- catch (error) {
438
- // Cancellation is checked before anything else, including
439
- // `ToolInputError`: whatever the tool threw on its way out, the client
440
- // has told us it is not listening, and the spec is explicit that a
441
- // cancelled request gets no response at all.
442
- if (controller.signal.aborted)
443
- return null;
444
- const graphStamp = readGraphStampSafely(session);
445
- const optionsWithStamp = () => ({
446
- ...renderOptions(),
447
- ...(graphStamp === undefined ? {} : { graphStamp }),
448
- });
449
- if (error instanceof ToolInputError)
450
- return renderRefusedInput(name, error.message, optionsWithStamp());
451
- if (isAbort(error) || ctx.signal.aborted)
452
- return renderTimedOut(name, optionsWithStamp());
453
- // Anything else is a bug or an environment failure. It still comes back as
454
- // a tool result: an agent can retry or tell the user, whereas a protocol
455
- // error just ends the call with nothing it can use.
456
- const failureMessage = error instanceof Error ? error.message : String(error);
457
- // 13.3.5 Half A: a `ConfigError` is thrown with a full written reason
458
- // specifically so a caller can read it — giving it the generic
459
- // "X failed." headline and burying that reason in `disclosures` says
460
- // less than the error already said. An unexplained fault keeps the
461
- // opaque default `renderFailed` falls back to.
462
- return renderFailed(name, failureMessage, optionsWithStamp(), error instanceof ConfigError ? `${name} could not run: ${failureMessage}` : undefined);
463
- }
464
- finally {
465
- pending.delete(id);
466
- }
467
- }
468
- /**
469
- * Act on `notifications/cancelled`: abort the named call if it is still ours
470
- * and still running.
471
- *
472
- * Silence in every other case is deliberate and is what the spec asks for. A
473
- * cancellation racing a call that has already returned is ordinary client
474
- * behaviour, not an error — the client sent it before our response reached
475
- * it — and a notification cannot be answered anyway, so there is nowhere to
476
- * report a bad `requestId` even if one were worth reporting.
477
- */
478
- function cancel(params) {
479
- const requestId = params["requestId"];
480
- if (typeof requestId !== "string" && typeof requestId !== "number")
481
- return;
482
- const controller = pending.get(requestId);
483
- if (controller === undefined)
484
- return;
485
- const reason = params["reason"];
486
- controller.abort(new Error(typeof reason === "string" && reason !== ""
487
- ? `cancelled by client: ${reason}`
488
- : "cancelled by client"));
489
- }
490
- // Monotonic per-request tick for narration with no natural count.
491
- const ticks = new Map();
492
- function nextTick(id) {
493
- const next = (ticks.get(id) ?? 0) + 1;
494
- ticks.set(id, next);
495
- return next;
496
- }
497
- return {
498
- get initialized() {
499
- return initialized;
500
- },
501
- async dispatch(line, transport) {
502
- let message;
503
- try {
504
- message = parseMessage(line);
505
- }
506
- catch (error) {
507
- if (error instanceof ProtocolError) {
508
- // No usable id means no response is possible: JSON-RPC has nowhere to
509
- // put the answer, and inventing an id would put a frame on the wire
510
- // the client cannot correlate to anything it sent.
511
- if (error.id !== null)
512
- transport.send(fail(error.id, error.code, error.message));
513
- return;
514
- }
515
- throw error;
516
- }
517
- if (!isRequest(message)) {
518
- if (message.method === "notifications/initialized")
519
- initialized = true;
520
- else if (message.method === "notifications/cancelled")
521
- cancel(message.params ?? {});
522
- // Anything else — roots changed, and every notification a future spec
523
- // adds — is accepted and ignored. A notification must never be
524
- // answered, so silence on the wire is the protocol; silence *in
525
- // response* is what cancellation could not afford, which is why it is
526
- // the one handled above.
527
- return;
528
- }
529
- try {
530
- await handleRequest(message, transport);
531
- }
532
- catch (error) {
533
- transport.send(fail(message.id, error instanceof ToolInputError ? RPC_INVALID_PARAMS : RPC_INTERNAL_ERROR, error instanceof Error ? error.message : String(error)));
534
- }
535
- finally {
536
- ticks.delete(message.id);
537
- }
538
- },
539
- };
540
- }
541
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,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