@descryy/mcp 0.11.4 → 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 +7 -7
  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 -591
  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 -1518
  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 -151
  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 -39
  99. package/dist/capped.d.ts.map +0 -1
  100. package/dist/capped.js +0 -43
  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 -327
  149. package/dist/registry.js.map +0 -1
  150. package/dist/render.d.ts +0 -623
  151. package/dist/render.d.ts.map +0 -1
  152. package/dist/render.js +0 -968
  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 -651
  193. package/dist/server.js.map +0 -1
  194. package/dist/session.d.ts +0 -356
  195. package/dist/session.d.ts.map +0 -1
  196. package/dist/session.js +0 -779
  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 -225
  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 -640
  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 -444
  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 -370
  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 -307
  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 -385
  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 -106
  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 -262
  355. package/dist/tools/observe-runtime.d.ts.map +0 -1
  356. package/dist/tools/observe-runtime.js +0 -1901
  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 -374
  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 -123
  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 -217
  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 -203
  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 -520
  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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descryy/mcp",
3
- "version": "0.11.4",
3
+ "version": "0.11.5",
4
4
  "type": "module",
5
5
  "description": "Descry's MCP server: the agent-facing front door over the query layer. The stdio transport is JSON-RPC 2.0 by hand rather than seventeen packages of HTTP and OAuth. Twenty-one tools; most read the graph and nothing else. The @descryy dependencies are here for the three that do more: observe_runtime boots or attaches to a real application, observe_tests runs the project's own test suite, and the browser tools drive a real browser — each writing what it witnessed into the graph as R4 facts. @descryy/runtime-browser is declared below like the others. It is still imported by specifier at call time rather than statically — not because it is unpublished (it is not) but because that indirection is an injection seam real tests use to drive the settle logic against a fake module with no real browser involved; see playwright-driver.ts. A missing package, a missing Chromium binary, or an import failure each still returns a named, remediable refusal rather than a crash or an empty result.",
6
6
  "license": "MIT",
@@ -32,9 +32,6 @@
32
32
  "registry": "https://registry.npmjs.org",
33
33
  "access": "public"
34
34
  },
35
- "scripts": {
36
- "build": "tsc -b"
37
- },
38
35
  "devDependencies": {
39
36
  "pg": "8.13.1"
40
37
  },
@@ -44,14 +41,14 @@
44
41
  "@descryy/runtime-backend-observation": "0.3.6",
45
42
  "@descryy/runtime-browser": "0.4.8",
46
43
  "@descryy/runtime-contracts": "0.3.3",
47
- "@descryy/runtime-controller": "0.3.7",
44
+ "@descryy/runtime-controller": "0.3.8",
48
45
  "@descryy/runtime-database-observation": "0.4.8",
49
46
  "@descryy/runtime-environment-profile": "0.4.5",
50
47
  "@descryy/runtime-evidence-correlation": "0.4.9",
51
48
  "@descryy/runtime-evidence-store": "0.4.2",
52
49
  "@descryy/runtime-graph-correlator": "0.4.8",
53
50
  "@descryy/runtime-identity-grounding": "0.4.4",
54
- "@descryy/runtime-orchestrator": "0.4.8",
51
+ "@descryy/runtime-orchestrator": "0.4.9",
55
52
  "@descryy/runtime-test-runner": "0.4.9"
56
53
  },
57
54
  "optionalDependencies": {
@@ -74,5 +71,8 @@
74
71
  "@descryy/adapter-ruby": "0.5.2",
75
72
  "@descryy/adapter-rust": "0.5.1",
76
73
  "@descryy/adapter-swift": "0.5.2"
74
+ },
75
+ "scripts": {
76
+ "build": "tsc -b"
77
77
  }
