@amplitude/ai 0.1.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 (510) hide show
  1. package/.cursor/skills/instrument-with-amplitude-ai/SKILL.md +50 -0
  2. package/AGENTS.md +79 -0
  3. package/LICENSE +21 -0
  4. package/README.md +2111 -0
  5. package/bin/amplitude-ai-completions.mjs +19 -0
  6. package/bin/amplitude-ai-doctor.mjs +26 -0
  7. package/bin/amplitude-ai-init.mjs +27 -0
  8. package/bin/amplitude-ai-instrument.mjs +52 -0
  9. package/bin/amplitude-ai-mcp.mjs +8 -0
  10. package/bin/amplitude-ai-register-catalog.mjs +156 -0
  11. package/bin/amplitude-ai-status.mjs +28 -0
  12. package/bin/amplitude-ai.mjs +43 -0
  13. package/bin/validate-catalog-constants.mjs +134 -0
  14. package/data/agent_event_catalog.json +1277 -0
  15. package/dist/_virtual/rolldown_runtime.js +31 -0
  16. package/dist/bound-agent.d.ts +56 -0
  17. package/dist/bound-agent.d.ts.map +1 -0
  18. package/dist/bound-agent.js +155 -0
  19. package/dist/bound-agent.js.map +1 -0
  20. package/dist/cli/doctor.d.ts +17 -0
  21. package/dist/cli/doctor.d.ts.map +1 -0
  22. package/dist/cli/doctor.js +89 -0
  23. package/dist/cli/doctor.js.map +1 -0
  24. package/dist/cli/init.d.ts +14 -0
  25. package/dist/cli/init.d.ts.map +1 -0
  26. package/dist/cli/init.js +40 -0
  27. package/dist/cli/init.js.map +1 -0
  28. package/dist/cli/providers.d.ts +32 -0
  29. package/dist/cli/providers.d.ts.map +1 -0
  30. package/dist/cli/providers.js +46 -0
  31. package/dist/cli/providers.js.map +1 -0
  32. package/dist/cli/status.d.ts +14 -0
  33. package/dist/cli/status.d.ts.map +1 -0
  34. package/dist/cli/status.js +38 -0
  35. package/dist/cli/status.js.map +1 -0
  36. package/dist/client.d.ts +246 -0
  37. package/dist/client.d.ts.map +1 -0
  38. package/dist/client.js +369 -0
  39. package/dist/client.js.map +1 -0
  40. package/dist/config.d.ts +60 -0
  41. package/dist/config.d.ts.map +1 -0
  42. package/dist/config.js +57 -0
  43. package/dist/config.js.map +1 -0
  44. package/dist/context.d.ts +44 -0
  45. package/dist/context.d.ts.map +1 -0
  46. package/dist/context.js +53 -0
  47. package/dist/context.js.map +1 -0
  48. package/dist/core/constants.d.ts +96 -0
  49. package/dist/core/constants.d.ts.map +1 -0
  50. package/dist/core/constants.js +105 -0
  51. package/dist/core/constants.js.map +1 -0
  52. package/dist/core/enrichments.d.ts +139 -0
  53. package/dist/core/enrichments.d.ts.map +1 -0
  54. package/dist/core/enrichments.js +177 -0
  55. package/dist/core/enrichments.js.map +1 -0
  56. package/dist/core/privacy.d.ts +53 -0
  57. package/dist/core/privacy.d.ts.map +1 -0
  58. package/dist/core/privacy.js +235 -0
  59. package/dist/core/privacy.js.map +1 -0
  60. package/dist/core/tracking.d.ts +242 -0
  61. package/dist/core/tracking.d.ts.map +1 -0
  62. package/dist/core/tracking.js +469 -0
  63. package/dist/core/tracking.js.map +1 -0
  64. package/dist/decorators.d.ts +109 -0
  65. package/dist/decorators.d.ts.map +1 -0
  66. package/dist/decorators.js +281 -0
  67. package/dist/decorators.js.map +1 -0
  68. package/dist/exceptions.d.ts +19 -0
  69. package/dist/exceptions.d.ts.map +1 -0
  70. package/dist/exceptions.js +35 -0
  71. package/dist/exceptions.js.map +1 -0
  72. package/dist/index.d.ts +37 -0
  73. package/dist/index.js +38 -0
  74. package/dist/integrations/anthropic-tools.d.ts +38 -0
  75. package/dist/integrations/anthropic-tools.d.ts.map +1 -0
  76. package/dist/integrations/anthropic-tools.js +175 -0
  77. package/dist/integrations/anthropic-tools.js.map +1 -0
  78. package/dist/integrations/crewai.d.ts +14 -0
  79. package/dist/integrations/crewai.d.ts.map +1 -0
  80. package/dist/integrations/crewai.js +19 -0
  81. package/dist/integrations/crewai.js.map +1 -0
  82. package/dist/integrations/langchain.d.ts +37 -0
  83. package/dist/integrations/langchain.d.ts.map +1 -0
  84. package/dist/integrations/langchain.js +189 -0
  85. package/dist/integrations/langchain.js.map +1 -0
  86. package/dist/integrations/llamaindex.d.ts +44 -0
  87. package/dist/integrations/llamaindex.d.ts.map +1 -0
  88. package/dist/integrations/llamaindex.js +144 -0
  89. package/dist/integrations/llamaindex.js.map +1 -0
  90. package/dist/integrations/openai-agents.d.ts +35 -0
  91. package/dist/integrations/openai-agents.d.ts.map +1 -0
  92. package/dist/integrations/openai-agents.js +248 -0
  93. package/dist/integrations/openai-agents.js.map +1 -0
  94. package/dist/integrations/opentelemetry.d.ts +40 -0
  95. package/dist/integrations/opentelemetry.d.ts.map +1 -0
  96. package/dist/integrations/opentelemetry.js +146 -0
  97. package/dist/integrations/opentelemetry.js.map +1 -0
  98. package/dist/internals.d.ts +5 -0
  99. package/dist/internals.js +5 -0
  100. package/dist/mcp/contract.d.ts +27 -0
  101. package/dist/mcp/contract.d.ts.map +1 -0
  102. package/dist/mcp/contract.js +25 -0
  103. package/dist/mcp/contract.js.map +1 -0
  104. package/dist/mcp/index.d.ts +4 -0
  105. package/dist/mcp/index.js +5 -0
  106. package/dist/mcp/patterns.d.ts +11 -0
  107. package/dist/mcp/patterns.d.ts.map +1 -0
  108. package/dist/mcp/patterns.js +38 -0
  109. package/dist/mcp/patterns.js.map +1 -0
  110. package/dist/mcp/server.d.ts +10 -0
  111. package/dist/mcp/server.d.ts.map +1 -0
  112. package/dist/mcp/server.js +241 -0
  113. package/dist/mcp/server.js.map +1 -0
  114. package/dist/mcp/validate-file.d.ts +20 -0
  115. package/dist/mcp/validate-file.d.ts.map +1 -0
  116. package/dist/mcp/validate-file.js +122 -0
  117. package/dist/mcp/validate-file.js.map +1 -0
  118. package/dist/middleware.d.ts +32 -0
  119. package/dist/middleware.d.ts.map +1 -0
  120. package/dist/middleware.js +67 -0
  121. package/dist/middleware.js.map +1 -0
  122. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js +54 -0
  123. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js.map +1 -0
  124. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js +20 -0
  125. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js.map +1 -0
  126. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js +34 -0
  127. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js.map +1 -0
  128. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js +225 -0
  129. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js.map +1 -0
  130. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +22 -0
  131. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +1 -0
  132. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +351 -0
  133. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -0
  134. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +634 -0
  135. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +1 -0
  136. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js +60 -0
  137. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js.map +1 -0
  138. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +122 -0
  139. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -0
  140. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +37 -0
  141. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +1 -0
  142. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +858 -0
  143. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -0
  144. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js +32 -0
  145. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js.map +1 -0
  146. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js +74 -0
  147. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js.map +1 -0
  148. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1262 -0
  149. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -0
  150. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +83 -0
  151. package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +1 -0
  152. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js +195 -0
  153. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/formats.js.map +1 -0
  154. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js +44 -0
  155. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/index.js.map +1 -0
  156. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js +88 -0
  157. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.18.0/node_modules/ajv-formats/dist/limit.js.map +1 -0
  158. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js +107 -0
  159. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/ajv.js.map +1 -0
  160. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js +142 -0
  161. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
  162. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js +678 -0
  163. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
  164. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js +145 -0
  165. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
  166. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js +106 -0
  167. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/errors.js.map +1 -0
  168. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js +227 -0
  169. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/index.js.map +1 -0
  170. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js +33 -0
  171. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/names.js.map +1 -0
  172. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js +22 -0
  173. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
  174. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js +137 -0
  175. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/resolve.js.map +1 -0
  176. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js +65 -0
  177. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/rules.js.map +1 -0
  178. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js +150 -0
  179. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/util.js.map +1 -0
  180. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js +27 -0
  181. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
  182. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js +52 -0
  183. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
  184. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js +176 -0
  185. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
  186. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
  187. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
  188. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js +437 -0
  189. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
  190. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js +117 -0
  191. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
  192. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js +76 -0
  193. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
  194. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js +587 -0
  195. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/core.js.map +1 -0
  196. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.js +22 -0
  197. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/data.js.map +1 -0
  198. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.js +145 -0
  199. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/refs/json-schema-draft-07.js.map +1 -0
  200. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js +16 -0
  201. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/equal.js.map +1 -0
  202. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js +29 -0
  203. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
  204. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js +16 -0
  205. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/uri.js.map +1 -0
  206. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js +20 -0
  207. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
  208. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +61 -0
  209. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
  210. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +101 -0
  211. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
  212. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +34 -0
  213. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
  214. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +21 -0
  215. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
  216. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +94 -0
  217. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
  218. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +91 -0
  219. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
  220. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
  221. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
  222. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js +64 -0
  223. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
  224. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js +63 -0
  225. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
  226. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +39 -0
  227. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
  228. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js +36 -0
  229. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
  230. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +56 -0
  231. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
  232. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +66 -0
  233. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
  234. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +22 -0
  235. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
  236. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +57 -0
  237. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
  238. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +46 -0
  239. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
  240. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +22 -0
  241. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
  242. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js +134 -0
  243. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
  244. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js +19 -0
  245. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
  246. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js +27 -0
  247. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
  248. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js +116 -0
  249. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
  250. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +106 -0
  251. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
  252. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +18 -0
  253. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
  254. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js +31 -0
  255. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
  256. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js +97 -0
  257. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
  258. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js +15 -0
  259. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
  260. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js +27 -0
  261. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
  262. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js +32 -0
  263. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
  264. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js +54 -0
  265. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
  266. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js +53 -0
  267. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
  268. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +33 -0
  269. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
  270. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +38 -0
  271. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
  272. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +52 -0
  273. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
  274. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +33 -0
  275. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
  276. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +32 -0
  277. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
  278. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +43 -0
  279. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
  280. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js +77 -0
  281. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
  282. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +75 -0
  283. package/dist/node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
  284. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +37 -0
  285. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js.map +1 -0
  286. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js +240 -0
  287. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js.map +1 -0
  288. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js +194 -0
  289. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js.map +1 -0
  290. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js +286 -0
  291. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js.map +1 -0
  292. package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +82 -0
  293. package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js.map +1 -0
  294. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js +37 -0
  295. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -0
  296. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js +30 -0
  297. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +1 -0
  298. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +16 -0
  299. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +1 -0
  300. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +10 -0
  301. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +1 -0
  302. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js +57 -0
  303. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +1 -0
  304. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +17 -0
  305. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +1 -0
  306. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +23 -0
  307. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +1 -0
  308. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +36 -0
  309. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +1 -0
  310. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +8 -0
  311. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +1 -0
  312. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +10 -0
  313. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +1 -0
  314. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +10 -0
  315. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +1 -0
  316. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +39 -0
  317. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +1 -0
  318. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +13 -0
  319. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +1 -0
  320. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +11 -0
  321. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +1 -0
  322. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +11 -0
  323. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +1 -0
  324. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +47 -0
  325. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +1 -0
  326. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +17 -0
  327. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +1 -0
  328. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +38 -0
  329. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +1 -0
  330. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +16 -0
  331. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +1 -0
  332. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +13 -0
  333. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +1 -0
  334. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +11 -0
  335. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +1 -0
  336. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +46 -0
  337. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +1 -0
  338. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +37 -0
  339. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +1 -0
  340. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +64 -0
  341. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +1 -0
  342. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +20 -0
  343. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +1 -0
  344. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +27 -0
  345. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +1 -0
  346. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +10 -0
  347. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +1 -0
  348. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +10 -0
  349. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +1 -0
  350. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +56 -0
  351. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +1 -0
  352. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +21 -0
  353. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +1 -0
  354. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +250 -0
  355. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
  356. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +38 -0
  357. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +1 -0
  358. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +10 -0
  359. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +1 -0
  360. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +64 -0
  361. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +1 -0
  362. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +10 -0
  363. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +1 -0
  364. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js +78 -0
  365. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +1 -0
  366. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +70 -0
  367. package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +1 -0
  368. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +104 -0
  369. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js.map +1 -0
  370. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +11 -0
  371. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js.map +1 -0
  372. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +10 -0
  373. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
  374. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +110 -0
  375. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
  376. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +99 -0
  377. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js.map +1 -0
  378. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +84 -0
  379. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js.map +1 -0
  380. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +3160 -0
  381. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js.map +1 -0
  382. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/errors.js +23 -0
  383. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/errors.js.map +1 -0
  384. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/iso.js +38 -0
  385. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/iso.js.map +1 -0
  386. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/parse.js +12 -0
  387. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/parse.js.map +1 -0
  388. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/schemas.js +611 -0
  389. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/schemas.js.map +1 -0
  390. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/api.js +437 -0
  391. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/api.js.map +1 -0
  392. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/checks.js +360 -0
  393. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/checks.js.map +1 -0
  394. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/core.js +50 -0
  395. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/core.js.map +1 -0
  396. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/doc.js +34 -0
  397. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/doc.js.map +1 -0
  398. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/errors.js +71 -0
  399. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/errors.js.map +1 -0
  400. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/parse.js +74 -0
  401. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/parse.js.map +1 -0
  402. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/regexes.js +63 -0
  403. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/regexes.js.map +1 -0
  404. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/registries.js +50 -0
  405. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/registries.js.map +1 -0
  406. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/schemas.js +1098 -0
  407. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/schemas.js.map +1 -0
  408. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/to-json-schema.js +599 -0
  409. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/to-json-schema.js.map +1 -0
  410. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/util.js +267 -0
  411. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/util.js.map +1 -0
  412. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/versions.js +10 -0
  413. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/versions.js.map +1 -0
  414. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/mini/schemas.js +50 -0
  415. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/mini/schemas.js.map +1 -0
  416. package/dist/patching.d.ts +59 -0
  417. package/dist/patching.d.ts.map +1 -0
  418. package/dist/patching.js +891 -0
  419. package/dist/patching.js.map +1 -0
  420. package/dist/propagation.d.ts +8 -0
  421. package/dist/propagation.d.ts.map +1 -0
  422. package/dist/propagation.js +46 -0
  423. package/dist/propagation.js.map +1 -0
  424. package/dist/providers/anthropic.d.ts +44 -0
  425. package/dist/providers/anthropic.d.ts.map +1 -0
  426. package/dist/providers/anthropic.js +287 -0
  427. package/dist/providers/anthropic.js.map +1 -0
  428. package/dist/providers/azure-openai.d.ts +32 -0
  429. package/dist/providers/azure-openai.d.ts.map +1 -0
  430. package/dist/providers/azure-openai.js +39 -0
  431. package/dist/providers/azure-openai.js.map +1 -0
  432. package/dist/providers/base.d.ts +70 -0
  433. package/dist/providers/base.d.ts.map +1 -0
  434. package/dist/providers/base.js +141 -0
  435. package/dist/providers/base.js.map +1 -0
  436. package/dist/providers/bedrock.d.ts +41 -0
  437. package/dist/providers/bedrock.d.ts.map +1 -0
  438. package/dist/providers/bedrock.js +229 -0
  439. package/dist/providers/bedrock.js.map +1 -0
  440. package/dist/providers/gemini.d.ts +34 -0
  441. package/dist/providers/gemini.d.ts.map +1 -0
  442. package/dist/providers/gemini.js +225 -0
  443. package/dist/providers/gemini.js.map +1 -0
  444. package/dist/providers/mistral.d.ts +32 -0
  445. package/dist/providers/mistral.d.ts.map +1 -0
  446. package/dist/providers/mistral.js +218 -0
  447. package/dist/providers/mistral.js.map +1 -0
  448. package/dist/providers/openai.d.ts +61 -0
  449. package/dist/providers/openai.d.ts.map +1 -0
  450. package/dist/providers/openai.js +530 -0
  451. package/dist/providers/openai.js.map +1 -0
  452. package/dist/register.d.ts +1 -0
  453. package/dist/register.js +46 -0
  454. package/dist/register.js.map +1 -0
  455. package/dist/session.d.ts +46 -0
  456. package/dist/session.d.ts.map +1 -0
  457. package/dist/session.js +144 -0
  458. package/dist/session.js.map +1 -0
  459. package/dist/tenant.d.ts +30 -0
  460. package/dist/tenant.d.ts.map +1 -0
  461. package/dist/tenant.js +23 -0
  462. package/dist/tenant.js.map +1 -0
  463. package/dist/testing.d.ts +46 -0
  464. package/dist/testing.d.ts.map +1 -0
  465. package/dist/testing.js +120 -0
  466. package/dist/testing.js.map +1 -0
  467. package/dist/types.d.ts +384 -0
  468. package/dist/types.d.ts.map +1 -0
  469. package/dist/types.js +13 -0
  470. package/dist/types.js.map +1 -0
  471. package/dist/utils/costs.d.ts +27 -0
  472. package/dist/utils/costs.d.ts.map +1 -0
  473. package/dist/utils/costs.js +63 -0
  474. package/dist/utils/costs.js.map +1 -0
  475. package/dist/utils/debug.d.ts +6 -0
  476. package/dist/utils/debug.d.ts.map +1 -0
  477. package/dist/utils/debug.js +73 -0
  478. package/dist/utils/debug.js.map +1 -0
  479. package/dist/utils/logger.d.ts +11 -0
  480. package/dist/utils/logger.d.ts.map +1 -0
  481. package/dist/utils/logger.js +18 -0
  482. package/dist/utils/logger.js.map +1 -0
  483. package/dist/utils/model-tiers.d.ts +8 -0
  484. package/dist/utils/model-tiers.d.ts.map +1 -0
  485. package/dist/utils/model-tiers.js +76 -0
  486. package/dist/utils/model-tiers.js.map +1 -0
  487. package/dist/utils/providers.d.ts +5 -0
  488. package/dist/utils/providers.d.ts.map +1 -0
  489. package/dist/utils/providers.js +20 -0
  490. package/dist/utils/providers.js.map +1 -0
  491. package/dist/utils/resolve-module.d.ts +5 -0
  492. package/dist/utils/resolve-module.d.ts.map +1 -0
  493. package/dist/utils/resolve-module.js +29 -0
  494. package/dist/utils/resolve-module.js.map +1 -0
  495. package/dist/utils/streaming.d.ts +55 -0
  496. package/dist/utils/streaming.d.ts.map +1 -0
  497. package/dist/utils/streaming.js +72 -0
  498. package/dist/utils/streaming.js.map +1 -0
  499. package/dist/utils/tokens.d.ts +16 -0
  500. package/dist/utils/tokens.d.ts.map +1 -0
  501. package/dist/utils/tokens.js +80 -0
  502. package/dist/utils/tokens.js.map +1 -0
  503. package/dist/wrappers.d.ts +37 -0
  504. package/dist/wrappers.d.ts.map +1 -0
  505. package/dist/wrappers.js +61 -0
  506. package/dist/wrappers.js.map +1 -0
  507. package/llms-full.txt +127 -0
  508. package/llms.txt +28 -0
  509. package/mcp.schema.json +18 -0
  510. package/package.json +189 -0
