@posthog/agent 1.26.0 → 1.27.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 (571) hide show
  1. package/dist/index.d.ts +1274 -20
  2. package/dist/index.js +7296 -11
  3. package/dist/index.js.map +1 -1
  4. package/package.json +6 -12
  5. package/src/agent.ts +42 -5
  6. package/src/types.ts +1 -1
  7. package/dist/_virtual/_commonjsHelpers.js +0 -6
  8. package/dist/_virtual/_commonjsHelpers.js.map +0 -1
  9. package/dist/_virtual/_tslib.js +0 -74
  10. package/dist/_virtual/_tslib.js.map +0 -1
  11. package/dist/_virtual/additionalItems.js +0 -4
  12. package/dist/_virtual/additionalItems.js.map +0 -1
  13. package/dist/_virtual/additionalProperties.js +0 -4
  14. package/dist/_virtual/additionalProperties.js.map +0 -1
  15. package/dist/_virtual/ajv.js +0 -4
  16. package/dist/_virtual/ajv.js.map +0 -1
  17. package/dist/_virtual/allOf.js +0 -4
  18. package/dist/_virtual/allOf.js.map +0 -1
  19. package/dist/_virtual/anyOf.js +0 -4
  20. package/dist/_virtual/anyOf.js.map +0 -1
  21. package/dist/_virtual/applicability.js +0 -4
  22. package/dist/_virtual/applicability.js.map +0 -1
  23. package/dist/_virtual/boolSchema.js +0 -4
  24. package/dist/_virtual/boolSchema.js.map +0 -1
  25. package/dist/_virtual/code.js +0 -4
  26. package/dist/_virtual/code.js.map +0 -1
  27. package/dist/_virtual/code2.js +0 -4
  28. package/dist/_virtual/code2.js.map +0 -1
  29. package/dist/_virtual/const.js +0 -4
  30. package/dist/_virtual/const.js.map +0 -1
  31. package/dist/_virtual/contains.js +0 -4
  32. package/dist/_virtual/contains.js.map +0 -1
  33. package/dist/_virtual/core.js +0 -4
  34. package/dist/_virtual/core.js.map +0 -1
  35. package/dist/_virtual/dataType.js +0 -4
  36. package/dist/_virtual/dataType.js.map +0 -1
  37. package/dist/_virtual/defaults.js +0 -4
  38. package/dist/_virtual/defaults.js.map +0 -1
  39. package/dist/_virtual/dependencies.js +0 -4
  40. package/dist/_virtual/dependencies.js.map +0 -1
  41. package/dist/_virtual/draft7.js +0 -4
  42. package/dist/_virtual/draft7.js.map +0 -1
  43. package/dist/_virtual/enum.js +0 -4
  44. package/dist/_virtual/enum.js.map +0 -1
  45. package/dist/_virtual/equal.js +0 -4
  46. package/dist/_virtual/equal.js.map +0 -1
  47. package/dist/_virtual/errors.js +0 -4
  48. package/dist/_virtual/errors.js.map +0 -1
  49. package/dist/_virtual/format.js +0 -4
  50. package/dist/_virtual/format.js.map +0 -1
  51. package/dist/_virtual/formats.js +0 -4
  52. package/dist/_virtual/formats.js.map +0 -1
  53. package/dist/_virtual/id.js +0 -4
  54. package/dist/_virtual/id.js.map +0 -1
  55. package/dist/_virtual/if.js +0 -4
  56. package/dist/_virtual/if.js.map +0 -1
  57. package/dist/_virtual/index.js +0 -4
  58. package/dist/_virtual/index.js.map +0 -1
  59. package/dist/_virtual/index10.js +0 -4
  60. package/dist/_virtual/index10.js.map +0 -1
  61. package/dist/_virtual/index11.js +0 -4
  62. package/dist/_virtual/index11.js.map +0 -1
  63. package/dist/_virtual/index2.js +0 -4
  64. package/dist/_virtual/index2.js.map +0 -1
  65. package/dist/_virtual/index3.js +0 -4
  66. package/dist/_virtual/index3.js.map +0 -1
  67. package/dist/_virtual/index4.js +0 -4
  68. package/dist/_virtual/index4.js.map +0 -1
  69. package/dist/_virtual/index5.js +0 -4
  70. package/dist/_virtual/index5.js.map +0 -1
  71. package/dist/_virtual/index6.js +0 -4
  72. package/dist/_virtual/index6.js.map +0 -1
  73. package/dist/_virtual/index7.js +0 -4
  74. package/dist/_virtual/index7.js.map +0 -1
  75. package/dist/_virtual/index8.js +0 -4
  76. package/dist/_virtual/index8.js.map +0 -1
  77. package/dist/_virtual/index9.js +0 -4
  78. package/dist/_virtual/index9.js.map +0 -1
  79. package/dist/_virtual/items.js +0 -4
  80. package/dist/_virtual/items.js.map +0 -1
  81. package/dist/_virtual/items2020.js +0 -4
  82. package/dist/_virtual/items2020.js.map +0 -1
  83. package/dist/_virtual/keyword.js +0 -4
  84. package/dist/_virtual/keyword.js.map +0 -1
  85. package/dist/_virtual/limit.js +0 -4
  86. package/dist/_virtual/limit.js.map +0 -1
  87. package/dist/_virtual/limitItems.js +0 -4
  88. package/dist/_virtual/limitItems.js.map +0 -1
  89. package/dist/_virtual/limitLength.js +0 -4
  90. package/dist/_virtual/limitLength.js.map +0 -1
  91. package/dist/_virtual/limitNumber.js +0 -4
  92. package/dist/_virtual/limitNumber.js.map +0 -1
  93. package/dist/_virtual/limitProperties.js +0 -4
  94. package/dist/_virtual/limitProperties.js.map +0 -1
  95. package/dist/_virtual/metadata.js +0 -4
  96. package/dist/_virtual/metadata.js.map +0 -1
  97. package/dist/_virtual/multipleOf.js +0 -4
  98. package/dist/_virtual/multipleOf.js.map +0 -1
  99. package/dist/_virtual/names.js +0 -4
  100. package/dist/_virtual/names.js.map +0 -1
  101. package/dist/_virtual/not.js +0 -4
  102. package/dist/_virtual/not.js.map +0 -1
  103. package/dist/_virtual/oneOf.js +0 -4
  104. package/dist/_virtual/oneOf.js.map +0 -1
  105. package/dist/_virtual/pattern.js +0 -4
  106. package/dist/_virtual/pattern.js.map +0 -1
  107. package/dist/_virtual/patternProperties.js +0 -4
  108. package/dist/_virtual/patternProperties.js.map +0 -1
  109. package/dist/_virtual/prefixItems.js +0 -4
  110. package/dist/_virtual/prefixItems.js.map +0 -1
  111. package/dist/_virtual/properties.js +0 -4
  112. package/dist/_virtual/properties.js.map +0 -1
  113. package/dist/_virtual/propertyNames.js +0 -4
  114. package/dist/_virtual/propertyNames.js.map +0 -1
  115. package/dist/_virtual/ref.js +0 -4
  116. package/dist/_virtual/ref.js.map +0 -1
  117. package/dist/_virtual/ref_error.js +0 -4
  118. package/dist/_virtual/ref_error.js.map +0 -1
  119. package/dist/_virtual/required.js +0 -4
  120. package/dist/_virtual/required.js.map +0 -1
  121. package/dist/_virtual/resolve.js +0 -4
  122. package/dist/_virtual/resolve.js.map +0 -1
  123. package/dist/_virtual/rules.js +0 -4
  124. package/dist/_virtual/rules.js.map +0 -1
  125. package/dist/_virtual/scope.js +0 -4
  126. package/dist/_virtual/scope.js.map +0 -1
  127. package/dist/_virtual/subschema.js +0 -4
  128. package/dist/_virtual/subschema.js.map +0 -1
  129. package/dist/_virtual/thenElse.js +0 -4
  130. package/dist/_virtual/thenElse.js.map +0 -1
  131. package/dist/_virtual/types.js +0 -4
  132. package/dist/_virtual/types.js.map +0 -1
  133. package/dist/_virtual/ucs2length.js +0 -4
  134. package/dist/_virtual/ucs2length.js.map +0 -1
  135. package/dist/_virtual/uniqueItems.js +0 -4
  136. package/dist/_virtual/uniqueItems.js.map +0 -1
  137. package/dist/_virtual/uri.js +0 -4
  138. package/dist/_virtual/uri.js.map +0 -1
  139. package/dist/_virtual/util.js +0 -4
  140. package/dist/_virtual/util.js.map +0 -1
  141. package/dist/_virtual/validation_error.js +0 -4
  142. package/dist/_virtual/validation_error.js.map +0 -1
  143. package/dist/example-client.d.ts +0 -3
  144. package/dist/example-client.d.ts.map +0 -1
  145. package/dist/example.d.ts +0 -3
  146. package/dist/example.d.ts.map +0 -1
  147. package/dist/index.d.ts.map +0 -1
  148. package/dist/node_modules/@agentclientprotocol/sdk/dist/acp.js +0 -891
  149. package/dist/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +0 -1
  150. package/dist/node_modules/@agentclientprotocol/sdk/dist/schema.js +0 -876
  151. package/dist/node_modules/@agentclientprotocol/sdk/dist/schema.js.map +0 -1
  152. package/dist/node_modules/@agentclientprotocol/sdk/dist/stream.js +0 -66
  153. package/dist/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +0 -1
  154. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +0 -23
  155. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +0 -1
  156. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +0 -331
  157. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +0 -1
  158. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +0 -717
  159. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +0 -1
  160. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +0 -221
  161. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +0 -1
  162. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +0 -56
  163. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +0 -1
  164. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +0 -440
  165. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +0 -1
  166. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js +0 -94
  167. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js.map +0 -1
  168. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +0 -1610
  169. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +0 -1
  170. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +0 -91
  171. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +0 -1
  172. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/ZodError.js +0 -133
  173. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/ZodError.js.map +0 -1
  174. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/errors.js +0 -9
  175. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/errors.js.map +0 -1
  176. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/errorUtil.js +0 -9
  177. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/errorUtil.js.map +0 -1
  178. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/parseUtil.js +0 -112
  179. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/parseUtil.js.map +0 -1
  180. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/util.js +0 -136
  181. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/util.js.map +0 -1
  182. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/locales/en.js +0 -112
  183. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/locales/en.js.map +0 -1
  184. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/types.js +0 -3297
  185. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/types.js.map +0 -1
  186. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/errors.js +0 -44
  187. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/errors.js.map +0 -1
  188. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/iso.js +0 -36
  189. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/iso.js.map +0 -1
  190. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/parse.js +0 -10
  191. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/parse.js.map +0 -1
  192. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/schemas.js +0 -657
  193. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/schemas.js.map +0 -1
  194. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/api.js +0 -449
  195. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/api.js.map +0 -1
  196. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/checks.js +0 -413
  197. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/checks.js.map +0 -1
  198. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/core.js +0 -57
  199. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/core.js.map +0 -1
  200. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/doc.js +0 -38
  201. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/doc.js.map +0 -1
  202. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/errors.js +0 -86
  203. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/errors.js.map +0 -1
  204. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/parse.js +0 -61
  205. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/parse.js.map +0 -1
  206. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/regexes.js +0 -80
  207. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/regexes.js.map +0 -1
  208. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/registries.js +0 -52
  209. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/registries.js.map +0 -1
  210. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/schemas.js +0 -1307
  211. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/schemas.js.map +0 -1
  212. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/to-json-schema.js +0 -842
  213. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/to-json-schema.js.map +0 -1
  214. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/util.js +0 -335
  215. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/util.js.map +0 -1
  216. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/versions.js +0 -8
  217. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/versions.js.map +0 -1
  218. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/mini/schemas.js +0 -51
  219. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/mini/schemas.js.map +0 -1
  220. package/dist/node_modules/ajv/dist/ajv.js +0 -69
  221. package/dist/node_modules/ajv/dist/ajv.js.map +0 -1
  222. package/dist/node_modules/ajv/dist/compile/codegen/code.js +0 -169
  223. package/dist/node_modules/ajv/dist/compile/codegen/code.js.map +0 -1
  224. package/dist/node_modules/ajv/dist/compile/codegen/index.js +0 -712
  225. package/dist/node_modules/ajv/dist/compile/codegen/index.js.map +0 -1
  226. package/dist/node_modules/ajv/dist/compile/codegen/scope.js +0 -157
  227. package/dist/node_modules/ajv/dist/compile/codegen/scope.js.map +0 -1
  228. package/dist/node_modules/ajv/dist/compile/errors.js +0 -140
  229. package/dist/node_modules/ajv/dist/compile/errors.js.map +0 -1
  230. package/dist/node_modules/ajv/dist/compile/index.js +0 -253
  231. package/dist/node_modules/ajv/dist/compile/index.js.map +0 -1
  232. package/dist/node_modules/ajv/dist/compile/names.js +0 -40
  233. package/dist/node_modules/ajv/dist/compile/names.js.map +0 -1
  234. package/dist/node_modules/ajv/dist/compile/ref_error.js +0 -25
  235. package/dist/node_modules/ajv/dist/compile/ref_error.js.map +0 -1
  236. package/dist/node_modules/ajv/dist/compile/resolve.js +0 -162
  237. package/dist/node_modules/ajv/dist/compile/resolve.js.map +0 -1
  238. package/dist/node_modules/ajv/dist/compile/rules.js +0 -29
  239. package/dist/node_modules/ajv/dist/compile/rules.js.map +0 -1
  240. package/dist/node_modules/ajv/dist/compile/util.js +0 -183
  241. package/dist/node_modules/ajv/dist/compile/util.js.map +0 -1
  242. package/dist/node_modules/ajv/dist/compile/validate/applicability.js +0 -30
  243. package/dist/node_modules/ajv/dist/compile/validate/applicability.js.map +0 -1
  244. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +0 -64
  245. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js.map +0 -1
  246. package/dist/node_modules/ajv/dist/compile/validate/dataType.js +0 -213
  247. package/dist/node_modules/ajv/dist/compile/validate/dataType.js.map +0 -1
  248. package/dist/node_modules/ajv/dist/compile/validate/defaults.js +0 -49
  249. package/dist/node_modules/ajv/dist/compile/validate/defaults.js.map +0 -1
  250. package/dist/node_modules/ajv/dist/compile/validate/index.js +0 -544
  251. package/dist/node_modules/ajv/dist/compile/validate/index.js.map +0 -1
  252. package/dist/node_modules/ajv/dist/compile/validate/keyword.js +0 -139
  253. package/dist/node_modules/ajv/dist/compile/validate/keyword.js.map +0 -1
  254. package/dist/node_modules/ajv/dist/compile/validate/subschema.js +0 -95
  255. package/dist/node_modules/ajv/dist/compile/validate/subschema.js.map +0 -1
  256. package/dist/node_modules/ajv/dist/core.js +0 -639
  257. package/dist/node_modules/ajv/dist/core.js.map +0 -1
  258. package/dist/node_modules/ajv/dist/refs/data.json.js +0 -31
  259. package/dist/node_modules/ajv/dist/refs/data.json.js.map +0 -1
  260. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +0 -254
  261. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +0 -1
  262. package/dist/node_modules/ajv/dist/runtime/equal.js +0 -9
  263. package/dist/node_modules/ajv/dist/runtime/equal.js.map +0 -1
  264. package/dist/node_modules/ajv/dist/runtime/ucs2length.js +0 -25
  265. package/dist/node_modules/ajv/dist/runtime/ucs2length.js.map +0 -1
  266. package/dist/node_modules/ajv/dist/runtime/uri.js +0 -8
  267. package/dist/node_modules/ajv/dist/runtime/uri.js.map +0 -1
  268. package/dist/node_modules/ajv/dist/runtime/validation_error.js +0 -22
  269. package/dist/node_modules/ajv/dist/runtime/validation_error.js.map +0 -1
  270. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +0 -53
  271. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +0 -1
  272. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -112
  273. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +0 -1
  274. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +0 -26
  275. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +0 -1
  276. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +0 -14
  277. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +0 -1
  278. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +0 -99
  279. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +0 -1
  280. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +0 -93
  281. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +0 -1
  282. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +0 -70
  283. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js.map +0 -1
  284. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +0 -77
  285. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js.map +0 -1
  286. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +0 -57
  287. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js.map +0 -1
  288. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +0 -37
  289. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +0 -1
  290. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +0 -29
  291. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js.map +0 -1
  292. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +0 -64
  293. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +0 -1
  294. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +0 -80
  295. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +0 -1
  296. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +0 -15
  297. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +0 -1
  298. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +0 -61
  299. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +0 -1
  300. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +0 -42
  301. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +0 -1
  302. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +0 -16
  303. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +0 -1
  304. package/dist/node_modules/ajv/dist/vocabularies/code.js +0 -146
  305. package/dist/node_modules/ajv/dist/vocabularies/code.js.map +0 -1
  306. package/dist/node_modules/ajv/dist/vocabularies/core/id.js +0 -11
  307. package/dist/node_modules/ajv/dist/vocabularies/core/id.js.map +0 -1
  308. package/dist/node_modules/ajv/dist/vocabularies/core/index.js +0 -21
  309. package/dist/node_modules/ajv/dist/vocabularies/core/index.js.map +0 -1
  310. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +0 -131
  311. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js.map +0 -1
  312. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +0 -113
  313. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +0 -1
  314. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +0 -12
  315. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +0 -1
  316. package/dist/node_modules/ajv/dist/vocabularies/draft7.js +0 -28
  317. package/dist/node_modules/ajv/dist/vocabularies/draft7.js.map +0 -1
  318. package/dist/node_modules/ajv/dist/vocabularies/format/format.js +0 -94
  319. package/dist/node_modules/ajv/dist/vocabularies/format/format.js.map +0 -1
  320. package/dist/node_modules/ajv/dist/vocabularies/format/index.js +0 -9
  321. package/dist/node_modules/ajv/dist/vocabularies/format/index.js.map +0 -1
  322. package/dist/node_modules/ajv/dist/vocabularies/metadata.js +0 -21
  323. package/dist/node_modules/ajv/dist/vocabularies/metadata.js.map +0 -1
  324. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +0 -31
  325. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js.map +0 -1
  326. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +0 -54
  327. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js.map +0 -1
  328. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +0 -54
  329. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js.map +0 -1
  330. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +0 -26
  331. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +0 -1
  332. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +0 -33
  333. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +0 -1
  334. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +0 -29
  335. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +0 -1
  336. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +0 -26
  337. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +0 -1
  338. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +0 -28
  339. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +0 -1
  340. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +0 -27
  341. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +0 -1
  342. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +0 -84
  343. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js.map +0 -1
  344. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +0 -72
  345. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +0 -1
  346. package/dist/node_modules/ajv-formats/dist/formats.js +0 -212
  347. package/dist/node_modules/ajv-formats/dist/formats.js.map +0 -1
  348. package/dist/node_modules/ajv-formats/dist/index.js +0 -52
  349. package/dist/node_modules/ajv-formats/dist/index.js.map +0 -1
  350. package/dist/node_modules/ajv-formats/dist/limit.js +0 -75
  351. package/dist/node_modules/ajv-formats/dist/limit.js.map +0 -1
  352. package/dist/node_modules/diff/libesm/diff/base.js +0 -256
  353. package/dist/node_modules/diff/libesm/diff/base.js.map +0 -1
  354. package/dist/node_modules/diff/libesm/diff/line.js +0 -64
  355. package/dist/node_modules/diff/libesm/diff/line.js.map +0 -1
  356. package/dist/node_modules/diff/libesm/patch/create.js +0 -185
  357. package/dist/node_modules/diff/libesm/patch/create.js.map +0 -1
  358. package/dist/node_modules/fast-deep-equal/index.js +0 -47
  359. package/dist/node_modules/fast-deep-equal/index.js.map +0 -1
  360. package/dist/node_modules/fast-uri/index.js +0 -347
  361. package/dist/node_modules/fast-uri/index.js.map +0 -1
  362. package/dist/node_modules/fast-uri/lib/schemes.js +0 -255
  363. package/dist/node_modules/fast-uri/lib/schemes.js.map +0 -1
  364. package/dist/node_modules/fast-uri/lib/utils.js +0 -334
  365. package/dist/node_modules/fast-uri/lib/utils.js.map +0 -1
  366. package/dist/node_modules/json-schema-traverse/index.js +0 -98
  367. package/dist/node_modules/json-schema-traverse/index.js.map +0 -1
  368. package/dist/node_modules/uuid/dist/rng.js +0 -14
  369. package/dist/node_modules/uuid/dist/rng.js.map +0 -1
  370. package/dist/node_modules/uuid/dist/stringify.js +0 -29
  371. package/dist/node_modules/uuid/dist/stringify.js.map +0 -1
  372. package/dist/node_modules/uuid/dist/v7.js +0 -65
  373. package/dist/node_modules/uuid/dist/v7.js.map +0 -1
  374. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js +0 -37
  375. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js.map +0 -1
  376. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js +0 -26
  377. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +0 -1
  378. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +0 -17
  379. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +0 -1
  380. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +0 -11
  381. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +0 -1
  382. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js +0 -66
  383. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +0 -1
  384. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +0 -21
  385. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +0 -1
  386. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +0 -30
  387. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +0 -1
  388. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +0 -53
  389. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +0 -1
  390. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +0 -8
  391. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +0 -1
  392. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +0 -8
  393. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +0 -1
  394. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +0 -8
  395. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +0 -1
  396. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +0 -50
  397. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +0 -1
  398. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +0 -11
  399. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +0 -1
  400. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +0 -11
  401. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +0 -1
  402. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +0 -9
  403. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +0 -1
  404. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +0 -56
  405. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +0 -1
  406. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +0 -24
  407. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +0 -1
  408. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +0 -30
  409. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +0 -1
  410. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +0 -19
  411. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +0 -1
  412. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +0 -15
  413. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +0 -1
  414. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +0 -13
  415. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +0 -1
  416. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +0 -37
  417. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +0 -1
  418. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +0 -56
  419. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +0 -1
  420. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +0 -76
  421. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +0 -1
  422. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +0 -25
  423. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +0 -1
  424. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +0 -24
  425. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +0 -1
  426. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +0 -8
  427. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +0 -1
  428. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +0 -8
  429. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +0 -1
  430. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +0 -65
  431. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +0 -1
  432. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +0 -24
  433. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +0 -1
  434. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +0 -350
  435. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +0 -1
  436. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +0 -36
  437. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +0 -1
  438. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +0 -10
  439. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +0 -1
  440. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +0 -84
  441. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +0 -1
  442. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +0 -8
  443. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +0 -1
  444. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js +0 -109
  445. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +0 -1
  446. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +0 -90
  447. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +0 -1
  448. package/dist/node_modules/zod-to-json-schema/node_modules/zod/v3/types.js +0 -42
  449. package/dist/node_modules/zod-to-json-schema/node_modules/zod/v3/types.js.map +0 -1
  450. package/dist/package.json.js +0 -8
  451. package/dist/package.json.js.map +0 -1
  452. package/dist/src/acp-extensions.d.ts +0 -91
  453. package/dist/src/acp-extensions.d.ts.map +0 -1
  454. package/dist/src/acp-extensions.js +0 -38
  455. package/dist/src/acp-extensions.js.map +0 -1
  456. package/dist/src/adapters/claude/claude.d.ts +0 -136
  457. package/dist/src/adapters/claude/claude.d.ts.map +0 -1
  458. package/dist/src/adapters/claude/claude.js +0 -1128
  459. package/dist/src/adapters/claude/claude.js.map +0 -1
  460. package/dist/src/adapters/claude/mcp-server.d.ts +0 -30
  461. package/dist/src/adapters/claude/mcp-server.d.ts.map +0 -1
  462. package/dist/src/adapters/claude/mcp-server.js +0 -668
  463. package/dist/src/adapters/claude/mcp-server.js.map +0 -1
  464. package/dist/src/adapters/claude/tools.d.ts +0 -35
  465. package/dist/src/adapters/claude/tools.d.ts.map +0 -1
  466. package/dist/src/adapters/claude/tools.js +0 -473
  467. package/dist/src/adapters/claude/tools.js.map +0 -1
  468. package/dist/src/adapters/claude/utils.d.ts +0 -48
  469. package/dist/src/adapters/claude/utils.d.ts.map +0 -1
  470. package/dist/src/adapters/claude/utils.js +0 -158
  471. package/dist/src/adapters/claude/utils.js.map +0 -1
  472. package/dist/src/agent.d.ts +0 -58
  473. package/dist/src/agent.d.ts.map +0 -1
  474. package/dist/src/agent.js +0 -576
  475. package/dist/src/agent.js.map +0 -1
  476. package/dist/src/agents/execution.d.ts +0 -2
  477. package/dist/src/agents/execution.d.ts.map +0 -1
  478. package/dist/src/agents/execution.js +0 -40
  479. package/dist/src/agents/execution.js.map +0 -1
  480. package/dist/src/agents/planning.d.ts +0 -2
  481. package/dist/src/agents/planning.d.ts.map +0 -1
  482. package/dist/src/agents/planning.js +0 -63
  483. package/dist/src/agents/planning.js.map +0 -1
  484. package/dist/src/agents/research.d.ts +0 -2
  485. package/dist/src/agents/research.d.ts.map +0 -1
  486. package/dist/src/agents/research.js +0 -163
  487. package/dist/src/agents/research.js.map +0 -1
  488. package/dist/src/file-manager.d.ts +0 -43
  489. package/dist/src/file-manager.d.ts.map +0 -1
  490. package/dist/src/file-manager.js +0 -266
  491. package/dist/src/file-manager.js.map +0 -1
  492. package/dist/src/git-manager.d.ts +0 -79
  493. package/dist/src/git-manager.d.ts.map +0 -1
  494. package/dist/src/git-manager.js +0 -454
  495. package/dist/src/git-manager.js.map +0 -1
  496. package/dist/src/posthog-api.d.ts +0 -48
  497. package/dist/src/posthog-api.d.ts.map +0 -1
  498. package/dist/src/posthog-api.js +0 -260
  499. package/dist/src/posthog-api.js.map +0 -1
  500. package/dist/src/prompt-builder.d.ts +0 -49
  501. package/dist/src/prompt-builder.d.ts.map +0 -1
  502. package/dist/src/prompt-builder.js +0 -397
  503. package/dist/src/prompt-builder.js.map +0 -1
  504. package/dist/src/schemas.d.ts +0 -980
  505. package/dist/src/schemas.d.ts.map +0 -1
  506. package/dist/src/schemas.js +0 -196
  507. package/dist/src/schemas.js.map +0 -1
  508. package/dist/src/session-store.d.ts +0 -58
  509. package/dist/src/session-store.d.ts.map +0 -1
  510. package/dist/src/session-store.js +0 -206
  511. package/dist/src/session-store.js.map +0 -1
  512. package/dist/src/task-manager.d.ts +0 -25
  513. package/dist/src/task-manager.d.ts.map +0 -1
  514. package/dist/src/task-manager.js +0 -123
  515. package/dist/src/task-manager.js.map +0 -1
  516. package/dist/src/template-manager.d.ts +0 -30
  517. package/dist/src/template-manager.d.ts.map +0 -1
  518. package/dist/src/template-manager.js +0 -152
  519. package/dist/src/template-manager.js.map +0 -1
  520. package/dist/src/todo-manager.d.ts +0 -29
  521. package/dist/src/todo-manager.d.ts.map +0 -1
  522. package/dist/src/todo-manager.js +0 -135
  523. package/dist/src/todo-manager.js.map +0 -1
  524. package/dist/src/tools/registry.d.ts +0 -25
  525. package/dist/src/tools/registry.d.ts.map +0 -1
  526. package/dist/src/tools/registry.js +0 -120
  527. package/dist/src/tools/registry.js.map +0 -1
  528. package/dist/src/tools/types.d.ts +0 -80
  529. package/dist/src/tools/types.d.ts.map +0 -1
  530. package/dist/src/types.d.ts +0 -193
  531. package/dist/src/types.d.ts.map +0 -1
  532. package/dist/src/types.js +0 -11
  533. package/dist/src/types.js.map +0 -1
  534. package/dist/src/utils/logger.d.ts +0 -37
  535. package/dist/src/utils/logger.d.ts.map +0 -1
  536. package/dist/src/utils/logger.js +0 -83
  537. package/dist/src/utils/logger.js.map +0 -1
  538. package/dist/src/utils/tapped-stream.d.ts +0 -17
  539. package/dist/src/utils/tapped-stream.d.ts.map +0 -1
  540. package/dist/src/utils/tapped-stream.js +0 -45
  541. package/dist/src/utils/tapped-stream.js.map +0 -1
  542. package/dist/src/workflow/config.d.ts +0 -3
  543. package/dist/src/workflow/config.d.ts.map +0 -1
  544. package/dist/src/workflow/config.js +0 -54
  545. package/dist/src/workflow/config.js.map +0 -1
  546. package/dist/src/workflow/steps/build.d.ts +0 -3
  547. package/dist/src/workflow/steps/build.d.ts.map +0 -1
  548. package/dist/src/workflow/steps/build.js +0 -108
  549. package/dist/src/workflow/steps/build.js.map +0 -1
  550. package/dist/src/workflow/steps/finalize.d.ts +0 -3
  551. package/dist/src/workflow/steps/finalize.d.ts.map +0 -1
  552. package/dist/src/workflow/steps/finalize.js +0 -188
  553. package/dist/src/workflow/steps/finalize.js.map +0 -1
  554. package/dist/src/workflow/steps/plan.d.ts +0 -3
  555. package/dist/src/workflow/steps/plan.d.ts.map +0 -1
  556. package/dist/src/workflow/steps/plan.js +0 -136
  557. package/dist/src/workflow/steps/plan.js.map +0 -1
  558. package/dist/src/workflow/steps/research.d.ts +0 -3
  559. package/dist/src/workflow/steps/research.d.ts.map +0 -1
  560. package/dist/src/workflow/steps/research.js +0 -189
  561. package/dist/src/workflow/steps/research.js.map +0 -1
  562. package/dist/src/workflow/types.d.ts +0 -51
  563. package/dist/src/workflow/types.d.ts.map +0 -1
  564. package/dist/src/workflow/utils.d.ts +0 -12
  565. package/dist/src/workflow/utils.d.ts.map +0 -1
  566. package/dist/src/workflow/utils.js +0 -41
  567. package/dist/src/workflow/utils.js.map +0 -1
  568. package/dist/src/worktree-manager.d.ts +0 -39
  569. package/dist/src/worktree-manager.d.ts.map +0 -1
  570. package/dist/src/worktree-manager.js +0 -808
  571. package/dist/src/worktree-manager.js.map +0 -1