78
- }
78
+ }
@@ -1,38 +0,0 @@
1
- /** Two-call action-tool handshake, §7/DEC-278. G5 doesn't run in MCP mode, so this replaces it —
2
- * the server owns both decision and state, holding the gate without client cooperation. A tool
3
- * opts in via `class: "action"` + `describeAction`. Token binds to call 1's exact args, is
4
- * single-use, expires in 5 minutes (a starting value), and any bad token throws
5
- * `ToolInputError` rather than a silent no-op.
6
- *
7
- * **Redemption runs the frozen args and says so when that cost the caller something.** It used
8
- * to ignore anything else supplied and disclose nothing, which is the "silently do less" rule 7
9
- * forbids: documenting a substitution in five tool descriptions does not make it not silent,
10
- * because the caller who gets it wrong is by definition the one who did not read them. So a
11
- * conflicting value is still discarded — the frozen args are the ones a human saw in `willDo`,
12
- * and honouring a value nobody confirmed would defeat the gate — but the keys dropped come back
13
- * on the dispatch and are disclosed by name in the reply.
14
- *
15
- * What is *not* a discard, and this is the whole difficulty: call 2 carrying only the token is
16
- * the documented normal path, and a client echoing the original args back alongside it is
17
- * equally correct. An omitted key used its frozen value; a re-sent identical key changed
18
- * nothing. Only a conflicting value is reported, or the disclosure would fire on every correct
19
- * call and be trained away before the one time it mattered. Ruled in
20
- * `DEC-NEXT-late-arguments-on-a-confirming-call.md`. */
21
- import { type ToolContext, type ToolDefinition } from "./tools/kit.ts";
22
- export type ActionDispatch = {
23
- readonly kind: "run";
24
- readonly args: Record<string, unknown>;
25
- /** Arguments the confirming call supplied that conflicted with the frozen ones and were
26
- * therefore not used. Present only on a redemption, and only when non-empty — every other
27
- * path discarded nothing and must say nothing. Rendered into the reply's `disclosures`. */
28
- readonly discardedArgs?: readonly string[];
29
- } | {
30
- readonly kind: "handshake";
31
- readonly token: string;
32
- readonly willDo: string;
33
- };
34
- /** Decides what a call should do, before any budget timer starts. `read`/`stateful-read` and an
35
- * ungated `action` call resolve to `{ kind: "run", args }`; an unconfirmed gated call resolves to
36
- * `{ kind: "handshake", token, willDo }`; a redeemed one runs the args captured at mint time. */
37
- export declare function resolveActionDispatch(tool: ToolDefinition, args: Record<string, unknown>, ctx: ToolContext): Promise<ActionDispatch>;
38
- //# sourceMappingURL=action-handshake.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-handshake.d.ts","sourceRoot":"","sources":["../src/action-handshake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;yDAmByD;AAIzD,OAAO,EAAkB,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAiCvF,MAAM,MAAM,cAAc,GACtB;IACE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC;;gGAE4F;IAC5F,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpF;;kGAEkG;AAClG,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,EAAE,WAAW,GACf,OAAO,CAAC,cAAc,CAAC,CAazB"}
@@ -1,127 +0,0 @@
1
- /** Two-call action-tool handshake, §7/DEC-278. G5 doesn't run in MCP mode, so this replaces it —
2
- * the server owns both decision and state, holding the gate without client cooperation. A tool
3
- * opts in via `class: "action"` + `describeAction`. Token binds to call 1's exact args, is
4
- * single-use, expires in 5 minutes (a starting value), and any bad token throws
5
- * `ToolInputError` rather than a silent no-op.
6
- *
7
- * **Redemption runs the frozen args and says so when that cost the caller something.** It used
8
- * to ignore anything else supplied and disclose nothing, which is the "silently do less" rule 7
9
- * forbids: documenting a substitution in five tool descriptions does not make it not silent,
10
- * because the caller who gets it wrong is by definition the one who did not read them. So a
11
- * conflicting value is still discarded — the frozen args are the ones a human saw in `willDo`,
12
- * and honouring a value nobody confirmed would defeat the gate — but the keys dropped come back
13
- * on the dispatch and are disclosed by name in the reply.
14
- *
15
- * What is *not* a discard, and this is the whole difficulty: call 2 carrying only the token is
16
- * the documented normal path, and a client echoing the original args back alongside it is
17
- * equally correct. An omitted key used its frozen value; a re-sent identical key changed
18
- * nothing. Only a conflicting value is reported, or the disclosure would fire on every correct
19
- * call and be trained away before the one time it mattered. Ruled in
20
- * `DEC-NEXT-late-arguments-on-a-confirming-call.md`. */
21
- import { randomBytes } from "node:crypto";
22
- import { ToolInputError } from "./tools/kit.js";
23
- const TOKEN_TTL_MS = 5 * 60 * 1000;
24
- const storesBySession = new WeakMap();
25
- function storeFor(session) {
26
- let store = storesBySession.get(session);
27
- if (store === undefined) {
28
- store = new Map();
29
- storesBySession.set(session, store);
30
- }
31
- return store;
32
- }
33
- function prune(store) {
34
- const now = Date.now();
35
- for (const [token, pending] of store) {
36
- if (pending.expiresAt < now)
37
- store.delete(token);
38
- }
39
- }
40
- function mintToken() {
41
- return `act_${randomBytes(9).toString("base64url")}`;
42
- }
43
- /** Decides what a call should do, before any budget timer starts. `read`/`stateful-read` and an
44
- * ungated `action` call resolve to `{ kind: "run", args }`; an unconfirmed gated call resolves to
45
- * `{ kind: "handshake", token, willDo }`; a redeemed one runs the args captured at mint time. */
46
- export async function resolveActionDispatch(tool, args, ctx) {
47
- if (tool.class !== "action")
48
- return { kind: "run", args };
49
- const confirmToken = args["confirmToken"];
50
- if (confirmToken !== undefined && typeof confirmToken !== "string") {
51
- throw new ToolInputError('"confirmToken" must be a string');
52
- }
53
- if (confirmToken === undefined) {
54
- return mintOrPassThrough(tool, args, ctx);
55
- }
56
- return redeem(tool, args, confirmToken, ctx);
57
- }
58
- async function mintOrPassThrough(tool, args, ctx) {
59
- if (tool.describeAction === undefined) {
60
- // Registry bug, not a caller mistake: `class: "action"` declared with no describeAction.
61
- throw new Error(`${tool.name} declares class "action" but has no describeAction`);
62
- }
63
- const willDo = await tool.describeAction(args, ctx);
64
- if (willDo === undefined)
65
- return { kind: "run", args };
66
- const store = storeFor(ctx.session);
67
- prune(store);
68
- const token = mintToken();
69
- store.set(token, { toolName: tool.name, args, expiresAt: Date.now() + TOKEN_TTL_MS });
70
- return { kind: "handshake", token, willDo };
71
- }
72
- async function redeem(tool, supplied, confirmToken, ctx) {
73
- const store = storeFor(ctx.session);
74
- const pending = store.get(confirmToken);
75
- // Deleted on lookup, not on success: a replayed token is a used token
76
- // whether or not what follows here succeeds.
77
- store.delete(confirmToken);
78
- if (pending === undefined) {
79
- throw new ToolInputError(`"confirmToken" is unknown or was already used. Call ${tool.name} again without confirmToken for a fresh one.`);
80
- }
81
- if (pending.expiresAt < Date.now()) {
82
- throw new ToolInputError(`"confirmToken" expired. Call ${tool.name} again without confirmToken for a fresh one.`);
83
- }
84
- if (pending.toolName !== tool.name) {
85
- throw new ToolInputError(`"confirmToken" was not issued for ${tool.name}.`);
86
- }
87
- const discardedArgs = conflictingKeys(supplied, pending.args);
88
- return discardedArgs.length === 0
89
- ? { kind: "run", args: pending.args }
90
- : { kind: "run", args: pending.args, discardedArgs };
91
- }
92
- /** Keys the confirming call supplied with a value the frozen args do not already hold. `confirmToken`
93
- * is excluded: it is the handshake's own argument, never one of the tool's. Sorted so the disclosure
94
- * reads the same on every run — a reply a caller diffs must not reorder on rerun (§9 layer 6). */
95
- function conflictingKeys(supplied, frozen) {
96
- const conflicts = [];
97
- for (const key of Object.keys(supplied)) {
98
- if (key === "confirmToken")
99
- continue;
100
- if (!sameValue(supplied[key], frozen[key]))
101
- conflicts.push(key);
102
- }
103
- return conflicts.sort();
104
- }
105
- /** Structural equality over the JSON an MCP client can actually send — objects, arrays, and the
106
- * four scalar types. Object key *order* is not part of a JSON value's identity, so it is not
107
- * compared: a client that rebuilds an argument from its own state and sends the same fields in a
108
- * different order discarded nothing, and telling it otherwise is the false positive that would
109
- * make this disclosure worth ignoring. */
110
- function sameValue(a, b) {
111
- if (a === b)
112
- return true;
113
- if (typeof a !== "object" || typeof b !== "object" || a === null || b === null)
114
- return false;
115
- if (Array.isArray(a) || Array.isArray(b)) {
116
- if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length)
117
- return false;
118
- return a.every((item, index) => sameValue(item, b[index]));
119
- }
120
- const left = a;
121
- const right = b;
122
- const leftKeys = Object.keys(left);
123
- if (leftKeys.length !== Object.keys(right).length)
124
- return false;
125
- return leftKeys.every((key) => Object.hasOwn(right, key) && sameValue(left[key], right[key]));
126
- }
127
- //# sourceMappingURL=action-handshake.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-handshake.js","sourceRoot":"","sources":["../src/action-handshake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;yDAmByD;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAyC,MAAM,gBAAgB,CAAC;AAGvF,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAQnC,MAAM,eAAe,GAAG,IAAI,OAAO,EAAuC,CAAC;AAE3E,SAAS,QAAQ,CAAC,OAAgB;IAChC,IAAI,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;QAClB,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,KAAK,CAAC,KAAiC;IAC9C,MAAM,GAA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CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAClF,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,MAAM,IAAI,GAAG,CAA4B,CAAC;IAC1C,MAAM,KAAK,GAAG,CAA4B,CAAC;IAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAChE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAChG,CAAC"}
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- /** The executable an MCP host launches. Takes the repo path (default cwd); everything else comes
3
- * from `.descry/config.json`. `serveStdio` redirects console to stderr on its first line, so this
4
- * file writes nothing before opening anything — earlier output corrupts the handshake frame, the
5
- * worst place to fail (host just reports "server did not start"). */
6
- export {};
7
- //# sourceMappingURL=descry-mcp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"descry-mcp.d.ts","sourceRoot":"","sources":["../../src/bin/descry-mcp.ts"],"names":[],"mappings":";AACA;;;sEAGsE"}
@@ -1,72 +0,0 @@
1
- #!/usr/bin/env node
2
- /** The executable an MCP host launches. Takes the repo path (default cwd); everything else comes
3
- * from `.descry/config.json`. `serveStdio` redirects console to stderr on its first line, so this
4
- * file writes nothing before opening anything — earlier output corrupts the handshake frame, the
5
- * worst place to fail (host just reports "server did not start"). */
6
- import process from "node:process";
7
- import { createRequire } from "node:module";
8
- import { resolve } from "node:path";
9
- import { createMcpServer, isOutOfBand } from "../server.js";
10
- import { Session } from "../session.js";
11
- import { serveStdio } from "../transport.js";
12
- import { createPlaywrightBrowserDriver } from "../browser/playwright-driver.js";
13
- import { createDefaultCredentialStore } from "../credential-store.js";
14
- /** Read from the installed package, not hardcoded. It used to be literal `"0.0.0"` for every
15
- * release, so no host could tell that 0.1.2 shipped from an off-main branch with an extra tool —
16
- * a server that can't say what it is can't be caught drifting. */
17
- const VERSION = (() => {
18
- try {
19
- const pkg = createRequire(import.meta.url)("../../package.json");
20
- return typeof pkg.version === "string" ? pkg.version : "0.0.0";
21
- }
22
- catch {
23
- // Never fatal. A host that cannot read a version still gets a server, and
24
- // failing the handshake over a label would be the worse trade.
25
- return "0.0.0";
26
- }
27
- })();
28
- const USAGE = `descry-mcp — Descry's MCP server (stdio)
29
-
30
- descry-mcp [repository-path]
31
-
32
- Reads .descry/config.json from the repository for the graph location and the
33
- list of adapter packages to load. Runs until stdin closes.
34
- `;
35
- async function main() {
36
- const args = process.argv.slice(2);
37
- if (args.includes("--help") || args.includes("-h")) {
38
- process.stderr.write(USAGE);
39
- return 0;
40
- }
41
- const repoPath = resolve(args[0] ?? process.cwd());
42
- const session = await Session.open({ repoPath });
43
- // Session never defaults this driver factory away from null; without this line every browser_*
44
- // tool refuses unconditionally regardless of what's installed. createPlaywrightBrowserDriver
45
- // still turns a missing package/binary into a named refusal, not a crash.
46
- session.useBrowserDriverFactory((options) => createPlaywrightBrowserDriver(options));
47
- // RG-1(4)'s remaining gap: `credentialStore` was settable but nothing outside a test ever
48
- // set it, so `${credential:NAME}` refused unconditionally in real use. The documented
49
- // default location is `~/.descry/credentials` (`credential-store.ts`'s own header) — the
50
- // same store `descry credential set` writes into.
51
- session.credentialStore = createDefaultCredentialStore();
52
- const server = createMcpServer({ session, name: "descry", version: VERSION });
53
- try {
54
- await serveStdio({ stdin: process.stdin, stdout: process.stdout, stderr: process.stderr }, (line, transport) => server.dispatch(line, transport),
55
- // Without this, `notifications/cancelled` waits in the ordered queue
56
- // behind the very call it cancels and can never do anything.
57
- { isOutOfBand });
58
- return 0;
59
- }
60
- finally {
61
- // `dispose`, not `close`: end-of-stdin is "disconnect," and §4 requires reaping every browser
62
- // this connection owns — a leaked Chromium keeps running on the developer's machine.
63
- await session.dispose();
64
- }
65
- }
66
- main().then((code) => {
67
- process.exitCode = code;
68
- }, (error) => {
69
- process.stderr.write(`descry-mcp: ${error instanceof Error ? error.stack ?? error.message : String(error)}\n`);
70
- process.exitCode = 1;
71
- });
72
- //# sourceMappingURL=descry-mcp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"descry-mcp.js","sourceRoot":"","sources":["../../src/bin/descry-mcp.ts"],"names":[],"mappings":";AACA;;;sEAGsE;AAEtE,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE;;mEAEmE;AACnE,MAAM,OAAO,GAAW,CAAC,GAAW,EAAE;IACpC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,oBAAoB,CAA0B,CAAC;QAC1F,OAAO,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IACjE,CAAC;IAAC,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AQ,CAAC,IAAI,EAAE,SAAS,CAAC;QACrD,qEAAqE;QACrE,6DAA6D;QAC7D,EAAE,WAAW,EAAE,CAChB,CAAC;QACF,OAAO,CAAC,CAAC;IACX,CAAC;YAAS,CAAC;QACT,8FAA8F;QAC9F,qFAAqF;QACrF,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,IAAI,CACT,CAAC,IAAI,EAAE,EAAE;IACP,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;AAC1B,CAAC,EACD,CAAC,KAAc,EAAE,EAAE;IACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,eAAe,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CACzF,CAAC;IACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CACF,CAAC"}
@@ -1,84 +0,0 @@
1
- /**
2
- * Reading an authenticated session in from a file — B1 of
3
- * `documents/plans/browser-reliability.md`.
4
- *
5
- * ## What was already here, and what was missing
6
- *
7
- * `browser_start_session` already accepted an inline `storageState` (11.4-b)
8
- * and `driver.ts` already carries it. Two things were missing and both are
9
- * about *reuse*: a caller had no way to point at a file, and a session had no
10
- * way to write one. Without those, "seed an authenticated session" means the
11
- * caller has to produce the cookie values by hand every time, which in
12
- * practice means nobody does it.
13
- *
14
- * So this module is the file half: load a browser's own saved state blob and
15
- * narrow it to the same-origin shape the port carries, refusing anything that
16
- * reaches outside the consented origin.
17
- *
18
- * ## Why the narrowing refuses rather than filters
19
- *
20
- * A saved state is whatever the browser had. A developer who logs in to their
21
- * application and saves the state has a file with one origin in it; a
22
- * developer who reuses a personal profile has a file with everything they are
23
- * logged into. Loading the second one wholesale would put unrelated
24
- * production sessions inside a browser the developer approved for one local
25
- * application. Quietly keeping only the matching cookies is worse than
26
- * refusing: a caller who believes they seeded a session and did not gets a run
27
- * that silently tested the logged-out surface and reported it as a clean one.
28
- *
29
- * ## Secrets
30
- *
31
- * Nothing here formats a value, including in a refusal — every message names a
32
- * cookie, a host or a path. `storageStateSecrets` returns the literal values
33
- * for `@descryy/core`'s `redactSecretsInText`, which replaces literal
34
- * substrings and never interprets one as a pattern, for the reason that
35
- * redactor's own header gives.
36
- *
37
- * Rule 1: a cookie, a header and an origin are facts about HTTP. No language,
38
- * framework or file extension is named here.
39
- */
40
- import type { BrowserStorageState } from "./driver.ts";
41
- export interface StorageStateContext {
42
- /** The origin this session's consent is bound to. Everything loaded must be within it. */
43
- readonly consentedOrigin: string;
44
- /** The repository root, for resolving a relative path. */
45
- readonly repoPath: string;
46
- }
47
- /**
48
- * Load a browser's saved storage state and narrow it to one origin.
49
- *
50
- * `path` is absolute or relative to the repository root. Throws
51
- * `ToolInputError` — every failure here is something the caller can fix by
52
- * changing an argument, and none of them is a bug in this server.
53
- */
54
- export declare function loadStorageStateFile(path: string, context: StorageStateContext): BrowserStorageState;
55
- /**
56
- * The parse-and-narrow half of {@link loadStorageStateFile}, taken directly rather than read
57
- * from a file — `browser-start-session.ts`'s `storageStateCredential` calls this against text
58
- * retrieved from `Session.credentialStore` (RG-1(4), lane "signin"). `sourceLabel` replaces the
59
- * file path in every message this can throw, so a credential-sourced refusal reads
60
- * `credential "NAME"` rather than a nonexistent file path.
61
- */
62
- export declare function parseStorageStateJson(text: string, sourceLabel: string, context: StorageStateContext): BrowserStorageState;
63
- /**
64
- * Where a saved state may be written.
65
- *
66
- * Inside the repository is refused. A storage state is a live credential in a
67
- * file, and the likeliest thing to happen to a file written into a working
68
- * tree is that it gets committed. Refusing costs the caller one argument; the
69
- * alternative costs them a session in their history.
70
- */
71
- export declare function resolveSavePath(raw: string, repoPath: string): string;
72
- /**
73
- * Every literal value a state carries. Names are deliberately absent — a
74
- * cookie called `session` is not a secret, and redacting the word would make
75
- * every reply that mentions a session unreadable.
76
- *
77
- * Values under four characters are dropped: one that short matches everywhere
78
- * and would redact a reply into noise, which is a worse outcome than leaving
79
- * a four-character credential in it.
80
- */
81
- export declare function storageStateSecrets(state: BrowserStorageState | null): readonly string[];
82
- /** The same, for header values. Separate because headers are not part of a storage state. */
83
- export declare function headerSecrets(headers: Readonly<Record<string, string>> | null): readonly string[];
84
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/browser/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAgB,MAAM,aAAa,CAAC;AAErE,MAAM,WAAW,mBAAmB;IAClC,0FAA0F;IAC1F,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AA0BD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,mBAAmB,CAepG;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,mBAAmB,CAW1H;AAmGD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAWrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,MAAM,EAAE,CAIxF;AAED,6FAA6F;AAC7F,wBAAgB,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,MAAM,EAAE,CAGjG"}
@@ -1,233 +0,0 @@
1
- /**
2
- * Reading an authenticated session in from a file — B1 of
3
- * `documents/plans/browser-reliability.md`.
4
- *
5
- * ## What was already here, and what was missing
6
- *
7
- * `browser_start_session` already accepted an inline `storageState` (11.4-b)
8
- * and `driver.ts` already carries it. Two things were missing and both are
9
- * about *reuse*: a caller had no way to point at a file, and a session had no
10
- * way to write one. Without those, "seed an authenticated session" means the
11
- * caller has to produce the cookie values by hand every time, which in
12
- * practice means nobody does it.
13
- *
14
- * So this module is the file half: load a browser's own saved state blob and
15
- * narrow it to the same-origin shape the port carries, refusing anything that
16
- * reaches outside the consented origin.
17
- *
18
- * ## Why the narrowing refuses rather than filters
19
- *
20
- * A saved state is whatever the browser had. A developer who logs in to their
21
- * application and saves the state has a file with one origin in it; a
22
- * developer who reuses a personal profile has a file with everything they are
23
- * logged into. Loading the second one wholesale would put unrelated
24
- * production sessions inside a browser the developer approved for one local
25
- * application. Quietly keeping only the matching cookies is worse than
26
- * refusing: a caller who believes they seeded a session and did not gets a run
27
- * that silently tested the logged-out surface and reported it as a clean one.
28
- *
29
- * ## Secrets
30
- *
31
- * Nothing here formats a value, including in a refusal — every message names a
32
- * cookie, a host or a path. `storageStateSecrets` returns the literal values
33
- * for `@descryy/core`'s `redactSecretsInText`, which replaces literal
34
- * substrings and never interprets one as a pattern, for the reason that
35
- * redactor's own header gives.
36
- *
37
- * Rule 1: a cookie, a header and an origin are facts about HTTP. No language,
38
- * framework or file extension is named here.
39
- */
40
- import { readFileSync } from "node:fs";
41
- import { isAbsolute, join, relative, resolve } from "node:path";
42
- import { ToolInputError } from "../tools/kit.js";
43
- const SAME_SITE = ["Strict", "Lax", "None"];
44
- function hostOf(origin) {
45
- try {
46
- return new URL(origin).hostname;
47
- }
48
- catch {
49
- return origin;
50
- }
51
- }
52
- /**
53
- * Does `domain` name the consented host and nothing else?
54
- *
55
- * A leading dot is how a saved jar spells "this domain and its subdomains", so
56
- * `.localhost` for `localhost` is the same host written two ways. What is not
57
- * accepted is a domain that covers *more* than the consented host — a cookie
58
- * for a parent domain travels to every sibling application under it, and that
59
- * is the widening this check exists to stop happening by accident.
60
- */
61
- function namesConsentedHost(domain, host) {
62
- const bare = (domain.startsWith(".") ? domain.slice(1) : domain).toLowerCase();
63
- return bare === host.toLowerCase();
64
- }
65
- /**
66
- * Load a browser's saved storage state and narrow it to one origin.
67
- *
68
- * `path` is absolute or relative to the repository root. Throws
69
- * `ToolInputError` — every failure here is something the caller can fix by
70
- * changing an argument, and none of them is a bug in this server.
71
- */
72
- export function loadStorageStateFile(path, context) {
73
- const resolved = isAbsolute(path) ? path : join(context.repoPath, path);
74
- let text;
75
- try {
76
- text = readFileSync(resolved, "utf8");
77
- }
78
- catch (error) {
79
- throw new ToolInputError(`Could not read the storage state at ${resolved}: ${error instanceof Error ? error.message : String(error)}. ` +
80
- "A relative path is resolved against the repository root. The usual way to produce this file is to " +
81
- "start a session with headless false and saveStorageStateTo, log in by hand, and close it.");
82
- }
83
- return parseStorageStateJson(text, resolved, context);
84
- }
85
- /**
86
- * The parse-and-narrow half of {@link loadStorageStateFile}, taken directly rather than read
87
- * from a file — `browser-start-session.ts`'s `storageStateCredential` calls this against text
88
- * retrieved from `Session.credentialStore` (RG-1(4), lane "signin"). `sourceLabel` replaces the
89
- * file path in every message this can throw, so a credential-sourced refusal reads
90
- * `credential "NAME"` rather than a nonexistent file path.
91
- */
92
- export function parseStorageStateJson(text, sourceLabel, context) {
93
- let parsed;
94
- try {
95
- parsed = JSON.parse(text);
96
- }
97
- catch {
98
- // The parser's own message quotes the text around the failure, and in this
99
- // one file that text is credential material.
100
- throw new ToolInputError(`The storage state at ${sourceLabel} is not valid JSON. Its contents are deliberately not quoted here.`);
101
- }
102
- return narrowToOrigin(parsed, sourceLabel, context);
103
- }
104
- function narrowToOrigin(raw, path, context) {
105
- if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
106
- throw new ToolInputError(`The storage state at ${path} is not an object.`);
107
- }
108
- const fields = raw;
109
- const rawCookies = fields["cookies"];
110
- const rawOrigins = fields["origins"];
111
- // Both keys required rather than defaulted to empty. A blob missing one is
112
- // far more likely to be the wrong file than a deliberately empty jar, and
113
- // loading it produces a session that looks seeded and is not.
114
- if (!Array.isArray(rawCookies) || !Array.isArray(rawOrigins)) {
115
- throw new ToolInputError(`${path} does not look like a saved browser storage state — it needs a "cookies" array and an "origins" ` +
116
- "array. Nothing was loaded.");
117
- }
118
- const host = hostOf(context.consentedOrigin);
119
- const strayHosts = new Set();
120
- const cookies = [];
121
- for (const [index, entry] of rawCookies.entries()) {
122
- if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
123
- throw new ToolInputError(`${path}: cookies[${index}] is not an object. Nothing was loaded.`);
124
- }
125
- const cookie = entry;
126
- const name = cookie["name"];
127
- const value = cookie["value"];
128
- const domain = cookie["domain"];
129
- if (typeof name !== "string" || typeof value !== "string") {
130
- throw new ToolInputError(`${path}: cookies[${index}] needs a string "name" and "value". Nothing was loaded.`);
131
- }
132
- if (typeof domain !== "string" || !namesConsentedHost(domain, host)) {
133
- strayHosts.add(typeof domain === "string" ? domain : "(no domain)");
134
- continue;
135
- }
136
- const sameSite = cookie["sameSite"];
137
- cookies.push({
138
- name,
139
- value,
140
- // The domain is deliberately dropped rather than carried: the port's
141
- // shape has no field for one, which is what makes a second origin
142
- // unnameable rather than merely unaccepted.
143
- ...(typeof cookie["path"] === "string" ? { path: cookie["path"] } : {}),
144
- ...(typeof cookie["httpOnly"] === "boolean" ? { httpOnly: cookie["httpOnly"] } : {}),
145
- ...(typeof cookie["secure"] === "boolean" ? { secure: cookie["secure"] } : {}),
146
- ...(typeof sameSite === "string" && SAME_SITE.includes(sameSite)
147
- ? { sameSite: sameSite }
148
- : {}),
149
- });
150
- }
151
- const strayOrigins = new Set();
152
- const localStorage = {};
153
- for (const [index, entry] of rawOrigins.entries()) {
154
- if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
155
- throw new ToolInputError(`${path}: origins[${index}] is not an object. Nothing was loaded.`);
156
- }
157
- const origin = entry["origin"];
158
- if (typeof origin !== "string") {
159
- throw new ToolInputError(`${path}: origins[${index}] needs a string "origin". Nothing was loaded.`);
160
- }
161
- if (origin !== context.consentedOrigin) {
162
- strayOrigins.add(origin);
163
- continue;
164
- }
165
- const items = entry["localStorage"];
166
- if (items !== undefined && !Array.isArray(items)) {
167
- throw new ToolInputError(`${path}: origins[${index}].localStorage is not an array. Nothing was loaded.`);
168
- }
169
- for (const item of items ?? []) {
170
- if (typeof item !== "object" || item === null)
171
- continue;
172
- const { name, value } = item;
173
- if (typeof name === "string" && typeof value === "string")
174
- localStorage[name] = value;
175
- }
176
- }
177
- if (strayHosts.size > 0 || strayOrigins.size > 0) {
178
- const parts = [];
179
- if (strayHosts.size > 0)
180
- parts.push(`cookies for ${[...strayHosts].join(", ")}`);
181
- if (strayOrigins.size > 0)
182
- parts.push(`stored data for ${[...strayOrigins].join(", ")}`);
183
- throw new ToolInputError(`${path} carries ${parts.join(" and ")}, which ${context.consentedOrigin} does not cover. This session's ` +
184
- "consent is bound to one origin, and seeding credentials for other hosts would put sessions the " +
185
- "developer never approved inside this browser. Nothing was loaded, and no value from the file is " +
186
- "printed here. Save a state for this application alone — a session started with saveStorageStateTo " +
187
- "writes exactly that.");
188
- }
189
- return {
190
- ...(cookies.length === 0 ? {} : { cookies }),
191
- ...(Object.keys(localStorage).length === 0 ? {} : { localStorage }),
192
- };
193
- }
194
- /**
195
- * Where a saved state may be written.
196
- *
197
- * Inside the repository is refused. A storage state is a live credential in a
198
- * file, and the likeliest thing to happen to a file written into a working
199
- * tree is that it gets committed. Refusing costs the caller one argument; the
200
- * alternative costs them a session in their history.
201
- */
202
- export function resolveSavePath(raw, repoPath) {
203
- const path = isAbsolute(raw) ? raw : resolve(join(repoPath, raw));
204
- const within = relative(resolve(repoPath), path);
205
- if (within !== "" && !within.startsWith("..") && !isAbsolute(within)) {
206
- throw new ToolInputError(`"saveStorageStateTo" resolves to ${path}, which is inside the repository at ${repoPath}. A saved storage ` +
207
- "state is a live credential in a file, and a credential written into a working tree is one `git add .` " +
208
- "away from being committed. Give an absolute path outside the repository.");
209
- }
210
- return path;
211
- }
212
- /**
213
- * Every literal value a state carries. Names are deliberately absent — a
214
- * cookie called `session` is not a secret, and redacting the word would make
215
- * every reply that mentions a session unreadable.
216
- *
217
- * Values under four characters are dropped: one that short matches everywhere
218
- * and would redact a reply into noise, which is a worse outcome than leaving
219
- * a four-character credential in it.
220
- */
221
- export function storageStateSecrets(state) {
222
- if (state === null)
223
- return [];
224
- const values = [...(state.cookies ?? []).map((cookie) => cookie.value), ...Object.values(state.localStorage ?? {})];
225
- return [...new Set(values.filter((value) => value.length >= 4))];
226
- }
227
- /** The same, for header values. Separate because headers are not part of a storage state. */
228
- export function headerSecrets(headers) {
229
- if (headers === null)
230
- return [];
231
- return [...new Set(Object.values(headers).filter((value) => value.length >= 4))];
232
- }
233
- //# sourceMappingURL=auth.js.map