@posthog/agent 1.24.2 → 1.26.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 (606) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +6 -0
  2. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  3. package/dist/_virtual/_tslib.js +74 -0
  4. package/dist/_virtual/_tslib.js.map +1 -0
  5. package/dist/_virtual/additionalItems.js +4 -0
  6. package/dist/_virtual/additionalItems.js.map +1 -0
  7. package/dist/_virtual/additionalProperties.js +4 -0
  8. package/dist/_virtual/additionalProperties.js.map +1 -0
  9. package/dist/_virtual/ajv.js +4 -0
  10. package/dist/_virtual/ajv.js.map +1 -0
  11. package/dist/_virtual/allOf.js +4 -0
  12. package/dist/_virtual/allOf.js.map +1 -0
  13. package/dist/_virtual/anyOf.js +4 -0
  14. package/dist/_virtual/anyOf.js.map +1 -0
  15. package/dist/_virtual/applicability.js +4 -0
  16. package/dist/_virtual/applicability.js.map +1 -0
  17. package/dist/_virtual/boolSchema.js +4 -0
  18. package/dist/_virtual/boolSchema.js.map +1 -0
  19. package/dist/_virtual/code.js +4 -0
  20. package/dist/_virtual/code.js.map +1 -0
  21. package/dist/_virtual/code2.js +4 -0
  22. package/dist/_virtual/code2.js.map +1 -0
  23. package/dist/_virtual/const.js +4 -0
  24. package/dist/_virtual/const.js.map +1 -0
  25. package/dist/_virtual/contains.js +4 -0
  26. package/dist/_virtual/contains.js.map +1 -0
  27. package/dist/_virtual/core.js +4 -0
  28. package/dist/_virtual/core.js.map +1 -0
  29. package/dist/_virtual/dataType.js +4 -0
  30. package/dist/_virtual/dataType.js.map +1 -0
  31. package/dist/_virtual/defaults.js +4 -0
  32. package/dist/_virtual/defaults.js.map +1 -0
  33. package/dist/_virtual/dependencies.js +4 -0
  34. package/dist/_virtual/dependencies.js.map +1 -0
  35. package/dist/_virtual/draft7.js +4 -0
  36. package/dist/_virtual/draft7.js.map +1 -0
  37. package/dist/_virtual/enum.js +4 -0
  38. package/dist/_virtual/enum.js.map +1 -0
  39. package/dist/_virtual/equal.js +4 -0
  40. package/dist/_virtual/equal.js.map +1 -0
  41. package/dist/_virtual/errors.js +4 -0
  42. package/dist/_virtual/errors.js.map +1 -0
  43. package/dist/_virtual/format.js +4 -0
  44. package/dist/_virtual/format.js.map +1 -0
  45. package/dist/_virtual/formats.js +4 -0
  46. package/dist/_virtual/formats.js.map +1 -0
  47. package/dist/_virtual/id.js +4 -0
  48. package/dist/_virtual/id.js.map +1 -0
  49. package/dist/_virtual/if.js +4 -0
  50. package/dist/_virtual/if.js.map +1 -0
  51. package/dist/_virtual/index.js +4 -0
  52. package/dist/_virtual/index.js.map +1 -0
  53. package/dist/_virtual/index10.js +4 -0
  54. package/dist/_virtual/index10.js.map +1 -0
  55. package/dist/_virtual/index11.js +4 -0
  56. package/dist/_virtual/index11.js.map +1 -0
  57. package/dist/_virtual/index2.js +4 -0
  58. package/dist/_virtual/index2.js.map +1 -0
  59. package/dist/_virtual/index3.js +4 -0
  60. package/dist/_virtual/index3.js.map +1 -0
  61. package/dist/_virtual/index4.js +4 -0
  62. package/dist/_virtual/index4.js.map +1 -0
  63. package/dist/_virtual/index5.js +4 -0
  64. package/dist/_virtual/index5.js.map +1 -0
  65. package/dist/_virtual/index6.js +4 -0
  66. package/dist/_virtual/index6.js.map +1 -0
  67. package/dist/_virtual/index7.js +4 -0
  68. package/dist/_virtual/index7.js.map +1 -0
  69. package/dist/_virtual/index8.js +4 -0
  70. package/dist/_virtual/index8.js.map +1 -0
  71. package/dist/_virtual/index9.js +4 -0
  72. package/dist/_virtual/index9.js.map +1 -0
  73. package/dist/_virtual/items.js +4 -0
  74. package/dist/_virtual/items.js.map +1 -0
  75. package/dist/_virtual/items2020.js +4 -0
  76. package/dist/_virtual/items2020.js.map +1 -0
  77. package/dist/_virtual/keyword.js +4 -0
  78. package/dist/_virtual/keyword.js.map +1 -0
  79. package/dist/_virtual/limit.js +4 -0
  80. package/dist/_virtual/limit.js.map +1 -0
  81. package/dist/_virtual/limitItems.js +4 -0
  82. package/dist/_virtual/limitItems.js.map +1 -0
  83. package/dist/_virtual/limitLength.js +4 -0
  84. package/dist/_virtual/limitLength.js.map +1 -0
  85. package/dist/_virtual/limitNumber.js +4 -0
  86. package/dist/_virtual/limitNumber.js.map +1 -0
  87. package/dist/_virtual/limitProperties.js +4 -0
  88. package/dist/_virtual/limitProperties.js.map +1 -0
  89. package/dist/_virtual/metadata.js +4 -0
  90. package/dist/_virtual/metadata.js.map +1 -0
  91. package/dist/_virtual/multipleOf.js +4 -0
  92. package/dist/_virtual/multipleOf.js.map +1 -0
  93. package/dist/_virtual/names.js +4 -0
  94. package/dist/_virtual/names.js.map +1 -0
  95. package/dist/_virtual/not.js +4 -0
  96. package/dist/_virtual/not.js.map +1 -0
  97. package/dist/_virtual/oneOf.js +4 -0
  98. package/dist/_virtual/oneOf.js.map +1 -0
  99. package/dist/_virtual/pattern.js +4 -0
  100. package/dist/_virtual/pattern.js.map +1 -0
  101. package/dist/_virtual/patternProperties.js +4 -0
  102. package/dist/_virtual/patternProperties.js.map +1 -0
  103. package/dist/_virtual/prefixItems.js +4 -0
  104. package/dist/_virtual/prefixItems.js.map +1 -0
  105. package/dist/_virtual/properties.js +4 -0
  106. package/dist/_virtual/properties.js.map +1 -0
  107. package/dist/_virtual/propertyNames.js +4 -0
  108. package/dist/_virtual/propertyNames.js.map +1 -0
  109. package/dist/_virtual/ref.js +4 -0
  110. package/dist/_virtual/ref.js.map +1 -0
  111. package/dist/_virtual/ref_error.js +4 -0
  112. package/dist/_virtual/ref_error.js.map +1 -0
  113. package/dist/_virtual/required.js +4 -0
  114. package/dist/_virtual/required.js.map +1 -0
  115. package/dist/_virtual/resolve.js +4 -0
  116. package/dist/_virtual/resolve.js.map +1 -0
  117. package/dist/_virtual/rules.js +4 -0
  118. package/dist/_virtual/rules.js.map +1 -0
  119. package/dist/_virtual/scope.js +4 -0
  120. package/dist/_virtual/scope.js.map +1 -0
  121. package/dist/_virtual/subschema.js +4 -0
  122. package/dist/_virtual/subschema.js.map +1 -0
  123. package/dist/_virtual/thenElse.js +4 -0
  124. package/dist/_virtual/thenElse.js.map +1 -0
  125. package/dist/_virtual/types.js +4 -0
  126. package/dist/_virtual/types.js.map +1 -0
  127. package/dist/_virtual/ucs2length.js +4 -0
  128. package/dist/_virtual/ucs2length.js.map +1 -0
  129. package/dist/_virtual/uniqueItems.js +4 -0
  130. package/dist/_virtual/uniqueItems.js.map +1 -0
  131. package/dist/_virtual/uri.js +4 -0
  132. package/dist/_virtual/uri.js.map +1 -0
  133. package/dist/_virtual/util.js +4 -0
  134. package/dist/_virtual/util.js.map +1 -0
  135. package/dist/_virtual/validation_error.js +4 -0
  136. package/dist/_virtual/validation_error.js.map +1 -0
  137. package/dist/claude-cli/cli.js +2294 -2146
  138. package/dist/example-client.d.ts +3 -0
  139. package/dist/example-client.d.ts.map +1 -0
  140. package/dist/index.d.ts +19 -11
  141. package/dist/index.d.ts.map +1 -1
  142. package/dist/index.js +7 -3
  143. package/dist/index.js.map +1 -1
  144. package/dist/node_modules/@agentclientprotocol/sdk/dist/acp.js +891 -0
  145. package/dist/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -0
  146. package/dist/node_modules/@agentclientprotocol/sdk/dist/schema.js +876 -0
  147. package/dist/node_modules/@agentclientprotocol/sdk/dist/schema.js.map +1 -0
  148. package/dist/node_modules/@agentclientprotocol/sdk/dist/stream.js +66 -0
  149. package/dist/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +1 -0
  150. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +23 -0
  151. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +1 -0
  152. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +331 -0
  153. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -0
  154. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +717 -0
  155. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +1 -0
  156. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +221 -0
  157. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -0
  158. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +56 -0
  159. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +1 -0
  160. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +440 -0
  161. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -0
  162. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js +94 -0
  163. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js.map +1 -0
  164. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1610 -0
  165. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -0
  166. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +91 -0
  167. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +1 -0
  168. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/ZodError.js +133 -0
  169. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/ZodError.js.map +1 -0
  170. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/errors.js +9 -0
  171. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/errors.js.map +1 -0
  172. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/errorUtil.js +9 -0
  173. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
  174. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/parseUtil.js +112 -0
  175. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
  176. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/util.js +136 -0
  177. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/util.js.map +1 -0
  178. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/locales/en.js +112 -0
  179. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/locales/en.js.map +1 -0
  180. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/types.js +3297 -0
  181. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/types.js.map +1 -0
  182. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/errors.js +44 -0
  183. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/errors.js.map +1 -0
  184. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/iso.js +36 -0
  185. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/iso.js.map +1 -0
  186. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/parse.js +10 -0
  187. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/parse.js.map +1 -0
  188. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/schemas.js +657 -0
  189. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/schemas.js.map +1 -0
  190. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/api.js +449 -0
  191. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/api.js.map +1 -0
  192. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/checks.js +413 -0
  193. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/checks.js.map +1 -0
  194. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/core.js +57 -0
  195. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/core.js.map +1 -0
  196. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/doc.js +38 -0
  197. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/doc.js.map +1 -0
  198. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/errors.js +86 -0
  199. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/errors.js.map +1 -0
  200. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/parse.js +61 -0
  201. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/parse.js.map +1 -0
  202. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/regexes.js +80 -0
  203. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/regexes.js.map +1 -0
  204. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/registries.js +52 -0
  205. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/registries.js.map +1 -0
  206. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/schemas.js +1307 -0
  207. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/schemas.js.map +1 -0
  208. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/to-json-schema.js +842 -0
  209. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/to-json-schema.js.map +1 -0
  210. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/util.js +335 -0
  211. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/util.js.map +1 -0
  212. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/versions.js +8 -0
  213. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/versions.js.map +1 -0
  214. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/mini/schemas.js +51 -0
  215. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/mini/schemas.js.map +1 -0
  216. package/dist/node_modules/ajv/dist/ajv.js +69 -0
  217. package/dist/node_modules/ajv/dist/ajv.js.map +1 -0
  218. package/dist/node_modules/ajv/dist/compile/codegen/code.js +169 -0
  219. package/dist/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
  220. package/dist/node_modules/ajv/dist/compile/codegen/index.js +712 -0
  221. package/dist/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
  222. package/dist/node_modules/ajv/dist/compile/codegen/scope.js +157 -0
  223. package/dist/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
  224. package/dist/node_modules/ajv/dist/compile/errors.js +140 -0
  225. package/dist/node_modules/ajv/dist/compile/errors.js.map +1 -0
  226. package/dist/node_modules/ajv/dist/compile/index.js +253 -0
  227. package/dist/node_modules/ajv/dist/compile/index.js.map +1 -0
  228. package/dist/node_modules/ajv/dist/compile/names.js +40 -0
  229. package/dist/node_modules/ajv/dist/compile/names.js.map +1 -0
  230. package/dist/node_modules/ajv/dist/compile/ref_error.js +25 -0
  231. package/dist/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
  232. package/dist/node_modules/ajv/dist/compile/resolve.js +162 -0
  233. package/dist/node_modules/ajv/dist/compile/resolve.js.map +1 -0
  234. package/dist/node_modules/ajv/dist/compile/rules.js +29 -0
  235. package/dist/node_modules/ajv/dist/compile/rules.js.map +1 -0
  236. package/dist/node_modules/ajv/dist/compile/util.js +183 -0
  237. package/dist/node_modules/ajv/dist/compile/util.js.map +1 -0
  238. package/dist/node_modules/ajv/dist/compile/validate/applicability.js +30 -0
  239. package/dist/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
  240. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +64 -0
  241. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
  242. package/dist/node_modules/ajv/dist/compile/validate/dataType.js +213 -0
  243. package/dist/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
  244. package/dist/node_modules/ajv/dist/compile/validate/defaults.js +49 -0
  245. package/dist/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
  246. package/dist/node_modules/ajv/dist/compile/validate/index.js +544 -0
  247. package/dist/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
  248. package/dist/node_modules/ajv/dist/compile/validate/keyword.js +139 -0
  249. package/dist/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
  250. package/dist/node_modules/ajv/dist/compile/validate/subschema.js +95 -0
  251. package/dist/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
  252. package/dist/node_modules/ajv/dist/core.js +639 -0
  253. package/dist/node_modules/ajv/dist/core.js.map +1 -0
  254. package/dist/node_modules/ajv/dist/refs/data.json.js +31 -0
  255. package/dist/node_modules/ajv/dist/refs/data.json.js.map +1 -0
  256. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +254 -0
  257. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -0
  258. package/dist/node_modules/ajv/dist/runtime/equal.js +9 -0
  259. package/dist/node_modules/ajv/dist/runtime/equal.js.map +1 -0
  260. package/dist/node_modules/ajv/dist/runtime/ucs2length.js +25 -0
  261. package/dist/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
  262. package/dist/node_modules/ajv/dist/runtime/uri.js +8 -0
  263. package/dist/node_modules/ajv/dist/runtime/uri.js.map +1 -0
  264. package/dist/node_modules/ajv/dist/runtime/validation_error.js +22 -0
  265. package/dist/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
  266. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +53 -0
  267. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
  268. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +112 -0
  269. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
  270. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +26 -0
  271. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
  272. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +14 -0
  273. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
  274. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +99 -0
  275. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
  276. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +93 -0
  277. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
  278. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +70 -0
  279. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
  280. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +77 -0
  281. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
  282. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +57 -0
  283. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
  284. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +37 -0
  285. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
  286. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +29 -0
  287. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
  288. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +64 -0
  289. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
  290. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +80 -0
  291. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
  292. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +15 -0
  293. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
  294. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +61 -0
  295. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
  296. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +42 -0
  297. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
  298. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +16 -0
  299. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
  300. package/dist/node_modules/ajv/dist/vocabularies/code.js +146 -0
  301. package/dist/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
  302. package/dist/node_modules/ajv/dist/vocabularies/core/id.js +11 -0
  303. package/dist/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
  304. package/dist/node_modules/ajv/dist/vocabularies/core/index.js +21 -0
  305. package/dist/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
  306. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +131 -0
  307. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
  308. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +113 -0
  309. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
  310. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +12 -0
  311. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
  312. package/dist/node_modules/ajv/dist/vocabularies/draft7.js +28 -0
  313. package/dist/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
  314. package/dist/node_modules/ajv/dist/vocabularies/format/format.js +94 -0
  315. package/dist/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
  316. package/dist/node_modules/ajv/dist/vocabularies/format/index.js +9 -0
  317. package/dist/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
  318. package/dist/node_modules/ajv/dist/vocabularies/metadata.js +21 -0
  319. package/dist/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
  320. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +31 -0
  321. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
  322. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +54 -0
  323. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
  324. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +54 -0
  325. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
  326. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +26 -0
  327. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
  328. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +33 -0
  329. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
  330. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +29 -0
  331. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
  332. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +26 -0
  333. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
  334. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +28 -0
  335. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
  336. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +27 -0
  337. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
  338. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +84 -0
  339. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
  340. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +72 -0
  341. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
  342. package/dist/node_modules/ajv-formats/dist/formats.js +212 -0
  343. package/dist/node_modules/ajv-formats/dist/formats.js.map +1 -0
  344. package/dist/node_modules/ajv-formats/dist/index.js +52 -0
  345. package/dist/node_modules/ajv-formats/dist/index.js.map +1 -0
  346. package/dist/node_modules/ajv-formats/dist/limit.js +75 -0
  347. package/dist/node_modules/ajv-formats/dist/limit.js.map +1 -0
  348. package/dist/node_modules/diff/libesm/diff/base.js +256 -0
  349. package/dist/node_modules/diff/libesm/diff/base.js.map +1 -0
  350. package/dist/node_modules/diff/libesm/diff/line.js +64 -0
  351. package/dist/node_modules/diff/libesm/diff/line.js.map +1 -0
  352. package/dist/node_modules/diff/libesm/patch/create.js +185 -0
  353. package/dist/node_modules/diff/libesm/patch/create.js.map +1 -0
  354. package/dist/node_modules/fast-deep-equal/index.js +47 -0
  355. package/dist/node_modules/fast-deep-equal/index.js.map +1 -0
  356. package/dist/node_modules/fast-uri/index.js +347 -0
  357. package/dist/node_modules/fast-uri/index.js.map +1 -0
  358. package/dist/node_modules/fast-uri/lib/schemes.js +255 -0
  359. package/dist/node_modules/fast-uri/lib/schemes.js.map +1 -0
  360. package/dist/node_modules/fast-uri/lib/utils.js +334 -0
  361. package/dist/node_modules/fast-uri/lib/utils.js.map +1 -0
  362. package/dist/node_modules/json-schema-traverse/index.js +98 -0
  363. package/dist/node_modules/json-schema-traverse/index.js.map +1 -0
  364. package/dist/node_modules/uuid/dist/rng.js +14 -0
  365. package/dist/node_modules/uuid/dist/rng.js.map +1 -0
  366. package/dist/node_modules/uuid/dist/stringify.js +29 -0
  367. package/dist/node_modules/uuid/dist/stringify.js.map +1 -0
  368. package/dist/node_modules/uuid/dist/v7.js +65 -0
  369. package/dist/node_modules/uuid/dist/v7.js.map +1 -0
  370. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js +37 -0
  371. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -0
  372. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js +26 -0
  373. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +1 -0
  374. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +17 -0
  375. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +1 -0
  376. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +11 -0
  377. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +1 -0
  378. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js +66 -0
  379. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +1 -0
  380. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +21 -0
  381. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +1 -0
  382. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +30 -0
  383. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +1 -0
  384. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +53 -0
  385. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +1 -0
  386. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +8 -0
  387. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +1 -0
  388. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +8 -0
  389. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +1 -0
  390. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +8 -0
  391. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +1 -0
  392. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +50 -0
  393. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +1 -0
  394. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +11 -0
  395. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +1 -0
  396. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +11 -0
  397. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +1 -0
  398. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +9 -0
  399. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +1 -0
  400. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +56 -0
  401. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +1 -0
  402. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +24 -0
  403. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +1 -0
  404. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +30 -0
  405. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +1 -0
  406. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +19 -0
  407. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +1 -0
  408. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +15 -0
  409. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +1 -0
  410. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +13 -0
  411. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +1 -0
  412. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +37 -0
  413. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +1 -0
  414. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +56 -0
  415. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +1 -0
  416. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +76 -0
  417. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +1 -0
  418. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +25 -0
  419. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +1 -0
  420. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +24 -0
  421. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +1 -0
  422. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +8 -0
  423. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +1 -0
  424. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +8 -0
  425. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +1 -0
  426. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +65 -0
  427. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +1 -0
  428. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +24 -0
  429. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +1 -0
  430. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +350 -0
  431. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
  432. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +36 -0
  433. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +1 -0
  434. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +10 -0
  435. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +1 -0
  436. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +84 -0
  437. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +1 -0
  438. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +8 -0
  439. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +1 -0
  440. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js +109 -0
  441. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +1 -0
  442. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +90 -0
  443. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +1 -0
  444. package/dist/node_modules/zod-to-json-schema/node_modules/zod/v3/types.js +42 -0
  445. package/dist/node_modules/zod-to-json-schema/node_modules/zod/v3/types.js.map +1 -0
  446. package/dist/package.json.js +8 -0
  447. package/dist/package.json.js.map +1 -0
  448. package/dist/src/acp-extensions.d.ts +91 -0
  449. package/dist/src/acp-extensions.d.ts.map +1 -0
  450. package/dist/src/acp-extensions.js +38 -0
  451. package/dist/src/acp-extensions.js.map +1 -0
  452. package/dist/src/adapters/claude/claude.d.ts +136 -0
  453. package/dist/src/adapters/claude/claude.d.ts.map +1 -0
  454. package/dist/src/adapters/claude/claude.js +1128 -0
  455. package/dist/src/adapters/claude/claude.js.map +1 -0
  456. package/dist/src/adapters/claude/mcp-server.d.ts +30 -0
  457. package/dist/src/adapters/claude/mcp-server.d.ts.map +1 -0
  458. package/dist/src/adapters/claude/mcp-server.js +668 -0
  459. package/dist/src/adapters/claude/mcp-server.js.map +1 -0
  460. package/dist/src/adapters/claude/tools.d.ts +35 -0
  461. package/dist/src/adapters/claude/tools.d.ts.map +1 -0
  462. package/dist/src/adapters/claude/tools.js +473 -0
  463. package/dist/src/adapters/claude/tools.js.map +1 -0
  464. package/dist/src/adapters/claude/utils.d.ts +48 -0
  465. package/dist/src/adapters/claude/utils.d.ts.map +1 -0
  466. package/dist/src/adapters/claude/utils.js +158 -0
  467. package/dist/src/adapters/claude/utils.js.map +1 -0
  468. package/dist/src/agent.d.ts +24 -28
  469. package/dist/src/agent.d.ts.map +1 -1
  470. package/dist/src/agent.js +343 -172
  471. package/dist/src/agent.js.map +1 -1
  472. package/dist/src/agents/execution.js.map +1 -1
  473. package/dist/src/agents/planning.js.map +1 -1
  474. package/dist/src/agents/research.js.map +1 -1
  475. package/dist/src/file-manager.d.ts +6 -6
  476. package/dist/src/file-manager.d.ts.map +1 -1
  477. package/dist/src/file-manager.js +72 -63
  478. package/dist/src/file-manager.js.map +1 -1
  479. package/dist/src/git-manager.d.ts +2 -1
  480. package/dist/src/git-manager.d.ts.map +1 -1
  481. package/dist/src/git-manager.js +105 -70
  482. package/dist/src/git-manager.js.map +1 -1
  483. package/dist/src/posthog-api.d.ts +8 -14
  484. package/dist/src/posthog-api.d.ts.map +1 -1
  485. package/dist/src/posthog-api.js +35 -23
  486. package/dist/src/posthog-api.js.map +1 -1
  487. package/dist/src/prompt-builder.d.ts +4 -4
  488. package/dist/src/prompt-builder.d.ts.map +1 -1
  489. package/dist/src/prompt-builder.js +129 -99
  490. package/dist/src/prompt-builder.js.map +1 -1
  491. package/dist/src/schemas.d.ts +980 -0
  492. package/dist/src/schemas.d.ts.map +1 -0
  493. package/dist/src/schemas.js +196 -0
  494. package/dist/src/schemas.js.map +1 -0
  495. package/dist/src/session-store.d.ts +58 -0
  496. package/dist/src/session-store.d.ts.map +1 -0
  497. package/dist/src/session-store.js +206 -0
  498. package/dist/src/session-store.js.map +1 -0
  499. package/dist/src/task-manager.d.ts +7 -7
  500. package/dist/src/task-manager.d.ts.map +1 -1
  501. package/dist/src/task-manager.js +19 -18
  502. package/dist/src/task-manager.js.map +1 -1
  503. package/dist/src/template-manager.d.ts +1 -1
  504. package/dist/src/template-manager.d.ts.map +1 -1
  505. package/dist/src/template-manager.js +30 -28
  506. package/dist/src/template-manager.js.map +1 -1
  507. package/dist/src/todo-manager.d.ts +5 -5
  508. package/dist/src/todo-manager.d.ts.map +1 -1
  509. package/dist/src/todo-manager.js +33 -24
  510. package/dist/src/todo-manager.js.map +1 -1
  511. package/dist/src/tools/registry.d.ts +1 -1
  512. package/dist/src/tools/registry.js +60 -60
  513. package/dist/src/tools/registry.js.map +1 -1
  514. package/dist/src/tools/types.d.ts +31 -31
  515. package/dist/src/types.d.ts +62 -167
  516. package/dist/src/types.d.ts.map +1 -1
  517. package/dist/src/types.js +1 -0
  518. package/dist/src/types.js.map +1 -1
  519. package/dist/src/utils/logger.d.ts +14 -6
  520. package/dist/src/utils/logger.d.ts.map +1 -1
  521. package/dist/src/utils/logger.js +37 -22
  522. package/dist/src/utils/logger.js.map +1 -1
  523. package/dist/src/utils/tapped-stream.d.ts +17 -0
  524. package/dist/src/utils/tapped-stream.d.ts.map +1 -0
  525. package/dist/src/utils/tapped-stream.js +45 -0
  526. package/dist/src/utils/tapped-stream.js.map +1 -0
  527. package/dist/src/workflow/config.d.ts +1 -1
  528. package/dist/src/workflow/config.d.ts.map +1 -1
  529. package/dist/src/workflow/config.js +18 -18
  530. package/dist/src/workflow/config.js.map +1 -1
  531. package/dist/src/workflow/steps/build.d.ts +1 -1
  532. package/dist/src/workflow/steps/build.d.ts.map +1 -1
  533. package/dist/src/workflow/steps/build.js +53 -39
  534. package/dist/src/workflow/steps/build.js.map +1 -1
  535. package/dist/src/workflow/steps/finalize.d.ts +1 -1
  536. package/dist/src/workflow/steps/finalize.d.ts.map +1 -1
  537. package/dist/src/workflow/steps/finalize.js +58 -52
  538. package/dist/src/workflow/steps/finalize.js.map +1 -1
  539. package/dist/src/workflow/steps/plan.d.ts +1 -1
  540. package/dist/src/workflow/steps/plan.d.ts.map +1 -1
  541. package/dist/src/workflow/steps/plan.js +69 -47
  542. package/dist/src/workflow/steps/plan.js.map +1 -1
  543. package/dist/src/workflow/steps/research.d.ts +1 -1
  544. package/dist/src/workflow/steps/research.d.ts.map +1 -1
  545. package/dist/src/workflow/steps/research.js +86 -67
  546. package/dist/src/workflow/steps/research.js.map +1 -1
  547. package/dist/src/workflow/types.d.ts +19 -14
  548. package/dist/src/workflow/types.d.ts.map +1 -1
  549. package/dist/src/workflow/utils.d.ts +1 -1
  550. package/dist/src/workflow/utils.d.ts.map +1 -1
  551. package/dist/src/workflow/utils.js +7 -4
  552. package/dist/src/workflow/utils.js.map +1 -1
  553. package/dist/src/worktree-manager.d.ts +39 -0
  554. package/dist/src/worktree-manager.d.ts.map +1 -0
  555. package/dist/src/worktree-manager.js +808 -0
  556. package/dist/src/worktree-manager.js.map +1 -0
  557. package/package.json +20 -16
  558. package/src/acp-extensions.ts +117 -0
  559. package/src/adapters/claude/claude.ts +1514 -0
  560. package/src/adapters/claude/mcp-server.ts +810 -0
  561. package/src/adapters/claude/tools.ts +616 -0
  562. package/src/adapters/claude/utils.ts +267 -0
  563. package/src/agent.ts +717 -441
  564. package/src/agents/execution.ts +1 -1
  565. package/src/agents/planning.ts +1 -1
  566. package/src/agents/research.ts +0 -1
  567. package/src/file-manager.ts +80 -70
  568. package/src/git-manager.ts +164 -88
  569. package/src/posthog-api.ts +155 -94
  570. package/src/prompt-builder.ts +196 -143
  571. package/src/schemas.ts +241 -0
  572. package/src/session-store.ts +259 -0
  573. package/src/task-manager.ts +41 -33
  574. package/src/template-manager.ts +98 -45
  575. package/src/todo-manager.ts +43 -32
  576. package/src/tools/registry.ts +62 -62
  577. package/src/tools/types.ts +36 -36
  578. package/src/types.ts +130 -239
  579. package/src/utils/logger.ts +89 -58
  580. package/src/utils/tapped-stream.ts +60 -0
  581. package/src/workflow/config.ts +48 -48
  582. package/src/workflow/steps/build.ts +127 -113
  583. package/src/workflow/steps/finalize.ts +207 -182
  584. package/src/workflow/steps/plan.ts +155 -130
  585. package/src/workflow/steps/research.ts +207 -187
  586. package/src/workflow/types.ts +47 -36
  587. package/src/workflow/utils.ts +37 -34
  588. package/src/worktree-manager.ts +881 -0
  589. package/dist/src/adapters/claude/claude-adapter.d.ts +0 -18
  590. package/dist/src/adapters/claude/claude-adapter.d.ts.map +0 -1
  591. package/dist/src/adapters/claude/claude-adapter.js +0 -311
  592. package/dist/src/adapters/claude/claude-adapter.js.map +0 -1
  593. package/dist/src/adapters/claude/tool-mapper.d.ts +0 -19
  594. package/dist/src/adapters/claude/tool-mapper.d.ts.map +0 -1
  595. package/dist/src/adapters/claude/tool-mapper.js +0 -44
  596. package/dist/src/adapters/claude/tool-mapper.js.map +0 -1
  597. package/dist/src/adapters/types.d.ts +0 -33
  598. package/dist/src/adapters/types.d.ts.map +0 -1
  599. package/dist/src/task-progress-reporter.d.ts +0 -43
  600. package/dist/src/task-progress-reporter.d.ts.map +0 -1
  601. package/dist/src/task-progress-reporter.js +0 -393
  602. package/dist/src/task-progress-reporter.js.map +0 -1
  603. package/src/adapters/claude/claude-adapter.ts +0 -338
  604. package/src/adapters/claude/tool-mapper.ts +0 -46
  605. package/src/adapters/types.ts +0 -37
  606. package/src/task-progress-reporter.ts +0 -443
