@animalabs/agent-framework 0.31.0 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/README.md +204 -14
  2. package/dist/src/admission/admit.d.ts +18 -0
  3. package/dist/src/admission/admit.d.ts.map +1 -1
  4. package/dist/src/admission/admit.js +16 -3
  5. package/dist/src/admission/admit.js.map +1 -1
  6. package/dist/src/agent.d.ts +185 -78
  7. package/dist/src/agent.d.ts.map +1 -1
  8. package/dist/src/agent.js +279 -102
  9. package/dist/src/agent.js.map +1 -1
  10. package/dist/src/api/mcp-server-core.d.ts.map +1 -1
  11. package/dist/src/api/mcp-server-core.js +50 -12
  12. package/dist/src/api/mcp-server-core.js.map +1 -1
  13. package/dist/src/api/server.d.ts.map +1 -1
  14. package/dist/src/api/server.js +4 -20
  15. package/dist/src/api/server.js.map +1 -1
  16. package/dist/src/code-execution/isolate/scripts.d.ts +12 -8
  17. package/dist/src/code-execution/isolate/scripts.d.ts.map +1 -1
  18. package/dist/src/code-execution/isolate/scripts.js +24 -0
  19. package/dist/src/code-execution/isolate/scripts.js.map +1 -1
  20. package/dist/src/config-checks.d.ts +7 -0
  21. package/dist/src/config-checks.d.ts.map +1 -1
  22. package/dist/src/config-checks.js +14 -0
  23. package/dist/src/config-checks.js.map +1 -1
  24. package/dist/src/context-manager-errors.d.ts +25 -0
  25. package/dist/src/context-manager-errors.d.ts.map +1 -0
  26. package/dist/src/context-manager-errors.js +31 -0
  27. package/dist/src/context-manager-errors.js.map +1 -0
  28. package/dist/src/context-options.d.ts +67 -0
  29. package/dist/src/context-options.d.ts.map +1 -0
  30. package/dist/src/context-options.js +85 -0
  31. package/dist/src/context-options.js.map +1 -0
  32. package/dist/src/deferred-import.d.ts +93 -0
  33. package/dist/src/deferred-import.d.ts.map +1 -0
  34. package/dist/src/deferred-import.js +177 -0
  35. package/dist/src/deferred-import.js.map +1 -0
  36. package/dist/src/dendrite/audience.d.ts +223 -0
  37. package/dist/src/dendrite/audience.d.ts.map +1 -0
  38. package/dist/src/dendrite/audience.js +202 -0
  39. package/dist/src/dendrite/audience.js.map +1 -0
  40. package/dist/src/dendrite/index.d.ts +5 -3
  41. package/dist/src/dendrite/index.d.ts.map +1 -1
  42. package/dist/src/dendrite/index.js +2 -1
  43. package/dist/src/dendrite/index.js.map +1 -1
  44. package/dist/src/dendrite/presets.d.ts +10 -5
  45. package/dist/src/dendrite/presets.d.ts.map +1 -1
  46. package/dist/src/dendrite/presets.js +17 -5
  47. package/dist/src/dendrite/presets.js.map +1 -1
  48. package/dist/src/dendrite/registry.d.ts +62 -7
  49. package/dist/src/dendrite/registry.d.ts.map +1 -1
  50. package/dist/src/dendrite/registry.js +179 -10
  51. package/dist/src/dendrite/registry.js.map +1 -1
  52. package/dist/src/dendrite/types.d.ts +91 -8
  53. package/dist/src/dendrite/types.d.ts.map +1 -1
  54. package/dist/src/foreign-rounds.d.ts +69 -0
  55. package/dist/src/foreign-rounds.d.ts.map +1 -0
  56. package/dist/src/foreign-rounds.js +152 -0
  57. package/dist/src/foreign-rounds.js.map +1 -0
  58. package/dist/src/framework.d.ts +1977 -820
  59. package/dist/src/framework.d.ts.map +1 -1
  60. package/dist/src/framework.js +7571 -3457
  61. package/dist/src/framework.js.map +1 -1
  62. package/dist/src/gate/event-gate.d.ts +85 -15
  63. package/dist/src/gate/event-gate.d.ts.map +1 -1
  64. package/dist/src/gate/event-gate.js +421 -47
  65. package/dist/src/gate/event-gate.js.map +1 -1
  66. package/dist/src/gate/index.d.ts +1 -1
  67. package/dist/src/gate/index.d.ts.map +1 -1
  68. package/dist/src/gate/index.js.map +1 -1
  69. package/dist/src/gate/rule-scope.d.ts +30 -0
  70. package/dist/src/gate/rule-scope.d.ts.map +1 -0
  71. package/dist/src/gate/rule-scope.js +41 -0
  72. package/dist/src/gate/rule-scope.js.map +1 -0
  73. package/dist/src/gate/suppress-script-worker.d.ts +2 -0
  74. package/dist/src/gate/suppress-script-worker.d.ts.map +1 -0
  75. package/dist/src/gate/suppress-script-worker.js +103 -0
  76. package/dist/src/gate/suppress-script-worker.js.map +1 -0
  77. package/dist/src/gate/suppress-scripts.d.ts +105 -0
  78. package/dist/src/gate/suppress-scripts.d.ts.map +1 -0
  79. package/dist/src/gate/suppress-scripts.js +403 -0
  80. package/dist/src/gate/suppress-scripts.js.map +1 -0
  81. package/dist/src/gate/suppression-review.d.ts +143 -0
  82. package/dist/src/gate/suppression-review.d.ts.map +1 -0
  83. package/dist/src/gate/suppression-review.js +463 -0
  84. package/dist/src/gate/suppression-review.js.map +1 -0
  85. package/dist/src/gate/suppression-stats.d.ts +125 -0
  86. package/dist/src/gate/suppression-stats.d.ts.map +1 -0
  87. package/dist/src/gate/suppression-stats.js +214 -0
  88. package/dist/src/gate/suppression-stats.js.map +1 -0
  89. package/dist/src/gate/types.d.ts +135 -7
  90. package/dist/src/gate/types.d.ts.map +1 -1
  91. package/dist/src/gate/wake-onboarding.d.ts +119 -0
  92. package/dist/src/gate/wake-onboarding.d.ts.map +1 -0
  93. package/dist/src/gate/wake-onboarding.js +277 -0
  94. package/dist/src/gate/wake-onboarding.js.map +1 -0
  95. package/dist/src/held-writes.d.ts +31 -23
  96. package/dist/src/held-writes.d.ts.map +1 -1
  97. package/dist/src/held-writes.js +44 -59
  98. package/dist/src/held-writes.js.map +1 -1
  99. package/dist/src/index.d.ts +5 -2
  100. package/dist/src/index.d.ts.map +1 -1
  101. package/dist/src/index.js +3 -0
  102. package/dist/src/index.js.map +1 -1
  103. package/dist/src/jsonrpc-envelope.d.ts +69 -0
  104. package/dist/src/jsonrpc-envelope.d.ts.map +1 -0
  105. package/dist/src/jsonrpc-envelope.js +66 -0
  106. package/dist/src/jsonrpc-envelope.js.map +1 -0
  107. package/dist/src/mcpl/channel-registry.d.ts +131 -15
  108. package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
  109. package/dist/src/mcpl/channel-registry.js +290 -46
  110. package/dist/src/mcpl/channel-registry.js.map +1 -1
  111. package/dist/src/mcpl/checkpoint-manager.d.ts +2 -4
  112. package/dist/src/mcpl/checkpoint-manager.d.ts.map +1 -1
  113. package/dist/src/mcpl/checkpoint-manager.js.map +1 -1
  114. package/dist/src/mcpl/feature-set-manager.d.ts +2 -4
  115. package/dist/src/mcpl/feature-set-manager.d.ts.map +1 -1
  116. package/dist/src/mcpl/feature-set-manager.js.map +1 -1
  117. package/dist/src/mcpl/inbound-source.d.ts +2 -1
  118. package/dist/src/mcpl/inbound-source.d.ts.map +1 -1
  119. package/dist/src/mcpl/inbound-source.js +2 -1
  120. package/dist/src/mcpl/inbound-source.js.map +1 -1
  121. package/dist/src/mcpl/inference-router.d.ts +6 -6
  122. package/dist/src/mcpl/inference-router.d.ts.map +1 -1
  123. package/dist/src/mcpl/inference-router.js.map +1 -1
  124. package/dist/src/mcpl/push-coalescer.d.ts +132 -22
  125. package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
  126. package/dist/src/mcpl/push-coalescer.js +105 -15
  127. package/dist/src/mcpl/push-coalescer.js.map +1 -1
  128. package/dist/src/mcpl/push-handler.d.ts +9 -7
  129. package/dist/src/mcpl/push-handler.d.ts.map +1 -1
  130. package/dist/src/mcpl/push-handler.js.map +1 -1
  131. package/dist/src/mcpl/server-connection.d.ts +13 -10
  132. package/dist/src/mcpl/server-connection.d.ts.map +1 -1
  133. package/dist/src/mcpl/server-connection.js +134 -56
  134. package/dist/src/mcpl/server-connection.js.map +1 -1
  135. package/dist/src/mcpl/tool-classes.d.ts.map +1 -1
  136. package/dist/src/mcpl/tool-classes.js +3 -0
  137. package/dist/src/mcpl/tool-classes.js.map +1 -1
  138. package/dist/src/mcpl/types.d.ts +8 -2
  139. package/dist/src/mcpl/types.d.ts.map +1 -1
  140. package/dist/src/mcpl/types.js.map +1 -1
  141. package/dist/src/module-registry.d.ts +24 -1
  142. package/dist/src/module-registry.d.ts.map +1 -1
  143. package/dist/src/module-registry.js +68 -18
  144. package/dist/src/module-registry.js.map +1 -1
  145. package/dist/src/modules/discord/index.d.ts +45 -8
  146. package/dist/src/modules/discord/index.d.ts.map +1 -1
  147. package/dist/src/modules/discord/index.js +237 -86
  148. package/dist/src/modules/discord/index.js.map +1 -1
  149. package/dist/src/modules/history/index.d.ts +59 -0
  150. package/dist/src/modules/history/index.d.ts.map +1 -1
  151. package/dist/src/modules/history/index.js +432 -67
  152. package/dist/src/modules/history/index.js.map +1 -1
  153. package/dist/src/modules/history/semantic.d.ts +6 -5
  154. package/dist/src/modules/history/semantic.d.ts.map +1 -1
  155. package/dist/src/modules/history/semantic.js +15 -22
  156. package/dist/src/modules/history/semantic.js.map +1 -1
  157. package/dist/src/modules/workspace/disk-agreement.d.ts +1 -1
  158. package/dist/src/modules/workspace/disk-agreement.js +1 -1
  159. package/dist/src/modules/workspace/index.d.ts +28 -7
  160. package/dist/src/modules/workspace/index.d.ts.map +1 -1
  161. package/dist/src/modules/workspace/index.js +76 -22
  162. package/dist/src/modules/workspace/index.js.map +1 -1
  163. package/dist/src/notice-tags.d.ts +10 -1
  164. package/dist/src/notice-tags.d.ts.map +1 -1
  165. package/dist/src/notice-tags.js +10 -1
  166. package/dist/src/notice-tags.js.map +1 -1
  167. package/dist/src/operator-log.d.ts +36 -3
  168. package/dist/src/operator-log.d.ts.map +1 -1
  169. package/dist/src/operator-log.js +2 -2
  170. package/dist/src/operator-log.js.map +1 -1
  171. package/dist/src/presentation.d.ts +746 -0
  172. package/dist/src/presentation.d.ts.map +1 -0
  173. package/dist/src/presentation.js +1435 -0
  174. package/dist/src/presentation.js.map +1 -0
  175. package/dist/src/prose-drafts.d.ts +15 -11
  176. package/dist/src/prose-drafts.d.ts.map +1 -1
  177. package/dist/src/prose-drafts.js +16 -12
  178. package/dist/src/prose-drafts.js.map +1 -1
  179. package/dist/src/read-marks.d.ts +192 -0
  180. package/dist/src/read-marks.d.ts.map +1 -0
  181. package/dist/src/read-marks.js +242 -0
  182. package/dist/src/read-marks.js.map +1 -0
  183. package/dist/src/recovery/offline-branch.d.ts +91 -6
  184. package/dist/src/recovery/offline-branch.d.ts.map +1 -1
  185. package/dist/src/recovery/offline-branch.js +273 -29
  186. package/dist/src/recovery/offline-branch.js.map +1 -1
  187. package/dist/src/recovery/recover-cli.js +22 -3
  188. package/dist/src/recovery/recover-cli.js.map +1 -1
  189. package/dist/src/send-tools.d.ts +5 -9
  190. package/dist/src/send-tools.d.ts.map +1 -1
  191. package/dist/src/send-tools.js +40 -7
  192. package/dist/src/send-tools.js.map +1 -1
  193. package/dist/src/stored-injections.d.ts +2 -2
  194. package/dist/src/stored-injections.js +2 -2
  195. package/dist/src/stored-removal.d.ts +17 -4
  196. package/dist/src/stored-removal.d.ts.map +1 -1
  197. package/dist/src/stored-removal.js +29 -5
  198. package/dist/src/stored-removal.js.map +1 -1
  199. package/dist/src/tool-result-guard.d.ts +12 -1
  200. package/dist/src/tool-result-guard.d.ts.map +1 -1
  201. package/dist/src/tool-result-guard.js +42 -8
  202. package/dist/src/tool-result-guard.js.map +1 -1
  203. package/dist/src/tune-out/coordinator.d.ts +1159 -79
  204. package/dist/src/tune-out/coordinator.d.ts.map +1 -1
  205. package/dist/src/tune-out/coordinator.js +3709 -363
  206. package/dist/src/tune-out/coordinator.js.map +1 -1
  207. package/dist/src/tune-out/tools.d.ts +114 -17
  208. package/dist/src/tune-out/tools.d.ts.map +1 -1
  209. package/dist/src/tune-out/tools.js +87 -27
  210. package/dist/src/tune-out/tools.js.map +1 -1
  211. package/dist/src/tune-out/window-anchor.d.ts +143 -0
  212. package/dist/src/tune-out/window-anchor.d.ts.map +1 -0
  213. package/dist/src/tune-out/window-anchor.js +202 -0
  214. package/dist/src/tune-out/window-anchor.js.map +1 -0
  215. package/dist/src/types/agent.d.ts +86 -31
  216. package/dist/src/types/agent.d.ts.map +1 -1
  217. package/dist/src/types/events.d.ts +2 -0
  218. package/dist/src/types/events.d.ts.map +1 -1
  219. package/dist/src/types/framework.d.ts +43 -21
  220. package/dist/src/types/framework.d.ts.map +1 -1
  221. package/dist/src/types/module.d.ts +180 -69
  222. package/dist/src/types/module.d.ts.map +1 -1
  223. package/dist/src/types/trace.d.ts +510 -36
  224. package/dist/src/types/trace.d.ts.map +1 -1
  225. package/package.json +3 -3
  226. package/src/admission/admit.ts +32 -3
  227. package/src/agent.ts +323 -120
  228. package/src/api/mcp-server-core.ts +54 -17
  229. package/src/api/server.ts +4 -23
  230. package/src/code-execution/isolate/scripts.ts +28 -3
  231. package/src/config-checks.ts +14 -0
  232. package/src/context-manager-errors.ts +37 -0
  233. package/src/context-options.ts +96 -0
  234. package/src/deferred-import.ts +239 -0
  235. package/src/dendrite/audience.ts +315 -0
  236. package/src/dendrite/index.ts +14 -2
  237. package/src/dendrite/presets.ts +18 -6
  238. package/src/dendrite/registry.ts +209 -12
  239. package/src/dendrite/types.ts +92 -8
  240. package/src/foreign-rounds.ts +199 -0
  241. package/src/framework.ts +7814 -3585
  242. package/src/gate/event-gate.ts +428 -65
  243. package/src/gate/index.ts +3 -0
  244. package/src/gate/rule-scope.ts +45 -0
  245. package/src/gate/suppress-script-worker.ts +89 -0
  246. package/src/gate/suppress-scripts.ts +414 -0
  247. package/src/gate/suppression-review.ts +517 -0
  248. package/src/gate/suppression-stats.ts +314 -0
  249. package/src/gate/types.ts +141 -7
  250. package/src/gate/wake-onboarding.ts +309 -0
  251. package/src/held-writes.ts +49 -60
  252. package/src/index.ts +9 -2
  253. package/src/jsonrpc-envelope.ts +81 -0
  254. package/src/mcpl/channel-registry.ts +353 -85
  255. package/src/mcpl/checkpoint-manager.ts +3 -2
  256. package/src/mcpl/feature-set-manager.ts +2 -1
  257. package/src/mcpl/inbound-source.ts +2 -1
  258. package/src/mcpl/inference-router.ts +7 -4
  259. package/src/mcpl/push-coalescer.ts +193 -34
  260. package/src/mcpl/push-handler.ts +10 -5
  261. package/src/mcpl/server-connection.ts +141 -60
  262. package/src/mcpl/tool-classes.ts +3 -0
  263. package/src/mcpl/types.ts +8 -2
  264. package/src/module-registry.ts +73 -17
  265. package/src/modules/discord/index.ts +229 -81
  266. package/src/modules/history/index.ts +439 -70
  267. package/src/modules/history/semantic.ts +15 -21
  268. package/src/modules/workspace/disk-agreement.ts +1 -1
  269. package/src/modules/workspace/index.ts +85 -23
  270. package/src/notice-tags.ts +10 -1
  271. package/src/operator-log.ts +36 -3
  272. package/src/presentation.ts +1676 -0
  273. package/src/prose-drafts.ts +16 -12
  274. package/src/read-marks.ts +328 -0
  275. package/src/recovery/offline-branch.ts +346 -32
  276. package/src/recovery/recover-cli.ts +21 -3
  277. package/src/send-tools.ts +40 -7
  278. package/src/stored-injections.ts +2 -2
  279. package/src/stored-removal.ts +31 -7
  280. package/src/tool-result-guard.ts +41 -7
  281. package/src/tune-out/coordinator.ts +4089 -457
  282. package/src/tune-out/tools.ts +160 -43
  283. package/src/tune-out/window-anchor.ts +277 -0
  284. package/src/types/agent.ts +90 -31
  285. package/src/types/events.ts +2 -0
  286. package/src/types/framework.ts +43 -21
  287. package/src/types/module.ts +181 -68
  288. package/src/types/trace.ts +542 -40
  289. package/dist/src/reasoning-loss-notice.d.ts +0 -23
  290. package/dist/src/reasoning-loss-notice.d.ts.map +0 -1
  291. package/dist/src/reasoning-loss-notice.js +0 -52
  292. package/dist/src/reasoning-loss-notice.js.map +0 -1
  293. package/dist/src/reasoning-loss.d.ts +0 -24
  294. package/dist/src/reasoning-loss.d.ts.map +0 -1
  295. package/dist/src/reasoning-loss.js +0 -102
  296. package/dist/src/reasoning-loss.js.map +0 -1
  297. package/src/reasoning-loss-notice.ts +0 -64
  298. package/src/reasoning-loss.ts +0 -120
