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
package/lib/node_modules/archgen-mcp/node_modules/@modelcontextprotocol/server/dist/mcp-uPg2RfP3.cjs
ADDED
|
@@ -0,0 +1,2293 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-Bnu9O96Y.cjs');
|
|
2
|
+
const require_src = require('./src-BvE2tDzk.cjs');
|
|
3
|
+
let _modelcontextprotocol_server__shims = require("@modelcontextprotocol/server/_shims");
|
|
4
|
+
let _modelcontextprotocol_core_internal = require("@modelcontextprotocol/core/internal");
|
|
5
|
+
|
|
6
|
+
//#region src/server/completable.ts
|
|
7
|
+
const COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
|
|
8
|
+
/**
|
|
9
|
+
* Wraps a schema to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts source="./completable.examples.ts#completable_basicUsage"
|
|
13
|
+
* server.registerPrompt(
|
|
14
|
+
* 'review-code',
|
|
15
|
+
* {
|
|
16
|
+
* title: 'Code Review',
|
|
17
|
+
* argsSchema: z.object({
|
|
18
|
+
* language: completable(z.string().describe('Programming language'), value =>
|
|
19
|
+
* ['typescript', 'javascript', 'python', 'rust', 'go'].filter(lang => lang.startsWith(value))
|
|
20
|
+
* )
|
|
21
|
+
* })
|
|
22
|
+
* },
|
|
23
|
+
* ({ language }) => ({
|
|
24
|
+
* messages: [
|
|
25
|
+
* {
|
|
26
|
+
* role: 'user' as const,
|
|
27
|
+
* content: {
|
|
28
|
+
* type: 'text' as const,
|
|
29
|
+
* text: `Review this ${language} code.`
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* ]
|
|
33
|
+
* })
|
|
34
|
+
* );
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @see {@linkcode server/mcp.McpServer.registerPrompt | McpServer.registerPrompt} for using completable schemas in prompt argument definitions
|
|
38
|
+
*/
|
|
39
|
+
function completable(schema, complete) {
|
|
40
|
+
Object.defineProperty(schema, COMPLETABLE_SYMBOL, {
|
|
41
|
+
value: { complete },
|
|
42
|
+
enumerable: false,
|
|
43
|
+
writable: false,
|
|
44
|
+
configurable: false
|
|
45
|
+
});
|
|
46
|
+
return schema;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Checks if a schema is completable (has completion metadata).
|
|
50
|
+
*/
|
|
51
|
+
function isCompletable(schema) {
|
|
52
|
+
return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Gets the completer callback from a completable schema, if it exists.
|
|
56
|
+
*/
|
|
57
|
+
function getCompleter(schema) {
|
|
58
|
+
return schema[COMPLETABLE_SYMBOL]?.complete;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/server/sseKeepAlive.ts
|
|
63
|
+
/** Default interval between SSE keep-alive comment frames. */
|
|
64
|
+
const DEFAULT_SSE_KEEP_ALIVE_MS = 15e3;
|
|
65
|
+
const MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
|
|
66
|
+
/** Arms an unref'd timer, or disables keep-alive for invalid delays. */
|
|
67
|
+
function armSseKeepAlive(intervalMs, onTick) {
|
|
68
|
+
if (!Number.isFinite(intervalMs) || intervalMs < 1) return;
|
|
69
|
+
const timer = setInterval(onTick, Math.min(intervalMs, MAX_TIMER_DELAY_MS));
|
|
70
|
+
timer.unref?.();
|
|
71
|
+
return timer;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/server/perRequestTransport.ts
|
|
76
|
+
let readClassification;
|
|
77
|
+
/**
|
|
78
|
+
* The per-request micro-transport: a real, connected `Transport` whose whole
|
|
79
|
+
* lifetime is one HTTP exchange. See the module documentation for the
|
|
80
|
+
* response shapes it produces.
|
|
81
|
+
*
|
|
82
|
+
* Connecting a `Server` binds the instance to the classified modern revision
|
|
83
|
+
* when its `supportedProtocolVersions` lists it and the SDK implements it.
|
|
84
|
+
*/
|
|
85
|
+
var PerRequestHTTPServerTransport = class {
|
|
86
|
+
static {
|
|
87
|
+
readClassification = (transport) => transport._classification;
|
|
88
|
+
}
|
|
89
|
+
onclose;
|
|
90
|
+
onerror;
|
|
91
|
+
onmessage;
|
|
92
|
+
_classification;
|
|
93
|
+
_responseMode;
|
|
94
|
+
_started = false;
|
|
95
|
+
_used = false;
|
|
96
|
+
_closed = false;
|
|
97
|
+
_terminalDelivered = false;
|
|
98
|
+
/**
|
|
99
|
+
* `true` only while the inbound message is being delivered synchronously
|
|
100
|
+
* to the connected protocol layer. The pre-handler gates (the era
|
|
101
|
+
* registry gate, the edge→instance handoff check, the missing-handler
|
|
102
|
+
* rejection) answer inside this window; request handlers always run
|
|
103
|
+
* after it (the protocol layer defers them to a microtask). An error
|
|
104
|
+
* sent inside the window is therefore ladder-originated, and an error
|
|
105
|
+
* sent after it is handler-produced.
|
|
106
|
+
*/
|
|
107
|
+
_dispatchWindowOpen = false;
|
|
108
|
+
_requestId;
|
|
109
|
+
_deferredResponse;
|
|
110
|
+
_sse;
|
|
111
|
+
_abortCleanup;
|
|
112
|
+
_keepAliveMs;
|
|
113
|
+
constructor(options) {
|
|
114
|
+
this._classification = options.classification;
|
|
115
|
+
this._responseMode = options.responseMode ?? "auto";
|
|
116
|
+
this._keepAliveMs = options.keepAliveMs ?? DEFAULT_SSE_KEEP_ALIVE_MS;
|
|
117
|
+
}
|
|
118
|
+
async start() {
|
|
119
|
+
if (this._started) throw new Error("PerRequestHTTPServerTransport is already started");
|
|
120
|
+
this._started = true;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Serves the single exchange: delivers the classified message to the
|
|
124
|
+
* connected server instance and resolves with the HTTP response.
|
|
125
|
+
*
|
|
126
|
+
* Throws when called a second time (the transport is strictly
|
|
127
|
+
* single-use), or before a server has been connected to the transport.
|
|
128
|
+
* The returned promise rejects with a connection-closed error when the
|
|
129
|
+
* transport is closed before a response was produced (for example because
|
|
130
|
+
* the client disconnected).
|
|
131
|
+
*/
|
|
132
|
+
async handleMessage(message, extra) {
|
|
133
|
+
if (this._used) throw new Error("PerRequestHTTPServerTransport serves exactly one exchange; construct a new transport per request");
|
|
134
|
+
if (!this._started || this.onmessage === void 0) throw new Error("PerRequestHTTPServerTransport is not connected: connect a server to this transport before handling a message");
|
|
135
|
+
if (this._closed) throw new Error("PerRequestHTTPServerTransport is closed");
|
|
136
|
+
this._used = true;
|
|
137
|
+
const signal = extra?.request?.signal;
|
|
138
|
+
if (signal?.aborted) {
|
|
139
|
+
await this.close();
|
|
140
|
+
throw new require_src.SdkError(require_src.SdkErrorCode.ConnectionClosed, "The request was aborted before it could be handled");
|
|
141
|
+
}
|
|
142
|
+
const messageExtra = {
|
|
143
|
+
classification: this._classification,
|
|
144
|
+
...extra?.request !== void 0 && { request: extra.request },
|
|
145
|
+
...extra?.authInfo !== void 0 && { authInfo: extra.authInfo }
|
|
146
|
+
};
|
|
147
|
+
if (require_src.isJSONRPCRequest(message)) {
|
|
148
|
+
this._requestId = message.id;
|
|
149
|
+
let resolve;
|
|
150
|
+
let reject;
|
|
151
|
+
const promise = new Promise((promiseResolve, promiseReject) => {
|
|
152
|
+
resolve = promiseResolve;
|
|
153
|
+
reject = promiseReject;
|
|
154
|
+
});
|
|
155
|
+
this._deferredResponse = {
|
|
156
|
+
promise,
|
|
157
|
+
resolve,
|
|
158
|
+
reject,
|
|
159
|
+
settled: false
|
|
160
|
+
};
|
|
161
|
+
if (signal !== void 0) {
|
|
162
|
+
const onAbort = () => void this.close();
|
|
163
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
164
|
+
this._abortCleanup = () => signal.removeEventListener("abort", onAbort);
|
|
165
|
+
}
|
|
166
|
+
this._dispatchWindowOpen = true;
|
|
167
|
+
try {
|
|
168
|
+
this.onmessage(message, messageExtra);
|
|
169
|
+
} finally {
|
|
170
|
+
this._dispatchWindowOpen = false;
|
|
171
|
+
}
|
|
172
|
+
if (this._responseMode === "sse" && !this._closed && !this._deferredResponse.settled) this.upgradeToSse();
|
|
173
|
+
return promise;
|
|
174
|
+
}
|
|
175
|
+
this.onmessage(message, messageExtra);
|
|
176
|
+
return new Response(null, { status: 202 });
|
|
177
|
+
}
|
|
178
|
+
async send(message, options) {
|
|
179
|
+
if (this._closed) return;
|
|
180
|
+
const isResponse = require_src.isJSONRPCResultResponse(message) || require_src.isJSONRPCErrorResponse(message);
|
|
181
|
+
const relatedId = isResponse ? message.id : options?.relatedRequestId;
|
|
182
|
+
if (this._requestId === void 0 || relatedId === void 0 || relatedId !== this._requestId) {
|
|
183
|
+
if (isResponse) this.onerror?.(/* @__PURE__ */ new Error(`Received a response for an unknown request id: ${String(message.id)}`));
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
if (isResponse) {
|
|
187
|
+
if (this._terminalDelivered) return;
|
|
188
|
+
this._terminalDelivered = true;
|
|
189
|
+
const errorCode = require_src.isJSONRPCErrorResponse(message) ? message.error.code : void 0;
|
|
190
|
+
const ladderStatus = errorCode !== void 0 && (this._dispatchWindowOpen || errorCode === require_src.ProtocolErrorCode.MissingRequiredClientCapability) ? require_src.LADDER_ERROR_HTTP_STATUS[errorCode] : void 0;
|
|
191
|
+
if (ladderStatus !== void 0 && this._sse === void 0) {
|
|
192
|
+
this.settleResponse(Response.json(message, {
|
|
193
|
+
status: ladderStatus,
|
|
194
|
+
headers: { "Content-Type": "application/json" }
|
|
195
|
+
}));
|
|
196
|
+
queueMicrotask(() => void this.close());
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (this._sse !== void 0 || this._responseMode === "sse") {
|
|
200
|
+
if (this._sse === void 0) this.upgradeToSse();
|
|
201
|
+
this.writeMessageFrame(message);
|
|
202
|
+
this.finalizeStream();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
this.settleResponse(Response.json(message, {
|
|
206
|
+
status: 200,
|
|
207
|
+
headers: { "Content-Type": "application/json" }
|
|
208
|
+
}));
|
|
209
|
+
queueMicrotask(() => void this.close());
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (this._responseMode === "json") return;
|
|
213
|
+
if (this._sse === void 0) this.upgradeToSse();
|
|
214
|
+
this.writeMessageFrame(message);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Writes an SSE comment frame (a keep-alive heartbeat). Dropped when the
|
|
218
|
+
* exchange is not currently streaming.
|
|
219
|
+
*/
|
|
220
|
+
writeCommentFrame(comment) {
|
|
221
|
+
if (this._closed || this._sse === void 0 || this._sse.closed) return;
|
|
222
|
+
const frame = comment.split("\n").map((line) => `: ${line}`).join("\n");
|
|
223
|
+
this.writeFrame(`${frame}\n\n`);
|
|
224
|
+
}
|
|
225
|
+
async close() {
|
|
226
|
+
if (this._closed) return;
|
|
227
|
+
this._closed = true;
|
|
228
|
+
this._abortCleanup?.();
|
|
229
|
+
this._abortCleanup = void 0;
|
|
230
|
+
if (this._sse?.keepAliveTimer !== void 0) clearInterval(this._sse.keepAliveTimer);
|
|
231
|
+
if (this._sse !== void 0 && !this._sse.closed) {
|
|
232
|
+
this._sse.closed = true;
|
|
233
|
+
try {
|
|
234
|
+
this._sse.controller.close();
|
|
235
|
+
} catch {}
|
|
236
|
+
}
|
|
237
|
+
if (this._deferredResponse !== void 0 && !this._deferredResponse.settled) {
|
|
238
|
+
this._deferredResponse.settled = true;
|
|
239
|
+
this._deferredResponse.reject(new require_src.SdkError(require_src.SdkErrorCode.ConnectionClosed, "Connection closed before a response was produced"));
|
|
240
|
+
}
|
|
241
|
+
this.onclose?.();
|
|
242
|
+
}
|
|
243
|
+
settleResponse(response) {
|
|
244
|
+
if (this._deferredResponse === void 0 || this._deferredResponse.settled) return;
|
|
245
|
+
this._deferredResponse.settled = true;
|
|
246
|
+
this._deferredResponse.resolve(response);
|
|
247
|
+
}
|
|
248
|
+
upgradeToSse() {
|
|
249
|
+
let controller;
|
|
250
|
+
const readable = new ReadableStream({
|
|
251
|
+
start: (streamController) => {
|
|
252
|
+
controller = streamController;
|
|
253
|
+
},
|
|
254
|
+
cancel: () => {
|
|
255
|
+
this.close();
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
this._sse = {
|
|
259
|
+
controller,
|
|
260
|
+
encoder: new TextEncoder(),
|
|
261
|
+
closed: false
|
|
262
|
+
};
|
|
263
|
+
this._sse.keepAliveTimer = armSseKeepAlive(this._keepAliveMs, () => this.writeCommentFrame("keepalive"));
|
|
264
|
+
this.settleResponse(new Response(readable, {
|
|
265
|
+
status: 200,
|
|
266
|
+
headers: {
|
|
267
|
+
"Content-Type": "text/event-stream",
|
|
268
|
+
"Cache-Control": "no-cache, no-transform",
|
|
269
|
+
Connection: "keep-alive",
|
|
270
|
+
"X-Accel-Buffering": "no"
|
|
271
|
+
}
|
|
272
|
+
}));
|
|
273
|
+
}
|
|
274
|
+
finalizeStream() {
|
|
275
|
+
if (this._sse?.keepAliveTimer !== void 0) clearInterval(this._sse.keepAliveTimer);
|
|
276
|
+
if (this._sse !== void 0 && !this._sse.closed) {
|
|
277
|
+
this._sse.closed = true;
|
|
278
|
+
try {
|
|
279
|
+
this._sse.controller.close();
|
|
280
|
+
} catch {}
|
|
281
|
+
}
|
|
282
|
+
queueMicrotask(() => void this.close());
|
|
283
|
+
}
|
|
284
|
+
writeMessageFrame(message) {
|
|
285
|
+
this.writeFrame(`event: message\ndata: ${JSON.stringify(message)}\n\n`);
|
|
286
|
+
}
|
|
287
|
+
writeFrame(frame) {
|
|
288
|
+
if (this._sse === void 0 || this._sse.closed) return;
|
|
289
|
+
try {
|
|
290
|
+
this._sse.controller.enqueue(this._sse.encoder.encode(frame));
|
|
291
|
+
} catch (error) {
|
|
292
|
+
this.onerror?.(/* @__PURE__ */ new Error(`Failed to write to the response stream: ${error}`));
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
/** Package-internal: the classification a per-request transport serves; `undefined` for any other transport. Not public API. */
|
|
297
|
+
function perRequestClassificationOf(transport) {
|
|
298
|
+
return transport instanceof PerRequestHTTPServerTransport ? readClassification(transport) : void 0;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/server/middleware/bearerAuth.ts
|
|
303
|
+
function comparableResource(value) {
|
|
304
|
+
const text = String(value);
|
|
305
|
+
const hash = text.indexOf("#");
|
|
306
|
+
return (hash === -1 ? text : text.slice(0, hash)).replace(/\/$/, "");
|
|
307
|
+
}
|
|
308
|
+
function sameResource(reported, expected) {
|
|
309
|
+
if (!reported) return false;
|
|
310
|
+
return comparableResource(reported) === comparableResource(expected);
|
|
311
|
+
}
|
|
312
|
+
function headerQuotedValue(value) {
|
|
313
|
+
return value.replaceAll(/[\\"]/g, String.raw`\$&`).replaceAll(/[^\u0020-\u007E]/g, " ");
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Build a `WWW-Authenticate: Bearer …` challenge header value (RFC 6750).
|
|
317
|
+
*
|
|
318
|
+
* The single formatter behind every challenge this package emits — the
|
|
319
|
+
* bearer-auth 401/403 answers and the per-operation scope-challenge 403 — so
|
|
320
|
+
* all challenges from one server agree on parameter order and quoting. Every
|
|
321
|
+
* parameter value is emitted as an HTTP quoted-string with `\` and `"`
|
|
322
|
+
* escaped and non-printable characters replaced.
|
|
323
|
+
*/
|
|
324
|
+
function buildWwwAuthenticateHeader(errorCode, description, requiredScopes, resourceMetadataUrl) {
|
|
325
|
+
let header = `Bearer error="${headerQuotedValue(errorCode)}", error_description="${headerQuotedValue(description)}"`;
|
|
326
|
+
if (requiredScopes.length > 0) header += `, scope="${headerQuotedValue(requiredScopes.join(" "))}"`;
|
|
327
|
+
if (resourceMetadataUrl) header += `, resource_metadata="${headerQuotedValue(resourceMetadataUrl)}"`;
|
|
328
|
+
return header;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Validate a raw `Authorization` header value as a Bearer token and return
|
|
332
|
+
* the verified {@link AuthInfo}.
|
|
333
|
+
*
|
|
334
|
+
* The runtime-neutral core of Bearer authentication: it parses the header,
|
|
335
|
+
* runs the verifier, compares the token's resource with `expectedResource`,
|
|
336
|
+
* enforces `requiredScopes`, and rejects tokens without an
|
|
337
|
+
* expiration or past it. On any failure it throws an {@link OAuthError} —
|
|
338
|
+
* pass that to {@link bearerAuthChallengeResponse} for the matching HTTP
|
|
339
|
+
* answer, or use {@link requireBearerAuth} to get both steps as one call.
|
|
340
|
+
*
|
|
341
|
+
* Framework adapters build on this: `requireBearerAuth` from
|
|
342
|
+
* `@modelcontextprotocol/express` feeds it `req.headers.authorization`.
|
|
343
|
+
*/
|
|
344
|
+
async function verifyBearerToken(authorizationHeader, options) {
|
|
345
|
+
const { verifier, requiredScopes = [], expectedResource } = options;
|
|
346
|
+
if (!authorizationHeader) throw new require_src.OAuthError(require_src.OAuthErrorCode.InvalidToken, "Missing Authorization header");
|
|
347
|
+
const [type, token] = authorizationHeader.split(" ");
|
|
348
|
+
if (type?.toLowerCase() !== "bearer" || !token) throw new require_src.OAuthError(require_src.OAuthErrorCode.InvalidToken, "Invalid Authorization header format, expected 'Bearer TOKEN'");
|
|
349
|
+
const authInfo = await verifier.verifyAccessToken(token);
|
|
350
|
+
if (expectedResource !== void 0 && !sameResource(authInfo.resource, expectedResource)) throw new require_src.OAuthError(require_src.OAuthErrorCode.InvalidToken, "Token was not issued for this resource");
|
|
351
|
+
if (requiredScopes.length > 0) {
|
|
352
|
+
if (!requiredScopes.every((scope) => authInfo.scopes.includes(scope))) throw new require_src.OAuthError(require_src.OAuthErrorCode.InsufficientScope, "Insufficient scope");
|
|
353
|
+
}
|
|
354
|
+
if (typeof authInfo.expiresAt !== "number" || Number.isNaN(authInfo.expiresAt)) throw new require_src.OAuthError(require_src.OAuthErrorCode.InvalidToken, "Token has no expiration time");
|
|
355
|
+
else if (authInfo.expiresAt < Date.now() / 1e3) throw new require_src.OAuthError(require_src.OAuthErrorCode.InvalidToken, "Token has expired");
|
|
356
|
+
if (options.resourceMetadataUrl !== void 0 && authInfo.resourceMetadataUrl === void 0) return {
|
|
357
|
+
...authInfo,
|
|
358
|
+
resourceMetadataUrl: options.resourceMetadataUrl
|
|
359
|
+
};
|
|
360
|
+
return authInfo;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Build the HTTP answer for a Bearer authentication failure.
|
|
364
|
+
*
|
|
365
|
+
* Maps an {@link OAuthError} to its status — `401` for `invalid_token` and
|
|
366
|
+
* `403` for `insufficient_scope` (both carrying the `WWW-Authenticate: Bearer …`
|
|
367
|
+
* challenge, with `resource_metadata` when configured so clients can discover
|
|
368
|
+
* the Authorization Server), `500` for `server_error`, `400` for anything
|
|
369
|
+
* else. A non-`OAuthError` value answers `500 server_error`. The body is the
|
|
370
|
+
* OAuth error JSON.
|
|
371
|
+
*/
|
|
372
|
+
function bearerAuthChallengeResponse(error, options) {
|
|
373
|
+
const { requiredScopes = [], resourceMetadataUrl } = options ?? {};
|
|
374
|
+
if (!(error instanceof require_src.OAuthError)) {
|
|
375
|
+
const serverError = new require_src.OAuthError(require_src.OAuthErrorCode.ServerError, "Internal Server Error");
|
|
376
|
+
return Response.json(serverError.toResponseObject(), { status: 500 });
|
|
377
|
+
}
|
|
378
|
+
switch (error.code) {
|
|
379
|
+
case require_src.OAuthErrorCode.InvalidToken: {
|
|
380
|
+
const challenge = buildWwwAuthenticateHeader(error.code, error.message, requiredScopes, resourceMetadataUrl);
|
|
381
|
+
return Response.json(error.toResponseObject(), {
|
|
382
|
+
status: 401,
|
|
383
|
+
headers: { "WWW-Authenticate": challenge }
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
case require_src.OAuthErrorCode.InsufficientScope: {
|
|
387
|
+
const challenge = buildWwwAuthenticateHeader(error.code, error.message, requiredScopes, resourceMetadataUrl);
|
|
388
|
+
return Response.json(error.toResponseObject(), {
|
|
389
|
+
status: 403,
|
|
390
|
+
headers: { "WWW-Authenticate": challenge }
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
case require_src.OAuthErrorCode.ServerError: return Response.json(error.toResponseObject(), { status: 500 });
|
|
394
|
+
default: return Response.json(error.toResponseObject(), { status: 400 });
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Require a valid Bearer token on web-standard requests.
|
|
399
|
+
*
|
|
400
|
+
* The framework-free counterpart of `requireBearerAuth` from
|
|
401
|
+
* `@modelcontextprotocol/express`, for hosts whose HTTP surface is a
|
|
402
|
+
* `fetch(request)` handler — Cloudflare Workers, Deno, Bun, Hono. The
|
|
403
|
+
* returned gate resolves to the verified {@link AuthInfo}, or to the
|
|
404
|
+
* ready-to-return challenge `Response` when the request must be refused.
|
|
405
|
+
*
|
|
406
|
+
* @example
|
|
407
|
+
* ```ts source="./bearerAuth.examples.ts#requireBearerAuth_fetchGate"
|
|
408
|
+
* const gate = requireBearerAuth({ verifier, requiredScopes: ['mcp'] });
|
|
409
|
+
*
|
|
410
|
+
* async function fetchHandler(request: Request): Promise<Response> {
|
|
411
|
+
* const auth: AuthInfo | Response = await gate(request);
|
|
412
|
+
* if (auth instanceof Response) return auth;
|
|
413
|
+
* return handler.fetch(request, { authInfo: auth });
|
|
414
|
+
* }
|
|
415
|
+
* ```
|
|
416
|
+
*/
|
|
417
|
+
function requireBearerAuth(options) {
|
|
418
|
+
const { verifier, requiredScopes = [], resourceMetadataUrl, expectedResource } = options;
|
|
419
|
+
const resolved = {
|
|
420
|
+
verifier,
|
|
421
|
+
requiredScopes,
|
|
422
|
+
resourceMetadataUrl,
|
|
423
|
+
expectedResource
|
|
424
|
+
};
|
|
425
|
+
return async (request) => {
|
|
426
|
+
const [authorizationHeader] = (request.headers.get("authorization") ?? "").split(",");
|
|
427
|
+
try {
|
|
428
|
+
return await verifyBearerToken(authorizationHeader || void 0, resolved);
|
|
429
|
+
} catch (error) {
|
|
430
|
+
return bearerAuthChallengeResponse(error, resolved);
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
//#endregion
|
|
436
|
+
//#region src/server/middleware/oauthMetadata.ts
|
|
437
|
+
function checkIssuerUrl(issuer, allowInsecure) {
|
|
438
|
+
if (issuer.protocol !== "https:" && issuer.hostname !== "localhost" && issuer.hostname !== "127.0.0.1" && !allowInsecure) throw new Error("Issuer URL must be HTTPS");
|
|
439
|
+
if (issuer.hash) throw new Error(`Issuer URL must not have a fragment: ${issuer}`);
|
|
440
|
+
if (issuer.search) throw new Error(`Issuer URL must not have a query string: ${issuer}`);
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Derive the RFC 9728 Protected Resource Metadata document from
|
|
444
|
+
* {@link AuthMetadataOptions}, validating the Authorization Server issuer URL
|
|
445
|
+
* (HTTPS required outside localhost) in the process.
|
|
446
|
+
*
|
|
447
|
+
* `oauthMetadataResponse` and the Express `mcpAuthMetadataRouter` both build
|
|
448
|
+
* on this; use it directly when serving the document through your own
|
|
449
|
+
* routing — or call it once at startup to fail fast on a misconfigured
|
|
450
|
+
* issuer before any request arrives.
|
|
451
|
+
*/
|
|
452
|
+
function buildOAuthProtectedResourceMetadata(options) {
|
|
453
|
+
checkIssuerUrl(new URL(options.oauthMetadata.issuer), options.dangerouslyAllowInsecureIssuerUrl);
|
|
454
|
+
return {
|
|
455
|
+
resource: options.resourceServerUrl.href,
|
|
456
|
+
authorization_servers: [options.oauthMetadata.issuer],
|
|
457
|
+
scopes_supported: options.scopesSupported,
|
|
458
|
+
resource_name: options.resourceName,
|
|
459
|
+
resource_documentation: options.serviceDocumentationUrl?.href
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Builds the RFC 9728 Protected Resource Metadata URL for a given MCP server
|
|
464
|
+
* URL by inserting `/.well-known/oauth-protected-resource` ahead of the path.
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
* ```ts
|
|
468
|
+
* getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp'))
|
|
469
|
+
* // → 'https://api.example.com/.well-known/oauth-protected-resource/mcp'
|
|
470
|
+
* ```
|
|
471
|
+
*/
|
|
472
|
+
function getOAuthProtectedResourceMetadataUrl(serverUrl) {
|
|
473
|
+
const metadataUrl = new URL(serverUrl);
|
|
474
|
+
metadataUrl.pathname = protectedResourceMetadataPath(serverUrl);
|
|
475
|
+
metadataUrl.hash = "";
|
|
476
|
+
return metadataUrl.href;
|
|
477
|
+
}
|
|
478
|
+
/** The RFC 9728 path-aware well-known path for a resource URL. */
|
|
479
|
+
function protectedResourceMetadataPath(resourceServerUrl) {
|
|
480
|
+
const rsPath = stripTrailingSlash(resourceServerUrl.pathname);
|
|
481
|
+
return `/.well-known/oauth-protected-resource${rsPath === "/" ? "" : rsPath}`;
|
|
482
|
+
}
|
|
483
|
+
function stripTrailingSlash(path) {
|
|
484
|
+
return path.length > 1 && path.endsWith("/") ? path.slice(0, -1) : path;
|
|
485
|
+
}
|
|
486
|
+
const ALLOWED_METHODS = "GET, HEAD, OPTIONS";
|
|
487
|
+
function metadataDocumentResponse(request, metadata) {
|
|
488
|
+
if (request.method === "OPTIONS") {
|
|
489
|
+
const requestedHeaders = request.headers.get("access-control-request-headers");
|
|
490
|
+
return new Response(null, {
|
|
491
|
+
status: 204,
|
|
492
|
+
headers: {
|
|
493
|
+
"Access-Control-Allow-Origin": "*",
|
|
494
|
+
"Access-Control-Allow-Methods": ALLOWED_METHODS,
|
|
495
|
+
...requestedHeaders === null ? {} : {
|
|
496
|
+
"Access-Control-Allow-Headers": requestedHeaders,
|
|
497
|
+
Vary: "Access-Control-Request-Headers"
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
503
|
+
const error = new require_src.OAuthError(require_src.OAuthErrorCode.MethodNotAllowed, `The method ${request.method} is not allowed for this endpoint`);
|
|
504
|
+
return Response.json(error.toResponseObject(), {
|
|
505
|
+
status: 405,
|
|
506
|
+
headers: {
|
|
507
|
+
Allow: ALLOWED_METHODS,
|
|
508
|
+
"Access-Control-Allow-Origin": "*"
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
const response = Response.json(metadata, { headers: { "Access-Control-Allow-Origin": "*" } });
|
|
513
|
+
return request.method === "HEAD" ? new Response(null, {
|
|
514
|
+
status: response.status,
|
|
515
|
+
headers: response.headers
|
|
516
|
+
}) : response;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Serve the two OAuth discovery documents an MCP server acting as a Resource
|
|
520
|
+
* Server exposes, from a web-standard `fetch(request)` handler:
|
|
521
|
+
*
|
|
522
|
+
* - `/.well-known/oauth-protected-resource[/<path>]` — RFC 9728 Protected
|
|
523
|
+
* Resource Metadata, derived from the supplied options (path-aware: the
|
|
524
|
+
* resource URL's path is reflected in the route).
|
|
525
|
+
* - `/.well-known/oauth-authorization-server` — RFC 8414 Authorization
|
|
526
|
+
* Server Metadata, passed through verbatim.
|
|
527
|
+
*
|
|
528
|
+
* Returns the matched document `Response` (JSON with permissive CORS, `405`
|
|
529
|
+
* with an `Allow` header for non-GET methods, `204` for CORS preflight), or
|
|
530
|
+
* `undefined` when the request path is neither well-known route — fall
|
|
531
|
+
* through to your own routing. The framework-free counterpart of
|
|
532
|
+
* `mcpAuthMetadataRouter` from `@modelcontextprotocol/express`; pair it with
|
|
533
|
+
* `requireBearerAuth` and `getOAuthProtectedResourceMetadataUrl` so
|
|
534
|
+
* unauthenticated clients can discover the AS from the `401` challenge.
|
|
535
|
+
*
|
|
536
|
+
* @example
|
|
537
|
+
* ```ts source="./oauthMetadata.examples.ts#oauthMetadataResponse_fetchHandler"
|
|
538
|
+
* async function fetchHandler(request: Request): Promise<Response> {
|
|
539
|
+
* return oauthMetadataResponse(request, options) ?? serveMcp(request);
|
|
540
|
+
* }
|
|
541
|
+
* ```
|
|
542
|
+
*/
|
|
543
|
+
function oauthMetadataResponse(request, options) {
|
|
544
|
+
const requestPath = stripTrailingSlash(new URL(request.url).pathname);
|
|
545
|
+
if (requestPath === protectedResourceMetadataPath(options.resourceServerUrl)) return metadataDocumentResponse(request, buildOAuthProtectedResourceMetadata(options));
|
|
546
|
+
if (requestPath === "/.well-known/oauth-authorization-server") {
|
|
547
|
+
buildOAuthProtectedResourceMetadata(options);
|
|
548
|
+
return metadataDocumentResponse(request, options.oauthMetadata);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
//#endregion
|
|
553
|
+
//#region src/server/scopeChallenge.ts
|
|
554
|
+
/** @internal */
|
|
555
|
+
function supportsScopeChallengeResolver(transport) {
|
|
556
|
+
return typeof transport === "object" && transport !== null && "setScopeChallengeResolver" in transport && typeof transport.setScopeChallengeResolver === "function";
|
|
557
|
+
}
|
|
558
|
+
function assertScope(scope, location) {
|
|
559
|
+
if (typeof scope !== "string" || !/^[\u0021\u0023-\u005B\u005D-\u007E]+$/.test(scope)) throw new TypeError(`${location} must satisfy the OAuth scope-token grammar`);
|
|
560
|
+
}
|
|
561
|
+
function validateScopeChallenge(challenge) {
|
|
562
|
+
if (challenge === null || typeof challenge !== "object" || !Array.isArray(challenge.scopes) || challenge.scopes.length === 0) throw new TypeError("scope challenge must contain at least one scope");
|
|
563
|
+
for (const [index, scope] of challenge.scopes.entries()) assertScope(scope, `scope challenge scopes[${index}]`);
|
|
564
|
+
if (challenge.errorDescription !== void 0 && typeof challenge.errorDescription !== "string") throw new TypeError("scope challenge errorDescription must be a string");
|
|
565
|
+
if (challenge.errorDescription !== void 0 && !/^[\u0020-\u0021\u0023-\u005B\u005D-\u007E]+$/.test(challenge.errorDescription)) throw new TypeError("scope challenge errorDescription must satisfy the RFC 6750 error-description grammar");
|
|
566
|
+
return challenge;
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Creates a handler that requires every supplied scope exactly.
|
|
570
|
+
*
|
|
571
|
+
* Requests without authentication are left to the server's authentication gate.
|
|
572
|
+
*/
|
|
573
|
+
function requireScopes(...scopes) {
|
|
574
|
+
if (scopes.length === 0) throw new TypeError("requireScopes must contain at least one scope");
|
|
575
|
+
for (const [index, scope] of scopes.entries()) assertScope(scope, `requireScopes scope[${index}]`);
|
|
576
|
+
const requiredScopes = [...scopes];
|
|
577
|
+
return ({ authInfo }) => {
|
|
578
|
+
if (authInfo === void 0) return;
|
|
579
|
+
const activeScopes = new Set(authInfo.scopes);
|
|
580
|
+
if (requiredScopes.every((scope) => activeScopes.has(scope))) return;
|
|
581
|
+
return { scopes: requiredScopes };
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
/** @internal */
|
|
585
|
+
async function findScopeChallenge(requests, authInfo, resolve) {
|
|
586
|
+
for (const request of requests) {
|
|
587
|
+
const challenge = await resolve({
|
|
588
|
+
request,
|
|
589
|
+
...authInfo !== void 0 && { authInfo }
|
|
590
|
+
});
|
|
591
|
+
if (challenge !== void 0) return validateScopeChallenge(challenge);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* The RFC 9728 Protected Resource Metadata URL to advertise on a scope
|
|
596
|
+
* challenge, derived from the verified {@link AuthInfo}: the URL the
|
|
597
|
+
* authentication gate stamped (`authInfo.resourceMetadataUrl`, set by the
|
|
598
|
+
* bearer-auth helpers from their `resourceMetadataUrl` option), falling back
|
|
599
|
+
* to the well-known location for an HTTP(S) RFC 8707 `resource` identifier, or
|
|
600
|
+
* `undefined` when neither is available (the `resource_metadata` parameter is
|
|
601
|
+
* then omitted, matching the bearer-auth challenges).
|
|
602
|
+
*
|
|
603
|
+
* @internal
|
|
604
|
+
*/
|
|
605
|
+
function scopeChallengeResourceMetadataUrl(authInfo) {
|
|
606
|
+
if (authInfo?.resourceMetadataUrl !== void 0) return authInfo.resourceMetadataUrl;
|
|
607
|
+
if (authInfo?.resource?.protocol === "https:" || authInfo?.resource?.protocol === "http:") return getOAuthProtectedResourceMetadataUrl(authInfo.resource);
|
|
608
|
+
}
|
|
609
|
+
/** @internal */
|
|
610
|
+
function createScopeChallengeResponse(challenge, resourceMetadataUrl) {
|
|
611
|
+
return bearerAuthChallengeResponse(new require_src.OAuthError(require_src.OAuthErrorCode.InsufficientScope, challenge.errorDescription ?? "Insufficient scope"), {
|
|
612
|
+
requiredScopes: [...challenge.scopes],
|
|
613
|
+
resourceMetadataUrl
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
//#endregion
|
|
618
|
+
//#region src/server/legacyInputRequiredShim.ts
|
|
619
|
+
/**
|
|
620
|
+
* Default handler re-entries per originating request — tighter than the
|
|
621
|
+
* client driver's 10 because the shim holds a live wire request open.
|
|
622
|
+
*/
|
|
623
|
+
const DEFAULT_LEGACY_SHIM_MAX_ROUNDS = 8;
|
|
624
|
+
/** Default per-leg timeout: legs are human-paced, so the 60s protocol default is wrong. */
|
|
625
|
+
const DEFAULT_LEGACY_SHIM_ROUND_TIMEOUT_MS = 6e5;
|
|
626
|
+
/** Resolves and validates `ServerOptions.inputRequired`, failing loudly at construction time. */
|
|
627
|
+
function resolveLegacyShimOptions(options) {
|
|
628
|
+
if (options?.maxRounds !== void 0 && (!Number.isInteger(options.maxRounds) || options.maxRounds < 1)) throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${options.maxRounds})`);
|
|
629
|
+
if (options?.roundTimeoutMs !== void 0 && (!Number.isFinite(options.roundTimeoutMs) || options.roundTimeoutMs <= 0)) throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${options.roundTimeoutMs})`);
|
|
630
|
+
return {
|
|
631
|
+
maxRounds: options?.maxRounds ?? DEFAULT_LEGACY_SHIM_MAX_ROUNDS,
|
|
632
|
+
roundTimeoutMs: options?.roundTimeoutMs ?? DEFAULT_LEGACY_SHIM_ROUND_TIMEOUT_MS,
|
|
633
|
+
legacyShim: options?.legacyShim ?? true
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Validates one `inputRequests` entry: malformed or unknown kinds are server
|
|
638
|
+
* bugs and fail loudly on both eras. Shared by the modern seam's capability
|
|
639
|
+
* check and the shim's gate.
|
|
640
|
+
*/
|
|
641
|
+
function coerceEmbeddedInputRequest(method, key, entry) {
|
|
642
|
+
if (entry === null || typeof entry !== "object" || typeof entry.method !== "string") throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InternalError, `Handler for ${method} returned an invalid input request '${key}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);
|
|
643
|
+
const embedded = entry;
|
|
644
|
+
const required = require_src.requiredClientCapabilitiesForInputRequest(embedded);
|
|
645
|
+
if (required === void 0) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InternalError, `Handler for ${method} returned an input request '${key}' of kind '${embedded.method}', which is not an embedded request the 2026-07-28 revision defines`);
|
|
646
|
+
return {
|
|
647
|
+
embedded,
|
|
648
|
+
required
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* The 2025-11-25 URL-mode wire shape requires an `elicitationId`; the 2026
|
|
653
|
+
* in-band shape has none, so URL legs mint one (CSPRNG-backed, with a
|
|
654
|
+
* getRandomValues fallback for runtimes without `randomUUID`).
|
|
655
|
+
*/
|
|
656
|
+
function syntheticElicitationId() {
|
|
657
|
+
const webCrypto = globalThis.crypto;
|
|
658
|
+
if (webCrypto?.randomUUID !== void 0) return webCrypto.randomUUID();
|
|
659
|
+
const bytes = new Uint8Array(16);
|
|
660
|
+
webCrypto.getRandomValues(bytes);
|
|
661
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
662
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
663
|
+
const hex = [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
664
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
665
|
+
}
|
|
666
|
+
/** Per-family surfacing: tools/call → isError result (the 2025 idiom); prompts/resources → JSON-RPC error. */
|
|
667
|
+
function legacyShimFailure(method, message) {
|
|
668
|
+
if (method === "tools/call") return {
|
|
669
|
+
content: [{
|
|
670
|
+
type: "text",
|
|
671
|
+
text: message
|
|
672
|
+
}],
|
|
673
|
+
isError: true
|
|
674
|
+
};
|
|
675
|
+
throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InternalError, message);
|
|
676
|
+
}
|
|
677
|
+
/** The fulfilment loop — see the module doc for the contract. */
|
|
678
|
+
var LegacyInputRequiredShim = class {
|
|
679
|
+
constructor(_host) {
|
|
680
|
+
this._host = _host;
|
|
681
|
+
}
|
|
682
|
+
async fulfill(method, handler, request, ctx, firstResult) {
|
|
683
|
+
const { maxRounds, roundTimeoutMs } = this._host;
|
|
684
|
+
const outerSignal = ctx.mcpReq.signal;
|
|
685
|
+
let current = firstResult;
|
|
686
|
+
let round = 0;
|
|
687
|
+
while (true) {
|
|
688
|
+
round += 1;
|
|
689
|
+
if (round > maxRounds) return legacyShimFailure(method, require_src.inputRequiredRoundsExceededMessage(method, maxRounds));
|
|
690
|
+
const inputRequests = current.inputRequests;
|
|
691
|
+
const hasInputRequests = inputRequests != null && Object.keys(inputRequests).length > 0;
|
|
692
|
+
const requestState = typeof current.requestState === "string" ? current.requestState : void 0;
|
|
693
|
+
if (!hasInputRequests && requestState === void 0) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);
|
|
694
|
+
let responses;
|
|
695
|
+
if (hasInputRequests) {
|
|
696
|
+
const declared = this._host.resolvedClientCapabilities(ctx);
|
|
697
|
+
const coerced = [];
|
|
698
|
+
for (const [key, entry] of Object.entries(inputRequests)) {
|
|
699
|
+
const { embedded, required } = coerceEmbeddedInputRequest(method, key, entry);
|
|
700
|
+
if (embedded.method !== "roots/list" && embedded.params === void 0) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InternalError, `Handler for ${method} returned an input request '${key}' of kind '${embedded.method}' without params`);
|
|
701
|
+
if (require_src.missingClientCapabilities(required, declared) !== void 0) return legacyShimFailure(method, `Cannot request input '${key}' (${embedded.method}): the client on this 2025-era connection did not declare the required capability${declared === void 0 ? " (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)" : ""}`);
|
|
702
|
+
coerced.push([key, embedded]);
|
|
703
|
+
}
|
|
704
|
+
const roundAbort = require_src.linkedRoundAbort(outerSignal);
|
|
705
|
+
try {
|
|
706
|
+
const legOptions = {
|
|
707
|
+
relatedRequestId: ctx.mcpReq.id,
|
|
708
|
+
timeout: roundTimeoutMs,
|
|
709
|
+
resetTimeoutOnProgress: true,
|
|
710
|
+
onprogress: () => {},
|
|
711
|
+
signal: roundAbort.signal
|
|
712
|
+
};
|
|
713
|
+
const fulfilled = await Promise.all(coerced.map(async ([key, embedded]) => {
|
|
714
|
+
try {
|
|
715
|
+
return [key, await this._dispatchLeg(embedded, legOptions)];
|
|
716
|
+
} catch (error) {
|
|
717
|
+
roundAbort.abort(error);
|
|
718
|
+
throw error;
|
|
719
|
+
}
|
|
720
|
+
}));
|
|
721
|
+
responses = Object.fromEntries(fulfilled);
|
|
722
|
+
} catch (error) {
|
|
723
|
+
if (outerSignal.aborted) throw error;
|
|
724
|
+
return legacyShimFailure(method, `Fulfilling input required by '${method}' failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
725
|
+
} finally {
|
|
726
|
+
roundAbort.dispose();
|
|
727
|
+
}
|
|
728
|
+
} else await require_src.sleep(require_src.REQUEST_STATE_ONLY_LEG_PACING_MS, outerSignal);
|
|
729
|
+
let ctxNext = {
|
|
730
|
+
...ctx,
|
|
731
|
+
mcpReq: {
|
|
732
|
+
...ctx.mcpReq,
|
|
733
|
+
inputResponses: responses,
|
|
734
|
+
droppedInputResponseKeys: void 0,
|
|
735
|
+
requestState: require_src.requestStateAccessor(requestState)
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
if (requestState !== void 0) {
|
|
739
|
+
const decoded = await this._host.verifyRequestState(requestState, ctxNext, method);
|
|
740
|
+
if (decoded !== void 0) ctxNext = require_src.withRequestStateValue(ctxNext, decoded);
|
|
741
|
+
}
|
|
742
|
+
const next = await handler(request, ctxNext);
|
|
743
|
+
if (!require_src.isInputRequiredResult(next)) return next;
|
|
744
|
+
current = next;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
/** Routes one embedded request through the host's existing 2025-era senders (gate already ran). */
|
|
748
|
+
async _dispatchLeg(embedded, options) {
|
|
749
|
+
switch (embedded.method) {
|
|
750
|
+
case "elicitation/create": {
|
|
751
|
+
let params = embedded.params;
|
|
752
|
+
if (params.mode === "url" && params.elicitationId === void 0) params = {
|
|
753
|
+
...params,
|
|
754
|
+
elicitationId: syntheticElicitationId()
|
|
755
|
+
};
|
|
756
|
+
return await this._host.sendElicitation(params, options);
|
|
757
|
+
}
|
|
758
|
+
case "sampling/createMessage": return await this._host.sendSampling(embedded.params, options);
|
|
759
|
+
case "roots/list": return await this._host.listRoots(embedded.params, options);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
//#endregion
|
|
765
|
+
//#region src/server/server.ts
|
|
766
|
+
/**
|
|
767
|
+
* The request methods whose 2026-07-28 result vocabulary includes
|
|
768
|
+
* `input_required` (the multi round-trip methods). Returning an
|
|
769
|
+
* input-required result from any other handler is a server bug.
|
|
770
|
+
*/
|
|
771
|
+
const INPUT_REQUIRED_CAPABLE_METHODS = new Set([
|
|
772
|
+
"tools/call",
|
|
773
|
+
"prompts/get",
|
|
774
|
+
"resources/read"
|
|
775
|
+
]);
|
|
776
|
+
let writeClientIdentity;
|
|
777
|
+
let installDiscoverHandler;
|
|
778
|
+
let readServerIdentity;
|
|
779
|
+
/**
|
|
780
|
+
* Package-internal: backfills the connection-scoped client-identity fields of a
|
|
781
|
+
* per-request server instance from the request's validated `_meta` envelope, so the
|
|
782
|
+
* (deprecated) {@linkcode Server.getClientCapabilities} / {@linkcode Server.getClientVersion}
|
|
783
|
+
* accessors keep answering on instances that never see an `initialize` handshake.
|
|
784
|
+
* Not public API.
|
|
785
|
+
*/
|
|
786
|
+
function seedClientIdentityFromEnvelope(server, identity) {
|
|
787
|
+
writeClientIdentity(server, identity);
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Package-internal: installs the modern-only `server/discover` handler on an instance
|
|
791
|
+
* the HTTP entry has marked as serving the 2026-07-28 era, and makes sure the modern
|
|
792
|
+
* revisions the entry serves appear in the instance's supported-versions list (so the
|
|
793
|
+
* discover advertisement and version-mismatch errors name them). Idempotent.
|
|
794
|
+
* Hand-constructed instances are unaffected: nothing else calls this, so they keep
|
|
795
|
+
* answering `-32601` unless their own supported-versions list opts into a modern
|
|
796
|
+
* revision. Not public API.
|
|
797
|
+
*/
|
|
798
|
+
function installModernOnlyHandlers(server, servedModernVersions) {
|
|
799
|
+
installDiscoverHandler(server, servedModernVersions);
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Package-internal: the instance's implementation identity, for the serving
|
|
803
|
+
* entries to stamp onto entry-built results (the `subscriptions/listen`
|
|
804
|
+
* graceful-close result — built outside the encode seam, but the spec's
|
|
805
|
+
* `SubscriptionsListenResultMetaObject` extends `ResultMetaObject`, so it carries
|
|
806
|
+
* the serverInfo SHOULD like every other result). Not public API.
|
|
807
|
+
*/
|
|
808
|
+
function serverIdentityOf(server) {
|
|
809
|
+
return readServerIdentity(server);
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* An MCP server on top of a pluggable transport.
|
|
813
|
+
*
|
|
814
|
+
* This server will automatically respond to the initialization flow as initiated from the client.
|
|
815
|
+
*
|
|
816
|
+
* @deprecated Use {@linkcode server/mcp.McpServer | McpServer} instead for the high-level API. Only use `Server` for advanced use cases.
|
|
817
|
+
*/
|
|
818
|
+
var Server = class extends require_src.Protocol {
|
|
819
|
+
_clientCapabilities;
|
|
820
|
+
_clientVersion;
|
|
821
|
+
static {
|
|
822
|
+
writeClientIdentity = (server, identity) => {
|
|
823
|
+
if (identity.clientCapabilities !== void 0) server._clientCapabilities = identity.clientCapabilities;
|
|
824
|
+
if (identity.clientInfo !== void 0) server._clientVersion = identity.clientInfo;
|
|
825
|
+
};
|
|
826
|
+
installDiscoverHandler = (server, servedModernVersions) => {
|
|
827
|
+
const missing = servedModernVersions.filter((version) => !server._supportedProtocolVersions.includes(version));
|
|
828
|
+
if (missing.length > 0) server._supportedProtocolVersions = [...server._supportedProtocolVersions, ...missing];
|
|
829
|
+
server.setRequestHandler("server/discover", () => server._ondiscover());
|
|
830
|
+
};
|
|
831
|
+
readServerIdentity = (server) => server._serverInfo;
|
|
832
|
+
}
|
|
833
|
+
_capabilities;
|
|
834
|
+
_instructions;
|
|
835
|
+
_jsonSchemaValidator;
|
|
836
|
+
_cacheHints;
|
|
837
|
+
_requestStateVerify;
|
|
838
|
+
_inputRequiredServing;
|
|
839
|
+
_legacyShim;
|
|
840
|
+
_boundFromTransport = false;
|
|
841
|
+
/** Lazily-built legacy shim; the loop lives in legacyInputRequiredShim.ts behind a narrow host contract. */
|
|
842
|
+
_legacyInputRequiredShim() {
|
|
843
|
+
return this._legacyShim ??= new LegacyInputRequiredShim({
|
|
844
|
+
maxRounds: this._inputRequiredServing.maxRounds,
|
|
845
|
+
roundTimeoutMs: this._inputRequiredServing.roundTimeoutMs,
|
|
846
|
+
resolvedClientCapabilities: (ctx) => this._inputRequestCapabilityView(ctx),
|
|
847
|
+
verifyRequestState: (state, ctx, method) => this._verifyRequestState(state, ctx, method),
|
|
848
|
+
sendElicitation: (params, options) => this._sendElicitationLeg(params, options, { validateAcceptedContent: false }),
|
|
849
|
+
sendSampling: (params, options) => this.createMessage(params, options),
|
|
850
|
+
listRoots: (params, options) => this.listRoots(params, options)
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Callback for when initialization has fully completed (i.e., the client has sent an `notifications/initialized` notification).
|
|
855
|
+
*/
|
|
856
|
+
oninitialized;
|
|
857
|
+
/**
|
|
858
|
+
* Initializes this server with the given name and version information.
|
|
859
|
+
*/
|
|
860
|
+
constructor(_serverInfo, options) {
|
|
861
|
+
super(options);
|
|
862
|
+
this._serverInfo = _serverInfo;
|
|
863
|
+
this._capabilities = options?.capabilities ? { ...options.capabilities } : {};
|
|
864
|
+
this._instructions = options?.instructions;
|
|
865
|
+
this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new _modelcontextprotocol_server__shims.DefaultJsonSchemaValidator();
|
|
866
|
+
this._requestStateVerify = options?.requestState?.verify;
|
|
867
|
+
this._inputRequiredServing = resolveLegacyShimOptions(options?.inputRequired);
|
|
868
|
+
if (options?.cacheHints !== void 0) {
|
|
869
|
+
for (const [operation, hint] of Object.entries(options.cacheHints)) if (hint !== void 0) require_src.assertValidCacheHint(hint, `cacheHints['${operation}']`);
|
|
870
|
+
this._cacheHints = options.cacheHints;
|
|
871
|
+
}
|
|
872
|
+
this.setRequestHandler("initialize", (request) => this._oninitialize(request));
|
|
873
|
+
this.setNotificationHandler("notifications/initialized", () => this.oninitialized?.());
|
|
874
|
+
if (require_src.modernProtocolVersions(this._supportedProtocolVersions).length > 0) this.setRequestHandler("server/discover", () => this._ondiscover());
|
|
875
|
+
if (this._capabilities.logging) this._registerLoggingHandler();
|
|
876
|
+
}
|
|
877
|
+
/** Attaches to the given transport; rejects while this instance is connected to another one. */
|
|
878
|
+
async connect(transport) {
|
|
879
|
+
if (this.transport !== void 0) throw new require_src.SdkError(require_src.SdkErrorCode.AlreadyConnected, "Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");
|
|
880
|
+
if (this._boundFromTransport) {
|
|
881
|
+
this._boundFromTransport = false;
|
|
882
|
+
this._negotiatedProtocolVersion = void 0;
|
|
883
|
+
}
|
|
884
|
+
const revision = perRequestClassificationOf(transport)?.revision;
|
|
885
|
+
if (revision !== void 0 && !this._servedModernEra() && require_src.SUPPORTED_MODERN_PROTOCOL_VERSIONS.includes(revision) && require_src.modernProtocolVersions(this._supportedProtocolVersions).includes(revision)) {
|
|
886
|
+
this._negotiatedProtocolVersion = revision;
|
|
887
|
+
this._boundFromTransport = true;
|
|
888
|
+
}
|
|
889
|
+
await super.connect(transport);
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Registers the built-in `logging/setLevel` request handler.
|
|
893
|
+
*
|
|
894
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
895
|
+
* Remains functional during the deprecation window (at least twelve months).
|
|
896
|
+
* Migrate to stderr logging (STDIO servers) or OpenTelemetry.
|
|
897
|
+
*/
|
|
898
|
+
_registerLoggingHandler() {
|
|
899
|
+
this.setRequestHandler("logging/setLevel", async (request, ctx) => {
|
|
900
|
+
const transportSessionId = ctx.sessionId || ctx.http?.req?.headers.get("mcp-session-id") || void 0;
|
|
901
|
+
const { level } = request.params;
|
|
902
|
+
const parseResult = require_src.parseSchema(_modelcontextprotocol_core_internal.LoggingLevelSchema, level);
|
|
903
|
+
if (parseResult.success) this._loggingLevels.set(transportSessionId, parseResult.data);
|
|
904
|
+
return {};
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
buildContext(ctx, transportInfo) {
|
|
908
|
+
const hasHttpInfo = ctx.http || transportInfo?.request || transportInfo?.closeSSEStream || transportInfo?.closeStandaloneSSEStream;
|
|
909
|
+
return {
|
|
910
|
+
...ctx,
|
|
911
|
+
mcpReq: {
|
|
912
|
+
...ctx.mcpReq,
|
|
913
|
+
log: (level, data, logger) => {
|
|
914
|
+
if (!this._capabilities.logging) return Promise.resolve();
|
|
915
|
+
let threshold;
|
|
916
|
+
if (this._servedModernEra()) {
|
|
917
|
+
threshold = ctx.mcpReq.envelope?.[_modelcontextprotocol_core_internal.LOG_LEVEL_META_KEY];
|
|
918
|
+
if (threshold === void 0) return Promise.resolve();
|
|
919
|
+
} else threshold = this._loggingLevels.get(ctx.sessionId) ?? this._loggingLevels.get(void 0);
|
|
920
|
+
if (threshold !== void 0 && this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(threshold)) return Promise.resolve();
|
|
921
|
+
return ctx.mcpReq.notify({
|
|
922
|
+
method: "notifications/message",
|
|
923
|
+
params: {
|
|
924
|
+
level,
|
|
925
|
+
data,
|
|
926
|
+
logger
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
},
|
|
930
|
+
elicitInput: (params, options) => this.elicitInput(params, options),
|
|
931
|
+
requestSampling: (params, options) => this.createMessage(params, options)
|
|
932
|
+
},
|
|
933
|
+
http: hasHttpInfo ? {
|
|
934
|
+
...ctx.http,
|
|
935
|
+
req: transportInfo?.request,
|
|
936
|
+
closeSSE: transportInfo?.closeSSEStream,
|
|
937
|
+
closeStandaloneSSE: transportInfo?.closeStandaloneSSEStream
|
|
938
|
+
} : void 0
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
_loggingLevels = /* @__PURE__ */ new Map();
|
|
942
|
+
LOG_LEVEL_SEVERITY = new Map(_modelcontextprotocol_core_internal.LoggingLevelSchema.options.map((level, index) => [level, index]));
|
|
943
|
+
isMessageIgnored = (level, sessionId) => {
|
|
944
|
+
const currentLevel = this._loggingLevels.get(sessionId);
|
|
945
|
+
return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;
|
|
946
|
+
};
|
|
947
|
+
/**
|
|
948
|
+
* Registers new capabilities. This can only be called before connecting to a transport.
|
|
949
|
+
*
|
|
950
|
+
* The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
|
|
951
|
+
*/
|
|
952
|
+
registerCapabilities(capabilities) {
|
|
953
|
+
if (this.transport) throw new require_src.SdkError(require_src.SdkErrorCode.AlreadyConnected, "Cannot register capabilities after connecting to transport");
|
|
954
|
+
const hadLogging = !!this._capabilities.logging;
|
|
955
|
+
this._capabilities = require_src.mergeCapabilities(this._capabilities, capabilities);
|
|
956
|
+
if (!hadLogging && this._capabilities.logging) this._registerLoggingHandler();
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Enforces server-side validation for `tools/call` results regardless of how the
|
|
960
|
+
* handler was registered, attaches the configured per-operation cache hint
|
|
961
|
+
* (when one exists) so the 2026-07-28 encode seam can fill `ttlMs`/`cacheScope`
|
|
962
|
+
* for results that do not provide their own, and owns the multi-round-trip
|
|
963
|
+
* seam: on the methods whose 2026-07-28 result vocabulary includes
|
|
964
|
+
* `input_required` (`tools/call`, `prompts/get`, `resources/read`) an
|
|
965
|
+
* input-required return skips result-schema validation and is checked
|
|
966
|
+
* against the served era, the at-least-one rule, and the request's own
|
|
967
|
+
* declared client capabilities; on every other method an input-required
|
|
968
|
+
* return is a server bug and fails loudly. The hint rides a symbol-keyed
|
|
969
|
+
* property that is never serialized, so 2025-era responses are unaffected.
|
|
970
|
+
*/
|
|
971
|
+
_wrapHandler(method, handler) {
|
|
972
|
+
if (method !== "tools/call") {
|
|
973
|
+
const cacheHint = this._cacheHints?.[method];
|
|
974
|
+
const isInputRequiredCapable = INPUT_REQUIRED_CAPABLE_METHODS.has(method);
|
|
975
|
+
if (cacheHint === void 0 && !isInputRequiredCapable) return async (request, ctx) => {
|
|
976
|
+
const result = await handler(request, ctx);
|
|
977
|
+
if (require_src.isInputRequiredResult(result)) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);
|
|
978
|
+
return result;
|
|
979
|
+
};
|
|
980
|
+
return async (request, ctx) => {
|
|
981
|
+
const result = isInputRequiredCapable ? await this._invokeInputRequiredCapableHandler(method, handler, request, ctx) : await handler(request, ctx);
|
|
982
|
+
if (require_src.isInputRequiredResult(result)) {
|
|
983
|
+
if (!isInputRequiredCapable) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);
|
|
984
|
+
return result;
|
|
985
|
+
}
|
|
986
|
+
return cacheHint === void 0 ? result : require_src.attachCacheHintFallback(result, cacheHint);
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
return async (request, ctx) => {
|
|
990
|
+
const codec = require_src.codecForVersion(this._negotiatedProtocolVersion);
|
|
991
|
+
const validatedRequest = codec.validateRequest("tools/call", request);
|
|
992
|
+
if (!validatedRequest.ok) throw new require_src.ProtocolError(validatedRequest.reason === "not-in-era" ? require_src.ProtocolErrorCode.InternalError : require_src.ProtocolErrorCode.InvalidParams, validatedRequest.reason === "not-in-era" ? "No wire schema for tools/call in the resolved era" : `Invalid tools/call request: ${validatedRequest.message}`);
|
|
993
|
+
const result = await this._invokeInputRequiredCapableHandler("tools/call", handler, request, ctx);
|
|
994
|
+
if (require_src.isInputRequiredResult(result)) return result;
|
|
995
|
+
const normalizedResult = require_src.normalizeContentlessToolResult(result);
|
|
996
|
+
const validationResult = codec.validateResult("tools/call", normalizedResult);
|
|
997
|
+
if (!validationResult.ok) throw new require_src.ProtocolError(validationResult.reason === "not-in-era" ? require_src.ProtocolErrorCode.InternalError : require_src.ProtocolErrorCode.InvalidParams, validationResult.reason === "not-in-era" ? "No wire schema for tools/call in the resolved era" : `Invalid tools/call result: ${validationResult.message}`);
|
|
998
|
+
return validationResult.value;
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Whether this instance is bound to a 2026-07-28-or-later protocol
|
|
1003
|
+
* revision. Era is instance state — a serving entry (`createMcpHandler`,
|
|
1004
|
+
* `serveStdio`) marks the instance modern at construction; a 2025-era
|
|
1005
|
+
* `initialize` handshake binds it legacy. The multi-round-trip seam reads
|
|
1006
|
+
* this directly: there is no per-request era consult.
|
|
1007
|
+
*/
|
|
1008
|
+
_servedModernEra() {
|
|
1009
|
+
return this._negotiatedProtocolVersion !== void 0 && require_src.isModernProtocolVersion(this._negotiatedProtocolVersion);
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
* Invokes a handler for one of the multi-round-trip methods and applies
|
|
1013
|
+
* the input-required seam:
|
|
1014
|
+
*
|
|
1015
|
+
* - a `UrlElicitationRequiredError` (or any 2025-style server→client
|
|
1016
|
+
* request idiom) escaping the handler on a request served on the
|
|
1017
|
+
* 2026-07-28 era fails LOUDLY with a clear steer to
|
|
1018
|
+
* `inputRequired.elicitUrl(...)` — the `-32042` error never reaches the
|
|
1019
|
+
* 2026-07-28 wire and the throw is not silently converted. Requests
|
|
1020
|
+
* served on the 2025 era keep today's `-32042` behavior byte-exact (the
|
|
1021
|
+
* error is rethrown unchanged).
|
|
1022
|
+
* - an input-required RETURN toward a 2026-07-28 request must satisfy
|
|
1023
|
+
* the at-least-one rule, and every embedded request must be covered by
|
|
1024
|
+
* the capabilities declared on the request's envelope (violations
|
|
1025
|
+
* answer the typed `-32021` error). Toward a 2025-era request the
|
|
1026
|
+
* return is fulfilled by the default-on legacy shim, whose own gate
|
|
1027
|
+
* consults the initialize-declared capabilities and surfaces
|
|
1028
|
+
* violations per family; `inputRequired.legacyShim: false` restores
|
|
1029
|
+
* the pre-shim loud failure.
|
|
1030
|
+
*/
|
|
1031
|
+
async _invokeInputRequiredCapableHandler(method, handler, request, ctx) {
|
|
1032
|
+
const servedModern = this._servedModernEra();
|
|
1033
|
+
const rawRequestState = ctx.mcpReq.requestState();
|
|
1034
|
+
if (rawRequestState !== void 0 && typeof rawRequestState !== "string") throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, "Invalid or expired requestState", { reason: "invalid_request_state" });
|
|
1035
|
+
let ctxForHandler = ctx;
|
|
1036
|
+
if (typeof rawRequestState === "string") {
|
|
1037
|
+
const decoded = await this._verifyRequestState(rawRequestState, ctx, method);
|
|
1038
|
+
if (decoded !== void 0) ctxForHandler = require_src.withRequestStateValue(ctx, decoded);
|
|
1039
|
+
}
|
|
1040
|
+
let result;
|
|
1041
|
+
try {
|
|
1042
|
+
result = await handler(request, ctxForHandler);
|
|
1043
|
+
} catch (error) {
|
|
1044
|
+
if (error instanceof require_src.ProtocolError && error.code === require_src.ProtocolErrorCode.UrlElicitationRequired) {
|
|
1045
|
+
if (!servedModern) throw error;
|
|
1046
|
+
throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InternalError, `URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`);
|
|
1047
|
+
}
|
|
1048
|
+
throw error;
|
|
1049
|
+
}
|
|
1050
|
+
if (!require_src.isInputRequiredResult(result)) return result;
|
|
1051
|
+
if (!servedModern) {
|
|
1052
|
+
if (!this._inputRequiredServing.legacyShim) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion ?? _modelcontextprotocol_core_internal.LATEST_PROTOCOL_VERSION}, which has no input_required vocabulary`);
|
|
1053
|
+
return await this._legacyInputRequiredShim().fulfill(method, handler, request, ctxForHandler, result);
|
|
1054
|
+
}
|
|
1055
|
+
const inputRequests = result.inputRequests;
|
|
1056
|
+
const hasInputRequests = inputRequests != null && Object.keys(inputRequests).length > 0;
|
|
1057
|
+
const hasRequestState = typeof result.requestState === "string";
|
|
1058
|
+
if (!hasInputRequests && !hasRequestState) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InternalError, `Handler for ${method} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);
|
|
1059
|
+
if (hasInputRequests) {
|
|
1060
|
+
const declared = this._inputRequestCapabilityView(ctx);
|
|
1061
|
+
for (const [key, entry] of Object.entries(inputRequests)) {
|
|
1062
|
+
const { embedded, required } = coerceEmbeddedInputRequest(method, key, entry);
|
|
1063
|
+
const missing = require_src.missingClientCapabilities(required, declared);
|
|
1064
|
+
if (missing !== void 0) throw new require_src.MissingRequiredClientCapabilityError({ requiredCapabilities: missing }, `Cannot request input '${key}' (${embedded.method}): the request's client capabilities do not declare the required capability`);
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
return result;
|
|
1068
|
+
}
|
|
1069
|
+
/**
|
|
1070
|
+
* Runs the configured `requestState.verify` hook and returns its
|
|
1071
|
+
* resolved value (`undefined` when unconfigured or the hook returns
|
|
1072
|
+
* nothing). Deny-on-error: any hook failure answers the frozen `-32602`;
|
|
1073
|
+
* the reason goes to `onerror` only.
|
|
1074
|
+
*/
|
|
1075
|
+
async _verifyRequestState(state, ctx, method) {
|
|
1076
|
+
if (this._requestStateVerify === void 0) return;
|
|
1077
|
+
try {
|
|
1078
|
+
return await this._requestStateVerify(state, ctx);
|
|
1079
|
+
} catch (error) {
|
|
1080
|
+
this.onerror?.(/* @__PURE__ */ new Error(`requestState verification rejected ${method}: ${error instanceof Error ? error.message : String(error)}`));
|
|
1081
|
+
throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, "Invalid or expired requestState", { reason: "invalid_request_state" });
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* The per-request resolved client-capabilities view: the request's own
|
|
1086
|
+
* `_meta` envelope on the 2026 era; the `initialize`-declared state on a
|
|
1087
|
+
* 2025-era connection. Per-request instances that never saw an
|
|
1088
|
+
* initialize (stateless legacy) hold nothing, so gates refuse there.
|
|
1089
|
+
*/
|
|
1090
|
+
_inputRequestCapabilityView(ctx) {
|
|
1091
|
+
return this._servedModernEra() ? ctx.mcpReq.envelope?.[_modelcontextprotocol_core_internal.CLIENT_CAPABILITIES_META_KEY] : this._clientCapabilities;
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* Guard for the push-style server→client request APIs ({@linkcode createMessage},
|
|
1095
|
+
* {@linkcode elicitInput}, {@linkcode listRoots}, {@linkcode ping}) on a
|
|
1096
|
+
* modern-era instance: the 2026-07-28 revision has no server→client request
|
|
1097
|
+
* channel, so the call fails before any wire traffic with a typed error
|
|
1098
|
+
* whose message steers to `inputRequired(...)`. The base era gate would
|
|
1099
|
+
* also reject it; this guard runs first to carry the steer.
|
|
1100
|
+
*/
|
|
1101
|
+
_assertPushApiInServedEra(method) {
|
|
1102
|
+
if (this._servedModernEra()) throw new require_src.SdkError(require_src.SdkErrorCode.MethodNotSupportedByProtocolVersion, `Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${method}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`, {
|
|
1103
|
+
method,
|
|
1104
|
+
era: "2026-07-28"
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
assertCapabilityForMethod(method) {
|
|
1108
|
+
switch (method) {
|
|
1109
|
+
case "sampling/createMessage":
|
|
1110
|
+
if (!this._clientCapabilities?.sampling) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Client does not support sampling (required for ${method})`);
|
|
1111
|
+
break;
|
|
1112
|
+
case "elicitation/create":
|
|
1113
|
+
if (!this._clientCapabilities?.elicitation) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Client does not support elicitation (required for ${method})`);
|
|
1114
|
+
break;
|
|
1115
|
+
case "roots/list":
|
|
1116
|
+
if (!this._clientCapabilities?.roots) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Client does not support listing roots (required for ${method})`);
|
|
1117
|
+
break;
|
|
1118
|
+
case "ping": break;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
assertNotificationCapability(method) {
|
|
1122
|
+
switch (method) {
|
|
1123
|
+
case "notifications/message":
|
|
1124
|
+
if (!this._capabilities.logging) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Server does not support logging (required for ${method})`);
|
|
1125
|
+
break;
|
|
1126
|
+
case "notifications/resources/updated":
|
|
1127
|
+
case "notifications/resources/list_changed":
|
|
1128
|
+
if (!this._capabilities.resources) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Server does not support notifying about resources (required for ${method})`);
|
|
1129
|
+
break;
|
|
1130
|
+
case "notifications/tools/list_changed":
|
|
1131
|
+
if (!this._capabilities.tools) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Server does not support notifying of tool list changes (required for ${method})`);
|
|
1132
|
+
break;
|
|
1133
|
+
case "notifications/prompts/list_changed":
|
|
1134
|
+
if (!this._capabilities.prompts) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Server does not support notifying of prompt list changes (required for ${method})`);
|
|
1135
|
+
break;
|
|
1136
|
+
case "notifications/elicitation/complete":
|
|
1137
|
+
if (!this._clientCapabilities?.elicitation?.url) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Client does not support URL elicitation (required for ${method})`);
|
|
1138
|
+
break;
|
|
1139
|
+
case "notifications/cancelled": break;
|
|
1140
|
+
case "notifications/progress": break;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
assertRequestHandlerCapability(method) {
|
|
1144
|
+
switch (method) {
|
|
1145
|
+
case "completion/complete":
|
|
1146
|
+
if (!this._capabilities.completions) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Server does not support completions (required for ${method})`);
|
|
1147
|
+
break;
|
|
1148
|
+
case "logging/setLevel":
|
|
1149
|
+
if (!this._capabilities.logging) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Server does not support logging (required for ${method})`);
|
|
1150
|
+
break;
|
|
1151
|
+
case "prompts/get":
|
|
1152
|
+
case "prompts/list":
|
|
1153
|
+
if (!this._capabilities.prompts) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Server does not support prompts (required for ${method})`);
|
|
1154
|
+
break;
|
|
1155
|
+
case "resources/list":
|
|
1156
|
+
case "resources/templates/list":
|
|
1157
|
+
case "resources/read":
|
|
1158
|
+
if (!this._capabilities.resources) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Server does not support resources (required for ${method})`);
|
|
1159
|
+
break;
|
|
1160
|
+
case "tools/call":
|
|
1161
|
+
case "tools/list":
|
|
1162
|
+
if (!this._capabilities.tools) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, `Server does not support tools (required for ${method})`);
|
|
1163
|
+
break;
|
|
1164
|
+
case "ping":
|
|
1165
|
+
case "initialize": break;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
async _oninitialize(request) {
|
|
1169
|
+
const requestedVersion = request.params.protocolVersion;
|
|
1170
|
+
this._clientCapabilities = request.params.capabilities;
|
|
1171
|
+
this._clientVersion = request.params.clientInfo;
|
|
1172
|
+
const legacyVersions = require_src.legacyProtocolVersions(this._supportedProtocolVersions);
|
|
1173
|
+
const protocolVersion = legacyVersions.includes(requestedVersion) ? requestedVersion : legacyVersions[0] ?? _modelcontextprotocol_core_internal.LATEST_PROTOCOL_VERSION;
|
|
1174
|
+
this._negotiatedProtocolVersion = protocolVersion;
|
|
1175
|
+
this.transport?.setProtocolVersion?.(protocolVersion);
|
|
1176
|
+
return {
|
|
1177
|
+
protocolVersion,
|
|
1178
|
+
capabilities: this.getCapabilities(),
|
|
1179
|
+
serverInfo: this._serverInfo,
|
|
1180
|
+
...this._instructions && { instructions: this._instructions }
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* Answers `server/discover` (protocol revision 2026-07-28). `supportedVersions`
|
|
1185
|
+
* lists only modern revisions (2025-era versions are negotiated via `initialize`);
|
|
1186
|
+
* the capabilities are advertised as-is, listChanged/subscribe bits included
|
|
1187
|
+
* (see {@linkcode discoverAdvertisedCapabilities}).
|
|
1188
|
+
*/
|
|
1189
|
+
_ondiscover() {
|
|
1190
|
+
return {
|
|
1191
|
+
supportedVersions: require_src.modernProtocolVersions(this._supportedProtocolVersions),
|
|
1192
|
+
capabilities: discoverAdvertisedCapabilities(this.getCapabilities()),
|
|
1193
|
+
...this._instructions && { instructions: this._instructions }
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
/**
|
|
1197
|
+
* The identity the 2026-era encode seam stamps into every outbound
|
|
1198
|
+
* result's `_meta` under `io.modelcontextprotocol/serverInfo` (spec PR
|
|
1199
|
+
* #3002: servers SHOULD identify themselves on every response).
|
|
1200
|
+
*/
|
|
1201
|
+
_outboundServerInfo() {
|
|
1202
|
+
return this._serverInfo;
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* After initialization has completed, this will be populated with the client's reported capabilities.
|
|
1206
|
+
*
|
|
1207
|
+
* @deprecated Read client identity from the per-request handler context instead: on
|
|
1208
|
+
* 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` carries the client's
|
|
1209
|
+
* declared capabilities, while on 2025-era connections this accessor keeps returning the
|
|
1210
|
+
* `initialize`-scoped value. The accessor remains functional where `createMcpHandler`
|
|
1211
|
+
* serves the 2026-07-28 era: it backfills it per request from the validated envelope.
|
|
1212
|
+
*/
|
|
1213
|
+
getClientCapabilities() {
|
|
1214
|
+
return this._clientCapabilities;
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* After initialization has completed, this will be populated with information about the client's name and version.
|
|
1218
|
+
*
|
|
1219
|
+
* @deprecated Read client identity from the per-request handler context instead: on
|
|
1220
|
+
* 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` carries the client's
|
|
1221
|
+
* name and version, while on 2025-era connections this accessor keeps returning the
|
|
1222
|
+
* `initialize`-scoped value. The accessor remains functional where `createMcpHandler`
|
|
1223
|
+
* serves the 2026-07-28 era: it backfills it per request from the validated envelope.
|
|
1224
|
+
*/
|
|
1225
|
+
getClientVersion() {
|
|
1226
|
+
return this._clientVersion;
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* After initialization has completed, this will be populated with the protocol version negotiated
|
|
1230
|
+
* with the client (the version the server responded with during the initialize handshake), or
|
|
1231
|
+
* `undefined` before initialization.
|
|
1232
|
+
*
|
|
1233
|
+
* @deprecated Read the protocol revision from the per-request handler context instead: on
|
|
1234
|
+
* 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` names the revision the
|
|
1235
|
+
* request was sent for, while on 2025-era connections this accessor keeps returning the
|
|
1236
|
+
* `initialize`-negotiated version. The accessor remains functional — instances serving the
|
|
1237
|
+
* 2026-07-28 era report that revision.
|
|
1238
|
+
*/
|
|
1239
|
+
getNegotiatedProtocolVersion() {
|
|
1240
|
+
return this._negotiatedProtocolVersion;
|
|
1241
|
+
}
|
|
1242
|
+
/**
|
|
1243
|
+
* Project a `tools/call` result through this instance's negotiated wire
|
|
1244
|
+
* codec — the era-agnostic SEP-2106 §4.3 TextContent auto-append, plus on
|
|
1245
|
+
* the 2025 era the `{result:…}` wrap when `structuredContent` is a
|
|
1246
|
+
* non-object value or the advertised `outputSchema` had a non-object root.
|
|
1247
|
+
* Identity for object-shaped `structuredContent` on the 2026 era.
|
|
1248
|
+
*
|
|
1249
|
+
* `McpServer`'s built-in `tools/call` handler routes through this method.
|
|
1250
|
+
* Low-level `setRequestHandler('tools/call', …)` authors call it
|
|
1251
|
+
* themselves so the projection lives in one place (the codec) and the
|
|
1252
|
+
* server-side handler stays era-blind.
|
|
1253
|
+
*
|
|
1254
|
+
* This is the only codec function exposed on `Server` — the full
|
|
1255
|
+
* `WireCodec` is intentionally not part of the public surface.
|
|
1256
|
+
*/
|
|
1257
|
+
projectCallToolResult(result, advertisedOutputSchema) {
|
|
1258
|
+
return this._wireCodec().projectCallToolResult(result, advertisedOutputSchema);
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Returns the current server capabilities.
|
|
1262
|
+
*/
|
|
1263
|
+
getCapabilities() {
|
|
1264
|
+
return this._capabilities;
|
|
1265
|
+
}
|
|
1266
|
+
/**
|
|
1267
|
+
* Sends a `ping` request to the connected client.
|
|
1268
|
+
*
|
|
1269
|
+
* @deprecated The 2026-07-28 protocol removed ping; it throws on a 2026-07-28-era instance.
|
|
1270
|
+
* If your factory serves both eras, this only works on the legacy path.
|
|
1271
|
+
*/
|
|
1272
|
+
async ping() {
|
|
1273
|
+
this._assertPushApiInServedEra("ping");
|
|
1274
|
+
return this.request({ method: "ping" });
|
|
1275
|
+
}
|
|
1276
|
+
async createMessage(params, options) {
|
|
1277
|
+
this._assertPushApiInServedEra("sampling/createMessage");
|
|
1278
|
+
if ((params.tools || params.toolChoice) && !this._clientCapabilities?.sampling?.tools) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, "Client does not support sampling tools capability.");
|
|
1279
|
+
if (params.messages.length > 0) {
|
|
1280
|
+
const lastMessage = params.messages.at(-1);
|
|
1281
|
+
const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
|
|
1282
|
+
const hasToolResults = lastContent.some((c) => c.type === "tool_result");
|
|
1283
|
+
const previousMessage = params.messages.length > 1 ? params.messages.at(-2) : void 0;
|
|
1284
|
+
const previousContent = previousMessage ? Array.isArray(previousMessage.content) ? previousMessage.content : [previousMessage.content] : [];
|
|
1285
|
+
const hasPreviousToolUse = previousContent.some((c) => c.type === "tool_use");
|
|
1286
|
+
if (hasToolResults) {
|
|
1287
|
+
if (lastContent.some((c) => c.type !== "tool_result")) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, "The last message must contain only tool_result content if any is present");
|
|
1288
|
+
if (!hasPreviousToolUse) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, "tool_result blocks are not matching any tool_use from the previous message");
|
|
1289
|
+
}
|
|
1290
|
+
if (hasPreviousToolUse) {
|
|
1291
|
+
const toolUseIds = new Set(previousContent.filter((c) => c.type === "tool_use").map((c) => c.id));
|
|
1292
|
+
const toolResultIds = new Set(lastContent.filter((c) => c.type === "tool_result").map((c) => c.toolUseId));
|
|
1293
|
+
if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id) => toolResultIds.has(id))) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, "ids of tool_result blocks and tool_use blocks from previous message do not match");
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
const hasTools = Boolean(params.tools || params.toolChoice);
|
|
1297
|
+
const wide = await this.request({
|
|
1298
|
+
method: "sampling/createMessage",
|
|
1299
|
+
params
|
|
1300
|
+
}, options);
|
|
1301
|
+
const outcome = this._wireCodec().samplingResultVariant(hasTools, wide);
|
|
1302
|
+
if (!outcome.ok) throw new require_src.SdkError(require_src.SdkErrorCode.InvalidResult, `Invalid sampling/createMessage result: ${outcome.reason === "invalid" ? outcome.message : outcome.reason}`);
|
|
1303
|
+
return outcome.value;
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Creates an elicitation request for the given parameters.
|
|
1307
|
+
* For backwards compatibility, `mode` may be omitted for form requests and will default to `"form"`.
|
|
1308
|
+
* @param params The parameters for the elicitation request.
|
|
1309
|
+
* @param options Optional request options.
|
|
1310
|
+
* @returns The result of the elicitation request.
|
|
1311
|
+
*
|
|
1312
|
+
* @deprecated Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip)
|
|
1313
|
+
* instead. The 2025 push-style server-to-client request model is replaced by input_required
|
|
1314
|
+
* results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the
|
|
1315
|
+
* legacy path.
|
|
1316
|
+
*/
|
|
1317
|
+
async elicitInput(params, options) {
|
|
1318
|
+
this._assertPushApiInServedEra("elicitation/create");
|
|
1319
|
+
switch (params.mode ?? "form") {
|
|
1320
|
+
case "url":
|
|
1321
|
+
if (!this._clientCapabilities?.elicitation?.url) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, "Client does not support url elicitation.");
|
|
1322
|
+
break;
|
|
1323
|
+
case "form":
|
|
1324
|
+
if (!this._clientCapabilities?.elicitation?.form) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, "Client does not support form elicitation.");
|
|
1325
|
+
break;
|
|
1326
|
+
}
|
|
1327
|
+
return this._sendElicitationLeg(params, options);
|
|
1328
|
+
}
|
|
1329
|
+
/**
|
|
1330
|
+
* The capability-check-free core of {@linkcode elicitInput}. The shim
|
|
1331
|
+
* uses it because its gate differs from the public checks: a bare
|
|
1332
|
+
* `elicitation: {}` counts as form support (the pre-mode rule), and
|
|
1333
|
+
* accepted content passes through unvalidated for parity with the
|
|
1334
|
+
* modern client driver (handlers validate via the schema-aware
|
|
1335
|
+
* `acceptedContent` overload and can re-ask).
|
|
1336
|
+
*/
|
|
1337
|
+
async _sendElicitationLeg(params, options, behavior) {
|
|
1338
|
+
const mode = params.mode ?? "form";
|
|
1339
|
+
const validateAcceptedContent = behavior?.validateAcceptedContent ?? true;
|
|
1340
|
+
switch (mode) {
|
|
1341
|
+
case "url": {
|
|
1342
|
+
const urlParams = params;
|
|
1343
|
+
return this.request({
|
|
1344
|
+
method: "elicitation/create",
|
|
1345
|
+
params: urlParams
|
|
1346
|
+
}, options);
|
|
1347
|
+
}
|
|
1348
|
+
case "form": {
|
|
1349
|
+
const formParams = params.mode === "form" ? params : {
|
|
1350
|
+
...params,
|
|
1351
|
+
mode: "form"
|
|
1352
|
+
};
|
|
1353
|
+
const result = await this.request({
|
|
1354
|
+
method: "elicitation/create",
|
|
1355
|
+
params: formParams
|
|
1356
|
+
}, options);
|
|
1357
|
+
if (validateAcceptedContent && result.action === "accept" && result.content && formParams.requestedSchema) try {
|
|
1358
|
+
const validationResult = this._jsonSchemaValidator.getValidator(formParams.requestedSchema)(result.content);
|
|
1359
|
+
if (!validationResult.valid) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`);
|
|
1360
|
+
} catch (error) {
|
|
1361
|
+
if (error instanceof require_src.ProtocolError) throw error;
|
|
1362
|
+
throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InternalError, `Error validating elicitation response: ${error instanceof Error ? error.message : String(error)}`);
|
|
1363
|
+
}
|
|
1364
|
+
return result;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete`
|
|
1370
|
+
* notification for the specified elicitation ID.
|
|
1371
|
+
*
|
|
1372
|
+
* The notification (and the `elicitationId` it references) exists only on protocol revision
|
|
1373
|
+
* 2025-11-25 — the 2026-07-28 revision removed both. On a connection negotiated at 2026-07-28 the
|
|
1374
|
+
* returned callback rejects with a typed local error before anything reaches the transport
|
|
1375
|
+
* (the method is not part of that revision's wire registry).
|
|
1376
|
+
*
|
|
1377
|
+
* @param elicitationId The ID of the elicitation to mark as complete.
|
|
1378
|
+
* @param options Optional notification options. Useful when the completion notification should be related to a prior request.
|
|
1379
|
+
* @returns A function that emits the completion notification when awaited.
|
|
1380
|
+
*/
|
|
1381
|
+
createElicitationCompletionNotifier(elicitationId, options) {
|
|
1382
|
+
if (!this._clientCapabilities?.elicitation?.url) throw new require_src.SdkError(require_src.SdkErrorCode.CapabilityNotSupported, "Client does not support URL elicitation (required for notifications/elicitation/complete)");
|
|
1383
|
+
return () => this.notification({
|
|
1384
|
+
method: "notifications/elicitation/complete",
|
|
1385
|
+
params: { elicitationId }
|
|
1386
|
+
}, options);
|
|
1387
|
+
}
|
|
1388
|
+
/**
|
|
1389
|
+
* Requests the list of roots from the client.
|
|
1390
|
+
*
|
|
1391
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
1392
|
+
* Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
|
|
1393
|
+
* or migrate to passing paths via tool parameters, resource URIs, or configuration. The 2025
|
|
1394
|
+
* push-style server-to-client request model is replaced by input_required results in the
|
|
1395
|
+
* 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.
|
|
1396
|
+
*/
|
|
1397
|
+
async listRoots(params, options) {
|
|
1398
|
+
this._assertPushApiInServedEra("roots/list");
|
|
1399
|
+
return this.request({
|
|
1400
|
+
method: "roots/list",
|
|
1401
|
+
params
|
|
1402
|
+
}, options);
|
|
1403
|
+
}
|
|
1404
|
+
/**
|
|
1405
|
+
* Sends a logging message to the client, if connected.
|
|
1406
|
+
* Note: You only need to send the parameters object, not the entire JSON-RPC message.
|
|
1407
|
+
* @see {@linkcode LoggingMessageNotification}
|
|
1408
|
+
* @param params
|
|
1409
|
+
* @param sessionId Optional for stateless transports and backward compatibility.
|
|
1410
|
+
*
|
|
1411
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
1412
|
+
* Remains functional during the deprecation window (at least twelve months).
|
|
1413
|
+
* Migrate to stderr logging (STDIO servers) or OpenTelemetry.
|
|
1414
|
+
*/
|
|
1415
|
+
async sendLoggingMessage(params, sessionId) {
|
|
1416
|
+
if (this._capabilities.logging && !this.isMessageIgnored(params.level, sessionId)) return this.notification({
|
|
1417
|
+
method: "notifications/message",
|
|
1418
|
+
params
|
|
1419
|
+
});
|
|
1420
|
+
}
|
|
1421
|
+
async sendResourceUpdated(params) {
|
|
1422
|
+
return this.notification({
|
|
1423
|
+
method: "notifications/resources/updated",
|
|
1424
|
+
params
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
async sendResourceListChanged() {
|
|
1428
|
+
return this.notification({ method: "notifications/resources/list_changed" });
|
|
1429
|
+
}
|
|
1430
|
+
async sendToolListChanged() {
|
|
1431
|
+
return this.notification({ method: "notifications/tools/list_changed" });
|
|
1432
|
+
}
|
|
1433
|
+
async sendPromptListChanged() {
|
|
1434
|
+
return this.notification({ method: "notifications/prompts/list_changed" });
|
|
1435
|
+
}
|
|
1436
|
+
};
|
|
1437
|
+
/**
|
|
1438
|
+
* The capability set a server advertises on `server/discover`. Pure — never
|
|
1439
|
+
* mutates the input; the legacy `initialize` advertisement is untouched.
|
|
1440
|
+
*
|
|
1441
|
+
* The serving entries serve `subscriptions/listen` themselves, so the
|
|
1442
|
+
* `listChanged` and `resources.subscribe` capability bits are advertised
|
|
1443
|
+
* as-is: a modern-era client uses them to decide which notification types to
|
|
1444
|
+
* request on its listen filter.
|
|
1445
|
+
*/
|
|
1446
|
+
function discoverAdvertisedCapabilities(capabilities) {
|
|
1447
|
+
return { ...capabilities };
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
//#endregion
|
|
1451
|
+
//#region src/server/mcp.ts
|
|
1452
|
+
function toolInputElementCount(value, max) {
|
|
1453
|
+
let count = 0;
|
|
1454
|
+
const stack = [value];
|
|
1455
|
+
while (stack.length > 0) {
|
|
1456
|
+
const node = stack.pop();
|
|
1457
|
+
if (node === null || typeof node !== "object") continue;
|
|
1458
|
+
if (Array.isArray(node)) for (const child of node) {
|
|
1459
|
+
if (++count > max) return count;
|
|
1460
|
+
if (child !== null && typeof child === "object") stack.push(child);
|
|
1461
|
+
}
|
|
1462
|
+
else for (const key in node) {
|
|
1463
|
+
if (!Object.prototype.hasOwnProperty.call(node, key)) continue;
|
|
1464
|
+
if (++count > max) return count;
|
|
1465
|
+
const child = node[key];
|
|
1466
|
+
if (child !== null && typeof child === "object") stack.push(child);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
return count;
|
|
1470
|
+
}
|
|
1471
|
+
function resolveMaxToolInputElements(value) {
|
|
1472
|
+
if (value === void 0 || value === Infinity) return void 0;
|
|
1473
|
+
if (typeof value !== "number" || Number.isNaN(value) || value < 1) throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);
|
|
1474
|
+
return value;
|
|
1475
|
+
}
|
|
1476
|
+
/**
|
|
1477
|
+
* High-level MCP server that provides a simpler API for working with resources, tools, and prompts.
|
|
1478
|
+
* For advanced usage (like sending notifications or setting custom request handlers), use the underlying
|
|
1479
|
+
* {@linkcode Server} instance available via the {@linkcode McpServer.server | server} property.
|
|
1480
|
+
*
|
|
1481
|
+
* @example
|
|
1482
|
+
* ```ts source="./mcp.examples.ts#McpServer_basicUsage"
|
|
1483
|
+
* const server = new McpServer({
|
|
1484
|
+
* name: 'my-server',
|
|
1485
|
+
* version: '1.0.0'
|
|
1486
|
+
* });
|
|
1487
|
+
* ```
|
|
1488
|
+
*/
|
|
1489
|
+
var McpServer = class {
|
|
1490
|
+
/**
|
|
1491
|
+
* The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.
|
|
1492
|
+
*/
|
|
1493
|
+
server;
|
|
1494
|
+
_maxToolInputElements;
|
|
1495
|
+
_registeredResources = {};
|
|
1496
|
+
_registeredResourceTemplates = {};
|
|
1497
|
+
_registeredTools = {};
|
|
1498
|
+
_registeredPrompts = {};
|
|
1499
|
+
/** Per-tool JSON-converted `inputSchema`, filled on first use by `toolInputSchemaJson()`. */
|
|
1500
|
+
_toolInputSchemaJson = {};
|
|
1501
|
+
/**
|
|
1502
|
+
* The JSON-serialized `inputSchema` of a registered tool, or `undefined`
|
|
1503
|
+
* when no such tool is registered. Used by the HTTP entry's pre-dispatch
|
|
1504
|
+
* SEP-2243 `Mcp-Param-*` validation step (which needs the same JSON Schema
|
|
1505
|
+
* `tools/list` would emit, before dispatch reaches the handler).
|
|
1506
|
+
*
|
|
1507
|
+
* @internal
|
|
1508
|
+
*/
|
|
1509
|
+
toolInputSchemaJson(name) {
|
|
1510
|
+
const tool = this._registeredTools[name];
|
|
1511
|
+
if (tool === void 0 || !tool.enabled) return void 0;
|
|
1512
|
+
if (Object.hasOwn(this._toolInputSchemaJson, name)) return this._toolInputSchemaJson[name];
|
|
1513
|
+
if (tool.inputSchema === void 0) return EMPTY_OBJECT_JSON_SCHEMA;
|
|
1514
|
+
try {
|
|
1515
|
+
const json = require_src.standardSchemaToJsonSchema(tool.inputSchema, "input");
|
|
1516
|
+
this._toolInputSchemaJson[name] = json;
|
|
1517
|
+
return json;
|
|
1518
|
+
} catch {
|
|
1519
|
+
return;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
constructor(serverInfo, options) {
|
|
1523
|
+
this.server = new Server(serverInfo, options);
|
|
1524
|
+
this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
|
|
1525
|
+
if (options?.capabilities?.tools) this.setToolRequestHandlers();
|
|
1526
|
+
if (options?.capabilities?.resources) this.setResourceRequestHandlers();
|
|
1527
|
+
if (options?.capabilities?.prompts) this.setPromptRequestHandlers();
|
|
1528
|
+
}
|
|
1529
|
+
/**
|
|
1530
|
+
* Attaches to the given transport, starts it, and starts listening for messages.
|
|
1531
|
+
*
|
|
1532
|
+
* 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.
|
|
1533
|
+
*
|
|
1534
|
+
* @example
|
|
1535
|
+
* ```ts source="./mcp.examples.ts#McpServer_connect_stdio"
|
|
1536
|
+
* const server = new McpServer({ name: 'my-server', version: '1.0.0' });
|
|
1537
|
+
* const transport = new StdioServerTransport();
|
|
1538
|
+
* await server.connect(transport);
|
|
1539
|
+
* ```
|
|
1540
|
+
*/
|
|
1541
|
+
async connect(transport) {
|
|
1542
|
+
if (supportsScopeChallengeResolver(transport)) transport.setScopeChallengeResolver((context) => this.resolveScopeChallenge(context));
|
|
1543
|
+
return await this.server.connect(transport);
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* Closes the connection.
|
|
1547
|
+
*/
|
|
1548
|
+
async close() {
|
|
1549
|
+
await this.server.close();
|
|
1550
|
+
}
|
|
1551
|
+
/** @internal */
|
|
1552
|
+
resolveScopeChallenge = (context) => {
|
|
1553
|
+
switch (context.request.method) {
|
|
1554
|
+
case "tools/call": {
|
|
1555
|
+
const toolName = context.request.params?.name;
|
|
1556
|
+
if (typeof toolName !== "string") return;
|
|
1557
|
+
const tool = this._registeredTools[toolName];
|
|
1558
|
+
if (tool === void 0 || !tool.enabled) return;
|
|
1559
|
+
return tool.scopeChallenge?.(context);
|
|
1560
|
+
}
|
|
1561
|
+
case "resources/read": {
|
|
1562
|
+
const resourceUri = context.request.params?.uri;
|
|
1563
|
+
if (typeof resourceUri !== "string") return;
|
|
1564
|
+
let uri;
|
|
1565
|
+
try {
|
|
1566
|
+
uri = new URL(resourceUri);
|
|
1567
|
+
} catch {
|
|
1568
|
+
return;
|
|
1569
|
+
}
|
|
1570
|
+
const resource = this._registeredResources[uri.toString()];
|
|
1571
|
+
if (resource !== void 0) return resource.enabled ? resource.scopeChallenge?.(context) : void 0;
|
|
1572
|
+
for (const template of Object.values(this._registeredResourceTemplates)) if (template.resourceTemplate.uriTemplate.match(uri.toString())) return template.enabled ? template.scopeChallenge?.(context) : void 0;
|
|
1573
|
+
return;
|
|
1574
|
+
}
|
|
1575
|
+
case "prompts/get": {
|
|
1576
|
+
const promptName = context.request.params?.name;
|
|
1577
|
+
if (typeof promptName !== "string") return;
|
|
1578
|
+
const prompt = this._registeredPrompts[promptName];
|
|
1579
|
+
if (prompt === void 0 || !prompt.enabled) return;
|
|
1580
|
+
return prompt.scopeChallenge?.(context);
|
|
1581
|
+
}
|
|
1582
|
+
default: return;
|
|
1583
|
+
}
|
|
1584
|
+
};
|
|
1585
|
+
_toolHandlersInitialized = false;
|
|
1586
|
+
setToolRequestHandlers() {
|
|
1587
|
+
if (this._toolHandlersInitialized) return;
|
|
1588
|
+
this.server.assertCanSetRequestHandler("tools/list");
|
|
1589
|
+
this.server.assertCanSetRequestHandler("tools/call");
|
|
1590
|
+
this.server.registerCapabilities({ tools: { listChanged: this.server.getCapabilities().tools?.listChanged ?? true } });
|
|
1591
|
+
this.server.setRequestHandler("tools/list", () => ({ tools: Object.entries(this._registeredTools).filter(([, tool]) => tool.enabled).map(([name, tool]) => {
|
|
1592
|
+
const toolDefinition = {
|
|
1593
|
+
name,
|
|
1594
|
+
title: tool.title,
|
|
1595
|
+
description: tool.description,
|
|
1596
|
+
inputSchema: tool.inputSchema ? convertListedInputSchema(name, tool.inputSchema) : EMPTY_OBJECT_JSON_SCHEMA,
|
|
1597
|
+
annotations: tool.annotations,
|
|
1598
|
+
icons: tool.icons,
|
|
1599
|
+
execution: tool.execution,
|
|
1600
|
+
_meta: tool._meta
|
|
1601
|
+
};
|
|
1602
|
+
if (tool.outputSchema) toolDefinition.outputSchema = require_src.standardSchemaToJsonSchema(tool.outputSchema, "output");
|
|
1603
|
+
return toolDefinition;
|
|
1604
|
+
}) }));
|
|
1605
|
+
this.server.setRequestHandler("tools/call", async (request, ctx) => {
|
|
1606
|
+
const tool = this._registeredTools[request.params.name];
|
|
1607
|
+
if (!tool) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Tool ${request.params.name} not found`);
|
|
1608
|
+
if (!tool.enabled) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Tool ${request.params.name} disabled`);
|
|
1609
|
+
try {
|
|
1610
|
+
const args = await this.validateToolInput(tool, request.params.arguments, request.params.name);
|
|
1611
|
+
const result = await this.executeToolHandler(tool, args, ctx);
|
|
1612
|
+
await this.validateToolOutput(tool, result, request.params.name);
|
|
1613
|
+
if (require_src.isInputRequiredResult(result)) return result;
|
|
1614
|
+
return this.server.projectCallToolResult(result, tool.outputSchemaJson);
|
|
1615
|
+
} catch (error) {
|
|
1616
|
+
if (error instanceof require_src.ProtocolError && error.code === require_src.ProtocolErrorCode.UrlElicitationRequired) throw error;
|
|
1617
|
+
return this.createToolError(error instanceof Error ? error.message : String(error));
|
|
1618
|
+
}
|
|
1619
|
+
});
|
|
1620
|
+
this._toolHandlersInitialized = true;
|
|
1621
|
+
}
|
|
1622
|
+
/**
|
|
1623
|
+
* Creates a tool error result.
|
|
1624
|
+
*
|
|
1625
|
+
* @param errorMessage - The error message.
|
|
1626
|
+
* @returns The tool error result.
|
|
1627
|
+
*/
|
|
1628
|
+
createToolError(errorMessage) {
|
|
1629
|
+
return {
|
|
1630
|
+
content: [{
|
|
1631
|
+
type: "text",
|
|
1632
|
+
text: errorMessage
|
|
1633
|
+
}],
|
|
1634
|
+
isError: true
|
|
1635
|
+
};
|
|
1636
|
+
}
|
|
1637
|
+
/**
|
|
1638
|
+
* Validates tool input arguments against the tool's input schema.
|
|
1639
|
+
*/
|
|
1640
|
+
async validateToolInput(tool, args, toolName) {
|
|
1641
|
+
if (this._maxToolInputElements !== void 0 && toolInputElementCount(args, this._maxToolInputElements) > this._maxToolInputElements) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Invalid arguments for tool ${toolName}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);
|
|
1642
|
+
if (!tool.inputSchema) return;
|
|
1643
|
+
const parseResult = await require_src.validateStandardSchema(tool.inputSchema, args ?? {});
|
|
1644
|
+
if (!parseResult.success) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${parseResult.error}`);
|
|
1645
|
+
return parseResult.data;
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* Validates tool output against the tool's output schema.
|
|
1649
|
+
*/
|
|
1650
|
+
async validateToolOutput(tool, result, toolName) {
|
|
1651
|
+
if (!tool.outputSchema) return;
|
|
1652
|
+
if (require_src.isInputRequiredResult(result)) return;
|
|
1653
|
+
if (result.isError) return;
|
|
1654
|
+
if (result.structuredContent === void 0) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Output validation error: Tool ${toolName} has an output schema but no structured content was provided`);
|
|
1655
|
+
const parseResult = await require_src.validateStandardSchema(tool.outputSchema, result.structuredContent);
|
|
1656
|
+
if (!parseResult.success) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Output validation error: Invalid structured content for tool ${toolName}: ${parseResult.error}`);
|
|
1657
|
+
}
|
|
1658
|
+
/**
|
|
1659
|
+
* Executes a tool handler.
|
|
1660
|
+
*/
|
|
1661
|
+
async executeToolHandler(tool, args, ctx) {
|
|
1662
|
+
return tool.executor(args, ctx);
|
|
1663
|
+
}
|
|
1664
|
+
_completionHandlerInitialized = false;
|
|
1665
|
+
setCompletionRequestHandler() {
|
|
1666
|
+
if (this._completionHandlerInitialized) return;
|
|
1667
|
+
this.server.assertCanSetRequestHandler("completion/complete");
|
|
1668
|
+
this.server.registerCapabilities({ completions: {} });
|
|
1669
|
+
this.server.setRequestHandler("completion/complete", async (request) => {
|
|
1670
|
+
switch (request.params.ref.type) {
|
|
1671
|
+
case "ref/prompt":
|
|
1672
|
+
require_src.assertCompleteRequestPrompt(request);
|
|
1673
|
+
return this.handlePromptCompletion(request, request.params.ref);
|
|
1674
|
+
case "ref/resource":
|
|
1675
|
+
require_src.assertCompleteRequestResourceTemplate(request);
|
|
1676
|
+
return this.handleResourceCompletion(request, request.params.ref);
|
|
1677
|
+
default: throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Invalid completion reference: ${request.params.ref}`);
|
|
1678
|
+
}
|
|
1679
|
+
});
|
|
1680
|
+
this._completionHandlerInitialized = true;
|
|
1681
|
+
}
|
|
1682
|
+
async handlePromptCompletion(request, ref) {
|
|
1683
|
+
const prompt = this._registeredPrompts[ref.name];
|
|
1684
|
+
if (!prompt) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Prompt ${ref.name} not found`);
|
|
1685
|
+
if (!prompt.enabled) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Prompt ${ref.name} disabled`);
|
|
1686
|
+
if (!prompt.argsSchema) return EMPTY_COMPLETION_RESULT;
|
|
1687
|
+
const field = unwrapOptionalSchema(getSchemaShape(prompt.argsSchema)?.[request.params.argument.name]);
|
|
1688
|
+
if (!isCompletable(field)) return EMPTY_COMPLETION_RESULT;
|
|
1689
|
+
const completer = getCompleter(field);
|
|
1690
|
+
if (!completer) return EMPTY_COMPLETION_RESULT;
|
|
1691
|
+
return createCompletionResult(await completer(request.params.argument.value, request.params.context));
|
|
1692
|
+
}
|
|
1693
|
+
async handleResourceCompletion(request, ref) {
|
|
1694
|
+
const template = Object.values(this._registeredResourceTemplates).find((t) => t.resourceTemplate.uriTemplate.toString() === ref.uri);
|
|
1695
|
+
if (!template) {
|
|
1696
|
+
if (this._registeredResources[ref.uri]) return EMPTY_COMPLETION_RESULT;
|
|
1697
|
+
throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Resource template ${request.params.ref.uri} not found`);
|
|
1698
|
+
}
|
|
1699
|
+
const completer = template.resourceTemplate.completeCallback(request.params.argument.name);
|
|
1700
|
+
if (!completer) return EMPTY_COMPLETION_RESULT;
|
|
1701
|
+
return createCompletionResult(await completer(request.params.argument.value, request.params.context));
|
|
1702
|
+
}
|
|
1703
|
+
_resourceHandlersInitialized = false;
|
|
1704
|
+
setResourceRequestHandlers() {
|
|
1705
|
+
if (this._resourceHandlersInitialized) return;
|
|
1706
|
+
this.server.assertCanSetRequestHandler("resources/list");
|
|
1707
|
+
this.server.assertCanSetRequestHandler("resources/templates/list");
|
|
1708
|
+
this.server.assertCanSetRequestHandler("resources/read");
|
|
1709
|
+
this.server.registerCapabilities({ resources: { listChanged: this.server.getCapabilities().resources?.listChanged ?? true } });
|
|
1710
|
+
this.server.setRequestHandler("resources/list", async (_request, ctx) => {
|
|
1711
|
+
const resources = Object.entries(this._registeredResources).filter(([_, resource]) => resource.enabled).map(([uri, resource]) => ({
|
|
1712
|
+
uri,
|
|
1713
|
+
name: resource.name,
|
|
1714
|
+
...resource.metadata
|
|
1715
|
+
}));
|
|
1716
|
+
const templateResources = [];
|
|
1717
|
+
for (const template of Object.values(this._registeredResourceTemplates)) {
|
|
1718
|
+
if (!template.resourceTemplate.listCallback) continue;
|
|
1719
|
+
const result = await template.resourceTemplate.listCallback(ctx);
|
|
1720
|
+
for (const resource of result.resources) templateResources.push({
|
|
1721
|
+
...template.metadata,
|
|
1722
|
+
...resource
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
return { resources: [...resources, ...templateResources] };
|
|
1726
|
+
});
|
|
1727
|
+
this.server.setRequestHandler("resources/templates/list", async () => {
|
|
1728
|
+
return { resourceTemplates: Object.entries(this._registeredResourceTemplates).map(([name, template]) => ({
|
|
1729
|
+
name,
|
|
1730
|
+
uriTemplate: template.resourceTemplate.uriTemplate.toString(),
|
|
1731
|
+
...template.metadata
|
|
1732
|
+
})) };
|
|
1733
|
+
});
|
|
1734
|
+
this.server.setRequestHandler("resources/read", async (request, ctx) => {
|
|
1735
|
+
let uri;
|
|
1736
|
+
try {
|
|
1737
|
+
uri = new URL(request.params.uri);
|
|
1738
|
+
} catch {
|
|
1739
|
+
throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Resource URI ${request.params.uri} is invalid`, {
|
|
1740
|
+
uri: request.params.uri,
|
|
1741
|
+
reason: "invalid_uri"
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
const resource = this._registeredResources[uri.toString()];
|
|
1745
|
+
if (resource) {
|
|
1746
|
+
if (!resource.enabled) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Resource ${uri} disabled`);
|
|
1747
|
+
return require_src.attachCacheHintFallback(await resource.readCallback(uri, ctx), resource.cacheHint);
|
|
1748
|
+
}
|
|
1749
|
+
for (const template of Object.values(this._registeredResourceTemplates)) {
|
|
1750
|
+
const variables = template.resourceTemplate.uriTemplate.match(uri.toString());
|
|
1751
|
+
if (variables) {
|
|
1752
|
+
if (!template.enabled) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Resource template ${template.resourceTemplate.uriTemplate} disabled`);
|
|
1753
|
+
return require_src.attachCacheHintFallback(await template.readCallback(uri, variables, ctx), template.cacheHint);
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
throw new require_src.ResourceNotFoundError(request.params.uri);
|
|
1757
|
+
});
|
|
1758
|
+
this._resourceHandlersInitialized = true;
|
|
1759
|
+
}
|
|
1760
|
+
_promptHandlersInitialized = false;
|
|
1761
|
+
setPromptRequestHandlers() {
|
|
1762
|
+
if (this._promptHandlersInitialized) return;
|
|
1763
|
+
this.server.assertCanSetRequestHandler("prompts/list");
|
|
1764
|
+
this.server.assertCanSetRequestHandler("prompts/get");
|
|
1765
|
+
this.server.registerCapabilities({ prompts: { listChanged: this.server.getCapabilities().prompts?.listChanged ?? true } });
|
|
1766
|
+
this.server.setRequestHandler("prompts/list", () => ({ prompts: Object.entries(this._registeredPrompts).filter(([, prompt]) => prompt.enabled).map(([name, prompt]) => {
|
|
1767
|
+
return {
|
|
1768
|
+
name,
|
|
1769
|
+
title: prompt.title,
|
|
1770
|
+
description: prompt.description,
|
|
1771
|
+
arguments: prompt.argsSchema ? require_src.promptArgumentsFromStandardSchema(prompt.argsSchema) : void 0,
|
|
1772
|
+
icons: prompt.icons,
|
|
1773
|
+
_meta: prompt._meta
|
|
1774
|
+
};
|
|
1775
|
+
}) }));
|
|
1776
|
+
this.server.setRequestHandler("prompts/get", async (request, ctx) => {
|
|
1777
|
+
const prompt = this._registeredPrompts[request.params.name];
|
|
1778
|
+
if (!prompt) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Prompt ${request.params.name} not found`);
|
|
1779
|
+
if (!prompt.enabled) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Prompt ${request.params.name} disabled`);
|
|
1780
|
+
return prompt.handler(request.params.arguments, ctx);
|
|
1781
|
+
});
|
|
1782
|
+
this._promptHandlersInitialized = true;
|
|
1783
|
+
}
|
|
1784
|
+
registerResource(name, uriOrTemplate, config, readCallback) {
|
|
1785
|
+
const { cacheHint, scopeChallenge, ...resourceMetadata } = config;
|
|
1786
|
+
const metadata = resourceMetadata;
|
|
1787
|
+
if (cacheHint !== void 0) require_src.assertValidCacheHint(cacheHint, `resource ${name}`);
|
|
1788
|
+
if (typeof uriOrTemplate === "string") {
|
|
1789
|
+
if (this._registeredResources[uriOrTemplate]) throw new Error(`Resource ${uriOrTemplate} is already registered`);
|
|
1790
|
+
const registeredResource = this._createRegisteredResource(name, config.title, uriOrTemplate, metadata, scopeChallenge, readCallback);
|
|
1791
|
+
if (cacheHint !== void 0) registeredResource.cacheHint = cacheHint;
|
|
1792
|
+
this.setResourceRequestHandlers();
|
|
1793
|
+
this.sendResourceListChanged();
|
|
1794
|
+
return registeredResource;
|
|
1795
|
+
} else {
|
|
1796
|
+
if (this._registeredResourceTemplates[name]) throw new Error(`Resource template ${name} is already registered`);
|
|
1797
|
+
const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, config.title, uriOrTemplate, metadata, scopeChallenge, readCallback);
|
|
1798
|
+
if (cacheHint !== void 0) registeredResourceTemplate.cacheHint = cacheHint;
|
|
1799
|
+
this.setResourceRequestHandlers();
|
|
1800
|
+
this.sendResourceListChanged();
|
|
1801
|
+
return registeredResourceTemplate;
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
_createRegisteredResource(name, title, uri, metadata, scopeChallenge, readCallback) {
|
|
1805
|
+
const registeredResource = {
|
|
1806
|
+
name,
|
|
1807
|
+
title,
|
|
1808
|
+
metadata,
|
|
1809
|
+
readCallback,
|
|
1810
|
+
scopeChallenge,
|
|
1811
|
+
enabled: true,
|
|
1812
|
+
disable: () => registeredResource.update({ enabled: false }),
|
|
1813
|
+
enable: () => registeredResource.update({ enabled: true }),
|
|
1814
|
+
remove: () => registeredResource.update({ uri: null }),
|
|
1815
|
+
update: (updates) => {
|
|
1816
|
+
if (updates.uri !== void 0 && updates.uri !== uri) {
|
|
1817
|
+
delete this._registeredResources[uri];
|
|
1818
|
+
if (updates.uri) this._registeredResources[updates.uri] = registeredResource;
|
|
1819
|
+
}
|
|
1820
|
+
if (updates.name !== void 0) registeredResource.name = updates.name;
|
|
1821
|
+
if (updates.metadata !== void 0) registeredResource.metadata = updates.metadata;
|
|
1822
|
+
if (updates.title !== void 0) {
|
|
1823
|
+
registeredResource.title = updates.title;
|
|
1824
|
+
registeredResource.metadata = {
|
|
1825
|
+
...registeredResource.metadata,
|
|
1826
|
+
title: updates.title
|
|
1827
|
+
};
|
|
1828
|
+
}
|
|
1829
|
+
if (updates.callback !== void 0) registeredResource.readCallback = updates.callback;
|
|
1830
|
+
if (updates.scopeChallenge !== void 0) registeredResource.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;
|
|
1831
|
+
if (updates.enabled !== void 0) registeredResource.enabled = updates.enabled;
|
|
1832
|
+
this.sendResourceListChanged();
|
|
1833
|
+
}
|
|
1834
|
+
};
|
|
1835
|
+
this._registeredResources[uri] = registeredResource;
|
|
1836
|
+
return registeredResource;
|
|
1837
|
+
}
|
|
1838
|
+
_createRegisteredResourceTemplate(name, title, template, metadata, scopeChallenge, readCallback) {
|
|
1839
|
+
const registeredResourceTemplate = {
|
|
1840
|
+
resourceTemplate: template,
|
|
1841
|
+
title,
|
|
1842
|
+
metadata,
|
|
1843
|
+
readCallback,
|
|
1844
|
+
scopeChallenge,
|
|
1845
|
+
enabled: true,
|
|
1846
|
+
disable: () => registeredResourceTemplate.update({ enabled: false }),
|
|
1847
|
+
enable: () => registeredResourceTemplate.update({ enabled: true }),
|
|
1848
|
+
remove: () => registeredResourceTemplate.update({ name: null }),
|
|
1849
|
+
update: (updates) => {
|
|
1850
|
+
if (updates.name !== void 0 && updates.name !== name) {
|
|
1851
|
+
delete this._registeredResourceTemplates[name];
|
|
1852
|
+
if (updates.name) this._registeredResourceTemplates[updates.name] = registeredResourceTemplate;
|
|
1853
|
+
}
|
|
1854
|
+
if (updates.template !== void 0) registeredResourceTemplate.resourceTemplate = updates.template;
|
|
1855
|
+
if (updates.metadata !== void 0) registeredResourceTemplate.metadata = updates.metadata;
|
|
1856
|
+
if (updates.title !== void 0) {
|
|
1857
|
+
registeredResourceTemplate.title = updates.title;
|
|
1858
|
+
registeredResourceTemplate.metadata = {
|
|
1859
|
+
...registeredResourceTemplate.metadata,
|
|
1860
|
+
title: updates.title
|
|
1861
|
+
};
|
|
1862
|
+
}
|
|
1863
|
+
if (updates.callback !== void 0) registeredResourceTemplate.readCallback = updates.callback;
|
|
1864
|
+
if (updates.scopeChallenge !== void 0) registeredResourceTemplate.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;
|
|
1865
|
+
if (updates.enabled !== void 0) registeredResourceTemplate.enabled = updates.enabled;
|
|
1866
|
+
this.sendResourceListChanged();
|
|
1867
|
+
}
|
|
1868
|
+
};
|
|
1869
|
+
this._registeredResourceTemplates[name] = registeredResourceTemplate;
|
|
1870
|
+
const variableNames = template.uriTemplate.variableNames;
|
|
1871
|
+
if (Array.isArray(variableNames) && variableNames.some((v) => !!template.completeCallback(v))) this.setCompletionRequestHandler();
|
|
1872
|
+
return registeredResourceTemplate;
|
|
1873
|
+
}
|
|
1874
|
+
_createRegisteredPrompt(name, title, description, argsSchema, callback, icons, scopeChallenge, _meta) {
|
|
1875
|
+
let currentArgsSchema = argsSchema;
|
|
1876
|
+
let currentCallback = callback;
|
|
1877
|
+
const registeredPrompt = {
|
|
1878
|
+
title,
|
|
1879
|
+
description,
|
|
1880
|
+
argsSchema,
|
|
1881
|
+
icons,
|
|
1882
|
+
scopeChallenge,
|
|
1883
|
+
_meta,
|
|
1884
|
+
handler: createPromptHandler(name, argsSchema, callback),
|
|
1885
|
+
enabled: true,
|
|
1886
|
+
disable: () => registeredPrompt.update({ enabled: false }),
|
|
1887
|
+
enable: () => registeredPrompt.update({ enabled: true }),
|
|
1888
|
+
remove: () => registeredPrompt.update({ name: null }),
|
|
1889
|
+
update: (updates) => {
|
|
1890
|
+
if (updates.name !== void 0 && updates.name !== name) {
|
|
1891
|
+
delete this._registeredPrompts[name];
|
|
1892
|
+
if (updates.name) this._registeredPrompts[updates.name] = registeredPrompt;
|
|
1893
|
+
}
|
|
1894
|
+
if (updates.title !== void 0) registeredPrompt.title = updates.title;
|
|
1895
|
+
if (updates.description !== void 0) registeredPrompt.description = updates.description;
|
|
1896
|
+
if (updates.icons !== void 0) registeredPrompt.icons = updates.icons;
|
|
1897
|
+
if (updates.scopeChallenge !== void 0) registeredPrompt.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;
|
|
1898
|
+
if (updates._meta !== void 0) registeredPrompt._meta = updates._meta;
|
|
1899
|
+
let needsHandlerRegen = false;
|
|
1900
|
+
if (updates.argsSchema !== void 0) {
|
|
1901
|
+
registeredPrompt.argsSchema = updates.argsSchema;
|
|
1902
|
+
currentArgsSchema = updates.argsSchema;
|
|
1903
|
+
needsHandlerRegen = true;
|
|
1904
|
+
}
|
|
1905
|
+
if (updates.callback !== void 0) {
|
|
1906
|
+
currentCallback = updates.callback;
|
|
1907
|
+
needsHandlerRegen = true;
|
|
1908
|
+
}
|
|
1909
|
+
if (needsHandlerRegen) registeredPrompt.handler = createPromptHandler(name, currentArgsSchema, currentCallback);
|
|
1910
|
+
if (updates.enabled !== void 0) registeredPrompt.enabled = updates.enabled;
|
|
1911
|
+
this.sendPromptListChanged();
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
this._registeredPrompts[name] = registeredPrompt;
|
|
1915
|
+
if (argsSchema) {
|
|
1916
|
+
const shape = getSchemaShape(argsSchema);
|
|
1917
|
+
if (shape) {
|
|
1918
|
+
if (Object.values(shape).some((field) => {
|
|
1919
|
+
return isCompletable(unwrapOptionalSchema(field));
|
|
1920
|
+
})) this.setCompletionRequestHandler();
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
return registeredPrompt;
|
|
1924
|
+
}
|
|
1925
|
+
_createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, icons, execution, scopeChallenge, _meta, handler) {
|
|
1926
|
+
require_src.validateAndWarnToolName(name);
|
|
1927
|
+
let currentHandler = handler;
|
|
1928
|
+
let outputSchemaJson;
|
|
1929
|
+
const registeredTool = {
|
|
1930
|
+
title,
|
|
1931
|
+
description,
|
|
1932
|
+
inputSchema,
|
|
1933
|
+
outputSchema,
|
|
1934
|
+
get outputSchemaJson() {
|
|
1935
|
+
return outputSchemaJson ??= convertOutputSchemaJson(registeredTool.outputSchema);
|
|
1936
|
+
},
|
|
1937
|
+
set outputSchemaJson(value) {
|
|
1938
|
+
outputSchemaJson = value;
|
|
1939
|
+
},
|
|
1940
|
+
annotations,
|
|
1941
|
+
icons,
|
|
1942
|
+
execution,
|
|
1943
|
+
scopeChallenge,
|
|
1944
|
+
_meta,
|
|
1945
|
+
handler,
|
|
1946
|
+
executor: createToolExecutor(inputSchema, handler),
|
|
1947
|
+
enabled: true,
|
|
1948
|
+
disable: () => registeredTool.update({ enabled: false }),
|
|
1949
|
+
enable: () => registeredTool.update({ enabled: true }),
|
|
1950
|
+
remove: () => registeredTool.update({ name: null }),
|
|
1951
|
+
update: (updates) => {
|
|
1952
|
+
if (updates.name !== void 0 && updates.name !== name) {
|
|
1953
|
+
if (typeof updates.name === "string") require_src.validateAndWarnToolName(updates.name);
|
|
1954
|
+
delete this._registeredTools[name];
|
|
1955
|
+
delete this._toolInputSchemaJson[name];
|
|
1956
|
+
if (updates.name) {
|
|
1957
|
+
delete this._toolInputSchemaJson[updates.name];
|
|
1958
|
+
this._registeredTools[updates.name] = registeredTool;
|
|
1959
|
+
name = updates.name;
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
if (updates.title !== void 0) registeredTool.title = updates.title;
|
|
1963
|
+
if (updates.description !== void 0) registeredTool.description = updates.description;
|
|
1964
|
+
let needsExecutorRegen = false;
|
|
1965
|
+
if (updates.paramsSchema !== void 0) {
|
|
1966
|
+
registeredTool.inputSchema = updates.paramsSchema;
|
|
1967
|
+
delete this._toolInputSchemaJson[name];
|
|
1968
|
+
needsExecutorRegen = true;
|
|
1969
|
+
}
|
|
1970
|
+
if (updates.callback !== void 0) {
|
|
1971
|
+
registeredTool.handler = updates.callback;
|
|
1972
|
+
currentHandler = updates.callback;
|
|
1973
|
+
needsExecutorRegen = true;
|
|
1974
|
+
}
|
|
1975
|
+
if (needsExecutorRegen) registeredTool.executor = createToolExecutor(registeredTool.inputSchema, currentHandler);
|
|
1976
|
+
if (updates.outputSchema !== void 0) {
|
|
1977
|
+
registeredTool.outputSchema = updates.outputSchema;
|
|
1978
|
+
registeredTool.outputSchemaJson = convertOutputSchemaJson(updates.outputSchema);
|
|
1979
|
+
}
|
|
1980
|
+
if (updates.annotations !== void 0) registeredTool.annotations = updates.annotations;
|
|
1981
|
+
if (updates.icons !== void 0) registeredTool.icons = updates.icons;
|
|
1982
|
+
if (updates.scopeChallenge !== void 0) registeredTool.scopeChallenge = updates.scopeChallenge === null ? void 0 : updates.scopeChallenge;
|
|
1983
|
+
if (updates._meta !== void 0) registeredTool._meta = updates._meta;
|
|
1984
|
+
if (updates.enabled !== void 0) registeredTool.enabled = updates.enabled;
|
|
1985
|
+
this.sendToolListChanged();
|
|
1986
|
+
}
|
|
1987
|
+
};
|
|
1988
|
+
this._registeredTools[name] = registeredTool;
|
|
1989
|
+
this.setToolRequestHandlers();
|
|
1990
|
+
this.sendToolListChanged();
|
|
1991
|
+
return registeredTool;
|
|
1992
|
+
}
|
|
1993
|
+
registerTool(name, config, cb) {
|
|
1994
|
+
if (this._registeredTools[name]) throw new Error(`Tool ${name} is already registered`);
|
|
1995
|
+
const { title, description, inputSchema, outputSchema, annotations, icons, scopeChallenge, _meta } = config;
|
|
1996
|
+
return this._createRegisteredTool(name, title, description, require_src.normalizeRawShapeSchema(inputSchema), require_src.normalizeRawShapeSchema(outputSchema), annotations, icons, void 0, scopeChallenge, _meta, cb);
|
|
1997
|
+
}
|
|
1998
|
+
registerPrompt(name, config, cb) {
|
|
1999
|
+
if (this._registeredPrompts[name]) throw new Error(`Prompt ${name} is already registered`);
|
|
2000
|
+
const { title, description, argsSchema, icons, scopeChallenge, _meta } = config;
|
|
2001
|
+
const registeredPrompt = this._createRegisteredPrompt(name, title, description, require_src.normalizeRawShapeSchema(argsSchema), cb, icons, scopeChallenge, _meta);
|
|
2002
|
+
this.setPromptRequestHandlers();
|
|
2003
|
+
this.sendPromptListChanged();
|
|
2004
|
+
return registeredPrompt;
|
|
2005
|
+
}
|
|
2006
|
+
/**
|
|
2007
|
+
* Checks if the server is connected to a transport.
|
|
2008
|
+
* @returns `true` if the server is connected
|
|
2009
|
+
*/
|
|
2010
|
+
isConnected() {
|
|
2011
|
+
return this.server.transport !== void 0;
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* Sends a logging message to the client, if connected.
|
|
2015
|
+
* Note: You only need to send the parameters object, not the entire JSON-RPC message.
|
|
2016
|
+
* @see {@linkcode LoggingMessageNotification}
|
|
2017
|
+
* @param params
|
|
2018
|
+
* @param sessionId Optional for stateless transports and backward compatibility.
|
|
2019
|
+
*
|
|
2020
|
+
* @example
|
|
2021
|
+
* ```ts source="./mcp.examples.ts#McpServer_sendLoggingMessage_basic"
|
|
2022
|
+
* await server.sendLoggingMessage({
|
|
2023
|
+
* level: 'info',
|
|
2024
|
+
* data: 'Processing complete'
|
|
2025
|
+
* });
|
|
2026
|
+
* ```
|
|
2027
|
+
*
|
|
2028
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
2029
|
+
* Remains functional during the deprecation window (at least twelve months).
|
|
2030
|
+
* Migrate to stderr logging (STDIO servers) or OpenTelemetry.
|
|
2031
|
+
*/
|
|
2032
|
+
async sendLoggingMessage(params, sessionId) {
|
|
2033
|
+
return this.server.sendLoggingMessage(params, sessionId);
|
|
2034
|
+
}
|
|
2035
|
+
/**
|
|
2036
|
+
* Sends a resource list changed event to the client, if connected.
|
|
2037
|
+
*/
|
|
2038
|
+
sendResourceListChanged() {
|
|
2039
|
+
if (this.isConnected()) this.server.sendResourceListChanged();
|
|
2040
|
+
}
|
|
2041
|
+
/**
|
|
2042
|
+
* Sends a tool list changed event to the client, if connected.
|
|
2043
|
+
*/
|
|
2044
|
+
sendToolListChanged() {
|
|
2045
|
+
if (this.isConnected()) this.server.sendToolListChanged();
|
|
2046
|
+
}
|
|
2047
|
+
/**
|
|
2048
|
+
* Sends a prompt list changed event to the client, if connected.
|
|
2049
|
+
*/
|
|
2050
|
+
sendPromptListChanged() {
|
|
2051
|
+
if (this.isConnected()) this.server.sendPromptListChanged();
|
|
2052
|
+
}
|
|
2053
|
+
};
|
|
2054
|
+
/**
|
|
2055
|
+
* A resource template combines a URI pattern with optional functionality to enumerate
|
|
2056
|
+
* all resources matching that pattern.
|
|
2057
|
+
*/
|
|
2058
|
+
var ResourceTemplate = class {
|
|
2059
|
+
_uriTemplate;
|
|
2060
|
+
constructor(uriTemplate, _callbacks) {
|
|
2061
|
+
this._callbacks = _callbacks;
|
|
2062
|
+
this._uriTemplate = typeof uriTemplate === "string" ? new require_src.UriTemplate(uriTemplate) : uriTemplate;
|
|
2063
|
+
}
|
|
2064
|
+
/**
|
|
2065
|
+
* Gets the URI template pattern.
|
|
2066
|
+
*/
|
|
2067
|
+
get uriTemplate() {
|
|
2068
|
+
return this._uriTemplate;
|
|
2069
|
+
}
|
|
2070
|
+
/**
|
|
2071
|
+
* Gets the list callback, if one was provided.
|
|
2072
|
+
*/
|
|
2073
|
+
get listCallback() {
|
|
2074
|
+
return this._callbacks.list;
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Gets the callback for completing a specific URI template variable, if one was provided.
|
|
2078
|
+
*/
|
|
2079
|
+
completeCallback(variable) {
|
|
2080
|
+
return this._callbacks.complete?.[variable];
|
|
2081
|
+
}
|
|
2082
|
+
};
|
|
2083
|
+
/**
|
|
2084
|
+
* Creates an executor that invokes the handler with the appropriate arguments.
|
|
2085
|
+
* When `inputSchema` is defined, the handler is called with `(args, ctx)`.
|
|
2086
|
+
* When `inputSchema` is undefined, the handler is called with just `(ctx)`.
|
|
2087
|
+
*/
|
|
2088
|
+
function createToolExecutor(inputSchema, handler) {
|
|
2089
|
+
if (inputSchema) {
|
|
2090
|
+
const callback$1 = handler;
|
|
2091
|
+
return async (args, ctx) => callback$1(args, ctx);
|
|
2092
|
+
}
|
|
2093
|
+
const callback = handler;
|
|
2094
|
+
return async (_args, ctx) => callback(ctx);
|
|
2095
|
+
}
|
|
2096
|
+
const EMPTY_OBJECT_JSON_SCHEMA = {
|
|
2097
|
+
type: "object",
|
|
2098
|
+
properties: {}
|
|
2099
|
+
};
|
|
2100
|
+
/** Converts a tool's `inputSchema` for `tools/list` and warns on an invalid SEP-2243 `x-mcp-header` declaration. */
|
|
2101
|
+
function convertListedInputSchema(name, inputSchema) {
|
|
2102
|
+
const json = require_src.standardSchemaToJsonSchema(inputSchema, "input");
|
|
2103
|
+
const scan = require_src.scanXMcpHeaderDeclarations(json);
|
|
2104
|
+
if (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
|
|
2105
|
+
return json;
|
|
2106
|
+
}
|
|
2107
|
+
/**
|
|
2108
|
+
* Convert a registered `outputSchema` to JSON Schema, memoised on {@link RegisteredTool.outputSchemaJson}
|
|
2109
|
+
* so `tools/call` passes the SAME advertised schema to the wire codec's `projectCallToolResult` that
|
|
2110
|
+
* `tools/list` emits (and that the 2025 codec's `encodeResult('tools/list', …)` may wrap). A conversion
|
|
2111
|
+
* failure yields `undefined` so the failure surfaces where it always has (`tools/list`).
|
|
2112
|
+
*/
|
|
2113
|
+
function convertOutputSchemaJson(outputSchema) {
|
|
2114
|
+
if (outputSchema === void 0) return void 0;
|
|
2115
|
+
try {
|
|
2116
|
+
return require_src.standardSchemaToJsonSchema(outputSchema, "output");
|
|
2117
|
+
} catch {
|
|
2118
|
+
return;
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
/**
|
|
2122
|
+
* Creates a type-safe prompt handler that captures the schema and callback in a closure.
|
|
2123
|
+
* This eliminates the need for type assertions at the call site.
|
|
2124
|
+
*/
|
|
2125
|
+
function createPromptHandler(name, argsSchema, callback) {
|
|
2126
|
+
if (argsSchema) {
|
|
2127
|
+
const typedCallback = callback;
|
|
2128
|
+
return async (args, ctx) => {
|
|
2129
|
+
const parseResult = await require_src.validateStandardSchema(argsSchema, args ?? {});
|
|
2130
|
+
if (!parseResult.success) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Invalid arguments for prompt ${name}: ${parseResult.error}`);
|
|
2131
|
+
return typedCallback(parseResult.data, ctx);
|
|
2132
|
+
};
|
|
2133
|
+
} else {
|
|
2134
|
+
const typedCallback = callback;
|
|
2135
|
+
return async (_args, ctx) => {
|
|
2136
|
+
return typedCallback(ctx);
|
|
2137
|
+
};
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
function createCompletionResult(suggestions) {
|
|
2141
|
+
return { completion: {
|
|
2142
|
+
values: suggestions.map(String).slice(0, 100),
|
|
2143
|
+
total: suggestions.length,
|
|
2144
|
+
hasMore: suggestions.length > 100
|
|
2145
|
+
} };
|
|
2146
|
+
}
|
|
2147
|
+
const EMPTY_COMPLETION_RESULT = { completion: {
|
|
2148
|
+
values: [],
|
|
2149
|
+
hasMore: false
|
|
2150
|
+
} };
|
|
2151
|
+
/** @internal Gets the shape of a Zod object schema */
|
|
2152
|
+
function getSchemaShape(schema) {
|
|
2153
|
+
const candidate = schema;
|
|
2154
|
+
if (candidate.shape && typeof candidate.shape === "object") return candidate.shape;
|
|
2155
|
+
}
|
|
2156
|
+
/** @internal Checks if a Zod schema is optional */
|
|
2157
|
+
function isOptionalSchema(schema) {
|
|
2158
|
+
return schema?.type === "optional";
|
|
2159
|
+
}
|
|
2160
|
+
/** @internal Unwraps an optional Zod schema */
|
|
2161
|
+
function unwrapOptionalSchema(schema) {
|
|
2162
|
+
if (!isOptionalSchema(schema)) return schema;
|
|
2163
|
+
return schema.def?.innerType ?? schema;
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
//#endregion
|
|
2167
|
+
Object.defineProperty(exports, 'DEFAULT_SSE_KEEP_ALIVE_MS', {
|
|
2168
|
+
enumerable: true,
|
|
2169
|
+
get: function () {
|
|
2170
|
+
return DEFAULT_SSE_KEEP_ALIVE_MS;
|
|
2171
|
+
}
|
|
2172
|
+
});
|
|
2173
|
+
Object.defineProperty(exports, 'McpServer', {
|
|
2174
|
+
enumerable: true,
|
|
2175
|
+
get: function () {
|
|
2176
|
+
return McpServer;
|
|
2177
|
+
}
|
|
2178
|
+
});
|
|
2179
|
+
Object.defineProperty(exports, 'PerRequestHTTPServerTransport', {
|
|
2180
|
+
enumerable: true,
|
|
2181
|
+
get: function () {
|
|
2182
|
+
return PerRequestHTTPServerTransport;
|
|
2183
|
+
}
|
|
2184
|
+
});
|
|
2185
|
+
Object.defineProperty(exports, 'ResourceTemplate', {
|
|
2186
|
+
enumerable: true,
|
|
2187
|
+
get: function () {
|
|
2188
|
+
return ResourceTemplate;
|
|
2189
|
+
}
|
|
2190
|
+
});
|
|
2191
|
+
Object.defineProperty(exports, 'Server', {
|
|
2192
|
+
enumerable: true,
|
|
2193
|
+
get: function () {
|
|
2194
|
+
return Server;
|
|
2195
|
+
}
|
|
2196
|
+
});
|
|
2197
|
+
Object.defineProperty(exports, 'armSseKeepAlive', {
|
|
2198
|
+
enumerable: true,
|
|
2199
|
+
get: function () {
|
|
2200
|
+
return armSseKeepAlive;
|
|
2201
|
+
}
|
|
2202
|
+
});
|
|
2203
|
+
Object.defineProperty(exports, 'bearerAuthChallengeResponse', {
|
|
2204
|
+
enumerable: true,
|
|
2205
|
+
get: function () {
|
|
2206
|
+
return bearerAuthChallengeResponse;
|
|
2207
|
+
}
|
|
2208
|
+
});
|
|
2209
|
+
Object.defineProperty(exports, 'buildOAuthProtectedResourceMetadata', {
|
|
2210
|
+
enumerable: true,
|
|
2211
|
+
get: function () {
|
|
2212
|
+
return buildOAuthProtectedResourceMetadata;
|
|
2213
|
+
}
|
|
2214
|
+
});
|
|
2215
|
+
Object.defineProperty(exports, 'completable', {
|
|
2216
|
+
enumerable: true,
|
|
2217
|
+
get: function () {
|
|
2218
|
+
return completable;
|
|
2219
|
+
}
|
|
2220
|
+
});
|
|
2221
|
+
Object.defineProperty(exports, 'createScopeChallengeResponse', {
|
|
2222
|
+
enumerable: true,
|
|
2223
|
+
get: function () {
|
|
2224
|
+
return createScopeChallengeResponse;
|
|
2225
|
+
}
|
|
2226
|
+
});
|
|
2227
|
+
Object.defineProperty(exports, 'findScopeChallenge', {
|
|
2228
|
+
enumerable: true,
|
|
2229
|
+
get: function () {
|
|
2230
|
+
return findScopeChallenge;
|
|
2231
|
+
}
|
|
2232
|
+
});
|
|
2233
|
+
Object.defineProperty(exports, 'getOAuthProtectedResourceMetadataUrl', {
|
|
2234
|
+
enumerable: true,
|
|
2235
|
+
get: function () {
|
|
2236
|
+
return getOAuthProtectedResourceMetadataUrl;
|
|
2237
|
+
}
|
|
2238
|
+
});
|
|
2239
|
+
Object.defineProperty(exports, 'installModernOnlyHandlers', {
|
|
2240
|
+
enumerable: true,
|
|
2241
|
+
get: function () {
|
|
2242
|
+
return installModernOnlyHandlers;
|
|
2243
|
+
}
|
|
2244
|
+
});
|
|
2245
|
+
Object.defineProperty(exports, 'isCompletable', {
|
|
2246
|
+
enumerable: true,
|
|
2247
|
+
get: function () {
|
|
2248
|
+
return isCompletable;
|
|
2249
|
+
}
|
|
2250
|
+
});
|
|
2251
|
+
Object.defineProperty(exports, 'oauthMetadataResponse', {
|
|
2252
|
+
enumerable: true,
|
|
2253
|
+
get: function () {
|
|
2254
|
+
return oauthMetadataResponse;
|
|
2255
|
+
}
|
|
2256
|
+
});
|
|
2257
|
+
Object.defineProperty(exports, 'requireBearerAuth', {
|
|
2258
|
+
enumerable: true,
|
|
2259
|
+
get: function () {
|
|
2260
|
+
return requireBearerAuth;
|
|
2261
|
+
}
|
|
2262
|
+
});
|
|
2263
|
+
Object.defineProperty(exports, 'requireScopes', {
|
|
2264
|
+
enumerable: true,
|
|
2265
|
+
get: function () {
|
|
2266
|
+
return requireScopes;
|
|
2267
|
+
}
|
|
2268
|
+
});
|
|
2269
|
+
Object.defineProperty(exports, 'scopeChallengeResourceMetadataUrl', {
|
|
2270
|
+
enumerable: true,
|
|
2271
|
+
get: function () {
|
|
2272
|
+
return scopeChallengeResourceMetadataUrl;
|
|
2273
|
+
}
|
|
2274
|
+
});
|
|
2275
|
+
Object.defineProperty(exports, 'seedClientIdentityFromEnvelope', {
|
|
2276
|
+
enumerable: true,
|
|
2277
|
+
get: function () {
|
|
2278
|
+
return seedClientIdentityFromEnvelope;
|
|
2279
|
+
}
|
|
2280
|
+
});
|
|
2281
|
+
Object.defineProperty(exports, 'serverIdentityOf', {
|
|
2282
|
+
enumerable: true,
|
|
2283
|
+
get: function () {
|
|
2284
|
+
return serverIdentityOf;
|
|
2285
|
+
}
|
|
2286
|
+
});
|
|
2287
|
+
Object.defineProperty(exports, 'verifyBearerToken', {
|
|
2288
|
+
enumerable: true,
|
|
2289
|
+
get: function () {
|
|
2290
|
+
return verifyBearerToken;
|
|
2291
|
+
}
|
|
2292
|
+
});
|
|
2293
|
+
//# sourceMappingURL=mcp-uPg2RfP3.cjs.map
|