@@ -0,0 +1,1610 @@
1
+ import { custom, union, string, number, looseObject, object, record, unknown, literal, optional, array, intersection, boolean, preprocess, enum as _enum, discriminatedUnion } from '../../node_modules/zod/v4/classic/schemas.js';
2
+
3
+ const LATEST_PROTOCOL_VERSION = '2025-06-18';
4
+ const SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, '2025-03-26', '2024-11-05', '2024-10-07'];
5
+ /* JSON-RPC types */
6
+ const JSONRPC_VERSION = '2.0';
7
+ /**
8
+ * Assert 'object' type schema.
9
+ *
10
+ * @internal
11
+ */
12
+ const AssertObjectSchema = custom((v) => v !== null && (typeof v === 'object' || typeof v === 'function'));
13
+ /**
14
+ * A progress token, used to associate progress notifications with the original request.
15
+ */
16
+ const ProgressTokenSchema = union([string(), number().int()]);
17
+ /**
18
+ * An opaque token used to represent a cursor for pagination.
19
+ */
20
+ const CursorSchema = string();
21
+ const RequestMetaSchema = looseObject({
22
+ /**
23
+ * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
24
+ */
25
+ progressToken: ProgressTokenSchema.optional()
26
+ });
27
+ /**
28
+ * Common params for any request.
29
+ */
30
+ const BaseRequestParamsSchema = looseObject({
31
+ /**
32
+ * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
33
+ */
34
+ _meta: RequestMetaSchema.optional()
35
+ });
36
+ const RequestSchema = object({
37
+ method: string(),
38
+ params: BaseRequestParamsSchema.optional()
39
+ });
40
+ const NotificationsParamsSchema = looseObject({
41
+ /**
42
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
43
+ * for notes on _meta usage.
44
+ */
45
+ _meta: record(string(), unknown()).optional()
46
+ });
47
+ const NotificationSchema = object({
48
+ method: string(),
49
+ params: NotificationsParamsSchema.optional()
50
+ });
51
+ const ResultSchema = looseObject({
52
+ /**
53
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
54
+ * for notes on _meta usage.
55
+ */
56
+ _meta: record(string(), unknown()).optional()
57
+ });
58
+ /**
59
+ * A uniquely identifying ID for a request in JSON-RPC.
60
+ */
61
+ const RequestIdSchema = union([string(), number().int()]);
62
+ /**
63
+ * A request that expects a response.
64
+ */
65
+ const JSONRPCRequestSchema = object({
66
+ jsonrpc: literal(JSONRPC_VERSION),
67
+ id: RequestIdSchema,
68
+ ...RequestSchema.shape
69
+ })
70
+ .strict();
71
+ const isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
72
+ /**
73
+ * A notification which does not expect a response.
74
+ */
75
+ const JSONRPCNotificationSchema = object({
76
+ jsonrpc: literal(JSONRPC_VERSION),
77
+ ...NotificationSchema.shape
78
+ })
79
+ .strict();
80
+ const isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
81
+ /**
82
+ * A successful (non-error) response to a request.
83
+ */
84
+ const JSONRPCResponseSchema = object({
85
+ jsonrpc: literal(JSONRPC_VERSION),
86
+ id: RequestIdSchema,
87
+ result: ResultSchema
88
+ })
89
+ .strict();
90
+ const isJSONRPCResponse = (value) => JSONRPCResponseSchema.safeParse(value).success;
91
+ /**
92
+ * Error codes defined by the JSON-RPC specification.
93
+ */
94
+ var ErrorCode;
95
+ (function (ErrorCode) {
96
+ // SDK error codes
97
+ ErrorCode[ErrorCode["ConnectionClosed"] = -32e3] = "ConnectionClosed";
98
+ ErrorCode[ErrorCode["RequestTimeout"] = -32001] = "RequestTimeout";
99
+ // Standard JSON-RPC error codes
100
+ ErrorCode[ErrorCode["ParseError"] = -32700] = "ParseError";
101
+ ErrorCode[ErrorCode["InvalidRequest"] = -32600] = "InvalidRequest";
102
+ ErrorCode[ErrorCode["MethodNotFound"] = -32601] = "MethodNotFound";
103
+ ErrorCode[ErrorCode["InvalidParams"] = -32602] = "InvalidParams";
104
+ ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError";
105
+ // MCP-specific error codes
106
+ ErrorCode[ErrorCode["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
107
+ })(ErrorCode || (ErrorCode = {}));
108
+ /**
109
+ * A response to a request that indicates an error occurred.
110
+ */
111
+ const JSONRPCErrorSchema = object({
112
+ jsonrpc: literal(JSONRPC_VERSION),
113
+ id: RequestIdSchema,
114
+ error: object({
115
+ /**
116
+ * The error type that occurred.
117
+ */
118
+ code: number().int(),
119
+ /**
120
+ * A short description of the error. The message SHOULD be limited to a concise single sentence.
121
+ */
122
+ message: string(),
123
+ /**
124
+ * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
125
+ */
126
+ data: optional(unknown())
127
+ })
128
+ })
129
+ .strict();
130
+ const isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
131
+ union([JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, JSONRPCErrorSchema]);
132
+ /* Empty result */
133
+ /**
134
+ * A response that indicates success but carries no data.
135
+ */
136
+ const EmptyResultSchema = ResultSchema.strict();
137
+ const CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
138
+ /**
139
+ * The ID of the request to cancel.
140
+ *
141
+ * This MUST correspond to the ID of a request previously issued in the same direction.
142
+ */
143
+ requestId: RequestIdSchema,
144
+ /**
145
+ * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
146
+ */
147
+ reason: string().optional()
148
+ });
149
+ /* Cancellation */
150
+ /**
151
+ * This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
152
+ *
153
+ * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.
154
+ *
155
+ * This notification indicates that the result will be unused, so any associated processing SHOULD cease.
156
+ *
157
+ * A client MUST NOT attempt to cancel its `initialize` request.
158
+ */
159
+ const CancelledNotificationSchema = NotificationSchema.extend({
160
+ method: literal('notifications/cancelled'),
161
+ params: CancelledNotificationParamsSchema
162
+ });
163
+ /* Base Metadata */
164
+ /**
165
+ * Icon schema for use in tools, prompts, resources, and implementations.
166
+ */
167
+ const IconSchema = object({
168
+ /**
169
+ * URL or data URI for the icon.
170
+ */
171
+ src: string(),
172
+ /**
173
+ * Optional MIME type for the icon.
174
+ */
175
+ mimeType: string().optional(),
176
+ /**
177
+ * Optional array of strings that specify sizes at which the icon can be used.
178
+ * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
179
+ *
180
+ * If not provided, the client should assume that the icon can be used at any size.
181
+ */
182
+ sizes: array(string()).optional()
183
+ });
184
+ /**
185
+ * Base schema to add `icons` property.
186
+ *
187
+ */
188
+ const IconsSchema = object({
189
+ /**
190
+ * Optional set of sized icons that the client can display in a user interface.
191
+ *
192
+ * Clients that support rendering icons MUST support at least the following MIME types:
193
+ * - `image/png` - PNG images (safe, universal compatibility)
194
+ * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
195
+ *
196
+ * Clients that support rendering icons SHOULD also support:
197
+ * - `image/svg+xml` - SVG images (scalable but requires security precautions)
198
+ * - `image/webp` - WebP images (modern, efficient format)
199
+ */
200
+ icons: array(IconSchema).optional()
201
+ });
202
+ /**
203
+ * Base metadata interface for common properties across resources, tools, prompts, and implementations.
204
+ */
205
+ const BaseMetadataSchema = object({
206
+ /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
207
+ name: string(),
208
+ /**
209
+ * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
210
+ * even by those unfamiliar with domain-specific terminology.
211
+ *
212
+ * If not provided, the name should be used for display (except for Tool,
213
+ * where `annotations.title` should be given precedence over using `name`,
214
+ * if present).
215
+ */
216
+ title: string().optional()
217
+ });
218
+ /* Initialization */
219
+ /**
220
+ * Describes the name and version of an MCP implementation.
221
+ */
222
+ const ImplementationSchema = BaseMetadataSchema.extend({
223
+ ...BaseMetadataSchema.shape,
224
+ ...IconsSchema.shape,
225
+ version: string(),
226
+ /**
227
+ * An optional URL of the website for this implementation.
228
+ */
229
+ websiteUrl: string().optional()
230
+ });
231
+ const FormElicitationCapabilitySchema = intersection(object({
232
+ applyDefaults: boolean().optional()
233
+ }), record(string(), unknown()));
234
+ const ElicitationCapabilitySchema = preprocess(value => {
235
+ if (value && typeof value === 'object' && !Array.isArray(value)) {
236
+ if (Object.keys(value).length === 0) {
237
+ return { form: {} };
238
+ }
239
+ }
240
+ return value;
241
+ }, intersection(object({
242
+ form: FormElicitationCapabilitySchema.optional(),
243
+ url: AssertObjectSchema.optional()
244
+ }), record(string(), unknown()).optional()));
245
+ /**
246
+ * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.
247
+ */
248
+ const ClientCapabilitiesSchema = object({
249
+ /**
250
+ * Experimental, non-standard capabilities that the client supports.
251
+ */
252
+ experimental: record(string(), AssertObjectSchema).optional(),
253
+ /**
254
+ * Present if the client supports sampling from an LLM.
255
+ */
256
+ sampling: object({
257
+ /**
258
+ * Present if the client supports context inclusion via includeContext parameter.
259
+ * If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
260
+ */
261
+ context: AssertObjectSchema.optional(),
262
+ /**
263
+ * Present if the client supports tool use via tools and toolChoice parameters.
264
+ */
265
+ tools: AssertObjectSchema.optional()
266
+ })
267
+ .optional(),
268
+ /**
269
+ * Present if the client supports eliciting user input.
270
+ */
271
+ elicitation: ElicitationCapabilitySchema.optional(),
272
+ /**
273
+ * Present if the client supports listing roots.
274
+ */
275
+ roots: object({
276
+ /**
277
+ * Whether the client supports issuing notifications for changes to the roots list.
278
+ */
279
+ listChanged: boolean().optional()
280
+ })
281
+ .optional()
282
+ });
283
+ const InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
284
+ /**
285
+ * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
286
+ */
287
+ protocolVersion: string(),
288
+ capabilities: ClientCapabilitiesSchema,
289
+ clientInfo: ImplementationSchema
290
+ });
291
+ /**
292
+ * This request is sent from the client to the server when it first connects, asking it to begin initialization.
293
+ */
294
+ const InitializeRequestSchema = RequestSchema.extend({
295
+ method: literal('initialize'),
296
+ params: InitializeRequestParamsSchema
297
+ });
298
+ /**
299
+ * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.
300
+ */
301
+ const ServerCapabilitiesSchema = object({
302
+ /**
303
+ * Experimental, non-standard capabilities that the server supports.
304
+ */
305
+ experimental: record(string(), AssertObjectSchema).optional(),
306
+ /**
307
+ * Present if the server supports sending log messages to the client.
308
+ */
309
+ logging: AssertObjectSchema.optional(),
310
+ /**
311
+ * Present if the server supports sending completions to the client.
312
+ */
313
+ completions: AssertObjectSchema.optional(),
314
+ /**
315
+ * Present if the server offers any prompt templates.
316
+ */
317
+ prompts: optional(object({
318
+ /**
319
+ * Whether this server supports issuing notifications for changes to the prompt list.
320
+ */
321
+ listChanged: optional(boolean())
322
+ })),
323
+ /**
324
+ * Present if the server offers any resources to read.
325
+ */
326
+ resources: object({
327
+ /**
328
+ * Whether this server supports clients subscribing to resource updates.
329
+ */
330
+ subscribe: boolean().optional(),
331
+ /**
332
+ * Whether this server supports issuing notifications for changes to the resource list.
333
+ */
334
+ listChanged: boolean().optional()
335
+ })
336
+ .optional(),
337
+ /**
338
+ * Present if the server offers any tools to call.
339
+ */
340
+ tools: object({
341
+ /**
342
+ * Whether this server supports issuing notifications for changes to the tool list.
343
+ */
344
+ listChanged: boolean().optional()
345
+ })
346
+ .optional()
347
+ });
348
+ /**
349
+ * After receiving an initialize request from the client, the server sends this response.
350
+ */
351
+ const InitializeResultSchema = ResultSchema.extend({
352
+ /**
353
+ * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
354
+ */
355
+ protocolVersion: string(),
356
+ capabilities: ServerCapabilitiesSchema,
357
+ serverInfo: ImplementationSchema,
358
+ /**
359
+ * Instructions describing how to use the server and its features.
360
+ *
361
+ * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
362
+ */
363
+ instructions: string().optional()
364
+ });
365
+ /**
366
+ * This notification is sent from the client to the server after initialization has finished.
367
+ */
368
+ const InitializedNotificationSchema = NotificationSchema.extend({
369
+ method: literal('notifications/initialized')
370
+ });
371
+ /* Ping */
372
+ /**
373
+ * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
374
+ */
375
+ const PingRequestSchema = RequestSchema.extend({
376
+ method: literal('ping')
377
+ });
378
+ /* Progress notifications */
379
+ const ProgressSchema = object({
380
+ /**
381
+ * The progress thus far. This should increase every time progress is made, even if the total is unknown.
382
+ */
383
+ progress: number(),
384
+ /**
385
+ * Total number of items to process (or total progress required), if known.
386
+ */
387
+ total: optional(number()),
388
+ /**
389
+ * An optional message describing the current progress.
390
+ */
391
+ message: optional(string())
392
+ });
393
+ const ProgressNotificationParamsSchema = object({
394
+ ...NotificationsParamsSchema.shape,
395
+ ...ProgressSchema.shape,
396
+ /**
397
+ * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
398
+ */
399
+ progressToken: ProgressTokenSchema
400
+ });
401
+ /**
402
+ * An out-of-band notification used to inform the receiver of a progress update for a long-running request.
403
+ *
404
+ * @category notifications/progress
405
+ */
406
+ const ProgressNotificationSchema = NotificationSchema.extend({
407
+ method: literal('notifications/progress'),
408
+ params: ProgressNotificationParamsSchema
409
+ });
410
+ const PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
411
+ /**
412
+ * An opaque token representing the current pagination position.
413
+ * If provided, the server should return results starting after this cursor.
414
+ */
415
+ cursor: CursorSchema.optional()
416
+ });
417
+ /* Pagination */
418
+ const PaginatedRequestSchema = RequestSchema.extend({
419
+ params: PaginatedRequestParamsSchema.optional()
420
+ });
421
+ const PaginatedResultSchema = ResultSchema.extend({
422
+ /**
423
+ * An opaque token representing the pagination position after the last returned result.
424
+ * If present, there may be more results available.
425
+ */
426
+ nextCursor: optional(CursorSchema)
427
+ });
428
+ /* Resources */
429
+ /**
430
+ * The contents of a specific resource or sub-resource.
431
+ */
432
+ const ResourceContentsSchema = object({
433
+ /**
434
+ * The URI of this resource.
435
+ */
436
+ uri: string(),
437
+ /**
438
+ * The MIME type of this resource, if known.
439
+ */
440
+ mimeType: optional(string()),
441
+ /**
442
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
443
+ * for notes on _meta usage.
444
+ */
445
+ _meta: record(string(), unknown()).optional()
446
+ });
447
+ const TextResourceContentsSchema = ResourceContentsSchema.extend({
448
+ /**
449
+ * The text of the item. This must only be set if the item can actually be represented as text (not binary data).
450
+ */
451
+ text: string()
452
+ });
453
+ /**
454
+ * A Zod schema for validating Base64 strings that is more performant and
455
+ * robust for very large inputs than the default regex-based check. It avoids
456
+ * stack overflows by using the native `atob` function for validation.
457
+ */
458
+ const Base64Schema = string().refine(val => {
459
+ try {
460
+ // atob throws a DOMException if the string contains characters
461
+ // that are not part of the Base64 character set.
462
+ atob(val);
463
+ return true;
464
+ }
465
+ catch (_a) {
466
+ return false;
467
+ }
468
+ }, { message: 'Invalid Base64 string' });
469
+ const BlobResourceContentsSchema = ResourceContentsSchema.extend({
470
+ /**
471
+ * A base64-encoded string representing the binary data of the item.
472
+ */
473
+ blob: Base64Schema
474
+ });
475
+ /**
476
+ * A known resource that the server is capable of reading.
477
+ */
478
+ const ResourceSchema = object({
479
+ ...BaseMetadataSchema.shape,
480
+ ...IconsSchema.shape,
481
+ /**
482
+ * The URI of this resource.
483
+ */
484
+ uri: string(),
485
+ /**
486
+ * A description of what this resource represents.
487
+ *
488
+ * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
489
+ */
490
+ description: optional(string()),
491
+ /**
492
+ * The MIME type of this resource, if known.
493
+ */
494
+ mimeType: optional(string()),
495
+ /**
496
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
497
+ * for notes on _meta usage.
498
+ */
499
+ _meta: optional(looseObject({}))
500
+ });
501
+ /**
502
+ * A template description for resources available on the server.
503
+ */
504
+ const ResourceTemplateSchema = object({
505
+ ...BaseMetadataSchema.shape,
506
+ ...IconsSchema.shape,
507
+ /**
508
+ * A URI template (according to RFC 6570) that can be used to construct resource URIs.
509
+ */
510
+ uriTemplate: string(),
511
+ /**
512
+ * A description of what this template is for.
513
+ *
514
+ * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
515
+ */
516
+ description: optional(string()),
517
+ /**
518
+ * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
519
+ */
520
+ mimeType: optional(string()),
521
+ /**
522
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
523
+ * for notes on _meta usage.
524
+ */
525
+ _meta: optional(looseObject({}))
526
+ });
527
+ /**
528
+ * Sent from the client to request a list of resources the server has.
529
+ */
530
+ const ListResourcesRequestSchema = PaginatedRequestSchema.extend({
531
+ method: literal('resources/list')
532
+ });
533
+ /**
534
+ * The server's response to a resources/list request from the client.
535
+ */
536
+ const ListResourcesResultSchema = PaginatedResultSchema.extend({
537
+ resources: array(ResourceSchema)
538
+ });
539
+ /**
540
+ * Sent from the client to request a list of resource templates the server has.
541
+ */
542
+ const ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
543
+ method: literal('resources/templates/list')
544
+ });
545
+ /**
546
+ * The server's response to a resources/templates/list request from the client.
547
+ */
548
+ const ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
549
+ resourceTemplates: array(ResourceTemplateSchema)
550
+ });
551
+ const ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
552
+ /**
553
+ * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
554
+ *
555
+ * @format uri
556
+ */
557
+ uri: string()
558
+ });
559
+ /**
560
+ * Parameters for a `resources/read` request.
561
+ */
562
+ const ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
563
+ /**
564
+ * Sent from the client to the server, to read a specific resource URI.
565
+ */
566
+ const ReadResourceRequestSchema = RequestSchema.extend({
567
+ method: literal('resources/read'),
568
+ params: ReadResourceRequestParamsSchema
569
+ });
570
+ /**
571
+ * The server's response to a resources/read request from the client.
572
+ */
573
+ const ReadResourceResultSchema = ResultSchema.extend({
574
+ contents: array(union([TextResourceContentsSchema, BlobResourceContentsSchema]))
575
+ });
576
+ /**
577
+ * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
578
+ */
579
+ const ResourceListChangedNotificationSchema = NotificationSchema.extend({
580
+ method: literal('notifications/resources/list_changed')
581
+ });
582
+ const SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
583
+ /**
584
+ * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
585
+ */
586
+ const SubscribeRequestSchema = RequestSchema.extend({
587
+ method: literal('resources/subscribe'),
588
+ params: SubscribeRequestParamsSchema
589
+ });
590
+ const UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
591
+ /**
592
+ * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
593
+ */
594
+ const UnsubscribeRequestSchema = RequestSchema.extend({
595
+ method: literal('resources/unsubscribe'),
596
+ params: UnsubscribeRequestParamsSchema
597
+ });
598
+ /**
599
+ * Parameters for a `notifications/resources/updated` notification.
600
+ */
601
+ const ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
602
+ /**
603
+ * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
604
+ */
605
+ uri: string()
606
+ });
607
+ /**
608
+ * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
609
+ */
610
+ const ResourceUpdatedNotificationSchema = NotificationSchema.extend({
611
+ method: literal('notifications/resources/updated'),
612
+ params: ResourceUpdatedNotificationParamsSchema
613
+ });
614
+ /* Prompts */
615
+ /**
616
+ * Describes an argument that a prompt can accept.
617
+ */
618
+ const PromptArgumentSchema = object({
619
+ /**
620
+ * The name of the argument.
621
+ */
622
+ name: string(),
623
+ /**
624
+ * A human-readable description of the argument.
625
+ */
626
+ description: optional(string()),
627
+ /**
628
+ * Whether this argument must be provided.
629
+ */
630
+ required: optional(boolean())
631
+ });
632
+ /**
633
+ * A prompt or prompt template that the server offers.
634
+ */
635
+ const PromptSchema = object({
636
+ ...BaseMetadataSchema.shape,
637
+ ...IconsSchema.shape,
638
+ /**
639
+ * An optional description of what this prompt provides
640
+ */
641
+ description: optional(string()),
642
+ /**
643
+ * A list of arguments to use for templating the prompt.
644
+ */
645
+ arguments: optional(array(PromptArgumentSchema)),
646
+ /**
647
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
648
+ * for notes on _meta usage.
649
+ */
650
+ _meta: optional(looseObject({}))
651
+ });
652
+ /**
653
+ * Sent from the client to request a list of prompts and prompt templates the server has.
654
+ */
655
+ const ListPromptsRequestSchema = PaginatedRequestSchema.extend({
656
+ method: literal('prompts/list')
657
+ });
658
+ /**
659
+ * The server's response to a prompts/list request from the client.
660
+ */
661
+ const ListPromptsResultSchema = PaginatedResultSchema.extend({
662
+ prompts: array(PromptSchema)
663
+ });
664
+ /**
665
+ * Parameters for a `prompts/get` request.
666
+ */
667
+ const GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
668
+ /**
669
+ * The name of the prompt or prompt template.
670
+ */
671
+ name: string(),
672
+ /**
673
+ * Arguments to use for templating the prompt.
674
+ */
675
+ arguments: record(string(), string()).optional()
676
+ });
677
+ /**
678
+ * Used by the client to get a prompt provided by the server.
679
+ */
680
+ const GetPromptRequestSchema = RequestSchema.extend({
681
+ method: literal('prompts/get'),
682
+ params: GetPromptRequestParamsSchema
683
+ });
684
+ /**
685
+ * Text provided to or from an LLM.
686
+ */
687
+ const TextContentSchema = object({
688
+ type: literal('text'),
689
+ /**
690
+ * The text content of the message.
691
+ */
692
+ text: string(),
693
+ /**
694
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
695
+ * for notes on _meta usage.
696
+ */
697
+ _meta: record(string(), unknown()).optional()
698
+ });
699
+ /**
700
+ * An image provided to or from an LLM.
701
+ */
702
+ const ImageContentSchema = object({
703
+ type: literal('image'),
704
+ /**
705
+ * The base64-encoded image data.
706
+ */
707
+ data: Base64Schema,
708
+ /**
709
+ * The MIME type of the image. Different providers may support different image types.
710
+ */
711
+ mimeType: string(),
712
+ /**
713
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
714
+ * for notes on _meta usage.
715
+ */
716
+ _meta: record(string(), unknown()).optional()
717
+ });
718
+ /**
719
+ * An Audio provided to or from an LLM.
720
+ */
721
+ const AudioContentSchema = object({
722
+ type: literal('audio'),
723
+ /**
724
+ * The base64-encoded audio data.
725
+ */
726
+ data: Base64Schema,
727
+ /**
728
+ * The MIME type of the audio. Different providers may support different audio types.
729
+ */
730
+ mimeType: string(),
731
+ /**
732
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
733
+ * for notes on _meta usage.
734
+ */
735
+ _meta: record(string(), unknown()).optional()
736
+ });
737
+ /**
738
+ * A tool call request from an assistant (LLM).
739
+ * Represents the assistant's request to use a tool.
740
+ */
741
+ const ToolUseContentSchema = object({
742
+ type: literal('tool_use'),
743
+ /**
744
+ * The name of the tool to invoke.
745
+ * Must match a tool name from the request's tools array.
746
+ */
747
+ name: string(),
748
+ /**
749
+ * Unique identifier for this tool call.
750
+ * Used to correlate with ToolResultContent in subsequent messages.
751
+ */
752
+ id: string(),
753
+ /**
754
+ * Arguments to pass to the tool.
755
+ * Must conform to the tool's inputSchema.
756
+ */
757
+ input: object({}).passthrough(),
758
+ /**
759
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
760
+ * for notes on _meta usage.
761
+ */
762
+ _meta: optional(object({}).passthrough())
763
+ })
764
+ .passthrough();
765
+ /**
766
+ * The contents of a resource, embedded into a prompt or tool call result.
767
+ */
768
+ const EmbeddedResourceSchema = object({
769
+ type: literal('resource'),
770
+ resource: union([TextResourceContentsSchema, BlobResourceContentsSchema]),
771
+ /**
772
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
773
+ * for notes on _meta usage.
774
+ */
775
+ _meta: record(string(), unknown()).optional()
776
+ });
777
+ /**
778
+ * A resource that the server is capable of reading, included in a prompt or tool call result.
779
+ *
780
+ * Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests.
781
+ */
782
+ const ResourceLinkSchema = ResourceSchema.extend({
783
+ type: literal('resource_link')
784
+ });
785
+ /**
786
+ * A content block that can be used in prompts and tool results.
787
+ */
788
+ const ContentBlockSchema = union([
789
+ TextContentSchema,
790
+ ImageContentSchema,
791
+ AudioContentSchema,
792
+ ResourceLinkSchema,
793
+ EmbeddedResourceSchema
794
+ ]);
795
+ /**
796
+ * Describes a message returned as part of a prompt.
797
+ */
798
+ const PromptMessageSchema = object({
799
+ role: _enum(['user', 'assistant']),
800
+ content: ContentBlockSchema
801
+ });
802
+ /**
803
+ * The server's response to a prompts/get request from the client.
804
+ */
805
+ const GetPromptResultSchema = ResultSchema.extend({
806
+ /**
807
+ * An optional description for the prompt.
808
+ */
809
+ description: optional(string()),
810
+ messages: array(PromptMessageSchema)
811
+ });
812
+ /**
813
+ * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
814
+ */
815
+ const PromptListChangedNotificationSchema = NotificationSchema.extend({
816
+ method: literal('notifications/prompts/list_changed')
817
+ });
818
+ /* Tools */
819
+ /**
820
+ * Additional properties describing a Tool to clients.
821
+ *
822
+ * NOTE: all properties in ToolAnnotations are **hints**.
823
+ * They are not guaranteed to provide a faithful description of
824
+ * tool behavior (including descriptive properties like `title`).
825
+ *
826
+ * Clients should never make tool use decisions based on ToolAnnotations
827
+ * received from untrusted servers.
828
+ */
829
+ const ToolAnnotationsSchema = object({
830
+ /**
831
+ * A human-readable title for the tool.
832
+ */
833
+ title: string().optional(),
834
+ /**
835
+ * If true, the tool does not modify its environment.
836
+ *
837
+ * Default: false
838
+ */
839
+ readOnlyHint: boolean().optional(),
840
+ /**
841
+ * If true, the tool may perform destructive updates to its environment.
842
+ * If false, the tool performs only additive updates.
843
+ *
844
+ * (This property is meaningful only when `readOnlyHint == false`)
845
+ *
846
+ * Default: true
847
+ */
848
+ destructiveHint: boolean().optional(),
849
+ /**
850
+ * If true, calling the tool repeatedly with the same arguments
851
+ * will have no additional effect on the its environment.
852
+ *
853
+ * (This property is meaningful only when `readOnlyHint == false`)
854
+ *
855
+ * Default: false
856
+ */
857
+ idempotentHint: boolean().optional(),
858
+ /**
859
+ * If true, this tool may interact with an "open world" of external
860
+ * entities. If false, the tool's domain of interaction is closed.
861
+ * For example, the world of a web search tool is open, whereas that
862
+ * of a memory tool is not.
863
+ *
864
+ * Default: true
865
+ */
866
+ openWorldHint: boolean().optional()
867
+ });
868
+ /**
869
+ * Definition for a tool the client can call.
870
+ */
871
+ const ToolSchema = object({
872
+ ...BaseMetadataSchema.shape,
873
+ ...IconsSchema.shape,
874
+ /**
875
+ * A human-readable description of the tool.
876
+ */
877
+ description: string().optional(),
878
+ /**
879
+ * A JSON Schema 2020-12 object defining the expected parameters for the tool.
880
+ * Must have type: 'object' at the root level per MCP spec.
881
+ */
882
+ inputSchema: object({
883
+ type: literal('object'),
884
+ properties: record(string(), AssertObjectSchema).optional(),
885
+ required: array(string()).optional()
886
+ })
887
+ .catchall(unknown()),
888
+ /**
889
+ * An optional JSON Schema 2020-12 object defining the structure of the tool's output
890
+ * returned in the structuredContent field of a CallToolResult.
891
+ * Must have type: 'object' at the root level per MCP spec.
892
+ */
893
+ outputSchema: object({
894
+ type: literal('object'),
895
+ properties: record(string(), AssertObjectSchema).optional(),
896
+ required: array(string()).optional()
897
+ })
898
+ .catchall(unknown())
899
+ .optional(),
900
+ /**
901
+ * Optional additional tool information.
902
+ */
903
+ annotations: optional(ToolAnnotationsSchema),
904
+ /**
905
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
906
+ * for notes on _meta usage.
907
+ */
908
+ _meta: record(string(), unknown()).optional()
909
+ });
910
+ /**
911
+ * Sent from the client to request a list of tools the server has.
912
+ */
913
+ const ListToolsRequestSchema = PaginatedRequestSchema.extend({
914
+ method: literal('tools/list')
915
+ });
916
+ /**
917
+ * The server's response to a tools/list request from the client.
918
+ */
919
+ const ListToolsResultSchema = PaginatedResultSchema.extend({
920
+ tools: array(ToolSchema)
921
+ });
922
+ /**
923
+ * The server's response to a tool call.
924
+ */
925
+ const CallToolResultSchema = ResultSchema.extend({
926
+ /**
927
+ * A list of content objects that represent the result of the tool call.
928
+ *
929
+ * If the Tool does not define an outputSchema, this field MUST be present in the result.
930
+ * For backwards compatibility, this field is always present, but it may be empty.
931
+ */
932
+ content: array(ContentBlockSchema).default([]),
933
+ /**
934
+ * An object containing structured tool output.
935
+ *
936
+ * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
937
+ */
938
+ structuredContent: record(string(), unknown()).optional(),
939
+ /**
940
+ * Whether the tool call ended in an error.
941
+ *
942
+ * If not set, this is assumed to be false (the call was successful).
943
+ *
944
+ * Any errors that originate from the tool SHOULD be reported inside the result
945
+ * object, with `isError` set to true, _not_ as an MCP protocol-level error
946
+ * response. Otherwise, the LLM would not be able to see that an error occurred
947
+ * and self-correct.
948
+ *
949
+ * However, any errors in _finding_ the tool, an error indicating that the
950
+ * server does not support tool calls, or any other exceptional conditions,
951
+ * should be reported as an MCP error response.
952
+ */
953
+ isError: optional(boolean())
954
+ });
955
+ /**
956
+ * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07.
957
+ */
958
+ CallToolResultSchema.or(ResultSchema.extend({
959
+ toolResult: unknown()
960
+ }));
961
+ /**
962
+ * Parameters for a `tools/call` request.
963
+ */
964
+ const CallToolRequestParamsSchema = BaseRequestParamsSchema.extend({
965
+ /**
966
+ * The name of the tool to call.
967
+ */
968
+ name: string(),
969
+ /**
970
+ * Arguments to pass to the tool.
971
+ */
972
+ arguments: optional(record(string(), unknown()))
973
+ });
974
+ /**
975
+ * Used by the client to invoke a tool provided by the server.
976
+ */
977
+ const CallToolRequestSchema = RequestSchema.extend({
978
+ method: literal('tools/call'),
979
+ params: CallToolRequestParamsSchema
980
+ });
981
+ /**
982
+ * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
983
+ */
984
+ const ToolListChangedNotificationSchema = NotificationSchema.extend({
985
+ method: literal('notifications/tools/list_changed')
986
+ });
987
+ /* Logging */
988
+ /**
989
+ * The severity of a log message.
990
+ */
991
+ const LoggingLevelSchema = _enum(['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency']);
992
+ /**
993
+ * Parameters for a `logging/setLevel` request.
994
+ */
995
+ const SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
996
+ /**
997
+ * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
998
+ */
999
+ level: LoggingLevelSchema
1000
+ });
1001
+ /**
1002
+ * A request from the client to the server, to enable or adjust logging.
1003
+ */
1004
+ const SetLevelRequestSchema = RequestSchema.extend({
1005
+ method: literal('logging/setLevel'),
1006
+ params: SetLevelRequestParamsSchema
1007
+ });
1008
+ /**
1009
+ * Parameters for a `notifications/message` notification.
1010
+ */
1011
+ const LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
1012
+ /**
1013
+ * The severity of this log message.
1014
+ */
1015
+ level: LoggingLevelSchema,
1016
+ /**
1017
+ * An optional name of the logger issuing this message.
1018
+ */
1019
+ logger: string().optional(),
1020
+ /**
1021
+ * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
1022
+ */
1023
+ data: unknown()
1024
+ });
1025
+ /**
1026
+ * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
1027
+ */
1028
+ const LoggingMessageNotificationSchema = NotificationSchema.extend({
1029
+ method: literal('notifications/message'),
1030
+ params: LoggingMessageNotificationParamsSchema
1031
+ });
1032
+ /* Sampling */
1033
+ /**
1034
+ * Hints to use for model selection.
1035
+ */
1036
+ const ModelHintSchema = object({
1037
+ /**
1038
+ * A hint for a model name.
1039
+ */
1040
+ name: string().optional()
1041
+ });
1042
+ /**
1043
+ * The server's preferences for model selection, requested of the client during sampling.
1044
+ */
1045
+ const ModelPreferencesSchema = object({
1046
+ /**
1047
+ * Optional hints to use for model selection.
1048
+ */
1049
+ hints: optional(array(ModelHintSchema)),
1050
+ /**
1051
+ * How much to prioritize cost when selecting a model.
1052
+ */
1053
+ costPriority: optional(number().min(0).max(1)),
1054
+ /**
1055
+ * How much to prioritize sampling speed (latency) when selecting a model.
1056
+ */
1057
+ speedPriority: optional(number().min(0).max(1)),
1058
+ /**
1059
+ * How much to prioritize intelligence and capabilities when selecting a model.
1060
+ */
1061
+ intelligencePriority: optional(number().min(0).max(1))
1062
+ });
1063
+ /**
1064
+ * Controls tool usage behavior in sampling requests.
1065
+ */
1066
+ const ToolChoiceSchema = object({
1067
+ /**
1068
+ * Controls when tools are used:
1069
+ * - "auto": Model decides whether to use tools (default)
1070
+ * - "required": Model MUST use at least one tool before completing
1071
+ * - "none": Model MUST NOT use any tools
1072
+ */
1073
+ mode: optional(_enum(['auto', 'required', 'none']))
1074
+ });
1075
+ /**
1076
+ * The result of a tool execution, provided by the user (server).
1077
+ * Represents the outcome of invoking a tool requested via ToolUseContent.
1078
+ */
1079
+ const ToolResultContentSchema = object({
1080
+ type: literal('tool_result'),
1081
+ toolUseId: string().describe('The unique identifier for the corresponding tool call.'),
1082
+ content: array(ContentBlockSchema).default([]),
1083
+ structuredContent: object({}).passthrough().optional(),
1084
+ isError: optional(boolean()),
1085
+ /**
1086
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
1087
+ * for notes on _meta usage.
1088
+ */
1089
+ _meta: optional(object({}).passthrough())
1090
+ })
1091
+ .passthrough();
1092
+ /**
1093
+ * Content block types allowed in sampling messages.
1094
+ * This includes text, image, audio, tool use requests, and tool results.
1095
+ */
1096
+ const SamplingMessageContentBlockSchema = discriminatedUnion('type', [
1097
+ TextContentSchema,
1098
+ ImageContentSchema,
1099
+ AudioContentSchema,
1100
+ ToolUseContentSchema,
1101
+ ToolResultContentSchema
1102
+ ]);
1103
+ /**
1104
+ * Describes a message issued to or received from an LLM API.
1105
+ */
1106
+ const SamplingMessageSchema = object({
1107
+ role: _enum(['user', 'assistant']),
1108
+ content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)]),
1109
+ /**
1110
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
1111
+ * for notes on _meta usage.
1112
+ */
1113
+ _meta: optional(object({}).passthrough())
1114
+ })
1115
+ .passthrough();
1116
+ /**
1117
+ * Parameters for a `sampling/createMessage` request.
1118
+ */
1119
+ const CreateMessageRequestParamsSchema = BaseRequestParamsSchema.extend({
1120
+ messages: array(SamplingMessageSchema),
1121
+ /**
1122
+ * The server's preferences for which model to select. The client MAY modify or omit this request.
1123
+ */
1124
+ modelPreferences: ModelPreferencesSchema.optional(),
1125
+ /**
1126
+ * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
1127
+ */
1128
+ systemPrompt: string().optional(),
1129
+ /**
1130
+ * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
1131
+ * The client MAY ignore this request.
1132
+ *
1133
+ * Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
1134
+ * declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
1135
+ */
1136
+ includeContext: _enum(['none', 'thisServer', 'allServers']).optional(),
1137
+ temperature: number().optional(),
1138
+ /**
1139
+ * The requested maximum number of tokens to sample (to prevent runaway completions).
1140
+ *
1141
+ * The client MAY choose to sample fewer tokens than the requested maximum.
1142
+ */
1143
+ maxTokens: number().int(),
1144
+ stopSequences: array(string()).optional(),
1145
+ /**
1146
+ * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
1147
+ */
1148
+ metadata: AssertObjectSchema.optional(),
1149
+ /**
1150
+ * Tools that the model may use during generation.
1151
+ * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
1152
+ */
1153
+ tools: optional(array(ToolSchema)),
1154
+ /**
1155
+ * Controls how the model uses tools.
1156
+ * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
1157
+ * Default is `{ mode: "auto" }`.
1158
+ */
1159
+ toolChoice: optional(ToolChoiceSchema)
1160
+ });
1161
+ /**
1162
+ * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
1163
+ */
1164
+ const CreateMessageRequestSchema = RequestSchema.extend({
1165
+ method: literal('sampling/createMessage'),
1166
+ params: CreateMessageRequestParamsSchema
1167
+ });
1168
+ /**
1169
+ * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
1170
+ */
1171
+ const CreateMessageResultSchema = ResultSchema.extend({
1172
+ /**
1173
+ * The name of the model that generated the message.
1174
+ */
1175
+ model: string(),
1176
+ /**
1177
+ * The reason why sampling stopped, if known.
1178
+ *
1179
+ * Standard values:
1180
+ * - "endTurn": Natural end of the assistant's turn
1181
+ * - "stopSequence": A stop sequence was encountered
1182
+ * - "maxTokens": Maximum token limit was reached
1183
+ * - "toolUse": The model wants to use one or more tools
1184
+ *
1185
+ * This field is an open string to allow for provider-specific stop reasons.
1186
+ */
1187
+ stopReason: optional(_enum(['endTurn', 'stopSequence', 'maxTokens', 'toolUse']).or(string())),
1188
+ role: _enum(['user', 'assistant']),
1189
+ /**
1190
+ * Response content. May be ToolUseContent if stopReason is "toolUse".
1191
+ */
1192
+ content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)])
1193
+ });
1194
+ /* Elicitation */
1195
+ /**
1196
+ * Primitive schema definition for boolean fields.
1197
+ */
1198
+ const BooleanSchemaSchema = object({
1199
+ type: literal('boolean'),
1200
+ title: string().optional(),
1201
+ description: string().optional(),
1202
+ default: boolean().optional()
1203
+ });
1204
+ /**
1205
+ * Primitive schema definition for string fields.
1206
+ */
1207
+ const StringSchemaSchema = object({
1208
+ type: literal('string'),
1209
+ title: string().optional(),
1210
+ description: string().optional(),
1211
+ minLength: number().optional(),
1212
+ maxLength: number().optional(),
1213
+ format: _enum(['email', 'uri', 'date', 'date-time']).optional(),
1214
+ default: string().optional()
1215
+ });
1216
+ /**
1217
+ * Primitive schema definition for number fields.
1218
+ */
1219
+ const NumberSchemaSchema = object({
1220
+ type: _enum(['number', 'integer']),
1221
+ title: string().optional(),
1222
+ description: string().optional(),
1223
+ minimum: number().optional(),
1224
+ maximum: number().optional(),
1225
+ default: number().optional()
1226
+ });
1227
+ /**
1228
+ * Schema for single-selection enumeration without display titles for options.
1229
+ */
1230
+ const UntitledSingleSelectEnumSchemaSchema = object({
1231
+ type: literal('string'),
1232
+ title: string().optional(),
1233
+ description: string().optional(),
1234
+ enum: array(string()),
1235
+ default: string().optional()
1236
+ });
1237
+ /**
1238
+ * Schema for single-selection enumeration with display titles for each option.
1239
+ */
1240
+ const TitledSingleSelectEnumSchemaSchema = object({
1241
+ type: literal('string'),
1242
+ title: string().optional(),
1243
+ description: string().optional(),
1244
+ oneOf: array(object({
1245
+ const: string(),
1246
+ title: string()
1247
+ })),
1248
+ default: string().optional()
1249
+ });
1250
+ /**
1251
+ * Use TitledSingleSelectEnumSchema instead.
1252
+ * This interface will be removed in a future version.
1253
+ */
1254
+ const LegacyTitledEnumSchemaSchema = object({
1255
+ type: literal('string'),
1256
+ title: string().optional(),
1257
+ description: string().optional(),
1258
+ enum: array(string()),
1259
+ enumNames: array(string()).optional(),
1260
+ default: string().optional()
1261
+ });
1262
+ // Combined single selection enumeration
1263
+ const SingleSelectEnumSchemaSchema = union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
1264
+ /**
1265
+ * Schema for multiple-selection enumeration without display titles for options.
1266
+ */
1267
+ const UntitledMultiSelectEnumSchemaSchema = object({
1268
+ type: literal('array'),
1269
+ title: string().optional(),
1270
+ description: string().optional(),
1271
+ minItems: number().optional(),
1272
+ maxItems: number().optional(),
1273
+ items: object({
1274
+ type: literal('string'),
1275
+ enum: array(string())
1276
+ }),
1277
+ default: array(string()).optional()
1278
+ });
1279
+ /**
1280
+ * Schema for multiple-selection enumeration with display titles for each option.
1281
+ */
1282
+ const TitledMultiSelectEnumSchemaSchema = object({
1283
+ type: literal('array'),
1284
+ title: string().optional(),
1285
+ description: string().optional(),
1286
+ minItems: number().optional(),
1287
+ maxItems: number().optional(),
1288
+ items: object({
1289
+ anyOf: array(object({
1290
+ const: string(),
1291
+ title: string()
1292
+ }))
1293
+ }),
1294
+ default: array(string()).optional()
1295
+ });
1296
+ /**
1297
+ * Combined schema for multiple-selection enumeration
1298
+ */
1299
+ const MultiSelectEnumSchemaSchema = union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
1300
+ /**
1301
+ * Primitive schema definition for enum fields.
1302
+ */
1303
+ const EnumSchemaSchema = union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
1304
+ /**
1305
+ * Union of all primitive schema definitions.
1306
+ */
1307
+ const PrimitiveSchemaDefinitionSchema = union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
1308
+ /**
1309
+ * Parameters for an `elicitation/create` request for form-based elicitation.
1310
+ */
1311
+ const ElicitRequestFormParamsSchema = BaseRequestParamsSchema.extend({
1312
+ /**
1313
+ * The elicitation mode.
1314
+ *
1315
+ * Optional for backward compatibility. Clients MUST treat missing mode as "form".
1316
+ */
1317
+ mode: literal('form').optional(),
1318
+ /**
1319
+ * The message to present to the user describing what information is being requested.
1320
+ */
1321
+ message: string(),
1322
+ /**
1323
+ * A restricted subset of JSON Schema.
1324
+ * Only top-level properties are allowed, without nesting.
1325
+ */
1326
+ requestedSchema: object({
1327
+ type: literal('object'),
1328
+ properties: record(string(), PrimitiveSchemaDefinitionSchema),
1329
+ required: array(string()).optional()
1330
+ })
1331
+ });
1332
+ /**
1333
+ * Parameters for an `elicitation/create` request for URL-based elicitation.
1334
+ */
1335
+ const ElicitRequestURLParamsSchema = BaseRequestParamsSchema.extend({
1336
+ /**
1337
+ * The elicitation mode.
1338
+ */
1339
+ mode: literal('url'),
1340
+ /**
1341
+ * The message to present to the user explaining why the interaction is needed.
1342
+ */
1343
+ message: string(),
1344
+ /**
1345
+ * The ID of the elicitation, which must be unique within the context of the server.
1346
+ * The client MUST treat this ID as an opaque value.
1347
+ */
1348
+ elicitationId: string(),
1349
+ /**
1350
+ * The URL that the user should navigate to.
1351
+ */
1352
+ url: string().url()
1353
+ });
1354
+ /**
1355
+ * The parameters for a request to elicit additional information from the user via the client.
1356
+ */
1357
+ const ElicitRequestParamsSchema = union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
1358
+ /**
1359
+ * A request from the server to elicit user input via the client.
1360
+ * The client should present the message and form fields to the user (form mode)
1361
+ * or navigate to a URL (URL mode).
1362
+ */
1363
+ const ElicitRequestSchema = RequestSchema.extend({
1364
+ method: literal('elicitation/create'),
1365
+ params: ElicitRequestParamsSchema
1366
+ });
1367
+ /**
1368
+ * Parameters for a `notifications/elicitation/complete` notification.
1369
+ *
1370
+ * @category notifications/elicitation/complete
1371
+ */
1372
+ const ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
1373
+ /**
1374
+ * The ID of the elicitation that completed.
1375
+ */
1376
+ elicitationId: string()
1377
+ });
1378
+ /**
1379
+ * A notification from the server to the client, informing it of a completion of an out-of-band elicitation request.
1380
+ *
1381
+ * @category notifications/elicitation/complete
1382
+ */
1383
+ const ElicitationCompleteNotificationSchema = NotificationSchema.extend({
1384
+ method: literal('notifications/elicitation/complete'),
1385
+ params: ElicitationCompleteNotificationParamsSchema
1386
+ });
1387
+ /**
1388
+ * The client's response to an elicitation/create request from the server.
1389
+ */
1390
+ const ElicitResultSchema = ResultSchema.extend({
1391
+ /**
1392
+ * The user action in response to the elicitation.
1393
+ * - "accept": User submitted the form/confirmed the action
1394
+ * - "decline": User explicitly decline the action
1395
+ * - "cancel": User dismissed without making an explicit choice
1396
+ */
1397
+ action: _enum(['accept', 'decline', 'cancel']),
1398
+ /**
1399
+ * The submitted form data, only present when action is "accept".
1400
+ * Contains values matching the requested schema.
1401
+ */
1402
+ content: record(string(), union([string(), number(), boolean(), array(string())])).optional()
1403
+ });
1404
+ /* Autocomplete */
1405
+ /**
1406
+ * A reference to a resource or resource template definition.
1407
+ */
1408
+ const ResourceTemplateReferenceSchema = object({
1409
+ type: literal('ref/resource'),
1410
+ /**
1411
+ * The URI or URI template of the resource.
1412
+ */
1413
+ uri: string()
1414
+ });
1415
+ /**
1416
+ * Identifies a prompt.
1417
+ */
1418
+ const PromptReferenceSchema = object({
1419
+ type: literal('ref/prompt'),
1420
+ /**
1421
+ * The name of the prompt or prompt template
1422
+ */
1423
+ name: string()
1424
+ });
1425
+ /**
1426
+ * Parameters for a `completion/complete` request.
1427
+ */
1428
+ const CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
1429
+ ref: union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
1430
+ /**
1431
+ * The argument's information
1432
+ */
1433
+ argument: object({
1434
+ /**
1435
+ * The name of the argument
1436
+ */
1437
+ name: string(),
1438
+ /**
1439
+ * The value of the argument to use for completion matching.
1440
+ */
1441
+ value: string()
1442
+ }),
1443
+ context: object({
1444
+ /**
1445
+ * Previously-resolved variables in a URI template or prompt.
1446
+ */
1447
+ arguments: record(string(), string()).optional()
1448
+ })
1449
+ .optional()
1450
+ });
1451
+ /**
1452
+ * A request from the client to the server, to ask for completion options.
1453
+ */
1454
+ const CompleteRequestSchema = RequestSchema.extend({
1455
+ method: literal('completion/complete'),
1456
+ params: CompleteRequestParamsSchema
1457
+ });
1458
+ function assertCompleteRequestPrompt(request) {
1459
+ if (request.params.ref.type !== 'ref/prompt') {
1460
+ throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`);
1461
+ }
1462
+ }
1463
+ function assertCompleteRequestResourceTemplate(request) {
1464
+ if (request.params.ref.type !== 'ref/resource') {
1465
+ throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${request.params.ref.type}`);
1466
+ }
1467
+ }
1468
+ /**
1469
+ * The server's response to a completion/complete request
1470
+ */
1471
+ const CompleteResultSchema = ResultSchema.extend({
1472
+ completion: looseObject({
1473
+ /**
1474
+ * An array of completion values. Must not exceed 100 items.
1475
+ */
1476
+ values: array(string()).max(100),
1477
+ /**
1478
+ * The total number of completion options available. This can exceed the number of values actually sent in the response.
1479
+ */
1480
+ total: optional(number().int()),
1481
+ /**
1482
+ * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
1483
+ */
1484
+ hasMore: optional(boolean())
1485
+ })
1486
+ });
1487
+ /* Roots */
1488
+ /**
1489
+ * Represents a root directory or file that the server can operate on.
1490
+ */
1491
+ const RootSchema = object({
1492
+ /**
1493
+ * The URI identifying the root. This *must* start with file:// for now.
1494
+ */
1495
+ uri: string().startsWith('file://'),
1496
+ /**
1497
+ * An optional name for the root.
1498
+ */
1499
+ name: string().optional(),
1500
+ /**
1501
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
1502
+ * for notes on _meta usage.
1503
+ */
1504
+ _meta: record(string(), unknown()).optional()
1505
+ });
1506
+ /**
1507
+ * Sent from the server to request a list of root URIs from the client.
1508
+ */
1509
+ const ListRootsRequestSchema = RequestSchema.extend({
1510
+ method: literal('roots/list')
1511
+ });
1512
+ /**
1513
+ * The client's response to a roots/list request from the server.
1514
+ */
1515
+ const ListRootsResultSchema = ResultSchema.extend({
1516
+ roots: array(RootSchema)
1517
+ });
1518
+ /**
1519
+ * A notification from the client to the server, informing it that the list of roots has changed.
1520
+ */
1521
+ const RootsListChangedNotificationSchema = NotificationSchema.extend({
1522
+ method: literal('notifications/roots/list_changed')
1523
+ });
1524
+ /* Client messages */
1525
+ union([
1526
+ PingRequestSchema,
1527
+ InitializeRequestSchema,
1528
+ CompleteRequestSchema,
1529
+ SetLevelRequestSchema,
1530
+ GetPromptRequestSchema,
1531
+ ListPromptsRequestSchema,
1532
+ ListResourcesRequestSchema,
1533
+ ListResourceTemplatesRequestSchema,
1534
+ ReadResourceRequestSchema,
1535
+ SubscribeRequestSchema,
1536
+ UnsubscribeRequestSchema,
1537
+ CallToolRequestSchema,
1538
+ ListToolsRequestSchema
1539
+ ]);
1540
+ union([
1541
+ CancelledNotificationSchema,
1542
+ ProgressNotificationSchema,
1543
+ InitializedNotificationSchema,
1544
+ RootsListChangedNotificationSchema
1545
+ ]);
1546
+ union([EmptyResultSchema, CreateMessageResultSchema, ElicitResultSchema, ListRootsResultSchema]);
1547
+ /* Server messages */
1548
+ union([PingRequestSchema, CreateMessageRequestSchema, ElicitRequestSchema, ListRootsRequestSchema]);
1549
+ union([
1550
+ CancelledNotificationSchema,
1551
+ ProgressNotificationSchema,
1552
+ LoggingMessageNotificationSchema,
1553
+ ResourceUpdatedNotificationSchema,
1554
+ ResourceListChangedNotificationSchema,
1555
+ ToolListChangedNotificationSchema,
1556
+ PromptListChangedNotificationSchema,
1557
+ ElicitationCompleteNotificationSchema
1558
+ ]);
1559
+ union([
1560
+ EmptyResultSchema,
1561
+ InitializeResultSchema,
1562
+ CompleteResultSchema,
1563
+ GetPromptResultSchema,
1564
+ ListPromptsResultSchema,
1565
+ ListResourcesResultSchema,
1566
+ ListResourceTemplatesResultSchema,
1567
+ ReadResourceResultSchema,
1568
+ CallToolResultSchema,
1569
+ ListToolsResultSchema
1570
+ ]);
1571
+ class McpError extends Error {
1572
+ constructor(code, message, data) {
1573
+ super(`MCP error ${code}: ${message}`);
1574
+ this.code = code;
1575
+ this.data = data;
1576
+ this.name = 'McpError';
1577
+ }
1578
+ /**
1579
+ * Factory method to create the appropriate error type based on the error code and data
1580
+ */
1581
+ static fromError(code, message, data) {
1582
+ // Check for specific error types
1583
+ if (code === ErrorCode.UrlElicitationRequired && data) {
1584
+ const errorData = data;
1585
+ if (errorData.elicitations) {
1586
+ return new UrlElicitationRequiredError(errorData.elicitations, message);
1587
+ }
1588
+ }
1589
+ // Default to generic McpError
1590
+ return new McpError(code, message, data);
1591
+ }
1592
+ }
1593
+ /**
1594
+ * Specialized error type when a tool requires a URL mode elicitation.
1595
+ * This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against.
1596
+ */
1597
+ class UrlElicitationRequiredError extends McpError {
1598
+ constructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? 's' : ''} required`) {
1599
+ super(ErrorCode.UrlElicitationRequired, message, {
1600
+ elicitations: elicitations
1601
+ });
1602
+ }
1603
+ get elicitations() {
1604
+ var _a, _b;
1605
+ return (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.elicitations) !== null && _b !== void 0 ? _b : [];
1606
+ }
1607
+ }
1608
+
1609
+ export { AudioContentSchema, BaseMetadataSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CallToolRequestParamsSchema, CallToolRequestSchema, CallToolResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CursorSchema, ElicitRequestFormParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitRequestURLParamsSchema, ElicitResultSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, ErrorCode, GetPromptRequestParamsSchema, GetPromptRequestSchema, GetPromptResultSchema, IconSchema, IconsSchema, ImageContentSchema, ImplementationSchema, InitializeRequestParamsSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONRPCErrorSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResponseSchema, JSONRPC_VERSION, LATEST_PROTOCOL_VERSION, LegacyTitledEnumSchemaSchema, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, McpError, ModelHintSchema, ModelPreferencesSchema, MultiSelectEnumSchemaSchema, NotificationSchema, NumberSchemaSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RequestIdSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceRequestParamsSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, ResultSchema, RootSchema, RootsListChangedNotificationSchema, SUPPORTED_PROTOCOL_VERSIONS, SamplingMessageContentBlockSchema, SamplingMessageSchema, ServerCapabilitiesSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, SingleSelectEnumSchemaSchema, StringSchemaSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, TextContentSchema, TextResourceContentsSchema, TitledMultiSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, ToolAnnotationsSchema, ToolChoiceSchema, ToolListChangedNotificationSchema, ToolResultContentSchema, ToolSchema, ToolUseContentSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, UntitledMultiSelectEnumSchemaSchema, UntitledSingleSelectEnumSchemaSchema, UrlElicitationRequiredError, assertCompleteRequestPrompt, assertCompleteRequestResourceTemplate, isJSONRPCError, isJSONRPCNotification, isJSONRPCRequest, isJSONRPCResponse };
1610
+ //# sourceMappingURL=types.js.map