@@ -1 +1 @@
1
- {"version":3,"file":"server-connection.d.ts","sourceRoot":"","sources":["../../../src/mcpl/server-connection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAqC,KAAK,aAAa,EAA2B,MAAM,gBAAgB,CAAC;AAEhH,OAAO,EAAE,eAAe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OAUG;IACH,OAAO,CAAC,WAAW;IA8HnB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAiBxB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAuBrC;IAEF;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,6BAA6B,CASnD;IAEF;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAUrB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAmB3B,oFAAoF;IACpF,OAAO,CAAC,eAAe;IAiGvB;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAWpB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,aAAa;IAarB,mFAAmF;IACnF,OAAO,CAAC,oBAAoB;IAY5B;;wDAEoD;IACpD,OAAO,CAAC,oBAAoB;IAW5B;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB;IAY5B;uDACmD;IACnD,OAAO,CAAC,WAAW;IAUnB;;OAEG;IACH,OAAO,CAAC,cAAc;IA+FtB;;OAEG;IACH,OAAO,CAAC,YAAY;IAQpB;;2DAEuD;IACvD,OAAO,CAAC,aAAa;IAQrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAsBzB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAqEvB"}
1
+ {"version":3,"file":"server-connection.d.ts","sourceRoot":"","sources":["../../../src/mcpl/server-connection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAqC,KAAK,aAAa,EAA2B,MAAM,gBAAgB,CAAC;AAEhH,OAAO,EAAE,eAAe,EAAgC,MAAM,uBAAuB,CAAC;AAetF,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EAGpB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACx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H,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,6BAA6B,CASnD;IAEF;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAUrB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAmB3B,oFAAoF;IACpF,OAAO,CAAC,eAAe;IAsHvB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAWpB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,aAAa;IAarB,mFAAmF;IACnF,OAAO,CAAC,oBAAoB;IAY5B;;wDAEoD;IACpD,OAAO,CAAC,oBAAoB;IAW5B;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB;IAY5B;uDACmD;IACnD,OAAO,CAAC,WAAW;IAUnB;;OAEG;IACH,OAAO,CAAC,cAAc;IAyGtB;;OAEG;IACH,OAAO,CAAC,YAAY;IAQpB;;2DAEuD;IACvD,OAAO,CAAC,aAAa;IAQrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAsBzB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAqEvB"}
@@ -14,6 +14,7 @@ import { maskNegotiatedCapabilities } from './capability-mask.js';
14
14
  import { CapabilityGrant, expandAdvertisementShorthand } from './capability-grant.js';
15
15
  import { CAPABILITY_DISABLED, boundedForLog, describeCause } from './errors.js';
16
16
  import { logDetail, logValue, logValueRedacted, loggedCode } from './log-value.js';
17
+ import { jsonKind, readEnvelope } from '../jsonrpc-envelope.js';
17
18
  import { LEGACY_MCP_PROTOCOL_VERSION, MODERN_MCP_PROTOCOL_VERSION, checkServerConfig, logDroppedLine, redactServerText, redactedData, serverTextRedactor, } from './protocol-family.js';
18
19
  import { McplMethod } from './types.js';
19
20
  /** Timeout for the initialize handshake in milliseconds.
@@ -239,11 +240,27 @@ export class McplRequestError extends Error {
239
240
  this.name = 'McplRequestError';
240
241
  }
241
242
  }
242
- /** A request's method for a log line, whatever the server sent there. */
243
- function describeMethod(method) {
244
- return typeof method === 'string'
245
- ? `method ${logValue(method)}`
246
- : `a method of type ${method === null ? 'null' : typeof method}`;
243
+ /** Whether a response that can't be matched to a request of ours, its id
244
+ * being neither a string nor a number or missing, is logged: only a
245
+ * JSON-RPC 2.0 error is, since that's how a server says it couldn't read a
246
+ * message of ours (JSON-RPC 2.0 §5). Anything else id-less, such as a
247
+ * server's own JSON log line with `"id": null`, is ignored silently, as it
248
+ * was before #475, so a server's log output can't fill the host's. */
249
+ function isJsonRpcError(response) {
250
+ return response.jsonrpc === '2.0' && Object.hasOwn(response, 'error');
251
+ }
252
+ /** The log line for such an error. The host's own request ids are numbers,
253
+ * so it can't be matched to one. Once connected it may be the answer to a
254
+ * request of ours, which gets nothing from it and ends as any unanswered
255
+ * request does, by its timeout where it has one. (During the handshake an
256
+ * error with id null or no id answers initialize.) Its error member is the
257
+ * server's text, whatever JSON value it is, so it's printed redacted with
258
+ * `redact`, the server's redaction (logValueRedacted), as handleResponse
259
+ * prints a matched error's code and message. */
260
+ function unmatchedResponse(serverId, response, redact) {
261
+ const which = Object.hasOwn(response, 'id') ? `whose id is ${jsonKind(response.id)}` : 'with no id';
262
+ return `[mcpl] ${serverId}: ignored a response ${which}, which can't be matched to a request of ours; ` +
263
+ `its error: ${logValueRedacted(response.error, redact)}`;
247
264
  }
248
265
  /**
249
266
  * McplServerConnection manages a single JSON-RPC 2.0 connection to an
@@ -542,13 +559,14 @@ export class McplServerConnection extends EventEmitter {
542
559
  // Reconnect state (adapted from Anarchid/agent-framework@mcpl-module-proto)
543
560
  config = null;
544
561
  /** The redactor of the server's text for `config`, made at its first error
545
- * answer, by when `config` is set, and kept: a framework-launched child's
546
- * `env` is a getter that reads the awareness ledger, so a redactor built
547
- * per answer would read it per answer (#540's review, R1-2). An answer
548
- * takes one build of it for its words, data and log line (`now()`), so
549
- * it reads the ledger at most once. It builds again only after a build
550
- * that failed, which withholds that answer's text, or once a dial notes
551
- * something new (serverTextRedactor). */
562
+ * answer or response it can't match (handleResponse), by when `config`
563
+ * is set, and kept: a framework-launched child's `env` is a getter that
564
+ * reads the awareness ledger, so a redactor built per answer would read
565
+ * it per answer (#540's review, R1-2). An answer takes one build of it
566
+ * for its words, data and log line (`now()`), so it reads the ledger at
567
+ * most once. It builds again only after a build that failed, which
568
+ * withholds that answer's text, or once a dial notes something new
569
+ * (serverTextRedactor). */
552
570
  redactor = null;
553
571
  hostCapabilities = null;
554
572
  reconnectEnabled = false;
@@ -1154,16 +1172,36 @@ export class McplServerConnection extends EventEmitter {
1154
1172
  // initialize response, whatever its id: a server's own ids can start
1155
1173
  // at 0, this handshake's. MCP lets a server ping before
1156
1174
  // initialization completes, and the ping gets its empty result, as
1157
- // on a connected transport. Anything else it sends now is ignored.
1158
- if ('method' in msg) {
1159
- const request = msg;
1160
- if (request.method === 'ping' && request.id != null) {
1161
- transport.writeLine(JSON.stringify({ jsonrpc: '2.0', id: request.id, result: {} }));
1162
- }
1175
+ // on a connected transport, `"id": null` included
1176
+ // (src/jsonrpc-envelope.ts). Anything else it sends now is ignored,
1177
+ // an invalid request included. Of its responses, the one with
1178
+ // initialize's id answers it, and so does a JSON-RPC 2.0 error with
1179
+ // id null or with no id: a peer answers a request it couldn't read
1180
+ // that way (JSON-RPC 2.0 §5; MCP 2025-11-25, Basic), initialize is
1181
+ // the only request this host has out, and a peer never answers a
1182
+ // response. Such an error means the server can't read this host's
1183
+ // messages, so the handshake fails at once, with the error's message.
1184
+ // `"jsonrpc": "2.0"` keeps a server's own JSON log line with an
1185
+ // error key and id null, or no id, from failing it; one with
1186
+ // initialize's id is taken for the answer, whatever its jsonrpc. Of
1187
+ // the other responses, a JSON-RPC 2.0 error whose id is neither a
1188
+ // string nor a number is logged, as on a connected transport, and
1189
+ // any other is ignored.
1190
+ const envelope = readEnvelope(msg);
1191
+ if (envelope.kind === 'request' && envelope.method === 'ping') {
1192
+ transport.writeLine(JSON.stringify({ jsonrpc: '2.0', id: envelope.id, result: {} }));
1163
1193
  return;
1164
1194
  }
1165
- if (msg.id !== initId)
1195
+ if (envelope.kind !== 'response')
1166
1196
  return;
1197
+ const namesNoRequest = msg.id === null || !Object.hasOwn(msg, 'id');
1198
+ const answersInitialize = msg.id === initId || (namesNoRequest && msg.jsonrpc === '2.0' && Boolean(msg.error));
1199
+ if (!answersInitialize) {
1200
+ if (typeof msg.id !== 'string' && typeof msg.id !== 'number' && isJsonRpcError(msg)) {
1201
+ console.error(unmatchedResponse(config.id, msg, (text) => redactServerText(text, config)));
1202
+ }
1203
+ return;
1204
+ }
1167
1205
  cleanup();
1168
1206
  if (msg.error) {
1169
1207
  // describeCause rather than the template's own conversion: the
@@ -1486,8 +1524,9 @@ export class McplServerConnection extends EventEmitter {
1486
1524
  * following `nextCursor` across pages (2024-11-05 pagination). Cursors are
1487
1525
  * opaque strings, `''` included: only an absent or null `nextCursor` ends
1488
1526
  * the inventory (a null one is how some servers say "no more", and main
1489
- * read it as a complete page). A page that isn't well formed (no `tools` array, a cursor
1490
- * that isn't a string), or cursors that don't terminate (a repeat, or more
1527
+ * read it as a complete page). A page that isn't well formed (no `tools` array, an entry
1528
+ * that isn't an object with a string `name`, a cursor that isn't a string), or cursors
1529
+ * that don't terminate (a repeat, or more
1491
1530
  * than {@link MAX_TOOL_LIST_PAGES} pages), are errors, never a partial or
1492
1531
  * empty inventory published as complete. The read tap (RFC-014) is handed
1493
1532
  * the complete inventory once, with the last page's `_meta`, as the last
@@ -1502,10 +1541,13 @@ export class McplServerConnection extends EventEmitter {
1502
1541
  let first;
1503
1542
  const read = [];
1504
1543
  const revs = new Set();
1544
+ const isTool = (entry) => !!entry && typeof entry === 'object' && typeof entry.name === 'string';
1505
1545
  const onRead = (result) => {
1506
1546
  if (!result || typeof result !== 'object' || !Array.isArray(result.tools))
1507
1547
  return;
1508
1548
  const r = result;
1549
+ if (!r.tools.every(isTool))
1550
+ return;
1509
1551
  for (const t of r.tools)
1510
1552
  read.push(t);
1511
1553
  const rev = r._meta?.['mcpl/rev'];
@@ -1524,6 +1566,9 @@ export class McplServerConnection extends EventEmitter {
1524
1566
  if (!result || typeof result !== 'object' || !Array.isArray(result.tools)) {
1525
1567
  throw malformed('no tools array');
1526
1568
  }
1569
+ const unreadable = result.tools.findIndex((entry) => !isTool(entry));
1570
+ if (unreadable !== -1)
1571
+ throw malformed(`entry ${unreadable + 1} isn't an object with a string name`);
1527
1572
  first ??= result;
1528
1573
  for (const t of result.tools)
1529
1574
  tools.push(t);
@@ -2103,23 +2148,46 @@ export class McplServerConnection extends EventEmitter {
2103
2148
  }
2104
2149
  /** Contain synchronous dispatch failures; async RPC handlers own their promises. */
2105
2150
  dispatchMessage(msg, epoch) {
2106
- // Is this a response to one of our outbound requests?
2107
- if ('id' in msg && msg.id != null && !('method' in msg)) {
2108
- const late = epoch !== this.transportEpoch;
2109
- // RFC-014: its hints apply as it's read, whether or not anyone still
2110
- // waits for it. A dead transport's revs are its own, so a response
2111
- // read after its boundary is never tapped.
2112
- if (!late)
2113
- this.tapResponse(msg);
2114
- this.handleResponse(msg, late);
2115
- return;
2151
+ // The envelope is read once, here (src/jsonrpc-envelope.ts says how).
2152
+ const envelope = readEnvelope(msg);
2153
+ switch (envelope.kind) {
2154
+ case 'response': {
2155
+ // Never answered, so a server that answers what it can't read, with
2156
+ // id null, can't start an exchange of errors with us. One read after
2157
+ // its transport's boundary is late (handleResponse).
2158
+ const late = epoch !== this.transportEpoch;
2159
+ // RFC-014: its hints apply as it's read, whether or not anyone still
2160
+ // waits for it. A dead transport's revs are its own, so a response
2161
+ // read after its boundary is never tapped.
2162
+ if (!late)
2163
+ this.tapResponse(msg);
2164
+ this.handleResponse(msg, late);
2165
+ return;
2166
+ }
2167
+ case 'neither':
2168
+ // Not JSON-RPC: ignored like the server's other unrelated output.
2169
+ return;
2170
+ case 'invalid': {
2171
+ // Answered on the transport it came on, as every request is. One
2172
+ // read after that transport's boundary is the dead process's and
2173
+ // isn't answered: sendErrorResponse logs the answer it didn't send.
2174
+ this.sendErrorResponse(envelope.id, envelope.error.code, envelope.error.message, undefined, epoch);
2175
+ if (epoch !== this.transportEpoch)
2176
+ return;
2177
+ const forMethod = envelope.method !== undefined ? ` for method ${logValue(envelope.method)}` : '';
2178
+ console.error(`[mcpl] ${this.id}: answered -32600 to an invalid request${forMethod}: ${envelope.problems}`);
2179
+ return;
2180
+ }
2116
2181
  }
2117
- // It is an inbound request or notification from the server
2182
+ // It is an inbound request or notification from the server, its method
2183
+ // a string. A request's id is a string, a number or null, and `"id": null`
2184
+ // is answered with id null; a notification has none.
2118
2185
  const request = msg;
2186
+ const requestId = envelope.kind === 'request' ? envelope.id : undefined;
2119
2187
  // Read after its transport's boundary, it is the dead process's: the
2120
2188
  // boundary's rule applies (afterBoundary).
2121
2189
  if (epoch !== this.transportEpoch) {
2122
- this.afterBoundary(request, epoch);
2190
+ this.afterBoundary(request, requestId, epoch);
2123
2191
  return;
2124
2192
  }
2125
2193
  // MCP's ping, which either side may send: its receiver answers promptly
@@ -2128,8 +2196,8 @@ export class McplServerConnection extends EventEmitter {
2128
2196
  // paused plane mustn't hold that answer. A ping sent as a notification
2129
2197
  // has nothing to answer. The handshake answers one too.
2130
2198
  if (request.method === 'ping') {
2131
- if (request.id != null)
2132
- this.sendResponse(request.id, {});
2199
+ if (requestId !== undefined)
2200
+ this.sendResponse(requestId, {});
2133
2201
  return;
2134
2202
  }
2135
2203
  // RFC-014 §6.1: a push's hints apply as it's read, before the plane gate
@@ -2140,11 +2208,11 @@ export class McplServerConnection extends EventEmitter {
2140
2208
  this.tap({ kind: 'push', params: request.params });
2141
2209
  else if (request.method === 'tools/hints' && this.readTap) {
2142
2210
  this.tap({ kind: 'hints', params: request.params });
2143
- if (request.id != null)
2144
- this.sendResponse(request.id, {});
2211
+ if (requestId !== undefined)
2212
+ this.sendResponse(requestId, {});
2145
2213
  return;
2146
2214
  }
2147
- const eventName = typeof request.method === 'string' && Object.hasOwn(McplServerConnection.METHOD_TO_EVENT, request.method)
2215
+ const eventName = Object.hasOwn(McplServerConnection.METHOD_TO_EVENT, request.method)
2148
2216
  ? McplServerConnection.METHOD_TO_EVENT[request.method] : undefined;
2149
2217
  // §7 is removed in 0.5.0: scope/elevate is no longer a method. Answer
2150
2218
  // rather than hang (§6.6 — a method that will never be answered MUST
@@ -2155,8 +2223,8 @@ export class McplServerConnection extends EventEmitter {
2155
2223
  // routed, control-plane classified, and mutating declarations — a
2156
2224
  // live ungated self-attestation path (PR #79 review blocker 4).
2157
2225
  if (request.method === McplMethod.FeatureSetsChanged) {
2158
- if (request.id != null) {
2159
- this.sendErrorResponse(request.id, -32601, 'featureSets/changed removed in MCPL 0.5.0 (superseded by mcpl/manifestChanged, SPEC §17)');
2226
+ if (requestId !== undefined) {
2227
+ this.sendErrorResponse(requestId, -32601, 'featureSets/changed removed in MCPL 0.5.0 (superseded by mcpl/manifestChanged, SPEC §17)');
2160
2228
  }
2161
2229
  else {
2162
2230
  console.error(`[mcpl] ${this.id}: discarded featureSets/changed — removed in 0.5.0 (§6.7/§17)`);
@@ -2164,8 +2232,8 @@ export class McplServerConnection extends EventEmitter {
2164
2232
  return;
2165
2233
  }
2166
2234
  if (request.method === McplMethod.ScopeElevate) {
2167
- if (request.id != null) {
2168
- this.sendErrorResponse(request.id, -32601, 'scope/elevate removed in MCPL 0.5.0 (SPEC §7)');
2235
+ if (requestId !== undefined) {
2236
+ this.sendErrorResponse(requestId, -32601, 'scope/elevate removed in MCPL 0.5.0 (SPEC §7)');
2169
2237
  }
2170
2238
  return;
2171
2239
  }
@@ -2175,19 +2243,18 @@ export class McplServerConnection extends EventEmitter {
2175
2243
  // rejecting here, at line receipt, was wrong for staged connections.
2176
2244
  if (!eventName) {
2177
2245
  // §6.6: a request that will never be answered MUST get an error, so a
2178
- // request (it has an id) whose method isn't a string, or isn't one this
2179
- // host handles, is answered -32601. A notification nobody handles is
2180
- // ignored, as JSON-RPC asks.
2181
- if (request.id != null) {
2182
- this.sendErrorResponse(request.id, -32601, 'Method not found');
2183
- console.error(`[mcpl] ${this.id}: answered -32601 to a request for ${describeMethod(request.method)}, which this host doesn't handle`);
2246
+ // request whose method isn't one this host handles is answered -32601.
2247
+ // A notification nobody handles is ignored, as JSON-RPC asks.
2248
+ if (requestId !== undefined) {
2249
+ this.sendErrorResponse(requestId, -32601, 'Method not found');
2250
+ console.error(`[mcpl] ${this.id}: answered -32601 to a request for method ${logValue(request.method)}, which this host doesn't handle`);
2184
2251
  }
2185
2252
  return;
2186
2253
  }
2187
2254
  // Emit the typed event with params and (for requests) a respond callback
2188
- if (request.id != null) {
2255
+ if (requestId !== undefined) {
2189
2256
  // Server expects a response — provide a respond helper
2190
- this.dispatchInboundEvent(eventName, request.params, this.responderFor(request.id, epoch));
2257
+ this.dispatchInboundEvent(eventName, request.params, this.responderFor(requestId, epoch));
2191
2258
  }
2192
2259
  else {
2193
2260
  // Notification — no response expected
@@ -2197,7 +2264,8 @@ export class McplServerConnection extends EventEmitter {
2197
2264
  /**
2198
2265
  * A request's responder, bound to the transport it came on (`epoch`): an
2199
2266
  * answer, or a streamed inference's chunk, sent after that transport has
2200
- * closed reaches nothing, never a server that didn't ask it.
2267
+ * closed reaches nothing, never a server that didn't ask it. A request
2268
+ * sent with id null is answered with id null.
2201
2269
  */
2202
2270
  responderFor(id, epoch) {
2203
2271
  return {
@@ -2222,15 +2290,15 @@ export class McplServerConnection extends EventEmitter {
2222
2290
  * it while its writer lives, with no grant to come, so it drops and logs
2223
2291
  * all of it; hold's bounds cap what any other keeps.
2224
2292
  */
2225
- afterBoundary(request, epoch) {
2226
- const event = typeof request.method === 'string' && Object.hasOwn(McplServerConnection.METHOD_TO_EVENT, request.method)
2293
+ afterBoundary(request, requestId, epoch) {
2294
+ const event = Object.hasOwn(McplServerConnection.METHOD_TO_EVENT, request.method)
2227
2295
  ? McplServerConnection.METHOD_TO_EVENT[request.method] : undefined;
2228
2296
  if (this.closedForGood || event === undefined || !McplServerConnection.WORLD_EVENTS.has(event)) {
2229
2297
  console.error(`[mcpl] ${this.id}: dropped a message read after its transport closed` +
2230
- `${this.closedForGood ? ', with no transport to come' : ''}: ${describeMethod(request.method)}`);
2298
+ `${this.closedForGood ? ', with no transport to come' : ''}: method ${logValue(request.method)}`);
2231
2299
  return;
2232
2300
  }
2233
- this.hold(event, request.id != null ? [request.params, this.responderFor(request.id, epoch)] : [request.params], true);
2301
+ this.hold(event, requestId !== undefined ? [request.params, this.responderFor(requestId, epoch)] : [request.params], true);
2234
2302
  }
2235
2303
  /** Live delivery and delayed plane flushes share the same containment boundary. */
2236
2304
  dispatchInboundEvent(event, ...args) {
@@ -2283,7 +2351,7 @@ export class McplServerConnection extends EventEmitter {
2283
2351
  /** Tap a response to a hinted request (RFC-014): its result's hints, or a
2284
2352
  * list's statement, apply now, awaited or not. */
2285
2353
  tapResponse(response) {
2286
- if (!this.readTap)
2354
+ if (!this.readTap || response.id === null)
2287
2355
  return;
2288
2356
  const sent = this.hintedRequests.get(response.id);
2289
2357
  if (!sent)
@@ -2298,6 +2366,16 @@ export class McplServerConnection extends EventEmitter {
2298
2366
  * Handle a JSON-RPC response by resolving/rejecting the corresponding pending request.
2299
2367
  */
2300
2368
  handleResponse(response, late = false) {
2369
+ // A response whose id is neither a string nor a number, or that has
2370
+ // none, can't be matched to a request of ours, on this transport or an
2371
+ // earlier one. It isn't an orphan, which is a late answer to one, so
2372
+ // it's ignored, and logged when it's a JSON-RPC 2.0 error.
2373
+ if (typeof response.id !== 'string' && typeof response.id !== 'number') {
2374
+ if (isJsonRpcError(response)) {
2375
+ console.error(unmatchedResponse(this.id, response, (this.redactor ??= serverTextRedactor(this.config ?? {})).now()));
2376
+ }
2377
+ return;
2378
+ }
2301
2379
  // One read after its transport's boundary answers a request the close
2302
2380
  // ended. It's matched against none of this connection's request records,
2303
2381
  // since the next transport numbers its requests afresh, and goes the way