archgen-skill 0.1.0 → 0.1.2
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.
- package/lib/node_modules/archgen-mcp/README.md +131 -0
- package/lib/node_modules/archgen-mcp/assets/briefs/investigate.md +21 -0
- package/lib/node_modules/archgen-mcp/assets/briefs/review.md +47 -0
- package/lib/node_modules/archgen-mcp/assets/briefs/survey.md +19 -0
- package/lib/node_modules/archgen-mcp/assets/briefs/verifier.md +56 -0
- package/lib/node_modules/archgen-mcp/assets/depth-ladder.json +90 -0
- package/lib/node_modules/archgen-mcp/assets/harness-mcp.json +398 -0
- package/lib/node_modules/archgen-mcp/assets/mcp-template.json +45 -0
- package/lib/node_modules/archgen-mcp/assets/platform-capabilities.json +579 -0
- package/lib/node_modules/archgen-mcp/assets/references/artifact-templates.md +120 -0
- package/lib/node_modules/archgen-mcp/assets/references/interview.md +161 -0
- package/lib/node_modules/archgen-mcp/assets/references/mcp-and-skills.md +62 -0
- package/lib/node_modules/archgen-mcp/assets/references/orchestration.md +149 -0
- package/lib/node_modules/archgen-mcp/assets/references/platforms.md +81 -0
- package/lib/node_modules/archgen-mcp/assets/skill-registry.json +128 -0
- package/lib/node_modules/archgen-mcp/assets/templates/adr.md +8 -0
- package/lib/node_modules/archgen-mcp/assets/templates/architecture.yaml +61 -0
- package/lib/node_modules/archgen-mcp/assets/templates/edge-matrix.md +8 -0
- package/lib/node_modules/archgen-mcp/assets/templates/mermaid.md +40 -0
- package/lib/node_modules/archgen-mcp/assets/templates/prd.md +31 -0
- package/lib/node_modules/archgen-mcp/assets/templates/tasks.yaml +47 -0
- package/lib/node_modules/archgen-mcp/bin/archgen-mcp.mjs +35 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/LICENSE +216 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/README.md +40 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/auth-B7cIpDZF.d.mts +293 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/auth-B7cIpDZF.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/auth-CV4m0LEJ.cjs +294 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/auth-CV4m0LEJ.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/auth-CmOFayUJ.d.cts +293 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/auth-CmOFayUJ.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/auth-UMQCo-ad.mjs +209 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/auth-UMQCo-ad.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/ext/skills/index.cjs +116 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/ext/skills/index.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/ext/skills/index.d.cts +316 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/ext/skills/index.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/ext/skills/index.d.mts +316 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/ext/skills/index.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/ext/skills/index.mjs +94 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/ext/skills/index.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/index.cjs +176 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/index.d.cts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/index.d.mts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/index.mjs +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/internal.cjs +202 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +100 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +100 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/internal.mjs +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/schemas-CzwpZ9-S.d.cts +8219 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/schemas-CzwpZ9-S.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/schemas-DBHuY3cl.d.mts +8219 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/schemas-DBHuY3cl.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/schemas-DscsoNZN.mjs +1476 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/schemas-DscsoNZN.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/schemas-lGLjBX8n.cjs +2619 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/dist/schemas-lGLjBX8n.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/core/package.json +98 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/LICENSE +216 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/README.md +24 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ajvProvider-B7XXxEF7.d.mts +1071 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ajvProvider-B7XXxEF7.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ajvProvider-D4aTKfX2.d.cts +1071 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ajvProvider-D4aTKfX2.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ajvProvider-DPYcD0gV.cjs +8027 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ajvProvider-DPYcD0gV.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ajvProvider-DyjnscPj.mjs +8010 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ajvProvider-DyjnscPj.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-B9jJP0v5.d.cts +74 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-B9jJP0v5.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-Bxo2L8Ch.d.mts +74 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-Bxo2L8Ch.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-QxAbCgU1.cjs +986 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-QxAbCgU1.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-hgYAfIZf.mjs +981 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-hgYAfIZf.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +60 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/chunk-vYduTEsO.mjs +42 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CadSHsnp.d.cts +498 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CadSHsnp.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-DzlXH0KL.d.mts +498 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-DzlXH0KL.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/dialects-CDpMbily.mjs +34 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/dialects-CDpMbily.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs +46 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/index.cjs +70 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/index.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/index.d.cts +42 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/index.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/index.d.mts +42 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/index.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/index.mjs +29 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/index.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/node.cjs +78 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/node.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/node.d.cts +30 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/node.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/node.d.mts +30 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/node.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/node.mjs +75 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/ext/skills/node.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/extension-B1GvIBnG.d.mts +143 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/extension-B1GvIBnG.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/extension-B6_E7IiR.d.cts +143 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/extension-B6_E7IiR.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/extension-Co9uP6Ds.cjs +1576 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/extension-Co9uP6Ds.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/extension-Pm4HwRE6.mjs +1528 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/extension-Pm4HwRE6.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/index.cjs +1766 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/index.d.cts +811 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/index.d.mts +811 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/index.mjs +1578 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/listenRouter-Bartj63y.mjs +426 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/listenRouter-Bartj63y.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/listenRouter-Dcw_aIh6.cjs +457 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/listenRouter-Dcw_aIh6.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/mcp-BCJHyo7l.d.mts +3682 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/mcp-BCJHyo7l.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/mcp-DbUPMDd5.d.cts +3684 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/mcp-DbUPMDd5.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/mcp-oHn3ureC.mjs +2166 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/mcp-oHn3ureC.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/mcp-uPg2RfP3.cjs +2293 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/mcp-uPg2RfP3.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +23 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +11 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +11 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +22 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +12 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +30 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +10 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +10 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +29 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/src-BvE2tDzk.cjs +8223 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/src-BvE2tDzk.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/src-DdvbAHrR.mjs +7713 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/src-DdvbAHrR.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +592 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +116 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +116 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +590 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/types-DDiDRBhz.d.mts +1099 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/types-DDiDRBhz.d.mts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/types-DqbrgVmG.d.cts +1099 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/types-DqbrgVmG.d.cts.map +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +2 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +2 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +2 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +2 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/package.json +186 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/LICENSE +21 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/README.md +218 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/compile.cjs +96 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/compile.d.cts +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/compile.d.ts +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/compile.js +52 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/index.cjs +52 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/index.d.cts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/index.d.ts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/index.js +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/locales/index.cjs +36 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/locales/index.d.cts +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/locales/index.d.ts +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/locales/index.js +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/locales/package.json +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/mini/index.cjs +51 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/mini/index.d.cts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/mini/index.d.ts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/mini/index.js +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/mini/package.json +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/package.json +147 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/compile.ts +56 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/index.ts +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/locales/index.ts +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/mini/index.ts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/ZodError.ts +340 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/errors.ts +13 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/external.ts +6 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/index.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/error.test.ts +586 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/object.test.ts +431 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/string.test.ts +922 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v3/types.ts +5138 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/checks.ts +33 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/compat.ts +78 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/errors.ts +97 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/external.ts +57 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/iso.ts +20 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/parse.ts +88 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/schemas.ts +2937 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/array.test.ts +291 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/assignability.test.ts +402 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/bigint.test.ts +89 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +942 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/enum.test.ts +305 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/error.test.ts +1108 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1467 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +127 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/map.test.ts +349 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/number.test.ts +401 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/object.test.ts +1006 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/prefault.test.ts +144 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +707 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/set.test.ts +196 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +153 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/string.test.ts +1440 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +812 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4733 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/api.ts +1875 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/checks.ts +1266 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/compile.ts +2322 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/core.ts +230 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/doc.ts +52 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/errors.ts +543 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/index.ts +19 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/json-schema.ts +148 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/parse.ts +309 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/regexes.ts +217 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/schemas.ts +5226 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/to-json-schema.ts +857 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/util.ts +1293 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/index.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ar.ts +120 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/az.ts +116 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/be.ts +188 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/bg.ts +133 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ca.ts +121 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/cs.ts +123 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/da.ts +128 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/de.ts +121 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/el.ts +124 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/en.ts +136 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/eo.ts +123 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/es.ts +145 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/fa.ts +131 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/fi.ts +126 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/fr-CA.ts +121 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/fr.ts +139 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/he.ts +253 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/hr.ts +135 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/hu.ts +122 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/hy.ts +175 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/id.ts +120 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/index.ts +63 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/is.ts +124 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/it.ts +121 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ja.ts +119 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ka.ts +128 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/km.ts +124 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ko.ts +126 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/lt.ts +243 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/mk.ts +123 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ms.ts +120 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/no.ts +121 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ota.ts +122 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/pl.ts +123 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ps.ts +131 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/pt.ts +159 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ro.ts +132 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ru.ts +188 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/sl.ts +123 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/sv.ts +124 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ta.ts +123 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/th.ts +124 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/tr.ts +116 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/uk.ts +122 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/ur.ts +124 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/uz.ts +120 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/vi.ts +122 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/yo.ts +129 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/zh-CN.ts +121 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/locales/zh-TW.ts +120 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/checks.ts +33 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/external.ts +52 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/parse.ts +16 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/schemas.ts +2051 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/computed.test.ts +30 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/index.test.ts +1146 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +341 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4/mini/tests/string.test.ts +396 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/ZodError.cjs +167 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/ZodError.js +143 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/errors.cjs +36 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/errors.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/errors.d.ts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/errors.js +9 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/external.cjs +41 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/external.d.cts +6 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/external.d.ts +6 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/external.js +6 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/enumUtil.cjs +21 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/errorUtil.cjs +28 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/parseUtil.cjs +143 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/partialUtil.cjs +21 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/typeAliases.cjs +21 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/util.cjs +156 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/helpers/util.js +133 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/index.cjs +52 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/index.d.cts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/index.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/index.js +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/locales/en.cjs +112 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/locales/en.js +109 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/package.json +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/standard-schema.cjs +21 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/standard-schema.js +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/types.cjs +3798 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/types.d.cts +1034 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/types.d.ts +1034 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v3/types.js +3697 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/checks.cjs +53 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/checks.js +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/coerce.cjs +66 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/coerce.js +17 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/compat.cjs +80 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/compat.d.cts +48 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/compat.d.ts +48 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/compat.js +31 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/errors.cjs +102 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/errors.d.cts +29 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/errors.d.ts +29 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/errors.js +57 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/external.cjs +97 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/external.d.cts +19 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/external.d.ts +19 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/external.js +17 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/from-json-schema.js +881 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/in-out.cjs +82 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/in-out.js +36 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/index.cjs +52 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/index.d.cts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/index.d.ts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/index.js +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/iso.cjs +68 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/iso.d.cts +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/iso.d.ts +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/iso.js +15 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/package.json +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/parse.cjs +63 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/parse.d.cts +44 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/parse.d.ts +44 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/parse.js +16 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/schemas.cjs +1676 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/schemas.d.cts +816 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/schemas.d.ts +816 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/classic/schemas.js +1535 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/api.cjs +1269 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/api.d.cts +335 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/api.d.ts +335 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/api.js +1107 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/checks.cjs +561 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/checks.d.cts +294 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/checks.d.ts +294 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/checks.js +516 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/compile.cjs +1916 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/compile.js +1866 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/core.cjs +167 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/core.d.cts +82 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/core.d.ts +82 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/core.js +141 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/doc.cjs +61 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/doc.d.cts +16 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/doc.d.ts +16 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/doc.js +38 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/errors.cjs +317 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/errors.d.cts +225 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/errors.d.ts +225 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/errors.js +267 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/index.cjs +70 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/index.d.cts +19 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/index.d.ts +19 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/index.js +19 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/json-schema-generator.js +99 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/json-schema-processors.js +843 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/json-schema.cjs +21 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/json-schema.d.cts +89 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/json-schema.d.ts +89 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/json-schema.js +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/memoizer.cjs +360 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/memoizer.js +311 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/package.json +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/parse.cjs +233 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/parse.d.cts +52 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/parse.d.ts +52 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/parse.js +175 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/regexes.cjs +209 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/regexes.d.cts +90 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/regexes.d.ts +90 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/regexes.js +156 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/registries.cjs +75 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/registries.js +51 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/schemas.cjs +2699 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/schemas.d.cts +1275 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/schemas.d.ts +1275 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/schemas.js +2636 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/standard-schema.cjs +21 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/to-json-schema.cjs +681 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/to-json-schema.d.cts +154 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/to-json-schema.d.ts +154 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/to-json-schema.js +651 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/util.cjs +964 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/util.d.cts +280 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/util.d.ts +280 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/util.js +873 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/versions.cjs +27 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/versions.js +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/visit.cjs +214 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/core/visit.js +169 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/index.cjs +51 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/index.d.cts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/index.d.ts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/index.js +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ar.cjs +138 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ar.js +111 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/az.cjs +137 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/az.js +110 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/be.cjs +195 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/be.js +168 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/bg.cjs +152 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/bg.js +125 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/bn.cjs +140 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/bn.js +113 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ca.cjs +139 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ca.js +112 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ckb.cjs +160 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ckb.js +133 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/cs.cjs +143 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/cs.js +116 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/da.cjs +147 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/da.js +120 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/de.cjs +140 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/de.js +113 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/el.cjs +139 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/el.js +112 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/en.cjs +152 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/en.js +125 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/eo.cjs +141 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/eo.js +114 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/es.cjs +163 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/es.js +136 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fa.cjs +146 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fa.js +119 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fi.cjs +144 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fi.js +117 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fr-CA.cjs +139 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fr-CA.js +112 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fr.cjs +156 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/fr.js +129 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/gu.cjs +140 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/gu.js +113 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/he.cjs +248 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/he.js +221 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hi.cjs +138 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hi.js +111 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hr.cjs +153 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hr.js +126 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hu.cjs +140 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hu.js +113 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hy.cjs +185 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/hy.js +158 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/id.cjs +138 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/id.js +111 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/index.cjs +152 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/index.d.cts +63 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/index.d.ts +63 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/index.js +63 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/is.cjs +141 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/is.js +114 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/it.cjs +140 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/it.js +113 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ja.cjs +139 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ja.js +112 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ka.cjs +144 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ka.js +117 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/kh.js +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/km.cjs +142 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/km.js +115 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/kn.cjs +143 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/kn.js +116 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ko.cjs +143 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ko.js +116 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/lt.cjs +234 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/lt.js +207 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/mk.cjs +141 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/mk.js +114 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ms.cjs +139 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ms.js +112 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ne.cjs +138 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ne.js +111 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/nl.cjs +142 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/nl.js +115 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/nn.cjs +140 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/nn.js +113 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/no.cjs +140 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/no.js +113 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ota.cjs +141 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ota.js +114 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/package.json +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/pl.cjs +141 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/pl.js +114 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ps.cjs +146 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ps.js +119 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/pt-BR.js +143 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/pt.cjs +169 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/pt.js +142 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ro.cjs +149 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ro.js +122 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ru.cjs +195 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ru.js +168 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/sk.cjs +143 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/sk.js +116 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/sl.cjs +141 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/sl.js +114 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/sv.cjs +142 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/sv.js +115 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ta.cjs +142 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ta.js +115 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/tg.js +117 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/th.cjs +142 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/th.js +115 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/tk.cjs +134 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/tk.js +107 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/tr.cjs +137 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/tr.js +110 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ua.js +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/uk.cjs +140 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/uk.js +113 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ur.cjs +142 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/ur.js +115 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/uz.cjs +140 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/uz.js +113 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/vi.cjs +140 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/vi.js +113 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/yo.cjs +139 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/yo.js +112 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/zh-CN.cjs +141 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/zh-CN.js +114 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/zh-TW.cjs +139 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/locales/zh-TW.js +112 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/checks.cjs +54 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/checks.js +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/coerce.cjs +71 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/coerce.js +22 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/external.cjs +95 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/external.d.cts +16 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/external.d.ts +16 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/external.js +16 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/in-out.cjs +82 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/in-out.js +36 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/index.cjs +51 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/index.js +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/iso.cjs +83 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/iso.js +34 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/package.json +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/parse.cjs +37 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/parse.js +1 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/schemas.cjs +1147 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/schemas.d.cts +480 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/schemas.d.ts +480 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/mini/schemas.js +1002 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4/package.json +7 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4-mini/index.cjs +51 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4-mini/index.js +3 -0
- package/lib/node_modules/archgen-mcp/node_modules/zod/v4-mini/package.json +7 -0
- package/lib/node_modules/archgen-mcp/package.json +49 -0
- package/lib/node_modules/archgen-mcp/src/cli.mjs +244 -0
- package/lib/node_modules/archgen-mcp/src/context.mjs +198 -0
- package/lib/node_modules/archgen-mcp/src/core/brief-context.mjs +106 -0
- package/lib/node_modules/archgen-mcp/src/core/brief-scope.mjs +218 -0
- package/lib/node_modules/archgen-mcp/src/core/briefs.mjs +168 -0
- package/lib/node_modules/archgen-mcp/src/core/codegraph-manager.mjs +512 -0
- package/lib/node_modules/archgen-mcp/src/core/compat.mjs +187 -0
- package/lib/node_modules/archgen-mcp/src/core/doc-navigator.mjs +620 -0
- package/lib/node_modules/archgen-mcp/src/core/docs.mjs +178 -0
- package/lib/node_modules/archgen-mcp/src/core/errors.mjs +65 -0
- package/lib/node_modules/archgen-mcp/src/core/fs-safety.mjs +247 -0
- package/lib/node_modules/archgen-mcp/src/core/graph.mjs +227 -0
- package/lib/node_modules/archgen-mcp/src/core/guidance.mjs +142 -0
- package/lib/node_modules/archgen-mcp/src/core/harness-wiring.mjs +604 -0
- package/lib/node_modules/archgen-mcp/src/core/impact-analyzer.mjs +89 -0
- package/lib/node_modules/archgen-mcp/src/core/jsonc-config.mjs +706 -0
- package/lib/node_modules/archgen-mcp/src/core/mcp-server-manager.mjs +143 -0
- package/lib/node_modules/archgen-mcp/src/core/plan-coverage.mjs +69 -0
- package/lib/node_modules/archgen-mcp/src/core/plan-grapher.mjs +347 -0
- package/lib/node_modules/archgen-mcp/src/core/platform-caps.mjs +95 -0
- package/lib/node_modules/archgen-mcp/src/core/refs.mjs +184 -0
- package/lib/node_modules/archgen-mcp/src/core/registry-updater.mjs +232 -0
- package/lib/node_modules/archgen-mcp/src/core/resume-snapshot.mjs +120 -0
- package/lib/node_modules/archgen-mcp/src/core/scaffold.mjs +199 -0
- package/lib/node_modules/archgen-mcp/src/core/scope.mjs +99 -0
- package/lib/node_modules/archgen-mcp/src/core/skill-manager.mjs +479 -0
- package/lib/node_modules/archgen-mcp/src/core/skill-roots.mjs +92 -0
- package/lib/node_modules/archgen-mcp/src/core/status-mutator.mjs +121 -0
- package/lib/node_modules/archgen-mcp/src/core/tokens.mjs +78 -0
- package/lib/node_modules/archgen-mcp/src/core/validator.mjs +121 -0
- package/lib/node_modules/archgen-mcp/src/core/verifier.mjs +99 -0
- package/lib/node_modules/archgen-mcp/src/core/wave-resolver.mjs +116 -0
- package/lib/node_modules/archgen-mcp/src/core/worker-contract.mjs +298 -0
- package/lib/node_modules/archgen-mcp/src/core/yaml.mjs +517 -0
- package/lib/node_modules/archgen-mcp/src/envelope.mjs +65 -0
- package/lib/node_modules/archgen-mcp/src/server.mjs +58 -0
- package/lib/node_modules/archgen-mcp/src/tools/_register.mjs +120 -0
- package/lib/node_modules/archgen-mcp/src/tools/codegraph.mjs +53 -0
- package/lib/node_modules/archgen-mcp/src/tools/docs.mjs +113 -0
- package/lib/node_modules/archgen-mcp/src/tools/help.mjs +284 -0
- package/lib/node_modules/archgen-mcp/src/tools/plan.mjs +176 -0
- package/lib/node_modules/archgen-mcp/src/tools/refs.mjs +62 -0
- package/lib/node_modules/archgen-mcp/src/tools/registry.mjs +35 -0
- package/lib/node_modules/archgen-mcp/src/tools/setup.mjs +179 -0
- package/lib/node_modules/archgen-mcp/src/tools/skills.mjs +207 -0
- package/lib/node_modules/archgen-mcp/src/tools/tasks.mjs +206 -0
- package/lib/store.js +31 -11
- package/package.json +1 -1
- package/vendor/skills/archgen/SKILL.md +16 -12
- package/vendor/skills/archgen/archgen.config.json +1 -1
- package/vendor/skills/archgen/references/code-standards.md +24 -8
|
@@ -0,0 +1,3682 @@
|
|
|
1
|
+
import { i as jsonSchemaValidator } from "./types-DDiDRBhz.mjs";
|
|
2
|
+
import { AnnotationsSchema, AudioContentSchema, AuthorizationServerMetadata, BAGGAGE_META_KEY, BaseMetadataSchema, BaseRequestParamsSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CLIENT_CAPABILITIES_META_KEY, CLIENT_INFO_META_KEY, CallToolRequestParamsSchema, CallToolRequestSchema, CallToolResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, ClientNotificationSchema, ClientRequestSchema, ClientResultSchema, ClientTasksCapabilitySchema, CompatibilityCallToolResultSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, CreateTaskResultSchema, CursorSchema, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, DiscoverRequestSchema, DiscoverResultSchema, ElicitRequestFormParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitRequestURLParamsSchema, ElicitResultSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, GetPromptResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, GetTaskRequestSchema, GetTaskResultSchema, INTERNAL_ERROR, INVALID_PARAMS, INVALID_REQUEST, IconSchema, IconsSchema, IdJagTokenExchangeResponse, ImageContentSchema, ImplementationSchema, InitializeRequestParamsSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONArray, JSONArraySchema, JSONObject, JSONObjectSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResponseSchema, JSONRPCResultResponseSchema, JSONRPC_VERSION, JSONValue, JSONValueSchema, LATEST_PROTOCOL_VERSION, LOG_LEVEL_META_KEY, LegacyTitledEnumSchemaSchema, ListChangedOptionsBaseSchema, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListTasksRequestSchema, ListTasksResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, METHOD_NOT_FOUND, ModelHintSchema, ModelPreferencesSchema, MultiSelectEnumSchemaSchema, NotificationSchema, NotificationsParamsSchema, NumberSchemaSchema, OAuthClientInformation, OAuthClientInformationFull, OAuthClientInformationMixed, OAuthClientMetadata, OAuthClientRegistrationError, OAuthErrorResponse, OAuthMetadata, OAuthProtectedResourceMetadata, OAuthTokenRevocationRequest, OAuthTokens, OpenIdProviderDiscoveryMetadata, OpenIdProviderMetadata, PARSE_ERROR, PROTOCOL_VERSION_META_KEY, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, RELATED_TASK_META_KEY, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RelatedTaskMetadataSchema, RequestIdSchema, RequestMetaSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceRequestParamsSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, ResultMetaObjectSchema, ResultSchema, RoleSchema, RootSchema, RootsListChangedNotificationSchema, SERVER_INFO_META_KEY, SUBSCRIPTION_ID_META_KEY, SUPPORTED_PROTOCOL_VERSIONS, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, ServerCapabilitiesSchema, ServerNotificationSchema, ServerRequestSchema, ServerResultSchema, ServerTasksCapabilitySchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, SingleSelectEnumSchemaSchema, StoredOAuthClientInformation, StoredOAuthTokens, StringSchemaSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, SubscriptionFilterSchema, SubscriptionsAcknowledgedNotificationParamsSchema, SubscriptionsAcknowledgedNotificationSchema, SubscriptionsListenRequestParamsSchema, SubscriptionsListenRequestSchema, SubscriptionsListenResultMetaSchema, SubscriptionsListenResultSchema, TRACEPARENT_META_KEY, TRACESTATE_META_KEY, TaskAugmentedRequestParamsSchema, TaskCreationParamsSchema, TaskMetadataSchema, TaskSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, TaskStatusSchema, TextContentSchema, TextResourceContentsSchema, TitledMultiSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, ToolAnnotationsSchema, ToolChoiceSchema, ToolExecutionSchema, ToolListChangedNotificationSchema, ToolResultContentSchema, ToolSchema, ToolUseContentSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, UntitledMultiSelectEnumSchemaSchema, UntitledSingleSelectEnumSchemaSchema } from "@modelcontextprotocol/core/internal";
|
|
3
|
+
import * as z from "zod/v4";
|
|
4
|
+
|
|
5
|
+
//#region ../core-internal/src/auth/errors.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* OAuth error codes as defined by {@link https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 | RFC 6749}
|
|
8
|
+
* and extensions.
|
|
9
|
+
*/
|
|
10
|
+
declare enum OAuthErrorCode {
|
|
11
|
+
/**
|
|
12
|
+
* The request is missing a required parameter, includes an invalid parameter value,
|
|
13
|
+
* includes a parameter more than once, or is otherwise malformed.
|
|
14
|
+
*/
|
|
15
|
+
InvalidRequest = "invalid_request",
|
|
16
|
+
/**
|
|
17
|
+
* Client authentication failed (e.g., unknown client, no client authentication included,
|
|
18
|
+
* or unsupported authentication method).
|
|
19
|
+
*/
|
|
20
|
+
InvalidClient = "invalid_client",
|
|
21
|
+
/**
|
|
22
|
+
* The provided authorization grant or refresh token is invalid, expired, revoked,
|
|
23
|
+
* does not match the redirection URI used in the authorization request, or was issued to another client.
|
|
24
|
+
*/
|
|
25
|
+
InvalidGrant = "invalid_grant",
|
|
26
|
+
/**
|
|
27
|
+
* The authenticated client is not authorized to use this authorization grant type.
|
|
28
|
+
*/
|
|
29
|
+
UnauthorizedClient = "unauthorized_client",
|
|
30
|
+
/**
|
|
31
|
+
* The authorization grant type is not supported by the authorization server.
|
|
32
|
+
*/
|
|
33
|
+
UnsupportedGrantType = "unsupported_grant_type",
|
|
34
|
+
/**
|
|
35
|
+
* The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.
|
|
36
|
+
*/
|
|
37
|
+
InvalidScope = "invalid_scope",
|
|
38
|
+
/**
|
|
39
|
+
* The resource owner or authorization server denied the request.
|
|
40
|
+
*/
|
|
41
|
+
AccessDenied = "access_denied",
|
|
42
|
+
/**
|
|
43
|
+
* The authorization server encountered an unexpected condition that prevented it from fulfilling the request.
|
|
44
|
+
*/
|
|
45
|
+
ServerError = "server_error",
|
|
46
|
+
/**
|
|
47
|
+
* The authorization server is currently unable to handle the request due to temporary overloading or maintenance.
|
|
48
|
+
*/
|
|
49
|
+
TemporarilyUnavailable = "temporarily_unavailable",
|
|
50
|
+
/**
|
|
51
|
+
* The authorization server does not support obtaining an authorization code using this method.
|
|
52
|
+
*/
|
|
53
|
+
UnsupportedResponseType = "unsupported_response_type",
|
|
54
|
+
/**
|
|
55
|
+
* The authorization server does not support the requested token type.
|
|
56
|
+
*/
|
|
57
|
+
UnsupportedTokenType = "unsupported_token_type",
|
|
58
|
+
/**
|
|
59
|
+
* The access token provided is expired, revoked, malformed, or invalid for other reasons.
|
|
60
|
+
*/
|
|
61
|
+
InvalidToken = "invalid_token",
|
|
62
|
+
/**
|
|
63
|
+
* The HTTP method used is not allowed for this endpoint. (Custom, non-standard error)
|
|
64
|
+
*/
|
|
65
|
+
MethodNotAllowed = "method_not_allowed",
|
|
66
|
+
/**
|
|
67
|
+
* Rate limit exceeded. (Custom, non-standard error based on RFC 6585)
|
|
68
|
+
*/
|
|
69
|
+
TooManyRequests = "too_many_requests",
|
|
70
|
+
/**
|
|
71
|
+
* The client metadata is invalid. (Custom error for dynamic client registration - RFC 7591)
|
|
72
|
+
*/
|
|
73
|
+
InvalidClientMetadata = "invalid_client_metadata",
|
|
74
|
+
/**
|
|
75
|
+
* The value of one or more redirection URIs is invalid. (Dynamic client registration - RFC 7591 §3.2.2)
|
|
76
|
+
*/
|
|
77
|
+
InvalidRedirectUri = "invalid_redirect_uri",
|
|
78
|
+
/**
|
|
79
|
+
* The request requires higher privileges than provided by the access token.
|
|
80
|
+
*/
|
|
81
|
+
InsufficientScope = "insufficient_scope",
|
|
82
|
+
/**
|
|
83
|
+
* The requested resource is invalid, missing, unknown, or malformed. (Custom error for resource indicators - RFC 8707)
|
|
84
|
+
*/
|
|
85
|
+
InvalidTarget = "invalid_target",
|
|
86
|
+
/**
|
|
87
|
+
* The DPoP proof accompanying the request is invalid, or does not match the key the grant
|
|
88
|
+
* (e.g. a refresh token) is bound to. (RFC 9449 §5 / §7.1)
|
|
89
|
+
*/
|
|
90
|
+
InvalidDpopProof = "invalid_dpop_proof",
|
|
91
|
+
/**
|
|
92
|
+
* The server requires a server-supplied nonce in the DPoP proof; retry with the `DPoP-Nonce`
|
|
93
|
+
* it returned. (RFC 9449 §8 / §9)
|
|
94
|
+
*/
|
|
95
|
+
UseDpopNonce = "use_dpop_nonce",
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* OAuth error class for all OAuth-related errors.
|
|
99
|
+
*/
|
|
100
|
+
declare class OAuthError extends Error {
|
|
101
|
+
readonly code: OAuthErrorCode | string;
|
|
102
|
+
readonly errorUri?: string | undefined;
|
|
103
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Brand-based type guard: equivalent to `value instanceof this`, as an
|
|
106
|
+
* explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
|
|
107
|
+
* the caller's own brand via `this`, so every branded subclass gets a
|
|
108
|
+
* correctly-scoped guard by inheritance. Must be invoked on the class —
|
|
109
|
+
* in callback position write `v => SdkError.isInstance(v)`, not
|
|
110
|
+
* `.filter(SdkError.isInstance)` (detached calls throw rather than
|
|
111
|
+
* silently matching nothing).
|
|
112
|
+
*/
|
|
113
|
+
static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
|
|
114
|
+
constructor(code: OAuthErrorCode | string, message: string, errorUri?: string | undefined);
|
|
115
|
+
/**
|
|
116
|
+
* Converts the error to a standard OAuth error response object.
|
|
117
|
+
*/
|
|
118
|
+
toResponseObject(): OAuthErrorResponse;
|
|
119
|
+
/**
|
|
120
|
+
* Creates an {@linkcode OAuthError} from an OAuth error response.
|
|
121
|
+
*/
|
|
122
|
+
static fromResponse(response: OAuthErrorResponse): OAuthError;
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region ../core-internal/src/errors/sdkErrors.d.ts
|
|
126
|
+
/**
|
|
127
|
+
* Error codes for SDK errors (local errors that never cross the wire).
|
|
128
|
+
* Unlike {@linkcode ProtocolErrorCode} which uses numeric JSON-RPC codes, `SdkErrorCode` uses
|
|
129
|
+
* descriptive string values for better developer experience.
|
|
130
|
+
*
|
|
131
|
+
* These errors are thrown locally by the SDK and are never serialized as
|
|
132
|
+
* JSON-RPC error responses.
|
|
133
|
+
*/
|
|
134
|
+
declare enum SdkErrorCode {
|
|
135
|
+
/** Transport is not connected */
|
|
136
|
+
NotConnected = "NOT_CONNECTED",
|
|
137
|
+
/** Transport is already connected */
|
|
138
|
+
AlreadyConnected = "ALREADY_CONNECTED",
|
|
139
|
+
/** Protocol is not initialized */
|
|
140
|
+
NotInitialized = "NOT_INITIALIZED",
|
|
141
|
+
/** Required capability is not supported by the remote side */
|
|
142
|
+
CapabilityNotSupported = "CAPABILITY_NOT_SUPPORTED",
|
|
143
|
+
/** Request timed out waiting for response */
|
|
144
|
+
RequestTimeout = "REQUEST_TIMEOUT",
|
|
145
|
+
/** Connection was closed */
|
|
146
|
+
ConnectionClosed = "CONNECTION_CLOSED",
|
|
147
|
+
/** Failed to send message */
|
|
148
|
+
SendFailed = "SEND_FAILED",
|
|
149
|
+
/** Response result failed local schema validation */
|
|
150
|
+
InvalidResult = "INVALID_RESULT",
|
|
151
|
+
/**
|
|
152
|
+
* The response carried a `resultType` discriminator (protocol revision
|
|
153
|
+
* 2026-07-28) naming a result kind this client cannot consume yet, e.g.
|
|
154
|
+
* `input_required`. The kind is carried in `data.resultType`.
|
|
155
|
+
*/
|
|
156
|
+
UnsupportedResultType = "UNSUPPORTED_RESULT_TYPE",
|
|
157
|
+
/**
|
|
158
|
+
* The multi-round-trip auto-fulfilment driver exhausted its round cap
|
|
159
|
+
* (`inputRequired.maxRounds`) without the server returning a complete
|
|
160
|
+
* result. `data.rounds` carries the cap that was hit and
|
|
161
|
+
* `data.lastResult` carries the last `input_required` payload received
|
|
162
|
+
* (`{ inputRequests, requestState? }`), so callers can inspect or resume
|
|
163
|
+
* the flow manually.
|
|
164
|
+
*/
|
|
165
|
+
InputRequiredRoundsExceeded = "INPUT_REQUIRED_ROUNDS_EXCEEDED",
|
|
166
|
+
/**
|
|
167
|
+
* The auto-aggregating no-`cursor` `listTools()` / `listPrompts()` /
|
|
168
|
+
* `listResources()` / `listResourceTemplates()` walk hit the
|
|
169
|
+
* `ClientOptions.listMaxPages` cap without the server's pagination
|
|
170
|
+
* converging. `data.method` carries the list verb and
|
|
171
|
+
* `data.listMaxPages` the cap that was hit; raise the cap or fall back to
|
|
172
|
+
* explicit per-page `{ cursor }` calls.
|
|
173
|
+
*/
|
|
174
|
+
ListPaginationExceeded = "LIST_PAGINATION_EXCEEDED",
|
|
175
|
+
/**
|
|
176
|
+
* The spec method being sent does not exist on the negotiated protocol
|
|
177
|
+
* version's wire era (e.g. `tasks/get` toward a 2026-07-28 peer, or
|
|
178
|
+
* `server/discover` toward a 2025-era peer). Raised locally, before
|
|
179
|
+
* anything reaches the transport. The method and era are carried in
|
|
180
|
+
* `data.method` / `data.era`.
|
|
181
|
+
*/
|
|
182
|
+
MethodNotSupportedByProtocolVersion = "METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",
|
|
183
|
+
/**
|
|
184
|
+
* Protocol-era negotiation at connect time failed without producing either a
|
|
185
|
+
* usable modern (2026-07-28+) era or a definitive legacy fallback signal —
|
|
186
|
+
* e.g. the negotiation mode forbids falling back (`pin`), the probe hit a
|
|
187
|
+
* network failure, or the server answered the probe with a 5xx (a typed
|
|
188
|
+
* connect error, never an era verdict).
|
|
189
|
+
*
|
|
190
|
+
* Negotiation-phase only: this code is never used once an era is
|
|
191
|
+
* established. Auth walls never carry it: a 401/403 rejecting the probe
|
|
192
|
+
* uses {@linkcode ClientHttpAuthentication} / {@linkcode ClientHttpForbidden}
|
|
193
|
+
* instead, so era-recovery flows keyed on this code (e.g. cached-verdict
|
|
194
|
+
* gateways) can never persist a verdict for an unauthorized exchange.
|
|
195
|
+
*/
|
|
196
|
+
EraNegotiationFailed = "ERA_NEGOTIATION_FAILED",
|
|
197
|
+
ClientHttpNotImplemented = "CLIENT_HTTP_NOT_IMPLEMENTED",
|
|
198
|
+
/**
|
|
199
|
+
* HTTP 401 authentication failure: the transport's re-auth retry still got
|
|
200
|
+
* 401 (`Server returned 401 after re-authentication`), or the version
|
|
201
|
+
* negotiation probe was rejected 401 with no `authProvider` configured
|
|
202
|
+
* (`Version negotiation failed: the server requires authorization (HTTP 401)`).
|
|
203
|
+
* Carried on an {@linkcode SdkHttpError} with `status: 401`.
|
|
204
|
+
*/
|
|
205
|
+
ClientHttpAuthentication = "CLIENT_HTTP_AUTHENTICATION",
|
|
206
|
+
/**
|
|
207
|
+
* HTTP 403 denial: the step-up re-authorization retry limit was reached,
|
|
208
|
+
* or the version negotiation probe was rejected 403
|
|
209
|
+
* (`Version negotiation failed: the server denied access (HTTP 403)`).
|
|
210
|
+
* Carried on an {@linkcode SdkHttpError} with `status: 403`.
|
|
211
|
+
*/
|
|
212
|
+
ClientHttpForbidden = "CLIENT_HTTP_FORBIDDEN",
|
|
213
|
+
ClientHttpUnexpectedContent = "CLIENT_HTTP_UNEXPECTED_CONTENT",
|
|
214
|
+
ClientHttpFailedToOpenStream = "CLIENT_HTTP_FAILED_TO_OPEN_STREAM",
|
|
215
|
+
ClientHttpFailedToTerminateSession = "CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* SDK errors are local errors that never cross the wire.
|
|
219
|
+
* They are distinct from {@linkcode ProtocolError} which represents JSON-RPC protocol errors
|
|
220
|
+
* that are serialized and sent as error responses.
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* ```ts source="./sdkErrors.examples.ts#SdkError_basicUsage"
|
|
224
|
+
* try {
|
|
225
|
+
* // Throwing an SDK error
|
|
226
|
+
* throw new SdkError(SdkErrorCode.NotConnected, 'Transport is not connected');
|
|
227
|
+
* } catch (error) {
|
|
228
|
+
* // Checking error type by code
|
|
229
|
+
* if (error instanceof SdkError && error.code === SdkErrorCode.RequestTimeout) {
|
|
230
|
+
* // Handle timeout
|
|
231
|
+
* }
|
|
232
|
+
* }
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
declare class SdkError extends Error {
|
|
236
|
+
readonly code: SdkErrorCode;
|
|
237
|
+
readonly data?: unknown | undefined;
|
|
238
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Brand-based type guard: equivalent to `value instanceof this`, as an
|
|
241
|
+
* explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
|
|
242
|
+
* the caller's own brand via `this`, so every branded subclass gets a
|
|
243
|
+
* correctly-scoped guard by inheritance. Must be invoked on the class —
|
|
244
|
+
* in callback position write `v => SdkError.isInstance(v)`, not
|
|
245
|
+
* `.filter(SdkError.isInstance)` (detached calls throw rather than
|
|
246
|
+
* silently matching nothing).
|
|
247
|
+
*/
|
|
248
|
+
static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
|
|
249
|
+
/**
|
|
250
|
+
* @param code - Stable string code identifying the failure ({@linkcode SdkErrorCode}).
|
|
251
|
+
* @param message - Human-readable description.
|
|
252
|
+
* @param data - Optional structured payload (for example the HTTP status carried by
|
|
253
|
+
* {@linkcode SdkHttpError}). Opaque to the SDK: a `cause` key inside `data` is not
|
|
254
|
+
* promoted to `Error.cause`.
|
|
255
|
+
* @param options - Standard `ErrorOptions`, forwarded to `Error`. Pass the underlying
|
|
256
|
+
* failure as `{ cause }` so it is reachable through the `Error.cause` chain that
|
|
257
|
+
* loggers and error trackers walk.
|
|
258
|
+
*/
|
|
259
|
+
constructor(code: SdkErrorCode, message: string, data?: unknown | undefined, options?: ErrorOptions);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Typed shape for HTTP error data carried by {@linkcode SdkHttpError}.
|
|
263
|
+
*/
|
|
264
|
+
interface SdkHttpErrorData {
|
|
265
|
+
status: number;
|
|
266
|
+
statusText?: string;
|
|
267
|
+
[key: string]: unknown;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* An {@linkcode SdkError} subclass for HTTP transport failures.
|
|
271
|
+
*
|
|
272
|
+
* Thrown by the streamable HTTP transport when the server responds with a
|
|
273
|
+
* non-OK status code. Narrows {@linkcode SdkError.data | data} to
|
|
274
|
+
* {@linkcode SdkHttpErrorData} so consumers can inspect the HTTP status
|
|
275
|
+
* without unsafe casting.
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```ts source="./sdkErrors.examples.ts#SdkHttpError_basicUsage"
|
|
279
|
+
* if (error instanceof SdkHttpError) {
|
|
280
|
+
* console.log(error.status); // number
|
|
281
|
+
* console.log(error.statusText); // string | undefined
|
|
282
|
+
* }
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
285
|
+
declare class SdkHttpError extends SdkError {
|
|
286
|
+
readonly data: SdkHttpErrorData;
|
|
287
|
+
/**
|
|
288
|
+
* @param options - Standard `ErrorOptions`, forwarded to `Error` (see {@linkcode SdkError}).
|
|
289
|
+
*/
|
|
290
|
+
constructor(code: SdkErrorCode, message: string, data: SdkHttpErrorData, options?: ErrorOptions);
|
|
291
|
+
get status(): number;
|
|
292
|
+
get statusText(): string | undefined;
|
|
293
|
+
}
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region ../core-internal/src/shared/authUtils.d.ts
|
|
296
|
+
/**
|
|
297
|
+
* Utilities for handling OAuth resource URIs.
|
|
298
|
+
*/
|
|
299
|
+
/**
|
|
300
|
+
* Converts a server URL to a resource URL by removing the fragment.
|
|
301
|
+
* {@link https://datatracker.ietf.org/doc/html/rfc8707#section-2 | RFC 8707 section 2}
|
|
302
|
+
* states that resource URIs "MUST NOT include a fragment component".
|
|
303
|
+
* Keeps everything else unchanged (scheme, domain, port, path, query).
|
|
304
|
+
*/
|
|
305
|
+
declare function resourceUrlFromServerUrl(url: URL | string): URL;
|
|
306
|
+
/**
|
|
307
|
+
* Checks if a requested resource URL matches a configured resource URL.
|
|
308
|
+
* A requested resource matches if it has the same scheme, domain, port,
|
|
309
|
+
* and its path starts with the configured resource's path.
|
|
310
|
+
*
|
|
311
|
+
* @param options - The options object
|
|
312
|
+
* @param options.requestedResource - The resource URL being requested
|
|
313
|
+
* @param options.configuredResource - The resource URL that has been configured
|
|
314
|
+
* @returns true if the requested resource matches the configured resource, false otherwise
|
|
315
|
+
*/
|
|
316
|
+
declare function checkResourceAllowed({
|
|
317
|
+
requestedResource,
|
|
318
|
+
configuredResource
|
|
319
|
+
}: {
|
|
320
|
+
requestedResource: URL | string;
|
|
321
|
+
configuredResource: URL | string;
|
|
322
|
+
}): boolean;
|
|
323
|
+
declare namespace schemas_d_exports {
|
|
324
|
+
export { AnnotationsSchema, AudioContentSchema, BaseMetadataSchema, BaseRequestParamsSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CallToolRequestParamsSchema, CallToolRequestSchema, CallToolResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, ClientNotificationSchema, ClientRequestSchema, ClientResultSchema, ClientTasksCapabilitySchema, CompatibilityCallToolResultSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, CreateTaskResultSchema, CursorSchema, DiscoverRequestSchema, DiscoverResultSchema, ElicitRequestFormParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitRequestURLParamsSchema, ElicitResultSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, GetPromptResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, GetTaskRequestSchema, GetTaskResultSchema, IconSchema, IconsSchema, ImageContentSchema, ImplementationSchema, InitializeRequestParamsSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONArraySchema, JSONObjectSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResponseSchema, JSONRPCResultResponseSchema, JSONValueSchema, LegacyTitledEnumSchemaSchema, ListChangedOptionsBaseSchema, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListTasksRequestSchema, ListTasksResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, MultiSelectEnumSchemaSchema, NotificationSchema, NotificationsParamsSchema, NumberSchemaSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RelatedTaskMetadataSchema, RequestIdSchema, RequestMetaSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceRequestParamsSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, ResultMetaObjectSchema, ResultSchema, RoleSchema, RootSchema, RootsListChangedNotificationSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, ServerCapabilitiesSchema, ServerNotificationSchema, ServerRequestSchema, ServerResultSchema, ServerTasksCapabilitySchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, SingleSelectEnumSchemaSchema, StringSchemaSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, SubscriptionFilterSchema, SubscriptionsAcknowledgedNotificationParamsSchema, SubscriptionsAcknowledgedNotificationSchema, SubscriptionsListenRequestParamsSchema, SubscriptionsListenRequestSchema, SubscriptionsListenResultMetaSchema, SubscriptionsListenResultSchema, TaskAugmentedRequestParamsSchema, TaskCreationParamsSchema, TaskMetadataSchema, TaskSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, TaskStatusSchema, TextContentSchema, TextResourceContentsSchema, TitledMultiSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, ToolAnnotationsSchema, ToolChoiceSchema, ToolExecutionSchema, ToolListChangedNotificationSchema, ToolResultContentSchema, ToolSchema, ToolUseContentSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, UntitledMultiSelectEnumSchemaSchema, UntitledSingleSelectEnumSchemaSchema };
|
|
325
|
+
}
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region ../core-internal/src/types/types.d.ts
|
|
328
|
+
/**
|
|
329
|
+
* Utility types
|
|
330
|
+
*/
|
|
331
|
+
type ExpandRecursively<T$1> = T$1 extends object ? (T$1 extends infer O ? { [K in keyof O]: ExpandRecursively<O[K]> } : never) : T$1;
|
|
332
|
+
type Primitive = string | number | boolean | bigint | null | undefined;
|
|
333
|
+
type Flatten<T$1> = T$1 extends Primitive ? T$1 : T$1 extends Array<infer U> ? Array<Flatten<U>> : T$1 extends Set<infer U> ? Set<Flatten<U>> : T$1 extends Map<infer K, infer V> ? Map<Flatten<K>, Flatten<V>> : T$1 extends object ? { [K in keyof T$1]: Flatten<T$1[K]> } : T$1;
|
|
334
|
+
type Infer<Schema extends z.ZodTypeAny> = Flatten<z.infer<Schema>>;
|
|
335
|
+
/**
|
|
336
|
+
* Wire-only members hidden from the public types.
|
|
337
|
+
*
|
|
338
|
+
* `resultType` is the protocol-revision-2026-07-28 wire discrimination field
|
|
339
|
+
* on results. It is consumed by the SDK's protocol layer (and stripped before
|
|
340
|
+
* results reach consumers), so the public result types do not declare it.
|
|
341
|
+
* The wire schemas continue to model it internally.
|
|
342
|
+
*/
|
|
343
|
+
type WireOnlyResultKey = 'resultType';
|
|
344
|
+
/**
|
|
345
|
+
* Removes wire-only members from a (possibly union) schema-inferred type
|
|
346
|
+
* while preserving every other declared member, optionality, and the loose
|
|
347
|
+
* index signature.
|
|
348
|
+
*/
|
|
349
|
+
type StripWireOnly<T$1> = T$1 extends unknown ? { [K in keyof T$1 as K extends WireOnlyResultKey ? never : K]: T$1[K] } : never;
|
|
350
|
+
type ProgressToken = Infer<typeof ProgressTokenSchema>;
|
|
351
|
+
type Cursor = Infer<typeof CursorSchema>;
|
|
352
|
+
type Request = Infer<typeof RequestSchema>;
|
|
353
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
354
|
+
type TaskAugmentedRequestParams = Infer<typeof TaskAugmentedRequestParamsSchema>;
|
|
355
|
+
type RequestMeta = Infer<typeof RequestMetaSchema>;
|
|
356
|
+
type Notification = Infer<typeof NotificationSchema>;
|
|
357
|
+
type Result$1 = StripWireOnly<Infer<typeof ResultSchema>>;
|
|
358
|
+
type RequestId = Infer<typeof RequestIdSchema>;
|
|
359
|
+
type JSONRPCRequest = Infer<typeof JSONRPCRequestSchema>;
|
|
360
|
+
type JSONRPCNotification = Infer<typeof JSONRPCNotificationSchema>;
|
|
361
|
+
type JSONRPCErrorResponse = Infer<typeof JSONRPCErrorResponseSchema>;
|
|
362
|
+
type JSONRPCResultResponse = Omit<Infer<typeof JSONRPCResultResponseSchema>, 'result'> & {
|
|
363
|
+
result: Result$1;
|
|
364
|
+
};
|
|
365
|
+
type JSONRPCResponse = JSONRPCResultResponse | JSONRPCErrorResponse;
|
|
366
|
+
type JSONRPCMessage = JSONRPCRequest | JSONRPCNotification | JSONRPCResultResponse | JSONRPCErrorResponse;
|
|
367
|
+
type RequestParams = Infer<typeof BaseRequestParamsSchema>;
|
|
368
|
+
type NotificationParams = Infer<typeof NotificationsParamsSchema>;
|
|
369
|
+
/**
|
|
370
|
+
* The per-request `_meta` envelope carried by every request under protocol revision
|
|
371
|
+
* 2026-07-28 (protocol version, client info, client capabilities, optional log level).
|
|
372
|
+
*
|
|
373
|
+
* Neutral hand-written shape keyed by the public meta-key constants — never
|
|
374
|
+
* inferred from a wire-module schema (this neutral layer does not import from
|
|
375
|
+
* `wire/rev*`). A `type` alias rather than an interface so it stays assignable
|
|
376
|
+
* to `_meta`'s string-indexed object slot.
|
|
377
|
+
*/
|
|
378
|
+
type RequestMetaEnvelope = {};
|
|
379
|
+
type EmptyResult = StripWireOnly<Infer<typeof EmptyResultSchema>>;
|
|
380
|
+
type CancelledNotificationParams = Infer<typeof CancelledNotificationParamsSchema>;
|
|
381
|
+
type CancelledNotification = Infer<typeof CancelledNotificationSchema>;
|
|
382
|
+
type Icon = Infer<typeof IconSchema>;
|
|
383
|
+
type Icons = Infer<typeof IconsSchema>;
|
|
384
|
+
type BaseMetadata = Infer<typeof BaseMetadataSchema>;
|
|
385
|
+
type Annotations = Infer<typeof AnnotationsSchema>;
|
|
386
|
+
type Role = Infer<typeof RoleSchema>;
|
|
387
|
+
type Implementation = Infer<typeof ImplementationSchema>;
|
|
388
|
+
/**
|
|
389
|
+
* Capabilities a client may support.
|
|
390
|
+
*
|
|
391
|
+
* Note: the `roots` and `sampling` capabilities are deprecated as of protocol
|
|
392
|
+
* version 2026-07-28 (SEP-2577); they remain in the specification for at least
|
|
393
|
+
* twelve months. See `ClientCapabilitiesSchema`.
|
|
394
|
+
*/
|
|
395
|
+
type ClientCapabilities = Infer<typeof ClientCapabilitiesSchema>;
|
|
396
|
+
type InitializeRequestParams = Infer<typeof InitializeRequestParamsSchema>;
|
|
397
|
+
type InitializeRequest = Infer<typeof InitializeRequestSchema>;
|
|
398
|
+
/**
|
|
399
|
+
* Capabilities a server may support.
|
|
400
|
+
*
|
|
401
|
+
* Note: the `logging` capability is deprecated as of protocol version
|
|
402
|
+
* 2026-07-28 (SEP-2577); it remains in the specification for at least twelve
|
|
403
|
+
* months. See `ServerCapabilitiesSchema`.
|
|
404
|
+
*/
|
|
405
|
+
type ServerCapabilities = Infer<typeof ServerCapabilitiesSchema>;
|
|
406
|
+
type InitializeResult = StripWireOnly<Infer<typeof InitializeResultSchema>>;
|
|
407
|
+
type InitializedNotification = Infer<typeof InitializedNotificationSchema>;
|
|
408
|
+
type DiscoverRequest = Infer<typeof DiscoverRequestSchema>;
|
|
409
|
+
type DiscoverResult = StripWireOnly<Infer<typeof DiscoverResultSchema>>;
|
|
410
|
+
type PingRequest = Infer<typeof PingRequestSchema>;
|
|
411
|
+
type Progress = Infer<typeof ProgressSchema>;
|
|
412
|
+
type ProgressNotificationParams = Infer<typeof ProgressNotificationParamsSchema>;
|
|
413
|
+
type ProgressNotification = Infer<typeof ProgressNotificationSchema>;
|
|
414
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
415
|
+
type Task = Infer<typeof TaskSchema>;
|
|
416
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
417
|
+
type TaskStatus = Infer<typeof TaskStatusSchema>;
|
|
418
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
419
|
+
type TaskCreationParams = Infer<typeof TaskCreationParamsSchema>;
|
|
420
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
421
|
+
type TaskMetadata = Infer<typeof TaskMetadataSchema>;
|
|
422
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
423
|
+
type RelatedTaskMetadata = Infer<typeof RelatedTaskMetadataSchema>;
|
|
424
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
425
|
+
type CreateTaskResult = StripWireOnly<Infer<typeof CreateTaskResultSchema>>;
|
|
426
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
427
|
+
type TaskStatusNotificationParams = Infer<typeof TaskStatusNotificationParamsSchema>;
|
|
428
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
429
|
+
type TaskStatusNotification = Infer<typeof TaskStatusNotificationSchema>;
|
|
430
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
431
|
+
type GetTaskRequest = Infer<typeof GetTaskRequestSchema>;
|
|
432
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
433
|
+
type GetTaskResult = StripWireOnly<Infer<typeof GetTaskResultSchema>>;
|
|
434
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
435
|
+
type GetTaskPayloadRequest = Infer<typeof GetTaskPayloadRequestSchema>;
|
|
436
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
437
|
+
type ListTasksRequest = Infer<typeof ListTasksRequestSchema>;
|
|
438
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
439
|
+
type ListTasksResult = StripWireOnly<Infer<typeof ListTasksResultSchema>>;
|
|
440
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
441
|
+
type CancelTaskRequest = Infer<typeof CancelTaskRequestSchema>;
|
|
442
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
443
|
+
type CancelTaskResult = StripWireOnly<Infer<typeof CancelTaskResultSchema>>;
|
|
444
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
445
|
+
type GetTaskPayloadResult = StripWireOnly<Infer<typeof GetTaskPayloadResultSchema>>;
|
|
446
|
+
type PaginatedRequestParams = Infer<typeof PaginatedRequestParamsSchema>;
|
|
447
|
+
type PaginatedRequest = Infer<typeof PaginatedRequestSchema>;
|
|
448
|
+
type PaginatedResult = StripWireOnly<Infer<typeof PaginatedResultSchema>>;
|
|
449
|
+
type ResourceContents = Infer<typeof ResourceContentsSchema>;
|
|
450
|
+
type TextResourceContents = Infer<typeof TextResourceContentsSchema>;
|
|
451
|
+
type BlobResourceContents = Infer<typeof BlobResourceContentsSchema>;
|
|
452
|
+
type Resource = Infer<typeof ResourceSchema>;
|
|
453
|
+
type ResourceTemplateType = Infer<typeof ResourceTemplateSchema>;
|
|
454
|
+
type ListResourcesRequest = Infer<typeof ListResourcesRequestSchema>;
|
|
455
|
+
type ListResourcesResult = StripWireOnly<Infer<typeof ListResourcesResultSchema>>;
|
|
456
|
+
type ListResourceTemplatesRequest = Infer<typeof ListResourceTemplatesRequestSchema>;
|
|
457
|
+
type ListResourceTemplatesResult = StripWireOnly<Infer<typeof ListResourceTemplatesResultSchema>>;
|
|
458
|
+
type ResourceRequestParams = Infer<typeof ResourceRequestParamsSchema>;
|
|
459
|
+
type ReadResourceRequestParams = Infer<typeof ReadResourceRequestParamsSchema>;
|
|
460
|
+
type ReadResourceRequest = Infer<typeof ReadResourceRequestSchema>;
|
|
461
|
+
type ReadResourceResult = StripWireOnly<Infer<typeof ReadResourceResultSchema>>;
|
|
462
|
+
type ResourceListChangedNotification = Infer<typeof ResourceListChangedNotificationSchema>;
|
|
463
|
+
type SubscribeRequestParams = Infer<typeof SubscribeRequestParamsSchema>;
|
|
464
|
+
type SubscribeRequest = Infer<typeof SubscribeRequestSchema>;
|
|
465
|
+
type UnsubscribeRequestParams = Infer<typeof UnsubscribeRequestParamsSchema>;
|
|
466
|
+
type UnsubscribeRequest = Infer<typeof UnsubscribeRequestSchema>;
|
|
467
|
+
type ResourceUpdatedNotificationParams = Infer<typeof ResourceUpdatedNotificationParamsSchema>;
|
|
468
|
+
type ResourceUpdatedNotification = Infer<typeof ResourceUpdatedNotificationSchema>;
|
|
469
|
+
type SubscriptionFilter = Infer<typeof SubscriptionFilterSchema>;
|
|
470
|
+
type SubscriptionsListenRequestParams = Infer<typeof SubscriptionsListenRequestParamsSchema>;
|
|
471
|
+
type SubscriptionsListenRequest = Infer<typeof SubscriptionsListenRequestSchema>;
|
|
472
|
+
type SubscriptionsAcknowledgedNotificationParams = Infer<typeof SubscriptionsAcknowledgedNotificationParamsSchema>;
|
|
473
|
+
type SubscriptionsAcknowledgedNotification = Infer<typeof SubscriptionsAcknowledgedNotificationSchema>;
|
|
474
|
+
type SubscriptionsListenResultMeta = Infer<typeof SubscriptionsListenResultMetaSchema>;
|
|
475
|
+
type SubscriptionsListenResult = StripWireOnly<Infer<typeof SubscriptionsListenResultSchema>>;
|
|
476
|
+
type PromptArgument = Infer<typeof PromptArgumentSchema>;
|
|
477
|
+
type Prompt = Infer<typeof PromptSchema>;
|
|
478
|
+
type ListPromptsRequest = Infer<typeof ListPromptsRequestSchema>;
|
|
479
|
+
type ListPromptsResult = StripWireOnly<Infer<typeof ListPromptsResultSchema>>;
|
|
480
|
+
type GetPromptRequestParams = Infer<typeof GetPromptRequestParamsSchema>;
|
|
481
|
+
type GetPromptRequest = Infer<typeof GetPromptRequestSchema>;
|
|
482
|
+
type TextContent = Infer<typeof TextContentSchema>;
|
|
483
|
+
type ImageContent = Infer<typeof ImageContentSchema>;
|
|
484
|
+
type AudioContent = Infer<typeof AudioContentSchema>;
|
|
485
|
+
/**
|
|
486
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
487
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
488
|
+
* provider APIs directly.
|
|
489
|
+
*/
|
|
490
|
+
type ToolUseContent = Infer<typeof ToolUseContentSchema>;
|
|
491
|
+
/**
|
|
492
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
493
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
494
|
+
* provider APIs directly.
|
|
495
|
+
*/
|
|
496
|
+
type ToolResultContent = Infer<typeof ToolResultContentSchema>;
|
|
497
|
+
type EmbeddedResource = Infer<typeof EmbeddedResourceSchema>;
|
|
498
|
+
type ResourceLink = Infer<typeof ResourceLinkSchema>;
|
|
499
|
+
type ContentBlock = Infer<typeof ContentBlockSchema>;
|
|
500
|
+
type PromptMessage = Infer<typeof PromptMessageSchema>;
|
|
501
|
+
type GetPromptResult = StripWireOnly<Infer<typeof GetPromptResultSchema>>;
|
|
502
|
+
type PromptListChangedNotification = Infer<typeof PromptListChangedNotificationSchema>;
|
|
503
|
+
type ToolAnnotations = Infer<typeof ToolAnnotationsSchema>;
|
|
504
|
+
type ToolExecution = Infer<typeof ToolExecutionSchema>;
|
|
505
|
+
type Tool = Infer<typeof ToolSchema>;
|
|
506
|
+
type ListToolsRequest = Infer<typeof ListToolsRequestSchema>;
|
|
507
|
+
type ListToolsResult = StripWireOnly<Infer<typeof ListToolsResultSchema>>;
|
|
508
|
+
type CallToolRequestParams = Infer<typeof CallToolRequestParamsSchema>;
|
|
509
|
+
type CallToolResult = StripWireOnly<Infer<typeof CallToolResultSchema>>;
|
|
510
|
+
type CompatibilityCallToolResult = StripWireOnly<Infer<typeof CompatibilityCallToolResultSchema>>;
|
|
511
|
+
type CallToolRequest = Infer<typeof CallToolRequestSchema>;
|
|
512
|
+
type ToolListChangedNotification = Infer<typeof ToolListChangedNotificationSchema>;
|
|
513
|
+
/**
|
|
514
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
515
|
+
* in the specification for at least twelve months. Migrate to stderr logging
|
|
516
|
+
* (STDIO servers) or OpenTelemetry.
|
|
517
|
+
*/
|
|
518
|
+
type LoggingLevel = Infer<typeof LoggingLevelSchema>;
|
|
519
|
+
/**
|
|
520
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
521
|
+
* in the specification for at least twelve months. Migrate to stderr logging
|
|
522
|
+
* (STDIO servers) or OpenTelemetry.
|
|
523
|
+
*/
|
|
524
|
+
type SetLevelRequestParams = Infer<typeof SetLevelRequestParamsSchema>;
|
|
525
|
+
/**
|
|
526
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
527
|
+
* in the specification for at least twelve months. Migrate to stderr logging
|
|
528
|
+
* (STDIO servers) or OpenTelemetry.
|
|
529
|
+
*/
|
|
530
|
+
type SetLevelRequest = Infer<typeof SetLevelRequestSchema>;
|
|
531
|
+
/**
|
|
532
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
533
|
+
* in the specification for at least twelve months. Migrate to stderr logging
|
|
534
|
+
* (STDIO servers) or OpenTelemetry.
|
|
535
|
+
*/
|
|
536
|
+
type LoggingMessageNotificationParams = Infer<typeof LoggingMessageNotificationParamsSchema>;
|
|
537
|
+
/**
|
|
538
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
539
|
+
* in the specification for at least twelve months. Migrate to stderr logging
|
|
540
|
+
* (STDIO servers) or OpenTelemetry.
|
|
541
|
+
*/
|
|
542
|
+
type LoggingMessageNotification = Infer<typeof LoggingMessageNotificationSchema>;
|
|
543
|
+
/**
|
|
544
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
545
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
546
|
+
* provider APIs directly.
|
|
547
|
+
*/
|
|
548
|
+
type ToolChoice = Infer<typeof ToolChoiceSchema>;
|
|
549
|
+
/**
|
|
550
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
551
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
552
|
+
* provider APIs directly.
|
|
553
|
+
*/
|
|
554
|
+
type ModelHint = Infer<typeof ModelHintSchema>;
|
|
555
|
+
/**
|
|
556
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
557
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
558
|
+
* provider APIs directly.
|
|
559
|
+
*/
|
|
560
|
+
type ModelPreferences = Infer<typeof ModelPreferencesSchema>;
|
|
561
|
+
/**
|
|
562
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
563
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
564
|
+
* provider APIs directly.
|
|
565
|
+
*/
|
|
566
|
+
type SamplingContent = Infer<typeof SamplingContentSchema>;
|
|
567
|
+
/**
|
|
568
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
569
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
570
|
+
* provider APIs directly.
|
|
571
|
+
*/
|
|
572
|
+
type SamplingMessageContentBlock = Infer<typeof SamplingMessageContentBlockSchema>;
|
|
573
|
+
/**
|
|
574
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
575
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
576
|
+
* provider APIs directly.
|
|
577
|
+
*/
|
|
578
|
+
type SamplingMessage = Infer<typeof SamplingMessageSchema>;
|
|
579
|
+
/**
|
|
580
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
581
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
582
|
+
* provider APIs directly.
|
|
583
|
+
*/
|
|
584
|
+
type CreateMessageRequestParams = Infer<typeof CreateMessageRequestParamsSchema>;
|
|
585
|
+
/**
|
|
586
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
587
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
588
|
+
* provider APIs directly.
|
|
589
|
+
*/
|
|
590
|
+
type CreateMessageRequest = Infer<typeof CreateMessageRequestSchema>;
|
|
591
|
+
/**
|
|
592
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
593
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
594
|
+
* provider APIs directly.
|
|
595
|
+
*/
|
|
596
|
+
type CreateMessageResult = StripWireOnly<Infer<typeof CreateMessageResultSchema>>;
|
|
597
|
+
/**
|
|
598
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
599
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
600
|
+
* provider APIs directly.
|
|
601
|
+
*/
|
|
602
|
+
type CreateMessageResultWithTools = StripWireOnly<Infer<typeof CreateMessageResultWithToolsSchema>>;
|
|
603
|
+
type BooleanSchema = Infer<typeof BooleanSchemaSchema>;
|
|
604
|
+
type StringSchema = Infer<typeof StringSchemaSchema>;
|
|
605
|
+
type NumberSchema = Infer<typeof NumberSchemaSchema>;
|
|
606
|
+
type EnumSchema = Infer<typeof EnumSchemaSchema>;
|
|
607
|
+
type UntitledSingleSelectEnumSchema = Infer<typeof UntitledSingleSelectEnumSchemaSchema>;
|
|
608
|
+
type TitledSingleSelectEnumSchema = Infer<typeof TitledSingleSelectEnumSchemaSchema>;
|
|
609
|
+
type LegacyTitledEnumSchema = Infer<typeof LegacyTitledEnumSchemaSchema>;
|
|
610
|
+
type UntitledMultiSelectEnumSchema = Infer<typeof UntitledMultiSelectEnumSchemaSchema>;
|
|
611
|
+
type TitledMultiSelectEnumSchema = Infer<typeof TitledMultiSelectEnumSchemaSchema>;
|
|
612
|
+
type SingleSelectEnumSchema = Infer<typeof SingleSelectEnumSchemaSchema>;
|
|
613
|
+
type MultiSelectEnumSchema = Infer<typeof MultiSelectEnumSchemaSchema>;
|
|
614
|
+
type PrimitiveSchemaDefinition = Infer<typeof PrimitiveSchemaDefinitionSchema>;
|
|
615
|
+
type ElicitRequestParams = Infer<typeof ElicitRequestParamsSchema>;
|
|
616
|
+
type ElicitRequestFormParams = Infer<typeof ElicitRequestFormParamsSchema>;
|
|
617
|
+
type ElicitRequestURLParams = Infer<typeof ElicitRequestURLParamsSchema>;
|
|
618
|
+
type ElicitRequest = Infer<typeof ElicitRequestSchema>;
|
|
619
|
+
/** @deprecated Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification. */
|
|
620
|
+
type ElicitationCompleteNotificationParams = Infer<typeof ElicitationCompleteNotificationParamsSchema>;
|
|
621
|
+
/** @deprecated Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification. */
|
|
622
|
+
type ElicitationCompleteNotification = Infer<typeof ElicitationCompleteNotificationSchema>;
|
|
623
|
+
type ElicitResult = StripWireOnly<Infer<typeof ElicitResultSchema>>;
|
|
624
|
+
type ResourceTemplateReference = Infer<typeof ResourceTemplateReferenceSchema>;
|
|
625
|
+
type PromptReference = Infer<typeof PromptReferenceSchema>;
|
|
626
|
+
type CompleteRequestParams = Infer<typeof CompleteRequestParamsSchema>;
|
|
627
|
+
type CompleteRequest = Infer<typeof CompleteRequestSchema>;
|
|
628
|
+
type CompleteResult = StripWireOnly<Infer<typeof CompleteResultSchema>>;
|
|
629
|
+
/**
|
|
630
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
631
|
+
* in the specification for at least twelve months. Migrate to passing paths via
|
|
632
|
+
* tool parameters, resource URIs, or configuration.
|
|
633
|
+
*/
|
|
634
|
+
type Root = Infer<typeof RootSchema>;
|
|
635
|
+
/**
|
|
636
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
637
|
+
* in the specification for at least twelve months. Migrate to passing paths via
|
|
638
|
+
* tool parameters, resource URIs, or configuration.
|
|
639
|
+
*/
|
|
640
|
+
type ListRootsRequest = Infer<typeof ListRootsRequestSchema>;
|
|
641
|
+
/**
|
|
642
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
643
|
+
* in the specification for at least twelve months. Migrate to passing paths via
|
|
644
|
+
* tool parameters, resource URIs, or configuration.
|
|
645
|
+
*/
|
|
646
|
+
type ListRootsResult = StripWireOnly<Infer<typeof ListRootsResultSchema>>;
|
|
647
|
+
/**
|
|
648
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
649
|
+
* in the specification for at least twelve months. Migrate to passing paths via
|
|
650
|
+
* tool parameters, resource URIs, or configuration.
|
|
651
|
+
*/
|
|
652
|
+
type RootsListChangedNotification = Infer<typeof RootsListChangedNotificationSchema>;
|
|
653
|
+
/**
|
|
654
|
+
* A single embedded (de-JSON-RPC'd) input request inside an
|
|
655
|
+
* {@linkcode InputRequiredResult}: an elicitation, sampling, or roots request
|
|
656
|
+
* object carried in-band rather than sent as a server→client JSON-RPC request.
|
|
657
|
+
*/
|
|
658
|
+
type InputRequest = CreateMessageRequest | ListRootsRequest | ElicitRequest;
|
|
659
|
+
/**
|
|
660
|
+
* A single embedded (de-JSON-RPC'd) input response inside a retried request's
|
|
661
|
+
* `inputResponses`: the bare result object for the corresponding
|
|
662
|
+
* {@linkcode InputRequest} (never wrapped in a `{method, result}` envelope).
|
|
663
|
+
*/
|
|
664
|
+
type InputResponse = CreateMessageResult | ListRootsResult | ElicitResult;
|
|
665
|
+
/**
|
|
666
|
+
* A map of embedded input requests, keyed by server-assigned identifiers that
|
|
667
|
+
* are unique within the scope of the request.
|
|
668
|
+
*/
|
|
669
|
+
interface InputRequests {
|
|
670
|
+
[key: string]: InputRequest;
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* A map of embedded input responses. Keys correspond to the keys of the
|
|
674
|
+
* {@linkcode InputRequests} map the server sent; values are the client's bare
|
|
675
|
+
* result for each request.
|
|
676
|
+
*/
|
|
677
|
+
interface InputResponses {
|
|
678
|
+
[key: string]: InputResponse;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* The input-required result a handler for a multi-round-trip method
|
|
682
|
+
* (`tools/call`, `prompts/get`, `resources/read`) returns to request more
|
|
683
|
+
* input from the client (protocol revision 2026-07-28). Build it with the
|
|
684
|
+
* `inputRequired()` builder; hand-built literals are equally legal —
|
|
685
|
+
* `resultType: 'input_required'` is the discriminator, and the SDK re-checks
|
|
686
|
+
* the at-least-one rule at the seam.
|
|
687
|
+
*
|
|
688
|
+
* This is the one place the wire discriminator `resultType` appears on the
|
|
689
|
+
* neutral surface: the handler authors it, the 2026-07-28 codec passes it
|
|
690
|
+
* through to the wire, and consumers receiving results never see it (complete
|
|
691
|
+
* results are lifted).
|
|
692
|
+
*
|
|
693
|
+
* At least one of `inputRequests` or `requestState` must be present.
|
|
694
|
+
*
|
|
695
|
+
* `requestState` is an opaque, server-minted string echoed back verbatim by
|
|
696
|
+
* the client on retry. It travels through the client and MUST be treated by
|
|
697
|
+
* the server as attacker-controlled input on re-entry: if it influences
|
|
698
|
+
* authorization, resource access, or business logic, the server MUST protect
|
|
699
|
+
* its integrity (e.g. HMAC or AEAD) and MUST reject state that fails
|
|
700
|
+
* verification (spec: basic/patterns/mrtr §Server Requirements). The SDK
|
|
701
|
+
* applies no integrity protection by default — without a configured
|
|
702
|
+
* `ServerOptions.requestState.verify` hook, `ctx.mcpReq.requestState()`
|
|
703
|
+
* returns the raw, unverified string; with one, the seam rejects state the
|
|
704
|
+
* hook refuses and the accessor returns the hook's decoded payload.
|
|
705
|
+
*/
|
|
706
|
+
interface InputRequiredResult extends Result$1 {
|
|
707
|
+
resultType: 'input_required';
|
|
708
|
+
/** Embedded requests the client must fulfil before retrying. */
|
|
709
|
+
inputRequests?: InputRequests;
|
|
710
|
+
/** Opaque server state the client echoes back verbatim on retry. */
|
|
711
|
+
requestState?: string;
|
|
712
|
+
}
|
|
713
|
+
type ClientRequest = Infer<typeof ClientRequestSchema>;
|
|
714
|
+
type ClientNotification = Infer<typeof ClientNotificationSchema>;
|
|
715
|
+
type ClientResult = StripWireOnly<Infer<typeof ClientResultSchema>>;
|
|
716
|
+
type ServerRequest = Infer<typeof ServerRequestSchema>;
|
|
717
|
+
type ServerNotification = Infer<typeof ServerNotificationSchema>;
|
|
718
|
+
type ServerResult = StripWireOnly<Infer<typeof ServerResultSchema>>;
|
|
719
|
+
type MethodToTypeMap<U$1> = { [T in U$1 as T extends {
|
|
720
|
+
method: infer M extends string;
|
|
721
|
+
} ? M : never]: T };
|
|
722
|
+
/**
|
|
723
|
+
* Task methods are 2025-11-25 wire vocabulary with no SDK runtime: the task
|
|
724
|
+
* wire types stay importable (see the Tasks section above), but the typed
|
|
725
|
+
* method surface — `request()`, `setRequestHandler()`, `ctx.mcpReq.send()` —
|
|
726
|
+
* does not offer them. The wire schemas keep parsing task vocabulary for
|
|
727
|
+
* interoperability with 2025-11-25 peers.
|
|
728
|
+
*/
|
|
729
|
+
type TaskRequestMethod = 'tasks/get' | 'tasks/result' | 'tasks/list' | 'tasks/cancel';
|
|
730
|
+
type TaskNotificationMethod = 'notifications/tasks/status';
|
|
731
|
+
type RequestMethod = Exclude<ClientRequest['method'] | ServerRequest['method'], TaskRequestMethod>;
|
|
732
|
+
type NotificationMethod = Exclude<ClientNotification['method'] | ServerNotification['method'], TaskNotificationMethod>;
|
|
733
|
+
type RequestTypeMap = MethodToTypeMap<Exclude<ClientRequest | ServerRequest, {
|
|
734
|
+
method: TaskRequestMethod;
|
|
735
|
+
}>>;
|
|
736
|
+
type NotificationTypeMap = MethodToTypeMap<Exclude<ClientNotification | ServerNotification, {
|
|
737
|
+
method: TaskNotificationMethod;
|
|
738
|
+
}>>;
|
|
739
|
+
type ResultTypeMap = {
|
|
740
|
+
ping: EmptyResult;
|
|
741
|
+
initialize: InitializeResult;
|
|
742
|
+
'server/discover': DiscoverResult;
|
|
743
|
+
'completion/complete': CompleteResult;
|
|
744
|
+
'logging/setLevel': EmptyResult;
|
|
745
|
+
'prompts/get': GetPromptResult;
|
|
746
|
+
'prompts/list': ListPromptsResult;
|
|
747
|
+
'resources/list': ListResourcesResult;
|
|
748
|
+
'resources/templates/list': ListResourceTemplatesResult;
|
|
749
|
+
'resources/read': ReadResourceResult;
|
|
750
|
+
'resources/subscribe': EmptyResult;
|
|
751
|
+
'resources/unsubscribe': EmptyResult;
|
|
752
|
+
'subscriptions/listen': SubscriptionsListenResult;
|
|
753
|
+
'tools/call': CallToolResult;
|
|
754
|
+
'tools/list': ListToolsResult;
|
|
755
|
+
'sampling/createMessage': CreateMessageResult | CreateMessageResultWithTools;
|
|
756
|
+
'elicitation/create': ElicitResult;
|
|
757
|
+
'roots/list': ListRootsResult;
|
|
758
|
+
};
|
|
759
|
+
/**
|
|
760
|
+
* The handler-return counterpart of {@linkcode ResultTypeMap}: what a
|
|
761
|
+
* registered request handler may RETURN for each method. Identical to
|
|
762
|
+
* `ResultTypeMap` except that the multi-round-trip methods (`tools/call`,
|
|
763
|
+
* `prompts/get`, `resources/read`) additionally accept an
|
|
764
|
+
* {@linkcode InputRequiredResult} (protocol revision 2026-07-28).
|
|
765
|
+
*
|
|
766
|
+
* `ResultTypeMap` itself — what a *requester* receives — is deliberately NOT
|
|
767
|
+
* widened: `client.callTool()` returns a plain {@linkcode CallToolResult} on
|
|
768
|
+
* both protocol eras.
|
|
769
|
+
*/
|
|
770
|
+
type HandlerResultTypeMap = { [M in keyof ResultTypeMap]: M extends 'tools/call' | 'prompts/get' | 'resources/read' ? ResultTypeMap[M] | InputRequiredResult : ResultTypeMap[M] };
|
|
771
|
+
/**
|
|
772
|
+
* Information about a validated access token, provided to request handlers.
|
|
773
|
+
*/
|
|
774
|
+
interface AuthInfo {
|
|
775
|
+
/**
|
|
776
|
+
* The access token.
|
|
777
|
+
*/
|
|
778
|
+
token: string;
|
|
779
|
+
/**
|
|
780
|
+
* The client ID associated with this token.
|
|
781
|
+
*/
|
|
782
|
+
clientId: string;
|
|
783
|
+
/**
|
|
784
|
+
* Scopes associated with this token.
|
|
785
|
+
*/
|
|
786
|
+
scopes: string[];
|
|
787
|
+
/**
|
|
788
|
+
* When the token expires (in seconds since epoch).
|
|
789
|
+
*/
|
|
790
|
+
expiresAt?: number;
|
|
791
|
+
/**
|
|
792
|
+
* The RFC 8707 resource server identifier for which this token is valid.
|
|
793
|
+
* If set, this MUST match the MCP server's resource identifier (minus hash fragment).
|
|
794
|
+
*/
|
|
795
|
+
resource?: URL;
|
|
796
|
+
/**
|
|
797
|
+
* URL of the RFC 9728 Protected Resource Metadata document for the
|
|
798
|
+
* resource server that accepted this token.
|
|
799
|
+
*
|
|
800
|
+
* The bearer-auth helpers stamp their configured `resourceMetadataUrl`
|
|
801
|
+
* here when verification succeeds, so challenge responses built after
|
|
802
|
+
* authentication (for example per-operation `insufficient_scope` scope
|
|
803
|
+
* challenges) can advertise the same document as the authentication
|
|
804
|
+
* gate's own challenges without separate configuration. Verifiers may
|
|
805
|
+
* also populate it directly; a verifier-set value wins.
|
|
806
|
+
*/
|
|
807
|
+
resourceMetadataUrl?: string;
|
|
808
|
+
/**
|
|
809
|
+
* Additional data associated with the token.
|
|
810
|
+
* This field should be used for any additional data that needs to be attached to the auth info.
|
|
811
|
+
*/
|
|
812
|
+
extra?: Record<string, unknown>;
|
|
813
|
+
}
|
|
814
|
+
type JSONRPCErrorObject = {
|
|
815
|
+
code: number;
|
|
816
|
+
message: string;
|
|
817
|
+
data?: unknown;
|
|
818
|
+
};
|
|
819
|
+
interface ParseError extends JSONRPCErrorObject {
|
|
820
|
+
code: typeof PARSE_ERROR;
|
|
821
|
+
}
|
|
822
|
+
interface InvalidRequestError extends JSONRPCErrorObject {
|
|
823
|
+
code: typeof INVALID_REQUEST;
|
|
824
|
+
}
|
|
825
|
+
interface MethodNotFoundError extends JSONRPCErrorObject {
|
|
826
|
+
code: typeof METHOD_NOT_FOUND;
|
|
827
|
+
}
|
|
828
|
+
interface InvalidParamsError extends JSONRPCErrorObject {
|
|
829
|
+
code: typeof INVALID_PARAMS;
|
|
830
|
+
}
|
|
831
|
+
interface InternalError extends JSONRPCErrorObject {
|
|
832
|
+
code: typeof INTERNAL_ERROR;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Data carried by a `-32021` MissingRequiredClientCapability protocol error
|
|
836
|
+
* (protocol revision 2026-07-28).
|
|
837
|
+
*/
|
|
838
|
+
interface MissingRequiredClientCapabilityErrorData {
|
|
839
|
+
/**
|
|
840
|
+
* The capabilities the server requires from the client to process the
|
|
841
|
+
* request, in the `ClientCapabilities` shape (only the missing
|
|
842
|
+
* capabilities are listed).
|
|
843
|
+
*/
|
|
844
|
+
requiredCapabilities: ClientCapabilities;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Data carried by a `-32022` UnsupportedProtocolVersion protocol error
|
|
848
|
+
* (protocol revision 2026-07-28).
|
|
849
|
+
*/
|
|
850
|
+
interface UnsupportedProtocolVersionErrorData {
|
|
851
|
+
/**
|
|
852
|
+
* Protocol versions the receiver supports. The sender should choose a
|
|
853
|
+
* mutually supported version from this list and retry.
|
|
854
|
+
*/
|
|
855
|
+
supported: string[];
|
|
856
|
+
/**
|
|
857
|
+
* The protocol version that was requested.
|
|
858
|
+
*/
|
|
859
|
+
requested: string;
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Callback type for list changed notifications.
|
|
863
|
+
*/
|
|
864
|
+
type ListChangedCallback<T$1> = (error: Error | null, items: T$1[] | null) => void;
|
|
865
|
+
/**
|
|
866
|
+
* Options for subscribing to list changed notifications.
|
|
867
|
+
*
|
|
868
|
+
* @typeParam T - The type of items in the list (`Tool`, `Prompt`, or `Resource`)
|
|
869
|
+
*/
|
|
870
|
+
type ListChangedOptions<T$1> = {
|
|
871
|
+
/**
|
|
872
|
+
* If `true`, the list will be refreshed automatically when a list changed notification is received.
|
|
873
|
+
* @default true
|
|
874
|
+
*/
|
|
875
|
+
autoRefresh?: boolean;
|
|
876
|
+
/**
|
|
877
|
+
* Debounce time in milliseconds. Set to `0` to disable.
|
|
878
|
+
* @default 300
|
|
879
|
+
*/
|
|
880
|
+
debounceMs?: number;
|
|
881
|
+
/**
|
|
882
|
+
* Callback invoked when the list changes.
|
|
883
|
+
*
|
|
884
|
+
* If `autoRefresh` is `true`, `items` contains the updated list.
|
|
885
|
+
* If `autoRefresh` is `false`, `items` is `null` (caller should refresh manually).
|
|
886
|
+
*/
|
|
887
|
+
onChanged: ListChangedCallback<T$1>;
|
|
888
|
+
};
|
|
889
|
+
/**
|
|
890
|
+
* Configuration for list changed notification handlers.
|
|
891
|
+
*
|
|
892
|
+
* Use this to configure handlers for tools, prompts, and resources list changes
|
|
893
|
+
* when creating a client.
|
|
894
|
+
*
|
|
895
|
+
* Note: Handlers are only activated if the server advertises the corresponding
|
|
896
|
+
* `listChanged` capability (e.g., `tools.listChanged: true`). If the server
|
|
897
|
+
* doesn't advertise this capability, the handler will not be set up.
|
|
898
|
+
*/
|
|
899
|
+
type ListChangedHandlers = {
|
|
900
|
+
/**
|
|
901
|
+
* Handler for tool list changes.
|
|
902
|
+
*/
|
|
903
|
+
tools?: ListChangedOptions<Tool>;
|
|
904
|
+
/**
|
|
905
|
+
* Handler for prompt list changes.
|
|
906
|
+
*/
|
|
907
|
+
prompts?: ListChangedOptions<Prompt>;
|
|
908
|
+
/**
|
|
909
|
+
* Handler for resource list changes.
|
|
910
|
+
*/
|
|
911
|
+
resources?: ListChangedOptions<Resource>;
|
|
912
|
+
};
|
|
913
|
+
/**
|
|
914
|
+
* Protocol-era classification of an inbound message.
|
|
915
|
+
*
|
|
916
|
+
* Populated by transports that classify messages at the edge (e.g. an HTTP
|
|
917
|
+
* entry distinguishing 2025-era from 2026-era traffic). The wire era itself
|
|
918
|
+
* is connection state (the negotiated protocol version held by the
|
|
919
|
+
* `Client`/`Server` instance); the protocol layer validates a classified
|
|
920
|
+
* message against that instance era at dispatch — a mismatch is treated as
|
|
921
|
+
* an entry/routing error, never a per-message era switch. Unclassified
|
|
922
|
+
* traffic is dispatched on the instance era unchanged.
|
|
923
|
+
*/
|
|
924
|
+
interface MessageClassification {
|
|
925
|
+
/**
|
|
926
|
+
* The wire era the message was classified into: `legacy` for the
|
|
927
|
+
* 2025-11-25 family of revisions, `modern` for 2026-07-28 and later.
|
|
928
|
+
*/
|
|
929
|
+
era: 'legacy' | 'modern';
|
|
930
|
+
/**
|
|
931
|
+
* The exact protocol revision, when the classifier derived one.
|
|
932
|
+
*/
|
|
933
|
+
revision?: string;
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Extra information about a message.
|
|
937
|
+
*/
|
|
938
|
+
interface MessageExtraInfo {
|
|
939
|
+
/**
|
|
940
|
+
* The original HTTP request.
|
|
941
|
+
*/
|
|
942
|
+
request?: globalThis.Request;
|
|
943
|
+
/**
|
|
944
|
+
* Protocol-era classification of the message, when the transport
|
|
945
|
+
* classified it at the edge. Validated by the protocol layer against the
|
|
946
|
+
* instance's negotiated era at dispatch (the edge→instance handoff
|
|
947
|
+
* check); it does not select the era itself.
|
|
948
|
+
*/
|
|
949
|
+
classification?: MessageClassification;
|
|
950
|
+
/**
|
|
951
|
+
* The authentication information.
|
|
952
|
+
*/
|
|
953
|
+
authInfo?: AuthInfo;
|
|
954
|
+
/**
|
|
955
|
+
* Callback to close the SSE stream for this request, triggering client reconnection.
|
|
956
|
+
* Only available when using {@linkcode @modelcontextprotocol/node!streamableHttp.NodeStreamableHTTPServerTransport | NodeStreamableHTTPServerTransport} with eventStore configured.
|
|
957
|
+
*/
|
|
958
|
+
closeSSEStream?: () => void;
|
|
959
|
+
/**
|
|
960
|
+
* Callback to close the standalone GET SSE stream, triggering client reconnection.
|
|
961
|
+
* Only available when using {@linkcode @modelcontextprotocol/node!streamableHttp.NodeStreamableHTTPServerTransport | NodeStreamableHTTPServerTransport} with eventStore configured.
|
|
962
|
+
*/
|
|
963
|
+
closeStandaloneSSEStream?: () => void;
|
|
964
|
+
}
|
|
965
|
+
type MetaObject = Record<string, unknown>;
|
|
966
|
+
type RequestMetaObject = RequestMeta;
|
|
967
|
+
/**
|
|
968
|
+
* The contents of a result's `_meta` field (the 2026-07-28 `ResultMetaObject`):
|
|
969
|
+
* loose, with the optional self-reported serverInfo key typed when present.
|
|
970
|
+
*/
|
|
971
|
+
type ResultMetaObject = Infer<typeof ResultMetaObjectSchema>;
|
|
972
|
+
/**
|
|
973
|
+
* {@linkcode CreateMessageRequestParams} without tools - for backwards-compatible overload.
|
|
974
|
+
* Excludes tools/toolChoice to indicate they should not be provided.
|
|
975
|
+
*
|
|
976
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
977
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
978
|
+
* provider APIs directly.
|
|
979
|
+
*/
|
|
980
|
+
type CreateMessageRequestParamsBase = Omit<CreateMessageRequestParams, 'tools' | 'toolChoice'>;
|
|
981
|
+
/**
|
|
982
|
+
* {@linkcode CreateMessageRequestParams} with required tools - for tool-enabled overload.
|
|
983
|
+
*
|
|
984
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
985
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
986
|
+
* provider APIs directly.
|
|
987
|
+
*/
|
|
988
|
+
interface CreateMessageRequestParamsWithTools extends CreateMessageRequestParams {
|
|
989
|
+
tools: Tool[];
|
|
990
|
+
}
|
|
991
|
+
type CompleteRequestResourceTemplate = ExpandRecursively<CompleteRequest & {
|
|
992
|
+
params: CompleteRequestParams & {
|
|
993
|
+
ref: ResourceTemplateReference;
|
|
994
|
+
};
|
|
995
|
+
}>;
|
|
996
|
+
type CompleteRequestPrompt = ExpandRecursively<CompleteRequest & {
|
|
997
|
+
params: CompleteRequestParams & {
|
|
998
|
+
ref: PromptReference;
|
|
999
|
+
};
|
|
1000
|
+
}>;
|
|
1001
|
+
//#endregion
|
|
1002
|
+
//#region ../core-internal/src/wire/codec.d.ts
|
|
1003
|
+
/** Wire eras with distinct vocabulary. */
|
|
1004
|
+
type WireEra = '2025-11-25' | '2026-07-28';
|
|
1005
|
+
/**
|
|
1006
|
+
* Wire-only material lifted off an inbound message by the protocol layer
|
|
1007
|
+
* before dispatch (the V-3 seam): the reserved `_meta` envelope keys and the
|
|
1008
|
+
* multi-round-trip driver fields. This is the typed driver-material channel
|
|
1009
|
+
* of the codec contract — handlers never see it; the protocol layer surfaces
|
|
1010
|
+
* it via `ctx.mcpReq.envelope` / `.inputResponses` / `.requestState`, and the
|
|
1011
|
+
* MRTR driver (M4.1) consumes the retry fields from here.
|
|
1012
|
+
*/
|
|
1013
|
+
interface LiftedWireMaterial {
|
|
1014
|
+
envelope?: Partial<RequestMetaEnvelope>;
|
|
1015
|
+
inputResponses?: Record<string, unknown>;
|
|
1016
|
+
requestState?: string;
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Tri-state validation outcome — the function-only contract for what the
|
|
1020
|
+
* schema-getter pair (`hasRequestMethod` ⇒ −32601-by-absence; `…Schema(m)
|
|
1021
|
+
* .parse` throw ⇒ −32602) used to encode in two pieces. Preserving the split
|
|
1022
|
+
* is the point: collapsing 'absent from this era's registry' into 'invalid'
|
|
1023
|
+
* would make the in-band fallback chain (validate → on `not-in-era` fall to
|
|
1024
|
+
* validateInputRequest) treat absence as failure and never fall through.
|
|
1025
|
+
*/
|
|
1026
|
+
type ValidateOutcome<T$1> = {
|
|
1027
|
+
readonly ok: true;
|
|
1028
|
+
readonly value: T$1;
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* Method is spec vocabulary but absent from THIS era's registry. Callers
|
|
1032
|
+
* map to −32601 (inbound) or a typed local SdkError (outbound), or fall
|
|
1033
|
+
* through to the in-band validator.
|
|
1034
|
+
*/ | {
|
|
1035
|
+
readonly ok: false;
|
|
1036
|
+
readonly reason: 'not-in-era';
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* Method is in this era's registry; payload failed the era-exact schema.
|
|
1040
|
+
* Callers map to −32602.
|
|
1041
|
+
*/ | {
|
|
1042
|
+
readonly ok: false;
|
|
1043
|
+
readonly reason: 'invalid';
|
|
1044
|
+
readonly message: string;
|
|
1045
|
+
};
|
|
1046
|
+
/** A single self-identifying problem found while validating a per-request `_meta` envelope. */
|
|
1047
|
+
interface EnvelopeIssue {
|
|
1048
|
+
/**
|
|
1049
|
+
* The envelope key the problem is about: one of the reserved `_meta`
|
|
1050
|
+
* keys, or a dotted path inside one.
|
|
1051
|
+
*/
|
|
1052
|
+
readonly key: string;
|
|
1053
|
+
/** A short description of what is wrong with that key (`missing`, or a validation message). */
|
|
1054
|
+
readonly problem: string;
|
|
1055
|
+
}
|
|
1056
|
+
/** Material a Client supplies for an era to build its per-request `_meta` envelope from. */
|
|
1057
|
+
interface OutboundEnvelopeMaterial {
|
|
1058
|
+
readonly protocolVersion: string;
|
|
1059
|
+
readonly clientInfo: Implementation;
|
|
1060
|
+
readonly clientCapabilities: ClientCapabilities;
|
|
1061
|
+
readonly logLevel?: LoggingLevel;
|
|
1062
|
+
}
|
|
1063
|
+
/** Result decode outcomes — the raw-first discrimination (V-1) lives in `decodeResult`. */
|
|
1064
|
+
type DecodedResult = {
|
|
1065
|
+
kind: 'complete';
|
|
1066
|
+
/** The neutral result value: wire-only material consumed/stripped. */
|
|
1067
|
+
result: Result$1;
|
|
1068
|
+
} | {
|
|
1069
|
+
kind: 'input_required';
|
|
1070
|
+
/**
|
|
1071
|
+
* Driver-only material (never consumer-visible). The full
|
|
1072
|
+
* multi-round-trip driver is M4.1 scope; this seam carries the
|
|
1073
|
+
* discriminated payload to it.
|
|
1074
|
+
*/
|
|
1075
|
+
inputRequests: Record<string, unknown>;
|
|
1076
|
+
requestState?: string;
|
|
1077
|
+
/** Result-level `_meta`, carried through so a manual caller sees it. */
|
|
1078
|
+
_meta?: ResultMetaObject;
|
|
1079
|
+
} | {
|
|
1080
|
+
kind: 'invalid';
|
|
1081
|
+
error: SdkError;
|
|
1082
|
+
};
|
|
1083
|
+
/**
|
|
1084
|
+
* The per-era wire codec contract (design C §3, adapted to the live funnel
|
|
1085
|
+
* layout: the universal wire-only LIFT runs once in the protocol layer for
|
|
1086
|
+
* every message — spec, custom, and fallback paths alike — and codecs consume
|
|
1087
|
+
* the lifted material rather than re-implementing the strip per era).
|
|
1088
|
+
*/
|
|
1089
|
+
interface WireCodec {
|
|
1090
|
+
readonly era: WireEra;
|
|
1091
|
+
/** Registry membership — the deletion story (inbound −32601 by absence; outbound typed local error). */
|
|
1092
|
+
hasRequestMethod(method: string): boolean;
|
|
1093
|
+
hasNotificationMethod(method: string): boolean;
|
|
1094
|
+
hasInputRequestMethod(method: string): boolean;
|
|
1095
|
+
/** Era-exact request validation. `not-in-era` ≡ −32601-by-absence; `invalid` ≡ −32602. */
|
|
1096
|
+
validateRequest<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<RequestTypeMap[M$1]>;
|
|
1097
|
+
validateRequest(method: string, raw: unknown): ValidateOutcome<unknown>;
|
|
1098
|
+
/** Era-exact result validation (same registry as `validateRequest`). */
|
|
1099
|
+
validateResult<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<ResultTypeMap[M$1]>;
|
|
1100
|
+
validateResult(method: string, raw: unknown): ValidateOutcome<unknown>;
|
|
1101
|
+
/** Era-exact notification validation. */
|
|
1102
|
+
validateNotification<M$1 extends NotificationMethod>(method: M$1, raw: unknown): ValidateOutcome<NotificationTypeMap[M$1]>;
|
|
1103
|
+
validateNotification(method: string, raw: unknown): ValidateOutcome<unknown>;
|
|
1104
|
+
/**
|
|
1105
|
+
* In-band (de-JSON-RPC'd) input-request validation — the embedded
|
|
1106
|
+
* requests a multi-round-trip `input_required` result may carry. Always
|
|
1107
|
+
* `not-in-era` on the 2025 era (elicitation/sampling/roots are wire
|
|
1108
|
+
* request methods there). Does NOT grant registry membership.
|
|
1109
|
+
*/
|
|
1110
|
+
validateInputRequest<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<RequestTypeMap[M$1]>;
|
|
1111
|
+
validateInputRequest(method: string, raw: unknown): ValidateOutcome<unknown>;
|
|
1112
|
+
/** In-band bare-response validation answering an embedded input request. */
|
|
1113
|
+
validateInputResponse<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<ResultTypeMap[M$1]>;
|
|
1114
|
+
validateInputResponse(method: string, raw: unknown): ValidateOutcome<unknown>;
|
|
1115
|
+
/**
|
|
1116
|
+
* Param-conditional `sampling/createMessage` result validation — the one
|
|
1117
|
+
* spec result whose schema depends on REQUEST params (tools vs no tools).
|
|
1118
|
+
* The 2025 era owns the with-tools/plain frozen schemas; the 2026 era
|
|
1119
|
+
* returns `not-in-era` (sampling is in-band there — callers fall through
|
|
1120
|
+
* to `validateInputResponse`).
|
|
1121
|
+
*/
|
|
1122
|
+
samplingResultVariant(hasTools: true, raw: unknown): ValidateOutcome<CreateMessageResultWithTools>;
|
|
1123
|
+
samplingResultVariant(hasTools: false, raw: unknown): ValidateOutcome<CreateMessageResult>;
|
|
1124
|
+
samplingResultVariant(hasTools: boolean, raw: unknown): ValidateOutcome<CreateMessageResult | CreateMessageResultWithTools>;
|
|
1125
|
+
/**
|
|
1126
|
+
* Outbound per-request `_meta` envelope encode. Returns the keyed object
|
|
1127
|
+
* to merge into `params._meta` on this era, or `undefined` when this era
|
|
1128
|
+
* carries no per-request envelope (the 2025 era — legacy wire stays
|
|
1129
|
+
* byte-identical).
|
|
1130
|
+
*/
|
|
1131
|
+
outboundEnvelope(material: OutboundEnvelopeMaterial): Readonly<Record<string, unknown>> | undefined;
|
|
1132
|
+
/**
|
|
1133
|
+
* Structured envelope validation: maps a `_meta` object to
|
|
1134
|
+
* self-identifying issues. The 2025 era never requires an envelope and
|
|
1135
|
+
* always returns `[]`; the 2026 era owns the required-key pre-pass plus
|
|
1136
|
+
* the wire-exact `RequestMetaEnvelopeSchema` parse.
|
|
1137
|
+
*/
|
|
1138
|
+
validateEnvelopeMeta(meta: Readonly<Record<string, unknown>>): EnvelopeIssue[];
|
|
1139
|
+
/**
|
|
1140
|
+
* Per-registration `tools/call` result projection. Two independent
|
|
1141
|
+
* decisions, both owned here so server-side code never re-derives them:
|
|
1142
|
+
*
|
|
1143
|
+
* - SEP-2106 §4.3 TextContent auto-append (EVERY era, value-shape-based):
|
|
1144
|
+
* when `structuredContent` is a non-object value (array/primitive/
|
|
1145
|
+
* `null`) and the handler authored no `type:'text'` block, append
|
|
1146
|
+
* `{type:'text', text: JSON.stringify(value)}` so consumers that read
|
|
1147
|
+
* only `content` still receive a rendering. The author opts out by
|
|
1148
|
+
* returning any `text` block themselves.
|
|
1149
|
+
*
|
|
1150
|
+
* - `{result:…}` wrap (2025 era only): wrap as `{result:<value>}` when the
|
|
1151
|
+
* value is non-object (the 2025 wire shape requires `structuredContent`
|
|
1152
|
+
* to be an object — a schema-less tool returning `[1,2,3]` would
|
|
1153
|
+
* otherwise ship wire-illegal bytes) OR when the tool's ADVERTISED
|
|
1154
|
+
* `outputSchema` has a non-object root (so the result matches the
|
|
1155
|
+
* `encodeResult('tools/list')` projection of the same tool). Identity on
|
|
1156
|
+
* the 2026 era — the wire shape carries the natural value directly.
|
|
1157
|
+
*/
|
|
1158
|
+
projectCallToolResult(result: CallToolResult, advertisedOutputSchema: Readonly<Record<string, unknown>> | undefined): CallToolResult;
|
|
1159
|
+
/**
|
|
1160
|
+
* Step 1 of result decoding: RAW `resultType` handling BEFORE any schema
|
|
1161
|
+
* validation (V-1's structural home). Era postures (Q1-SD3):
|
|
1162
|
+
* - 2026 era: required discriminator — absent ⇒ typed error naming the
|
|
1163
|
+
* spec violation; `input_required` ⇒ driver payload; unknown ⇒ invalid,
|
|
1164
|
+
* no retry; `complete` ⇒ consume + lift.
|
|
1165
|
+
* - 2025 era: `resultType` is foreign vocabulary ⇒ strip-on-lift.
|
|
1166
|
+
*/
|
|
1167
|
+
decodeResult(method: string, raw: unknown): DecodedResult;
|
|
1168
|
+
/**
|
|
1169
|
+
* Outbound result mapping (the stamp seam). The 2025-era codec is the
|
|
1170
|
+
* identity — it has NO stamp code path (the never-stamp guarantee; it
|
|
1171
|
+
* never reads `serverInfo`). The 2026-era codec strictly enforces the
|
|
1172
|
+
* 2026 wire shape for the known deleted-field set
|
|
1173
|
+
* (`execution.taskSupport`, `capabilities.tasks` — Q1-SD3 iii), stamps
|
|
1174
|
+
* `resultType`, fills the required `ttlMs`/`cacheScope` fields on
|
|
1175
|
+
* cacheable results, and — when the caller supplies its identity —
|
|
1176
|
+
* stamps `_meta['io.modelcontextprotocol/serverInfo']` on every result
|
|
1177
|
+
* (spec PR #3002 SHOULD; a handler-authored value wins). `Server`
|
|
1178
|
+
* instances pass their identity; clients and hand-constructed protocol
|
|
1179
|
+
* objects pass nothing and no identity is ever invented.
|
|
1180
|
+
*/
|
|
1181
|
+
encodeResult(method: string, result: Result$1, serverInfo?: Implementation): Result$1;
|
|
1182
|
+
/**
|
|
1183
|
+
* Outbound error-code mapping (the error half of the stamp seam). A
|
|
1184
|
+
* handler-thrown `ProtocolError`'s numeric code passes through here on
|
|
1185
|
+
* its way to the JSON-RPC error response, so per-era wire-code selection
|
|
1186
|
+
* lives in the codec rather than in handler/funnel code. The current
|
|
1187
|
+
* mapping is identical on both eras (the `-32002` resource-not-found
|
|
1188
|
+
* domain code maps to `-32602` Invalid Params on the wire — the
|
|
1189
|
+
* 2026-07-28 spec MUST, and what the deployed v1.x SDK already emits on
|
|
1190
|
+
* earlier revisions); the seam is the structural home for any future
|
|
1191
|
+
* per-era divergence. Unknown codes pass through unchanged.
|
|
1192
|
+
*/
|
|
1193
|
+
encodeErrorCode(code: number): number;
|
|
1194
|
+
/**
|
|
1195
|
+
* @deprecated Use {@link validateEnvelopeMeta}. Inbound envelope
|
|
1196
|
+
* enforcement for era-classified traffic: validates the lifted envelope
|
|
1197
|
+
* material of a request. Returns an error message when the era requires
|
|
1198
|
+
* an envelope and it is missing/invalid (→ −32602 at the dispatch
|
|
1199
|
+
* layer); `undefined` when acceptable. The 2025 era never requires an
|
|
1200
|
+
* envelope.
|
|
1201
|
+
*/
|
|
1202
|
+
checkInboundEnvelope(material: LiftedWireMaterial): string | undefined;
|
|
1203
|
+
}
|
|
1204
|
+
//#endregion
|
|
1205
|
+
//#region ../core-internal/src/shared/inboundClassification.d.ts
|
|
1206
|
+
/**
|
|
1207
|
+
* The transport-neutral description of an inbound HTTP request the classifier
|
|
1208
|
+
* evaluates. The caller (the HTTP entry) reads the body exactly once and
|
|
1209
|
+
* extracts the two protocol headers; the classifier never touches a request
|
|
1210
|
+
* object itself.
|
|
1211
|
+
*/
|
|
1212
|
+
interface InboundHttpRequest {
|
|
1213
|
+
/** The HTTP request method, e.g. `POST`, `GET`, `DELETE`. */
|
|
1214
|
+
httpMethod: string;
|
|
1215
|
+
/** The value of the `MCP-Protocol-Version` header, when present. */
|
|
1216
|
+
protocolVersionHeader?: string;
|
|
1217
|
+
/** The value of the `Mcp-Method` header, when present. */
|
|
1218
|
+
mcpMethodHeader?: string;
|
|
1219
|
+
/** The value of the `Mcp-Name` header, when present. */
|
|
1220
|
+
mcpNameHeader?: string;
|
|
1221
|
+
/** The parsed JSON request body (`undefined` for body-less methods). */
|
|
1222
|
+
body?: unknown;
|
|
1223
|
+
}
|
|
1224
|
+
/** Why an inbound request was routed to legacy-era serving. */
|
|
1225
|
+
type InboundLegacyRouteReason = /** Non-`POST` HTTP method: a body-less 2025-era session operation. */
|
|
1226
|
+
'http-method'
|
|
1227
|
+
/** An `initialize` request without a valid modern envelope claim — the legacy handshake by definition. */ | 'initialize'
|
|
1228
|
+
/** A request without a per-request envelope claim. */ | 'no-claim'
|
|
1229
|
+
/** A notification without a body claim or a modern protocol-version header. */ | 'notification'
|
|
1230
|
+
/** An all-legacy JSON-RPC batch array. */ | 'batch'
|
|
1231
|
+
/** A JSON-RPC response posted to the endpoint (2025-era session traffic). */ | 'response';
|
|
1232
|
+
/**
|
|
1233
|
+
* The request is legacy-era traffic. It carries no classification on purpose:
|
|
1234
|
+
* legacy serving receives it exactly as a hand-wired 2025 transport would.
|
|
1235
|
+
*/
|
|
1236
|
+
interface InboundLegacyRoute {
|
|
1237
|
+
kind: 'legacy';
|
|
1238
|
+
reason: InboundLegacyRouteReason;
|
|
1239
|
+
/**
|
|
1240
|
+
* The protocol version the request named, when it named one (an
|
|
1241
|
+
* `initialize` body's `protocolVersion`, or the `MCP-Protocol-Version`
|
|
1242
|
+
* header). Used to echo `requested` when legacy serving is not configured.
|
|
1243
|
+
*/
|
|
1244
|
+
requestedVersion?: string;
|
|
1245
|
+
}
|
|
1246
|
+
/**
|
|
1247
|
+
* The request claims the per-request envelope mechanism and is served on the
|
|
1248
|
+
* modern path. Discriminated by `messageKind` so the typed `message` narrows
|
|
1249
|
+
* with it — the classifier has already proved the JSON-RPC shape via the
|
|
1250
|
+
* `isJSONRPCRequest` / `isJSONRPCNotification` guards, so consumers never
|
|
1251
|
+
* cast the body again.
|
|
1252
|
+
*/
|
|
1253
|
+
type InboundModernRoute = {
|
|
1254
|
+
kind: 'modern';
|
|
1255
|
+
messageKind: 'request';
|
|
1256
|
+
/** The classified body — guard-proved {@linkcode JSONRPCRequest} shape. */
|
|
1257
|
+
message: JSONRPCRequest;
|
|
1258
|
+
/**
|
|
1259
|
+
* The classification handed to the per-request transport and validated by
|
|
1260
|
+
* the protocol layer against the serving instance's negotiated era.
|
|
1261
|
+
*/
|
|
1262
|
+
classification: MessageClassification;
|
|
1263
|
+
} | {
|
|
1264
|
+
kind: 'modern';
|
|
1265
|
+
messageKind: 'notification';
|
|
1266
|
+
/** The classified body — guard-proved {@linkcode JSONRPCNotification} shape. */
|
|
1267
|
+
message: JSONRPCNotification;
|
|
1268
|
+
classification: MessageClassification;
|
|
1269
|
+
};
|
|
1270
|
+
/** The named steps of the inbound validation ladder, in evaluation order. */
|
|
1271
|
+
type InboundValidationRung = 'http-method' | 'jsonrpc-shape' | 'era-classification' | 'envelope' | 'method-registry' | 'request-params' | 'standard-header-validation' | 'client-capabilities' | 'param-header-validation';
|
|
1272
|
+
/** A ladder rejection: the JSON-RPC error to emit and the HTTP status to emit it with. */
|
|
1273
|
+
interface InboundLadderRejection {
|
|
1274
|
+
kind: 'reject';
|
|
1275
|
+
/** The ladder rung that produced the rejection. */
|
|
1276
|
+
rung: InboundValidationRung;
|
|
1277
|
+
/** The cell this rejection corresponds to on the ladder cell sheet (stable identifier for tests). */
|
|
1278
|
+
cell: string;
|
|
1279
|
+
/** The HTTP status the rejection is emitted with. */
|
|
1280
|
+
httpStatus: number;
|
|
1281
|
+
/** The JSON-RPC error code. */
|
|
1282
|
+
code: number;
|
|
1283
|
+
/** The JSON-RPC error message. */
|
|
1284
|
+
message: string;
|
|
1285
|
+
/** Structured error data (recognizers parse this; they never rely on class identity). */
|
|
1286
|
+
data?: unknown;
|
|
1287
|
+
/**
|
|
1288
|
+
* `false` when the exact error code for this cell is not settled upstream
|
|
1289
|
+
* yet and the emitted code is provisional.
|
|
1290
|
+
*/
|
|
1291
|
+
settled: boolean;
|
|
1292
|
+
}
|
|
1293
|
+
/** The outcome of classifying one inbound HTTP request. */
|
|
1294
|
+
type InboundClassificationOutcome = InboundLegacyRoute | InboundModernRoute | InboundLadderRejection;
|
|
1295
|
+
/**
|
|
1296
|
+
* Classifies one inbound HTTP request for dual-era serving.
|
|
1297
|
+
*
|
|
1298
|
+
* The body-primary predicate, evaluated once at the entry boundary: see the
|
|
1299
|
+
* module documentation for the rules. Returns a routing outcome (`legacy` or
|
|
1300
|
+
* `modern`) or a ladder rejection; it never throws.
|
|
1301
|
+
*/
|
|
1302
|
+
declare function classifyInboundRequest(request: InboundHttpRequest): InboundClassificationOutcome;
|
|
1303
|
+
//#endregion
|
|
1304
|
+
//#region ../core-internal/src/util/standardSchema.d.ts
|
|
1305
|
+
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
1306
|
+
readonly '~standard': StandardTypedV1.Props<Input, Output>;
|
|
1307
|
+
}
|
|
1308
|
+
declare namespace StandardTypedV1 {
|
|
1309
|
+
interface Props<Input = unknown, Output = Input> {
|
|
1310
|
+
readonly version: 1;
|
|
1311
|
+
readonly vendor: string;
|
|
1312
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
1313
|
+
}
|
|
1314
|
+
interface Types<Input = unknown, Output = Input> {
|
|
1315
|
+
readonly input: Input;
|
|
1316
|
+
readonly output: Output;
|
|
1317
|
+
}
|
|
1318
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['input'];
|
|
1319
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['output'];
|
|
1320
|
+
}
|
|
1321
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
1322
|
+
readonly '~standard': StandardSchemaV1.Props<Input, Output>;
|
|
1323
|
+
}
|
|
1324
|
+
declare namespace StandardSchemaV1 {
|
|
1325
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
1326
|
+
readonly validate: (value: unknown, options?: Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
1327
|
+
}
|
|
1328
|
+
interface Options {
|
|
1329
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
1330
|
+
}
|
|
1331
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
1332
|
+
interface SuccessResult<Output> {
|
|
1333
|
+
readonly value: Output;
|
|
1334
|
+
readonly issues?: undefined;
|
|
1335
|
+
}
|
|
1336
|
+
interface FailureResult {
|
|
1337
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
1338
|
+
}
|
|
1339
|
+
interface Issue {
|
|
1340
|
+
readonly message: string;
|
|
1341
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
1342
|
+
}
|
|
1343
|
+
interface PathSegment {
|
|
1344
|
+
readonly key: PropertyKey;
|
|
1345
|
+
}
|
|
1346
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
1347
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
1348
|
+
}
|
|
1349
|
+
interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
|
|
1350
|
+
readonly '~standard': StandardJSONSchemaV1.Props<Input, Output>;
|
|
1351
|
+
}
|
|
1352
|
+
declare namespace StandardJSONSchemaV1 {
|
|
1353
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
1354
|
+
readonly jsonSchema: Converter;
|
|
1355
|
+
}
|
|
1356
|
+
interface Converter {
|
|
1357
|
+
readonly input: (options: Options) => Record<string, unknown>;
|
|
1358
|
+
readonly output: (options: Options) => Record<string, unknown>;
|
|
1359
|
+
}
|
|
1360
|
+
type Target = 'draft-2020-12' | 'draft-07' | 'openapi-3.0' | (object & string);
|
|
1361
|
+
interface Options {
|
|
1362
|
+
readonly target: Target;
|
|
1363
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
1364
|
+
}
|
|
1365
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
1366
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Combined interface for schemas with both validation and JSON Schema conversion —
|
|
1370
|
+
* the intersection of {@linkcode StandardSchemaV1} and {@linkcode StandardJSONSchemaV1}.
|
|
1371
|
+
*
|
|
1372
|
+
* This is the type accepted by `registerTool` / `registerPrompt`. The SDK needs
|
|
1373
|
+
* `~standard.jsonSchema` to advertise the tool's argument shape in `tools/list`, and
|
|
1374
|
+
* `~standard.validate` to check incoming arguments when a `tools/call` arrives.
|
|
1375
|
+
*
|
|
1376
|
+
* Zod v4, ArkType, and Valibot (via `@valibot/to-json-schema`'s `toStandardJsonSchema`)
|
|
1377
|
+
* all implement both interfaces.
|
|
1378
|
+
*
|
|
1379
|
+
* @see https://standardschema.dev/ for the Standard Schema specification
|
|
1380
|
+
*/
|
|
1381
|
+
interface StandardSchemaWithJSON<Input = unknown, Output = Input> {
|
|
1382
|
+
readonly '~standard': StandardSchemaV1.Props<Input, Output> & StandardJSONSchemaV1.Props<Input, Output>;
|
|
1383
|
+
}
|
|
1384
|
+
declare namespace StandardSchemaWithJSON {
|
|
1385
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
1386
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
1387
|
+
}
|
|
1388
|
+
/**
|
|
1389
|
+
* Narrowing of {@linkcode StandardSchemaV1} whose `validate` is guaranteed synchronous.
|
|
1390
|
+
*
|
|
1391
|
+
* The Zod schemas backing `specTypeSchemas` contain no async refinements or transforms,
|
|
1392
|
+
* so every entry satisfies this interface. Consumers can call `validate()` and access
|
|
1393
|
+
* `.issues` / `.value` on the result without `await`.
|
|
1394
|
+
*
|
|
1395
|
+
* `StandardSchemaV1Sync` is assignable to `StandardSchemaV1` — it is a strict subtype.
|
|
1396
|
+
*/
|
|
1397
|
+
interface StandardSchemaV1Sync<Input = unknown, Output = Input> extends StandardSchemaV1<Input, Output> {
|
|
1398
|
+
readonly '~standard': StandardSchemaV1Sync.Props<Input, Output>;
|
|
1399
|
+
}
|
|
1400
|
+
declare namespace StandardSchemaV1Sync {
|
|
1401
|
+
interface Props<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output> {
|
|
1402
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<Output>;
|
|
1403
|
+
}
|
|
1404
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
1405
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
1406
|
+
}
|
|
1407
|
+
//#endregion
|
|
1408
|
+
//#region ../core-internal/src/shared/elicitation.d.ts
|
|
1409
|
+
/** Input accepted by `inputRequired.elicit()`: a wire-ready elicitation JSON Schema or a Standard Schema. */
|
|
1410
|
+
type ElicitInputParams = Omit<ElicitRequestFormParams, 'requestedSchema'> & {
|
|
1411
|
+
requestedSchema: ElicitRequestFormParams['requestedSchema'] | StandardSchemaWithJSON;
|
|
1412
|
+
};
|
|
1413
|
+
//#endregion
|
|
1414
|
+
//#region ../core-internal/src/shared/inputRequired.d.ts
|
|
1415
|
+
/** The shape accepted by {@linkcode inputRequired}. */
|
|
1416
|
+
interface InputRequiredSpec {
|
|
1417
|
+
/** Embedded requests the client must fulfil before retrying. */
|
|
1418
|
+
inputRequests?: InputRequests;
|
|
1419
|
+
/** Opaque server state echoed back verbatim by the client on retry. */
|
|
1420
|
+
requestState?: string;
|
|
1421
|
+
}
|
|
1422
|
+
interface InputRequiredBuilder {
|
|
1423
|
+
/**
|
|
1424
|
+
* Builds the input-required return value for a multi-round-trip handler.
|
|
1425
|
+
*
|
|
1426
|
+
* At least one of `inputRequests` or `requestState` must be provided
|
|
1427
|
+
* (spec: basic/patterns/mrtr, server requirements) — the builder throws a
|
|
1428
|
+
* `TypeError` otherwise, and the server seam re-checks the same rule for
|
|
1429
|
+
* hand-built results.
|
|
1430
|
+
*
|
|
1431
|
+
* `requestState` is opaque, server-minted state. It round-trips through
|
|
1432
|
+
* the client and comes back as attacker-controlled input: a server that
|
|
1433
|
+
* lets it influence authorization, resource access, or business logic
|
|
1434
|
+
* MUST integrity-protect it (e.g. HMAC or AEAD) and MUST reject state
|
|
1435
|
+
* that fails verification. The SDK does not do this for you.
|
|
1436
|
+
*/
|
|
1437
|
+
(spec: InputRequiredSpec): InputRequiredResult;
|
|
1438
|
+
/**
|
|
1439
|
+
* Builds an embedded form-mode elicitation request (`elicitation/create`).
|
|
1440
|
+
*
|
|
1441
|
+
* A Standard Schema `requestedSchema` is converted to the restricted wire shape;
|
|
1442
|
+
* shapes it cannot express throw a `TypeError` before anything is sent. Responses
|
|
1443
|
+
* are not validated against it — pass the same schema to `acceptedContent()` on
|
|
1444
|
+
* re-entry for validated, typed content.
|
|
1445
|
+
*/
|
|
1446
|
+
elicit(params: ElicitInputParams): InputRequest;
|
|
1447
|
+
/**
|
|
1448
|
+
* Builds an embedded URL-mode elicitation request (`elicitation/create`).
|
|
1449
|
+
* On the 2026-07-28 revision URL elicitation rides the multi-round-trip
|
|
1450
|
+
* flow — the `-32042` error of earlier revisions never appears on this
|
|
1451
|
+
* era's wire. The 2025-era `elicitationId` is not part of the 2026-07-28
|
|
1452
|
+
* URL-mode shape; correlation across retries is the server's own
|
|
1453
|
+
* identifier inside `requestState`.
|
|
1454
|
+
*/
|
|
1455
|
+
elicitUrl(params: Omit<ElicitRequestURLParams, 'mode' | 'elicitationId'>): InputRequest;
|
|
1456
|
+
/** Builds an embedded sampling request (`sampling/createMessage`). */
|
|
1457
|
+
createMessage(params: CreateMessageRequestParams): InputRequest;
|
|
1458
|
+
/** Builds an embedded roots listing request (`roots/list`). */
|
|
1459
|
+
listRoots(): InputRequest;
|
|
1460
|
+
}
|
|
1461
|
+
/**
|
|
1462
|
+
* Builder for the input-required return value of multi-round-trip handlers,
|
|
1463
|
+
* with per-kind constructors for the embedded requests
|
|
1464
|
+
* (`inputRequired.elicit`, `inputRequired.elicitUrl`,
|
|
1465
|
+
* `inputRequired.createMessage`, `inputRequired.listRoots`).
|
|
1466
|
+
*
|
|
1467
|
+
* @example Write-once tool requesting confirmation
|
|
1468
|
+
* ```ts
|
|
1469
|
+
* server.registerTool('deploy', { inputSchema: z.object({ env: z.string() }) }, async ({ env }, ctx) => {
|
|
1470
|
+
* const confirmationSchema = z.object({ confirm: z.boolean() });
|
|
1471
|
+
* const confirmed = acceptedContent(ctx.mcpReq.inputResponses, 'confirm', confirmationSchema);
|
|
1472
|
+
* if (confirmed?.confirm !== true) {
|
|
1473
|
+
* return inputRequired({
|
|
1474
|
+
* inputRequests: {
|
|
1475
|
+
* confirm: inputRequired.elicit({
|
|
1476
|
+
* message: `Deploy to ${env}?`,
|
|
1477
|
+
* requestedSchema: confirmationSchema
|
|
1478
|
+
* })
|
|
1479
|
+
* }
|
|
1480
|
+
* });
|
|
1481
|
+
* }
|
|
1482
|
+
* return { content: [{ type: 'text', text: `deployed to ${env}` }] };
|
|
1483
|
+
* });
|
|
1484
|
+
* ```
|
|
1485
|
+
*/
|
|
1486
|
+
declare const inputRequired: InputRequiredBuilder;
|
|
1487
|
+
/**
|
|
1488
|
+
* Reads the accepted content of a form-mode elicitation response from a
|
|
1489
|
+
* retried request's `inputResponses` (`ctx.mcpReq.inputResponses`).
|
|
1490
|
+
*
|
|
1491
|
+
* Returns the response's `content` for `key` when the entry is an accepted
|
|
1492
|
+
* elicitation result, and `undefined` otherwise (missing key, declined or
|
|
1493
|
+
* cancelled elicitation, or a response of another kind). The values arrive
|
|
1494
|
+
* from the client and are not re-validated here — treat them as untrusted
|
|
1495
|
+
* input.
|
|
1496
|
+
*/
|
|
1497
|
+
declare function acceptedContent<T$1 extends Record<string, unknown> = Record<string, unknown>>(responses: InputResponses | Record<string, unknown> | undefined, key: string): T$1 | undefined;
|
|
1498
|
+
/**
|
|
1499
|
+
* Schema-aware overload: validates the accepted content against the given
|
|
1500
|
+
* schema (any Standard Schema, e.g. a zod object) before returning it, so the
|
|
1501
|
+
* untrusted client value arrives in the handler already validated and typed.
|
|
1502
|
+
*
|
|
1503
|
+
* Returns `undefined` when the response is missing/declined/of another kind
|
|
1504
|
+
* (as the two-argument form does) AND when the accepted content fails schema
|
|
1505
|
+
* validation — handlers treat both the same way (re-issue the request or
|
|
1506
|
+
* give up). Only synchronous schemas are supported (zod schemas without async
|
|
1507
|
+
* refinements are synchronous); an asynchronously-validating schema throws a
|
|
1508
|
+
* `TypeError`.
|
|
1509
|
+
*/
|
|
1510
|
+
declare function acceptedContent<S extends StandardSchemaV1>(responses: InputResponses | Record<string, unknown> | undefined, key: string, schema: S): StandardSchemaV1.InferOutput<S> | undefined;
|
|
1511
|
+
/**
|
|
1512
|
+
* The discriminated view {@linkcode inputResponse} returns: which kind of
|
|
1513
|
+
* embedded response (if any) a retried request carried for a key. Bare
|
|
1514
|
+
* response objects are discriminated structurally — an `action` member means
|
|
1515
|
+
* an elicitation result, a `roots` array a roots listing, a `role` + `content`
|
|
1516
|
+
* pair a sampling result. A missing key or an entry that matches none of the
|
|
1517
|
+
* three shapes reads as `{ kind: 'missing' }`.
|
|
1518
|
+
*/
|
|
1519
|
+
type InputResponseView = {
|
|
1520
|
+
kind: 'missing';
|
|
1521
|
+
} | {
|
|
1522
|
+
kind: 'elicit';
|
|
1523
|
+
action: 'accept' | 'decline' | 'cancel';
|
|
1524
|
+
content?: Record<string, unknown>;
|
|
1525
|
+
} | {
|
|
1526
|
+
kind: 'sampling';
|
|
1527
|
+
result: CreateMessageResult | CreateMessageResultWithTools;
|
|
1528
|
+
} | {
|
|
1529
|
+
kind: 'roots';
|
|
1530
|
+
roots: Root[];
|
|
1531
|
+
};
|
|
1532
|
+
/**
|
|
1533
|
+
* Reads one entry of a retried request's `inputResponses`
|
|
1534
|
+
* (`ctx.mcpReq.inputResponses`) as a discriminated view, covering
|
|
1535
|
+
* decline/cancel detection and the non-elicitation response kinds that
|
|
1536
|
+
* {@linkcode acceptedContent} does not surface.
|
|
1537
|
+
*
|
|
1538
|
+
* The values arrive from the client and are not re-validated here — treat
|
|
1539
|
+
* them as untrusted input (validate elicitation content with the
|
|
1540
|
+
* schema-aware {@linkcode acceptedContent} overload where it matters).
|
|
1541
|
+
*/
|
|
1542
|
+
declare function inputResponse(responses: InputResponses | Record<string, unknown> | undefined, key: string): InputResponseView;
|
|
1543
|
+
//#endregion
|
|
1544
|
+
//#region ../core-internal/src/types/enums.d.ts
|
|
1545
|
+
/**
|
|
1546
|
+
* Error codes for protocol errors that cross the wire as JSON-RPC error responses.
|
|
1547
|
+
* These follow the JSON-RPC specification and MCP-specific extensions.
|
|
1548
|
+
*/
|
|
1549
|
+
declare enum ProtocolErrorCode {
|
|
1550
|
+
ParseError = -32700,
|
|
1551
|
+
InvalidRequest = -32600,
|
|
1552
|
+
MethodNotFound = -32601,
|
|
1553
|
+
InvalidParams = -32602,
|
|
1554
|
+
InternalError = -32603,
|
|
1555
|
+
/**
|
|
1556
|
+
* Resource not found.
|
|
1557
|
+
*
|
|
1558
|
+
* Receive-tolerated only: the SDK never EMITS `-32002` — `resources/read`
|
|
1559
|
+
* misses answer `-32602` (Invalid Params) on every protocol revision per
|
|
1560
|
+
* the 2026-07-28 spec MUST, and a handler-thrown `-32002` is mapped to
|
|
1561
|
+
* `-32602` at the era encode seam. The member stays importable so clients
|
|
1562
|
+
* can recognise `-32002` from peers built on earlier SDK releases (the
|
|
1563
|
+
* spec's "clients SHOULD also accept `-32002`" backwards-compatibility
|
|
1564
|
+
* clause). Throw `ResourceNotFoundError` instead.
|
|
1565
|
+
*/
|
|
1566
|
+
ResourceNotFound = -32002,
|
|
1567
|
+
/**
|
|
1568
|
+
* Processing the request requires a capability the client did not declare
|
|
1569
|
+
* in the request's `clientCapabilities` (protocol revision 2026-07-28).
|
|
1570
|
+
*/
|
|
1571
|
+
MissingRequiredClientCapability = -32021,
|
|
1572
|
+
/**
|
|
1573
|
+
* The request's protocol version is unknown to the server or unsupported
|
|
1574
|
+
* by it (protocol revision 2026-07-28).
|
|
1575
|
+
*/
|
|
1576
|
+
UnsupportedProtocolVersion = -32022,
|
|
1577
|
+
UrlElicitationRequired = -32042,
|
|
1578
|
+
}
|
|
1579
|
+
//#endregion
|
|
1580
|
+
//#region ../core-internal/src/types/errors.d.ts
|
|
1581
|
+
/**
|
|
1582
|
+
* Protocol errors are JSON-RPC errors that cross the wire as error responses.
|
|
1583
|
+
* They use numeric error codes from the {@linkcode ProtocolErrorCode} enum.
|
|
1584
|
+
*
|
|
1585
|
+
* `instanceof` on this class (and its subclasses) is brand-matched, so it works
|
|
1586
|
+
* across separately bundled copies of the SDK — e.g. an error constructed by
|
|
1587
|
+
* `@modelcontextprotocol/client` matches the class re-exported by
|
|
1588
|
+
* `@modelcontextprotocol/server` in the same process.
|
|
1589
|
+
*/
|
|
1590
|
+
declare class ProtocolError extends Error {
|
|
1591
|
+
readonly code: number;
|
|
1592
|
+
readonly data?: unknown | undefined;
|
|
1593
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
1594
|
+
/**
|
|
1595
|
+
* Brand-based type guard: equivalent to `value instanceof this`, as an
|
|
1596
|
+
* explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
|
|
1597
|
+
* the caller's own brand via `this`, so every branded subclass gets a
|
|
1598
|
+
* correctly-scoped guard by inheritance. Must be invoked on the class —
|
|
1599
|
+
* in callback position write `v => SdkError.isInstance(v)`, not
|
|
1600
|
+
* `.filter(SdkError.isInstance)` (detached calls throw rather than
|
|
1601
|
+
* silently matching nothing).
|
|
1602
|
+
*/
|
|
1603
|
+
static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
|
|
1604
|
+
constructor(code: number, message: string, data?: unknown | undefined);
|
|
1605
|
+
/**
|
|
1606
|
+
* Factory method to create the appropriate error type based on the error code and data
|
|
1607
|
+
*/
|
|
1608
|
+
static fromError(code: number, message: string, data?: unknown): ProtocolError;
|
|
1609
|
+
}
|
|
1610
|
+
/**
|
|
1611
|
+
* Error type for a `resources/read` miss: the requested resource does not
|
|
1612
|
+
* exist. The wire code is `-32602` (Invalid Params) on every protocol
|
|
1613
|
+
* revision — the spec MUST for revision 2026-07-28, and the value the v1.x
|
|
1614
|
+
* SDK has always emitted on earlier revisions. The error data echoes the
|
|
1615
|
+
* requested URI.
|
|
1616
|
+
*
|
|
1617
|
+
* Recognise this error by checking `error.data` is exactly `{ uri: string }`
|
|
1618
|
+
* (a `-32602` whose data carries `uri` and nothing else is resource-not-found;
|
|
1619
|
+
* any other `-32602` is an ordinary Invalid Params). For backwards compatibility, clients should also
|
|
1620
|
+
* accept `-32002` as resource not found — earlier SDK builds emitted that
|
|
1621
|
+
* code, and {@linkcode ProtocolError.fromError} reconstructs this class for
|
|
1622
|
+
* either code **when `error.data` carries `uri`** (a bare `-32002` without
|
|
1623
|
+
* `data.uri` stays a generic {@linkcode ProtocolError}). `instanceof` checks
|
|
1624
|
+
* are brand-matched and work across separately bundled copies of the SDK.
|
|
1625
|
+
*/
|
|
1626
|
+
declare class ResourceNotFoundError extends ProtocolError {
|
|
1627
|
+
constructor(uri: string, message?: string);
|
|
1628
|
+
/** The URI that was requested and not found. */
|
|
1629
|
+
get uri(): string;
|
|
1630
|
+
}
|
|
1631
|
+
/**
|
|
1632
|
+
* Specialized error type when a tool requires a URL mode elicitation.
|
|
1633
|
+
* 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.
|
|
1634
|
+
*/
|
|
1635
|
+
declare class UrlElicitationRequiredError extends ProtocolError {
|
|
1636
|
+
constructor(elicitations: ElicitRequestURLParams[], message?: string);
|
|
1637
|
+
get elicitations(): ElicitRequestURLParams[];
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* Error type for the `-32022` UnsupportedProtocolVersion protocol error (protocol
|
|
1641
|
+
* revision 2026-07-28): the request's protocol version is unknown to the server or
|
|
1642
|
+
* unsupported by it.
|
|
1643
|
+
*
|
|
1644
|
+
* The error data lists the protocol versions the receiver supports (`supported`),
|
|
1645
|
+
* so the sender can choose a mutually supported version and retry, and echoes the
|
|
1646
|
+
* version that was requested (`requested`).
|
|
1647
|
+
*/
|
|
1648
|
+
declare class UnsupportedProtocolVersionError extends ProtocolError {
|
|
1649
|
+
constructor(data: UnsupportedProtocolVersionErrorData, message?: string);
|
|
1650
|
+
/**
|
|
1651
|
+
* Protocol versions the receiver supports.
|
|
1652
|
+
*/
|
|
1653
|
+
get supported(): string[];
|
|
1654
|
+
/**
|
|
1655
|
+
* The protocol version that was requested.
|
|
1656
|
+
*/
|
|
1657
|
+
get requested(): string;
|
|
1658
|
+
}
|
|
1659
|
+
/**
|
|
1660
|
+
* Error type for the `-32021` MissingRequiredClientCapability protocol error
|
|
1661
|
+
* (protocol revision 2026-07-28): processing the request requires a capability
|
|
1662
|
+
* the client did not declare in the request's `clientCapabilities`.
|
|
1663
|
+
*
|
|
1664
|
+
* The error data lists the missing capabilities (`requiredCapabilities`) in
|
|
1665
|
+
* the `ClientCapabilities` shape, so the client can see exactly what it would
|
|
1666
|
+
* have to declare for the request to be served. On HTTP, the response status
|
|
1667
|
+
* is `400 Bad Request`.
|
|
1668
|
+
*
|
|
1669
|
+
* Recognize this error by its code and `data.requiredCapabilities`, or by
|
|
1670
|
+
* `instanceof` — checks are brand-matched and work across separately bundled
|
|
1671
|
+
* copies of the SDK.
|
|
1672
|
+
*/
|
|
1673
|
+
declare class MissingRequiredClientCapabilityError extends ProtocolError {
|
|
1674
|
+
constructor(data: MissingRequiredClientCapabilityErrorData, message?: string);
|
|
1675
|
+
/**
|
|
1676
|
+
* The capabilities the server requires from the client to process the
|
|
1677
|
+
* request (only the missing capabilities are listed).
|
|
1678
|
+
*/
|
|
1679
|
+
get requiredCapabilities(): ClientCapabilities;
|
|
1680
|
+
}
|
|
1681
|
+
//#endregion
|
|
1682
|
+
//#region ../core-internal/src/types/guards.d.ts
|
|
1683
|
+
/**
|
|
1684
|
+
* Validates and parses an unknown value as a JSON-RPC message.
|
|
1685
|
+
*
|
|
1686
|
+
* Use this to validate incoming messages in custom transport implementations.
|
|
1687
|
+
* Throws if the value does not conform to the JSON-RPC message schema.
|
|
1688
|
+
*
|
|
1689
|
+
* @param value - The value to validate (typically a parsed JSON object).
|
|
1690
|
+
* @returns The validated {@linkcode JSONRPCMessage}.
|
|
1691
|
+
* @throws If validation fails.
|
|
1692
|
+
*/
|
|
1693
|
+
declare function parseJSONRPCMessage(value: unknown): JSONRPCMessage;
|
|
1694
|
+
declare const isJSONRPCRequest: (value: unknown) => value is JSONRPCRequest;
|
|
1695
|
+
declare const isJSONRPCNotification: (value: unknown) => value is JSONRPCNotification;
|
|
1696
|
+
/**
|
|
1697
|
+
* Checks if a value is a valid {@linkcode JSONRPCResultResponse}.
|
|
1698
|
+
* @param value - The value to check.
|
|
1699
|
+
*
|
|
1700
|
+
* @returns True if the value is a valid {@linkcode JSONRPCResultResponse}, false otherwise.
|
|
1701
|
+
*/
|
|
1702
|
+
declare const isJSONRPCResultResponse: (value: unknown) => value is JSONRPCResultResponse;
|
|
1703
|
+
/**
|
|
1704
|
+
* Checks if a value is a valid {@linkcode JSONRPCErrorResponse}.
|
|
1705
|
+
* @param value - The value to check.
|
|
1706
|
+
*
|
|
1707
|
+
* @returns True if the value is a valid {@linkcode JSONRPCErrorResponse}, false otherwise.
|
|
1708
|
+
*/
|
|
1709
|
+
declare const isJSONRPCErrorResponse: (value: unknown) => value is JSONRPCErrorResponse;
|
|
1710
|
+
/**
|
|
1711
|
+
* Checks if a value is a valid {@linkcode JSONRPCResponse} (either a result or error response).
|
|
1712
|
+
* @param value - The value to check.
|
|
1713
|
+
*
|
|
1714
|
+
* @returns True if the value is a valid {@linkcode JSONRPCResponse}, false otherwise.
|
|
1715
|
+
*/
|
|
1716
|
+
declare const isJSONRPCResponse: (value: unknown) => value is JSONRPCResponse;
|
|
1717
|
+
/**
|
|
1718
|
+
* Checks if a value is a valid {@linkcode CallToolResult}.
|
|
1719
|
+
*
|
|
1720
|
+
* This is a consumer-side VALUE check against the neutral model, not a wire
|
|
1721
|
+
* validator: a raw wire object that additionally carries wire-only members
|
|
1722
|
+
* (e.g. `resultType`) still passes through the loose index signature. Use a
|
|
1723
|
+
* transport-level parse to validate raw wire traffic.
|
|
1724
|
+
*
|
|
1725
|
+
* @param value - The value to check.
|
|
1726
|
+
*
|
|
1727
|
+
* @returns True if the value is a valid {@linkcode CallToolResult}, false otherwise.
|
|
1728
|
+
*/
|
|
1729
|
+
declare const isCallToolResult: (value: unknown) => value is CallToolResult;
|
|
1730
|
+
/**
|
|
1731
|
+
* Checks whether a value is an input-required result (protocol revision
|
|
1732
|
+
* 2026-07-28): the multi-round-trip return shape discriminated by
|
|
1733
|
+
* `resultType: 'input_required'`.
|
|
1734
|
+
*
|
|
1735
|
+
* This is a discriminator check, not a full validator — the at-least-one rule
|
|
1736
|
+
* (`inputRequests` or `requestState`) is enforced by the `inputRequired()`
|
|
1737
|
+
* builder and re-checked by the server seam for hand-built values.
|
|
1738
|
+
*
|
|
1739
|
+
* @param value - The value to check.
|
|
1740
|
+
* @returns True if the value carries the `input_required` discriminator.
|
|
1741
|
+
*/
|
|
1742
|
+
declare const isInputRequiredResult: (value: unknown) => value is InputRequiredResult;
|
|
1743
|
+
/**
|
|
1744
|
+
* Checks if a value is a valid {@linkcode TaskAugmentedRequestParams}.
|
|
1745
|
+
* @param value - The value to check.
|
|
1746
|
+
*
|
|
1747
|
+
* @returns True if the value is a valid {@linkcode TaskAugmentedRequestParams}, false otherwise.
|
|
1748
|
+
*
|
|
1749
|
+
* @deprecated Recognizes 2025-11-25 task wire vocabulary, which has no SDK
|
|
1750
|
+
* runtime; kept importable for interoperability only.
|
|
1751
|
+
*/
|
|
1752
|
+
declare const isTaskAugmentedRequestParams: (value: unknown) => value is TaskAugmentedRequestParams;
|
|
1753
|
+
declare const isInitializeRequest: (value: unknown) => value is InitializeRequest;
|
|
1754
|
+
declare const isInitializedNotification: (value: unknown) => value is InitializedNotification;
|
|
1755
|
+
declare function assertCompleteRequestPrompt(request: CompleteRequest): asserts request is CompleteRequestPrompt;
|
|
1756
|
+
declare function assertCompleteRequestResourceTemplate(request: CompleteRequest): asserts request is CompleteRequestResourceTemplate;
|
|
1757
|
+
//#endregion
|
|
1758
|
+
//#region ../core-internal/src/types/specTypeSchema.d.ts
|
|
1759
|
+
/**
|
|
1760
|
+
* Explicit allowlist of protocol Zod schemas that correspond to a public spec type in `types.ts`.
|
|
1761
|
+
*
|
|
1762
|
+
* This intentionally excludes internal helper schemas exported from `schemas.ts` that have no
|
|
1763
|
+
* matching public type (e.g. `ListChangedOptionsBaseSchema`, `BaseRequestParamsSchema`,
|
|
1764
|
+
* `NotificationsParamsSchema`, `ClientTasksCapabilitySchema`, `ServerTasksCapabilitySchema`).
|
|
1765
|
+
* Keeping the list explicit means new public spec types must be added here deliberately, and
|
|
1766
|
+
* internals never leak into `SpecTypeName`.
|
|
1767
|
+
*
|
|
1768
|
+
* `ResourceTemplateSchema` is included; its public type is exported as `ResourceTemplateType`
|
|
1769
|
+
* (the bare name collides with the server package's `ResourceTemplate` class), so
|
|
1770
|
+
* `SpecTypes['ResourceTemplate']` is structurally equal to `ResourceTemplateType` rather than to
|
|
1771
|
+
* a type literally named `ResourceTemplate`.
|
|
1772
|
+
*/
|
|
1773
|
+
declare const SPEC_SCHEMA_KEYS: readonly ["AnnotationsSchema", "AudioContentSchema", "BaseMetadataSchema", "BlobResourceContentsSchema", "BooleanSchemaSchema", "CallToolRequestSchema", "CallToolRequestParamsSchema", "CallToolResultSchema", "CancelledNotificationSchema", "CancelledNotificationParamsSchema", "CancelTaskRequestSchema", "CancelTaskResultSchema", "ClientCapabilitiesSchema", "ClientNotificationSchema", "ClientRequestSchema", "ClientResultSchema", "CompatibilityCallToolResultSchema", "CompleteRequestSchema", "CompleteRequestParamsSchema", "CompleteResultSchema", "ContentBlockSchema", "CreateMessageRequestSchema", "CreateMessageRequestParamsSchema", "CreateMessageResultSchema", "CreateMessageResultWithToolsSchema", "CreateTaskResultSchema", "CursorSchema", "DiscoverRequestSchema", "DiscoverResultSchema", "ElicitationCompleteNotificationSchema", "ElicitationCompleteNotificationParamsSchema", "ElicitRequestSchema", "ElicitRequestFormParamsSchema", "ElicitRequestParamsSchema", "ElicitRequestURLParamsSchema", "ElicitResultSchema", "EmbeddedResourceSchema", "EmptyResultSchema", "EnumSchemaSchema", "GetPromptRequestSchema", "GetPromptRequestParamsSchema", "GetPromptResultSchema", "GetTaskPayloadRequestSchema", "GetTaskPayloadResultSchema", "GetTaskRequestSchema", "GetTaskResultSchema", "IconSchema", "IconsSchema", "ImageContentSchema", "ImplementationSchema", "InitializedNotificationSchema", "InitializeRequestSchema", "InitializeRequestParamsSchema", "InitializeResultSchema", "JSONArraySchema", "JSONObjectSchema", "JSONRPCErrorResponseSchema", "JSONRPCMessageSchema", "JSONRPCNotificationSchema", "JSONRPCRequestSchema", "JSONRPCResponseSchema", "JSONRPCResultResponseSchema", "JSONValueSchema", "LegacyTitledEnumSchemaSchema", "ListPromptsRequestSchema", "ListPromptsResultSchema", "ListResourcesRequestSchema", "ListResourcesResultSchema", "ListResourceTemplatesRequestSchema", "ListResourceTemplatesResultSchema", "ListRootsRequestSchema", "ListRootsResultSchema", "ListTasksRequestSchema", "ListTasksResultSchema", "ListToolsRequestSchema", "ListToolsResultSchema", "LoggingLevelSchema", "LoggingMessageNotificationSchema", "LoggingMessageNotificationParamsSchema", "ModelHintSchema", "ModelPreferencesSchema", "MultiSelectEnumSchemaSchema", "NotificationSchema", "NumberSchemaSchema", "PaginatedRequestSchema", "PaginatedRequestParamsSchema", "PaginatedResultSchema", "PingRequestSchema", "PrimitiveSchemaDefinitionSchema", "ProgressSchema", "ProgressNotificationSchema", "ProgressNotificationParamsSchema", "ProgressTokenSchema", "PromptSchema", "PromptArgumentSchema", "PromptListChangedNotificationSchema", "PromptMessageSchema", "PromptReferenceSchema", "ReadResourceRequestSchema", "ReadResourceRequestParamsSchema", "ReadResourceResultSchema", "RelatedTaskMetadataSchema", "RequestSchema", "RequestIdSchema", "RequestMetaSchema", "ResourceSchema", "ResourceContentsSchema", "ResourceLinkSchema", "ResourceListChangedNotificationSchema", "ResourceRequestParamsSchema", "ResourceTemplateSchema", "ResourceTemplateReferenceSchema", "ResourceUpdatedNotificationSchema", "ResourceUpdatedNotificationParamsSchema", "ResultMetaObjectSchema", "ResultSchema", "RoleSchema", "RootSchema", "RootsListChangedNotificationSchema", "SamplingContentSchema", "SamplingMessageSchema", "SamplingMessageContentBlockSchema", "ServerCapabilitiesSchema", "ServerNotificationSchema", "ServerRequestSchema", "ServerResultSchema", "SetLevelRequestSchema", "SetLevelRequestParamsSchema", "SingleSelectEnumSchemaSchema", "StringSchemaSchema", "SubscribeRequestSchema", "SubscribeRequestParamsSchema", "SubscriptionFilterSchema", "SubscriptionsAcknowledgedNotificationSchema", "SubscriptionsAcknowledgedNotificationParamsSchema", "SubscriptionsListenRequestSchema", "SubscriptionsListenRequestParamsSchema", "SubscriptionsListenResultSchema", "SubscriptionsListenResultMetaSchema", "TaskAugmentedRequestParamsSchema", "TaskCreationParamsSchema", "TaskMetadataSchema", "TaskSchema", "TaskStatusSchema", "TaskStatusNotificationSchema", "TaskStatusNotificationParamsSchema", "TextContentSchema", "TextResourceContentsSchema", "TitledMultiSelectEnumSchemaSchema", "TitledSingleSelectEnumSchemaSchema", "ToolSchema", "ToolAnnotationsSchema", "ToolChoiceSchema", "ToolExecutionSchema", "ToolListChangedNotificationSchema", "ToolResultContentSchema", "ToolUseContentSchema", "UnsubscribeRequestSchema", "UnsubscribeRequestParamsSchema", "UntitledMultiSelectEnumSchemaSchema", "UntitledSingleSelectEnumSchemaSchema"];
|
|
1774
|
+
declare const authSchemas: {
|
|
1775
|
+
readonly IdJagTokenExchangeResponseSchema: any;
|
|
1776
|
+
readonly OAuthClientInformationFullSchema: any;
|
|
1777
|
+
readonly OAuthClientInformationSchema: any;
|
|
1778
|
+
readonly OAuthClientMetadataSchema: any;
|
|
1779
|
+
readonly OAuthClientRegistrationErrorSchema: any;
|
|
1780
|
+
readonly OAuthErrorResponseSchema: any;
|
|
1781
|
+
readonly OAuthMetadataSchema: any;
|
|
1782
|
+
readonly OAuthProtectedResourceMetadataSchema: any;
|
|
1783
|
+
readonly OAuthTokenRevocationRequestSchema: any;
|
|
1784
|
+
readonly OAuthTokensSchema: any;
|
|
1785
|
+
readonly OpenIdProviderDiscoveryMetadataSchema: any;
|
|
1786
|
+
readonly OpenIdProviderMetadataSchema: any;
|
|
1787
|
+
};
|
|
1788
|
+
type ProtocolSchemaKey = (typeof SPEC_SCHEMA_KEYS)[number];
|
|
1789
|
+
type AuthSchemaKey = keyof typeof authSchemas;
|
|
1790
|
+
type SchemaKey = ProtocolSchemaKey | AuthSchemaKey;
|
|
1791
|
+
type SchemaFor<K$1 extends SchemaKey> = K$1 extends ProtocolSchemaKey ? (typeof schemas_d_exports)[K$1] : K$1 extends AuthSchemaKey ? (typeof authSchemas)[K$1] : never;
|
|
1792
|
+
type StripSchemaSuffix<K$1> = K$1 extends `${infer N}Schema` ? N : never;
|
|
1793
|
+
/**
|
|
1794
|
+
* Union of every named type in the SDK's protocol and OAuth schemas (e.g. `'CallToolResult'`,
|
|
1795
|
+
* `'ContentBlock'`, `'Tool'`, `'OAuthTokens'`). Derived from the internal Zod schemas, so it stays
|
|
1796
|
+
* in sync with the spec.
|
|
1797
|
+
*/
|
|
1798
|
+
type SpecTypeName = StripSchemaSuffix<SchemaKey>;
|
|
1799
|
+
/**
|
|
1800
|
+
* Maps each {@linkcode SpecTypeName} to its TypeScript type.
|
|
1801
|
+
*
|
|
1802
|
+
* `SpecTypes['Tool']` is equivalent to importing the `Tool` type directly.
|
|
1803
|
+
* These validators cover the NEUTRAL model — the consumer-facing shapes with
|
|
1804
|
+
* no wire-only members (`resultType`, the reserved `_meta` envelope keys).
|
|
1805
|
+
* Per-revision WIRE validators are deliberately not public surface; they are
|
|
1806
|
+
* planned to return as versioned `zod-schemas/<revision>` exports for
|
|
1807
|
+
* consumers who validate raw wire traffic themselves.
|
|
1808
|
+
*/
|
|
1809
|
+
type SpecTypes = { [K in SchemaKey as StripSchemaSuffix<K>]: SchemaFor<K> extends z.ZodType ? z.output<SchemaFor<K>> : never };
|
|
1810
|
+
/**
|
|
1811
|
+
* Input shape for each {@linkcode SpecTypeName}. For most types this equals {@linkcode SpecTypes},
|
|
1812
|
+
* but a few schemas apply defaults/preprocessing, so the accepted input may be looser than the
|
|
1813
|
+
* resulting output type.
|
|
1814
|
+
*/
|
|
1815
|
+
type SpecTypeInputs = { [K in SchemaKey as StripSchemaSuffix<K>]: SchemaFor<K> extends z.ZodType ? z.input<SchemaFor<K>> : never };
|
|
1816
|
+
type SchemaRecord = { readonly [K in SpecTypeName]: StandardSchemaV1Sync<SpecTypeInputs[K], SpecTypes[K]> };
|
|
1817
|
+
type GuardRecord = { readonly [K in SpecTypeName]: (value: unknown) => value is SpecTypeInputs[K] };
|
|
1818
|
+
/**
|
|
1819
|
+
* Runtime validators for every MCP spec type, keyed by type name.
|
|
1820
|
+
*
|
|
1821
|
+
* Use this when you need to validate a spec-defined shape at a boundary the SDK does not own, for
|
|
1822
|
+
* example an extension's custom-method payload that embeds a `CallToolResult`, or a value read from
|
|
1823
|
+
* storage that should be a `Tool`.
|
|
1824
|
+
*
|
|
1825
|
+
* Each entry implements the Standard Schema interface, so it composes with any
|
|
1826
|
+
* Standard-Schema-aware library. For a simple boolean check, use {@linkcode isSpecType} instead.
|
|
1827
|
+
*
|
|
1828
|
+
* @example
|
|
1829
|
+
* ```ts source="./specTypeSchema.examples.ts#specTypeSchemas_basicUsage"
|
|
1830
|
+
* const result = specTypeSchemas.CallToolResult['~standard'].validate(untrusted);
|
|
1831
|
+
* if (result.issues === undefined) {
|
|
1832
|
+
* // result.value is CallToolResult
|
|
1833
|
+
* }
|
|
1834
|
+
* ```
|
|
1835
|
+
*/
|
|
1836
|
+
declare const specTypeSchemas: SchemaRecord;
|
|
1837
|
+
/**
|
|
1838
|
+
* Type predicates for every MCP spec type, keyed by type name.
|
|
1839
|
+
*
|
|
1840
|
+
* Returns `true` if the value satisfies the schema's input type (`z.input<>`, before defaults and
|
|
1841
|
+
* transforms are applied), and narrows to that input type. For schemas with `.default()` or
|
|
1842
|
+
* `.preprocess()`, this may accept values that do not structurally match the named output type;
|
|
1843
|
+
* for example `isSpecType.CallToolResult({})` is `true` because `content` has a default. Use
|
|
1844
|
+
* `specTypeSchemas.X['~standard'].validate(value)` when you need the validated output value.
|
|
1845
|
+
*
|
|
1846
|
+
* Each guard is a standalone function, so it can be passed directly as a callback.
|
|
1847
|
+
*
|
|
1848
|
+
* @example
|
|
1849
|
+
* ```ts source="./specTypeSchema.examples.ts#isSpecType_basicUsage"
|
|
1850
|
+
* if (isSpecType.ContentBlock(value)) {
|
|
1851
|
+
* // value is ContentBlock
|
|
1852
|
+
* }
|
|
1853
|
+
*
|
|
1854
|
+
* const blocks = mixed.filter(isSpecType.ContentBlock);
|
|
1855
|
+
* ```
|
|
1856
|
+
*/
|
|
1857
|
+
declare const isSpecType: GuardRecord;
|
|
1858
|
+
//#endregion
|
|
1859
|
+
//#region ../core-internal/src/shared/transport.d.ts
|
|
1860
|
+
type FetchLike = (url: string | URL, init?: RequestInit) => Promise<Response>;
|
|
1861
|
+
/**
|
|
1862
|
+
* Creates a fetch function that includes base `RequestInit` options.
|
|
1863
|
+
* This ensures requests inherit settings like credentials, mode, headers, etc. from the base init.
|
|
1864
|
+
*
|
|
1865
|
+
* @param baseFetch - The base fetch function to wrap (defaults to global `fetch`)
|
|
1866
|
+
* @param baseInit - The base `RequestInit` to merge with each request
|
|
1867
|
+
* @returns A wrapped fetch function that merges base options with call-specific options
|
|
1868
|
+
*/
|
|
1869
|
+
declare function createFetchWithInit(baseFetch?: FetchLike, baseInit?: RequestInit): FetchLike;
|
|
1870
|
+
/**
|
|
1871
|
+
* Options for sending a JSON-RPC message.
|
|
1872
|
+
*/
|
|
1873
|
+
type TransportSendOptions = {
|
|
1874
|
+
/**
|
|
1875
|
+
* If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with.
|
|
1876
|
+
*/
|
|
1877
|
+
relatedRequestId?: RequestId | undefined;
|
|
1878
|
+
/**
|
|
1879
|
+
* The resumption token used to continue long-running requests that were interrupted.
|
|
1880
|
+
*
|
|
1881
|
+
* This allows clients to reconnect and continue from where they left off, if supported by the transport.
|
|
1882
|
+
*/
|
|
1883
|
+
resumptionToken?: string | undefined;
|
|
1884
|
+
/**
|
|
1885
|
+
* A callback that is invoked when the resumption token changes, if supported by the transport.
|
|
1886
|
+
*
|
|
1887
|
+
* This allows clients to persist the latest token for potential reconnection.
|
|
1888
|
+
*/
|
|
1889
|
+
onresumptiontoken?: ((token: string) => void) | undefined;
|
|
1890
|
+
/**
|
|
1891
|
+
* An abort signal for THIS outbound message's underlying request, when the
|
|
1892
|
+
* transport sends one outbound message per underlying request (the
|
|
1893
|
+
* Streamable HTTP transport's POST-per-request model). Aborting it cancels
|
|
1894
|
+
* the underlying request (and its SSE response stream) without closing the
|
|
1895
|
+
* transport. Transports that share a single channel (stdio, in-memory)
|
|
1896
|
+
* ignore it.
|
|
1897
|
+
*/
|
|
1898
|
+
requestSignal?: AbortSignal | undefined;
|
|
1899
|
+
/**
|
|
1900
|
+
* Fired by transports that open a per-request stream (the Streamable HTTP
|
|
1901
|
+
* transport's POST-per-request SSE response) when that stream ends or
|
|
1902
|
+
* errors for any reason OTHER than a deliberate `requestSignal` abort —
|
|
1903
|
+
* i.e. the server closed the stream, the network dropped it, or
|
|
1904
|
+
* reconnection was exhausted. Transports that share a single channel
|
|
1905
|
+
* (stdio, in-memory) ignore it.
|
|
1906
|
+
*/
|
|
1907
|
+
onRequestStreamEnd?: (() => void) | undefined;
|
|
1908
|
+
/**
|
|
1909
|
+
* Additional HTTP headers to send with THIS outbound message, when the
|
|
1910
|
+
* transport sends one outbound message per underlying HTTP request (the
|
|
1911
|
+
* Streamable HTTP transport's POST-per-request model). Transports that
|
|
1912
|
+
* share a single channel (stdio, in-memory) ignore it.
|
|
1913
|
+
*
|
|
1914
|
+
* The Client uses this to attach SEP-2243 `Mcp-Param-{Name}` headers to a
|
|
1915
|
+
* `tools/call` request on a 2026-07-28 connection. Values are sent
|
|
1916
|
+
* verbatim — encode anything that is not a safe RFC 9110 field value
|
|
1917
|
+
* before passing it here.
|
|
1918
|
+
*/
|
|
1919
|
+
headers?: Readonly<Record<string, string>> | undefined;
|
|
1920
|
+
};
|
|
1921
|
+
/**
|
|
1922
|
+
* Describes the minimal contract for an MCP transport that a client or server can communicate over.
|
|
1923
|
+
*/
|
|
1924
|
+
interface Transport {
|
|
1925
|
+
/**
|
|
1926
|
+
* Starts processing messages on the transport, including any connection steps that might need to be taken.
|
|
1927
|
+
*
|
|
1928
|
+
* This method should only be called after callbacks are installed, or else messages may be lost.
|
|
1929
|
+
*
|
|
1930
|
+
* NOTE: This method should not be called explicitly when using {@linkcode @modelcontextprotocol/client!client/client.Client | Client} or {@linkcode @modelcontextprotocol/server!server/server.Server | Server} classes, as they will implicitly call {@linkcode Transport.start | start()}.
|
|
1931
|
+
*/
|
|
1932
|
+
start(): Promise<void>;
|
|
1933
|
+
/**
|
|
1934
|
+
* Sends a JSON-RPC message (request or response).
|
|
1935
|
+
*
|
|
1936
|
+
* If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with.
|
|
1937
|
+
*/
|
|
1938
|
+
send(message: JSONRPCMessage, options?: TransportSendOptions): Promise<void>;
|
|
1939
|
+
/**
|
|
1940
|
+
* Closes the connection.
|
|
1941
|
+
*/
|
|
1942
|
+
close(): Promise<void>;
|
|
1943
|
+
/**
|
|
1944
|
+
* `true` when this transport opens one underlying request per outbound
|
|
1945
|
+
* JSON-RPC request (the Streamable HTTP POST-per-request model) and
|
|
1946
|
+
* therefore honors {@linkcode TransportSendOptions.requestSignal}. The
|
|
1947
|
+
* 2026-07-28 spec makes closing that per-request stream the cancellation
|
|
1948
|
+
* signal — the protocol layer aborts `requestSignal` instead of POSTing
|
|
1949
|
+
* `notifications/cancelled` when this flag is set on a 2026-era
|
|
1950
|
+
* connection. Transports that share a single channel (stdio, in-memory)
|
|
1951
|
+
* leave it `undefined`.
|
|
1952
|
+
*/
|
|
1953
|
+
readonly hasPerRequestStream?: boolean;
|
|
1954
|
+
/**
|
|
1955
|
+
* Callback for when the connection is closed for any reason.
|
|
1956
|
+
*
|
|
1957
|
+
* This should be invoked when {@linkcode Transport.close | close()} is called as well.
|
|
1958
|
+
*/
|
|
1959
|
+
onclose?: (() => void) | undefined;
|
|
1960
|
+
/**
|
|
1961
|
+
* Callback for when an error occurs.
|
|
1962
|
+
*
|
|
1963
|
+
* Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
|
|
1964
|
+
*/
|
|
1965
|
+
onerror?: ((error: Error) => void) | undefined;
|
|
1966
|
+
/**
|
|
1967
|
+
* Callback for when a message (request or response) is received over the connection.
|
|
1968
|
+
*
|
|
1969
|
+
* Includes the {@linkcode MessageExtraInfo.request | request} and {@linkcode MessageExtraInfo.authInfo | authInfo} if the transport is authenticated.
|
|
1970
|
+
*
|
|
1971
|
+
* The {@linkcode MessageExtraInfo.request | request} can be used to get the original request information (headers, etc.)
|
|
1972
|
+
*/
|
|
1973
|
+
onmessage?: (<T$1 extends JSONRPCMessage>(message: T$1, extra?: MessageExtraInfo) => void) | undefined;
|
|
1974
|
+
/**
|
|
1975
|
+
* The session ID generated for this connection.
|
|
1976
|
+
*/
|
|
1977
|
+
sessionId?: string | undefined;
|
|
1978
|
+
/**
|
|
1979
|
+
* Sets the protocol version used for the connection (called when the initialize response is received).
|
|
1980
|
+
*/
|
|
1981
|
+
setProtocolVersion?: ((version: string) => void) | undefined;
|
|
1982
|
+
/**
|
|
1983
|
+
* Sets the supported protocol versions for header validation (called during connect).
|
|
1984
|
+
* This allows the server to pass its supported versions to the transport.
|
|
1985
|
+
*/
|
|
1986
|
+
setSupportedProtocolVersions?: ((versions: string[]) => void) | undefined;
|
|
1987
|
+
}
|
|
1988
|
+
//#endregion
|
|
1989
|
+
//#region ../core-internal/src/shared/protocol.d.ts
|
|
1990
|
+
/**
|
|
1991
|
+
* Callback for progress notifications.
|
|
1992
|
+
*/
|
|
1993
|
+
type ProgressCallback = (progress: Progress) => void;
|
|
1994
|
+
/**
|
|
1995
|
+
* Additional initialization options.
|
|
1996
|
+
*/
|
|
1997
|
+
type ProtocolOptions = {
|
|
1998
|
+
/**
|
|
1999
|
+
* Protocol versions supported. The legacy `initialize` handshake offers and
|
|
2000
|
+
* falls back to the first 2025-era entry in the list (the client sends it,
|
|
2001
|
+
* the server counter-offers it); 2026-era entries are only ever selected via
|
|
2002
|
+
* `server/discover`. Passed to transport during {@linkcode Protocol.connect | connect()}.
|
|
2003
|
+
*
|
|
2004
|
+
* @default {@linkcode SUPPORTED_PROTOCOL_VERSIONS}
|
|
2005
|
+
*/
|
|
2006
|
+
supportedProtocolVersions?: string[];
|
|
2007
|
+
/**
|
|
2008
|
+
* Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities.
|
|
2009
|
+
*
|
|
2010
|
+
* Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those.
|
|
2011
|
+
*
|
|
2012
|
+
* Currently this defaults to `false`, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to `true`.
|
|
2013
|
+
*/
|
|
2014
|
+
enforceStrictCapabilities?: boolean;
|
|
2015
|
+
/**
|
|
2016
|
+
* An array of notification method names that should be automatically debounced.
|
|
2017
|
+
* Any notifications with a method in this list will be coalesced if they
|
|
2018
|
+
* occur in the same tick of the event loop.
|
|
2019
|
+
* e.g., `['notifications/tools/list_changed']`
|
|
2020
|
+
*/
|
|
2021
|
+
debouncedNotificationMethods?: string[];
|
|
2022
|
+
};
|
|
2023
|
+
/**
|
|
2024
|
+
* The default request timeout, in milliseconds.
|
|
2025
|
+
*/
|
|
2026
|
+
declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
|
|
2027
|
+
/**
|
|
2028
|
+
* Options that can be given per request.
|
|
2029
|
+
*/
|
|
2030
|
+
type RequestOptions = {
|
|
2031
|
+
/**
|
|
2032
|
+
* If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked.
|
|
2033
|
+
*/
|
|
2034
|
+
onprogress?: ProgressCallback;
|
|
2035
|
+
/**
|
|
2036
|
+
* Can be used to cancel an in-flight request. This will cause an `AbortError` to be raised from {@linkcode Protocol.request | request()}.
|
|
2037
|
+
*/
|
|
2038
|
+
signal?: AbortSignal;
|
|
2039
|
+
/**
|
|
2040
|
+
* A timeout (in milliseconds) for this request. If exceeded, an {@linkcode SdkError} with code {@linkcode SdkErrorCode.RequestTimeout} will be raised from {@linkcode Protocol.request | request()}.
|
|
2041
|
+
*
|
|
2042
|
+
* If not specified, {@linkcode DEFAULT_REQUEST_TIMEOUT_MSEC} will be used as the timeout.
|
|
2043
|
+
*/
|
|
2044
|
+
timeout?: number;
|
|
2045
|
+
/**
|
|
2046
|
+
* If `true`, receiving a progress notification will reset the request timeout.
|
|
2047
|
+
* This is useful for long-running operations that send periodic progress updates.
|
|
2048
|
+
* Default: `false`
|
|
2049
|
+
*/
|
|
2050
|
+
resetTimeoutOnProgress?: boolean;
|
|
2051
|
+
/**
|
|
2052
|
+
* Maximum total time (in milliseconds) to wait for a response.
|
|
2053
|
+
* If exceeded, an {@linkcode SdkError} with code {@linkcode SdkErrorCode.RequestTimeout} will be raised, regardless of progress notifications.
|
|
2054
|
+
* If not specified, there is no maximum total timeout.
|
|
2055
|
+
*
|
|
2056
|
+
* For multi-round-trip requests fulfilled by the auto-fulfilment driver
|
|
2057
|
+
* (protocol revision 2026-07-28), the budget bounds the WHOLE flow: every
|
|
2058
|
+
* retry leg is given only the time remaining.
|
|
2059
|
+
*/
|
|
2060
|
+
maxTotalTimeout?: number;
|
|
2061
|
+
/**
|
|
2062
|
+
* Manual multi-round-trip mode for this call (protocol revision
|
|
2063
|
+
* 2026-07-28): when the response is an `input_required` result, hand it
|
|
2064
|
+
* back to the caller instead of auto-fulfilling it (or raising a typed
|
|
2065
|
+
* error). The resolved value is the neutral input-required shape
|
|
2066
|
+
* (`resultType: 'input_required'`, `inputRequests?`, `requestState?`);
|
|
2067
|
+
* wrap the result schema with `withInputRequired()` on the explicit
|
|
2068
|
+
* schema path to type both outcomes. The caller is then responsible for
|
|
2069
|
+
* gathering the requested input and retrying the original request with
|
|
2070
|
+
* `inputResponses` / `requestState` params and a fresh request.
|
|
2071
|
+
*
|
|
2072
|
+
* Default: `false`.
|
|
2073
|
+
*/
|
|
2074
|
+
allowInputRequired?: boolean;
|
|
2075
|
+
} & TransportSendOptions;
|
|
2076
|
+
/**
|
|
2077
|
+
* Flow context handed to {@linkcode Protocol._resolveNonCompleteResult}: the
|
|
2078
|
+
* originating request, its options, the wire codec that decoded the response,
|
|
2079
|
+
* the timestamp the originating leg was issued at (for whole-flow timeout
|
|
2080
|
+
* accounting), and a `retry` closure that re-enters the request funnel with
|
|
2081
|
+
* fresh params on a fresh request id.
|
|
2082
|
+
*/
|
|
2083
|
+
interface NonCompleteResultFlow<T$1 extends StandardSchemaV1 = StandardSchemaV1> {
|
|
2084
|
+
codec: WireCodec;
|
|
2085
|
+
request: Request;
|
|
2086
|
+
resultSchema: T$1;
|
|
2087
|
+
options: RequestOptions | undefined;
|
|
2088
|
+
flowStartedAt: number;
|
|
2089
|
+
/** Re-issue the originating request with the given params and per-leg options. */
|
|
2090
|
+
retry(params: Record<string, unknown> | undefined, legOptions: RequestOptions): Promise<unknown>;
|
|
2091
|
+
}
|
|
2092
|
+
/**
|
|
2093
|
+
* Options that can be given per notification.
|
|
2094
|
+
*/
|
|
2095
|
+
type NotificationOptions = {
|
|
2096
|
+
/**
|
|
2097
|
+
* May be used to indicate to the transport which incoming request to associate this outgoing notification with.
|
|
2098
|
+
*/
|
|
2099
|
+
relatedRequestId?: RequestId;
|
|
2100
|
+
};
|
|
2101
|
+
/**
|
|
2102
|
+
* The type of `ctx.mcpReq.requestState`. The type parameter is
|
|
2103
|
+
* caller-asserted (no validation, like the two-argument `acceptedContent<T>`)
|
|
2104
|
+
* — pair with `createRequestStateCodec<T>` so the claim is backed by the
|
|
2105
|
+
* codec's verification.
|
|
2106
|
+
*/
|
|
2107
|
+
type RequestStateAccessor = <T$1 = unknown>() => T$1 | undefined;
|
|
2108
|
+
/**
|
|
2109
|
+
* Base context provided to all request handlers.
|
|
2110
|
+
*/
|
|
2111
|
+
type BaseContext = {
|
|
2112
|
+
/**
|
|
2113
|
+
* The session ID from the transport, if available.
|
|
2114
|
+
*/
|
|
2115
|
+
sessionId?: string;
|
|
2116
|
+
/**
|
|
2117
|
+
* Information about the MCP request being handled.
|
|
2118
|
+
*/
|
|
2119
|
+
mcpReq: {
|
|
2120
|
+
/**
|
|
2121
|
+
* The JSON-RPC ID of the request being handled.
|
|
2122
|
+
*/
|
|
2123
|
+
id: RequestId;
|
|
2124
|
+
/**
|
|
2125
|
+
* The method name of the request (e.g., 'tools/call', 'ping').
|
|
2126
|
+
*/
|
|
2127
|
+
method: string;
|
|
2128
|
+
/**
|
|
2129
|
+
* Metadata from the original request, with the reserved
|
|
2130
|
+
* `io.modelcontextprotocol/*` envelope keys already lifted out
|
|
2131
|
+
* (readable via `ctx.mcpReq.envelope`).
|
|
2132
|
+
*/
|
|
2133
|
+
_meta?: RequestMeta;
|
|
2134
|
+
/**
|
|
2135
|
+
* The per-request `_meta` envelope (protocol revision 2026-07-28):
|
|
2136
|
+
* the reserved `io.modelcontextprotocol/*` keys carried by the
|
|
2137
|
+
* request, lifted out of the `_meta` the handler sees. Surfaced as
|
|
2138
|
+
* received — `Partial` because only the keys the request actually
|
|
2139
|
+
* carried are present (envelope requiredness is enforced per request
|
|
2140
|
+
* at dispatch time, not by the lift); only present at all when the
|
|
2141
|
+
* request carried envelope keys.
|
|
2142
|
+
*/
|
|
2143
|
+
envelope?: Partial<RequestMetaEnvelope>;
|
|
2144
|
+
/**
|
|
2145
|
+
* Multi-round-trip input responses carried by a retried request
|
|
2146
|
+
* (protocol revision 2026-07-28), lifted out of the params the
|
|
2147
|
+
* handler sees. Entries are the BARE response objects keyed by the
|
|
2148
|
+
* identifiers the server assigned in `inputRequests`; entries that do
|
|
2149
|
+
* not look like bare responses (e.g. a `{method, result}` wrapper)
|
|
2150
|
+
* are dropped and their keys recorded in `droppedInputResponseKeys`.
|
|
2151
|
+
*
|
|
2152
|
+
* The values arrive from the client and are NOT validated by the SDK
|
|
2153
|
+
* — treat them as untrusted input.
|
|
2154
|
+
*/
|
|
2155
|
+
inputResponses?: Record<string, unknown>;
|
|
2156
|
+
/**
|
|
2157
|
+
* Keys of `inputResponses` entries the SDK dropped because they were
|
|
2158
|
+
* not bare response objects (for example the wrapped `{method,
|
|
2159
|
+
* result}` shape some peers emit). Surfaced so a handler can re-issue
|
|
2160
|
+
* the corresponding input request rather than hard-fail.
|
|
2161
|
+
*/
|
|
2162
|
+
droppedInputResponseKeys?: string[];
|
|
2163
|
+
/**
|
|
2164
|
+
* Reads the multi-round-trip request state for the current round:
|
|
2165
|
+
* the value the configured `ServerOptions.requestState.verify` hook
|
|
2166
|
+
* resolved with (e.g. `createRequestStateCodec.verify`'s decoded
|
|
2167
|
+
* payload — `mint<T>`/`requestState<T>()` are the typed pair), the
|
|
2168
|
+
* raw wire string when no hook is configured, or `undefined` when
|
|
2169
|
+
* the round carried no state. The type parameter is a compile-time
|
|
2170
|
+
* cast only.
|
|
2171
|
+
*
|
|
2172
|
+
* SECURITY: `requestState` round-trips through the client and MUST
|
|
2173
|
+
* be treated as attacker-controlled input. The SDK applies no
|
|
2174
|
+
* integrity protection by default — servers whose state influences
|
|
2175
|
+
* authorization or business logic MUST integrity-protect it and
|
|
2176
|
+
* verify via the `requestState.verify` hook (spec:
|
|
2177
|
+
* basic/patterns/mrtr, server requirements 4–5).
|
|
2178
|
+
*/
|
|
2179
|
+
requestState: RequestStateAccessor;
|
|
2180
|
+
/**
|
|
2181
|
+
* An abort signal used to communicate if the request was cancelled from the sender's side.
|
|
2182
|
+
*/
|
|
2183
|
+
signal: AbortSignal;
|
|
2184
|
+
/**
|
|
2185
|
+
* Sends a request that relates to the current request being handled.
|
|
2186
|
+
*
|
|
2187
|
+
* This is used by certain transports to correctly associate related messages.
|
|
2188
|
+
*
|
|
2189
|
+
* For spec methods the result type is inferred from the method name.
|
|
2190
|
+
* For custom (non-spec) methods, pass a result schema as the second argument.
|
|
2191
|
+
*/
|
|
2192
|
+
send: {
|
|
2193
|
+
<M$1 extends RequestMethod>(request: {
|
|
2194
|
+
method: M$1;
|
|
2195
|
+
params?: Record<string, unknown>;
|
|
2196
|
+
}, options?: RequestOptions): Promise<ResultTypeMap[M$1]>;
|
|
2197
|
+
<T$1 extends StandardSchemaV1>(request: Request, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
|
|
2198
|
+
};
|
|
2199
|
+
/**
|
|
2200
|
+
* Sends a notification that relates to the current request being handled.
|
|
2201
|
+
*
|
|
2202
|
+
* This is used by certain transports to correctly associate related messages.
|
|
2203
|
+
*/
|
|
2204
|
+
notify: (notification: Notification) => Promise<void>;
|
|
2205
|
+
};
|
|
2206
|
+
/**
|
|
2207
|
+
* HTTP transport information, only available when using an HTTP-based transport.
|
|
2208
|
+
*/
|
|
2209
|
+
http?: {
|
|
2210
|
+
/**
|
|
2211
|
+
* Information about a validated access token, provided to request handlers.
|
|
2212
|
+
*/
|
|
2213
|
+
authInfo?: AuthInfo;
|
|
2214
|
+
};
|
|
2215
|
+
};
|
|
2216
|
+
/**
|
|
2217
|
+
* Context provided to server-side request handlers, extending {@linkcode BaseContext} with server-specific fields.
|
|
2218
|
+
*/
|
|
2219
|
+
type ServerContext = BaseContext & {
|
|
2220
|
+
mcpReq: {
|
|
2221
|
+
/**
|
|
2222
|
+
* Send a log message notification to the client.
|
|
2223
|
+
* Respects the client's log level filter set via logging/setLevel.
|
|
2224
|
+
*
|
|
2225
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
2226
|
+
* Remains functional during the deprecation window (at least twelve months).
|
|
2227
|
+
* Migrate to stderr logging (STDIO servers) or OpenTelemetry.
|
|
2228
|
+
*/
|
|
2229
|
+
log: (level: LoggingLevel, data: unknown, logger?: string) => Promise<void>;
|
|
2230
|
+
/**
|
|
2231
|
+
* Send an elicitation request to the client, requesting user input.
|
|
2232
|
+
*
|
|
2233
|
+
* @deprecated Throws on a 2026-07-28-era request — return `inputRequired(...)`
|
|
2234
|
+
* (multi-round-trip) from the handler instead. The 2025 push-style server-to-client request model is
|
|
2235
|
+
* replaced by input_required results in the 2026-07-28 protocol. If your factory serves
|
|
2236
|
+
* both eras, this only works on the legacy path.
|
|
2237
|
+
*/
|
|
2238
|
+
elicitInput: (params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions) => Promise<ElicitResult>;
|
|
2239
|
+
/**
|
|
2240
|
+
* Request LLM sampling from the client.
|
|
2241
|
+
*
|
|
2242
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
2243
|
+
* Throws on a 2026-07-28-era request — return `inputRequired(...)` (multi-round-trip)
|
|
2244
|
+
* from the handler instead, or migrate to calling LLM provider APIs directly. The 2025 push-style
|
|
2245
|
+
* server-to-client request model is replaced by input_required results in the 2026-07-28
|
|
2246
|
+
* protocol. If your factory serves both eras, this only works on the legacy path.
|
|
2247
|
+
*/
|
|
2248
|
+
requestSampling: (params: CreateMessageRequest['params'], options?: RequestOptions) => Promise<CreateMessageResult | CreateMessageResultWithTools>;
|
|
2249
|
+
};
|
|
2250
|
+
http?: {
|
|
2251
|
+
/**
|
|
2252
|
+
* The original HTTP request.
|
|
2253
|
+
*/
|
|
2254
|
+
req?: globalThis.Request;
|
|
2255
|
+
/**
|
|
2256
|
+
* Closes the SSE stream for this request, triggering client reconnection.
|
|
2257
|
+
* Only available when using a StreamableHTTPServerTransport with eventStore configured.
|
|
2258
|
+
*/
|
|
2259
|
+
closeSSE?: () => void;
|
|
2260
|
+
/**
|
|
2261
|
+
* Closes the standalone GET SSE stream, triggering client reconnection.
|
|
2262
|
+
* Only available when using a StreamableHTTPServerTransport with eventStore configured.
|
|
2263
|
+
*/
|
|
2264
|
+
closeStandaloneSSE?: () => void;
|
|
2265
|
+
};
|
|
2266
|
+
};
|
|
2267
|
+
/**
|
|
2268
|
+
* Context provided to client-side request handlers.
|
|
2269
|
+
*/
|
|
2270
|
+
type ClientContext = BaseContext;
|
|
2271
|
+
/**
|
|
2272
|
+
* Implements MCP protocol framing on top of a pluggable transport, including
|
|
2273
|
+
* features like request/response linking, notifications, and progress.
|
|
2274
|
+
*
|
|
2275
|
+
* `Protocol` is abstract; `Client` and `Server` are the concrete role-specific
|
|
2276
|
+
* implementations most code should use.
|
|
2277
|
+
*/
|
|
2278
|
+
declare abstract class Protocol<ContextT extends BaseContext> {
|
|
2279
|
+
private _options?;
|
|
2280
|
+
private _transport?;
|
|
2281
|
+
private _requestMessageId;
|
|
2282
|
+
private _requestHandlers;
|
|
2283
|
+
/** Methods registered with an explicit schema; the era gate in `_onrequest` reads it for the Tasks extension names. */
|
|
2284
|
+
private _customSchemaRequestMethods;
|
|
2285
|
+
private _requestHandlerAbortControllers;
|
|
2286
|
+
private _notificationHandlers;
|
|
2287
|
+
private _responseHandlers;
|
|
2288
|
+
private _progressHandlers;
|
|
2289
|
+
private _timeoutInfo;
|
|
2290
|
+
private _pendingDebouncedNotifications;
|
|
2291
|
+
/**
|
|
2292
|
+
* The protocol version negotiated for the current connection (`undefined`
|
|
2293
|
+
* before negotiation completes), which determines the wire era this
|
|
2294
|
+
* instance speaks. Set by the SDK's negotiation and initialize paths
|
|
2295
|
+
* (`Client.connect`, `Server._oninitialize`).
|
|
2296
|
+
*/
|
|
2297
|
+
protected _negotiatedProtocolVersion?: string;
|
|
2298
|
+
protected _supportedProtocolVersions: string[];
|
|
2299
|
+
/**
|
|
2300
|
+
* Callback for when the connection is closed for any reason.
|
|
2301
|
+
*
|
|
2302
|
+
* This is invoked when {@linkcode Protocol.close | close()} is called as well.
|
|
2303
|
+
*/
|
|
2304
|
+
onclose?: () => void;
|
|
2305
|
+
/**
|
|
2306
|
+
* Callback for when an error occurs.
|
|
2307
|
+
*
|
|
2308
|
+
* Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
|
|
2309
|
+
*/
|
|
2310
|
+
onerror?: (error: Error) => void;
|
|
2311
|
+
/**
|
|
2312
|
+
* A handler to invoke for any request types that do not have their own handler installed.
|
|
2313
|
+
*/
|
|
2314
|
+
fallbackRequestHandler?: (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>;
|
|
2315
|
+
/**
|
|
2316
|
+
* A handler to invoke for any notification types that do not have their own handler installed.
|
|
2317
|
+
*/
|
|
2318
|
+
fallbackNotificationHandler?: (notification: Notification) => Promise<void>;
|
|
2319
|
+
constructor(_options?: ProtocolOptions | undefined);
|
|
2320
|
+
/**
|
|
2321
|
+
* Builds the context object for request handlers. Subclasses must override
|
|
2322
|
+
* to return the appropriate context type (e.g., ServerContext adds HTTP request info).
|
|
2323
|
+
*/
|
|
2324
|
+
protected abstract buildContext(ctx: BaseContext, transportInfo?: MessageExtraInfo): ContextT;
|
|
2325
|
+
/**
|
|
2326
|
+
* Drop consult for inbound messages whose transport did not classify them
|
|
2327
|
+
* at the edge — long-lived channels such as stdio, where a role class may
|
|
2328
|
+
* need to decline traffic the negotiated era has no answer for (the
|
|
2329
|
+
* client-side inbound-request drop on modern-era connections: the
|
|
2330
|
+
* 2026-07-28 era has no server→client request channel, and on stdio the
|
|
2331
|
+
* client must never write JSON-RPC responses).
|
|
2332
|
+
*
|
|
2333
|
+
* Consulted ONLY when the transport supplied no
|
|
2334
|
+
* {@linkcode MessageExtraInfo.classification}: edge-classified traffic
|
|
2335
|
+
* never reaches the hook. Returning `'drop'` discards the message without
|
|
2336
|
+
* writing any response (requests are surfaced via `onerror`). The base
|
|
2337
|
+
* implementation returns `undefined`: unclassified traffic keeps today's
|
|
2338
|
+
* dispatch path unchanged. Era selection never happens here — era is
|
|
2339
|
+
* instance state, owned by the serving entry that constructed and
|
|
2340
|
+
* connected the instance.
|
|
2341
|
+
*/
|
|
2342
|
+
protected _shouldDropInbound(_message: JSONRPCRequest | JSONRPCNotification): 'drop' | undefined;
|
|
2343
|
+
/**
|
|
2344
|
+
* The per-request `_meta` envelope this instance attaches to every outgoing
|
|
2345
|
+
* request and notification, when one applies. The base implementation
|
|
2346
|
+
* returns `undefined` (no envelope — the 2025-era posture, so legacy-era
|
|
2347
|
+
* outbound traffic is byte-identical to a build without this seam).
|
|
2348
|
+
* `Client` overrides it on a connection that negotiated a modern (2026-07-28+)
|
|
2349
|
+
* era to return the reserved protocol-version / client-info /
|
|
2350
|
+
* client-capabilities keys. User-supplied `_meta` keys take precedence over
|
|
2351
|
+
* the auto-attached ones.
|
|
2352
|
+
*/
|
|
2353
|
+
protected _outboundMetaEnvelope(): Readonly<Record<string, unknown>> | undefined;
|
|
2354
|
+
/**
|
|
2355
|
+
* Attach this instance's outbound `_meta` envelope (when one is configured)
|
|
2356
|
+
* to a request or notification. A no-op when the seam returns `undefined`
|
|
2357
|
+
* — the message returns by reference, so the legacy-era wire stays
|
|
2358
|
+
* byte-identical. User-supplied `_meta` keys are spread last so they win
|
|
2359
|
+
* over the auto-attached envelope keys.
|
|
2360
|
+
*/
|
|
2361
|
+
private _envelopeOutbound;
|
|
2362
|
+
/**
|
|
2363
|
+
* Extension point for non-`complete` decoded results in the response
|
|
2364
|
+
* funnel: a result the wire codec discriminated into a kind other than
|
|
2365
|
+
* `'complete'` or `'invalid'` is handed here for the role class to
|
|
2366
|
+
* resolve. The base default surfaces it as a typed
|
|
2367
|
+
* {@linkcode SdkErrorCode.UnsupportedResultType} error (no retry).
|
|
2368
|
+
*
|
|
2369
|
+
* Intended consumers (named so the seam stays accountable):
|
|
2370
|
+
* - the `Client`'s multi-round-trip auto-fulfilment engine, which fulfils
|
|
2371
|
+
* `'input_required'` results through the registered
|
|
2372
|
+
* elicitation/sampling/roots handlers and retries via `flow.retry`;
|
|
2373
|
+
* - a future client-side terminal-result handler for
|
|
2374
|
+
* `subscriptions/listen`, when the spec defines one.
|
|
2375
|
+
*
|
|
2376
|
+
* `Server` instances never receive `input_required` responses on their
|
|
2377
|
+
* outbound legs and leave the base behavior in place.
|
|
2378
|
+
*/
|
|
2379
|
+
protected _resolveNonCompleteResult<T$1 extends StandardSchemaV1>(decoded: ReturnType<WireCodec['decodeResult']> & {
|
|
2380
|
+
kind: 'input_required';
|
|
2381
|
+
}, flow: NonCompleteResultFlow<T$1>): Promise<unknown>;
|
|
2382
|
+
/**
|
|
2383
|
+
* Protected accessor for a registered request handler. Used by role
|
|
2384
|
+
* classes that dispatch synthesized requests through the same stored
|
|
2385
|
+
* handler chain (e.g. the `Client` fulfilling an embedded multi-round-trip
|
|
2386
|
+
* input request).
|
|
2387
|
+
*/
|
|
2388
|
+
protected _getRequestHandler(method: string): ((request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>) | undefined;
|
|
2389
|
+
private _oncancel;
|
|
2390
|
+
private _setupTimeout;
|
|
2391
|
+
private _resetTimeout;
|
|
2392
|
+
private _cleanupTimeout;
|
|
2393
|
+
/**
|
|
2394
|
+
* Attaches to the given transport, starts it, and starts listening for messages.
|
|
2395
|
+
*
|
|
2396
|
+
* The caller assumes ownership of the {@linkcode Transport}, replacing any callbacks that have already been set, and expects that it is the only user of the {@linkcode Transport} instance going forward.
|
|
2397
|
+
*/
|
|
2398
|
+
connect(transport: Transport): Promise<void>;
|
|
2399
|
+
/**
|
|
2400
|
+
* Transport-close hook. Subclass overrides MUST call `super._onclose()`
|
|
2401
|
+
* after their own cleanup — base teardown (response-handler settlement,
|
|
2402
|
+
* timeout clearing, in-flight request abort) does not run otherwise.
|
|
2403
|
+
*/
|
|
2404
|
+
protected _onclose(): void;
|
|
2405
|
+
private _onerror;
|
|
2406
|
+
/**
|
|
2407
|
+
* Inbound-notification dispatch. Subclass overrides MUST delegate
|
|
2408
|
+
* unmatched traffic to `super._onnotification(rawNotification, extra)` —
|
|
2409
|
+
* an override that consumes only what it owns and falls through to base
|
|
2410
|
+
* dispatch for everything else.
|
|
2411
|
+
*/
|
|
2412
|
+
protected _onnotification(rawNotification: JSONRPCNotification, extra?: MessageExtraInfo): void;
|
|
2413
|
+
private _onrequest;
|
|
2414
|
+
private _onprogress;
|
|
2415
|
+
/**
|
|
2416
|
+
* Inbound-response dispatch. Subclass overrides MUST delegate unmatched
|
|
2417
|
+
* traffic to `super._onresponse(response)` — an override that consumes
|
|
2418
|
+
* only what it owns and falls through to base dispatch for everything
|
|
2419
|
+
* else.
|
|
2420
|
+
*/
|
|
2421
|
+
protected _onresponse(response: JSONRPCResponse | JSONRPCErrorResponse): void;
|
|
2422
|
+
get transport(): Transport | undefined;
|
|
2423
|
+
/**
|
|
2424
|
+
* Closes the connection.
|
|
2425
|
+
*/
|
|
2426
|
+
close(): Promise<void>;
|
|
2427
|
+
/**
|
|
2428
|
+
* A method to check if a capability is supported by the remote side, for the given method to be called.
|
|
2429
|
+
*
|
|
2430
|
+
* This should be implemented by subclasses.
|
|
2431
|
+
*/
|
|
2432
|
+
protected abstract assertCapabilityForMethod(method: RequestMethod | string): void;
|
|
2433
|
+
/**
|
|
2434
|
+
* A method to check if a notification is supported by the local side, for the given method to be sent.
|
|
2435
|
+
*
|
|
2436
|
+
* This should be implemented by subclasses.
|
|
2437
|
+
*/
|
|
2438
|
+
protected abstract assertNotificationCapability(method: NotificationMethod | string): void;
|
|
2439
|
+
/**
|
|
2440
|
+
* A method to check if a request handler is supported by the local side, for the given method to be handled.
|
|
2441
|
+
*
|
|
2442
|
+
* This should be implemented by subclasses.
|
|
2443
|
+
*/
|
|
2444
|
+
protected abstract assertRequestHandlerCapability(method: string): void;
|
|
2445
|
+
/**
|
|
2446
|
+
* Sends a request and waits for a response.
|
|
2447
|
+
*
|
|
2448
|
+
* For spec methods the result schema is resolved automatically from the method name
|
|
2449
|
+
* and the return type is method-keyed. For custom (non-spec) methods, pass a
|
|
2450
|
+
* `resultSchema` as the second argument; the response is validated against it and
|
|
2451
|
+
* the return type is inferred from the schema.
|
|
2452
|
+
*
|
|
2453
|
+
* Do not use this method to emit notifications! Use {@linkcode Protocol.notification | notification()} instead.
|
|
2454
|
+
*/
|
|
2455
|
+
request<M$1 extends RequestMethod>(request: {
|
|
2456
|
+
method: M$1;
|
|
2457
|
+
params?: Record<string, unknown>;
|
|
2458
|
+
}, options?: RequestOptions): Promise<ResultTypeMap[M$1]>;
|
|
2459
|
+
request<T$1 extends StandardSchemaV1>(request: Request, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
|
|
2460
|
+
/**
|
|
2461
|
+
* The wire codec for this instance's negotiated era — the phase-2 truth:
|
|
2462
|
+
* everything an established connection sends and receives resolves
|
|
2463
|
+
* through it. Legacy until a version has been negotiated.
|
|
2464
|
+
*/
|
|
2465
|
+
private _negotiatedWireCodec;
|
|
2466
|
+
/**
|
|
2467
|
+
* Protected accessor for the instance's negotiated wire codec, for role
|
|
2468
|
+
* classes (Client/Server/McpServer) routing era-dependent behavior
|
|
2469
|
+
* through the codec's function-only surface — `samplingResultVariant`,
|
|
2470
|
+
* `outboundEnvelope`, `projectCallToolResult` — instead of branching on
|
|
2471
|
+
* the protocol version themselves.
|
|
2472
|
+
*/
|
|
2473
|
+
protected _wireCodec(): WireCodec;
|
|
2474
|
+
/**
|
|
2475
|
+
* Outbound codec resolution: while the negotiated version is still unset
|
|
2476
|
+
* (the negotiation window), lifecycle messages are bootstrap-pinned BY
|
|
2477
|
+
* METHOD — they self-identify their era (`initialize` IS the legacy
|
|
2478
|
+
* handshake, `server/discover` IS the modern probe). Once a version has
|
|
2479
|
+
* been negotiated, the instance era is authoritative for everything — a
|
|
2480
|
+
* negotiated session never re-routes a method onto the other era.
|
|
2481
|
+
*/
|
|
2482
|
+
private _resolveOutboundCodec;
|
|
2483
|
+
/**
|
|
2484
|
+
* Era gate for outbound requests — deletions are physical in BOTH
|
|
2485
|
+
* directions: sending a spec method that the resolved era does not define
|
|
2486
|
+
* dies locally with a typed error before anything reaches the transport.
|
|
2487
|
+
* Methods outside the spec universe are consumer-owned extension methods
|
|
2488
|
+
* and stay era-blind.
|
|
2489
|
+
*/
|
|
2490
|
+
private _assertOutboundRequestInEra;
|
|
2491
|
+
/**
|
|
2492
|
+
* Sends a request and waits for a response, using the provided schema for
|
|
2493
|
+
* validation instead of the era registry's method-keyed entry.
|
|
2494
|
+
*
|
|
2495
|
+
* This is the internal implementation used by SDK methods whose result
|
|
2496
|
+
* schema cannot be expressed as a method-keyed registry entry — the one
|
|
2497
|
+
* surviving case is `server.createMessage`, whose result schema depends
|
|
2498
|
+
* on the REQUEST params (tools vs no tools) — and by callers passing
|
|
2499
|
+
* explicit compatibility schemas. Spec methods are still era-gated here:
|
|
2500
|
+
* an explicit schema never smuggles a deleted method onto the wire.
|
|
2501
|
+
*/
|
|
2502
|
+
protected _requestWithSchema<T$1 extends StandardSchemaV1>(request: Request, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
|
|
2503
|
+
/**
|
|
2504
|
+
* The request funnel proper, keyed by the resolved era codec: the codec
|
|
2505
|
+
* owns result decoding (raw-first `resultType` discrimination — V-1 —
|
|
2506
|
+
* and the era's lift posture) before the schema validation step.
|
|
2507
|
+
*/
|
|
2508
|
+
private _requestWithSchemaViaCodec;
|
|
2509
|
+
/**
|
|
2510
|
+
* Emits a notification, which is a one-way message that does not expect a response.
|
|
2511
|
+
*/
|
|
2512
|
+
notification(notification: Notification, options?: NotificationOptions): Promise<void>;
|
|
2513
|
+
/**
|
|
2514
|
+
* The notification funnel proper, keyed by the resolved era codec —
|
|
2515
|
+
* direct sends and related notifications (`ctx.mcpReq.notify`) alike
|
|
2516
|
+
* resolve through the instance's negotiated era at send time.
|
|
2517
|
+
*/
|
|
2518
|
+
private _notificationViaCodec;
|
|
2519
|
+
/**
|
|
2520
|
+
* Registers a handler to invoke when this protocol object receives a request with the given method.
|
|
2521
|
+
*
|
|
2522
|
+
* Note that this will replace any previous request handler for the same method.
|
|
2523
|
+
*
|
|
2524
|
+
* For spec methods, pass `(method, handler)`; the request is parsed with the spec
|
|
2525
|
+
* schema and the handler receives the typed `Request`. For custom (non-spec)
|
|
2526
|
+
* methods, pass `(method, schemas, handler)`; `params` are validated against
|
|
2527
|
+
* `schemas.params` and the handler receives the parsed params object directly.
|
|
2528
|
+
* Supplying `schemas.result` types the handler's return value.
|
|
2529
|
+
*
|
|
2530
|
+
* @example Custom request method
|
|
2531
|
+
* ```ts source="./protocol.examples.ts#Protocol_setRequestHandler_customMethod"
|
|
2532
|
+
* const SearchParams = z.object({ query: z.string(), limit: z.number().optional() });
|
|
2533
|
+
* const SearchResult = z.object({ hits: z.array(z.string()) });
|
|
2534
|
+
*
|
|
2535
|
+
* protocol.setRequestHandler('acme/search', { params: SearchParams, result: SearchResult }, async (params, _ctx) => {
|
|
2536
|
+
* return { hits: [`result for ${params.query}`] };
|
|
2537
|
+
* });
|
|
2538
|
+
* ```
|
|
2539
|
+
*/
|
|
2540
|
+
setRequestHandler<M$1 extends RequestMethod>(method: M$1, handler: (request: RequestTypeMap[M$1], ctx: ContextT) => HandlerResultTypeMap[M$1] | Promise<HandlerResultTypeMap[M$1]>): void;
|
|
2541
|
+
setRequestHandler<P extends StandardSchemaV1, R extends StandardSchemaV1 | undefined = undefined>(method: string, schemas: {
|
|
2542
|
+
params: P;
|
|
2543
|
+
result?: R;
|
|
2544
|
+
}, handler: (params: StandardSchemaV1.InferOutput<P>, ctx: ContextT) => InferHandlerResult<R> | Promise<InferHandlerResult<R>>): void;
|
|
2545
|
+
/**
|
|
2546
|
+
* Hook for subclasses to wrap a registered request handler with role-specific
|
|
2547
|
+
* validation or behavior (e.g. `Server` validates `tools/call` results, `Client`
|
|
2548
|
+
* validates `elicitation/create` mode and result). Runs for both the 2-arg and
|
|
2549
|
+
* 3-arg registration paths. The default implementation is identity.
|
|
2550
|
+
*
|
|
2551
|
+
* Subclasses overriding this hook avoid redeclaring `setRequestHandler`'s overload set.
|
|
2552
|
+
*/
|
|
2553
|
+
protected _wrapHandler(_method: string, handler: (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>): (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>;
|
|
2554
|
+
/**
|
|
2555
|
+
* Hook for subclasses to supply the implementation identity the 2026-era
|
|
2556
|
+
* encode seam stamps into outbound result `_meta` under
|
|
2557
|
+
* `io.modelcontextprotocol/serverInfo` (spec PR #3002: servers SHOULD
|
|
2558
|
+
* identify themselves on every response). The default is `undefined` — no
|
|
2559
|
+
* stamp. Only `Server` overrides this: the key identifies the software
|
|
2560
|
+
* producing a response, and the 2025-era codec never stamps anything
|
|
2561
|
+
* regardless (the never-stamp guarantee).
|
|
2562
|
+
*/
|
|
2563
|
+
protected _outboundServerInfo(): Implementation | undefined;
|
|
2564
|
+
/**
|
|
2565
|
+
* Removes the request handler for the given method.
|
|
2566
|
+
*/
|
|
2567
|
+
removeRequestHandler(method: RequestMethod | string): void;
|
|
2568
|
+
/**
|
|
2569
|
+
* Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
|
|
2570
|
+
*/
|
|
2571
|
+
assertCanSetRequestHandler(method: RequestMethod | string): void;
|
|
2572
|
+
/**
|
|
2573
|
+
* Registers a handler to invoke when this protocol object receives a notification with the given method.
|
|
2574
|
+
*
|
|
2575
|
+
* Note that this will replace any previous notification handler for the same method.
|
|
2576
|
+
*
|
|
2577
|
+
* For spec methods, pass `(method, handler)`; the notification is parsed with the
|
|
2578
|
+
* spec schema. For custom (non-spec) methods, pass `(method, schemas, handler)`;
|
|
2579
|
+
* `params` are validated against `schemas.params` and the handler receives the
|
|
2580
|
+
* parsed params object directly. The raw notification is passed as the second
|
|
2581
|
+
* argument; `_meta` is recoverable via `notification.params?._meta` (minus the
|
|
2582
|
+
* reserved `io.modelcontextprotocol/*` envelope keys, which the protocol layer
|
|
2583
|
+
* lifts out before dispatch).
|
|
2584
|
+
*/
|
|
2585
|
+
setNotificationHandler<M$1 extends NotificationMethod>(method: M$1, handler: (notification: NotificationTypeMap[M$1]) => void | Promise<void>): void;
|
|
2586
|
+
setNotificationHandler<P extends StandardSchemaV1>(method: string, schemas: {
|
|
2587
|
+
params: P;
|
|
2588
|
+
}, handler: (params: StandardSchemaV1.InferOutput<P>, notification: Notification) => void | Promise<void>): void;
|
|
2589
|
+
/**
|
|
2590
|
+
* Removes the notification handler for the given method.
|
|
2591
|
+
*/
|
|
2592
|
+
removeNotificationHandler(method: NotificationMethod | string): void;
|
|
2593
|
+
}
|
|
2594
|
+
/**
|
|
2595
|
+
* Schema bundle accepted by {@linkcode Protocol.setRequestHandler | setRequestHandler}'s 3-arg form.
|
|
2596
|
+
*
|
|
2597
|
+
* `params` is required and validates the inbound `request.params`. `result` is optional;
|
|
2598
|
+
* when supplied it types the handler's return value (no runtime validation is performed
|
|
2599
|
+
* on the result).
|
|
2600
|
+
*/
|
|
2601
|
+
interface RequestHandlerSchemas<P extends StandardSchemaV1 = StandardSchemaV1, R extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> {
|
|
2602
|
+
params: P;
|
|
2603
|
+
result?: R;
|
|
2604
|
+
}
|
|
2605
|
+
type InferHandlerResult<R extends StandardSchemaV1 | undefined> = R extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<R> : Result$1;
|
|
2606
|
+
declare function mergeCapabilities(base: ServerCapabilities, additional: Partial<ServerCapabilities>): ServerCapabilities;
|
|
2607
|
+
declare function mergeCapabilities(base: ClientCapabilities, additional: Partial<ClientCapabilities>): ClientCapabilities;
|
|
2608
|
+
//#endregion
|
|
2609
|
+
//#region ../core-internal/src/shared/mediaType.d.ts
|
|
2610
|
+
/**
|
|
2611
|
+
* Whether a raw `Content-Type` header value denotes `application/json`.
|
|
2612
|
+
* Parameters (for example `charset=utf-8`) are allowed and ignored; malformed
|
|
2613
|
+
* parameter sections do not reject a header whose media type is unambiguously
|
|
2614
|
+
* `application/json` (see `mediaTypeEssence` for the exact grammar).
|
|
2615
|
+
*/
|
|
2616
|
+
declare function isJsonContentType(header: string | null | undefined): boolean;
|
|
2617
|
+
//#endregion
|
|
2618
|
+
//#region ../core-internal/src/shared/metadataUtils.d.ts
|
|
2619
|
+
/**
|
|
2620
|
+
* Utilities for working with {@linkcode BaseMetadata} objects.
|
|
2621
|
+
*/
|
|
2622
|
+
/**
|
|
2623
|
+
* Gets the display name for an object with {@linkcode BaseMetadata}.
|
|
2624
|
+
* For tools, the precedence is: `title` → {@linkcode index.ToolAnnotations | annotations}.`title` → `name`
|
|
2625
|
+
* For other objects: `title` → `name`
|
|
2626
|
+
* This implements the spec requirement: "if no title is provided, name should be used for display purposes"
|
|
2627
|
+
*/
|
|
2628
|
+
declare function getDisplayName(metadata: BaseMetadata | (BaseMetadata & {
|
|
2629
|
+
annotations?: {
|
|
2630
|
+
title?: string;
|
|
2631
|
+
};
|
|
2632
|
+
})): string;
|
|
2633
|
+
//#endregion
|
|
2634
|
+
//#region ../core-internal/src/shared/protocolEras.d.ts
|
|
2635
|
+
/**
|
|
2636
|
+
* Protocol-era helpers (pure module). The MCP wire protocol splits into two eras:
|
|
2637
|
+
* legacy (the 2025-11-25 family and earlier; the version is negotiated via the
|
|
2638
|
+
* `initialize` handshake) and modern (2026-07-28 and later; no `initialize` —
|
|
2639
|
+
* servers advertise versions via `server/discover` and every request carries a
|
|
2640
|
+
* `_meta` envelope).
|
|
2641
|
+
*
|
|
2642
|
+
* An operation that belongs to one era must only ever consult that era's subset
|
|
2643
|
+
* of a supported-versions list: `initialize` never accepts or counter-offers a
|
|
2644
|
+
* modern revision, and the `server/discover` advertisement only ever contains
|
|
2645
|
+
* modern revisions.
|
|
2646
|
+
*/
|
|
2647
|
+
/**
|
|
2648
|
+
* The protocol era of a connection: `'legacy'` for the 2025-11-25 family and
|
|
2649
|
+
* earlier (negotiated via `initialize`), `'modern'` for 2026-07-28 and later
|
|
2650
|
+
* (negotiated via `server/discover`; every request carries a `_meta` envelope).
|
|
2651
|
+
*/
|
|
2652
|
+
type ProtocolEra = 'legacy' | 'modern';
|
|
2653
|
+
//#endregion
|
|
2654
|
+
//#region ../core-internal/src/shared/resultCacheHints.d.ts
|
|
2655
|
+
/**
|
|
2656
|
+
* Cache-hint plumbing for cacheable results (protocol revision 2026-07-28).
|
|
2657
|
+
*
|
|
2658
|
+
* The 2026-07-28 revision requires `ttlMs`/`cacheScope` on the cacheable
|
|
2659
|
+
* result types (SEP-2549 `CacheableResult`). The values are resolved at the
|
|
2660
|
+
* era-aware encode seam (the 2026 wire codec's `encodeResult`), most specific
|
|
2661
|
+
* author first:
|
|
2662
|
+
*
|
|
2663
|
+
* 1. fields the handler returned on the result itself (when valid),
|
|
2664
|
+
* 2. a configured cache hint attached by the server layer
|
|
2665
|
+
* (per-registration hint, then the server-level per-operation hint,
|
|
2666
|
+
* combined per field — see {@linkcode attachCacheHintFallback}),
|
|
2667
|
+
* 3. the conservative defaults `{ ttlMs: 0, cacheScope: 'private' }`.
|
|
2668
|
+
*
|
|
2669
|
+
* The configured hint travels from the (era-blind) server configuration to the
|
|
2670
|
+
* (era-aware) encode seam on a symbol-keyed property of the result object —
|
|
2671
|
+
* {@linkcode RESULT_CACHE_HINT_FALLBACK}. Symbol-keyed properties are never
|
|
2672
|
+
* serialized to JSON, so attaching a hint can never change what a 2025-era
|
|
2673
|
+
* response looks like on the wire: only the 2026-era codec reads (and removes)
|
|
2674
|
+
* it while filling the required fields. The 2025-era codec has no cache code
|
|
2675
|
+
* path at all.
|
|
2676
|
+
*/
|
|
2677
|
+
/** The cache scopes defined for cacheable results (SEP-2549). */
|
|
2678
|
+
type CacheScope = 'public' | 'private';
|
|
2679
|
+
/**
|
|
2680
|
+
* A cache hint for a cacheable result (protocol revision 2026-07-28): the
|
|
2681
|
+
* values to emit for `ttlMs` / `cacheScope` when the handler does not provide
|
|
2682
|
+
* them itself. Absent fields fall back to the conservative defaults
|
|
2683
|
+
* (`ttlMs: 0`, `cacheScope: 'private'`).
|
|
2684
|
+
*/
|
|
2685
|
+
interface CacheHint {
|
|
2686
|
+
/** Cache lifetime in milliseconds. Must be a non-negative safe integer. */
|
|
2687
|
+
ttlMs?: number;
|
|
2688
|
+
/** Whether the result may be cached by shared caches (`public`) or only by the requesting client (`private`). */
|
|
2689
|
+
cacheScope?: CacheScope;
|
|
2690
|
+
}
|
|
2691
|
+
/**
|
|
2692
|
+
* The operations whose results are cacheable on the 2026-07-28 revision (the
|
|
2693
|
+
* `CacheableResult` extenders). This list is closed: no other operation's
|
|
2694
|
+
* result ever receives cache fields from the SDK.
|
|
2695
|
+
*/
|
|
2696
|
+
declare const CACHEABLE_RESULT_METHODS: readonly ["tools/list", "prompts/list", "resources/list", "resources/templates/list", "resources/read", "server/discover"];
|
|
2697
|
+
/** A method whose result is cacheable on the 2026-07-28 revision. */
|
|
2698
|
+
type CacheableResultMethod = (typeof CACHEABLE_RESULT_METHODS)[number];
|
|
2699
|
+
//#endregion
|
|
2700
|
+
//#region ../core-internal/src/shared/stdio.d.ts
|
|
2701
|
+
declare const STDIO_DEFAULT_MAX_BUFFER_SIZE: number;
|
|
2702
|
+
/**
|
|
2703
|
+
* Buffers a continuous stdio stream into discrete JSON-RPC messages.
|
|
2704
|
+
*/
|
|
2705
|
+
declare class ReadBuffer {
|
|
2706
|
+
private _buffer?;
|
|
2707
|
+
private _maxBufferSize;
|
|
2708
|
+
constructor(options?: {
|
|
2709
|
+
maxBufferSize?: number;
|
|
2710
|
+
});
|
|
2711
|
+
append(chunk: Buffer): void;
|
|
2712
|
+
readMessage(): JSONRPCMessage | null;
|
|
2713
|
+
clear(): void;
|
|
2714
|
+
}
|
|
2715
|
+
declare function deserializeMessage(line: string): JSONRPCMessage;
|
|
2716
|
+
declare function serializeMessage(message: JSONRPCMessage): string;
|
|
2717
|
+
//#endregion
|
|
2718
|
+
//#region ../core-internal/src/shared/uriTemplate.d.ts
|
|
2719
|
+
type Variables = Record<string, string | string[]>;
|
|
2720
|
+
declare class UriTemplate {
|
|
2721
|
+
/**
|
|
2722
|
+
* Returns true if the given string contains any URI template expressions.
|
|
2723
|
+
* A template expression is a sequence of characters enclosed in curly braces,
|
|
2724
|
+
* like `{foo}` or `{?bar}`.
|
|
2725
|
+
*/
|
|
2726
|
+
static isTemplate(str: string): boolean;
|
|
2727
|
+
private static validateLength;
|
|
2728
|
+
private readonly template;
|
|
2729
|
+
private readonly parts;
|
|
2730
|
+
get variableNames(): string[];
|
|
2731
|
+
constructor(template: string);
|
|
2732
|
+
toString(): string;
|
|
2733
|
+
private parse;
|
|
2734
|
+
private getOperator;
|
|
2735
|
+
private getNames;
|
|
2736
|
+
private encodeValue;
|
|
2737
|
+
private expandPart;
|
|
2738
|
+
expand(variables: Variables): string;
|
|
2739
|
+
private escapeRegExp;
|
|
2740
|
+
private partToRegExp;
|
|
2741
|
+
match(uri: string): Variables | null;
|
|
2742
|
+
}
|
|
2743
|
+
//#endregion
|
|
2744
|
+
//#region ../core-internal/src/util/inMemory.d.ts
|
|
2745
|
+
/**
|
|
2746
|
+
* In-memory transport for creating clients and servers that talk to each other within the same process.
|
|
2747
|
+
*
|
|
2748
|
+
* Intended for testing and development. For production in-process connections, use
|
|
2749
|
+
* `StreamableHTTPClientTransport` against a local server URL.
|
|
2750
|
+
*/
|
|
2751
|
+
declare class InMemoryTransport implements Transport {
|
|
2752
|
+
private _otherTransport?;
|
|
2753
|
+
private _messageQueue;
|
|
2754
|
+
private _closed;
|
|
2755
|
+
onclose?: () => void;
|
|
2756
|
+
onerror?: (error: Error) => void;
|
|
2757
|
+
onmessage?: (message: JSONRPCMessage, extra?: {
|
|
2758
|
+
authInfo?: AuthInfo;
|
|
2759
|
+
}) => void;
|
|
2760
|
+
sessionId?: string;
|
|
2761
|
+
/**
|
|
2762
|
+
* Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a {@linkcode @modelcontextprotocol/client!client/client.Client | Client} and one to a {@linkcode @modelcontextprotocol/server!server/server.Server | Server}.
|
|
2763
|
+
*/
|
|
2764
|
+
static createLinkedPair(): [InMemoryTransport, InMemoryTransport];
|
|
2765
|
+
start(): Promise<void>;
|
|
2766
|
+
close(): Promise<void>;
|
|
2767
|
+
/**
|
|
2768
|
+
* Sends a message with optional auth info.
|
|
2769
|
+
* This is useful for testing authentication scenarios.
|
|
2770
|
+
*/
|
|
2771
|
+
send(message: JSONRPCMessage, options?: {
|
|
2772
|
+
relatedRequestId?: RequestId;
|
|
2773
|
+
authInfo?: AuthInfo;
|
|
2774
|
+
}): Promise<void>;
|
|
2775
|
+
}
|
|
2776
|
+
//#endregion
|
|
2777
|
+
//#region ../core-internal/src/wire/preload.d.ts
|
|
2778
|
+
/**
|
|
2779
|
+
* Eagerly builds every lazily-constructed wire-schema layer, so that no later
|
|
2780
|
+
* validation pays schema-construction cost.
|
|
2781
|
+
*
|
|
2782
|
+
* Synchronous and idempotent: every layer is a memo, so the first call does
|
|
2783
|
+
* all the work and subsequent calls return immediately. Reference identity is
|
|
2784
|
+
* unaffected — this forces the same memos every lazy consumer pulls through.
|
|
2785
|
+
*
|
|
2786
|
+
* Call it at module scope on platforms that bill per-request CPU but not
|
|
2787
|
+
* module evaluation (isolate-based edge/serverless runtimes), where deferring
|
|
2788
|
+
* construction would move it into the first request of every fresh isolate:
|
|
2789
|
+
*
|
|
2790
|
+
* ```ts
|
|
2791
|
+
* // from '@modelcontextprotocol/server' or '@modelcontextprotocol/client' —
|
|
2792
|
+
* // each package bundles its own schema copy, so warm the one(s) you import.
|
|
2793
|
+
* preloadSchemas(); // module scope — runs during isolate warm-up
|
|
2794
|
+
* ```
|
|
2795
|
+
*
|
|
2796
|
+
* On Node CLIs and other process-per-invocation runtimes, prefer the lazy
|
|
2797
|
+
* default — there, module-scope construction is pure added boot latency.
|
|
2798
|
+
*/
|
|
2799
|
+
declare function preloadSchemas(): void;
|
|
2800
|
+
//#endregion
|
|
2801
|
+
//#region src/server/scopeChallenge.d.ts
|
|
2802
|
+
/** OAuth scopes to request before handling an MCP request. */
|
|
2803
|
+
interface ScopeChallenge {
|
|
2804
|
+
/** The exact, complete scope set to include in the challenge. Each scope must satisfy the OAuth `scope-token` grammar. */
|
|
2805
|
+
scopes: readonly [string, ...string[]];
|
|
2806
|
+
/** Optional human-readable detail satisfying the RFC 6750 `error-description` grammar. */
|
|
2807
|
+
errorDescription?: string;
|
|
2808
|
+
}
|
|
2809
|
+
/** Determines whether an MCP request needs an OAuth scope challenge. */
|
|
2810
|
+
type ScopeChallengeHandler = (context: {
|
|
2811
|
+
request: JSONRPCRequest;
|
|
2812
|
+
authInfo?: AuthInfo;
|
|
2813
|
+
}) => ScopeChallenge | undefined | Promise<ScopeChallenge | undefined>;
|
|
2814
|
+
/**
|
|
2815
|
+
* Creates a handler that requires every supplied scope exactly.
|
|
2816
|
+
*
|
|
2817
|
+
* Requests without authentication are left to the server's authentication gate.
|
|
2818
|
+
*/
|
|
2819
|
+
declare function requireScopes(...scopes: readonly [string, ...string[]]): ScopeChallengeHandler;
|
|
2820
|
+
//#endregion
|
|
2821
|
+
//#region src/server/server.d.ts
|
|
2822
|
+
type ServerOptions = ProtocolOptions & {
|
|
2823
|
+
/**
|
|
2824
|
+
* Capabilities to advertise as being supported by this server.
|
|
2825
|
+
*
|
|
2826
|
+
* Note: per the MCP spec, a server that declares a capability MUST respond to that
|
|
2827
|
+
* capability's requests (e.g. `tools/list` for `tools`) — potentially with an empty
|
|
2828
|
+
* result — rather than with a "Method not found" error. {@linkcode server/mcp.McpServer | McpServer}
|
|
2829
|
+
* handles this automatically for capabilities declared here; when using the low-level
|
|
2830
|
+
* {@linkcode Server} directly, you are responsible for registering a request handler for
|
|
2831
|
+
* every capability you declare.
|
|
2832
|
+
*/
|
|
2833
|
+
capabilities?: ServerCapabilities;
|
|
2834
|
+
/**
|
|
2835
|
+
* Optional instructions describing how to use the server and its features.
|
|
2836
|
+
*/
|
|
2837
|
+
instructions?: string;
|
|
2838
|
+
/**
|
|
2839
|
+
* JSON Schema validator for elicitation response validation.
|
|
2840
|
+
*
|
|
2841
|
+
* The validator is used to validate user input returned from elicitation
|
|
2842
|
+
* requests against the requested schema.
|
|
2843
|
+
*
|
|
2844
|
+
* @default Runtime-selected validator (AJV-backed on Node.js, `@cfworker/json-schema`-backed on browser/workerd runtimes)
|
|
2845
|
+
*/
|
|
2846
|
+
jsonSchemaValidator?: jsonSchemaValidator;
|
|
2847
|
+
/**
|
|
2848
|
+
* Cache hints for the cacheable results of the 2026-07-28 protocol
|
|
2849
|
+
* revision (`ttlMs` / `cacheScope`), keyed by operation. The cacheable
|
|
2850
|
+
* operations are `tools/list`, `prompts/list`, `resources/list`,
|
|
2851
|
+
* `resources/templates/list`, `resources/read` and `server/discover`. The
|
|
2852
|
+
* hint is used when the result for that operation does not provide its own
|
|
2853
|
+
* cache fields — most useful for the list results and `server/discover`,
|
|
2854
|
+
* which the SDK builds itself. A hint registered with an individual
|
|
2855
|
+
* resource (`registerResource(..., { cacheHint })`) takes precedence for
|
|
2856
|
+
* that resource's `resources/read` results, field by field: a field the
|
|
2857
|
+
* per-resource hint leaves unset still falls back to the per-operation
|
|
2858
|
+
* hint configured here.
|
|
2859
|
+
*
|
|
2860
|
+
* Absent hints (or omitting this option entirely) keep today's behavior:
|
|
2861
|
+
* cacheable 2026-07-28 results are emitted with `ttlMs: 0` and
|
|
2862
|
+
* `cacheScope: 'private'`. Responses to 2025-era requests are never
|
|
2863
|
+
* affected. Invalid values throw a `RangeError` at construction time.
|
|
2864
|
+
*/
|
|
2865
|
+
cacheHints?: Partial<Record<CacheableResultMethod, CacheHint>>;
|
|
2866
|
+
/**
|
|
2867
|
+
* Multi-round-trip serving knobs. On 2026-era requests the client
|
|
2868
|
+
* fulfils `input_required` returns; on 2025-era connections the SDK's
|
|
2869
|
+
* legacy shim fulfils them server-side (real server→client requests +
|
|
2870
|
+
* handler re-entry), so handlers are written once and serve both eras.
|
|
2871
|
+
*/
|
|
2872
|
+
inputRequired?: {
|
|
2873
|
+
/**
|
|
2874
|
+
* Handler re-entries per originating request before the shim fails
|
|
2875
|
+
* (tools/call: `isError` result; prompts/resources: JSON-RPC error).
|
|
2876
|
+
* @default 8
|
|
2877
|
+
*/
|
|
2878
|
+
maxRounds?: number;
|
|
2879
|
+
/**
|
|
2880
|
+
* Per-leg timeout (ms) for the shim's embedded server→client
|
|
2881
|
+
* requests, sent with `resetTimeoutOnProgress: true`. Human-paced —
|
|
2882
|
+
* deliberately far above the 60s protocol default.
|
|
2883
|
+
* @default 600_000
|
|
2884
|
+
*/
|
|
2885
|
+
roundTimeoutMs?: number;
|
|
2886
|
+
/**
|
|
2887
|
+
* `false` disables the shim: an `input_required` return on a
|
|
2888
|
+
* 2025-era request fails loudly (the pre-shim behavior).
|
|
2889
|
+
* @default true
|
|
2890
|
+
*/
|
|
2891
|
+
legacyShim?: boolean;
|
|
2892
|
+
};
|
|
2893
|
+
/**
|
|
2894
|
+
* Multi-round-trip `requestState` integrity hook (protocol revision
|
|
2895
|
+
* 2026-07-28).
|
|
2896
|
+
*/
|
|
2897
|
+
requestState?: {
|
|
2898
|
+
/**
|
|
2899
|
+
* Called on every multi-round-trip request round whose echoed
|
|
2900
|
+
* `requestState` is a string (i.e. whenever
|
|
2901
|
+
* `ctx.mcpReq.requestState()` would return one), BEFORE the handler
|
|
2902
|
+
* runs — including the legacy shim's in-process rounds. Throw or
|
|
2903
|
+
* reject to refuse the request: the seam answers with a wire-level
|
|
2904
|
+
* `-32602` Invalid Params error whose message is frozen to
|
|
2905
|
+
* `"Invalid or expired requestState"` and whose `data.reason` is
|
|
2906
|
+
* `'invalid_request_state'` — the thrown reason is surfaced via the
|
|
2907
|
+
* server's `onerror` callback only and never reaches the wire.
|
|
2908
|
+
*
|
|
2909
|
+
* This is the place to put HMAC or AEAD verification of
|
|
2910
|
+
* `requestState`. The spec MUST for integrity-protecting state that
|
|
2911
|
+
* influences authorization, resource access, or business logic is on
|
|
2912
|
+
* the server author (basic/patterns/mrtr, server requirements 4–5);
|
|
2913
|
+
* the SDK provides NO default verification —
|
|
2914
|
+
* {@linkcode server/requestStateCodec.createRequestStateCodec | createRequestStateCodec}
|
|
2915
|
+
* is the SDK-provided HMAC helper whose `verify` drops in here
|
|
2916
|
+
* directly. Leaving this option unconfigured keeps the passthrough
|
|
2917
|
+
* behavior — `ctx.mcpReq.requestState()` returns the raw wire string,
|
|
2918
|
+
* which MUST be treated as attacker-controlled input.
|
|
2919
|
+
*
|
|
2920
|
+
* The resolved value is LOAD-BEARING: when the hook resolves with a
|
|
2921
|
+
* non-`undefined` value — as
|
|
2922
|
+
* {@linkcode server/requestStateCodec.RequestStateCodec | RequestStateCodec}`.verify`
|
|
2923
|
+
* does (the decoded payload) — the seam hands THAT value to the
|
|
2924
|
+
* handler via the typed `ctx.mcpReq.requestState<T>()` accessor, so a
|
|
2925
|
+
* codec-using handler reads its verified state with no second decode
|
|
2926
|
+
* call. A verifier that is not also the decoder should resolve
|
|
2927
|
+
* `undefined` (return nothing) to keep the accessor on the raw wire
|
|
2928
|
+
* string — resolving an incidental value (e.g. a boolean
|
|
2929
|
+
* verification flag) would replace what the handler reads.
|
|
2930
|
+
*/
|
|
2931
|
+
verify?: (state: string, ctx: ServerContext) => unknown | Promise<unknown>;
|
|
2932
|
+
};
|
|
2933
|
+
};
|
|
2934
|
+
/**
|
|
2935
|
+
* An MCP server on top of a pluggable transport.
|
|
2936
|
+
*
|
|
2937
|
+
* This server will automatically respond to the initialization flow as initiated from the client.
|
|
2938
|
+
*
|
|
2939
|
+
* @deprecated Use {@linkcode server/mcp.McpServer | McpServer} instead for the high-level API. Only use `Server` for advanced use cases.
|
|
2940
|
+
*/
|
|
2941
|
+
declare class Server extends Protocol<ServerContext> {
|
|
2942
|
+
private _serverInfo;
|
|
2943
|
+
private _clientCapabilities?;
|
|
2944
|
+
private _clientVersion?;
|
|
2945
|
+
private _capabilities;
|
|
2946
|
+
private _instructions?;
|
|
2947
|
+
private _jsonSchemaValidator;
|
|
2948
|
+
private _cacheHints?;
|
|
2949
|
+
private _requestStateVerify?;
|
|
2950
|
+
private _inputRequiredServing;
|
|
2951
|
+
private _legacyShim?;
|
|
2952
|
+
private _boundFromTransport;
|
|
2953
|
+
/** Lazily-built legacy shim; the loop lives in legacyInputRequiredShim.ts behind a narrow host contract. */
|
|
2954
|
+
private _legacyInputRequiredShim;
|
|
2955
|
+
/**
|
|
2956
|
+
* Callback for when initialization has fully completed (i.e., the client has sent an `notifications/initialized` notification).
|
|
2957
|
+
*/
|
|
2958
|
+
oninitialized?: () => void;
|
|
2959
|
+
/**
|
|
2960
|
+
* Initializes this server with the given name and version information.
|
|
2961
|
+
*/
|
|
2962
|
+
constructor(_serverInfo: Implementation, options?: ServerOptions);
|
|
2963
|
+
/** Attaches to the given transport; rejects while this instance is connected to another one. */
|
|
2964
|
+
connect(transport: Transport): Promise<void>;
|
|
2965
|
+
/**
|
|
2966
|
+
* Registers the built-in `logging/setLevel` request handler.
|
|
2967
|
+
*
|
|
2968
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
2969
|
+
* Remains functional during the deprecation window (at least twelve months).
|
|
2970
|
+
* Migrate to stderr logging (STDIO servers) or OpenTelemetry.
|
|
2971
|
+
*/
|
|
2972
|
+
private _registerLoggingHandler;
|
|
2973
|
+
protected buildContext(ctx: BaseContext, transportInfo?: MessageExtraInfo): ServerContext;
|
|
2974
|
+
private _loggingLevels;
|
|
2975
|
+
private readonly LOG_LEVEL_SEVERITY;
|
|
2976
|
+
private isMessageIgnored;
|
|
2977
|
+
/**
|
|
2978
|
+
* Registers new capabilities. This can only be called before connecting to a transport.
|
|
2979
|
+
*
|
|
2980
|
+
* The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
|
|
2981
|
+
*/
|
|
2982
|
+
registerCapabilities(capabilities: ServerCapabilities): void;
|
|
2983
|
+
/**
|
|
2984
|
+
* Enforces server-side validation for `tools/call` results regardless of how the
|
|
2985
|
+
* handler was registered, attaches the configured per-operation cache hint
|
|
2986
|
+
* (when one exists) so the 2026-07-28 encode seam can fill `ttlMs`/`cacheScope`
|
|
2987
|
+
* for results that do not provide their own, and owns the multi-round-trip
|
|
2988
|
+
* seam: on the methods whose 2026-07-28 result vocabulary includes
|
|
2989
|
+
* `input_required` (`tools/call`, `prompts/get`, `resources/read`) an
|
|
2990
|
+
* input-required return skips result-schema validation and is checked
|
|
2991
|
+
* against the served era, the at-least-one rule, and the request's own
|
|
2992
|
+
* declared client capabilities; on every other method an input-required
|
|
2993
|
+
* return is a server bug and fails loudly. The hint rides a symbol-keyed
|
|
2994
|
+
* property that is never serialized, so 2025-era responses are unaffected.
|
|
2995
|
+
*/
|
|
2996
|
+
protected _wrapHandler(method: string, handler: (request: JSONRPCRequest, ctx: ServerContext) => Promise<Result$1>): (request: JSONRPCRequest, ctx: ServerContext) => Promise<Result$1>;
|
|
2997
|
+
/**
|
|
2998
|
+
* Whether this instance is bound to a 2026-07-28-or-later protocol
|
|
2999
|
+
* revision. Era is instance state — a serving entry (`createMcpHandler`,
|
|
3000
|
+
* `serveStdio`) marks the instance modern at construction; a 2025-era
|
|
3001
|
+
* `initialize` handshake binds it legacy. The multi-round-trip seam reads
|
|
3002
|
+
* this directly: there is no per-request era consult.
|
|
3003
|
+
*/
|
|
3004
|
+
private _servedModernEra;
|
|
3005
|
+
/**
|
|
3006
|
+
* Invokes a handler for one of the multi-round-trip methods and applies
|
|
3007
|
+
* the input-required seam:
|
|
3008
|
+
*
|
|
3009
|
+
* - a `UrlElicitationRequiredError` (or any 2025-style server→client
|
|
3010
|
+
* request idiom) escaping the handler on a request served on the
|
|
3011
|
+
* 2026-07-28 era fails LOUDLY with a clear steer to
|
|
3012
|
+
* `inputRequired.elicitUrl(...)` — the `-32042` error never reaches the
|
|
3013
|
+
* 2026-07-28 wire and the throw is not silently converted. Requests
|
|
3014
|
+
* served on the 2025 era keep today's `-32042` behavior byte-exact (the
|
|
3015
|
+
* error is rethrown unchanged).
|
|
3016
|
+
* - an input-required RETURN toward a 2026-07-28 request must satisfy
|
|
3017
|
+
* the at-least-one rule, and every embedded request must be covered by
|
|
3018
|
+
* the capabilities declared on the request's envelope (violations
|
|
3019
|
+
* answer the typed `-32021` error). Toward a 2025-era request the
|
|
3020
|
+
* return is fulfilled by the default-on legacy shim, whose own gate
|
|
3021
|
+
* consults the initialize-declared capabilities and surfaces
|
|
3022
|
+
* violations per family; `inputRequired.legacyShim: false` restores
|
|
3023
|
+
* the pre-shim loud failure.
|
|
3024
|
+
*/
|
|
3025
|
+
private _invokeInputRequiredCapableHandler;
|
|
3026
|
+
/**
|
|
3027
|
+
* Runs the configured `requestState.verify` hook and returns its
|
|
3028
|
+
* resolved value (`undefined` when unconfigured or the hook returns
|
|
3029
|
+
* nothing). Deny-on-error: any hook failure answers the frozen `-32602`;
|
|
3030
|
+
* the reason goes to `onerror` only.
|
|
3031
|
+
*/
|
|
3032
|
+
private _verifyRequestState;
|
|
3033
|
+
/**
|
|
3034
|
+
* The per-request resolved client-capabilities view: the request's own
|
|
3035
|
+
* `_meta` envelope on the 2026 era; the `initialize`-declared state on a
|
|
3036
|
+
* 2025-era connection. Per-request instances that never saw an
|
|
3037
|
+
* initialize (stateless legacy) hold nothing, so gates refuse there.
|
|
3038
|
+
*/
|
|
3039
|
+
private _inputRequestCapabilityView;
|
|
3040
|
+
/**
|
|
3041
|
+
* Guard for the push-style server→client request APIs ({@linkcode createMessage},
|
|
3042
|
+
* {@linkcode elicitInput}, {@linkcode listRoots}, {@linkcode ping}) on a
|
|
3043
|
+
* modern-era instance: the 2026-07-28 revision has no server→client request
|
|
3044
|
+
* channel, so the call fails before any wire traffic with a typed error
|
|
3045
|
+
* whose message steers to `inputRequired(...)`. The base era gate would
|
|
3046
|
+
* also reject it; this guard runs first to carry the steer.
|
|
3047
|
+
*/
|
|
3048
|
+
private _assertPushApiInServedEra;
|
|
3049
|
+
protected assertCapabilityForMethod(method: RequestMethod | string): void;
|
|
3050
|
+
protected assertNotificationCapability(method: NotificationMethod | string): void;
|
|
3051
|
+
protected assertRequestHandlerCapability(method: string): void;
|
|
3052
|
+
private _oninitialize;
|
|
3053
|
+
/**
|
|
3054
|
+
* Answers `server/discover` (protocol revision 2026-07-28). `supportedVersions`
|
|
3055
|
+
* lists only modern revisions (2025-era versions are negotiated via `initialize`);
|
|
3056
|
+
* the capabilities are advertised as-is, listChanged/subscribe bits included
|
|
3057
|
+
* (see {@linkcode discoverAdvertisedCapabilities}).
|
|
3058
|
+
*/
|
|
3059
|
+
private _ondiscover;
|
|
3060
|
+
/**
|
|
3061
|
+
* The identity the 2026-era encode seam stamps into every outbound
|
|
3062
|
+
* result's `_meta` under `io.modelcontextprotocol/serverInfo` (spec PR
|
|
3063
|
+
* #3002: servers SHOULD identify themselves on every response).
|
|
3064
|
+
*/
|
|
3065
|
+
protected _outboundServerInfo(): Implementation | undefined;
|
|
3066
|
+
/**
|
|
3067
|
+
* After initialization has completed, this will be populated with the client's reported capabilities.
|
|
3068
|
+
*
|
|
3069
|
+
* @deprecated Read client identity from the per-request handler context instead: on
|
|
3070
|
+
* 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` carries the client's
|
|
3071
|
+
* declared capabilities, while on 2025-era connections this accessor keeps returning the
|
|
3072
|
+
* `initialize`-scoped value. The accessor remains functional where `createMcpHandler`
|
|
3073
|
+
* serves the 2026-07-28 era: it backfills it per request from the validated envelope.
|
|
3074
|
+
*/
|
|
3075
|
+
getClientCapabilities(): ClientCapabilities | undefined;
|
|
3076
|
+
/**
|
|
3077
|
+
* After initialization has completed, this will be populated with information about the client's name and version.
|
|
3078
|
+
*
|
|
3079
|
+
* @deprecated Read client identity from the per-request handler context instead: on
|
|
3080
|
+
* 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` carries the client's
|
|
3081
|
+
* name and version, while on 2025-era connections this accessor keeps returning the
|
|
3082
|
+
* `initialize`-scoped value. The accessor remains functional where `createMcpHandler`
|
|
3083
|
+
* serves the 2026-07-28 era: it backfills it per request from the validated envelope.
|
|
3084
|
+
*/
|
|
3085
|
+
getClientVersion(): Implementation | undefined;
|
|
3086
|
+
/**
|
|
3087
|
+
* After initialization has completed, this will be populated with the protocol version negotiated
|
|
3088
|
+
* with the client (the version the server responded with during the initialize handshake), or
|
|
3089
|
+
* `undefined` before initialization.
|
|
3090
|
+
*
|
|
3091
|
+
* @deprecated Read the protocol revision from the per-request handler context instead: on
|
|
3092
|
+
* 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` names the revision the
|
|
3093
|
+
* request was sent for, while on 2025-era connections this accessor keeps returning the
|
|
3094
|
+
* `initialize`-negotiated version. The accessor remains functional — instances serving the
|
|
3095
|
+
* 2026-07-28 era report that revision.
|
|
3096
|
+
*/
|
|
3097
|
+
getNegotiatedProtocolVersion(): string | undefined;
|
|
3098
|
+
/**
|
|
3099
|
+
* Project a `tools/call` result through this instance's negotiated wire
|
|
3100
|
+
* codec — the era-agnostic SEP-2106 §4.3 TextContent auto-append, plus on
|
|
3101
|
+
* the 2025 era the `{result:…}` wrap when `structuredContent` is a
|
|
3102
|
+
* non-object value or the advertised `outputSchema` had a non-object root.
|
|
3103
|
+
* Identity for object-shaped `structuredContent` on the 2026 era.
|
|
3104
|
+
*
|
|
3105
|
+
* `McpServer`'s built-in `tools/call` handler routes through this method.
|
|
3106
|
+
* Low-level `setRequestHandler('tools/call', …)` authors call it
|
|
3107
|
+
* themselves so the projection lives in one place (the codec) and the
|
|
3108
|
+
* server-side handler stays era-blind.
|
|
3109
|
+
*
|
|
3110
|
+
* This is the only codec function exposed on `Server` — the full
|
|
3111
|
+
* `WireCodec` is intentionally not part of the public surface.
|
|
3112
|
+
*/
|
|
3113
|
+
projectCallToolResult(result: CallToolResult, advertisedOutputSchema: Readonly<Record<string, unknown>> | undefined): CallToolResult;
|
|
3114
|
+
/**
|
|
3115
|
+
* Returns the current server capabilities.
|
|
3116
|
+
*/
|
|
3117
|
+
getCapabilities(): ServerCapabilities;
|
|
3118
|
+
/**
|
|
3119
|
+
* Sends a `ping` request to the connected client.
|
|
3120
|
+
*
|
|
3121
|
+
* @deprecated The 2026-07-28 protocol removed ping; it throws on a 2026-07-28-era instance.
|
|
3122
|
+
* If your factory serves both eras, this only works on the legacy path.
|
|
3123
|
+
*/
|
|
3124
|
+
ping(): Promise<EmptyResult>;
|
|
3125
|
+
/**
|
|
3126
|
+
* Request LLM sampling from the client (without tools).
|
|
3127
|
+
* Returns single content block for backwards compatibility.
|
|
3128
|
+
*
|
|
3129
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
3130
|
+
* Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
|
|
3131
|
+
* or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client
|
|
3132
|
+
* request model is replaced by input_required results in the 2026-07-28 protocol. If your
|
|
3133
|
+
* factory serves both eras, this only works on the legacy path.
|
|
3134
|
+
*/
|
|
3135
|
+
createMessage(params: CreateMessageRequestParamsBase, options?: RequestOptions): Promise<CreateMessageResult>;
|
|
3136
|
+
/**
|
|
3137
|
+
* Request LLM sampling from the client with tool support.
|
|
3138
|
+
* Returns content that may be a single block or array (for parallel tool calls).
|
|
3139
|
+
*
|
|
3140
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
3141
|
+
* Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
|
|
3142
|
+
* or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client
|
|
3143
|
+
* request model is replaced by input_required results in the 2026-07-28 protocol. If your
|
|
3144
|
+
* factory serves both eras, this only works on the legacy path.
|
|
3145
|
+
*/
|
|
3146
|
+
createMessage(params: CreateMessageRequestParamsWithTools, options?: RequestOptions): Promise<CreateMessageResultWithTools>;
|
|
3147
|
+
/**
|
|
3148
|
+
* Request LLM sampling from the client.
|
|
3149
|
+
* When tools may or may not be present, returns the union type.
|
|
3150
|
+
*
|
|
3151
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
3152
|
+
* Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
|
|
3153
|
+
* or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client
|
|
3154
|
+
* request model is replaced by input_required results in the 2026-07-28 protocol. If your
|
|
3155
|
+
* factory serves both eras, this only works on the legacy path.
|
|
3156
|
+
*/
|
|
3157
|
+
createMessage(params: CreateMessageRequest['params'], options?: RequestOptions): Promise<CreateMessageResult | CreateMessageResultWithTools>;
|
|
3158
|
+
/**
|
|
3159
|
+
* Creates an elicitation request for the given parameters.
|
|
3160
|
+
* For backwards compatibility, `mode` may be omitted for form requests and will default to `"form"`.
|
|
3161
|
+
* @param params The parameters for the elicitation request.
|
|
3162
|
+
* @param options Optional request options.
|
|
3163
|
+
* @returns The result of the elicitation request.
|
|
3164
|
+
*
|
|
3165
|
+
* @deprecated Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip)
|
|
3166
|
+
* instead. The 2025 push-style server-to-client request model is replaced by input_required
|
|
3167
|
+
* results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the
|
|
3168
|
+
* legacy path.
|
|
3169
|
+
*/
|
|
3170
|
+
elicitInput(params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions): Promise<ElicitResult>;
|
|
3171
|
+
/**
|
|
3172
|
+
* The capability-check-free core of {@linkcode elicitInput}. The shim
|
|
3173
|
+
* uses it because its gate differs from the public checks: a bare
|
|
3174
|
+
* `elicitation: {}` counts as form support (the pre-mode rule), and
|
|
3175
|
+
* accepted content passes through unvalidated for parity with the
|
|
3176
|
+
* modern client driver (handlers validate via the schema-aware
|
|
3177
|
+
* `acceptedContent` overload and can re-ask).
|
|
3178
|
+
*/
|
|
3179
|
+
private _sendElicitationLeg;
|
|
3180
|
+
/**
|
|
3181
|
+
* Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete`
|
|
3182
|
+
* notification for the specified elicitation ID.
|
|
3183
|
+
*
|
|
3184
|
+
* The notification (and the `elicitationId` it references) exists only on protocol revision
|
|
3185
|
+
* 2025-11-25 — the 2026-07-28 revision removed both. On a connection negotiated at 2026-07-28 the
|
|
3186
|
+
* returned callback rejects with a typed local error before anything reaches the transport
|
|
3187
|
+
* (the method is not part of that revision's wire registry).
|
|
3188
|
+
*
|
|
3189
|
+
* @param elicitationId The ID of the elicitation to mark as complete.
|
|
3190
|
+
* @param options Optional notification options. Useful when the completion notification should be related to a prior request.
|
|
3191
|
+
* @returns A function that emits the completion notification when awaited.
|
|
3192
|
+
*/
|
|
3193
|
+
createElicitationCompletionNotifier(elicitationId: string, options?: NotificationOptions): () => Promise<void>;
|
|
3194
|
+
/**
|
|
3195
|
+
* Requests the list of roots from the client.
|
|
3196
|
+
*
|
|
3197
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
3198
|
+
* Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
|
|
3199
|
+
* or migrate to passing paths via tool parameters, resource URIs, or configuration. The 2025
|
|
3200
|
+
* push-style server-to-client request model is replaced by input_required results in the
|
|
3201
|
+
* 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.
|
|
3202
|
+
*/
|
|
3203
|
+
listRoots(params?: ListRootsRequest['params'], options?: RequestOptions): Promise<ListRootsResult>;
|
|
3204
|
+
/**
|
|
3205
|
+
* Sends a logging message to the client, if connected.
|
|
3206
|
+
* Note: You only need to send the parameters object, not the entire JSON-RPC message.
|
|
3207
|
+
* @see {@linkcode LoggingMessageNotification}
|
|
3208
|
+
* @param params
|
|
3209
|
+
* @param sessionId Optional for stateless transports and backward compatibility.
|
|
3210
|
+
*
|
|
3211
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
3212
|
+
* Remains functional during the deprecation window (at least twelve months).
|
|
3213
|
+
* Migrate to stderr logging (STDIO servers) or OpenTelemetry.
|
|
3214
|
+
*/
|
|
3215
|
+
sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise<void>;
|
|
3216
|
+
sendResourceUpdated(params: ResourceUpdatedNotification['params']): Promise<void>;
|
|
3217
|
+
sendResourceListChanged(): Promise<void>;
|
|
3218
|
+
sendToolListChanged(): Promise<void>;
|
|
3219
|
+
sendPromptListChanged(): Promise<void>;
|
|
3220
|
+
}
|
|
3221
|
+
//#endregion
|
|
3222
|
+
//#region src/server/mcp.d.ts
|
|
3223
|
+
/**
|
|
3224
|
+
* Options for {@linkcode McpServer}: everything {@linkcode ServerOptions} accepts, plus `maxToolInputElements`.
|
|
3225
|
+
*/
|
|
3226
|
+
type McpServerOptions = ServerOptions & {
|
|
3227
|
+
/**
|
|
3228
|
+
* Largest combined number of array elements and object members a single `tools/call` `arguments` payload may contain.
|
|
3229
|
+
* A number of at least 1; unset or `Infinity` means no limit.
|
|
3230
|
+
*/
|
|
3231
|
+
maxToolInputElements?: number;
|
|
3232
|
+
};
|
|
3233
|
+
/**
|
|
3234
|
+
* High-level MCP server that provides a simpler API for working with resources, tools, and prompts.
|
|
3235
|
+
* For advanced usage (like sending notifications or setting custom request handlers), use the underlying
|
|
3236
|
+
* {@linkcode Server} instance available via the {@linkcode McpServer.server | server} property.
|
|
3237
|
+
*
|
|
3238
|
+
* @example
|
|
3239
|
+
* ```ts source="./mcp.examples.ts#McpServer_basicUsage"
|
|
3240
|
+
* const server = new McpServer({
|
|
3241
|
+
* name: 'my-server',
|
|
3242
|
+
* version: '1.0.0'
|
|
3243
|
+
* });
|
|
3244
|
+
* ```
|
|
3245
|
+
*/
|
|
3246
|
+
declare class McpServer {
|
|
3247
|
+
/**
|
|
3248
|
+
* The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.
|
|
3249
|
+
*/
|
|
3250
|
+
readonly server: Server;
|
|
3251
|
+
private readonly _maxToolInputElements;
|
|
3252
|
+
private _registeredResources;
|
|
3253
|
+
private _registeredResourceTemplates;
|
|
3254
|
+
private _registeredTools;
|
|
3255
|
+
private _registeredPrompts;
|
|
3256
|
+
/** Per-tool JSON-converted `inputSchema`, filled on first use by `toolInputSchemaJson()`. */
|
|
3257
|
+
private _toolInputSchemaJson;
|
|
3258
|
+
/**
|
|
3259
|
+
* The JSON-serialized `inputSchema` of a registered tool, or `undefined`
|
|
3260
|
+
* when no such tool is registered. Used by the HTTP entry's pre-dispatch
|
|
3261
|
+
* SEP-2243 `Mcp-Param-*` validation step (which needs the same JSON Schema
|
|
3262
|
+
* `tools/list` would emit, before dispatch reaches the handler).
|
|
3263
|
+
*
|
|
3264
|
+
* @internal
|
|
3265
|
+
*/
|
|
3266
|
+
toolInputSchemaJson(name: string): Record<string, unknown> | undefined;
|
|
3267
|
+
constructor(serverInfo: Implementation, options?: McpServerOptions);
|
|
3268
|
+
/**
|
|
3269
|
+
* Attaches to the given transport, starts it, and starts listening for messages.
|
|
3270
|
+
*
|
|
3271
|
+
* The `server` object assumes ownership of the {@linkcode Transport}, replacing any callbacks that have already been set, and expects that it is the only user of the {@linkcode Transport} instance going forward.
|
|
3272
|
+
*
|
|
3273
|
+
* @example
|
|
3274
|
+
* ```ts source="./mcp.examples.ts#McpServer_connect_stdio"
|
|
3275
|
+
* const server = new McpServer({ name: 'my-server', version: '1.0.0' });
|
|
3276
|
+
* const transport = new StdioServerTransport();
|
|
3277
|
+
* await server.connect(transport);
|
|
3278
|
+
* ```
|
|
3279
|
+
*/
|
|
3280
|
+
connect(transport: Transport): Promise<void>;
|
|
3281
|
+
/**
|
|
3282
|
+
* Closes the connection.
|
|
3283
|
+
*/
|
|
3284
|
+
close(): Promise<void>;
|
|
3285
|
+
/** @internal */
|
|
3286
|
+
resolveScopeChallenge: ScopeChallengeHandler;
|
|
3287
|
+
private _toolHandlersInitialized;
|
|
3288
|
+
private setToolRequestHandlers;
|
|
3289
|
+
/**
|
|
3290
|
+
* Creates a tool error result.
|
|
3291
|
+
*
|
|
3292
|
+
* @param errorMessage - The error message.
|
|
3293
|
+
* @returns The tool error result.
|
|
3294
|
+
*/
|
|
3295
|
+
private createToolError;
|
|
3296
|
+
/**
|
|
3297
|
+
* Validates tool input arguments against the tool's input schema.
|
|
3298
|
+
*/
|
|
3299
|
+
private validateToolInput;
|
|
3300
|
+
/**
|
|
3301
|
+
* Validates tool output against the tool's output schema.
|
|
3302
|
+
*/
|
|
3303
|
+
private validateToolOutput;
|
|
3304
|
+
/**
|
|
3305
|
+
* Executes a tool handler.
|
|
3306
|
+
*/
|
|
3307
|
+
private executeToolHandler;
|
|
3308
|
+
private _completionHandlerInitialized;
|
|
3309
|
+
private setCompletionRequestHandler;
|
|
3310
|
+
private handlePromptCompletion;
|
|
3311
|
+
private handleResourceCompletion;
|
|
3312
|
+
private _resourceHandlersInitialized;
|
|
3313
|
+
private setResourceRequestHandlers;
|
|
3314
|
+
private _promptHandlersInitialized;
|
|
3315
|
+
private setPromptRequestHandlers;
|
|
3316
|
+
/**
|
|
3317
|
+
* Registers a resource with a config object and callback.
|
|
3318
|
+
* For static resources, use a URI string. For dynamic resources, use a {@linkcode ResourceTemplate}.
|
|
3319
|
+
*
|
|
3320
|
+
* @example
|
|
3321
|
+
* ```ts source="./mcp.examples.ts#McpServer_registerResource_static"
|
|
3322
|
+
* server.registerResource(
|
|
3323
|
+
* 'config',
|
|
3324
|
+
* 'config://app',
|
|
3325
|
+
* {
|
|
3326
|
+
* title: 'Application Config',
|
|
3327
|
+
* mimeType: 'text/plain'
|
|
3328
|
+
* },
|
|
3329
|
+
* async uri => ({
|
|
3330
|
+
* contents: [{ uri: uri.href, text: 'App configuration here' }]
|
|
3331
|
+
* })
|
|
3332
|
+
* );
|
|
3333
|
+
* ```
|
|
3334
|
+
*/
|
|
3335
|
+
registerResource(name: string, uriOrTemplate: string, config: ResourceMetadata & {
|
|
3336
|
+
cacheHint?: CacheHint;
|
|
3337
|
+
scopeChallenge?: ScopeChallengeHandler;
|
|
3338
|
+
}, readCallback: ReadResourceCallback): RegisteredResource;
|
|
3339
|
+
registerResource(name: string, uriOrTemplate: ResourceTemplate, config: ResourceMetadata & {
|
|
3340
|
+
cacheHint?: CacheHint;
|
|
3341
|
+
scopeChallenge?: ScopeChallengeHandler;
|
|
3342
|
+
}, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate;
|
|
3343
|
+
private _createRegisteredResource;
|
|
3344
|
+
private _createRegisteredResourceTemplate;
|
|
3345
|
+
private _createRegisteredPrompt;
|
|
3346
|
+
private _createRegisteredTool;
|
|
3347
|
+
/**
|
|
3348
|
+
* Registers a tool with a config object and callback.
|
|
3349
|
+
*
|
|
3350
|
+
* @example
|
|
3351
|
+
* ```ts source="./mcp.examples.ts#McpServer_registerTool_basic"
|
|
3352
|
+
* server.registerTool(
|
|
3353
|
+
* 'calculate-bmi',
|
|
3354
|
+
* {
|
|
3355
|
+
* title: 'BMI Calculator',
|
|
3356
|
+
* description: 'Calculate Body Mass Index',
|
|
3357
|
+
* inputSchema: z.object({
|
|
3358
|
+
* weightKg: z.number(),
|
|
3359
|
+
* heightM: z.number()
|
|
3360
|
+
* }),
|
|
3361
|
+
* outputSchema: z.object({ bmi: z.number() })
|
|
3362
|
+
* },
|
|
3363
|
+
* async ({ weightKg, heightM }) => {
|
|
3364
|
+
* const output = { bmi: weightKg / (heightM * heightM) };
|
|
3365
|
+
* return {
|
|
3366
|
+
* content: [{ type: 'text', text: JSON.stringify(output) }],
|
|
3367
|
+
* structuredContent: output
|
|
3368
|
+
* };
|
|
3369
|
+
* }
|
|
3370
|
+
* );
|
|
3371
|
+
* ```
|
|
3372
|
+
*/
|
|
3373
|
+
registerTool<OutputArgs extends StandardSchemaWithJSON, InputArgs extends StandardSchemaWithJSON | undefined = undefined>(name: string, config: {
|
|
3374
|
+
title?: string;
|
|
3375
|
+
description?: string;
|
|
3376
|
+
inputSchema?: InputArgs;
|
|
3377
|
+
outputSchema?: OutputArgs;
|
|
3378
|
+
annotations?: ToolAnnotations;
|
|
3379
|
+
icons?: Icon[];
|
|
3380
|
+
/** Determines whether this tool call needs an OAuth scope challenge. */
|
|
3381
|
+
scopeChallenge?: ScopeChallengeHandler;
|
|
3382
|
+
_meta?: Record<string, unknown>;
|
|
3383
|
+
}, cb: ToolCallback<InputArgs>): RegisteredTool;
|
|
3384
|
+
/** @deprecated Wrap with `z.object({...})` instead. Raw-shape form: `inputSchema`/`outputSchema` may be a plain `{ field: z.string() }` record; it is auto-wrapped with `z.object()`. */
|
|
3385
|
+
registerTool<InputArgs extends ZodRawShape, OutputArgs extends ZodRawShape | StandardSchemaWithJSON | undefined = undefined>(name: string, config: {
|
|
3386
|
+
title?: string;
|
|
3387
|
+
description?: string;
|
|
3388
|
+
inputSchema?: InputArgs;
|
|
3389
|
+
outputSchema?: OutputArgs;
|
|
3390
|
+
annotations?: ToolAnnotations;
|
|
3391
|
+
icons?: Icon[];
|
|
3392
|
+
scopeChallenge?: ScopeChallengeHandler;
|
|
3393
|
+
_meta?: Record<string, unknown>;
|
|
3394
|
+
}, cb: LegacyToolCallback<InputArgs>): RegisteredTool;
|
|
3395
|
+
/**
|
|
3396
|
+
* Registers a prompt with a config object and callback.
|
|
3397
|
+
*
|
|
3398
|
+
* @example
|
|
3399
|
+
* ```ts source="./mcp.examples.ts#McpServer_registerPrompt_basic"
|
|
3400
|
+
* server.registerPrompt(
|
|
3401
|
+
* 'review-code',
|
|
3402
|
+
* {
|
|
3403
|
+
* title: 'Code Review',
|
|
3404
|
+
* description: 'Review code for best practices',
|
|
3405
|
+
* argsSchema: z.object({ code: z.string() })
|
|
3406
|
+
* },
|
|
3407
|
+
* ({ code }) => ({
|
|
3408
|
+
* messages: [
|
|
3409
|
+
* {
|
|
3410
|
+
* role: 'user' as const,
|
|
3411
|
+
* content: {
|
|
3412
|
+
* type: 'text' as const,
|
|
3413
|
+
* text: `Please review this code:\n\n${code}`
|
|
3414
|
+
* }
|
|
3415
|
+
* }
|
|
3416
|
+
* ]
|
|
3417
|
+
* })
|
|
3418
|
+
* );
|
|
3419
|
+
* ```
|
|
3420
|
+
*/
|
|
3421
|
+
registerPrompt(name: string, config: {
|
|
3422
|
+
title?: string;
|
|
3423
|
+
description?: string;
|
|
3424
|
+
argsSchema?: undefined;
|
|
3425
|
+
icons?: Icon[];
|
|
3426
|
+
/** Determines whether this prompt retrieval needs an OAuth scope challenge. */
|
|
3427
|
+
scopeChallenge?: ScopeChallengeHandler;
|
|
3428
|
+
_meta?: Record<string, unknown>;
|
|
3429
|
+
}, cb: PromptCallback): RegisteredPrompt;
|
|
3430
|
+
registerPrompt<Args extends StandardSchemaWithJSON>(name: string, config: {
|
|
3431
|
+
title?: string;
|
|
3432
|
+
description?: string;
|
|
3433
|
+
argsSchema?: Args;
|
|
3434
|
+
icons?: Icon[];
|
|
3435
|
+
/** Determines whether this prompt retrieval needs an OAuth scope challenge. */
|
|
3436
|
+
scopeChallenge?: ScopeChallengeHandler;
|
|
3437
|
+
_meta?: Record<string, unknown>;
|
|
3438
|
+
}, cb: PromptCallback<Args>): RegisteredPrompt;
|
|
3439
|
+
/** @deprecated Wrap with `z.object({...})` instead. Raw-shape form: `argsSchema` may be a plain `{ field: z.string() }` record; it is auto-wrapped with `z.object()`. */
|
|
3440
|
+
registerPrompt<Args extends ZodRawShape>(name: string, config: {
|
|
3441
|
+
title?: string;
|
|
3442
|
+
description?: string;
|
|
3443
|
+
argsSchema?: Args;
|
|
3444
|
+
icons?: Icon[];
|
|
3445
|
+
scopeChallenge?: ScopeChallengeHandler;
|
|
3446
|
+
_meta?: Record<string, unknown>;
|
|
3447
|
+
}, cb: LegacyPromptCallback<Args>): RegisteredPrompt;
|
|
3448
|
+
/**
|
|
3449
|
+
* Checks if the server is connected to a transport.
|
|
3450
|
+
* @returns `true` if the server is connected
|
|
3451
|
+
*/
|
|
3452
|
+
isConnected(): boolean;
|
|
3453
|
+
/**
|
|
3454
|
+
* Sends a logging message to the client, if connected.
|
|
3455
|
+
* Note: You only need to send the parameters object, not the entire JSON-RPC message.
|
|
3456
|
+
* @see {@linkcode LoggingMessageNotification}
|
|
3457
|
+
* @param params
|
|
3458
|
+
* @param sessionId Optional for stateless transports and backward compatibility.
|
|
3459
|
+
*
|
|
3460
|
+
* @example
|
|
3461
|
+
* ```ts source="./mcp.examples.ts#McpServer_sendLoggingMessage_basic"
|
|
3462
|
+
* await server.sendLoggingMessage({
|
|
3463
|
+
* level: 'info',
|
|
3464
|
+
* data: 'Processing complete'
|
|
3465
|
+
* });
|
|
3466
|
+
* ```
|
|
3467
|
+
*
|
|
3468
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
3469
|
+
* Remains functional during the deprecation window (at least twelve months).
|
|
3470
|
+
* Migrate to stderr logging (STDIO servers) or OpenTelemetry.
|
|
3471
|
+
*/
|
|
3472
|
+
sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise<void>;
|
|
3473
|
+
/**
|
|
3474
|
+
* Sends a resource list changed event to the client, if connected.
|
|
3475
|
+
*/
|
|
3476
|
+
sendResourceListChanged(): void;
|
|
3477
|
+
/**
|
|
3478
|
+
* Sends a tool list changed event to the client, if connected.
|
|
3479
|
+
*/
|
|
3480
|
+
sendToolListChanged(): void;
|
|
3481
|
+
/**
|
|
3482
|
+
* Sends a prompt list changed event to the client, if connected.
|
|
3483
|
+
*/
|
|
3484
|
+
sendPromptListChanged(): void;
|
|
3485
|
+
}
|
|
3486
|
+
/**
|
|
3487
|
+
* A callback to complete one variable within a resource template's URI template.
|
|
3488
|
+
*/
|
|
3489
|
+
type CompleteResourceTemplateCallback = (value: string, context?: {
|
|
3490
|
+
arguments?: Record<string, string>;
|
|
3491
|
+
}) => string[] | Promise<string[]>;
|
|
3492
|
+
/**
|
|
3493
|
+
* A resource template combines a URI pattern with optional functionality to enumerate
|
|
3494
|
+
* all resources matching that pattern.
|
|
3495
|
+
*/
|
|
3496
|
+
declare class ResourceTemplate {
|
|
3497
|
+
private _callbacks;
|
|
3498
|
+
private _uriTemplate;
|
|
3499
|
+
constructor(uriTemplate: string | UriTemplate, _callbacks: {
|
|
3500
|
+
/**
|
|
3501
|
+
* A callback to list all resources matching this template. This is required to be specified, even if `undefined`, to avoid accidentally forgetting resource listing.
|
|
3502
|
+
*/
|
|
3503
|
+
list: ListResourcesCallback | undefined;
|
|
3504
|
+
/**
|
|
3505
|
+
* An optional callback to autocomplete variables within the URI template. Useful for clients and users to discover possible values.
|
|
3506
|
+
*/
|
|
3507
|
+
complete?: {
|
|
3508
|
+
[variable: string]: CompleteResourceTemplateCallback;
|
|
3509
|
+
};
|
|
3510
|
+
});
|
|
3511
|
+
/**
|
|
3512
|
+
* Gets the URI template pattern.
|
|
3513
|
+
*/
|
|
3514
|
+
get uriTemplate(): UriTemplate;
|
|
3515
|
+
/**
|
|
3516
|
+
* Gets the list callback, if one was provided.
|
|
3517
|
+
*/
|
|
3518
|
+
get listCallback(): ListResourcesCallback | undefined;
|
|
3519
|
+
/**
|
|
3520
|
+
* Gets the callback for completing a specific URI template variable, if one was provided.
|
|
3521
|
+
*/
|
|
3522
|
+
completeCallback(variable: string): CompleteResourceTemplateCallback | undefined;
|
|
3523
|
+
}
|
|
3524
|
+
/**
|
|
3525
|
+
* A plain record of Zod field schemas, e.g. `{ name: z.string() }`. Accepted by
|
|
3526
|
+
* `registerTool`/`registerPrompt` as a shorthand; auto-wrapped with `z.object()`.
|
|
3527
|
+
* Zod schemas only — `z.object()` cannot wrap other Standard Schema libraries.
|
|
3528
|
+
*/
|
|
3529
|
+
type ZodRawShape = Record<string, z.ZodType>;
|
|
3530
|
+
/** Infers the parsed-output type of a {@linkcode ZodRawShape}. */
|
|
3531
|
+
type InferRawShape<S extends ZodRawShape> = z.infer<z.ZodObject<S>>;
|
|
3532
|
+
/** {@linkcode ToolCallback} variant used when `inputSchema` is a {@linkcode ZodRawShape}. */
|
|
3533
|
+
type LegacyToolCallback<Args extends ZodRawShape | undefined> = Args extends ZodRawShape ? (args: InferRawShape<Args>, ctx: ServerContext) => CallToolResult | InputRequiredResult | Promise<CallToolResult | InputRequiredResult> : (ctx: ServerContext) => CallToolResult | InputRequiredResult | Promise<CallToolResult | InputRequiredResult>;
|
|
3534
|
+
/** {@linkcode PromptCallback} variant used when `argsSchema` is a {@linkcode ZodRawShape}. */
|
|
3535
|
+
type LegacyPromptCallback<Args extends ZodRawShape | undefined> = Args extends ZodRawShape ? (args: InferRawShape<Args>, ctx: ServerContext) => GetPromptResult | InputRequiredResult | Promise<GetPromptResult | InputRequiredResult> : (ctx: ServerContext) => GetPromptResult | InputRequiredResult | Promise<GetPromptResult | InputRequiredResult>;
|
|
3536
|
+
type BaseToolCallback<SendResultT extends Result$1, Ctx extends ServerContext, Args extends StandardSchemaWithJSON | undefined> = Args extends StandardSchemaWithJSON ? (args: StandardSchemaWithJSON.InferOutput<Args>, ctx: Ctx) => SendResultT | Promise<SendResultT> : (ctx: Ctx) => SendResultT | Promise<SendResultT>;
|
|
3537
|
+
/**
|
|
3538
|
+
* Callback for a tool handler registered with {@linkcode McpServer.registerTool}.
|
|
3539
|
+
*/
|
|
3540
|
+
type ToolCallback<Args extends StandardSchemaWithJSON | undefined = undefined> = BaseToolCallback<CallToolResult | InputRequiredResult, ServerContext, Args>;
|
|
3541
|
+
/**
|
|
3542
|
+
* Tool handler callback type.
|
|
3543
|
+
*/
|
|
3544
|
+
type AnyToolHandler<Args extends StandardSchemaWithJSON | undefined = undefined> = ToolCallback<Args>;
|
|
3545
|
+
/**
|
|
3546
|
+
* Internal executor type that encapsulates handler invocation with proper types.
|
|
3547
|
+
*/
|
|
3548
|
+
type ToolExecutor = (args: unknown, ctx: ServerContext) => Promise<CallToolResult | InputRequiredResult>;
|
|
3549
|
+
type RegisteredTool = {
|
|
3550
|
+
title?: string;
|
|
3551
|
+
description?: string;
|
|
3552
|
+
inputSchema?: StandardSchemaWithJSON;
|
|
3553
|
+
outputSchema?: StandardSchemaWithJSON;
|
|
3554
|
+
/**
|
|
3555
|
+
* @hidden
|
|
3556
|
+
* The converted JSON Schema of `outputSchema`, memoised on first use (and on
|
|
3557
|
+
* `update({outputSchema})`) so the `tools/call` handler passes the SAME advertised schema
|
|
3558
|
+
* `tools/list` emits to the wire codec's `projectCallToolResult` — the SEP-2106 `{result:…}`
|
|
3559
|
+
* wrap predicate follows the schema's root, never the runtime value shape. `undefined` when
|
|
3560
|
+
* no `outputSchema` is registered or its conversion threw (see {@link convertOutputSchemaJson}).
|
|
3561
|
+
*/
|
|
3562
|
+
outputSchemaJson?: Record<string, unknown>;
|
|
3563
|
+
annotations?: ToolAnnotations;
|
|
3564
|
+
icons?: Icon[];
|
|
3565
|
+
execution?: ToolExecution;
|
|
3566
|
+
scopeChallenge?: ScopeChallengeHandler;
|
|
3567
|
+
_meta?: Record<string, unknown>;
|
|
3568
|
+
handler: AnyToolHandler<StandardSchemaWithJSON | undefined>;
|
|
3569
|
+
/** @hidden */
|
|
3570
|
+
executor: ToolExecutor;
|
|
3571
|
+
enabled: boolean;
|
|
3572
|
+
enable(): void;
|
|
3573
|
+
disable(): void;
|
|
3574
|
+
update(updates: {
|
|
3575
|
+
name?: string | null;
|
|
3576
|
+
title?: string;
|
|
3577
|
+
description?: string;
|
|
3578
|
+
paramsSchema?: StandardSchemaWithJSON;
|
|
3579
|
+
outputSchema?: StandardSchemaWithJSON;
|
|
3580
|
+
annotations?: ToolAnnotations;
|
|
3581
|
+
icons?: Icon[];
|
|
3582
|
+
scopeChallenge?: ScopeChallengeHandler | null;
|
|
3583
|
+
_meta?: Record<string, unknown>;
|
|
3584
|
+
callback?: ToolCallback<StandardSchemaWithJSON>;
|
|
3585
|
+
enabled?: boolean;
|
|
3586
|
+
}): void;
|
|
3587
|
+
remove(): void;
|
|
3588
|
+
};
|
|
3589
|
+
/**
|
|
3590
|
+
* Additional, optional information for annotating a resource.
|
|
3591
|
+
*/
|
|
3592
|
+
type ResourceMetadata = Omit<Resource, 'uri' | 'name'>;
|
|
3593
|
+
/**
|
|
3594
|
+
* Callback to list all resources matching a given template.
|
|
3595
|
+
*/
|
|
3596
|
+
type ListResourcesCallback = (ctx: ServerContext) => ListResourcesResult | Promise<ListResourcesResult>;
|
|
3597
|
+
/**
|
|
3598
|
+
* Callback to read a resource at a given URI.
|
|
3599
|
+
*/
|
|
3600
|
+
type ReadResourceCallback = (uri: URL, ctx: ServerContext) => ReadResourceResult | InputRequiredResult | Promise<ReadResourceResult | InputRequiredResult>;
|
|
3601
|
+
type RegisteredResource = {
|
|
3602
|
+
name: string;
|
|
3603
|
+
title?: string;
|
|
3604
|
+
metadata?: ResourceMetadata;
|
|
3605
|
+
/** Cache hint applied to this resource's `resources/read` results on the 2026-07-28 revision. */
|
|
3606
|
+
cacheHint?: CacheHint;
|
|
3607
|
+
scopeChallenge?: ScopeChallengeHandler;
|
|
3608
|
+
readCallback: ReadResourceCallback;
|
|
3609
|
+
enabled: boolean;
|
|
3610
|
+
enable(): void;
|
|
3611
|
+
disable(): void;
|
|
3612
|
+
update(updates: {
|
|
3613
|
+
name?: string;
|
|
3614
|
+
title?: string;
|
|
3615
|
+
uri?: string | null;
|
|
3616
|
+
metadata?: ResourceMetadata;
|
|
3617
|
+
scopeChallenge?: ScopeChallengeHandler | null;
|
|
3618
|
+
callback?: ReadResourceCallback;
|
|
3619
|
+
enabled?: boolean;
|
|
3620
|
+
}): void;
|
|
3621
|
+
remove(): void;
|
|
3622
|
+
};
|
|
3623
|
+
/**
|
|
3624
|
+
* Callback to read a resource at a given URI, following a filled-in URI template.
|
|
3625
|
+
*/
|
|
3626
|
+
type ReadResourceTemplateCallback = (uri: URL, variables: Variables, ctx: ServerContext) => ReadResourceResult | InputRequiredResult | Promise<ReadResourceResult | InputRequiredResult>;
|
|
3627
|
+
type RegisteredResourceTemplate = {
|
|
3628
|
+
resourceTemplate: ResourceTemplate;
|
|
3629
|
+
title?: string;
|
|
3630
|
+
metadata?: ResourceMetadata;
|
|
3631
|
+
/** Cache hint applied to this template's `resources/read` results on the 2026-07-28 revision. */
|
|
3632
|
+
cacheHint?: CacheHint;
|
|
3633
|
+
scopeChallenge?: ScopeChallengeHandler;
|
|
3634
|
+
readCallback: ReadResourceTemplateCallback;
|
|
3635
|
+
enabled: boolean;
|
|
3636
|
+
enable(): void;
|
|
3637
|
+
disable(): void;
|
|
3638
|
+
update(updates: {
|
|
3639
|
+
name?: string | null;
|
|
3640
|
+
title?: string;
|
|
3641
|
+
template?: ResourceTemplate;
|
|
3642
|
+
metadata?: ResourceMetadata;
|
|
3643
|
+
scopeChallenge?: ScopeChallengeHandler | null;
|
|
3644
|
+
callback?: ReadResourceTemplateCallback;
|
|
3645
|
+
enabled?: boolean;
|
|
3646
|
+
}): void;
|
|
3647
|
+
remove(): void;
|
|
3648
|
+
};
|
|
3649
|
+
type PromptCallback<Args extends StandardSchemaWithJSON | undefined = undefined> = Args extends StandardSchemaWithJSON ? (args: StandardSchemaWithJSON.InferOutput<Args>, ctx: ServerContext) => GetPromptResult | InputRequiredResult | Promise<GetPromptResult | InputRequiredResult> : (ctx: ServerContext) => GetPromptResult | InputRequiredResult | Promise<GetPromptResult | InputRequiredResult>;
|
|
3650
|
+
/**
|
|
3651
|
+
* Internal handler type that encapsulates parsing and callback invocation.
|
|
3652
|
+
* This allows type-safe handling without runtime type assertions.
|
|
3653
|
+
*/
|
|
3654
|
+
type PromptHandler = (args: Record<string, unknown> | undefined, ctx: ServerContext) => Promise<GetPromptResult | InputRequiredResult>;
|
|
3655
|
+
type RegisteredPrompt = {
|
|
3656
|
+
title?: string;
|
|
3657
|
+
description?: string;
|
|
3658
|
+
argsSchema?: StandardSchemaWithJSON;
|
|
3659
|
+
icons?: Icon[];
|
|
3660
|
+
scopeChallenge?: ScopeChallengeHandler;
|
|
3661
|
+
_meta?: Record<string, unknown>;
|
|
3662
|
+
/** @hidden */
|
|
3663
|
+
handler: PromptHandler;
|
|
3664
|
+
enabled: boolean;
|
|
3665
|
+
enable(): void;
|
|
3666
|
+
disable(): void;
|
|
3667
|
+
update<Args extends StandardSchemaWithJSON>(updates: {
|
|
3668
|
+
name?: string | null;
|
|
3669
|
+
title?: string;
|
|
3670
|
+
description?: string;
|
|
3671
|
+
argsSchema?: Args;
|
|
3672
|
+
icons?: Icon[];
|
|
3673
|
+
scopeChallenge?: ScopeChallengeHandler | null;
|
|
3674
|
+
_meta?: Record<string, unknown>;
|
|
3675
|
+
callback?: PromptCallback<Args>;
|
|
3676
|
+
enabled?: boolean;
|
|
3677
|
+
}): void;
|
|
3678
|
+
remove(): void;
|
|
3679
|
+
};
|
|
3680
|
+
//#endregion
|
|
3681
|
+
export { isSpecType as $, OAuthTokens as $a, TextContent as $i, JSONRPCErrorResponse as $n, ReadResourceRequest as $r, ClientResult as $t, CacheHint as A, SUBSCRIPTION_ID_META_KEY as Aa, ServerNotification as Ai, GetTaskPayloadRequest as An, ModelHint as Ar, InboundHttpRequest as At, Protocol as B, OAuthError as Ba, SubscriptionsAcknowledgedNotification as Bi, InitializeRequestParams as Bn, PaginatedResult as Br, BaseMetadata as Bt, InMemoryTransport as C, LATEST_PROTOCOL_VERSION as Ca, Role as Ci, ElicitationCompleteNotificationParams as Cn, LoggingMessageNotification as Cr, inputRequired as Ct, STDIO_DEFAULT_MAX_BUFFER_SIZE as D, PROTOCOL_VERSION_META_KEY as Da, SamplingMessage as Di, GetPromptRequest as Dn, MetaObject as Dr, StandardSchemaV1Sync as Dt, ReadBuffer as E, PARSE_ERROR as Ea, SamplingContent as Ei, EnumSchema as En, MessageExtraInfo as Er, StandardSchemaV1 as Et, BaseContext as F, resourceUrlFromServerUrl as Fa, SingleSelectEnumSchema as Fi, Icon as Fn, NotificationParams as Fr, InboundValidationRung as Ft, ServerContext as G, OAuthClientInformationFull as Ga, SubscriptionsListenResultMeta as Gi, InputRequiredResult as Gn, ProgressNotification as Gr, CallToolResult as Gt, RequestHandlerSchemas as H, AuthorizationServerMetadata as Ha, SubscriptionsListenRequest as Hi, InitializedNotification as Hn, PingRequest as Hr, BooleanSchema as Ht, ClientContext as I, SdkError as Ia, StringSchema as Ii, Icons as In, NotificationTypeMap as Ir, classifyInboundRequest as It, Transport as J, OAuthClientRegistrationError as Ja, TaskCreationParams as Ji, InternalError as Jn, Prompt as Jr, CancelledNotification as Jt, mergeCapabilities as K, OAuthClientInformationMixed as Ka, Task as Ki, InputResponse as Kn, ProgressNotificationParams as Kr, CancelTaskRequest as Kt, DEFAULT_REQUEST_TIMEOUT_MSEC as L, SdkErrorCode as La, SubscribeRequest as Li, ImageContent as Ln, NumberSchema as Lr, Annotations as Lt, ProtocolEra as M, TRACEPARENT_META_KEY as Ma, ServerResult as Mi, GetTaskRequest as Mn, MultiSelectEnumSchema as Mr, InboundLegacyRoute as Mt, getDisplayName as N, TRACESTATE_META_KEY as Na, SetLevelRequest as Ni, GetTaskResult as Nn, Notification as Nr, InboundLegacyRouteReason as Nt, deserializeMessage as O, RELATED_TASK_META_KEY as Oa, SamplingMessageContentBlock as Oi, GetPromptRequestParams as On, MethodNotFoundError as Or, StandardSchemaWithJSON as Ot, isJsonContentType as P, checkResourceAllowed as Pa, SetLevelRequestParams as Pi, HandlerResultTypeMap as Pn, NotificationMethod as Pr, InboundModernRoute as Pt, SpecTypes as Q, OAuthTokenRevocationRequest as Qa, TaskStatusNotificationParams as Qi, JSONObject as Qn, PromptReference as Qr, ClientRequest as Qt, NotificationOptions as R, SdkHttpError as Ra, SubscribeRequestParams as Ri, Implementation as Rn, PaginatedRequest as Rr, AudioContent as Rt, preloadSchemas as S, JSONRPC_VERSION as Sa, ResultTypeMap as Si, ElicitationCompleteNotification as Sn, LoggingLevel as Sr, acceptedContent as St, Variables as T, METHOD_NOT_FOUND as Ta, RootsListChangedNotification as Ti, EmptyResult as Tn, MessageClassification as Tr, ElicitInputParams as Tt, RequestOptions as U, IdJagTokenExchangeResponse as Ua, SubscriptionsListenRequestParams as Ui, InputRequest as Un, PrimitiveSchemaDefinition as Ur, CallToolRequest as Ut, ProtocolOptions as V, OAuthErrorCode as Va, SubscriptionsAcknowledgedNotificationParams as Vi, InitializeResult as Vn, ParseError as Vr, BlobResourceContents as Vt, RequestStateAccessor as W, OAuthClientInformation as Wa, SubscriptionsListenResult as Wi, InputRequests as Wn, Progress as Wr, CallToolRequestParams as Wt, createFetchWithInit as X, OAuthMetadata as Xa, TaskStatus as Xi, InvalidRequestError as Xn, PromptListChangedNotification as Xr, ClientCapabilities as Xt, TransportSendOptions as Y, OAuthErrorResponse as Ya, TaskMetadata as Yi, InvalidParamsError as Yn, PromptArgument as Yr, CancelledNotificationParams as Yt, SpecTypeName as Z, OAuthProtectedResourceMetadata as Za, TaskStatusNotification as Zi, JSONArray as Zn, PromptMessage as Zr, ClientNotification as Zt, Server as _, CLIENT_INFO_META_KEY as _a, ResourceTemplateType as _i, ElicitRequest as _n, ListRootsResult as _r, UnsupportedProtocolVersionError as _t, McpServer as a, ToolChoice as aa, RequestMeta as ai, CompleteResult as an, JSONValue as ar, isInitializedNotification as at, ScopeChallengeHandler as b, INVALID_PARAMS as ba, Result$1 as bi, ElicitRequestURLParams as bn, ListToolsRequest as br, InputRequiredSpec as bt, ReadResourceCallback as c, ToolResultContent as ca, RequestMethod as ci, CreateMessageRequestParams as cn, ListChangedHandlers as cr, isJSONRPCNotification as ct, RegisteredResource as d, UnsubscribeRequestParams as da, Resource as di, CreateMessageResult as dn, ListPromptsResult as dr, isJSONRPCResultResponse as dt, TextResourceContents as ea, ReadResourceRequestParams as ei, CompatibilityCallToolResult as en, OpenIdProviderDiscoveryMetadata as eo, JSONRPCMessage as er, specTypeSchemas as et, RegisteredResourceTemplate as f, UnsupportedProtocolVersionErrorData as fa, ResourceContents as fi, CreateMessageResultWithTools as fn, ListResourceTemplatesRequest as fr, isTaskAugmentedRequestParams as ft, ToolCallback as g, CLIENT_CAPABILITIES_META_KEY as ga, ResourceTemplateReference as gi, DiscoverResult as gn, ListRootsRequest as gr, ResourceNotFoundError as gt, ResourceTemplate as h, BAGGAGE_META_KEY as ha, ResourceRequestParams as hi, DiscoverRequest as hn, ListResourcesResult as hr, ProtocolError as ht, ListResourcesCallback as i, ToolAnnotations as ia, RequestId as ii, CompleteRequestResourceTemplate as in, JSONRPCResultResponse as ir, isInitializeRequest as it, CacheScope as j, SUPPORTED_PROTOCOL_VERSIONS as ja, ServerRequest as ji, GetTaskPayloadResult as jn, ModelPreferences as jr, InboundLadderRejection as jt, serializeMessage as k, SERVER_INFO_META_KEY as ka, ServerCapabilities as ki, GetPromptResult as kn, MissingRequiredClientCapabilityErrorData as kr, InboundClassificationOutcome as kt, ReadResourceTemplateCallback as l, ToolUseContent as la, RequestParams as li, CreateMessageRequestParamsBase as ln, ListChangedOptions as lr, isJSONRPCRequest as lt, ResourceMetadata as m, UntitledSingleSelectEnumSchema as ma, ResourceListChangedNotification as mi, Cursor as mn, ListResourcesRequest as mr, MissingRequiredClientCapabilityError as mt, BaseToolCallback as n, TitledSingleSelectEnumSchema as na, RelatedTaskMetadata as ni, CompleteRequestParams as nn, StoredOAuthClientInformation as no, JSONRPCRequest as nr, assertCompleteRequestResourceTemplate as nt, McpServerOptions as o, ToolExecution as oa, RequestMetaEnvelope as oi, ContentBlock as on, LegacyTitledEnumSchema as or, isInputRequiredResult as ot, RegisteredTool as p, UntitledMultiSelectEnumSchema as pa, ResourceLink as pi, CreateTaskResult as pn, ListResourceTemplatesResult as pr, parseJSONRPCMessage as pt, FetchLike as q, OAuthClientMetadata as qa, TaskAugmentedRequestParams as qi, InputResponses as qn, ProgressToken as qr, CancelTaskResult as qt, CompleteResourceTemplateCallback as r, Tool as ra, Request as ri, CompleteRequestPrompt as rn, StoredOAuthTokens as ro, JSONRPCResponse as rr, isCallToolResult as rt, PromptCallback as s, ToolListChangedNotification as sa, RequestMetaObject as si, CreateMessageRequest as sn, ListChangedCallback as sr, isJSONRPCErrorResponse as st, AnyToolHandler as t, TitledMultiSelectEnumSchema as ta, ReadResourceResult as ti, CompleteRequest as tn, OpenIdProviderMetadata as to, JSONRPCNotification as tr, assertCompleteRequestPrompt as tt, RegisteredPrompt as u, UnsubscribeRequest as ua, RequestTypeMap as ui, CreateMessageRequestParamsWithTools as un, ListPromptsRequest as ur, isJSONRPCResponse as ut, ServerOptions as v, DEFAULT_NEGOTIATED_PROTOCOL_VERSION as va, ResourceUpdatedNotification as vi, ElicitRequestFormParams as vn, ListTasksRequest as vr, UrlElicitationRequiredError as vt, UriTemplate as w, LOG_LEVEL_META_KEY as wa, Root as wi, EmbeddedResource as wn, LoggingMessageNotificationParams as wr, inputResponse as wt, requireScopes as x, INVALID_REQUEST as xa, ResultMetaObject as xi, ElicitResult as xn, ListToolsResult as xr, InputResponseView as xt, ScopeChallenge as y, INTERNAL_ERROR as ya, ResourceUpdatedNotificationParams as yi, ElicitRequestParams as yn, ListTasksResult as yr, ProtocolErrorCode as yt, ProgressCallback as z, SdkHttpErrorData as za, SubscriptionFilter as zi, InitializeRequest as zn, PaginatedRequestParams as zr, AuthInfo as zt };
|
|
3682
|
+
//# sourceMappingURL=mcp-BCJHyo7l.d.mts.map
|