@@ -1,440 +0,0 @@
1
- import { safeParse } from '../server/zod-compat.js';
2
- import { CancelledNotificationSchema, ProgressNotificationSchema, PingRequestSchema, McpError, ErrorCode, isJSONRPCResponse, isJSONRPCError, isJSONRPCRequest, isJSONRPCNotification } from '../types.js';
3
- import { getMethodLiteral, parseWithCompat } from '../server/zod-json-schema-compat.js';
4
-
5
- /**
6
- * The default request timeout, in miliseconds.
7
- */
8
- const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
9
- /**
10
- * Implements MCP protocol framing on top of a pluggable transport, including
11
- * features like request/response linking, notifications, and progress.
12
- */
13
- class Protocol {
14
- constructor(_options) {
15
- this._options = _options;
16
- this._requestMessageId = 0;
17
- this._requestHandlers = new Map();
18
- this._requestHandlerAbortControllers = new Map();
19
- this._notificationHandlers = new Map();
20
- this._responseHandlers = new Map();
21
- this._progressHandlers = new Map();
22
- this._timeoutInfo = new Map();
23
- this._pendingDebouncedNotifications = new Set();
24
- this.setNotificationHandler(CancelledNotificationSchema, notification => {
25
- const controller = this._requestHandlerAbortControllers.get(notification.params.requestId);
26
- controller === null || controller === void 0 ? void 0 : controller.abort(notification.params.reason);
27
- });
28
- this.setNotificationHandler(ProgressNotificationSchema, notification => {
29
- this._onprogress(notification);
30
- });
31
- this.setRequestHandler(PingRequestSchema,
32
- // Automatic pong by default.
33
- _request => ({}));
34
- }
35
- _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
36
- this._timeoutInfo.set(messageId, {
37
- timeoutId: setTimeout(onTimeout, timeout),
38
- startTime: Date.now(),
39
- timeout,
40
- maxTotalTimeout,
41
- resetTimeoutOnProgress,
42
- onTimeout
43
- });
44
- }
45
- _resetTimeout(messageId) {
46
- const info = this._timeoutInfo.get(messageId);
47
- if (!info)
48
- return false;
49
- const totalElapsed = Date.now() - info.startTime;
50
- if (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) {
51
- this._timeoutInfo.delete(messageId);
52
- throw McpError.fromError(ErrorCode.RequestTimeout, 'Maximum total timeout exceeded', {
53
- maxTotalTimeout: info.maxTotalTimeout,
54
- totalElapsed
55
- });
56
- }
57
- clearTimeout(info.timeoutId);
58
- info.timeoutId = setTimeout(info.onTimeout, info.timeout);
59
- return true;
60
- }
61
- _cleanupTimeout(messageId) {
62
- const info = this._timeoutInfo.get(messageId);
63
- if (info) {
64
- clearTimeout(info.timeoutId);
65
- this._timeoutInfo.delete(messageId);
66
- }
67
- }
68
- /**
69
- * Attaches to the given transport, starts it, and starts listening for messages.
70
- *
71
- * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.
72
- */
73
- async connect(transport) {
74
- var _a, _b, _c;
75
- this._transport = transport;
76
- const _onclose = (_a = this.transport) === null || _a === void 0 ? void 0 : _a.onclose;
77
- this._transport.onclose = () => {
78
- _onclose === null || _onclose === void 0 ? void 0 : _onclose();
79
- this._onclose();
80
- };
81
- const _onerror = (_b = this.transport) === null || _b === void 0 ? void 0 : _b.onerror;
82
- this._transport.onerror = (error) => {
83
- _onerror === null || _onerror === void 0 ? void 0 : _onerror(error);
84
- this._onerror(error);
85
- };
86
- const _onmessage = (_c = this._transport) === null || _c === void 0 ? void 0 : _c.onmessage;
87
- this._transport.onmessage = (message, extra) => {
88
- _onmessage === null || _onmessage === void 0 ? void 0 : _onmessage(message, extra);
89
- if (isJSONRPCResponse(message) || isJSONRPCError(message)) {
90
- this._onresponse(message);
91
- }
92
- else if (isJSONRPCRequest(message)) {
93
- this._onrequest(message, extra);
94
- }
95
- else if (isJSONRPCNotification(message)) {
96
- this._onnotification(message);
97
- }
98
- else {
99
- this._onerror(new Error(`Unknown message type: ${JSON.stringify(message)}`));
100
- }
101
- };
102
- await this._transport.start();
103
- }
104
- _onclose() {
105
- var _a;
106
- const responseHandlers = this._responseHandlers;
107
- this._responseHandlers = new Map();
108
- this._progressHandlers.clear();
109
- this._pendingDebouncedNotifications.clear();
110
- this._transport = undefined;
111
- (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this);
112
- const error = McpError.fromError(ErrorCode.ConnectionClosed, 'Connection closed');
113
- for (const handler of responseHandlers.values()) {
114
- handler(error);
115
- }
116
- }
117
- _onerror(error) {
118
- var _a;
119
- (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error);
120
- }
121
- _onnotification(notification) {
122
- var _a;
123
- const handler = (_a = this._notificationHandlers.get(notification.method)) !== null && _a !== void 0 ? _a : this.fallbackNotificationHandler;
124
- // Ignore notifications not being subscribed to.
125
- if (handler === undefined) {
126
- return;
127
- }
128
- // Starting with Promise.resolve() puts any synchronous errors into the monad as well.
129
- Promise.resolve()
130
- .then(() => handler(notification))
131
- .catch(error => this._onerror(new Error(`Uncaught error in notification handler: ${error}`)));
132
- }
133
- _onrequest(request, extra) {
134
- var _a, _b;
135
- const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== void 0 ? _a : this.fallbackRequestHandler;
136
- // Capture the current transport at request time to ensure responses go to the correct client
137
- const capturedTransport = this._transport;
138
- if (handler === undefined) {
139
- capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send({
140
- jsonrpc: '2.0',
141
- id: request.id,
142
- error: {
143
- code: ErrorCode.MethodNotFound,
144
- message: 'Method not found'
145
- }
146
- }).catch(error => this._onerror(new Error(`Failed to send an error response: ${error}`)));
147
- return;
148
- }
149
- const abortController = new AbortController();
150
- this._requestHandlerAbortControllers.set(request.id, abortController);
151
- const fullExtra = {
152
- signal: abortController.signal,
153
- sessionId: capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId,
154
- _meta: (_b = request.params) === null || _b === void 0 ? void 0 : _b._meta,
155
- sendNotification: notification => this.notification(notification, { relatedRequestId: request.id }),
156
- sendRequest: (r, resultSchema, options) => this.request(r, resultSchema, { ...options, relatedRequestId: request.id }),
157
- authInfo: extra === null || extra === void 0 ? void 0 : extra.authInfo,
158
- requestId: request.id,
159
- requestInfo: extra === null || extra === void 0 ? void 0 : extra.requestInfo
160
- };
161
- // Starting with Promise.resolve() puts any synchronous errors into the monad as well.
162
- Promise.resolve()
163
- .then(() => handler(request, fullExtra))
164
- .then(result => {
165
- if (abortController.signal.aborted) {
166
- return;
167
- }
168
- return capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send({
169
- result,
170
- jsonrpc: '2.0',
171
- id: request.id
172
- });
173
- }, error => {
174
- var _a;
175
- if (abortController.signal.aborted) {
176
- return;
177
- }
178
- return capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send({
179
- jsonrpc: '2.0',
180
- id: request.id,
181
- error: {
182
- code: Number.isSafeInteger(error['code']) ? error['code'] : ErrorCode.InternalError,
183
- message: (_a = error.message) !== null && _a !== void 0 ? _a : 'Internal error',
184
- ...(error['data'] !== undefined && { data: error['data'] })
185
- }
186
- });
187
- })
188
- .catch(error => this._onerror(new Error(`Failed to send response: ${error}`)))
189
- .finally(() => {
190
- this._requestHandlerAbortControllers.delete(request.id);
191
- });
192
- }
193
- _onprogress(notification) {
194
- const { progressToken, ...params } = notification.params;
195
- const messageId = Number(progressToken);
196
- const handler = this._progressHandlers.get(messageId);
197
- if (!handler) {
198
- this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`));
199
- return;
200
- }
201
- const responseHandler = this._responseHandlers.get(messageId);
202
- const timeoutInfo = this._timeoutInfo.get(messageId);
203
- if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) {
204
- try {
205
- this._resetTimeout(messageId);
206
- }
207
- catch (error) {
208
- responseHandler(error);
209
- return;
210
- }
211
- }
212
- handler(params);
213
- }
214
- _onresponse(response) {
215
- const messageId = Number(response.id);
216
- const handler = this._responseHandlers.get(messageId);
217
- if (handler === undefined) {
218
- this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`));
219
- return;
220
- }
221
- this._responseHandlers.delete(messageId);
222
- this._progressHandlers.delete(messageId);
223
- this._cleanupTimeout(messageId);
224
- if (isJSONRPCResponse(response)) {
225
- handler(response);
226
- }
227
- else {
228
- const error = McpError.fromError(response.error.code, response.error.message, response.error.data);
229
- handler(error);
230
- }
231
- }
232
- get transport() {
233
- return this._transport;
234
- }
235
- /**
236
- * Closes the connection.
237
- */
238
- async close() {
239
- var _a;
240
- await ((_a = this._transport) === null || _a === void 0 ? void 0 : _a.close());
241
- }
242
- /**
243
- * Sends a request and wait for a response.
244
- *
245
- * Do not use this method to emit notifications! Use notification() instead.
246
- */
247
- request(request, resultSchema, options) {
248
- const { relatedRequestId, resumptionToken, onresumptiontoken } = options !== null && options !== void 0 ? options : {};
249
- return new Promise((resolve, reject) => {
250
- var _a, _b, _c, _d, _e, _f;
251
- if (!this._transport) {
252
- reject(new Error('Not connected'));
253
- return;
254
- }
255
- if (((_a = this._options) === null || _a === void 0 ? void 0 : _a.enforceStrictCapabilities) === true) {
256
- this.assertCapabilityForMethod(request.method);
257
- }
258
- (_b = options === null || options === void 0 ? void 0 : options.signal) === null || _b === void 0 ? void 0 : _b.throwIfAborted();
259
- const messageId = this._requestMessageId++;
260
- const jsonrpcRequest = {
261
- ...request,
262
- jsonrpc: '2.0',
263
- id: messageId
264
- };
265
- if (options === null || options === void 0 ? void 0 : options.onprogress) {
266
- this._progressHandlers.set(messageId, options.onprogress);
267
- jsonrpcRequest.params = {
268
- ...request.params,
269
- _meta: {
270
- ...(((_c = request.params) === null || _c === void 0 ? void 0 : _c._meta) || {}),
271
- progressToken: messageId
272
- }
273
- };
274
- }
275
- const cancel = (reason) => {
276
- var _a;
277
- this._responseHandlers.delete(messageId);
278
- this._progressHandlers.delete(messageId);
279
- this._cleanupTimeout(messageId);
280
- (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({
281
- jsonrpc: '2.0',
282
- method: 'notifications/cancelled',
283
- params: {
284
- requestId: messageId,
285
- reason: String(reason)
286
- }
287
- }, { relatedRequestId, resumptionToken, onresumptiontoken }).catch(error => this._onerror(new Error(`Failed to send cancellation: ${error}`)));
288
- reject(reason);
289
- };
290
- this._responseHandlers.set(messageId, response => {
291
- var _a;
292
- if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {
293
- return;
294
- }
295
- if (response instanceof Error) {
296
- return reject(response);
297
- }
298
- try {
299
- const parseResult = safeParse(resultSchema, response.result);
300
- if (!parseResult.success) {
301
- // Type guard: if success is false, error is guaranteed to exist
302
- reject(parseResult.error);
303
- }
304
- else {
305
- resolve(parseResult.data);
306
- }
307
- }
308
- catch (error) {
309
- reject(error);
310
- }
311
- });
312
- (_d = options === null || options === void 0 ? void 0 : options.signal) === null || _d === void 0 ? void 0 : _d.addEventListener('abort', () => {
313
- var _a;
314
- cancel((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.reason);
315
- });
316
- const timeout = (_e = options === null || options === void 0 ? void 0 : options.timeout) !== null && _e !== void 0 ? _e : DEFAULT_REQUEST_TIMEOUT_MSEC;
317
- const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, 'Request timed out', { timeout }));
318
- this._setupTimeout(messageId, timeout, options === null || options === void 0 ? void 0 : options.maxTotalTimeout, timeoutHandler, (_f = options === null || options === void 0 ? void 0 : options.resetTimeoutOnProgress) !== null && _f !== void 0 ? _f : false);
319
- this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch(error => {
320
- this._cleanupTimeout(messageId);
321
- reject(error);
322
- });
323
- });
324
- }
325
- /**
326
- * Emits a notification, which is a one-way message that does not expect a response.
327
- */
328
- async notification(notification, options) {
329
- var _a, _b;
330
- if (!this._transport) {
331
- throw new Error('Not connected');
332
- }
333
- this.assertNotificationCapability(notification.method);
334
- const debouncedMethods = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.debouncedNotificationMethods) !== null && _b !== void 0 ? _b : [];
335
- // A notification can only be debounced if it's in the list AND it's "simple"
336
- // (i.e., has no parameters and no related request ID that could be lost).
337
- const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !(options === null || options === void 0 ? void 0 : options.relatedRequestId);
338
- if (canDebounce) {
339
- // If a notification of this type is already scheduled, do nothing.
340
- if (this._pendingDebouncedNotifications.has(notification.method)) {
341
- return;
342
- }
343
- // Mark this notification type as pending.
344
- this._pendingDebouncedNotifications.add(notification.method);
345
- // Schedule the actual send to happen in the next microtask.
346
- // This allows all synchronous calls in the current event loop tick to be coalesced.
347
- Promise.resolve().then(() => {
348
- var _a;
349
- // Un-mark the notification so the next one can be scheduled.
350
- this._pendingDebouncedNotifications.delete(notification.method);
351
- // SAFETY CHECK: If the connection was closed while this was pending, abort.
352
- if (!this._transport) {
353
- return;
354
- }
355
- const jsonrpcNotification = {
356
- ...notification,
357
- jsonrpc: '2.0'
358
- };
359
- // Send the notification, but don't await it here to avoid blocking.
360
- // Handle potential errors with a .catch().
361
- (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send(jsonrpcNotification, options).catch(error => this._onerror(error));
362
- });
363
- // Return immediately.
364
- return;
365
- }
366
- const jsonrpcNotification = {
367
- ...notification,
368
- jsonrpc: '2.0'
369
- };
370
- await this._transport.send(jsonrpcNotification, options);
371
- }
372
- /**
373
- * Registers a handler to invoke when this protocol object receives a request with the given method.
374
- *
375
- * Note that this will replace any previous request handler for the same method.
376
- */
377
- setRequestHandler(requestSchema, handler) {
378
- const method = getMethodLiteral(requestSchema);
379
- this.assertRequestHandlerCapability(method);
380
- this._requestHandlers.set(method, (request, extra) => {
381
- const parsed = parseWithCompat(requestSchema, request);
382
- return Promise.resolve(handler(parsed, extra));
383
- });
384
- }
385
- /**
386
- * Removes the request handler for the given method.
387
- */
388
- removeRequestHandler(method) {
389
- this._requestHandlers.delete(method);
390
- }
391
- /**
392
- * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
393
- */
394
- assertCanSetRequestHandler(method) {
395
- if (this._requestHandlers.has(method)) {
396
- throw new Error(`A request handler for ${method} already exists, which would be overridden`);
397
- }
398
- }
399
- /**
400
- * Registers a handler to invoke when this protocol object receives a notification with the given method.
401
- *
402
- * Note that this will replace any previous notification handler for the same method.
403
- */
404
- setNotificationHandler(notificationSchema, handler) {
405
- const method = getMethodLiteral(notificationSchema);
406
- this._notificationHandlers.set(method, notification => {
407
- const parsed = parseWithCompat(notificationSchema, notification);
408
- return Promise.resolve(handler(parsed));
409
- });
410
- }
411
- /**
412
- * Removes the notification handler for the given method.
413
- */
414
- removeNotificationHandler(method) {
415
- this._notificationHandlers.delete(method);
416
- }
417
- }
418
- function isPlainObject(value) {
419
- return value !== null && typeof value === 'object' && !Array.isArray(value);
420
- }
421
- function mergeCapabilities(base, additional) {
422
- const result = { ...base };
423
- for (const key in additional) {
424
- const k = key;
425
- const addValue = additional[k];
426
- if (addValue === undefined)
427
- continue;
428
- const baseValue = result[k];
429
- if (isPlainObject(baseValue) && isPlainObject(addValue)) {
430
- result[k] = { ...baseValue, ...addValue };
431
- }
432
- else {
433
- result[k] = addValue;
434
- }
435
- }
436
- return result;
437
- }
438
-
439
- export { DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol, mergeCapabilities };
440
- //# sourceMappingURL=protocol.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protocol.js","sources":["../../../../../../../../../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js"],"sourcesContent":["import { safeParse } from '../server/zod-compat.js';\nimport { CancelledNotificationSchema, ErrorCode, isJSONRPCError, isJSONRPCRequest, isJSONRPCResponse, isJSONRPCNotification, McpError, PingRequestSchema, ProgressNotificationSchema } from '../types.js';\nimport { getMethodLiteral, parseWithCompat } from '../server/zod-json-schema-compat.js';\n/**\n * The default request timeout, in miliseconds.\n */\nexport const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;\n/**\n * Implements MCP protocol framing on top of a pluggable transport, including\n * features like request/response linking, notifications, and progress.\n */\nexport class Protocol {\n constructor(_options) {\n this._options = _options;\n this._requestMessageId = 0;\n this._requestHandlers = new Map();\n this._requestHandlerAbortControllers = new Map();\n this._notificationHandlers = new Map();\n this._responseHandlers = new Map();\n this._progressHandlers = new Map();\n this._timeoutInfo = new Map();\n this._pendingDebouncedNotifications = new Set();\n this.setNotificationHandler(CancelledNotificationSchema, notification => {\n const controller = this._requestHandlerAbortControllers.get(notification.params.requestId);\n controller === null || controller === void 0 ? void 0 : controller.abort(notification.params.reason);\n });\n this.setNotificationHandler(ProgressNotificationSchema, notification => {\n this._onprogress(notification);\n });\n this.setRequestHandler(PingRequestSchema, \n // Automatic pong by default.\n _request => ({}));\n }\n _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {\n this._timeoutInfo.set(messageId, {\n timeoutId: setTimeout(onTimeout, timeout),\n startTime: Date.now(),\n timeout,\n maxTotalTimeout,\n resetTimeoutOnProgress,\n onTimeout\n });\n }\n _resetTimeout(messageId) {\n const info = this._timeoutInfo.get(messageId);\n if (!info)\n return false;\n const totalElapsed = Date.now() - info.startTime;\n if (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) {\n this._timeoutInfo.delete(messageId);\n throw McpError.fromError(ErrorCode.RequestTimeout, 'Maximum total timeout exceeded', {\n maxTotalTimeout: info.maxTotalTimeout,\n totalElapsed\n });\n }\n clearTimeout(info.timeoutId);\n info.timeoutId = setTimeout(info.onTimeout, info.timeout);\n return true;\n }\n _cleanupTimeout(messageId) {\n const info = this._timeoutInfo.get(messageId);\n if (info) {\n clearTimeout(info.timeoutId);\n this._timeoutInfo.delete(messageId);\n }\n }\n /**\n * Attaches to the given transport, starts it, and starts listening for messages.\n *\n * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.\n */\n async connect(transport) {\n var _a, _b, _c;\n this._transport = transport;\n const _onclose = (_a = this.transport) === null || _a === void 0 ? void 0 : _a.onclose;\n this._transport.onclose = () => {\n _onclose === null || _onclose === void 0 ? void 0 : _onclose();\n this._onclose();\n };\n const _onerror = (_b = this.transport) === null || _b === void 0 ? void 0 : _b.onerror;\n this._transport.onerror = (error) => {\n _onerror === null || _onerror === void 0 ? void 0 : _onerror(error);\n this._onerror(error);\n };\n const _onmessage = (_c = this._transport) === null || _c === void 0 ? void 0 : _c.onmessage;\n this._transport.onmessage = (message, extra) => {\n _onmessage === null || _onmessage === void 0 ? void 0 : _onmessage(message, extra);\n if (isJSONRPCResponse(message) || isJSONRPCError(message)) {\n this._onresponse(message);\n }\n else if (isJSONRPCRequest(message)) {\n this._onrequest(message, extra);\n }\n else if (isJSONRPCNotification(message)) {\n this._onnotification(message);\n }\n else {\n this._onerror(new Error(`Unknown message type: ${JSON.stringify(message)}`));\n }\n };\n await this._transport.start();\n }\n _onclose() {\n var _a;\n const responseHandlers = this._responseHandlers;\n this._responseHandlers = new Map();\n this._progressHandlers.clear();\n this._pendingDebouncedNotifications.clear();\n this._transport = undefined;\n (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this);\n const error = McpError.fromError(ErrorCode.ConnectionClosed, 'Connection closed');\n for (const handler of responseHandlers.values()) {\n handler(error);\n }\n }\n _onerror(error) {\n var _a;\n (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error);\n }\n _onnotification(notification) {\n var _a;\n const handler = (_a = this._notificationHandlers.get(notification.method)) !== null && _a !== void 0 ? _a : this.fallbackNotificationHandler;\n // Ignore notifications not being subscribed to.\n if (handler === undefined) {\n return;\n }\n // Starting with Promise.resolve() puts any synchronous errors into the monad as well.\n Promise.resolve()\n .then(() => handler(notification))\n .catch(error => this._onerror(new Error(`Uncaught error in notification handler: ${error}`)));\n }\n _onrequest(request, extra) {\n var _a, _b;\n const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== void 0 ? _a : this.fallbackRequestHandler;\n // Capture the current transport at request time to ensure responses go to the correct client\n const capturedTransport = this._transport;\n if (handler === undefined) {\n capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send({\n jsonrpc: '2.0',\n id: request.id,\n error: {\n code: ErrorCode.MethodNotFound,\n message: 'Method not found'\n }\n }).catch(error => this._onerror(new Error(`Failed to send an error response: ${error}`)));\n return;\n }\n const abortController = new AbortController();\n this._requestHandlerAbortControllers.set(request.id, abortController);\n const fullExtra = {\n signal: abortController.signal,\n sessionId: capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.sessionId,\n _meta: (_b = request.params) === null || _b === void 0 ? void 0 : _b._meta,\n sendNotification: notification => this.notification(notification, { relatedRequestId: request.id }),\n sendRequest: (r, resultSchema, options) => this.request(r, resultSchema, { ...options, relatedRequestId: request.id }),\n authInfo: extra === null || extra === void 0 ? void 0 : extra.authInfo,\n requestId: request.id,\n requestInfo: extra === null || extra === void 0 ? void 0 : extra.requestInfo\n };\n // Starting with Promise.resolve() puts any synchronous errors into the monad as well.\n Promise.resolve()\n .then(() => handler(request, fullExtra))\n .then(result => {\n if (abortController.signal.aborted) {\n return;\n }\n return capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send({\n result,\n jsonrpc: '2.0',\n id: request.id\n });\n }, error => {\n var _a;\n if (abortController.signal.aborted) {\n return;\n }\n return capturedTransport === null || capturedTransport === void 0 ? void 0 : capturedTransport.send({\n jsonrpc: '2.0',\n id: request.id,\n error: {\n code: Number.isSafeInteger(error['code']) ? error['code'] : ErrorCode.InternalError,\n message: (_a = error.message) !== null && _a !== void 0 ? _a : 'Internal error',\n ...(error['data'] !== undefined && { data: error['data'] })\n }\n });\n })\n .catch(error => this._onerror(new Error(`Failed to send response: ${error}`)))\n .finally(() => {\n this._requestHandlerAbortControllers.delete(request.id);\n });\n }\n _onprogress(notification) {\n const { progressToken, ...params } = notification.params;\n const messageId = Number(progressToken);\n const handler = this._progressHandlers.get(messageId);\n if (!handler) {\n this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`));\n return;\n }\n const responseHandler = this._responseHandlers.get(messageId);\n const timeoutInfo = this._timeoutInfo.get(messageId);\n if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) {\n try {\n this._resetTimeout(messageId);\n }\n catch (error) {\n responseHandler(error);\n return;\n }\n }\n handler(params);\n }\n _onresponse(response) {\n const messageId = Number(response.id);\n const handler = this._responseHandlers.get(messageId);\n if (handler === undefined) {\n this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`));\n return;\n }\n this._responseHandlers.delete(messageId);\n this._progressHandlers.delete(messageId);\n this._cleanupTimeout(messageId);\n if (isJSONRPCResponse(response)) {\n handler(response);\n }\n else {\n const error = McpError.fromError(response.error.code, response.error.message, response.error.data);\n handler(error);\n }\n }\n get transport() {\n return this._transport;\n }\n /**\n * Closes the connection.\n */\n async close() {\n var _a;\n await ((_a = this._transport) === null || _a === void 0 ? void 0 : _a.close());\n }\n /**\n * Sends a request and wait for a response.\n *\n * Do not use this method to emit notifications! Use notification() instead.\n */\n request(request, resultSchema, options) {\n const { relatedRequestId, resumptionToken, onresumptiontoken } = options !== null && options !== void 0 ? options : {};\n return new Promise((resolve, reject) => {\n var _a, _b, _c, _d, _e, _f;\n if (!this._transport) {\n reject(new Error('Not connected'));\n return;\n }\n if (((_a = this._options) === null || _a === void 0 ? void 0 : _a.enforceStrictCapabilities) === true) {\n this.assertCapabilityForMethod(request.method);\n }\n (_b = options === null || options === void 0 ? void 0 : options.signal) === null || _b === void 0 ? void 0 : _b.throwIfAborted();\n const messageId = this._requestMessageId++;\n const jsonrpcRequest = {\n ...request,\n jsonrpc: '2.0',\n id: messageId\n };\n if (options === null || options === void 0 ? void 0 : options.onprogress) {\n this._progressHandlers.set(messageId, options.onprogress);\n jsonrpcRequest.params = {\n ...request.params,\n _meta: {\n ...(((_c = request.params) === null || _c === void 0 ? void 0 : _c._meta) || {}),\n progressToken: messageId\n }\n };\n }\n const cancel = (reason) => {\n var _a;\n this._responseHandlers.delete(messageId);\n this._progressHandlers.delete(messageId);\n this._cleanupTimeout(messageId);\n (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send({\n jsonrpc: '2.0',\n method: 'notifications/cancelled',\n params: {\n requestId: messageId,\n reason: String(reason)\n }\n }, { relatedRequestId, resumptionToken, onresumptiontoken }).catch(error => this._onerror(new Error(`Failed to send cancellation: ${error}`)));\n reject(reason);\n };\n this._responseHandlers.set(messageId, response => {\n var _a;\n if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {\n return;\n }\n if (response instanceof Error) {\n return reject(response);\n }\n try {\n const parseResult = safeParse(resultSchema, response.result);\n if (!parseResult.success) {\n // Type guard: if success is false, error is guaranteed to exist\n reject(parseResult.error);\n }\n else {\n resolve(parseResult.data);\n }\n }\n catch (error) {\n reject(error);\n }\n });\n (_d = options === null || options === void 0 ? void 0 : options.signal) === null || _d === void 0 ? void 0 : _d.addEventListener('abort', () => {\n var _a;\n cancel((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.reason);\n });\n const timeout = (_e = options === null || options === void 0 ? void 0 : options.timeout) !== null && _e !== void 0 ? _e : DEFAULT_REQUEST_TIMEOUT_MSEC;\n const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, 'Request timed out', { timeout }));\n this._setupTimeout(messageId, timeout, options === null || options === void 0 ? void 0 : options.maxTotalTimeout, timeoutHandler, (_f = options === null || options === void 0 ? void 0 : options.resetTimeoutOnProgress) !== null && _f !== void 0 ? _f : false);\n this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch(error => {\n this._cleanupTimeout(messageId);\n reject(error);\n });\n });\n }\n /**\n * Emits a notification, which is a one-way message that does not expect a response.\n */\n async notification(notification, options) {\n var _a, _b;\n if (!this._transport) {\n throw new Error('Not connected');\n }\n this.assertNotificationCapability(notification.method);\n const debouncedMethods = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.debouncedNotificationMethods) !== null && _b !== void 0 ? _b : [];\n // A notification can only be debounced if it's in the list AND it's \"simple\"\n // (i.e., has no parameters and no related request ID that could be lost).\n const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !(options === null || options === void 0 ? void 0 : options.relatedRequestId);\n if (canDebounce) {\n // If a notification of this type is already scheduled, do nothing.\n if (this._pendingDebouncedNotifications.has(notification.method)) {\n return;\n }\n // Mark this notification type as pending.\n this._pendingDebouncedNotifications.add(notification.method);\n // Schedule the actual send to happen in the next microtask.\n // This allows all synchronous calls in the current event loop tick to be coalesced.\n Promise.resolve().then(() => {\n var _a;\n // Un-mark the notification so the next one can be scheduled.\n this._pendingDebouncedNotifications.delete(notification.method);\n // SAFETY CHECK: If the connection was closed while this was pending, abort.\n if (!this._transport) {\n return;\n }\n const jsonrpcNotification = {\n ...notification,\n jsonrpc: '2.0'\n };\n // Send the notification, but don't await it here to avoid blocking.\n // Handle potential errors with a .catch().\n (_a = this._transport) === null || _a === void 0 ? void 0 : _a.send(jsonrpcNotification, options).catch(error => this._onerror(error));\n });\n // Return immediately.\n return;\n }\n const jsonrpcNotification = {\n ...notification,\n jsonrpc: '2.0'\n };\n await this._transport.send(jsonrpcNotification, options);\n }\n /**\n * Registers a handler to invoke when this protocol object receives a request with the given method.\n *\n * Note that this will replace any previous request handler for the same method.\n */\n setRequestHandler(requestSchema, handler) {\n const method = getMethodLiteral(requestSchema);\n this.assertRequestHandlerCapability(method);\n this._requestHandlers.set(method, (request, extra) => {\n const parsed = parseWithCompat(requestSchema, request);\n return Promise.resolve(handler(parsed, extra));\n });\n }\n /**\n * Removes the request handler for the given method.\n */\n removeRequestHandler(method) {\n this._requestHandlers.delete(method);\n }\n /**\n * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.\n */\n assertCanSetRequestHandler(method) {\n if (this._requestHandlers.has(method)) {\n throw new Error(`A request handler for ${method} already exists, which would be overridden`);\n }\n }\n /**\n * Registers a handler to invoke when this protocol object receives a notification with the given method.\n *\n * Note that this will replace any previous notification handler for the same method.\n */\n setNotificationHandler(notificationSchema, handler) {\n const method = getMethodLiteral(notificationSchema);\n this._notificationHandlers.set(method, notification => {\n const parsed = parseWithCompat(notificationSchema, notification);\n return Promise.resolve(handler(parsed));\n });\n }\n /**\n * Removes the notification handler for the given method.\n */\n removeNotificationHandler(method) {\n this._notificationHandlers.delete(method);\n }\n}\nfunction isPlainObject(value) {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\nexport function mergeCapabilities(base, additional) {\n const result = { ...base };\n for (const key in additional) {\n const k = key;\n const addValue = additional[k];\n if (addValue === undefined)\n continue;\n const baseValue = result[k];\n if (isPlainObject(baseValue) && isPlainObject(addValue)) {\n result[k] = { ...baseValue, ...addValue };\n }\n else {\n result[k] = addValue;\n }\n }\n return result;\n}\n//# sourceMappingURL=protocol.js.map"],"names":[],"mappings":";;;;AAGA;AACA;AACA;AACY,MAAC,4BAA4B,GAAG;AAC5C;AACA;AACA;AACA;AACO,MAAM,QAAQ,CAAC;AACtB,IAAI,WAAW,CAAC,QAAQ,EAAE;AAC1B,QAAQ,IAAI,CAAC,QAAQ,GAAG,QAAQ;AAChC,QAAQ,IAAI,CAAC,iBAAiB,GAAG,CAAC;AAClC,QAAQ,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE;AACzC,QAAQ,IAAI,CAAC,+BAA+B,GAAG,IAAI,GAAG,EAAE;AACxD,QAAQ,IAAI,CAAC,qBAAqB,GAAG,IAAI,GAAG,EAAE;AAC9C,QAAQ,IAAI,CAAC,iBAAiB,GAAG,IAAI,G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ities according to SEP: Specify Format for Tool Names
3
- *
4
- * Tool names SHOULD be between 1 and 128 characters in length (inclusive).
5
- * Tool names are case-sensitive.
6
- * Allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits
7
- * (0-9), underscore (_), dash (-), and dot (.).
8
- * Tool names SHOULD NOT contain spaces, commas, or other special characters.
9
- */
10
- /**
11
- * Regular expression for valid tool names according to SEP-986 specification
12
- */
13
- const TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
14
- /**
15
- * Validates a tool name according to the SEP specification
16
- * @param name - The tool name to validate
17
- * @returns An object containing validation result and any warnings
18
- */
19
- function validateToolName(name) {
20
- const warnings = [];
21
- // Check length
22
- if (name.length === 0) {
23
- return {
24
- isValid: false,
25
- warnings: ['Tool name cannot be empty']
26
- };
27
- }
28
- if (name.length > 128) {
29
- return {
30
- isValid: false,
31
- warnings: [`Tool name exceeds maximum length of 128 characters (current: ${name.length})`]
32
- };
33
- }
34
- // Check for specific problematic patterns (these are warnings, not validation failures)
35
- if (name.includes(' ')) {
36
- warnings.push('Tool name contains spaces, which may cause parsing issues');
37
- }
38
- if (name.includes(',')) {
39
- warnings.push('Tool name contains commas, which may cause parsing issues');
40
- }
41
- // Check for potentially confusing patterns (leading/trailing dashes, dots, slashes)
42
- if (name.startsWith('-') || name.endsWith('-')) {
43
- warnings.push('Tool name starts or ends with a dash, which may cause parsing issues in some contexts');
44
- }
45
- if (name.startsWith('.') || name.endsWith('.')) {
46
- warnings.push('Tool name starts or ends with a dot, which may cause parsing issues in some contexts');
47
- }
48
- // Check for invalid characters
49
- if (!TOOL_NAME_REGEX.test(name)) {
50
- const invalidChars = name
51
- .split('')
52
- .filter(char => !/[A-Za-z0-9._-]/.test(char))
53
- .filter((char, index, arr) => arr.indexOf(char) === index); // Remove duplicates
54
- warnings.push(`Tool name contains invalid characters: ${invalidChars.map(c => `"${c}"`).join(', ')}`, 'Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)');
55
- return {
56
- isValid: false,
57
- warnings
58
- };
59
- }
60
- return {
61
- isValid: true,
62
- warnings
63
- };
64
- }
65
- /**
66
- * Issues warnings for non-conforming tool names
67
- * @param name - The tool name that triggered the warnings
68
- * @param warnings - Array of warning messages
69
- */
70
- function issueToolNameWarning(name, warnings) {
71
- if (warnings.length > 0) {
72
- console.warn(`Tool name validation warning for "${name}":`);
73
- for (const warning of warnings) {
74
- console.warn(` - ${warning}`);
75
- }
76
- console.warn('Tool registration will proceed, but this may cause compatibility issues.');
77
- console.warn('Consider updating the tool name to conform to the MCP tool naming standard.');
78
- console.warn('See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.');
79
- }
80
- }
81
- /**
82
- * Validates a tool name and issues warnings for non-conforming names
83
- * @param name - The tool name to validate
84
- * @returns true if the name is valid, false otherwise
85
- */
86
- function validateAndWarnToolName(name) {
87
- const result = validateToolName(name);
88
- // Always issue warnings for any validation issues (both invalid names and warnings)
89
- issueToolNameWarning(name, result.warnings);
90
- return result.isValid;
91
- }
92
-
93
- export { issueToolNameWarning, validateAndWarnToolName, validateToolName };
94
- //# sourceMappingURL=toolNameValidation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toolNameValidation.js","sources":["../../../../../../../../../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js"],"sourcesContent":["/**\n * Tool name validation utilities according to SEP: Specify Format for Tool Names\n *\n * Tool names SHOULD be between 1 and 128 characters in length (inclusive).\n * Tool names are case-sensitive.\n * Allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits\n * (0-9), underscore (_), dash (-), and dot (.).\n * Tool names SHOULD NOT contain spaces, commas, or other special characters.\n */\n/**\n * Regular expression for valid tool names according to SEP-986 specification\n */\nconst TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;\n/**\n * Validates a tool name according to the SEP specification\n * @param name - The tool name to validate\n * @returns An object containing validation result and any warnings\n */\nexport function validateToolName(name) {\n const warnings = [];\n // Check length\n if (name.length === 0) {\n return {\n isValid: false,\n warnings: ['Tool name cannot be empty']\n };\n }\n if (name.length > 128) {\n return {\n isValid: false,\n warnings: [`Tool name exceeds maximum length of 128 characters (current: ${name.length})`]\n };\n }\n // Check for specific problematic patterns (these are warnings, not validation failures)\n if (name.includes(' ')) {\n warnings.push('Tool name contains spaces, which may cause parsing issues');\n }\n if (name.includes(',')) {\n warnings.push('Tool name contains commas, which may cause parsing issues');\n }\n // Check for potentially confusing patterns (leading/trailing dashes, dots, slashes)\n if (name.startsWith('-') || name.endsWith('-')) {\n warnings.push('Tool name starts or ends with a dash, which may cause parsing issues in some contexts');\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n warnings.push('Tool name starts or ends with a dot, which may cause parsing issues in some contexts');\n }\n // Check for invalid characters\n if (!TOOL_NAME_REGEX.test(name)) {\n const invalidChars = name\n .split('')\n .filter(char => !/[A-Za-z0-9._-]/.test(char))\n .filter((char, index, arr) => arr.indexOf(char) === index); // Remove duplicates\n warnings.push(`Tool name contains invalid characters: ${invalidChars.map(c => `\"${c}\"`).join(', ')}`, 'Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)');\n return {\n isValid: false,\n warnings\n };\n }\n return {\n isValid: true,\n warnings\n };\n}\n/**\n * Issues warnings for non-conforming tool names\n * @param name - The tool name that triggered the warnings\n * @param warnings - Array of warning messages\n */\nexport function issueToolNameWarning(name, warnings) {\n if (warnings.length > 0) {\n console.warn(`Tool name validation warning for \"${name}\":`);\n for (const warning of warnings) {\n console.warn(` - ${warning}`);\n }\n console.warn('Tool registration will proceed, but this may cause compatibility issues.');\n console.warn('Consider updating the tool name to conform to the MCP tool naming standard.');\n console.warn('See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.');\n }\n}\n/**\n * Validates a tool name and issues warnings for non-conforming names\n * @param name - The tool name to validate\n * @returns true if the name is valid, false otherwise\n */\nexport function validateAndWarnToolName(name) {\n const result = validateToolName(name);\n // Always issue warnings for any validation issues (both invalid names and warnings)\n issueToolNameWarning(name, result.warnings);\n return result.isValid;\n}\n//# sourceMappingURL=toolNameValidation.js.map"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,eAAe,GAAG,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,IAAI,EAAE;AACvC,IAAI,MAAM,QAAQ,GAAG,EAAE;AACvB;AACA,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;AAC3B,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,KAAK;AAC1B,YAAY,QAAQ,EAAE,CAAC,2BAA2B;AAClD,SAAS;AACT,IAAI;AACJ,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE;AAC3B,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,KAAK;AAC1B,YAAY,QAAQ,EAAE,CAAC,CAAC,6DAA6D,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AACrG,SAAS;AACT,IAAI;AACJ;AACA,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC5B,QAAQ,QAAQ,CAAC,IAAI,CAAC,2DAA2D,CAAC;AAClF,IAAI;AACJ,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC5B,QAAQ,QAAQ,CAAC,IAAI,CAAC,2DAA2D,CAAC;AAClF,IAAI;AACJ;AACA,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACpD,QAAQ,QAAQ,CAAC,IAAI,CAAC,uFAAuF,CAAC;AAC9G,IAAI;AACJ,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ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