@@ -0,0 +1,858 @@
1
+ import { safeParse } from "../server/zod-compat.js";
2
+ import { CancelTaskRequestSchema, CancelTaskResultSchema, CancelledNotificationSchema, CreateTaskResultSchema, ErrorCode, GetTaskPayloadRequestSchema, GetTaskRequestSchema, GetTaskResultSchema, ListTasksRequestSchema, ListTasksResultSchema, McpError, PingRequestSchema, ProgressNotificationSchema, RELATED_TASK_META_KEY, TaskStatusNotificationSchema, isJSONRPCErrorResponse, isJSONRPCNotification, isJSONRPCRequest, isJSONRPCResultResponse, isTaskAugmentedRequestParams } from "../types.js";
3
+ import { isTerminal } from "../experimental/tasks/interfaces.js";
4
+ import { getMethodLiteral, parseWithCompat } from "../server/zod-json-schema-compat.js";
5
+
6
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
7
+ /**
8
+ * The default request timeout, in miliseconds.
9
+ */
10
+ const DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
11
+ /**
12
+ * Implements MCP protocol framing on top of a pluggable transport, including
13
+ * features like request/response linking, notifications, and progress.
14
+ */
15
+ var Protocol = class {
16
+ constructor(_options) {
17
+ this._options = _options;
18
+ this._requestMessageId = 0;
19
+ this._requestHandlers = /* @__PURE__ */ new Map();
20
+ this._requestHandlerAbortControllers = /* @__PURE__ */ new Map();
21
+ this._notificationHandlers = /* @__PURE__ */ new Map();
22
+ this._responseHandlers = /* @__PURE__ */ new Map();
23
+ this._progressHandlers = /* @__PURE__ */ new Map();
24
+ this._timeoutInfo = /* @__PURE__ */ new Map();
25
+ this._pendingDebouncedNotifications = /* @__PURE__ */ new Set();
26
+ this._taskProgressTokens = /* @__PURE__ */ new Map();
27
+ this._requestResolvers = /* @__PURE__ */ new Map();
28
+ this.setNotificationHandler(CancelledNotificationSchema, (notification) => {
29
+ this._oncancel(notification);
30
+ });
31
+ this.setNotificationHandler(ProgressNotificationSchema, (notification) => {
32
+ this._onprogress(notification);
33
+ });
34
+ this.setRequestHandler(PingRequestSchema, (_request) => ({}));
35
+ this._taskStore = _options?.taskStore;
36
+ this._taskMessageQueue = _options?.taskMessageQueue;
37
+ if (this._taskStore) {
38
+ this.setRequestHandler(GetTaskRequestSchema, async (request, extra) => {
39
+ const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
40
+ if (!task) throw new McpError(ErrorCode.InvalidParams, "Failed to retrieve task: Task not found");
41
+ return { ...task };
42
+ });
43
+ this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
44
+ const handleTaskResult = async () => {
45
+ const taskId = request.params.taskId;
46
+ if (this._taskMessageQueue) {
47
+ let queuedMessage;
48
+ while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
49
+ if (queuedMessage.type === "response" || queuedMessage.type === "error") {
50
+ const message = queuedMessage.message;
51
+ const requestId = message.id;
52
+ const resolver = this._requestResolvers.get(requestId);
53
+ if (resolver) {
54
+ this._requestResolvers.delete(requestId);
55
+ if (queuedMessage.type === "response") resolver(message);
56
+ else {
57
+ const errorMessage = message;
58
+ resolver(new McpError(errorMessage.error.code, errorMessage.error.message, errorMessage.error.data));
59
+ }
60
+ } else {
61
+ const messageType = queuedMessage.type === "response" ? "Response" : "Error";
62
+ this._onerror(/* @__PURE__ */ new Error(`${messageType} handler missing for request ${requestId}`));
63
+ }
64
+ continue;
65
+ }
66
+ await this._transport?.send(queuedMessage.message, { relatedRequestId: extra.requestId });
67
+ }
68
+ }
69
+ const task = await this._taskStore.getTask(taskId, extra.sessionId);
70
+ if (!task) throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
71
+ if (!isTerminal(task.status)) {
72
+ await this._waitForTaskUpdate(taskId, extra.signal);
73
+ return await handleTaskResult();
74
+ }
75
+ if (isTerminal(task.status)) {
76
+ const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
77
+ this._clearTaskQueue(taskId);
78
+ return {
79
+ ...result,
80
+ _meta: {
81
+ ...result._meta,
82
+ [RELATED_TASK_META_KEY]: { taskId }
83
+ }
84
+ };
85
+ }
86
+ return await handleTaskResult();
87
+ };
88
+ return await handleTaskResult();
89
+ });
90
+ this.setRequestHandler(ListTasksRequestSchema, async (request, extra) => {
91
+ try {
92
+ const { tasks, nextCursor } = await this._taskStore.listTasks(request.params?.cursor, extra.sessionId);
93
+ return {
94
+ tasks,
95
+ nextCursor,
96
+ _meta: {}
97
+ };
98
+ } catch (error) {
99
+ throw new McpError(ErrorCode.InvalidParams, `Failed to list tasks: ${error instanceof Error ? error.message : String(error)}`);
100
+ }
101
+ });
102
+ this.setRequestHandler(CancelTaskRequestSchema, async (request, extra) => {
103
+ try {
104
+ const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
105
+ if (!task) throw new McpError(ErrorCode.InvalidParams, `Task not found: ${request.params.taskId}`);
106
+ if (isTerminal(task.status)) throw new McpError(ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`);
107
+ await this._taskStore.updateTaskStatus(request.params.taskId, "cancelled", "Client cancelled task execution.", extra.sessionId);
108
+ this._clearTaskQueue(request.params.taskId);
109
+ const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
110
+ if (!cancelledTask) throw new McpError(ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`);
111
+ return {
112
+ _meta: {},
113
+ ...cancelledTask
114
+ };
115
+ } catch (error) {
116
+ if (error instanceof McpError) throw error;
117
+ throw new McpError(ErrorCode.InvalidRequest, `Failed to cancel task: ${error instanceof Error ? error.message : String(error)}`);
118
+ }
119
+ });
120
+ }
121
+ }
122
+ async _oncancel(notification) {
123
+ if (!notification.params.requestId) return;
124
+ this._requestHandlerAbortControllers.get(notification.params.requestId)?.abort(notification.params.reason);
125
+ }
126
+ _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
127
+ this._timeoutInfo.set(messageId, {
128
+ timeoutId: setTimeout(onTimeout, timeout),
129
+ startTime: Date.now(),
130
+ timeout,
131
+ maxTotalTimeout,
132
+ resetTimeoutOnProgress,
133
+ onTimeout
134
+ });
135
+ }
136
+ _resetTimeout(messageId) {
137
+ const info = this._timeoutInfo.get(messageId);
138
+ if (!info) return false;
139
+ const totalElapsed = Date.now() - info.startTime;
140
+ if (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) {
141
+ this._timeoutInfo.delete(messageId);
142
+ throw McpError.fromError(ErrorCode.RequestTimeout, "Maximum total timeout exceeded", {
143
+ maxTotalTimeout: info.maxTotalTimeout,
144
+ totalElapsed
145
+ });
146
+ }
147
+ clearTimeout(info.timeoutId);
148
+ info.timeoutId = setTimeout(info.onTimeout, info.timeout);
149
+ return true;
150
+ }
151
+ _cleanupTimeout(messageId) {
152
+ const info = this._timeoutInfo.get(messageId);
153
+ if (info) {
154
+ clearTimeout(info.timeoutId);
155
+ this._timeoutInfo.delete(messageId);
156
+ }
157
+ }
158
+ /**
159
+ * Attaches to the given transport, starts it, and starts listening for messages.
160
+ *
161
+ * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.
162
+ */
163
+ async connect(transport) {
164
+ if (this._transport) throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");
165
+ this._transport = transport;
166
+ const _onclose = this.transport?.onclose;
167
+ this._transport.onclose = () => {
168
+ _onclose?.();
169
+ this._onclose();
170
+ };
171
+ const _onerror = this.transport?.onerror;
172
+ this._transport.onerror = (error) => {
173
+ _onerror?.(error);
174
+ this._onerror(error);
175
+ };
176
+ const _onmessage = this._transport?.onmessage;
177
+ this._transport.onmessage = (message, extra) => {
178
+ _onmessage?.(message, extra);
179
+ if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) this._onresponse(message);
180
+ else if (isJSONRPCRequest(message)) this._onrequest(message, extra);
181
+ else if (isJSONRPCNotification(message)) this._onnotification(message);
182
+ else this._onerror(/* @__PURE__ */ new Error(`Unknown message type: ${JSON.stringify(message)}`));
183
+ };
184
+ await this._transport.start();
185
+ }
186
+ _onclose() {
187
+ const responseHandlers = this._responseHandlers;
188
+ this._responseHandlers = /* @__PURE__ */ new Map();
189
+ this._progressHandlers.clear();
190
+ this._taskProgressTokens.clear();
191
+ this._pendingDebouncedNotifications.clear();
192
+ for (const controller of this._requestHandlerAbortControllers.values()) controller.abort();
193
+ this._requestHandlerAbortControllers.clear();
194
+ const error = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed");
195
+ this._transport = void 0;
196
+ this.onclose?.();
197
+ for (const handler of responseHandlers.values()) handler(error);
198
+ }
199
+ _onerror(error) {
200
+ this.onerror?.(error);
201
+ }
202
+ _onnotification(notification) {
203
+ const handler = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler;
204
+ if (handler === void 0) return;
205
+ Promise.resolve().then(() => handler(notification)).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Uncaught error in notification handler: ${error}`)));
206
+ }
207
+ _onrequest(request, extra) {
208
+ const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
209
+ const capturedTransport = this._transport;
210
+ const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
211
+ if (handler === void 0) {
212
+ const errorResponse = {
213
+ jsonrpc: "2.0",
214
+ id: request.id,
215
+ error: {
216
+ code: ErrorCode.MethodNotFound,
217
+ message: "Method not found"
218
+ }
219
+ };
220
+ if (relatedTaskId && this._taskMessageQueue) this._enqueueTaskMessage(relatedTaskId, {
221
+ type: "error",
222
+ message: errorResponse,
223
+ timestamp: Date.now()
224
+ }, capturedTransport?.sessionId).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to enqueue error response: ${error}`)));
225
+ else capturedTransport?.send(errorResponse).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send an error response: ${error}`)));
226
+ return;
227
+ }
228
+ const abortController = new AbortController();
229
+ this._requestHandlerAbortControllers.set(request.id, abortController);
230
+ const taskCreationParams = isTaskAugmentedRequestParams(request.params) ? request.params.task : void 0;
231
+ const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport?.sessionId) : void 0;
232
+ const fullExtra = {
233
+ signal: abortController.signal,
234
+ sessionId: capturedTransport?.sessionId,
235
+ _meta: request.params?._meta,
236
+ sendNotification: async (notification) => {
237
+ if (abortController.signal.aborted) return;
238
+ const notificationOptions = { relatedRequestId: request.id };
239
+ if (relatedTaskId) notificationOptions.relatedTask = { taskId: relatedTaskId };
240
+ await this.notification(notification, notificationOptions);
241
+ },
242
+ sendRequest: async (r, resultSchema, options) => {
243
+ if (abortController.signal.aborted) throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
244
+ const requestOptions = {
245
+ ...options,
246
+ relatedRequestId: request.id
247
+ };
248
+ if (relatedTaskId && !requestOptions.relatedTask) requestOptions.relatedTask = { taskId: relatedTaskId };
249
+ const effectiveTaskId = requestOptions.relatedTask?.taskId ?? relatedTaskId;
250
+ if (effectiveTaskId && taskStore) await taskStore.updateTaskStatus(effectiveTaskId, "input_required");
251
+ return await this.request(r, resultSchema, requestOptions);
252
+ },
253
+ authInfo: extra?.authInfo,
254
+ requestId: request.id,
255
+ requestInfo: extra?.requestInfo,
256
+ taskId: relatedTaskId,
257
+ taskStore,
258
+ taskRequestedTtl: taskCreationParams?.ttl,
259
+ closeSSEStream: extra?.closeSSEStream,
260
+ closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
261
+ };
262
+ Promise.resolve().then(() => {
263
+ if (taskCreationParams) this.assertTaskHandlerCapability(request.method);
264
+ }).then(() => handler(request, fullExtra)).then(async (result) => {
265
+ if (abortController.signal.aborted) return;
266
+ const response = {
267
+ result,
268
+ jsonrpc: "2.0",
269
+ id: request.id
270
+ };
271
+ if (relatedTaskId && this._taskMessageQueue) await this._enqueueTaskMessage(relatedTaskId, {
272
+ type: "response",
273
+ message: response,
274
+ timestamp: Date.now()
275
+ }, capturedTransport?.sessionId);
276
+ else await capturedTransport?.send(response);
277
+ }, async (error) => {
278
+ if (abortController.signal.aborted) return;
279
+ const errorResponse = {
280
+ jsonrpc: "2.0",
281
+ id: request.id,
282
+ error: {
283
+ code: Number.isSafeInteger(error["code"]) ? error["code"] : ErrorCode.InternalError,
284
+ message: error.message ?? "Internal error",
285
+ ...error["data"] !== void 0 && { data: error["data"] }
286
+ }
287
+ };
288
+ if (relatedTaskId && this._taskMessageQueue) await this._enqueueTaskMessage(relatedTaskId, {
289
+ type: "error",
290
+ message: errorResponse,
291
+ timestamp: Date.now()
292
+ }, capturedTransport?.sessionId);
293
+ else await capturedTransport?.send(errorResponse);
294
+ }).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send response: ${error}`))).finally(() => {
295
+ this._requestHandlerAbortControllers.delete(request.id);
296
+ });
297
+ }
298
+ _onprogress(notification) {
299
+ const { progressToken, ...params } = notification.params;
300
+ const messageId = Number(progressToken);
301
+ const handler = this._progressHandlers.get(messageId);
302
+ if (!handler) {
303
+ this._onerror(/* @__PURE__ */ new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`));
304
+ return;
305
+ }
306
+ const responseHandler = this._responseHandlers.get(messageId);
307
+ const timeoutInfo = this._timeoutInfo.get(messageId);
308
+ if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) try {
309
+ this._resetTimeout(messageId);
310
+ } catch (error) {
311
+ this._responseHandlers.delete(messageId);
312
+ this._progressHandlers.delete(messageId);
313
+ this._cleanupTimeout(messageId);
314
+ responseHandler(error);
315
+ return;
316
+ }
317
+ handler(params);
318
+ }
319
+ _onresponse(response) {
320
+ const messageId = Number(response.id);
321
+ const resolver = this._requestResolvers.get(messageId);
322
+ if (resolver) {
323
+ this._requestResolvers.delete(messageId);
324
+ if (isJSONRPCResultResponse(response)) resolver(response);
325
+ else resolver(new McpError(response.error.code, response.error.message, response.error.data));
326
+ return;
327
+ }
328
+ const handler = this._responseHandlers.get(messageId);
329
+ if (handler === void 0) {
330
+ this._onerror(/* @__PURE__ */ new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`));
331
+ return;
332
+ }
333
+ this._responseHandlers.delete(messageId);
334
+ this._cleanupTimeout(messageId);
335
+ let isTaskResponse = false;
336
+ if (isJSONRPCResultResponse(response) && response.result && typeof response.result === "object") {
337
+ const result = response.result;
338
+ if (result.task && typeof result.task === "object") {
339
+ const task = result.task;
340
+ if (typeof task.taskId === "string") {
341
+ isTaskResponse = true;
342
+ this._taskProgressTokens.set(task.taskId, messageId);
343
+ }
344
+ }
345
+ }
346
+ if (!isTaskResponse) this._progressHandlers.delete(messageId);
347
+ if (isJSONRPCResultResponse(response)) handler(response);
348
+ else handler(McpError.fromError(response.error.code, response.error.message, response.error.data));
349
+ }
350
+ get transport() {
351
+ return this._transport;
352
+ }
353
+ /**
354
+ * Closes the connection.
355
+ */
356
+ async close() {
357
+ await this._transport?.close();
358
+ }
359
+ /**
360
+ * Sends a request and returns an AsyncGenerator that yields response messages.
361
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
362
+ *
363
+ * @example
364
+ * ```typescript
365
+ * const stream = protocol.requestStream(request, resultSchema, options);
366
+ * for await (const message of stream) {
367
+ * switch (message.type) {
368
+ * case 'taskCreated':
369
+ * console.log('Task created:', message.task.taskId);
370
+ * break;
371
+ * case 'taskStatus':
372
+ * console.log('Task status:', message.task.status);
373
+ * break;
374
+ * case 'result':
375
+ * console.log('Final result:', message.result);
376
+ * break;
377
+ * case 'error':
378
+ * console.error('Error:', message.error);
379
+ * break;
380
+ * }
381
+ * }
382
+ * ```
383
+ *
384
+ * @experimental Use `client.experimental.tasks.requestStream()` to access this method.
385
+ */
386
+ async *requestStream(request, resultSchema, options) {
387
+ const { task } = options ?? {};
388
+ if (!task) {
389
+ try {
390
+ yield {
391
+ type: "result",
392
+ result: await this.request(request, resultSchema, options)
393
+ };
394
+ } catch (error) {
395
+ yield {
396
+ type: "error",
397
+ error: error instanceof McpError ? error : new McpError(ErrorCode.InternalError, String(error))
398
+ };
399
+ }
400
+ return;
401
+ }
402
+ let taskId;
403
+ try {
404
+ const createResult = await this.request(request, CreateTaskResultSchema, options);
405
+ if (createResult.task) {
406
+ taskId = createResult.task.taskId;
407
+ yield {
408
+ type: "taskCreated",
409
+ task: createResult.task
410
+ };
411
+ } else throw new McpError(ErrorCode.InternalError, "Task creation did not return a task");
412
+ while (true) {
413
+ const task$1 = await this.getTask({ taskId }, options);
414
+ yield {
415
+ type: "taskStatus",
416
+ task: task$1
417
+ };
418
+ if (isTerminal(task$1.status)) {
419
+ if (task$1.status === "completed") yield {
420
+ type: "result",
421
+ result: await this.getTaskResult({ taskId }, resultSchema, options)
422
+ };
423
+ else if (task$1.status === "failed") yield {
424
+ type: "error",
425
+ error: new McpError(ErrorCode.InternalError, `Task ${taskId} failed`)
426
+ };
427
+ else if (task$1.status === "cancelled") yield {
428
+ type: "error",
429
+ error: new McpError(ErrorCode.InternalError, `Task ${taskId} was cancelled`)
430
+ };
431
+ return;
432
+ }
433
+ if (task$1.status === "input_required") {
434
+ yield {
435
+ type: "result",
436
+ result: await this.getTaskResult({ taskId }, resultSchema, options)
437
+ };
438
+ return;
439
+ }
440
+ const pollInterval = task$1.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
441
+ await new Promise((resolve) => setTimeout(resolve, pollInterval));
442
+ options?.signal?.throwIfAborted();
443
+ }
444
+ } catch (error) {
445
+ yield {
446
+ type: "error",
447
+ error: error instanceof McpError ? error : new McpError(ErrorCode.InternalError, String(error))
448
+ };
449
+ }
450
+ }
451
+ /**
452
+ * Sends a request and waits for a response.
453
+ *
454
+ * Do not use this method to emit notifications! Use notification() instead.
455
+ */
456
+ request(request, resultSchema, options) {
457
+ const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
458
+ return new Promise((resolve, reject) => {
459
+ const earlyReject = (error) => {
460
+ reject(error);
461
+ };
462
+ if (!this._transport) {
463
+ earlyReject(/* @__PURE__ */ new Error("Not connected"));
464
+ return;
465
+ }
466
+ if (this._options?.enforceStrictCapabilities === true) try {
467
+ this.assertCapabilityForMethod(request.method);
468
+ if (task) this.assertTaskCapability(request.method);
469
+ } catch (e) {
470
+ earlyReject(e);
471
+ return;
472
+ }
473
+ options?.signal?.throwIfAborted();
474
+ const messageId = this._requestMessageId++;
475
+ const jsonrpcRequest = {
476
+ ...request,
477
+ jsonrpc: "2.0",
478
+ id: messageId
479
+ };
480
+ if (options?.onprogress) {
481
+ this._progressHandlers.set(messageId, options.onprogress);
482
+ jsonrpcRequest.params = {
483
+ ...request.params,
484
+ _meta: {
485
+ ...request.params?._meta || {},
486
+ progressToken: messageId
487
+ }
488
+ };
489
+ }
490
+ if (task) jsonrpcRequest.params = {
491
+ ...jsonrpcRequest.params,
492
+ task
493
+ };
494
+ if (relatedTask) jsonrpcRequest.params = {
495
+ ...jsonrpcRequest.params,
496
+ _meta: {
497
+ ...jsonrpcRequest.params?._meta || {},
498
+ [RELATED_TASK_META_KEY]: relatedTask
499
+ }
500
+ };
501
+ const cancel = (reason) => {
502
+ this._responseHandlers.delete(messageId);
503
+ this._progressHandlers.delete(messageId);
504
+ this._cleanupTimeout(messageId);
505
+ this._transport?.send({
506
+ jsonrpc: "2.0",
507
+ method: "notifications/cancelled",
508
+ params: {
509
+ requestId: messageId,
510
+ reason: String(reason)
511
+ }
512
+ }, {
513
+ relatedRequestId,
514
+ resumptionToken,
515
+ onresumptiontoken
516
+ }).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send cancellation: ${error}`)));
517
+ reject(reason instanceof McpError ? reason : new McpError(ErrorCode.RequestTimeout, String(reason)));
518
+ };
519
+ this._responseHandlers.set(messageId, (response) => {
520
+ if (options?.signal?.aborted) return;
521
+ if (response instanceof Error) return reject(response);
522
+ try {
523
+ const parseResult = safeParse(resultSchema, response.result);
524
+ if (!parseResult.success) reject(parseResult.error);
525
+ else resolve(parseResult.data);
526
+ } catch (error) {
527
+ reject(error);
528
+ }
529
+ });
530
+ options?.signal?.addEventListener("abort", () => {
531
+ cancel(options?.signal?.reason);
532
+ });
533
+ const timeout = options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC;
534
+ const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, "Request timed out", { timeout }));
535
+ this._setupTimeout(messageId, timeout, options?.maxTotalTimeout, timeoutHandler, options?.resetTimeoutOnProgress ?? false);
536
+ const relatedTaskId = relatedTask?.taskId;
537
+ if (relatedTaskId) {
538
+ const responseResolver = (response) => {
539
+ const handler = this._responseHandlers.get(messageId);
540
+ if (handler) handler(response);
541
+ else this._onerror(/* @__PURE__ */ new Error(`Response handler missing for side-channeled request ${messageId}`));
542
+ };
543
+ this._requestResolvers.set(messageId, responseResolver);
544
+ this._enqueueTaskMessage(relatedTaskId, {
545
+ type: "request",
546
+ message: jsonrpcRequest,
547
+ timestamp: Date.now()
548
+ }).catch((error) => {
549
+ this._cleanupTimeout(messageId);
550
+ reject(error);
551
+ });
552
+ } else this._transport.send(jsonrpcRequest, {
553
+ relatedRequestId,
554
+ resumptionToken,
555
+ onresumptiontoken
556
+ }).catch((error) => {
557
+ this._cleanupTimeout(messageId);
558
+ reject(error);
559
+ });
560
+ });
561
+ }
562
+ /**
563
+ * Gets the current status of a task.
564
+ *
565
+ * @experimental Use `client.experimental.tasks.getTask()` to access this method.
566
+ */
567
+ async getTask(params, options) {
568
+ return this.request({
569
+ method: "tasks/get",
570
+ params
571
+ }, GetTaskResultSchema, options);
572
+ }
573
+ /**
574
+ * Retrieves the result of a completed task.
575
+ *
576
+ * @experimental Use `client.experimental.tasks.getTaskResult()` to access this method.
577
+ */
578
+ async getTaskResult(params, resultSchema, options) {
579
+ return this.request({
580
+ method: "tasks/result",
581
+ params
582
+ }, resultSchema, options);
583
+ }
584
+ /**
585
+ * Lists tasks, optionally starting from a pagination cursor.
586
+ *
587
+ * @experimental Use `client.experimental.tasks.listTasks()` to access this method.
588
+ */
589
+ async listTasks(params, options) {
590
+ return this.request({
591
+ method: "tasks/list",
592
+ params
593
+ }, ListTasksResultSchema, options);
594
+ }
595
+ /**
596
+ * Cancels a specific task.
597
+ *
598
+ * @experimental Use `client.experimental.tasks.cancelTask()` to access this method.
599
+ */
600
+ async cancelTask(params, options) {
601
+ return this.request({
602
+ method: "tasks/cancel",
603
+ params
604
+ }, CancelTaskResultSchema, options);
605
+ }
606
+ /**
607
+ * Emits a notification, which is a one-way message that does not expect a response.
608
+ */
609
+ async notification(notification, options) {
610
+ if (!this._transport) throw new Error("Not connected");
611
+ this.assertNotificationCapability(notification.method);
612
+ const relatedTaskId = options?.relatedTask?.taskId;
613
+ if (relatedTaskId) {
614
+ const jsonrpcNotification$1 = {
615
+ ...notification,
616
+ jsonrpc: "2.0",
617
+ params: {
618
+ ...notification.params,
619
+ _meta: {
620
+ ...notification.params?._meta || {},
621
+ [RELATED_TASK_META_KEY]: options.relatedTask
622
+ }
623
+ }
624
+ };
625
+ await this._enqueueTaskMessage(relatedTaskId, {
626
+ type: "notification",
627
+ message: jsonrpcNotification$1,
628
+ timestamp: Date.now()
629
+ });
630
+ return;
631
+ }
632
+ if ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params && !options?.relatedRequestId && !options?.relatedTask) {
633
+ if (this._pendingDebouncedNotifications.has(notification.method)) return;
634
+ this._pendingDebouncedNotifications.add(notification.method);
635
+ Promise.resolve().then(() => {
636
+ this._pendingDebouncedNotifications.delete(notification.method);
637
+ if (!this._transport) return;
638
+ let jsonrpcNotification$1 = {
639
+ ...notification,
640
+ jsonrpc: "2.0"
641
+ };
642
+ if (options?.relatedTask) jsonrpcNotification$1 = {
643
+ ...jsonrpcNotification$1,
644
+ params: {
645
+ ...jsonrpcNotification$1.params,
646
+ _meta: {
647
+ ...jsonrpcNotification$1.params?._meta || {},
648
+ [RELATED_TASK_META_KEY]: options.relatedTask
649
+ }
650
+ }
651
+ };
652
+ this._transport?.send(jsonrpcNotification$1, options).catch((error) => this._onerror(error));
653
+ });
654
+ return;
655
+ }
656
+ let jsonrpcNotification = {
657
+ ...notification,
658
+ jsonrpc: "2.0"
659
+ };
660
+ if (options?.relatedTask) jsonrpcNotification = {
661
+ ...jsonrpcNotification,
662
+ params: {
663
+ ...jsonrpcNotification.params,
664
+ _meta: {
665
+ ...jsonrpcNotification.params?._meta || {},
666
+ [RELATED_TASK_META_KEY]: options.relatedTask
667
+ }
668
+ }
669
+ };
670
+ await this._transport.send(jsonrpcNotification, options);
671
+ }
672
+ /**
673
+ * Registers a handler to invoke when this protocol object receives a request with the given method.
674
+ *
675
+ * Note that this will replace any previous request handler for the same method.
676
+ */
677
+ setRequestHandler(requestSchema, handler) {
678
+ const method = getMethodLiteral(requestSchema);
679
+ this.assertRequestHandlerCapability(method);
680
+ this._requestHandlers.set(method, (request, extra) => {
681
+ const parsed = parseWithCompat(requestSchema, request);
682
+ return Promise.resolve(handler(parsed, extra));
683
+ });
684
+ }
685
+ /**
686
+ * Removes the request handler for the given method.
687
+ */
688
+ removeRequestHandler(method) {
689
+ this._requestHandlers.delete(method);
690
+ }
691
+ /**
692
+ * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
693
+ */
694
+ assertCanSetRequestHandler(method) {
695
+ if (this._requestHandlers.has(method)) throw new Error(`A request handler for ${method} already exists, which would be overridden`);
696
+ }
697
+ /**
698
+ * Registers a handler to invoke when this protocol object receives a notification with the given method.
699
+ *
700
+ * Note that this will replace any previous notification handler for the same method.
701
+ */
702
+ setNotificationHandler(notificationSchema, handler) {
703
+ const method = getMethodLiteral(notificationSchema);
704
+ this._notificationHandlers.set(method, (notification) => {
705
+ const parsed = parseWithCompat(notificationSchema, notification);
706
+ return Promise.resolve(handler(parsed));
707
+ });
708
+ }
709
+ /**
710
+ * Removes the notification handler for the given method.
711
+ */
712
+ removeNotificationHandler(method) {
713
+ this._notificationHandlers.delete(method);
714
+ }
715
+ /**
716
+ * Cleans up the progress handler associated with a task.
717
+ * This should be called when a task reaches a terminal status.
718
+ */
719
+ _cleanupTaskProgressHandler(taskId) {
720
+ const progressToken = this._taskProgressTokens.get(taskId);
721
+ if (progressToken !== void 0) {
722
+ this._progressHandlers.delete(progressToken);
723
+ this._taskProgressTokens.delete(taskId);
724
+ }
725
+ }
726
+ /**
727
+ * Enqueues a task-related message for side-channel delivery via tasks/result.
728
+ * @param taskId The task ID to associate the message with
729
+ * @param message The message to enqueue
730
+ * @param sessionId Optional session ID for binding the operation to a specific session
731
+ * @throws Error if taskStore is not configured or if enqueue fails (e.g., queue overflow)
732
+ *
733
+ * Note: If enqueue fails, it's the TaskMessageQueue implementation's responsibility to handle
734
+ * the error appropriately (e.g., by failing the task, logging, etc.). The Protocol layer
735
+ * simply propagates the error.
736
+ */
737
+ async _enqueueTaskMessage(taskId, message, sessionId) {
738
+ if (!this._taskStore || !this._taskMessageQueue) throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
739
+ const maxQueueSize = this._options?.maxTaskQueueSize;
740
+ await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
741
+ }
742
+ /**
743
+ * Clears the message queue for a task and rejects any pending request resolvers.
744
+ * @param taskId The task ID whose queue should be cleared
745
+ * @param sessionId Optional session ID for binding the operation to a specific session
746
+ */
747
+ async _clearTaskQueue(taskId, sessionId) {
748
+ if (this._taskMessageQueue) {
749
+ const messages = await this._taskMessageQueue.dequeueAll(taskId, sessionId);
750
+ for (const message of messages) if (message.type === "request" && isJSONRPCRequest(message.message)) {
751
+ const requestId = message.message.id;
752
+ const resolver = this._requestResolvers.get(requestId);
753
+ if (resolver) {
754
+ resolver(new McpError(ErrorCode.InternalError, "Task cancelled or completed"));
755
+ this._requestResolvers.delete(requestId);
756
+ } else this._onerror(/* @__PURE__ */ new Error(`Resolver missing for request ${requestId} during task ${taskId} cleanup`));
757
+ }
758
+ }
759
+ }
760
+ /**
761
+ * Waits for a task update (new messages or status change) with abort signal support.
762
+ * Uses polling to check for updates at the task's configured poll interval.
763
+ * @param taskId The task ID to wait for
764
+ * @param signal Abort signal to cancel the wait
765
+ * @returns Promise that resolves when an update occurs or rejects if aborted
766
+ */
767
+ async _waitForTaskUpdate(taskId, signal) {
768
+ let interval = this._options?.defaultTaskPollInterval ?? 1e3;
769
+ try {
770
+ const task = await this._taskStore?.getTask(taskId);
771
+ if (task?.pollInterval) interval = task.pollInterval;
772
+ } catch {}
773
+ return new Promise((resolve, reject) => {
774
+ if (signal.aborted) {
775
+ reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
776
+ return;
777
+ }
778
+ const timeoutId = setTimeout(resolve, interval);
779
+ signal.addEventListener("abort", () => {
780
+ clearTimeout(timeoutId);
781
+ reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
782
+ }, { once: true });
783
+ });
784
+ }
785
+ requestTaskStore(request, sessionId) {
786
+ const taskStore = this._taskStore;
787
+ if (!taskStore) throw new Error("No task store configured");
788
+ return {
789
+ createTask: async (taskParams) => {
790
+ if (!request) throw new Error("No request provided");
791
+ return await taskStore.createTask(taskParams, request.id, {
792
+ method: request.method,
793
+ params: request.params
794
+ }, sessionId);
795
+ },
796
+ getTask: async (taskId) => {
797
+ const task = await taskStore.getTask(taskId, sessionId);
798
+ if (!task) throw new McpError(ErrorCode.InvalidParams, "Failed to retrieve task: Task not found");
799
+ return task;
800
+ },
801
+ storeTaskResult: async (taskId, status, result) => {
802
+ await taskStore.storeTaskResult(taskId, status, result, sessionId);
803
+ const task = await taskStore.getTask(taskId, sessionId);
804
+ if (task) {
805
+ const notification = TaskStatusNotificationSchema.parse({
806
+ method: "notifications/tasks/status",
807
+ params: task
808
+ });
809
+ await this.notification(notification);
810
+ if (isTerminal(task.status)) this._cleanupTaskProgressHandler(taskId);
811
+ }
812
+ },
813
+ getTaskResult: (taskId) => {
814
+ return taskStore.getTaskResult(taskId, sessionId);
815
+ },
816
+ updateTaskStatus: async (taskId, status, statusMessage) => {
817
+ const task = await taskStore.getTask(taskId, sessionId);
818
+ if (!task) throw new McpError(ErrorCode.InvalidParams, `Task "${taskId}" not found - it may have been cleaned up`);
819
+ if (isTerminal(task.status)) throw new McpError(ErrorCode.InvalidParams, `Cannot update task "${taskId}" from terminal status "${task.status}" to "${status}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);
820
+ await taskStore.updateTaskStatus(taskId, status, statusMessage, sessionId);
821
+ const updatedTask = await taskStore.getTask(taskId, sessionId);
822
+ if (updatedTask) {
823
+ const notification = TaskStatusNotificationSchema.parse({
824
+ method: "notifications/tasks/status",
825
+ params: updatedTask
826
+ });
827
+ await this.notification(notification);
828
+ if (isTerminal(updatedTask.status)) this._cleanupTaskProgressHandler(taskId);
829
+ }
830
+ },
831
+ listTasks: (cursor) => {
832
+ return taskStore.listTasks(cursor, sessionId);
833
+ }
834
+ };
835
+ }
836
+ };
837
+ function isPlainObject(value) {
838
+ return value !== null && typeof value === "object" && !Array.isArray(value);
839
+ }
840
+ function mergeCapabilities(base, additional) {
841
+ const result = { ...base };
842
+ for (const key in additional) {
843
+ const k = key;
844
+ const addValue = additional[k];
845
+ if (addValue === void 0) continue;
846
+ const baseValue = result[k];
847
+ if (isPlainObject(baseValue) && isPlainObject(addValue)) result[k] = {
848
+ ...baseValue,
849
+ ...addValue
850
+ };
851
+ else result[k] = addValue;
852
+ }
853
+ return result;
854
+ }
855
+
856
+ //#endregion
857
+ export { Protocol, mergeCapabilities };
858
+ //# sourceMappingURL=protocol.js.map