@noodleseed/one 0.95.1 → 0.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/auth-live-doctor.d.ts +1 -0
- package/dist/commands/auth-live-doctor.d.ts.map +1 -1
- package/dist/commands/auth-live-doctor.js +7 -6
- package/dist/commands/auth-live-doctor.js.map +1 -1
- package/dist/commands/auth-metadata-readiness.d.ts +2 -0
- package/dist/commands/auth-metadata-readiness.d.ts.map +1 -1
- package/dist/commands/auth-metadata-readiness.js +7 -0
- package/dist/commands/auth-metadata-readiness.js.map +1 -1
- package/dist/commands/auth-ops.d.ts +1 -0
- package/dist/commands/auth-ops.d.ts.map +1 -1
- package/dist/commands/auth-ops.js +26 -7
- package/dist/commands/auth-ops.js.map +1 -1
- package/dist/commands/author-loop.d.ts.map +1 -1
- package/dist/commands/author-loop.js +3 -2
- package/dist/commands/author-loop.js.map +1 -1
- package/dist/commands/catalog-data-auth-discovery.d.ts.map +1 -1
- package/dist/commands/catalog-data-auth-discovery.js +7 -0
- package/dist/commands/catalog-data-auth-discovery.js.map +1 -1
- package/dist/commands/connect-oauth.d.ts.map +1 -1
- package/dist/commands/connect-oauth.js +1 -0
- package/dist/commands/connect-oauth.js.map +1 -1
- package/dist/dev.d.ts +6 -1
- package/dist/dev.d.ts.map +1 -1
- package/dist/dev.js +120 -34
- package/dist/dev.js.map +1 -1
- package/dist/device-login.js +1 -0
- package/dist/device-login.js.map +1 -1
- package/dist/devtools-preview.d.ts.map +1 -1
- package/dist/devtools-preview.js +82 -8
- package/dist/devtools-preview.js.map +1 -1
- package/dist/plugin-mode/build-readiness-server.d.ts +1 -1
- package/dist/plugin-mode/build-readiness-server.d.ts.map +1 -1
- package/dist/plugin-mode/build-readiness-server.js +3 -4
- package/dist/plugin-mode/build-readiness-server.js.map +1 -1
- package/dist/plugin-mode/plugin-operation-contract.d.ts +1 -1
- package/dist/plugin-mode/plugin-operation-contract.d.ts.map +1 -1
- package/dist/plugin-mode/plugin-operation-tools.d.ts +1 -2
- package/dist/plugin-mode/plugin-operation-tools.d.ts.map +1 -1
- package/dist/plugin-mode/plugin-operation-tools.js.map +1 -1
- package/dist/saas-scaffold-template.d.ts.map +1 -1
- package/dist/saas-scaffold-template.js +2 -1
- package/dist/saas-scaffold-template.js.map +1 -1
- package/node_modules/@modelcontextprotocol/client/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/client/README.md +26 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-1b6pVpkg.cjs +7531 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-1b6pVpkg.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-97rDpkRx.mjs +7514 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-97rDpkRx.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-FOQRM7up.d.cts +1071 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-FOQRM7up.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-INpkxUi1.d.mts +1071 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-INpkxUi1.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3ZJEoRM.d.mts +74 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3ZJEoRM.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3dvjU3F.cjs +986 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3dvjU3F.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-BylNJ1R5.mjs +981 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-BylNJ1R5.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-doTkZbTr.d.cts +74 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-doTkZbTr.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/chunk-Bnu9O96Y.cjs +60 -0
- package/node_modules/@modelcontextprotocol/client/dist/chunk-Br0eD_fh.mjs +42 -0
- package/node_modules/@modelcontextprotocol/client/dist/dialects-BGO_ZrYF.cjs +46 -0
- package/node_modules/@modelcontextprotocol/client/dist/dialects-BGO_ZrYF.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/dialects-BOhdv1Fc.mjs +34 -0
- package/node_modules/@modelcontextprotocol/client/dist/dialects-BOhdv1Fc.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-CHhhk6PQ.d.cts +2526 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-CHhhk6PQ.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-D4xIIEF6.d.mts +2523 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-D4xIIEF6.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs +5690 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts +3252 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts +3252 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs +5481 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs +14 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs +14 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +21 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +20 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs +7063 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-NAgB4Mp8.cjs +7431 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-NAgB4Mp8.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +217 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts +96 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts +96 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +212 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts +1099 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-mS0yxCL0.d.mts +1099 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-mS0yxCL0.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.cjs +5 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.mjs +3 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.cjs +3 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.mjs +3 -0
- package/node_modules/@modelcontextprotocol/client/package.json +166 -0
- package/node_modules/@modelcontextprotocol/core/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/core/README.md +40 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts +8501 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs +1678 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs +2899 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts +8501 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.cjs +175 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +201 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +99 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +99 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/package.json +85 -0
- package/node_modules/@modelcontextprotocol/server/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/server/README.md +30 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs +7514 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts +1071 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts +1071 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs +7531 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs +986 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts +74 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts +74 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs +981 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +60 -0
- package/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs +42 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts +4043 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts +4045 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs +46 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs +34 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs +2055 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts +739 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts +739 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs +1870 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs +2022 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs +1931 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +23 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +11 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +11 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +22 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +12 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +4 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +30 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +10 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +10 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +29 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs +7606 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs +8104 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +564 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +107 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +107 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +562 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts +1099 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts +1099 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +5 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +3 -0
- package/node_modules/@modelcontextprotocol/server/package.json +160 -0
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +4 -4
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-auth-ref.js +3 -3
- package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-auth-ref.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-server-playbook-ref.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-server-playbook-ref.js +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/skill-server-playbook-ref.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/capabilities/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/capabilities/dist/index.js +11 -4
- package/node_modules/@noodle-borg/capabilities/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/developer-mcp/dist/prompts.d.ts +1 -1
- package/node_modules/@noodle-borg/developer-mcp/dist/prompts.d.ts.map +1 -1
- package/node_modules/@noodle-borg/developer-mcp/dist/resources.d.ts +1 -1
- package/node_modules/@noodle-borg/developer-mcp/dist/resources.d.ts.map +1 -1
- package/node_modules/@noodle-borg/developer-mcp/dist/server.d.ts +1 -1
- package/node_modules/@noodle-borg/developer-mcp/dist/server.d.ts.map +1 -1
- package/node_modules/@noodle-borg/developer-mcp/dist/server.js +3 -1
- package/node_modules/@noodle-borg/developer-mcp/dist/server.js.map +1 -1
- package/node_modules/@noodle-borg/developer-mcp/package.json +2 -1
- package/node_modules/@noodle-borg/module/dist/contract.d.ts +3 -1
- package/node_modules/@noodle-borg/module/dist/contract.d.ts.map +1 -1
- package/node_modules/@noodle-borg/module/dist/contract.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/error-codes.d.ts +11 -0
- package/node_modules/@noodle-borg/protocol/dist/error-codes.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/error-codes.js +11 -0
- package/node_modules/@noodle-borg/protocol/dist/error-codes.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/prompts.d.ts +6 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/prompts.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/prompts.js +31 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/prompts.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/resources.d.ts +6 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/resources.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/resources.js +50 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/resources.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/tools.d.ts +6 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/tools.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/tools.js +126 -0
- package/node_modules/@noodle-borg/protocol/dist/handlers/tools.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/index.d.ts +6 -2
- package/node_modules/@noodle-borg/protocol/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/index.js +4 -1
- package/node_modules/@noodle-borg/protocol/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/interaction-envelope.d.ts +10 -0
- package/node_modules/@noodle-borg/protocol/dist/interaction-envelope.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/interaction-envelope.js +66 -0
- package/node_modules/@noodle-borg/protocol/dist/interaction-envelope.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/jsonrpc.d.ts +1 -0
- package/node_modules/@noodle-borg/protocol/dist/jsonrpc.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/jsonrpc.js +1 -0
- package/node_modules/@noodle-borg/protocol/dist/jsonrpc.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/observation.d.ts +27 -0
- package/node_modules/@noodle-borg/protocol/dist/observation.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/observation.js +20 -0
- package/node_modules/@noodle-borg/protocol/dist/observation.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/request-deps.d.ts +6 -0
- package/node_modules/@noodle-borg/protocol/dist/request-deps.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/request-deps.js +16 -0
- package/node_modules/@noodle-borg/protocol/dist/request-deps.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/request-state.d.ts +50 -0
- package/node_modules/@noodle-borg/protocol/dist/request-state.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/request-state.js +195 -0
- package/node_modules/@noodle-borg/protocol/dist/request-state.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.d.ts +16 -23
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.js +7 -341
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/tool-authorization.d.ts +1 -1
- package/node_modules/@noodle-borg/protocol/dist/tool-authorization.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/tool-authorization.js +1 -1
- package/node_modules/@noodle-borg/protocol/dist/tool-authorization.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/tool-interaction.d.ts +7 -2
- package/node_modules/@noodle-borg/protocol/dist/tool-interaction.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/tool-interaction.js +8 -1
- package/node_modules/@noodle-borg/protocol/dist/tool-interaction.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/tool-results.d.ts +7 -0
- package/node_modules/@noodle-borg/protocol/dist/tool-results.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/tool-results.js +49 -0
- package/node_modules/@noodle-borg/protocol/dist/tool-results.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/cache-hints.d.ts +11 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/cache-hints.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/cache-hints.js +14 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/cache-hints.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/confirmation.d.ts +16 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/confirmation.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/confirmation.js +57 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/confirmation.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/handler.d.ts +11 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/handler.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/handler.js +154 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/handler.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/input-required.d.ts +12 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/input-required.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/input-required.js +78 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/input-required.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/server.d.ts +5 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/server.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/server.js +314 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/server.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/tool-list.d.ts +4 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/tool-list.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/tool-list.js +25 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/tool-list.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/versions.d.ts +6 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/versions.d.ts.map +1 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/versions.js +11 -0
- package/node_modules/@noodle-borg/protocol/dist/v2/versions.js.map +1 -0
- package/node_modules/@noodle-borg/protocol/package.json +3 -0
- package/node_modules/@noodle-borg/service/dist/billing/usage-identity.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/billing/usage-identity.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/billing/usage-identity.js +15 -7
- package/node_modules/@noodle-borg/service/dist/billing/usage-identity.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/customer-auth-audience-binding.d.ts +37 -0
- package/node_modules/@noodle-borg/service/dist/customer-auth-audience-binding.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/customer-auth-audience-binding.js +182 -0
- package/node_modules/@noodle-borg/service/dist/customer-auth-audience-binding.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/customer-auth-audience-quarantine.d.ts +5 -0
- package/node_modules/@noodle-borg/service/dist/customer-auth-audience-quarantine.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/customer-auth-audience-quarantine.js +14 -0
- package/node_modules/@noodle-borg/service/dist/customer-auth-audience-quarantine.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/customer-verifier.js +5 -4
- package/node_modules/@noodle-borg/service/dist/customer-verifier.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/developer-mcp/mount.d.ts +2 -1
- package/node_modules/@noodle-borg/service/dist/developer-mcp/mount.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/developer-mcp/mount.js +16 -14
- package/node_modules/@noodle-borg/service/dist/developer-mcp/mount.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/developer-mcp/service-options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/developer-mcp/service-options.js +1 -0
- package/node_modules/@noodle-borg/service/dist/developer-mcp/service-options.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.js +2 -0
- package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/main.js +3 -0
- package/node_modules/@noodle-borg/service/dist/main.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/mcp-confirmation-nonce-postgres.d.ts +14 -0
- package/node_modules/@noodle-borg/service/dist/mcp-confirmation-nonce-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/mcp-confirmation-nonce-postgres.js +35 -0
- package/node_modules/@noodle-borg/service/dist/mcp-confirmation-nonce-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/mcp-protocol-runtime.d.ts +16 -0
- package/node_modules/@noodle-borg/service/dist/mcp-protocol-runtime.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/mcp-protocol-runtime.js +21 -0
- package/node_modules/@noodle-borg/service/dist/mcp-protocol-runtime.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/app.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/app.js +47 -0
- package/node_modules/@noodle-borg/service/dist/oauth/app.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/authorization-response.d.ts +4 -0
- package/node_modules/@noodle-borg/service/dist/oauth/authorization-response.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/authorization-response.js +6 -0
- package/node_modules/@noodle-borg/service/dist/oauth/authorization-response.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/consent-decision.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/consent-decision.js +2 -1
- package/node_modules/@noodle-borg/service/dist/oauth/consent-decision.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-flow.js +2 -1
- package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-flow.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.js +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/metadata.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/metadata.js +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/metadata.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/provider.js +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/provider.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/token-issuer.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/token-issuer.js +2 -1
- package/node_modules/@noodle-borg/service/dist/oauth/token-issuer.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.js +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.js +2 -1
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/options.d.ts +10 -3
- package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.js +20 -8
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.js +58 -13
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.js +3 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator.d.ts +24 -24
- package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.d.ts +2 -1
- package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.js +4 -1
- package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-access.d.ts +5 -1
- package/node_modules/@noodle-borg/service/dist/registry-access.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-access.js +64 -15
- package/node_modules/@noodle-borg/service/dist/registry-access.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-rollback.d.ts +19 -0
- package/node_modules/@noodle-borg/service/dist/registry-rollback.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/registry-rollback.js +91 -0
- package/node_modules/@noodle-borg/service/dist/registry-rollback.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/registry-state.d.ts +18 -2
- package/node_modules/@noodle-borg/service/dist/registry-state.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-state.js +83 -7
- package/node_modules/@noodle-borg/service/dist/registry-state.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-targets.d.ts +8 -0
- package/node_modules/@noodle-borg/service/dist/registry-targets.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-targets.js +24 -0
- package/node_modules/@noodle-borg/service/dist/registry-targets.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-types.d.ts +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-types.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry.d.ts +2 -1
- package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry.js +72 -83
- package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/archive.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/archive.js +14 -0
- package/node_modules/@noodle-borg/service/dist/routes/archive.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-dispatch.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-dispatch.js +4 -0
- package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-dispatch.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-live.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-live.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-live.js +17 -4
- package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-live.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/contracts.d.ts +9 -9
- package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.js +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.js +19 -2
- package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.js +5 -0
- package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/in-memory.d.ts +5 -2
- package/node_modules/@noodle-borg/service/dist/store/in-memory.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/in-memory.js +51 -8
- package/node_modules/@noodle-borg/service/dist/store/in-memory.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/json-file.d.ts +5 -2
- package/node_modules/@noodle-borg/service/dist/store/json-file.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/json-file.js +55 -6
- package/node_modules/@noodle-borg/service/dist/store/json-file.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts +2 -2
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js +30 -15
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience-schema.d.ts +16 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience-schema.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience-schema.js +329 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience-schema.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience.d.ts +5 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience.js +24 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-deploy-records.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-deploy-records.js +2 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-deploy-records.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-deployment-access.d.ts +9 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-deployment-access.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-deployment-access.js +53 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-deployment-access.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js +2 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-rows.d.ts +2 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-rows.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-rows.js +2 -24
- package/node_modules/@noodle-borg/service/dist/store/postgres-rows.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts +2 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js +3 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts +7 -2
- package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.js +27 -31
- package/node_modules/@noodle-borg/service/dist/store/postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/request-events-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/request-events-postgres.js +9 -2
- package/node_modules/@noodle-borg/service/dist/store/request-events-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/request-events.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/request-events.js +1 -0
- package/node_modules/@noodle-borg/service/dist/store/request-events.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store.d.ts +20 -1
- package/node_modules/@noodle-borg/service/dist/store.d.ts.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/handler.d.ts +19 -67
- package/node_modules/@noodle-borg/transport-http/dist/handler.d.ts.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/handler.js +12 -281
- package/node_modules/@noodle-borg/transport-http/dist/handler.js.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/index.d.ts +2 -1
- package/node_modules/@noodle-borg/transport-http/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/index.js +1 -0
- package/node_modules/@noodle-borg/transport-http/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/request-capture.d.ts.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/request-capture.js +38 -4
- package/node_modules/@noodle-borg/transport-http/dist/request-capture.js.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/responses.d.ts +28 -0
- package/node_modules/@noodle-borg/transport-http/dist/responses.d.ts.map +1 -0
- package/node_modules/@noodle-borg/transport-http/dist/responses.js +50 -0
- package/node_modules/@noodle-borg/transport-http/dist/responses.js.map +1 -0
- package/node_modules/@noodle-borg/transport-http/dist/routing.d.ts +28 -0
- package/node_modules/@noodle-borg/transport-http/dist/routing.d.ts.map +1 -0
- package/node_modules/@noodle-borg/transport-http/dist/routing.js +52 -0
- package/node_modules/@noodle-borg/transport-http/dist/routing.js.map +1 -0
- package/node_modules/@noodle-borg/transport-http/dist/serve-request.d.ts +35 -0
- package/node_modules/@noodle-borg/transport-http/dist/serve-request.d.ts.map +1 -0
- package/node_modules/@noodle-borg/transport-http/dist/serve-request.js +190 -0
- package/node_modules/@noodle-borg/transport-http/dist/serve-request.js.map +1 -0
- package/node_modules/@noodle-borg/transport-http/dist/tool-dispatch.d.ts +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/tool-dispatch.d.ts.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/tool-dispatch.js +17 -5
- package/node_modules/@noodle-borg/transport-http/dist/tool-dispatch.js.map +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/web-bridge.d.ts +9 -0
- package/node_modules/@noodle-borg/transport-http/dist/web-bridge.d.ts.map +1 -0
- package/node_modules/@noodle-borg/transport-http/dist/web-bridge.js +61 -0
- package/node_modules/@noodle-borg/transport-http/dist/web-bridge.js.map +1 -0
- package/package.json +6 -2
|
@@ -0,0 +1,2526 @@
|
|
|
1
|
+
import { AnnotationsSchema, AudioContentSchema, AuthorizationServerMetadata, BAGGAGE_META_KEY, BaseMetadataSchema, BaseRequestParamsSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CLIENT_CAPABILITIES_META_KEY, CLIENT_INFO_META_KEY, CallToolRequestParamsSchema, CallToolRequestSchema, CallToolResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, ClientNotificationSchema, ClientRequestSchema, ClientResultSchema, ClientTasksCapabilitySchema, CompatibilityCallToolResultSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, CreateTaskResultSchema, CursorSchema, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, DiscoverRequestSchema, DiscoverResultSchema, ElicitRequestFormParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitRequestURLParamsSchema, ElicitResultSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, GetPromptResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, GetTaskRequestSchema, GetTaskResultSchema, INTERNAL_ERROR, INVALID_PARAMS, INVALID_REQUEST, IconSchema, IconsSchema, IdJagTokenExchangeResponse, ImageContentSchema, ImplementationSchema, InitializeRequestParamsSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONArray, JSONArraySchema, JSONObject, JSONObjectSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResponseSchema, JSONRPCResultResponseSchema, JSONRPC_VERSION, JSONValue, JSONValueSchema, LATEST_PROTOCOL_VERSION, LOG_LEVEL_META_KEY, LegacyTitledEnumSchemaSchema, ListChangedOptionsBaseSchema, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListTasksRequestSchema, ListTasksResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, METHOD_NOT_FOUND, ModelHintSchema, ModelPreferencesSchema, MultiSelectEnumSchemaSchema, NotificationSchema, NotificationsParamsSchema, NumberSchemaSchema, OAuthClientInformation, OAuthClientInformationFull, OAuthClientInformationMixed, OAuthClientMetadata, OAuthClientRegistrationError, OAuthErrorResponse, OAuthMetadata, OAuthProtectedResourceMetadata, OAuthTokenRevocationRequest, OAuthTokens, OpenIdProviderDiscoveryMetadata, OpenIdProviderMetadata, PARSE_ERROR, PROTOCOL_VERSION_META_KEY, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, RELATED_TASK_META_KEY, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RelatedTaskMetadataSchema, RequestIdSchema, RequestMetaSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceRequestParamsSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, ResultMetaObjectSchema, ResultSchema, RoleSchema, RootSchema, RootsListChangedNotificationSchema, SERVER_INFO_META_KEY, SUBSCRIPTION_ID_META_KEY, SUPPORTED_PROTOCOL_VERSIONS, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, ServerCapabilitiesSchema, ServerNotificationSchema, ServerRequestSchema, ServerResultSchema, ServerTasksCapabilitySchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, SingleSelectEnumSchemaSchema, StoredOAuthClientInformation, StoredOAuthTokens, StringSchemaSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, SubscriptionFilterSchema, SubscriptionsAcknowledgedNotificationParamsSchema, SubscriptionsAcknowledgedNotificationSchema, SubscriptionsListenRequestParamsSchema, SubscriptionsListenRequestSchema, SubscriptionsListenResultMetaSchema, SubscriptionsListenResultSchema, TRACEPARENT_META_KEY, TRACESTATE_META_KEY, TaskAugmentedRequestParamsSchema, TaskCreationParamsSchema, TaskMetadataSchema, TaskSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, TaskStatusSchema, TextContentSchema, TextResourceContentsSchema, TitledMultiSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, ToolAnnotationsSchema, ToolChoiceSchema, ToolExecutionSchema, ToolListChangedNotificationSchema, ToolResultContentSchema, ToolSchema, ToolUseContentSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, UntitledMultiSelectEnumSchemaSchema, UntitledSingleSelectEnumSchemaSchema } from "@modelcontextprotocol/core/internal";
|
|
2
|
+
import * as z from "zod/v4";
|
|
3
|
+
|
|
4
|
+
//#region rolldown:runtime
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ../core-internal/src/auth/errors.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* OAuth error codes as defined by {@link https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 | RFC 6749}
|
|
10
|
+
* and extensions.
|
|
11
|
+
*/
|
|
12
|
+
declare enum OAuthErrorCode {
|
|
13
|
+
/**
|
|
14
|
+
* The request is missing a required parameter, includes an invalid parameter value,
|
|
15
|
+
* includes a parameter more than once, or is otherwise malformed.
|
|
16
|
+
*/
|
|
17
|
+
InvalidRequest = "invalid_request",
|
|
18
|
+
/**
|
|
19
|
+
* Client authentication failed (e.g., unknown client, no client authentication included,
|
|
20
|
+
* or unsupported authentication method).
|
|
21
|
+
*/
|
|
22
|
+
InvalidClient = "invalid_client",
|
|
23
|
+
/**
|
|
24
|
+
* The provided authorization grant or refresh token is invalid, expired, revoked,
|
|
25
|
+
* does not match the redirection URI used in the authorization request, or was issued to another client.
|
|
26
|
+
*/
|
|
27
|
+
InvalidGrant = "invalid_grant",
|
|
28
|
+
/**
|
|
29
|
+
* The authenticated client is not authorized to use this authorization grant type.
|
|
30
|
+
*/
|
|
31
|
+
UnauthorizedClient = "unauthorized_client",
|
|
32
|
+
/**
|
|
33
|
+
* The authorization grant type is not supported by the authorization server.
|
|
34
|
+
*/
|
|
35
|
+
UnsupportedGrantType = "unsupported_grant_type",
|
|
36
|
+
/**
|
|
37
|
+
* The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.
|
|
38
|
+
*/
|
|
39
|
+
InvalidScope = "invalid_scope",
|
|
40
|
+
/**
|
|
41
|
+
* The resource owner or authorization server denied the request.
|
|
42
|
+
*/
|
|
43
|
+
AccessDenied = "access_denied",
|
|
44
|
+
/**
|
|
45
|
+
* The authorization server encountered an unexpected condition that prevented it from fulfilling the request.
|
|
46
|
+
*/
|
|
47
|
+
ServerError = "server_error",
|
|
48
|
+
/**
|
|
49
|
+
* The authorization server is currently unable to handle the request due to temporary overloading or maintenance.
|
|
50
|
+
*/
|
|
51
|
+
TemporarilyUnavailable = "temporarily_unavailable",
|
|
52
|
+
/**
|
|
53
|
+
* The authorization server does not support obtaining an authorization code using this method.
|
|
54
|
+
*/
|
|
55
|
+
UnsupportedResponseType = "unsupported_response_type",
|
|
56
|
+
/**
|
|
57
|
+
* The authorization server does not support the requested token type.
|
|
58
|
+
*/
|
|
59
|
+
UnsupportedTokenType = "unsupported_token_type",
|
|
60
|
+
/**
|
|
61
|
+
* The access token provided is expired, revoked, malformed, or invalid for other reasons.
|
|
62
|
+
*/
|
|
63
|
+
InvalidToken = "invalid_token",
|
|
64
|
+
/**
|
|
65
|
+
* The HTTP method used is not allowed for this endpoint. (Custom, non-standard error)
|
|
66
|
+
*/
|
|
67
|
+
MethodNotAllowed = "method_not_allowed",
|
|
68
|
+
/**
|
|
69
|
+
* Rate limit exceeded. (Custom, non-standard error based on RFC 6585)
|
|
70
|
+
*/
|
|
71
|
+
TooManyRequests = "too_many_requests",
|
|
72
|
+
/**
|
|
73
|
+
* The client metadata is invalid. (Custom error for dynamic client registration - RFC 7591)
|
|
74
|
+
*/
|
|
75
|
+
InvalidClientMetadata = "invalid_client_metadata",
|
|
76
|
+
/**
|
|
77
|
+
* The value of one or more redirection URIs is invalid. (Dynamic client registration - RFC 7591 §3.2.2)
|
|
78
|
+
*/
|
|
79
|
+
InvalidRedirectUri = "invalid_redirect_uri",
|
|
80
|
+
/**
|
|
81
|
+
* The request requires higher privileges than provided by the access token.
|
|
82
|
+
*/
|
|
83
|
+
InsufficientScope = "insufficient_scope",
|
|
84
|
+
/**
|
|
85
|
+
* The requested resource is invalid, missing, unknown, or malformed. (Custom error for resource indicators - RFC 8707)
|
|
86
|
+
*/
|
|
87
|
+
InvalidTarget = "invalid_target",
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* OAuth error class for all OAuth-related errors.
|
|
91
|
+
*/
|
|
92
|
+
declare class OAuthError extends Error {
|
|
93
|
+
readonly code: OAuthErrorCode | string;
|
|
94
|
+
readonly errorUri?: string | undefined;
|
|
95
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Brand-based type guard: equivalent to `value instanceof this`, as an
|
|
98
|
+
* explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
|
|
99
|
+
* the caller's own brand via `this`, so every branded subclass gets a
|
|
100
|
+
* correctly-scoped guard by inheritance. Must be invoked on the class —
|
|
101
|
+
* in callback position write `v => SdkError.isInstance(v)`, not
|
|
102
|
+
* `.filter(SdkError.isInstance)` (detached calls throw rather than
|
|
103
|
+
* silently matching nothing).
|
|
104
|
+
*/
|
|
105
|
+
static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
|
|
106
|
+
constructor(code: OAuthErrorCode | string, message: string, errorUri?: string | undefined);
|
|
107
|
+
/**
|
|
108
|
+
* Converts the error to a standard OAuth error response object.
|
|
109
|
+
*/
|
|
110
|
+
toResponseObject(): OAuthErrorResponse;
|
|
111
|
+
/**
|
|
112
|
+
* Creates an {@linkcode OAuthError} from an OAuth error response.
|
|
113
|
+
*/
|
|
114
|
+
static fromResponse(response: OAuthErrorResponse): OAuthError;
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region ../core-internal/src/errors/sdkErrors.d.ts
|
|
118
|
+
/**
|
|
119
|
+
* Error codes for SDK errors (local errors that never cross the wire).
|
|
120
|
+
* Unlike {@linkcode ProtocolErrorCode} which uses numeric JSON-RPC codes, `SdkErrorCode` uses
|
|
121
|
+
* descriptive string values for better developer experience.
|
|
122
|
+
*
|
|
123
|
+
* These errors are thrown locally by the SDK and are never serialized as
|
|
124
|
+
* JSON-RPC error responses.
|
|
125
|
+
*/
|
|
126
|
+
declare enum SdkErrorCode {
|
|
127
|
+
/** Transport is not connected */
|
|
128
|
+
NotConnected = "NOT_CONNECTED",
|
|
129
|
+
/** Transport is already connected */
|
|
130
|
+
AlreadyConnected = "ALREADY_CONNECTED",
|
|
131
|
+
/** Protocol is not initialized */
|
|
132
|
+
NotInitialized = "NOT_INITIALIZED",
|
|
133
|
+
/** Required capability is not supported by the remote side */
|
|
134
|
+
CapabilityNotSupported = "CAPABILITY_NOT_SUPPORTED",
|
|
135
|
+
/** Request timed out waiting for response */
|
|
136
|
+
RequestTimeout = "REQUEST_TIMEOUT",
|
|
137
|
+
/** Connection was closed */
|
|
138
|
+
ConnectionClosed = "CONNECTION_CLOSED",
|
|
139
|
+
/** Failed to send message */
|
|
140
|
+
SendFailed = "SEND_FAILED",
|
|
141
|
+
/** Response result failed local schema validation */
|
|
142
|
+
InvalidResult = "INVALID_RESULT",
|
|
143
|
+
/**
|
|
144
|
+
* The response carried a `resultType` discriminator (protocol revision
|
|
145
|
+
* 2026-07-28) naming a result kind this client cannot consume yet, e.g.
|
|
146
|
+
* `input_required`. The kind is carried in `data.resultType`.
|
|
147
|
+
*/
|
|
148
|
+
UnsupportedResultType = "UNSUPPORTED_RESULT_TYPE",
|
|
149
|
+
/**
|
|
150
|
+
* The multi-round-trip auto-fulfilment driver exhausted its round cap
|
|
151
|
+
* (`inputRequired.maxRounds`) without the server returning a complete
|
|
152
|
+
* result. `data.rounds` carries the cap that was hit and
|
|
153
|
+
* `data.lastResult` carries the last `input_required` payload received
|
|
154
|
+
* (`{ inputRequests, requestState? }`), so callers can inspect or resume
|
|
155
|
+
* the flow manually.
|
|
156
|
+
*/
|
|
157
|
+
InputRequiredRoundsExceeded = "INPUT_REQUIRED_ROUNDS_EXCEEDED",
|
|
158
|
+
/**
|
|
159
|
+
* The auto-aggregating no-`cursor` `listTools()` / `listPrompts()` /
|
|
160
|
+
* `listResources()` / `listResourceTemplates()` walk hit the
|
|
161
|
+
* `ClientOptions.listMaxPages` cap without the server's pagination
|
|
162
|
+
* converging. `data.method` carries the list verb and
|
|
163
|
+
* `data.listMaxPages` the cap that was hit; raise the cap or fall back to
|
|
164
|
+
* explicit per-page `{ cursor }` calls.
|
|
165
|
+
*/
|
|
166
|
+
ListPaginationExceeded = "LIST_PAGINATION_EXCEEDED",
|
|
167
|
+
/**
|
|
168
|
+
* The spec method being sent does not exist on the negotiated protocol
|
|
169
|
+
* version's wire era (e.g. `tasks/get` toward a 2026-07-28 peer, or
|
|
170
|
+
* `server/discover` toward a 2025-era peer). Raised locally, before
|
|
171
|
+
* anything reaches the transport. The method and era are carried in
|
|
172
|
+
* `data.method` / `data.era`.
|
|
173
|
+
*/
|
|
174
|
+
MethodNotSupportedByProtocolVersion = "METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",
|
|
175
|
+
/**
|
|
176
|
+
* Protocol-era negotiation at connect time failed without producing either a
|
|
177
|
+
* usable modern (2026-07-28+) era or a definitive legacy fallback signal —
|
|
178
|
+
* e.g. the negotiation mode forbids falling back (`pin`), the probe hit a
|
|
179
|
+
* network failure, or the server answered the probe with a 5xx (a typed
|
|
180
|
+
* connect error, never an era verdict).
|
|
181
|
+
*
|
|
182
|
+
* Negotiation-phase only: this code is never used once an era is
|
|
183
|
+
* established. Auth walls never carry it: a 401/403 rejecting the probe
|
|
184
|
+
* uses {@linkcode ClientHttpAuthentication} / {@linkcode ClientHttpForbidden}
|
|
185
|
+
* instead, so era-recovery flows keyed on this code (e.g. cached-verdict
|
|
186
|
+
* gateways) can never persist a verdict for an unauthorized exchange.
|
|
187
|
+
*/
|
|
188
|
+
EraNegotiationFailed = "ERA_NEGOTIATION_FAILED",
|
|
189
|
+
ClientHttpNotImplemented = "CLIENT_HTTP_NOT_IMPLEMENTED",
|
|
190
|
+
/**
|
|
191
|
+
* HTTP 401 authentication failure: the transport's re-auth retry still got
|
|
192
|
+
* 401 (`Server returned 401 after re-authentication`), or the version
|
|
193
|
+
* negotiation probe was rejected 401 with no `authProvider` configured
|
|
194
|
+
* (`Version negotiation failed: the server requires authorization (HTTP 401)`).
|
|
195
|
+
* Carried on an {@linkcode SdkHttpError} with `status: 401`.
|
|
196
|
+
*/
|
|
197
|
+
ClientHttpAuthentication = "CLIENT_HTTP_AUTHENTICATION",
|
|
198
|
+
/**
|
|
199
|
+
* HTTP 403 denial: the step-up re-authorization retry limit was reached,
|
|
200
|
+
* or the version negotiation probe was rejected 403
|
|
201
|
+
* (`Version negotiation failed: the server denied access (HTTP 403)`).
|
|
202
|
+
* Carried on an {@linkcode SdkHttpError} with `status: 403`.
|
|
203
|
+
*/
|
|
204
|
+
ClientHttpForbidden = "CLIENT_HTTP_FORBIDDEN",
|
|
205
|
+
ClientHttpUnexpectedContent = "CLIENT_HTTP_UNEXPECTED_CONTENT",
|
|
206
|
+
ClientHttpFailedToOpenStream = "CLIENT_HTTP_FAILED_TO_OPEN_STREAM",
|
|
207
|
+
ClientHttpFailedToTerminateSession = "CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* SDK errors are local errors that never cross the wire.
|
|
211
|
+
* They are distinct from {@linkcode ProtocolError} which represents JSON-RPC protocol errors
|
|
212
|
+
* that are serialized and sent as error responses.
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```ts source="./sdkErrors.examples.ts#SdkError_basicUsage"
|
|
216
|
+
* try {
|
|
217
|
+
* // Throwing an SDK error
|
|
218
|
+
* throw new SdkError(SdkErrorCode.NotConnected, 'Transport is not connected');
|
|
219
|
+
* } catch (error) {
|
|
220
|
+
* // Checking error type by code
|
|
221
|
+
* if (error instanceof SdkError && error.code === SdkErrorCode.RequestTimeout) {
|
|
222
|
+
* // Handle timeout
|
|
223
|
+
* }
|
|
224
|
+
* }
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
declare class SdkError extends Error {
|
|
228
|
+
readonly code: SdkErrorCode;
|
|
229
|
+
readonly data?: unknown | undefined;
|
|
230
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Brand-based type guard: equivalent to `value instanceof this`, as an
|
|
233
|
+
* explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
|
|
234
|
+
* the caller's own brand via `this`, so every branded subclass gets a
|
|
235
|
+
* correctly-scoped guard by inheritance. Must be invoked on the class —
|
|
236
|
+
* in callback position write `v => SdkError.isInstance(v)`, not
|
|
237
|
+
* `.filter(SdkError.isInstance)` (detached calls throw rather than
|
|
238
|
+
* silently matching nothing).
|
|
239
|
+
*/
|
|
240
|
+
static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
|
|
241
|
+
constructor(code: SdkErrorCode, message: string, data?: unknown | undefined);
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Typed shape for HTTP error data carried by {@linkcode SdkHttpError}.
|
|
245
|
+
*/
|
|
246
|
+
interface SdkHttpErrorData {
|
|
247
|
+
status: number;
|
|
248
|
+
statusText?: string;
|
|
249
|
+
[key: string]: unknown;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* An {@linkcode SdkError} subclass for HTTP transport failures.
|
|
253
|
+
*
|
|
254
|
+
* Thrown by the streamable HTTP transport when the server responds with a
|
|
255
|
+
* non-OK status code. Narrows {@linkcode SdkError.data | data} to
|
|
256
|
+
* {@linkcode SdkHttpErrorData} so consumers can inspect the HTTP status
|
|
257
|
+
* without unsafe casting.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```ts source="./sdkErrors.examples.ts#SdkHttpError_basicUsage"
|
|
261
|
+
* if (error instanceof SdkHttpError) {
|
|
262
|
+
* console.log(error.status); // number
|
|
263
|
+
* console.log(error.statusText); // string | undefined
|
|
264
|
+
* }
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
declare class SdkHttpError extends SdkError {
|
|
268
|
+
readonly data: SdkHttpErrorData;
|
|
269
|
+
constructor(code: SdkErrorCode, message: string, data: SdkHttpErrorData);
|
|
270
|
+
get status(): number;
|
|
271
|
+
get statusText(): string | undefined;
|
|
272
|
+
}
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region ../core-internal/src/shared/authUtils.d.ts
|
|
275
|
+
/**
|
|
276
|
+
* Utilities for handling OAuth resource URIs.
|
|
277
|
+
*/
|
|
278
|
+
/**
|
|
279
|
+
* Converts a server URL to a resource URL by removing the fragment.
|
|
280
|
+
* {@link https://datatracker.ietf.org/doc/html/rfc8707#section-2 | RFC 8707 section 2}
|
|
281
|
+
* states that resource URIs "MUST NOT include a fragment component".
|
|
282
|
+
* Keeps everything else unchanged (scheme, domain, port, path, query).
|
|
283
|
+
*/
|
|
284
|
+
declare function resourceUrlFromServerUrl(url: URL | string): URL;
|
|
285
|
+
/**
|
|
286
|
+
* Checks if a requested resource URL matches a configured resource URL.
|
|
287
|
+
* A requested resource matches if it has the same scheme, domain, port,
|
|
288
|
+
* and its path starts with the configured resource's path.
|
|
289
|
+
*
|
|
290
|
+
* @param options - The options object
|
|
291
|
+
* @param options.requestedResource - The resource URL being requested
|
|
292
|
+
* @param options.configuredResource - The resource URL that has been configured
|
|
293
|
+
* @returns true if the requested resource matches the configured resource, false otherwise
|
|
294
|
+
*/
|
|
295
|
+
declare function checkResourceAllowed({
|
|
296
|
+
requestedResource,
|
|
297
|
+
configuredResource
|
|
298
|
+
}: {
|
|
299
|
+
requestedResource: URL | string;
|
|
300
|
+
configuredResource: URL | string;
|
|
301
|
+
}): boolean;
|
|
302
|
+
declare namespace schemas_d_exports {
|
|
303
|
+
export { AnnotationsSchema, AudioContentSchema, BaseMetadataSchema, BaseRequestParamsSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CallToolRequestParamsSchema, CallToolRequestSchema, CallToolResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, ClientNotificationSchema, ClientRequestSchema, ClientResultSchema, ClientTasksCapabilitySchema, CompatibilityCallToolResultSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, CreateTaskResultSchema, CursorSchema, DiscoverRequestSchema, DiscoverResultSchema, ElicitRequestFormParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitRequestURLParamsSchema, ElicitResultSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, GetPromptResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, GetTaskRequestSchema, GetTaskResultSchema, IconSchema, IconsSchema, ImageContentSchema, ImplementationSchema, InitializeRequestParamsSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONArraySchema, JSONObjectSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResponseSchema, JSONRPCResultResponseSchema, JSONValueSchema, LegacyTitledEnumSchemaSchema, ListChangedOptionsBaseSchema, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListTasksRequestSchema, ListTasksResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, MultiSelectEnumSchemaSchema, NotificationSchema, NotificationsParamsSchema, NumberSchemaSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RelatedTaskMetadataSchema, RequestIdSchema, RequestMetaSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceRequestParamsSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, ResultMetaObjectSchema, ResultSchema, RoleSchema, RootSchema, RootsListChangedNotificationSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, ServerCapabilitiesSchema, ServerNotificationSchema, ServerRequestSchema, ServerResultSchema, ServerTasksCapabilitySchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, SingleSelectEnumSchemaSchema, StringSchemaSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, SubscriptionFilterSchema, SubscriptionsAcknowledgedNotificationParamsSchema, SubscriptionsAcknowledgedNotificationSchema, SubscriptionsListenRequestParamsSchema, SubscriptionsListenRequestSchema, SubscriptionsListenResultMetaSchema, SubscriptionsListenResultSchema, TaskAugmentedRequestParamsSchema, TaskCreationParamsSchema, TaskMetadataSchema, TaskSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, TaskStatusSchema, TextContentSchema, TextResourceContentsSchema, TitledMultiSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, ToolAnnotationsSchema, ToolChoiceSchema, ToolExecutionSchema, ToolListChangedNotificationSchema, ToolResultContentSchema, ToolSchema, ToolUseContentSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, UntitledMultiSelectEnumSchemaSchema, UntitledSingleSelectEnumSchemaSchema };
|
|
304
|
+
}
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region ../core-internal/src/types/types.d.ts
|
|
307
|
+
/**
|
|
308
|
+
* Utility types
|
|
309
|
+
*/
|
|
310
|
+
type ExpandRecursively<T$1> = T$1 extends object ? (T$1 extends infer O ? { [K in keyof O]: ExpandRecursively<O[K]> } : never) : T$1;
|
|
311
|
+
type Primitive = string | number | boolean | bigint | null | undefined;
|
|
312
|
+
type Flatten<T$1> = T$1 extends Primitive ? T$1 : T$1 extends Array<infer U> ? Array<Flatten<U>> : T$1 extends Set<infer U> ? Set<Flatten<U>> : T$1 extends Map<infer K, infer V> ? Map<Flatten<K>, Flatten<V>> : T$1 extends object ? { [K in keyof T$1]: Flatten<T$1[K]> } : T$1;
|
|
313
|
+
type Infer<Schema extends z.ZodTypeAny> = Flatten<z.infer<Schema>>;
|
|
314
|
+
/**
|
|
315
|
+
* Wire-only members hidden from the public types.
|
|
316
|
+
*
|
|
317
|
+
* `resultType` is the protocol-revision-2026-07-28 wire discrimination field
|
|
318
|
+
* on results. It is consumed by the SDK's protocol layer (and stripped before
|
|
319
|
+
* results reach consumers), so the public result types do not declare it.
|
|
320
|
+
* The wire schemas continue to model it internally.
|
|
321
|
+
*/
|
|
322
|
+
type WireOnlyResultKey = 'resultType';
|
|
323
|
+
/**
|
|
324
|
+
* Removes wire-only members from a (possibly union) schema-inferred type
|
|
325
|
+
* while preserving every other declared member, optionality, and the loose
|
|
326
|
+
* index signature.
|
|
327
|
+
*/
|
|
328
|
+
type StripWireOnly<T$1> = T$1 extends unknown ? { [K in keyof T$1 as K extends WireOnlyResultKey ? never : K]: T$1[K] } : never;
|
|
329
|
+
type ProgressToken = Infer<typeof ProgressTokenSchema>;
|
|
330
|
+
type Cursor = Infer<typeof CursorSchema>;
|
|
331
|
+
type Request = Infer<typeof RequestSchema>;
|
|
332
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
333
|
+
type TaskAugmentedRequestParams = Infer<typeof TaskAugmentedRequestParamsSchema>;
|
|
334
|
+
type RequestMeta = Infer<typeof RequestMetaSchema>;
|
|
335
|
+
type Notification = Infer<typeof NotificationSchema>;
|
|
336
|
+
type Result$1 = StripWireOnly<Infer<typeof ResultSchema>>;
|
|
337
|
+
type RequestId = Infer<typeof RequestIdSchema>;
|
|
338
|
+
type JSONRPCRequest = Infer<typeof JSONRPCRequestSchema>;
|
|
339
|
+
type JSONRPCNotification = Infer<typeof JSONRPCNotificationSchema>;
|
|
340
|
+
type JSONRPCErrorResponse = Infer<typeof JSONRPCErrorResponseSchema>;
|
|
341
|
+
type JSONRPCResultResponse = Omit<Infer<typeof JSONRPCResultResponseSchema>, 'result'> & {
|
|
342
|
+
result: Result$1;
|
|
343
|
+
};
|
|
344
|
+
type JSONRPCResponse = JSONRPCResultResponse | JSONRPCErrorResponse;
|
|
345
|
+
type JSONRPCMessage = JSONRPCRequest | JSONRPCNotification | JSONRPCResultResponse | JSONRPCErrorResponse;
|
|
346
|
+
type RequestParams = Infer<typeof BaseRequestParamsSchema>;
|
|
347
|
+
type NotificationParams = Infer<typeof NotificationsParamsSchema>;
|
|
348
|
+
/**
|
|
349
|
+
* The per-request `_meta` envelope carried by every request under protocol revision
|
|
350
|
+
* 2026-07-28 (protocol version, client info, client capabilities, optional log level).
|
|
351
|
+
*
|
|
352
|
+
* Neutral hand-written shape keyed by the public meta-key constants — never
|
|
353
|
+
* inferred from a wire-module schema (this neutral layer does not import from
|
|
354
|
+
* `wire/rev*`). A `type` alias rather than an interface so it stays assignable
|
|
355
|
+
* to `_meta`'s string-indexed object slot.
|
|
356
|
+
*/
|
|
357
|
+
type RequestMetaEnvelope = {};
|
|
358
|
+
type EmptyResult = StripWireOnly<Infer<typeof EmptyResultSchema>>;
|
|
359
|
+
type CancelledNotificationParams = Infer<typeof CancelledNotificationParamsSchema>;
|
|
360
|
+
type CancelledNotification = Infer<typeof CancelledNotificationSchema>;
|
|
361
|
+
type Icon = Infer<typeof IconSchema>;
|
|
362
|
+
type Icons = Infer<typeof IconsSchema>;
|
|
363
|
+
type BaseMetadata = Infer<typeof BaseMetadataSchema>;
|
|
364
|
+
type Annotations = Infer<typeof AnnotationsSchema>;
|
|
365
|
+
type Role = Infer<typeof RoleSchema>;
|
|
366
|
+
type Implementation = Infer<typeof ImplementationSchema>;
|
|
367
|
+
/**
|
|
368
|
+
* Capabilities a client may support.
|
|
369
|
+
*
|
|
370
|
+
* Note: the `roots` and `sampling` capabilities are deprecated as of protocol
|
|
371
|
+
* version 2026-07-28 (SEP-2577); they remain in the specification for at least
|
|
372
|
+
* twelve months. See `ClientCapabilitiesSchema`.
|
|
373
|
+
*/
|
|
374
|
+
type ClientCapabilities = Infer<typeof ClientCapabilitiesSchema>;
|
|
375
|
+
type InitializeRequestParams = Infer<typeof InitializeRequestParamsSchema>;
|
|
376
|
+
type InitializeRequest = Infer<typeof InitializeRequestSchema>;
|
|
377
|
+
/**
|
|
378
|
+
* Capabilities a server may support.
|
|
379
|
+
*
|
|
380
|
+
* Note: the `logging` capability is deprecated as of protocol version
|
|
381
|
+
* 2026-07-28 (SEP-2577); it remains in the specification for at least twelve
|
|
382
|
+
* months. See `ServerCapabilitiesSchema`.
|
|
383
|
+
*/
|
|
384
|
+
type ServerCapabilities = Infer<typeof ServerCapabilitiesSchema>;
|
|
385
|
+
type InitializeResult = StripWireOnly<Infer<typeof InitializeResultSchema>>;
|
|
386
|
+
type InitializedNotification = Infer<typeof InitializedNotificationSchema>;
|
|
387
|
+
type DiscoverRequest = Infer<typeof DiscoverRequestSchema>;
|
|
388
|
+
type DiscoverResult = StripWireOnly<Infer<typeof DiscoverResultSchema>>;
|
|
389
|
+
type PingRequest = Infer<typeof PingRequestSchema>;
|
|
390
|
+
type Progress = Infer<typeof ProgressSchema>;
|
|
391
|
+
type ProgressNotificationParams = Infer<typeof ProgressNotificationParamsSchema>;
|
|
392
|
+
type ProgressNotification = Infer<typeof ProgressNotificationSchema>;
|
|
393
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
394
|
+
type Task = Infer<typeof TaskSchema>;
|
|
395
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
396
|
+
type TaskStatus = Infer<typeof TaskStatusSchema>;
|
|
397
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
398
|
+
type TaskCreationParams = Infer<typeof TaskCreationParamsSchema>;
|
|
399
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
400
|
+
type TaskMetadata = Infer<typeof TaskMetadataSchema>;
|
|
401
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
402
|
+
type RelatedTaskMetadata = Infer<typeof RelatedTaskMetadataSchema>;
|
|
403
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
404
|
+
type CreateTaskResult = StripWireOnly<Infer<typeof CreateTaskResultSchema>>;
|
|
405
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
406
|
+
type TaskStatusNotificationParams = Infer<typeof TaskStatusNotificationParamsSchema>;
|
|
407
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
408
|
+
type TaskStatusNotification = Infer<typeof TaskStatusNotificationSchema>;
|
|
409
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
410
|
+
type GetTaskRequest = Infer<typeof GetTaskRequestSchema>;
|
|
411
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
412
|
+
type GetTaskResult = StripWireOnly<Infer<typeof GetTaskResultSchema>>;
|
|
413
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
414
|
+
type GetTaskPayloadRequest = Infer<typeof GetTaskPayloadRequestSchema>;
|
|
415
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
416
|
+
type ListTasksRequest = Infer<typeof ListTasksRequestSchema>;
|
|
417
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
418
|
+
type ListTasksResult = StripWireOnly<Infer<typeof ListTasksResultSchema>>;
|
|
419
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
420
|
+
type CancelTaskRequest = Infer<typeof CancelTaskRequestSchema>;
|
|
421
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
422
|
+
type CancelTaskResult = StripWireOnly<Infer<typeof CancelTaskResultSchema>>;
|
|
423
|
+
/** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
|
|
424
|
+
type GetTaskPayloadResult = StripWireOnly<Infer<typeof GetTaskPayloadResultSchema>>;
|
|
425
|
+
type PaginatedRequestParams = Infer<typeof PaginatedRequestParamsSchema>;
|
|
426
|
+
type PaginatedRequest = Infer<typeof PaginatedRequestSchema>;
|
|
427
|
+
type PaginatedResult = StripWireOnly<Infer<typeof PaginatedResultSchema>>;
|
|
428
|
+
type ResourceContents = Infer<typeof ResourceContentsSchema>;
|
|
429
|
+
type TextResourceContents = Infer<typeof TextResourceContentsSchema>;
|
|
430
|
+
type BlobResourceContents = Infer<typeof BlobResourceContentsSchema>;
|
|
431
|
+
type Resource = Infer<typeof ResourceSchema>;
|
|
432
|
+
type ResourceTemplateType = Infer<typeof ResourceTemplateSchema>;
|
|
433
|
+
type ListResourcesRequest = Infer<typeof ListResourcesRequestSchema>;
|
|
434
|
+
type ListResourcesResult = StripWireOnly<Infer<typeof ListResourcesResultSchema>>;
|
|
435
|
+
type ListResourceTemplatesRequest = Infer<typeof ListResourceTemplatesRequestSchema>;
|
|
436
|
+
type ListResourceTemplatesResult = StripWireOnly<Infer<typeof ListResourceTemplatesResultSchema>>;
|
|
437
|
+
type ResourceRequestParams = Infer<typeof ResourceRequestParamsSchema>;
|
|
438
|
+
type ReadResourceRequestParams = Infer<typeof ReadResourceRequestParamsSchema>;
|
|
439
|
+
type ReadResourceRequest = Infer<typeof ReadResourceRequestSchema>;
|
|
440
|
+
type ReadResourceResult = StripWireOnly<Infer<typeof ReadResourceResultSchema>>;
|
|
441
|
+
type ResourceListChangedNotification = Infer<typeof ResourceListChangedNotificationSchema>;
|
|
442
|
+
type SubscribeRequestParams = Infer<typeof SubscribeRequestParamsSchema>;
|
|
443
|
+
type SubscribeRequest = Infer<typeof SubscribeRequestSchema>;
|
|
444
|
+
type UnsubscribeRequestParams = Infer<typeof UnsubscribeRequestParamsSchema>;
|
|
445
|
+
type UnsubscribeRequest = Infer<typeof UnsubscribeRequestSchema>;
|
|
446
|
+
type ResourceUpdatedNotificationParams = Infer<typeof ResourceUpdatedNotificationParamsSchema>;
|
|
447
|
+
type ResourceUpdatedNotification = Infer<typeof ResourceUpdatedNotificationSchema>;
|
|
448
|
+
type SubscriptionFilter = Infer<typeof SubscriptionFilterSchema>;
|
|
449
|
+
type SubscriptionsListenRequestParams = Infer<typeof SubscriptionsListenRequestParamsSchema>;
|
|
450
|
+
type SubscriptionsListenRequest = Infer<typeof SubscriptionsListenRequestSchema>;
|
|
451
|
+
type SubscriptionsAcknowledgedNotificationParams = Infer<typeof SubscriptionsAcknowledgedNotificationParamsSchema>;
|
|
452
|
+
type SubscriptionsAcknowledgedNotification = Infer<typeof SubscriptionsAcknowledgedNotificationSchema>;
|
|
453
|
+
type SubscriptionsListenResultMeta = Infer<typeof SubscriptionsListenResultMetaSchema>;
|
|
454
|
+
type SubscriptionsListenResult = StripWireOnly<Infer<typeof SubscriptionsListenResultSchema>>;
|
|
455
|
+
type PromptArgument = Infer<typeof PromptArgumentSchema>;
|
|
456
|
+
type Prompt = Infer<typeof PromptSchema>;
|
|
457
|
+
type ListPromptsRequest = Infer<typeof ListPromptsRequestSchema>;
|
|
458
|
+
type ListPromptsResult = StripWireOnly<Infer<typeof ListPromptsResultSchema>>;
|
|
459
|
+
type GetPromptRequestParams = Infer<typeof GetPromptRequestParamsSchema>;
|
|
460
|
+
type GetPromptRequest = Infer<typeof GetPromptRequestSchema>;
|
|
461
|
+
type TextContent = Infer<typeof TextContentSchema>;
|
|
462
|
+
type ImageContent = Infer<typeof ImageContentSchema>;
|
|
463
|
+
type AudioContent = Infer<typeof AudioContentSchema>;
|
|
464
|
+
/**
|
|
465
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
466
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
467
|
+
* provider APIs directly.
|
|
468
|
+
*/
|
|
469
|
+
type ToolUseContent = Infer<typeof ToolUseContentSchema>;
|
|
470
|
+
/**
|
|
471
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
472
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
473
|
+
* provider APIs directly.
|
|
474
|
+
*/
|
|
475
|
+
type ToolResultContent = Infer<typeof ToolResultContentSchema>;
|
|
476
|
+
type EmbeddedResource = Infer<typeof EmbeddedResourceSchema>;
|
|
477
|
+
type ResourceLink = Infer<typeof ResourceLinkSchema>;
|
|
478
|
+
type ContentBlock = Infer<typeof ContentBlockSchema>;
|
|
479
|
+
type PromptMessage = Infer<typeof PromptMessageSchema>;
|
|
480
|
+
type GetPromptResult = StripWireOnly<Infer<typeof GetPromptResultSchema>>;
|
|
481
|
+
type PromptListChangedNotification = Infer<typeof PromptListChangedNotificationSchema>;
|
|
482
|
+
type ToolAnnotations = Infer<typeof ToolAnnotationsSchema>;
|
|
483
|
+
type ToolExecution = Infer<typeof ToolExecutionSchema>;
|
|
484
|
+
type Tool = Infer<typeof ToolSchema>;
|
|
485
|
+
type ListToolsRequest = Infer<typeof ListToolsRequestSchema>;
|
|
486
|
+
type ListToolsResult = StripWireOnly<Infer<typeof ListToolsResultSchema>>;
|
|
487
|
+
type CallToolRequestParams = Infer<typeof CallToolRequestParamsSchema>;
|
|
488
|
+
type CallToolResult = StripWireOnly<Infer<typeof CallToolResultSchema>>;
|
|
489
|
+
type CompatibilityCallToolResult = StripWireOnly<Infer<typeof CompatibilityCallToolResultSchema>>;
|
|
490
|
+
type CallToolRequest = Infer<typeof CallToolRequestSchema>;
|
|
491
|
+
type ToolListChangedNotification = Infer<typeof ToolListChangedNotificationSchema>;
|
|
492
|
+
/**
|
|
493
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
494
|
+
* in the specification for at least twelve months. Migrate to stderr logging
|
|
495
|
+
* (STDIO servers) or OpenTelemetry.
|
|
496
|
+
*/
|
|
497
|
+
type LoggingLevel = Infer<typeof LoggingLevelSchema>;
|
|
498
|
+
/**
|
|
499
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
500
|
+
* in the specification for at least twelve months. Migrate to stderr logging
|
|
501
|
+
* (STDIO servers) or OpenTelemetry.
|
|
502
|
+
*/
|
|
503
|
+
type SetLevelRequestParams = Infer<typeof SetLevelRequestParamsSchema>;
|
|
504
|
+
/**
|
|
505
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
506
|
+
* in the specification for at least twelve months. Migrate to stderr logging
|
|
507
|
+
* (STDIO servers) or OpenTelemetry.
|
|
508
|
+
*/
|
|
509
|
+
type SetLevelRequest = Infer<typeof SetLevelRequestSchema>;
|
|
510
|
+
/**
|
|
511
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
512
|
+
* in the specification for at least twelve months. Migrate to stderr logging
|
|
513
|
+
* (STDIO servers) or OpenTelemetry.
|
|
514
|
+
*/
|
|
515
|
+
type LoggingMessageNotificationParams = Infer<typeof LoggingMessageNotificationParamsSchema>;
|
|
516
|
+
/**
|
|
517
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
518
|
+
* in the specification for at least twelve months. Migrate to stderr logging
|
|
519
|
+
* (STDIO servers) or OpenTelemetry.
|
|
520
|
+
*/
|
|
521
|
+
type LoggingMessageNotification = Infer<typeof LoggingMessageNotificationSchema>;
|
|
522
|
+
/**
|
|
523
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
524
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
525
|
+
* provider APIs directly.
|
|
526
|
+
*/
|
|
527
|
+
type ToolChoice = Infer<typeof ToolChoiceSchema>;
|
|
528
|
+
/**
|
|
529
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
530
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
531
|
+
* provider APIs directly.
|
|
532
|
+
*/
|
|
533
|
+
type ModelHint = Infer<typeof ModelHintSchema>;
|
|
534
|
+
/**
|
|
535
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
536
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
537
|
+
* provider APIs directly.
|
|
538
|
+
*/
|
|
539
|
+
type ModelPreferences = Infer<typeof ModelPreferencesSchema>;
|
|
540
|
+
/**
|
|
541
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
542
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
543
|
+
* provider APIs directly.
|
|
544
|
+
*/
|
|
545
|
+
type SamplingContent = Infer<typeof SamplingContentSchema>;
|
|
546
|
+
/**
|
|
547
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
548
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
549
|
+
* provider APIs directly.
|
|
550
|
+
*/
|
|
551
|
+
type SamplingMessageContentBlock = Infer<typeof SamplingMessageContentBlockSchema>;
|
|
552
|
+
/**
|
|
553
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
554
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
555
|
+
* provider APIs directly.
|
|
556
|
+
*/
|
|
557
|
+
type SamplingMessage = Infer<typeof SamplingMessageSchema>;
|
|
558
|
+
/**
|
|
559
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
560
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
561
|
+
* provider APIs directly.
|
|
562
|
+
*/
|
|
563
|
+
type CreateMessageRequestParams = Infer<typeof CreateMessageRequestParamsSchema>;
|
|
564
|
+
/**
|
|
565
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
566
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
567
|
+
* provider APIs directly.
|
|
568
|
+
*/
|
|
569
|
+
type CreateMessageRequest = Infer<typeof CreateMessageRequestSchema>;
|
|
570
|
+
/**
|
|
571
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
572
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
573
|
+
* provider APIs directly.
|
|
574
|
+
*/
|
|
575
|
+
type CreateMessageResult = StripWireOnly<Infer<typeof CreateMessageResultSchema>>;
|
|
576
|
+
/**
|
|
577
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
578
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
579
|
+
* provider APIs directly.
|
|
580
|
+
*/
|
|
581
|
+
type CreateMessageResultWithTools = StripWireOnly<Infer<typeof CreateMessageResultWithToolsSchema>>;
|
|
582
|
+
type BooleanSchema = Infer<typeof BooleanSchemaSchema>;
|
|
583
|
+
type StringSchema = Infer<typeof StringSchemaSchema>;
|
|
584
|
+
type NumberSchema = Infer<typeof NumberSchemaSchema>;
|
|
585
|
+
type EnumSchema = Infer<typeof EnumSchemaSchema>;
|
|
586
|
+
type UntitledSingleSelectEnumSchema = Infer<typeof UntitledSingleSelectEnumSchemaSchema>;
|
|
587
|
+
type TitledSingleSelectEnumSchema = Infer<typeof TitledSingleSelectEnumSchemaSchema>;
|
|
588
|
+
type LegacyTitledEnumSchema = Infer<typeof LegacyTitledEnumSchemaSchema>;
|
|
589
|
+
type UntitledMultiSelectEnumSchema = Infer<typeof UntitledMultiSelectEnumSchemaSchema>;
|
|
590
|
+
type TitledMultiSelectEnumSchema = Infer<typeof TitledMultiSelectEnumSchemaSchema>;
|
|
591
|
+
type SingleSelectEnumSchema = Infer<typeof SingleSelectEnumSchemaSchema>;
|
|
592
|
+
type MultiSelectEnumSchema = Infer<typeof MultiSelectEnumSchemaSchema>;
|
|
593
|
+
type PrimitiveSchemaDefinition = Infer<typeof PrimitiveSchemaDefinitionSchema>;
|
|
594
|
+
type ElicitRequestParams = Infer<typeof ElicitRequestParamsSchema>;
|
|
595
|
+
type ElicitRequestFormParams = Infer<typeof ElicitRequestFormParamsSchema>;
|
|
596
|
+
type ElicitRequestURLParams = Infer<typeof ElicitRequestURLParamsSchema>;
|
|
597
|
+
type ElicitRequest = Infer<typeof ElicitRequestSchema>;
|
|
598
|
+
/** @deprecated Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification. */
|
|
599
|
+
type ElicitationCompleteNotificationParams = Infer<typeof ElicitationCompleteNotificationParamsSchema>;
|
|
600
|
+
/** @deprecated Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification. */
|
|
601
|
+
type ElicitationCompleteNotification = Infer<typeof ElicitationCompleteNotificationSchema>;
|
|
602
|
+
type ElicitResult = StripWireOnly<Infer<typeof ElicitResultSchema>>;
|
|
603
|
+
type ResourceTemplateReference = Infer<typeof ResourceTemplateReferenceSchema>;
|
|
604
|
+
type PromptReference = Infer<typeof PromptReferenceSchema>;
|
|
605
|
+
type CompleteRequestParams = Infer<typeof CompleteRequestParamsSchema>;
|
|
606
|
+
type CompleteRequest = Infer<typeof CompleteRequestSchema>;
|
|
607
|
+
type CompleteResult = StripWireOnly<Infer<typeof CompleteResultSchema>>;
|
|
608
|
+
/**
|
|
609
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
610
|
+
* in the specification for at least twelve months. Migrate to passing paths via
|
|
611
|
+
* tool parameters, resource URIs, or configuration.
|
|
612
|
+
*/
|
|
613
|
+
type Root = Infer<typeof RootSchema>;
|
|
614
|
+
/**
|
|
615
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
616
|
+
* in the specification for at least twelve months. Migrate to passing paths via
|
|
617
|
+
* tool parameters, resource URIs, or configuration.
|
|
618
|
+
*/
|
|
619
|
+
type ListRootsRequest = Infer<typeof ListRootsRequestSchema>;
|
|
620
|
+
/**
|
|
621
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
622
|
+
* in the specification for at least twelve months. Migrate to passing paths via
|
|
623
|
+
* tool parameters, resource URIs, or configuration.
|
|
624
|
+
*/
|
|
625
|
+
type ListRootsResult = StripWireOnly<Infer<typeof ListRootsResultSchema>>;
|
|
626
|
+
/**
|
|
627
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
628
|
+
* in the specification for at least twelve months. Migrate to passing paths via
|
|
629
|
+
* tool parameters, resource URIs, or configuration.
|
|
630
|
+
*/
|
|
631
|
+
type RootsListChangedNotification = Infer<typeof RootsListChangedNotificationSchema>;
|
|
632
|
+
/**
|
|
633
|
+
* A single embedded (de-JSON-RPC'd) input request inside an
|
|
634
|
+
* {@linkcode InputRequiredResult}: an elicitation, sampling, or roots request
|
|
635
|
+
* object carried in-band rather than sent as a server→client JSON-RPC request.
|
|
636
|
+
*/
|
|
637
|
+
type InputRequest = CreateMessageRequest | ListRootsRequest | ElicitRequest;
|
|
638
|
+
/**
|
|
639
|
+
* A single embedded (de-JSON-RPC'd) input response inside a retried request's
|
|
640
|
+
* `inputResponses`: the bare result object for the corresponding
|
|
641
|
+
* {@linkcode InputRequest} (never wrapped in a `{method, result}` envelope).
|
|
642
|
+
*/
|
|
643
|
+
type InputResponse = CreateMessageResult | ListRootsResult | ElicitResult;
|
|
644
|
+
/**
|
|
645
|
+
* A map of embedded input requests, keyed by server-assigned identifiers that
|
|
646
|
+
* are unique within the scope of the request.
|
|
647
|
+
*/
|
|
648
|
+
interface InputRequests {
|
|
649
|
+
[key: string]: InputRequest;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* A map of embedded input responses. Keys correspond to the keys of the
|
|
653
|
+
* {@linkcode InputRequests} map the server sent; values are the client's bare
|
|
654
|
+
* result for each request.
|
|
655
|
+
*/
|
|
656
|
+
interface InputResponses {
|
|
657
|
+
[key: string]: InputResponse;
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* The input-required result a handler for a multi-round-trip method
|
|
661
|
+
* (`tools/call`, `prompts/get`, `resources/read`) returns to request more
|
|
662
|
+
* input from the client (protocol revision 2026-07-28). Build it with the
|
|
663
|
+
* `inputRequired()` builder; hand-built literals are equally legal —
|
|
664
|
+
* `resultType: 'input_required'` is the discriminator, and the SDK re-checks
|
|
665
|
+
* the at-least-one rule at the seam.
|
|
666
|
+
*
|
|
667
|
+
* This is the one place the wire discriminator `resultType` appears on the
|
|
668
|
+
* neutral surface: the handler authors it, the 2026-07-28 codec passes it
|
|
669
|
+
* through to the wire, and consumers receiving results never see it (complete
|
|
670
|
+
* results are lifted).
|
|
671
|
+
*
|
|
672
|
+
* At least one of `inputRequests` or `requestState` must be present.
|
|
673
|
+
*
|
|
674
|
+
* `requestState` is an opaque, server-minted string echoed back verbatim by
|
|
675
|
+
* the client on retry. It travels through the client and MUST be treated by
|
|
676
|
+
* the server as attacker-controlled input on re-entry: if it influences
|
|
677
|
+
* authorization, resource access, or business logic, the server MUST protect
|
|
678
|
+
* its integrity (e.g. HMAC or AEAD) and MUST reject state that fails
|
|
679
|
+
* verification (spec: basic/patterns/mrtr §Server Requirements). The SDK
|
|
680
|
+
* applies no integrity protection by default — without a configured
|
|
681
|
+
* `ServerOptions.requestState.verify` hook, `ctx.mcpReq.requestState()`
|
|
682
|
+
* returns the raw, unverified string; with one, the seam rejects state the
|
|
683
|
+
* hook refuses and the accessor returns the hook's decoded payload.
|
|
684
|
+
*/
|
|
685
|
+
interface InputRequiredResult extends Result$1 {
|
|
686
|
+
resultType: 'input_required';
|
|
687
|
+
/** Embedded requests the client must fulfil before retrying. */
|
|
688
|
+
inputRequests?: InputRequests;
|
|
689
|
+
/** Opaque server state the client echoes back verbatim on retry. */
|
|
690
|
+
requestState?: string;
|
|
691
|
+
}
|
|
692
|
+
type ClientRequest = Infer<typeof ClientRequestSchema>;
|
|
693
|
+
type ClientNotification = Infer<typeof ClientNotificationSchema>;
|
|
694
|
+
type ClientResult = StripWireOnly<Infer<typeof ClientResultSchema>>;
|
|
695
|
+
type ServerRequest = Infer<typeof ServerRequestSchema>;
|
|
696
|
+
type ServerNotification = Infer<typeof ServerNotificationSchema>;
|
|
697
|
+
type ServerResult = StripWireOnly<Infer<typeof ServerResultSchema>>;
|
|
698
|
+
type MethodToTypeMap<U$1> = { [T in U$1 as T extends {
|
|
699
|
+
method: infer M extends string;
|
|
700
|
+
} ? M : never]: T };
|
|
701
|
+
/**
|
|
702
|
+
* Task methods are 2025-11-25 wire vocabulary with no SDK runtime: the task
|
|
703
|
+
* wire types stay importable (see the Tasks section above), but the typed
|
|
704
|
+
* method surface — `request()`, `setRequestHandler()`, `ctx.mcpReq.send()` —
|
|
705
|
+
* does not offer them. The wire schemas keep parsing task vocabulary for
|
|
706
|
+
* interoperability with 2025-11-25 peers.
|
|
707
|
+
*/
|
|
708
|
+
type TaskRequestMethod = 'tasks/get' | 'tasks/result' | 'tasks/list' | 'tasks/cancel';
|
|
709
|
+
type TaskNotificationMethod = 'notifications/tasks/status';
|
|
710
|
+
type RequestMethod = Exclude<ClientRequest['method'] | ServerRequest['method'], TaskRequestMethod>;
|
|
711
|
+
type NotificationMethod = Exclude<ClientNotification['method'] | ServerNotification['method'], TaskNotificationMethod>;
|
|
712
|
+
type RequestTypeMap = MethodToTypeMap<Exclude<ClientRequest | ServerRequest, {
|
|
713
|
+
method: TaskRequestMethod;
|
|
714
|
+
}>>;
|
|
715
|
+
type NotificationTypeMap = MethodToTypeMap<Exclude<ClientNotification | ServerNotification, {
|
|
716
|
+
method: TaskNotificationMethod;
|
|
717
|
+
}>>;
|
|
718
|
+
type ResultTypeMap = {
|
|
719
|
+
ping: EmptyResult;
|
|
720
|
+
initialize: InitializeResult;
|
|
721
|
+
'server/discover': DiscoverResult;
|
|
722
|
+
'completion/complete': CompleteResult;
|
|
723
|
+
'logging/setLevel': EmptyResult;
|
|
724
|
+
'prompts/get': GetPromptResult;
|
|
725
|
+
'prompts/list': ListPromptsResult;
|
|
726
|
+
'resources/list': ListResourcesResult;
|
|
727
|
+
'resources/templates/list': ListResourceTemplatesResult;
|
|
728
|
+
'resources/read': ReadResourceResult;
|
|
729
|
+
'resources/subscribe': EmptyResult;
|
|
730
|
+
'resources/unsubscribe': EmptyResult;
|
|
731
|
+
'subscriptions/listen': SubscriptionsListenResult;
|
|
732
|
+
'tools/call': CallToolResult;
|
|
733
|
+
'tools/list': ListToolsResult;
|
|
734
|
+
'sampling/createMessage': CreateMessageResult | CreateMessageResultWithTools;
|
|
735
|
+
'elicitation/create': ElicitResult;
|
|
736
|
+
'roots/list': ListRootsResult;
|
|
737
|
+
};
|
|
738
|
+
/**
|
|
739
|
+
* The handler-return counterpart of {@linkcode ResultTypeMap}: what a
|
|
740
|
+
* registered request handler may RETURN for each method. Identical to
|
|
741
|
+
* `ResultTypeMap` except that the multi-round-trip methods (`tools/call`,
|
|
742
|
+
* `prompts/get`, `resources/read`) additionally accept an
|
|
743
|
+
* {@linkcode InputRequiredResult} (protocol revision 2026-07-28).
|
|
744
|
+
*
|
|
745
|
+
* `ResultTypeMap` itself — what a *requester* receives — is deliberately NOT
|
|
746
|
+
* widened: `client.callTool()` returns a plain {@linkcode CallToolResult} on
|
|
747
|
+
* both protocol eras.
|
|
748
|
+
*/
|
|
749
|
+
type HandlerResultTypeMap = { [M in keyof ResultTypeMap]: M extends 'tools/call' | 'prompts/get' | 'resources/read' ? ResultTypeMap[M] | InputRequiredResult : ResultTypeMap[M] };
|
|
750
|
+
/**
|
|
751
|
+
* Information about a validated access token, provided to request handlers.
|
|
752
|
+
*/
|
|
753
|
+
interface AuthInfo {
|
|
754
|
+
/**
|
|
755
|
+
* The access token.
|
|
756
|
+
*/
|
|
757
|
+
token: string;
|
|
758
|
+
/**
|
|
759
|
+
* The client ID associated with this token.
|
|
760
|
+
*/
|
|
761
|
+
clientId: string;
|
|
762
|
+
/**
|
|
763
|
+
* Scopes associated with this token.
|
|
764
|
+
*/
|
|
765
|
+
scopes: string[];
|
|
766
|
+
/**
|
|
767
|
+
* When the token expires (in seconds since epoch).
|
|
768
|
+
*/
|
|
769
|
+
expiresAt?: number;
|
|
770
|
+
/**
|
|
771
|
+
* The RFC 8707 resource server identifier for which this token is valid.
|
|
772
|
+
* If set, this MUST match the MCP server's resource identifier (minus hash fragment).
|
|
773
|
+
*/
|
|
774
|
+
resource?: URL;
|
|
775
|
+
/**
|
|
776
|
+
* Additional data associated with the token.
|
|
777
|
+
* This field should be used for any additional data that needs to be attached to the auth info.
|
|
778
|
+
*/
|
|
779
|
+
extra?: Record<string, unknown>;
|
|
780
|
+
}
|
|
781
|
+
type JSONRPCErrorObject = {
|
|
782
|
+
code: number;
|
|
783
|
+
message: string;
|
|
784
|
+
data?: unknown;
|
|
785
|
+
};
|
|
786
|
+
interface ParseError extends JSONRPCErrorObject {
|
|
787
|
+
code: typeof PARSE_ERROR;
|
|
788
|
+
}
|
|
789
|
+
interface InvalidRequestError extends JSONRPCErrorObject {
|
|
790
|
+
code: typeof INVALID_REQUEST;
|
|
791
|
+
}
|
|
792
|
+
interface MethodNotFoundError extends JSONRPCErrorObject {
|
|
793
|
+
code: typeof METHOD_NOT_FOUND;
|
|
794
|
+
}
|
|
795
|
+
interface InvalidParamsError extends JSONRPCErrorObject {
|
|
796
|
+
code: typeof INVALID_PARAMS;
|
|
797
|
+
}
|
|
798
|
+
interface InternalError extends JSONRPCErrorObject {
|
|
799
|
+
code: typeof INTERNAL_ERROR;
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Data carried by a `-32021` MissingRequiredClientCapability protocol error
|
|
803
|
+
* (protocol revision 2026-07-28).
|
|
804
|
+
*/
|
|
805
|
+
interface MissingRequiredClientCapabilityErrorData {
|
|
806
|
+
/**
|
|
807
|
+
* The capabilities the server requires from the client to process the
|
|
808
|
+
* request, in the `ClientCapabilities` shape (only the missing
|
|
809
|
+
* capabilities are listed).
|
|
810
|
+
*/
|
|
811
|
+
requiredCapabilities: ClientCapabilities;
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Data carried by a `-32022` UnsupportedProtocolVersion protocol error
|
|
815
|
+
* (protocol revision 2026-07-28).
|
|
816
|
+
*/
|
|
817
|
+
interface UnsupportedProtocolVersionErrorData {
|
|
818
|
+
/**
|
|
819
|
+
* Protocol versions the receiver supports. The sender should choose a
|
|
820
|
+
* mutually supported version from this list and retry.
|
|
821
|
+
*/
|
|
822
|
+
supported: string[];
|
|
823
|
+
/**
|
|
824
|
+
* The protocol version that was requested.
|
|
825
|
+
*/
|
|
826
|
+
requested: string;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Callback type for list changed notifications.
|
|
830
|
+
*/
|
|
831
|
+
type ListChangedCallback<T$1> = (error: Error | null, items: T$1[] | null) => void;
|
|
832
|
+
/**
|
|
833
|
+
* Options for subscribing to list changed notifications.
|
|
834
|
+
*
|
|
835
|
+
* @typeParam T - The type of items in the list (`Tool`, `Prompt`, or `Resource`)
|
|
836
|
+
*/
|
|
837
|
+
type ListChangedOptions<T$1> = {
|
|
838
|
+
/**
|
|
839
|
+
* If `true`, the list will be refreshed automatically when a list changed notification is received.
|
|
840
|
+
* @default true
|
|
841
|
+
*/
|
|
842
|
+
autoRefresh?: boolean;
|
|
843
|
+
/**
|
|
844
|
+
* Debounce time in milliseconds. Set to `0` to disable.
|
|
845
|
+
* @default 300
|
|
846
|
+
*/
|
|
847
|
+
debounceMs?: number;
|
|
848
|
+
/**
|
|
849
|
+
* Callback invoked when the list changes.
|
|
850
|
+
*
|
|
851
|
+
* If `autoRefresh` is `true`, `items` contains the updated list.
|
|
852
|
+
* If `autoRefresh` is `false`, `items` is `null` (caller should refresh manually).
|
|
853
|
+
*/
|
|
854
|
+
onChanged: ListChangedCallback<T$1>;
|
|
855
|
+
};
|
|
856
|
+
/**
|
|
857
|
+
* Configuration for list changed notification handlers.
|
|
858
|
+
*
|
|
859
|
+
* Use this to configure handlers for tools, prompts, and resources list changes
|
|
860
|
+
* when creating a client.
|
|
861
|
+
*
|
|
862
|
+
* Note: Handlers are only activated if the server advertises the corresponding
|
|
863
|
+
* `listChanged` capability (e.g., `tools.listChanged: true`). If the server
|
|
864
|
+
* doesn't advertise this capability, the handler will not be set up.
|
|
865
|
+
*/
|
|
866
|
+
type ListChangedHandlers = {
|
|
867
|
+
/**
|
|
868
|
+
* Handler for tool list changes.
|
|
869
|
+
*/
|
|
870
|
+
tools?: ListChangedOptions<Tool>;
|
|
871
|
+
/**
|
|
872
|
+
* Handler for prompt list changes.
|
|
873
|
+
*/
|
|
874
|
+
prompts?: ListChangedOptions<Prompt>;
|
|
875
|
+
/**
|
|
876
|
+
* Handler for resource list changes.
|
|
877
|
+
*/
|
|
878
|
+
resources?: ListChangedOptions<Resource>;
|
|
879
|
+
};
|
|
880
|
+
/**
|
|
881
|
+
* Protocol-era classification of an inbound message.
|
|
882
|
+
*
|
|
883
|
+
* Populated by transports that classify messages at the edge (e.g. an HTTP
|
|
884
|
+
* entry distinguishing 2025-era from 2026-era traffic). The wire era itself
|
|
885
|
+
* is connection state (the negotiated protocol version held by the
|
|
886
|
+
* `Client`/`Server` instance); the protocol layer validates a classified
|
|
887
|
+
* message against that instance era at dispatch — a mismatch is treated as
|
|
888
|
+
* an entry/routing error, never a per-message era switch. Unclassified
|
|
889
|
+
* traffic is dispatched on the instance era unchanged.
|
|
890
|
+
*/
|
|
891
|
+
interface MessageClassification {
|
|
892
|
+
/**
|
|
893
|
+
* The wire era the message was classified into: `legacy` for the
|
|
894
|
+
* 2025-11-25 family of revisions, `modern` for 2026-07-28 and later.
|
|
895
|
+
*/
|
|
896
|
+
era: 'legacy' | 'modern';
|
|
897
|
+
/**
|
|
898
|
+
* The exact protocol revision, when the classifier derived one.
|
|
899
|
+
*/
|
|
900
|
+
revision?: string;
|
|
901
|
+
}
|
|
902
|
+
/**
|
|
903
|
+
* Extra information about a message.
|
|
904
|
+
*/
|
|
905
|
+
interface MessageExtraInfo {
|
|
906
|
+
/**
|
|
907
|
+
* The original HTTP request.
|
|
908
|
+
*/
|
|
909
|
+
request?: globalThis.Request;
|
|
910
|
+
/**
|
|
911
|
+
* Protocol-era classification of the message, when the transport
|
|
912
|
+
* classified it at the edge. Validated by the protocol layer against the
|
|
913
|
+
* instance's negotiated era at dispatch (the edge→instance handoff
|
|
914
|
+
* check); it does not select the era itself.
|
|
915
|
+
*/
|
|
916
|
+
classification?: MessageClassification;
|
|
917
|
+
/**
|
|
918
|
+
* The authentication information.
|
|
919
|
+
*/
|
|
920
|
+
authInfo?: AuthInfo;
|
|
921
|
+
/**
|
|
922
|
+
* Callback to close the SSE stream for this request, triggering client reconnection.
|
|
923
|
+
* Only available when using {@linkcode @modelcontextprotocol/node!streamableHttp.NodeStreamableHTTPServerTransport | NodeStreamableHTTPServerTransport} with eventStore configured.
|
|
924
|
+
*/
|
|
925
|
+
closeSSEStream?: () => void;
|
|
926
|
+
/**
|
|
927
|
+
* Callback to close the standalone GET SSE stream, triggering client reconnection.
|
|
928
|
+
* Only available when using {@linkcode @modelcontextprotocol/node!streamableHttp.NodeStreamableHTTPServerTransport | NodeStreamableHTTPServerTransport} with eventStore configured.
|
|
929
|
+
*/
|
|
930
|
+
closeStandaloneSSEStream?: () => void;
|
|
931
|
+
}
|
|
932
|
+
type MetaObject = Record<string, unknown>;
|
|
933
|
+
type RequestMetaObject = RequestMeta;
|
|
934
|
+
/**
|
|
935
|
+
* The contents of a result's `_meta` field (the 2026-07-28 `ResultMetaObject`):
|
|
936
|
+
* loose, with the optional self-reported serverInfo key typed when present.
|
|
937
|
+
*/
|
|
938
|
+
type ResultMetaObject = Infer<typeof ResultMetaObjectSchema>;
|
|
939
|
+
/**
|
|
940
|
+
* {@linkcode CreateMessageRequestParams} without tools - for backwards-compatible overload.
|
|
941
|
+
* Excludes tools/toolChoice to indicate they should not be provided.
|
|
942
|
+
*
|
|
943
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
944
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
945
|
+
* provider APIs directly.
|
|
946
|
+
*/
|
|
947
|
+
type CreateMessageRequestParamsBase = Omit<CreateMessageRequestParams, 'tools' | 'toolChoice'>;
|
|
948
|
+
/**
|
|
949
|
+
* {@linkcode CreateMessageRequestParams} with required tools - for tool-enabled overload.
|
|
950
|
+
*
|
|
951
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
|
|
952
|
+
* in the specification for at least twelve months. Migrate to calling LLM
|
|
953
|
+
* provider APIs directly.
|
|
954
|
+
*/
|
|
955
|
+
interface CreateMessageRequestParamsWithTools extends CreateMessageRequestParams {
|
|
956
|
+
tools: Tool[];
|
|
957
|
+
}
|
|
958
|
+
type CompleteRequestResourceTemplate = ExpandRecursively<CompleteRequest & {
|
|
959
|
+
params: CompleteRequestParams & {
|
|
960
|
+
ref: ResourceTemplateReference;
|
|
961
|
+
};
|
|
962
|
+
}>;
|
|
963
|
+
type CompleteRequestPrompt = ExpandRecursively<CompleteRequest & {
|
|
964
|
+
params: CompleteRequestParams & {
|
|
965
|
+
ref: PromptReference;
|
|
966
|
+
};
|
|
967
|
+
}>;
|
|
968
|
+
//#endregion
|
|
969
|
+
//#region ../core-internal/src/wire/codec.d.ts
|
|
970
|
+
/** Wire eras with distinct vocabulary. */
|
|
971
|
+
type WireEra = '2025-11-25' | '2026-07-28';
|
|
972
|
+
/**
|
|
973
|
+
* Wire-only material lifted off an inbound message by the protocol layer
|
|
974
|
+
* before dispatch (the V-3 seam): the reserved `_meta` envelope keys and the
|
|
975
|
+
* multi-round-trip driver fields. This is the typed driver-material channel
|
|
976
|
+
* of the codec contract — handlers never see it; the protocol layer surfaces
|
|
977
|
+
* it via `ctx.mcpReq.envelope` / `.inputResponses` / `.requestState`, and the
|
|
978
|
+
* MRTR driver (M4.1) consumes the retry fields from here.
|
|
979
|
+
*/
|
|
980
|
+
interface LiftedWireMaterial {
|
|
981
|
+
envelope?: Partial<RequestMetaEnvelope>;
|
|
982
|
+
inputResponses?: Record<string, unknown>;
|
|
983
|
+
requestState?: string;
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Tri-state validation outcome — the function-only contract for what the
|
|
987
|
+
* schema-getter pair (`hasRequestMethod` ⇒ −32601-by-absence; `…Schema(m)
|
|
988
|
+
* .parse` throw ⇒ −32602) used to encode in two pieces. Preserving the split
|
|
989
|
+
* is the point: collapsing 'absent from this era's registry' into 'invalid'
|
|
990
|
+
* would make the in-band fallback chain (validate → on `not-in-era` fall to
|
|
991
|
+
* validateInputRequest) treat absence as failure and never fall through.
|
|
992
|
+
*/
|
|
993
|
+
type ValidateOutcome<T$1> = {
|
|
994
|
+
readonly ok: true;
|
|
995
|
+
readonly value: T$1;
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* Method is spec vocabulary but absent from THIS era's registry. Callers
|
|
999
|
+
* map to −32601 (inbound) or a typed local SdkError (outbound), or fall
|
|
1000
|
+
* through to the in-band validator.
|
|
1001
|
+
*/ | {
|
|
1002
|
+
readonly ok: false;
|
|
1003
|
+
readonly reason: 'not-in-era';
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* Method is in this era's registry; payload failed the era-exact schema.
|
|
1007
|
+
* Callers map to −32602.
|
|
1008
|
+
*/ | {
|
|
1009
|
+
readonly ok: false;
|
|
1010
|
+
readonly reason: 'invalid';
|
|
1011
|
+
readonly message: string;
|
|
1012
|
+
};
|
|
1013
|
+
/** A single self-identifying problem found while validating a per-request `_meta` envelope. */
|
|
1014
|
+
interface EnvelopeIssue {
|
|
1015
|
+
/**
|
|
1016
|
+
* The envelope key the problem is about: one of the reserved `_meta`
|
|
1017
|
+
* keys, or a dotted path inside one.
|
|
1018
|
+
*/
|
|
1019
|
+
readonly key: string;
|
|
1020
|
+
/** A short description of what is wrong with that key (`missing`, or a validation message). */
|
|
1021
|
+
readonly problem: string;
|
|
1022
|
+
}
|
|
1023
|
+
/** Material a Client supplies for an era to build its per-request `_meta` envelope from. */
|
|
1024
|
+
interface OutboundEnvelopeMaterial {
|
|
1025
|
+
readonly protocolVersion: string;
|
|
1026
|
+
readonly clientInfo: Implementation;
|
|
1027
|
+
readonly clientCapabilities: ClientCapabilities;
|
|
1028
|
+
readonly logLevel?: LoggingLevel;
|
|
1029
|
+
}
|
|
1030
|
+
/** Result decode outcomes — the raw-first discrimination (V-1) lives in `decodeResult`. */
|
|
1031
|
+
type DecodedResult = {
|
|
1032
|
+
kind: 'complete';
|
|
1033
|
+
/** The neutral result value: wire-only material consumed/stripped. */
|
|
1034
|
+
result: Result$1;
|
|
1035
|
+
} | {
|
|
1036
|
+
kind: 'input_required';
|
|
1037
|
+
/**
|
|
1038
|
+
* Driver-only material (never consumer-visible). The full
|
|
1039
|
+
* multi-round-trip driver is M4.1 scope; this seam carries the
|
|
1040
|
+
* discriminated payload to it.
|
|
1041
|
+
*/
|
|
1042
|
+
inputRequests: Record<string, unknown>;
|
|
1043
|
+
requestState?: string;
|
|
1044
|
+
} | {
|
|
1045
|
+
kind: 'invalid';
|
|
1046
|
+
error: SdkError;
|
|
1047
|
+
};
|
|
1048
|
+
/**
|
|
1049
|
+
* The per-era wire codec contract (design C §3, adapted to the live funnel
|
|
1050
|
+
* layout: the universal wire-only LIFT runs once in the protocol layer for
|
|
1051
|
+
* every message — spec, custom, and fallback paths alike — and codecs consume
|
|
1052
|
+
* the lifted material rather than re-implementing the strip per era).
|
|
1053
|
+
*/
|
|
1054
|
+
interface WireCodec {
|
|
1055
|
+
readonly era: WireEra;
|
|
1056
|
+
/** Registry membership — the deletion story (inbound −32601 by absence; outbound typed local error). */
|
|
1057
|
+
hasRequestMethod(method: string): boolean;
|
|
1058
|
+
hasNotificationMethod(method: string): boolean;
|
|
1059
|
+
hasInputRequestMethod(method: string): boolean;
|
|
1060
|
+
/** Era-exact request validation. `not-in-era` ≡ −32601-by-absence; `invalid` ≡ −32602. */
|
|
1061
|
+
validateRequest<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<RequestTypeMap[M$1]>;
|
|
1062
|
+
validateRequest(method: string, raw: unknown): ValidateOutcome<unknown>;
|
|
1063
|
+
/** Era-exact result validation (same registry as `validateRequest`). */
|
|
1064
|
+
validateResult<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<ResultTypeMap[M$1]>;
|
|
1065
|
+
validateResult(method: string, raw: unknown): ValidateOutcome<unknown>;
|
|
1066
|
+
/** Era-exact notification validation. */
|
|
1067
|
+
validateNotification<M$1 extends NotificationMethod>(method: M$1, raw: unknown): ValidateOutcome<NotificationTypeMap[M$1]>;
|
|
1068
|
+
validateNotification(method: string, raw: unknown): ValidateOutcome<unknown>;
|
|
1069
|
+
/**
|
|
1070
|
+
* In-band (de-JSON-RPC'd) input-request validation — the embedded
|
|
1071
|
+
* requests a multi-round-trip `input_required` result may carry. Always
|
|
1072
|
+
* `not-in-era` on the 2025 era (elicitation/sampling/roots are wire
|
|
1073
|
+
* request methods there). Does NOT grant registry membership.
|
|
1074
|
+
*/
|
|
1075
|
+
validateInputRequest<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<RequestTypeMap[M$1]>;
|
|
1076
|
+
validateInputRequest(method: string, raw: unknown): ValidateOutcome<unknown>;
|
|
1077
|
+
/** In-band bare-response validation answering an embedded input request. */
|
|
1078
|
+
validateInputResponse<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<ResultTypeMap[M$1]>;
|
|
1079
|
+
validateInputResponse(method: string, raw: unknown): ValidateOutcome<unknown>;
|
|
1080
|
+
/**
|
|
1081
|
+
* Param-conditional `sampling/createMessage` result validation — the one
|
|
1082
|
+
* spec result whose schema depends on REQUEST params (tools vs no tools).
|
|
1083
|
+
* The 2025 era owns the with-tools/plain frozen schemas; the 2026 era
|
|
1084
|
+
* returns `not-in-era` (sampling is in-band there — callers fall through
|
|
1085
|
+
* to `validateInputResponse`).
|
|
1086
|
+
*/
|
|
1087
|
+
samplingResultVariant(hasTools: true, raw: unknown): ValidateOutcome<CreateMessageResultWithTools>;
|
|
1088
|
+
samplingResultVariant(hasTools: false, raw: unknown): ValidateOutcome<CreateMessageResult>;
|
|
1089
|
+
samplingResultVariant(hasTools: boolean, raw: unknown): ValidateOutcome<CreateMessageResult | CreateMessageResultWithTools>;
|
|
1090
|
+
/**
|
|
1091
|
+
* Outbound per-request `_meta` envelope encode. Returns the keyed object
|
|
1092
|
+
* to merge into `params._meta` on this era, or `undefined` when this era
|
|
1093
|
+
* carries no per-request envelope (the 2025 era — legacy wire stays
|
|
1094
|
+
* byte-identical).
|
|
1095
|
+
*/
|
|
1096
|
+
outboundEnvelope(material: OutboundEnvelopeMaterial): Readonly<Record<string, unknown>> | undefined;
|
|
1097
|
+
/**
|
|
1098
|
+
* Structured envelope validation: maps a `_meta` object to
|
|
1099
|
+
* self-identifying issues. The 2025 era never requires an envelope and
|
|
1100
|
+
* always returns `[]`; the 2026 era owns the required-key pre-pass plus
|
|
1101
|
+
* the wire-exact `RequestMetaEnvelopeSchema` parse.
|
|
1102
|
+
*/
|
|
1103
|
+
validateEnvelopeMeta(meta: Readonly<Record<string, unknown>>): EnvelopeIssue[];
|
|
1104
|
+
/**
|
|
1105
|
+
* Per-registration `tools/call` result projection. Two independent
|
|
1106
|
+
* decisions, both owned here so server-side code never re-derives them:
|
|
1107
|
+
*
|
|
1108
|
+
* - SEP-2106 §4.3 TextContent auto-append (EVERY era, value-shape-based):
|
|
1109
|
+
* when `structuredContent` is a non-object value (array/primitive/
|
|
1110
|
+
* `null`) and the handler authored no `type:'text'` block, append
|
|
1111
|
+
* `{type:'text', text: JSON.stringify(value)}` so consumers that read
|
|
1112
|
+
* only `content` still receive a rendering. The author opts out by
|
|
1113
|
+
* returning any `text` block themselves.
|
|
1114
|
+
*
|
|
1115
|
+
* - `{result:…}` wrap (2025 era only): wrap as `{result:<value>}` when the
|
|
1116
|
+
* value is non-object (the 2025 wire shape requires `structuredContent`
|
|
1117
|
+
* to be an object — a schema-less tool returning `[1,2,3]` would
|
|
1118
|
+
* otherwise ship wire-illegal bytes) OR when the tool's ADVERTISED
|
|
1119
|
+
* `outputSchema` has a non-object root (so the result matches the
|
|
1120
|
+
* `encodeResult('tools/list')` projection of the same tool). Identity on
|
|
1121
|
+
* the 2026 era — the wire shape carries the natural value directly.
|
|
1122
|
+
*/
|
|
1123
|
+
projectCallToolResult(result: CallToolResult, advertisedOutputSchema: Readonly<Record<string, unknown>> | undefined): CallToolResult;
|
|
1124
|
+
/**
|
|
1125
|
+
* Step 1 of result decoding: RAW `resultType` handling BEFORE any schema
|
|
1126
|
+
* validation (V-1's structural home). Era postures (Q1-SD3):
|
|
1127
|
+
* - 2026 era: required discriminator — absent ⇒ typed error naming the
|
|
1128
|
+
* spec violation; `input_required` ⇒ driver payload; unknown ⇒ invalid,
|
|
1129
|
+
* no retry; `complete` ⇒ consume + lift.
|
|
1130
|
+
* - 2025 era: `resultType` is foreign vocabulary ⇒ strip-on-lift.
|
|
1131
|
+
*/
|
|
1132
|
+
decodeResult(method: string, raw: unknown): DecodedResult;
|
|
1133
|
+
/**
|
|
1134
|
+
* Outbound result mapping (the stamp seam). The 2025-era codec is the
|
|
1135
|
+
* identity — it has NO stamp code path (the never-stamp guarantee; it
|
|
1136
|
+
* never reads `serverInfo`). The 2026-era codec strictly enforces the
|
|
1137
|
+
* 2026 wire shape for the known deleted-field set
|
|
1138
|
+
* (`execution.taskSupport`, `capabilities.tasks` — Q1-SD3 iii), stamps
|
|
1139
|
+
* `resultType`, fills the required `ttlMs`/`cacheScope` fields on
|
|
1140
|
+
* cacheable results, and — when the caller supplies its identity —
|
|
1141
|
+
* stamps `_meta['io.modelcontextprotocol/serverInfo']` on every result
|
|
1142
|
+
* (spec PR #3002 SHOULD; a handler-authored value wins). `Server`
|
|
1143
|
+
* instances pass their identity; clients and hand-constructed protocol
|
|
1144
|
+
* objects pass nothing and no identity is ever invented.
|
|
1145
|
+
*/
|
|
1146
|
+
encodeResult(method: string, result: Result$1, serverInfo?: Implementation): Result$1;
|
|
1147
|
+
/**
|
|
1148
|
+
* Outbound error-code mapping (the error half of the stamp seam). A
|
|
1149
|
+
* handler-thrown `ProtocolError`'s numeric code passes through here on
|
|
1150
|
+
* its way to the JSON-RPC error response, so per-era wire-code selection
|
|
1151
|
+
* lives in the codec rather than in handler/funnel code. The current
|
|
1152
|
+
* mapping is identical on both eras (the `-32002` resource-not-found
|
|
1153
|
+
* domain code maps to `-32602` Invalid Params on the wire — the
|
|
1154
|
+
* 2026-07-28 spec MUST, and what the deployed v1.x SDK already emits on
|
|
1155
|
+
* earlier revisions); the seam is the structural home for any future
|
|
1156
|
+
* per-era divergence. Unknown codes pass through unchanged.
|
|
1157
|
+
*/
|
|
1158
|
+
encodeErrorCode(code: number): number;
|
|
1159
|
+
/**
|
|
1160
|
+
* @deprecated Use {@link validateEnvelopeMeta}. Inbound envelope
|
|
1161
|
+
* enforcement for era-classified traffic: validates the lifted envelope
|
|
1162
|
+
* material of a request. Returns an error message when the era requires
|
|
1163
|
+
* an envelope and it is missing/invalid (→ −32602 at the dispatch
|
|
1164
|
+
* layer); `undefined` when acceptable. The 2025 era never requires an
|
|
1165
|
+
* envelope.
|
|
1166
|
+
*/
|
|
1167
|
+
checkInboundEnvelope(material: LiftedWireMaterial): string | undefined;
|
|
1168
|
+
}
|
|
1169
|
+
//#endregion
|
|
1170
|
+
//#region ../core-internal/src/util/standardSchema.d.ts
|
|
1171
|
+
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
1172
|
+
readonly '~standard': StandardTypedV1.Props<Input, Output>;
|
|
1173
|
+
}
|
|
1174
|
+
declare namespace StandardTypedV1 {
|
|
1175
|
+
interface Props<Input = unknown, Output = Input> {
|
|
1176
|
+
readonly version: 1;
|
|
1177
|
+
readonly vendor: string;
|
|
1178
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
1179
|
+
}
|
|
1180
|
+
interface Types<Input = unknown, Output = Input> {
|
|
1181
|
+
readonly input: Input;
|
|
1182
|
+
readonly output: Output;
|
|
1183
|
+
}
|
|
1184
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['input'];
|
|
1185
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['output'];
|
|
1186
|
+
}
|
|
1187
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
1188
|
+
readonly '~standard': StandardSchemaV1.Props<Input, Output>;
|
|
1189
|
+
}
|
|
1190
|
+
declare namespace StandardSchemaV1 {
|
|
1191
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
1192
|
+
readonly validate: (value: unknown, options?: Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
1193
|
+
}
|
|
1194
|
+
interface Options {
|
|
1195
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
1196
|
+
}
|
|
1197
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
1198
|
+
interface SuccessResult<Output> {
|
|
1199
|
+
readonly value: Output;
|
|
1200
|
+
readonly issues?: undefined;
|
|
1201
|
+
}
|
|
1202
|
+
interface FailureResult {
|
|
1203
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
1204
|
+
}
|
|
1205
|
+
interface Issue {
|
|
1206
|
+
readonly message: string;
|
|
1207
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
1208
|
+
}
|
|
1209
|
+
interface PathSegment {
|
|
1210
|
+
readonly key: PropertyKey;
|
|
1211
|
+
}
|
|
1212
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
1213
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
1214
|
+
}
|
|
1215
|
+
interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
|
|
1216
|
+
readonly '~standard': StandardJSONSchemaV1.Props<Input, Output>;
|
|
1217
|
+
}
|
|
1218
|
+
declare namespace StandardJSONSchemaV1 {
|
|
1219
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
1220
|
+
readonly jsonSchema: Converter;
|
|
1221
|
+
}
|
|
1222
|
+
interface Converter {
|
|
1223
|
+
readonly input: (options: Options) => Record<string, unknown>;
|
|
1224
|
+
readonly output: (options: Options) => Record<string, unknown>;
|
|
1225
|
+
}
|
|
1226
|
+
type Target = 'draft-2020-12' | 'draft-07' | 'openapi-3.0' | (object & string);
|
|
1227
|
+
interface Options {
|
|
1228
|
+
readonly target: Target;
|
|
1229
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
1230
|
+
}
|
|
1231
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
1232
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* Combined interface for schemas with both validation and JSON Schema conversion —
|
|
1236
|
+
* the intersection of {@linkcode StandardSchemaV1} and {@linkcode StandardJSONSchemaV1}.
|
|
1237
|
+
*
|
|
1238
|
+
* This is the type accepted by `registerTool` / `registerPrompt`. The SDK needs
|
|
1239
|
+
* `~standard.jsonSchema` to advertise the tool's argument shape in `tools/list`, and
|
|
1240
|
+
* `~standard.validate` to check incoming arguments when a `tools/call` arrives.
|
|
1241
|
+
*
|
|
1242
|
+
* Zod v4, ArkType, and Valibot (via `@valibot/to-json-schema`'s `toStandardJsonSchema`)
|
|
1243
|
+
* all implement both interfaces.
|
|
1244
|
+
*
|
|
1245
|
+
* @see https://standardschema.dev/ for the Standard Schema specification
|
|
1246
|
+
*/
|
|
1247
|
+
interface StandardSchemaWithJSON<Input = unknown, Output = Input> {
|
|
1248
|
+
readonly '~standard': StandardSchemaV1.Props<Input, Output> & StandardJSONSchemaV1.Props<Input, Output>;
|
|
1249
|
+
}
|
|
1250
|
+
declare namespace StandardSchemaWithJSON {
|
|
1251
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
1252
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1255
|
+
* Narrowing of {@linkcode StandardSchemaV1} whose `validate` is guaranteed synchronous.
|
|
1256
|
+
*
|
|
1257
|
+
* The Zod schemas backing `specTypeSchemas` contain no async refinements or transforms,
|
|
1258
|
+
* so every entry satisfies this interface. Consumers can call `validate()` and access
|
|
1259
|
+
* `.issues` / `.value` on the result without `await`.
|
|
1260
|
+
*
|
|
1261
|
+
* `StandardSchemaV1Sync` is assignable to `StandardSchemaV1` — it is a strict subtype.
|
|
1262
|
+
*/
|
|
1263
|
+
interface StandardSchemaV1Sync<Input = unknown, Output = Input> extends StandardSchemaV1<Input, Output> {
|
|
1264
|
+
readonly '~standard': StandardSchemaV1Sync.Props<Input, Output>;
|
|
1265
|
+
}
|
|
1266
|
+
declare namespace StandardSchemaV1Sync {
|
|
1267
|
+
interface Props<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output> {
|
|
1268
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<Output>;
|
|
1269
|
+
}
|
|
1270
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
1271
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
1272
|
+
}
|
|
1273
|
+
//#endregion
|
|
1274
|
+
//#region ../core-internal/src/shared/inputRequired.d.ts
|
|
1275
|
+
/**
|
|
1276
|
+
* Wraps a result schema so a request issued through `client.request()` /
|
|
1277
|
+
* `ctx.mcpReq.send()` with `allowInputRequired: true` is typed as either the
|
|
1278
|
+
* schema's result or an {@linkcode InputRequiredResult}.
|
|
1279
|
+
*
|
|
1280
|
+
* The manual multi-round-trip path: pass `{ allowInputRequired: true }` in the
|
|
1281
|
+
* request options so an `input_required` response is handed back to the
|
|
1282
|
+
* caller instead of being auto-fulfilled (or rejected), and wrap the result
|
|
1283
|
+
* schema with `withInputRequired()` so the returned value is typed and
|
|
1284
|
+
* validated correctly for both outcomes — `input_required` values pass
|
|
1285
|
+
* through as-is, complete results validate against the wrapped schema.
|
|
1286
|
+
*/
|
|
1287
|
+
declare function withInputRequired<S extends StandardSchemaV1>(schema: S): StandardSchemaV1<unknown, StandardSchemaV1.InferOutput<S> | InputRequiredResult>;
|
|
1288
|
+
//#endregion
|
|
1289
|
+
//#region ../core-internal/src/shared/inputRequiredDriver.d.ts
|
|
1290
|
+
/**
|
|
1291
|
+
* Multi-round-trip driver options (`inputRequired` on the client options bag).
|
|
1292
|
+
*/
|
|
1293
|
+
interface InputRequiredOptions {
|
|
1294
|
+
/**
|
|
1295
|
+
* Fulfil `input_required` results automatically by dispatching the
|
|
1296
|
+
* embedded requests to the registered handlers and retrying.
|
|
1297
|
+
*
|
|
1298
|
+
* Set to `false` for manual mode: an `input_required` response then
|
|
1299
|
+
* surfaces as a typed error unless the individual call opts in with
|
|
1300
|
+
* `allowInputRequired: true` (and, for typed results on the explicit
|
|
1301
|
+
* schema path, `withInputRequired()`).
|
|
1302
|
+
*
|
|
1303
|
+
* @default true
|
|
1304
|
+
*/
|
|
1305
|
+
autoFulfill?: boolean;
|
|
1306
|
+
/**
|
|
1307
|
+
* Maximum number of rounds (retries) the driver performs for a single
|
|
1308
|
+
* call before failing with a typed
|
|
1309
|
+
* {@linkcode SdkErrorCode.InputRequiredRoundsExceeded} error.
|
|
1310
|
+
*
|
|
1311
|
+
* @default 10
|
|
1312
|
+
*/
|
|
1313
|
+
maxRounds?: number;
|
|
1314
|
+
}
|
|
1315
|
+
//#endregion
|
|
1316
|
+
//#region ../core-internal/src/types/enums.d.ts
|
|
1317
|
+
/**
|
|
1318
|
+
* Error codes for protocol errors that cross the wire as JSON-RPC error responses.
|
|
1319
|
+
* These follow the JSON-RPC specification and MCP-specific extensions.
|
|
1320
|
+
*/
|
|
1321
|
+
declare enum ProtocolErrorCode {
|
|
1322
|
+
ParseError = -32700,
|
|
1323
|
+
InvalidRequest = -32600,
|
|
1324
|
+
MethodNotFound = -32601,
|
|
1325
|
+
InvalidParams = -32602,
|
|
1326
|
+
InternalError = -32603,
|
|
1327
|
+
/**
|
|
1328
|
+
* Resource not found.
|
|
1329
|
+
*
|
|
1330
|
+
* Receive-tolerated only: the SDK never EMITS `-32002` — `resources/read`
|
|
1331
|
+
* misses answer `-32602` (Invalid Params) on every protocol revision per
|
|
1332
|
+
* the 2026-07-28 spec MUST, and a handler-thrown `-32002` is mapped to
|
|
1333
|
+
* `-32602` at the era encode seam. The member stays importable so clients
|
|
1334
|
+
* can recognise `-32002` from peers built on earlier SDK releases (the
|
|
1335
|
+
* spec's "clients SHOULD also accept `-32002`" backwards-compatibility
|
|
1336
|
+
* clause). Throw `ResourceNotFoundError` instead.
|
|
1337
|
+
*/
|
|
1338
|
+
ResourceNotFound = -32002,
|
|
1339
|
+
/**
|
|
1340
|
+
* Processing the request requires a capability the client did not declare
|
|
1341
|
+
* in the request's `clientCapabilities` (protocol revision 2026-07-28).
|
|
1342
|
+
*/
|
|
1343
|
+
MissingRequiredClientCapability = -32021,
|
|
1344
|
+
/**
|
|
1345
|
+
* The request's protocol version is unknown to the server or unsupported
|
|
1346
|
+
* by it (protocol revision 2026-07-28).
|
|
1347
|
+
*/
|
|
1348
|
+
UnsupportedProtocolVersion = -32022,
|
|
1349
|
+
UrlElicitationRequired = -32042,
|
|
1350
|
+
}
|
|
1351
|
+
//#endregion
|
|
1352
|
+
//#region ../core-internal/src/types/errors.d.ts
|
|
1353
|
+
/**
|
|
1354
|
+
* Protocol errors are JSON-RPC errors that cross the wire as error responses.
|
|
1355
|
+
* They use numeric error codes from the {@linkcode ProtocolErrorCode} enum.
|
|
1356
|
+
*
|
|
1357
|
+
* `instanceof` on this class (and its subclasses) is brand-matched, so it works
|
|
1358
|
+
* across separately bundled copies of the SDK — e.g. an error constructed by
|
|
1359
|
+
* `@modelcontextprotocol/client` matches the class re-exported by
|
|
1360
|
+
* `@modelcontextprotocol/server` in the same process.
|
|
1361
|
+
*/
|
|
1362
|
+
declare class ProtocolError extends Error {
|
|
1363
|
+
readonly code: number;
|
|
1364
|
+
readonly data?: unknown | undefined;
|
|
1365
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
1366
|
+
/**
|
|
1367
|
+
* Brand-based type guard: equivalent to `value instanceof this`, as an
|
|
1368
|
+
* explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
|
|
1369
|
+
* the caller's own brand via `this`, so every branded subclass gets a
|
|
1370
|
+
* correctly-scoped guard by inheritance. Must be invoked on the class —
|
|
1371
|
+
* in callback position write `v => SdkError.isInstance(v)`, not
|
|
1372
|
+
* `.filter(SdkError.isInstance)` (detached calls throw rather than
|
|
1373
|
+
* silently matching nothing).
|
|
1374
|
+
*/
|
|
1375
|
+
static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
|
|
1376
|
+
constructor(code: number, message: string, data?: unknown | undefined);
|
|
1377
|
+
/**
|
|
1378
|
+
* Factory method to create the appropriate error type based on the error code and data
|
|
1379
|
+
*/
|
|
1380
|
+
static fromError(code: number, message: string, data?: unknown): ProtocolError;
|
|
1381
|
+
}
|
|
1382
|
+
/**
|
|
1383
|
+
* Error type for a `resources/read` miss: the requested resource does not
|
|
1384
|
+
* exist. The wire code is `-32602` (Invalid Params) on every protocol
|
|
1385
|
+
* revision — the spec MUST for revision 2026-07-28, and the value the v1.x
|
|
1386
|
+
* SDK has always emitted on earlier revisions. The error data echoes the
|
|
1387
|
+
* requested URI.
|
|
1388
|
+
*
|
|
1389
|
+
* Recognise this error by checking `error.data` is exactly `{ uri: string }`
|
|
1390
|
+
* (a `-32602` whose data carries `uri` and nothing else is resource-not-found;
|
|
1391
|
+
* any other `-32602` is an ordinary Invalid Params). For backwards compatibility, clients should also
|
|
1392
|
+
* accept `-32002` as resource not found — earlier SDK builds emitted that
|
|
1393
|
+
* code, and {@linkcode ProtocolError.fromError} reconstructs this class for
|
|
1394
|
+
* either code **when `error.data` carries `uri`** (a bare `-32002` without
|
|
1395
|
+
* `data.uri` stays a generic {@linkcode ProtocolError}). `instanceof` checks
|
|
1396
|
+
* are brand-matched and work across separately bundled copies of the SDK.
|
|
1397
|
+
*/
|
|
1398
|
+
declare class ResourceNotFoundError extends ProtocolError {
|
|
1399
|
+
constructor(uri: string, message?: string);
|
|
1400
|
+
/** The URI that was requested and not found. */
|
|
1401
|
+
get uri(): string;
|
|
1402
|
+
}
|
|
1403
|
+
/**
|
|
1404
|
+
* Specialized error type when a tool requires a URL mode elicitation.
|
|
1405
|
+
* This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against.
|
|
1406
|
+
*/
|
|
1407
|
+
declare class UrlElicitationRequiredError extends ProtocolError {
|
|
1408
|
+
constructor(elicitations: ElicitRequestURLParams[], message?: string);
|
|
1409
|
+
get elicitations(): ElicitRequestURLParams[];
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Error type for the `-32022` UnsupportedProtocolVersion protocol error (protocol
|
|
1413
|
+
* revision 2026-07-28): the request's protocol version is unknown to the server or
|
|
1414
|
+
* unsupported by it.
|
|
1415
|
+
*
|
|
1416
|
+
* The error data lists the protocol versions the receiver supports (`supported`),
|
|
1417
|
+
* so the sender can choose a mutually supported version and retry, and echoes the
|
|
1418
|
+
* version that was requested (`requested`).
|
|
1419
|
+
*/
|
|
1420
|
+
declare class UnsupportedProtocolVersionError extends ProtocolError {
|
|
1421
|
+
constructor(data: UnsupportedProtocolVersionErrorData, message?: string);
|
|
1422
|
+
/**
|
|
1423
|
+
* Protocol versions the receiver supports.
|
|
1424
|
+
*/
|
|
1425
|
+
get supported(): string[];
|
|
1426
|
+
/**
|
|
1427
|
+
* The protocol version that was requested.
|
|
1428
|
+
*/
|
|
1429
|
+
get requested(): string;
|
|
1430
|
+
}
|
|
1431
|
+
/**
|
|
1432
|
+
* Error type for the `-32021` MissingRequiredClientCapability protocol error
|
|
1433
|
+
* (protocol revision 2026-07-28): processing the request requires a capability
|
|
1434
|
+
* the client did not declare in the request's `clientCapabilities`.
|
|
1435
|
+
*
|
|
1436
|
+
* The error data lists the missing capabilities (`requiredCapabilities`) in
|
|
1437
|
+
* the `ClientCapabilities` shape, so the client can see exactly what it would
|
|
1438
|
+
* have to declare for the request to be served. On HTTP, the response status
|
|
1439
|
+
* is `400 Bad Request`.
|
|
1440
|
+
*
|
|
1441
|
+
* Recognize this error by its code and `data.requiredCapabilities`, or by
|
|
1442
|
+
* `instanceof` — checks are brand-matched and work across separately bundled
|
|
1443
|
+
* copies of the SDK.
|
|
1444
|
+
*/
|
|
1445
|
+
declare class MissingRequiredClientCapabilityError extends ProtocolError {
|
|
1446
|
+
constructor(data: MissingRequiredClientCapabilityErrorData, message?: string);
|
|
1447
|
+
/**
|
|
1448
|
+
* The capabilities the server requires from the client to process the
|
|
1449
|
+
* request (only the missing capabilities are listed).
|
|
1450
|
+
*/
|
|
1451
|
+
get requiredCapabilities(): ClientCapabilities;
|
|
1452
|
+
}
|
|
1453
|
+
//#endregion
|
|
1454
|
+
//#region ../core-internal/src/types/guards.d.ts
|
|
1455
|
+
/**
|
|
1456
|
+
* Validates and parses an unknown value as a JSON-RPC message.
|
|
1457
|
+
*
|
|
1458
|
+
* Use this to validate incoming messages in custom transport implementations.
|
|
1459
|
+
* Throws if the value does not conform to the JSON-RPC message schema.
|
|
1460
|
+
*
|
|
1461
|
+
* @param value - The value to validate (typically a parsed JSON object).
|
|
1462
|
+
* @returns The validated {@linkcode JSONRPCMessage}.
|
|
1463
|
+
* @throws If validation fails.
|
|
1464
|
+
*/
|
|
1465
|
+
declare function parseJSONRPCMessage(value: unknown): JSONRPCMessage;
|
|
1466
|
+
declare const isJSONRPCRequest: (value: unknown) => value is JSONRPCRequest;
|
|
1467
|
+
declare const isJSONRPCNotification: (value: unknown) => value is JSONRPCNotification;
|
|
1468
|
+
/**
|
|
1469
|
+
* Checks if a value is a valid {@linkcode JSONRPCResultResponse}.
|
|
1470
|
+
* @param value - The value to check.
|
|
1471
|
+
*
|
|
1472
|
+
* @returns True if the value is a valid {@linkcode JSONRPCResultResponse}, false otherwise.
|
|
1473
|
+
*/
|
|
1474
|
+
declare const isJSONRPCResultResponse: (value: unknown) => value is JSONRPCResultResponse;
|
|
1475
|
+
/**
|
|
1476
|
+
* Checks if a value is a valid {@linkcode JSONRPCErrorResponse}.
|
|
1477
|
+
* @param value - The value to check.
|
|
1478
|
+
*
|
|
1479
|
+
* @returns True if the value is a valid {@linkcode JSONRPCErrorResponse}, false otherwise.
|
|
1480
|
+
*/
|
|
1481
|
+
declare const isJSONRPCErrorResponse: (value: unknown) => value is JSONRPCErrorResponse;
|
|
1482
|
+
/**
|
|
1483
|
+
* Checks if a value is a valid {@linkcode JSONRPCResponse} (either a result or error response).
|
|
1484
|
+
* @param value - The value to check.
|
|
1485
|
+
*
|
|
1486
|
+
* @returns True if the value is a valid {@linkcode JSONRPCResponse}, false otherwise.
|
|
1487
|
+
*/
|
|
1488
|
+
declare const isJSONRPCResponse: (value: unknown) => value is JSONRPCResponse;
|
|
1489
|
+
/**
|
|
1490
|
+
* Checks if a value is a valid {@linkcode CallToolResult}.
|
|
1491
|
+
*
|
|
1492
|
+
* This is a consumer-side VALUE check against the neutral model, not a wire
|
|
1493
|
+
* validator: a raw wire object that additionally carries wire-only members
|
|
1494
|
+
* (e.g. `resultType`) still passes through the loose index signature. Use a
|
|
1495
|
+
* transport-level parse to validate raw wire traffic.
|
|
1496
|
+
*
|
|
1497
|
+
* @param value - The value to check.
|
|
1498
|
+
*
|
|
1499
|
+
* @returns True if the value is a valid {@linkcode CallToolResult}, false otherwise.
|
|
1500
|
+
*/
|
|
1501
|
+
declare const isCallToolResult: (value: unknown) => value is CallToolResult;
|
|
1502
|
+
/**
|
|
1503
|
+
* Checks whether a value is an input-required result (protocol revision
|
|
1504
|
+
* 2026-07-28): the multi-round-trip return shape discriminated by
|
|
1505
|
+
* `resultType: 'input_required'`.
|
|
1506
|
+
*
|
|
1507
|
+
* This is a discriminator check, not a full validator — the at-least-one rule
|
|
1508
|
+
* (`inputRequests` or `requestState`) is enforced by the `inputRequired()`
|
|
1509
|
+
* builder and re-checked by the server seam for hand-built values.
|
|
1510
|
+
*
|
|
1511
|
+
* @param value - The value to check.
|
|
1512
|
+
* @returns True if the value carries the `input_required` discriminator.
|
|
1513
|
+
*/
|
|
1514
|
+
declare const isInputRequiredResult: (value: unknown) => value is InputRequiredResult;
|
|
1515
|
+
/**
|
|
1516
|
+
* Checks if a value is a valid {@linkcode TaskAugmentedRequestParams}.
|
|
1517
|
+
* @param value - The value to check.
|
|
1518
|
+
*
|
|
1519
|
+
* @returns True if the value is a valid {@linkcode TaskAugmentedRequestParams}, false otherwise.
|
|
1520
|
+
*
|
|
1521
|
+
* @deprecated Recognizes 2025-11-25 task wire vocabulary, which has no SDK
|
|
1522
|
+
* runtime; kept importable for interoperability only.
|
|
1523
|
+
*/
|
|
1524
|
+
declare const isTaskAugmentedRequestParams: (value: unknown) => value is TaskAugmentedRequestParams;
|
|
1525
|
+
declare const isInitializeRequest: (value: unknown) => value is InitializeRequest;
|
|
1526
|
+
declare const isInitializedNotification: (value: unknown) => value is InitializedNotification;
|
|
1527
|
+
declare function assertCompleteRequestPrompt(request: CompleteRequest): asserts request is CompleteRequestPrompt;
|
|
1528
|
+
declare function assertCompleteRequestResourceTemplate(request: CompleteRequest): asserts request is CompleteRequestResourceTemplate;
|
|
1529
|
+
//#endregion
|
|
1530
|
+
//#region ../core-internal/src/types/specTypeSchema.d.ts
|
|
1531
|
+
/**
|
|
1532
|
+
* Explicit allowlist of protocol Zod schemas that correspond to a public spec type in `types.ts`.
|
|
1533
|
+
*
|
|
1534
|
+
* This intentionally excludes internal helper schemas exported from `schemas.ts` that have no
|
|
1535
|
+
* matching public type (e.g. `ListChangedOptionsBaseSchema`, `BaseRequestParamsSchema`,
|
|
1536
|
+
* `NotificationsParamsSchema`, `ClientTasksCapabilitySchema`, `ServerTasksCapabilitySchema`).
|
|
1537
|
+
* Keeping the list explicit means new public spec types must be added here deliberately, and
|
|
1538
|
+
* internals never leak into `SpecTypeName`.
|
|
1539
|
+
*
|
|
1540
|
+
* `ResourceTemplateSchema` is included; its public type is exported as `ResourceTemplateType`
|
|
1541
|
+
* (the bare name collides with the server package's `ResourceTemplate` class), so
|
|
1542
|
+
* `SpecTypes['ResourceTemplate']` is structurally equal to `ResourceTemplateType` rather than to
|
|
1543
|
+
* a type literally named `ResourceTemplate`.
|
|
1544
|
+
*/
|
|
1545
|
+
declare const SPEC_SCHEMA_KEYS: readonly ["AnnotationsSchema", "AudioContentSchema", "BaseMetadataSchema", "BlobResourceContentsSchema", "BooleanSchemaSchema", "CallToolRequestSchema", "CallToolRequestParamsSchema", "CallToolResultSchema", "CancelledNotificationSchema", "CancelledNotificationParamsSchema", "CancelTaskRequestSchema", "CancelTaskResultSchema", "ClientCapabilitiesSchema", "ClientNotificationSchema", "ClientRequestSchema", "ClientResultSchema", "CompatibilityCallToolResultSchema", "CompleteRequestSchema", "CompleteRequestParamsSchema", "CompleteResultSchema", "ContentBlockSchema", "CreateMessageRequestSchema", "CreateMessageRequestParamsSchema", "CreateMessageResultSchema", "CreateMessageResultWithToolsSchema", "CreateTaskResultSchema", "CursorSchema", "DiscoverRequestSchema", "DiscoverResultSchema", "ElicitationCompleteNotificationSchema", "ElicitationCompleteNotificationParamsSchema", "ElicitRequestSchema", "ElicitRequestFormParamsSchema", "ElicitRequestParamsSchema", "ElicitRequestURLParamsSchema", "ElicitResultSchema", "EmbeddedResourceSchema", "EmptyResultSchema", "EnumSchemaSchema", "GetPromptRequestSchema", "GetPromptRequestParamsSchema", "GetPromptResultSchema", "GetTaskPayloadRequestSchema", "GetTaskPayloadResultSchema", "GetTaskRequestSchema", "GetTaskResultSchema", "IconSchema", "IconsSchema", "ImageContentSchema", "ImplementationSchema", "InitializedNotificationSchema", "InitializeRequestSchema", "InitializeRequestParamsSchema", "InitializeResultSchema", "JSONArraySchema", "JSONObjectSchema", "JSONRPCErrorResponseSchema", "JSONRPCMessageSchema", "JSONRPCNotificationSchema", "JSONRPCRequestSchema", "JSONRPCResponseSchema", "JSONRPCResultResponseSchema", "JSONValueSchema", "LegacyTitledEnumSchemaSchema", "ListPromptsRequestSchema", "ListPromptsResultSchema", "ListResourcesRequestSchema", "ListResourcesResultSchema", "ListResourceTemplatesRequestSchema", "ListResourceTemplatesResultSchema", "ListRootsRequestSchema", "ListRootsResultSchema", "ListTasksRequestSchema", "ListTasksResultSchema", "ListToolsRequestSchema", "ListToolsResultSchema", "LoggingLevelSchema", "LoggingMessageNotificationSchema", "LoggingMessageNotificationParamsSchema", "ModelHintSchema", "ModelPreferencesSchema", "MultiSelectEnumSchemaSchema", "NotificationSchema", "NumberSchemaSchema", "PaginatedRequestSchema", "PaginatedRequestParamsSchema", "PaginatedResultSchema", "PingRequestSchema", "PrimitiveSchemaDefinitionSchema", "ProgressSchema", "ProgressNotificationSchema", "ProgressNotificationParamsSchema", "ProgressTokenSchema", "PromptSchema", "PromptArgumentSchema", "PromptListChangedNotificationSchema", "PromptMessageSchema", "PromptReferenceSchema", "ReadResourceRequestSchema", "ReadResourceRequestParamsSchema", "ReadResourceResultSchema", "RelatedTaskMetadataSchema", "RequestSchema", "RequestIdSchema", "RequestMetaSchema", "ResourceSchema", "ResourceContentsSchema", "ResourceLinkSchema", "ResourceListChangedNotificationSchema", "ResourceRequestParamsSchema", "ResourceTemplateSchema", "ResourceTemplateReferenceSchema", "ResourceUpdatedNotificationSchema", "ResourceUpdatedNotificationParamsSchema", "ResultMetaObjectSchema", "ResultSchema", "RoleSchema", "RootSchema", "RootsListChangedNotificationSchema", "SamplingContentSchema", "SamplingMessageSchema", "SamplingMessageContentBlockSchema", "ServerCapabilitiesSchema", "ServerNotificationSchema", "ServerRequestSchema", "ServerResultSchema", "SetLevelRequestSchema", "SetLevelRequestParamsSchema", "SingleSelectEnumSchemaSchema", "StringSchemaSchema", "SubscribeRequestSchema", "SubscribeRequestParamsSchema", "SubscriptionFilterSchema", "SubscriptionsAcknowledgedNotificationSchema", "SubscriptionsAcknowledgedNotificationParamsSchema", "SubscriptionsListenRequestSchema", "SubscriptionsListenRequestParamsSchema", "SubscriptionsListenResultSchema", "SubscriptionsListenResultMetaSchema", "TaskAugmentedRequestParamsSchema", "TaskCreationParamsSchema", "TaskMetadataSchema", "TaskSchema", "TaskStatusSchema", "TaskStatusNotificationSchema", "TaskStatusNotificationParamsSchema", "TextContentSchema", "TextResourceContentsSchema", "TitledMultiSelectEnumSchemaSchema", "TitledSingleSelectEnumSchemaSchema", "ToolSchema", "ToolAnnotationsSchema", "ToolChoiceSchema", "ToolExecutionSchema", "ToolListChangedNotificationSchema", "ToolResultContentSchema", "ToolUseContentSchema", "UnsubscribeRequestSchema", "UnsubscribeRequestParamsSchema", "UntitledMultiSelectEnumSchemaSchema", "UntitledSingleSelectEnumSchemaSchema"];
|
|
1546
|
+
declare const authSchemas: {
|
|
1547
|
+
readonly IdJagTokenExchangeResponseSchema: any;
|
|
1548
|
+
readonly OAuthClientInformationFullSchema: any;
|
|
1549
|
+
readonly OAuthClientInformationSchema: any;
|
|
1550
|
+
readonly OAuthClientMetadataSchema: any;
|
|
1551
|
+
readonly OAuthClientRegistrationErrorSchema: any;
|
|
1552
|
+
readonly OAuthErrorResponseSchema: any;
|
|
1553
|
+
readonly OAuthMetadataSchema: any;
|
|
1554
|
+
readonly OAuthProtectedResourceMetadataSchema: any;
|
|
1555
|
+
readonly OAuthTokenRevocationRequestSchema: any;
|
|
1556
|
+
readonly OAuthTokensSchema: any;
|
|
1557
|
+
readonly OpenIdProviderDiscoveryMetadataSchema: any;
|
|
1558
|
+
readonly OpenIdProviderMetadataSchema: any;
|
|
1559
|
+
};
|
|
1560
|
+
type ProtocolSchemaKey = (typeof SPEC_SCHEMA_KEYS)[number];
|
|
1561
|
+
type AuthSchemaKey = keyof typeof authSchemas;
|
|
1562
|
+
type SchemaKey = ProtocolSchemaKey | AuthSchemaKey;
|
|
1563
|
+
type SchemaFor<K$1 extends SchemaKey> = K$1 extends ProtocolSchemaKey ? (typeof schemas_d_exports)[K$1] : K$1 extends AuthSchemaKey ? (typeof authSchemas)[K$1] : never;
|
|
1564
|
+
type StripSchemaSuffix<K$1> = K$1 extends `${infer N}Schema` ? N : never;
|
|
1565
|
+
/**
|
|
1566
|
+
* Union of every named type in the SDK's protocol and OAuth schemas (e.g. `'CallToolResult'`,
|
|
1567
|
+
* `'ContentBlock'`, `'Tool'`, `'OAuthTokens'`). Derived from the internal Zod schemas, so it stays
|
|
1568
|
+
* in sync with the spec.
|
|
1569
|
+
*/
|
|
1570
|
+
type SpecTypeName = StripSchemaSuffix<SchemaKey>;
|
|
1571
|
+
/**
|
|
1572
|
+
* Maps each {@linkcode SpecTypeName} to its TypeScript type.
|
|
1573
|
+
*
|
|
1574
|
+
* `SpecTypes['Tool']` is equivalent to importing the `Tool` type directly.
|
|
1575
|
+
* These validators cover the NEUTRAL model — the consumer-facing shapes with
|
|
1576
|
+
* no wire-only members (`resultType`, the reserved `_meta` envelope keys).
|
|
1577
|
+
* Per-revision WIRE validators are deliberately not public surface; they are
|
|
1578
|
+
* planned to return as versioned `zod-schemas/<revision>` exports for
|
|
1579
|
+
* consumers who validate raw wire traffic themselves.
|
|
1580
|
+
*/
|
|
1581
|
+
type SpecTypes = { [K in SchemaKey as StripSchemaSuffix<K>]: SchemaFor<K> extends z.ZodType ? z.output<SchemaFor<K>> : never };
|
|
1582
|
+
/**
|
|
1583
|
+
* Input shape for each {@linkcode SpecTypeName}. For most types this equals {@linkcode SpecTypes},
|
|
1584
|
+
* but a few schemas apply defaults/preprocessing, so the accepted input may be looser than the
|
|
1585
|
+
* resulting output type.
|
|
1586
|
+
*/
|
|
1587
|
+
type SpecTypeInputs = { [K in SchemaKey as StripSchemaSuffix<K>]: SchemaFor<K> extends z.ZodType ? z.input<SchemaFor<K>> : never };
|
|
1588
|
+
type SchemaRecord = { readonly [K in SpecTypeName]: StandardSchemaV1Sync<SpecTypeInputs[K], SpecTypes[K]> };
|
|
1589
|
+
type GuardRecord = { readonly [K in SpecTypeName]: (value: unknown) => value is SpecTypeInputs[K] };
|
|
1590
|
+
/**
|
|
1591
|
+
* Runtime validators for every MCP spec type, keyed by type name.
|
|
1592
|
+
*
|
|
1593
|
+
* Use this when you need to validate a spec-defined shape at a boundary the SDK does not own, for
|
|
1594
|
+
* example an extension's custom-method payload that embeds a `CallToolResult`, or a value read from
|
|
1595
|
+
* storage that should be a `Tool`.
|
|
1596
|
+
*
|
|
1597
|
+
* Each entry implements the Standard Schema interface, so it composes with any
|
|
1598
|
+
* Standard-Schema-aware library. For a simple boolean check, use {@linkcode isSpecType} instead.
|
|
1599
|
+
*
|
|
1600
|
+
* @example
|
|
1601
|
+
* ```ts source="./specTypeSchema.examples.ts#specTypeSchemas_basicUsage"
|
|
1602
|
+
* const result = specTypeSchemas.CallToolResult['~standard'].validate(untrusted);
|
|
1603
|
+
* if (result.issues === undefined) {
|
|
1604
|
+
* // result.value is CallToolResult
|
|
1605
|
+
* }
|
|
1606
|
+
* ```
|
|
1607
|
+
*/
|
|
1608
|
+
declare const specTypeSchemas: SchemaRecord;
|
|
1609
|
+
/**
|
|
1610
|
+
* Type predicates for every MCP spec type, keyed by type name.
|
|
1611
|
+
*
|
|
1612
|
+
* Returns `true` if the value satisfies the schema's input type (`z.input<>`, before defaults and
|
|
1613
|
+
* transforms are applied), and narrows to that input type. For schemas with `.default()` or
|
|
1614
|
+
* `.preprocess()`, this may accept values that do not structurally match the named output type;
|
|
1615
|
+
* for example `isSpecType.CallToolResult({})` is `true` because `content` has a default. Use
|
|
1616
|
+
* `specTypeSchemas.X['~standard'].validate(value)` when you need the validated output value.
|
|
1617
|
+
*
|
|
1618
|
+
* Each guard is a standalone function, so it can be passed directly as a callback.
|
|
1619
|
+
*
|
|
1620
|
+
* @example
|
|
1621
|
+
* ```ts source="./specTypeSchema.examples.ts#isSpecType_basicUsage"
|
|
1622
|
+
* if (isSpecType.ContentBlock(value)) {
|
|
1623
|
+
* // value is ContentBlock
|
|
1624
|
+
* }
|
|
1625
|
+
*
|
|
1626
|
+
* const blocks = mixed.filter(isSpecType.ContentBlock);
|
|
1627
|
+
* ```
|
|
1628
|
+
*/
|
|
1629
|
+
declare const isSpecType: GuardRecord;
|
|
1630
|
+
//#endregion
|
|
1631
|
+
//#region ../core-internal/src/shared/transport.d.ts
|
|
1632
|
+
type FetchLike = (url: string | URL, init?: RequestInit) => Promise<Response>;
|
|
1633
|
+
/**
|
|
1634
|
+
* Creates a fetch function that includes base `RequestInit` options.
|
|
1635
|
+
* This ensures requests inherit settings like credentials, mode, headers, etc. from the base init.
|
|
1636
|
+
*
|
|
1637
|
+
* @param baseFetch - The base fetch function to wrap (defaults to global `fetch`)
|
|
1638
|
+
* @param baseInit - The base `RequestInit` to merge with each request
|
|
1639
|
+
* @returns A wrapped fetch function that merges base options with call-specific options
|
|
1640
|
+
*/
|
|
1641
|
+
declare function createFetchWithInit(baseFetch?: FetchLike, baseInit?: RequestInit): FetchLike;
|
|
1642
|
+
/**
|
|
1643
|
+
* Options for sending a JSON-RPC message.
|
|
1644
|
+
*/
|
|
1645
|
+
type TransportSendOptions = {
|
|
1646
|
+
/**
|
|
1647
|
+
* If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with.
|
|
1648
|
+
*/
|
|
1649
|
+
relatedRequestId?: RequestId | undefined;
|
|
1650
|
+
/**
|
|
1651
|
+
* The resumption token used to continue long-running requests that were interrupted.
|
|
1652
|
+
*
|
|
1653
|
+
* This allows clients to reconnect and continue from where they left off, if supported by the transport.
|
|
1654
|
+
*/
|
|
1655
|
+
resumptionToken?: string | undefined;
|
|
1656
|
+
/**
|
|
1657
|
+
* A callback that is invoked when the resumption token changes, if supported by the transport.
|
|
1658
|
+
*
|
|
1659
|
+
* This allows clients to persist the latest token for potential reconnection.
|
|
1660
|
+
*/
|
|
1661
|
+
onresumptiontoken?: ((token: string) => void) | undefined;
|
|
1662
|
+
/**
|
|
1663
|
+
* An abort signal for THIS outbound message's underlying request, when the
|
|
1664
|
+
* transport sends one outbound message per underlying request (the
|
|
1665
|
+
* Streamable HTTP transport's POST-per-request model). Aborting it cancels
|
|
1666
|
+
* the underlying request (and its SSE response stream) without closing the
|
|
1667
|
+
* transport. Transports that share a single channel (stdio, in-memory)
|
|
1668
|
+
* ignore it.
|
|
1669
|
+
*/
|
|
1670
|
+
requestSignal?: AbortSignal | undefined;
|
|
1671
|
+
/**
|
|
1672
|
+
* Fired by transports that open a per-request stream (the Streamable HTTP
|
|
1673
|
+
* transport's POST-per-request SSE response) when that stream ends or
|
|
1674
|
+
* errors for any reason OTHER than a deliberate `requestSignal` abort —
|
|
1675
|
+
* i.e. the server closed the stream, the network dropped it, or
|
|
1676
|
+
* reconnection was exhausted. Transports that share a single channel
|
|
1677
|
+
* (stdio, in-memory) ignore it.
|
|
1678
|
+
*/
|
|
1679
|
+
onRequestStreamEnd?: (() => void) | undefined;
|
|
1680
|
+
/**
|
|
1681
|
+
* Additional HTTP headers to send with THIS outbound message, when the
|
|
1682
|
+
* transport sends one outbound message per underlying HTTP request (the
|
|
1683
|
+
* Streamable HTTP transport's POST-per-request model). Transports that
|
|
1684
|
+
* share a single channel (stdio, in-memory) ignore it.
|
|
1685
|
+
*
|
|
1686
|
+
* The Client uses this to attach SEP-2243 `Mcp-Param-{Name}` headers to a
|
|
1687
|
+
* `tools/call` request on a 2026-07-28 connection. Values are sent
|
|
1688
|
+
* verbatim — encode anything that is not a safe RFC 9110 field value
|
|
1689
|
+
* before passing it here.
|
|
1690
|
+
*/
|
|
1691
|
+
headers?: Readonly<Record<string, string>> | undefined;
|
|
1692
|
+
};
|
|
1693
|
+
/**
|
|
1694
|
+
* Describes the minimal contract for an MCP transport that a client or server can communicate over.
|
|
1695
|
+
*/
|
|
1696
|
+
interface Transport {
|
|
1697
|
+
/**
|
|
1698
|
+
* Starts processing messages on the transport, including any connection steps that might need to be taken.
|
|
1699
|
+
*
|
|
1700
|
+
* This method should only be called after callbacks are installed, or else messages may be lost.
|
|
1701
|
+
*
|
|
1702
|
+
* NOTE: This method should not be called explicitly when using {@linkcode @modelcontextprotocol/client!client/client.Client | Client} or {@linkcode @modelcontextprotocol/server!server/server.Server | Server} classes, as they will implicitly call {@linkcode Transport.start | start()}.
|
|
1703
|
+
*/
|
|
1704
|
+
start(): Promise<void>;
|
|
1705
|
+
/**
|
|
1706
|
+
* Sends a JSON-RPC message (request or response).
|
|
1707
|
+
*
|
|
1708
|
+
* If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with.
|
|
1709
|
+
*/
|
|
1710
|
+
send(message: JSONRPCMessage, options?: TransportSendOptions): Promise<void>;
|
|
1711
|
+
/**
|
|
1712
|
+
* Closes the connection.
|
|
1713
|
+
*/
|
|
1714
|
+
close(): Promise<void>;
|
|
1715
|
+
/**
|
|
1716
|
+
* `true` when this transport opens one underlying request per outbound
|
|
1717
|
+
* JSON-RPC request (the Streamable HTTP POST-per-request model) and
|
|
1718
|
+
* therefore honors {@linkcode TransportSendOptions.requestSignal}. The
|
|
1719
|
+
* 2026-07-28 spec makes closing that per-request stream the cancellation
|
|
1720
|
+
* signal — the protocol layer aborts `requestSignal` instead of POSTing
|
|
1721
|
+
* `notifications/cancelled` when this flag is set on a 2026-era
|
|
1722
|
+
* connection. Transports that share a single channel (stdio, in-memory)
|
|
1723
|
+
* leave it `undefined`.
|
|
1724
|
+
*/
|
|
1725
|
+
readonly hasPerRequestStream?: boolean;
|
|
1726
|
+
/**
|
|
1727
|
+
* Callback for when the connection is closed for any reason.
|
|
1728
|
+
*
|
|
1729
|
+
* This should be invoked when {@linkcode Transport.close | close()} is called as well.
|
|
1730
|
+
*/
|
|
1731
|
+
onclose?: (() => void) | undefined;
|
|
1732
|
+
/**
|
|
1733
|
+
* Callback for when an error occurs.
|
|
1734
|
+
*
|
|
1735
|
+
* Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
|
|
1736
|
+
*/
|
|
1737
|
+
onerror?: ((error: Error) => void) | undefined;
|
|
1738
|
+
/**
|
|
1739
|
+
* Callback for when a message (request or response) is received over the connection.
|
|
1740
|
+
*
|
|
1741
|
+
* Includes the {@linkcode MessageExtraInfo.request | request} and {@linkcode MessageExtraInfo.authInfo | authInfo} if the transport is authenticated.
|
|
1742
|
+
*
|
|
1743
|
+
* The {@linkcode MessageExtraInfo.request | request} can be used to get the original request information (headers, etc.)
|
|
1744
|
+
*/
|
|
1745
|
+
onmessage?: (<T$1 extends JSONRPCMessage>(message: T$1, extra?: MessageExtraInfo) => void) | undefined;
|
|
1746
|
+
/**
|
|
1747
|
+
* The session ID generated for this connection.
|
|
1748
|
+
*/
|
|
1749
|
+
sessionId?: string | undefined;
|
|
1750
|
+
/**
|
|
1751
|
+
* Sets the protocol version used for the connection (called when the initialize response is received).
|
|
1752
|
+
*/
|
|
1753
|
+
setProtocolVersion?: ((version: string) => void) | undefined;
|
|
1754
|
+
/**
|
|
1755
|
+
* Sets the supported protocol versions for header validation (called during connect).
|
|
1756
|
+
* This allows the server to pass its supported versions to the transport.
|
|
1757
|
+
*/
|
|
1758
|
+
setSupportedProtocolVersions?: ((versions: string[]) => void) | undefined;
|
|
1759
|
+
}
|
|
1760
|
+
//#endregion
|
|
1761
|
+
//#region ../core-internal/src/shared/protocol.d.ts
|
|
1762
|
+
/**
|
|
1763
|
+
* Callback for progress notifications.
|
|
1764
|
+
*/
|
|
1765
|
+
type ProgressCallback = (progress: Progress) => void;
|
|
1766
|
+
/**
|
|
1767
|
+
* Additional initialization options.
|
|
1768
|
+
*/
|
|
1769
|
+
type ProtocolOptions = {
|
|
1770
|
+
/**
|
|
1771
|
+
* Protocol versions supported. The legacy `initialize` handshake offers and
|
|
1772
|
+
* falls back to the first 2025-era entry in the list (the client sends it,
|
|
1773
|
+
* the server counter-offers it); 2026-era entries are only ever selected via
|
|
1774
|
+
* `server/discover`. Passed to transport during {@linkcode Protocol.connect | connect()}.
|
|
1775
|
+
*
|
|
1776
|
+
* @default {@linkcode SUPPORTED_PROTOCOL_VERSIONS}
|
|
1777
|
+
*/
|
|
1778
|
+
supportedProtocolVersions?: string[];
|
|
1779
|
+
/**
|
|
1780
|
+
* Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities.
|
|
1781
|
+
*
|
|
1782
|
+
* Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those.
|
|
1783
|
+
*
|
|
1784
|
+
* Currently this defaults to `false`, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to `true`.
|
|
1785
|
+
*/
|
|
1786
|
+
enforceStrictCapabilities?: boolean;
|
|
1787
|
+
/**
|
|
1788
|
+
* An array of notification method names that should be automatically debounced.
|
|
1789
|
+
* Any notifications with a method in this list will be coalesced if they
|
|
1790
|
+
* occur in the same tick of the event loop.
|
|
1791
|
+
* e.g., `['notifications/tools/list_changed']`
|
|
1792
|
+
*/
|
|
1793
|
+
debouncedNotificationMethods?: string[];
|
|
1794
|
+
};
|
|
1795
|
+
/**
|
|
1796
|
+
* The default request timeout, in milliseconds.
|
|
1797
|
+
*/
|
|
1798
|
+
declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
|
|
1799
|
+
/**
|
|
1800
|
+
* Options that can be given per request.
|
|
1801
|
+
*/
|
|
1802
|
+
type RequestOptions = {
|
|
1803
|
+
/**
|
|
1804
|
+
* If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked.
|
|
1805
|
+
*/
|
|
1806
|
+
onprogress?: ProgressCallback;
|
|
1807
|
+
/**
|
|
1808
|
+
* Can be used to cancel an in-flight request. This will cause an `AbortError` to be raised from {@linkcode Protocol.request | request()}.
|
|
1809
|
+
*/
|
|
1810
|
+
signal?: AbortSignal;
|
|
1811
|
+
/**
|
|
1812
|
+
* A timeout (in milliseconds) for this request. If exceeded, an {@linkcode SdkError} with code {@linkcode SdkErrorCode.RequestTimeout} will be raised from {@linkcode Protocol.request | request()}.
|
|
1813
|
+
*
|
|
1814
|
+
* If not specified, {@linkcode DEFAULT_REQUEST_TIMEOUT_MSEC} will be used as the timeout.
|
|
1815
|
+
*/
|
|
1816
|
+
timeout?: number;
|
|
1817
|
+
/**
|
|
1818
|
+
* If `true`, receiving a progress notification will reset the request timeout.
|
|
1819
|
+
* This is useful for long-running operations that send periodic progress updates.
|
|
1820
|
+
* Default: `false`
|
|
1821
|
+
*/
|
|
1822
|
+
resetTimeoutOnProgress?: boolean;
|
|
1823
|
+
/**
|
|
1824
|
+
* Maximum total time (in milliseconds) to wait for a response.
|
|
1825
|
+
* If exceeded, an {@linkcode SdkError} with code {@linkcode SdkErrorCode.RequestTimeout} will be raised, regardless of progress notifications.
|
|
1826
|
+
* If not specified, there is no maximum total timeout.
|
|
1827
|
+
*
|
|
1828
|
+
* For multi-round-trip requests fulfilled by the auto-fulfilment driver
|
|
1829
|
+
* (protocol revision 2026-07-28), the budget bounds the WHOLE flow: every
|
|
1830
|
+
* retry leg is given only the time remaining.
|
|
1831
|
+
*/
|
|
1832
|
+
maxTotalTimeout?: number;
|
|
1833
|
+
/**
|
|
1834
|
+
* Manual multi-round-trip mode for this call (protocol revision
|
|
1835
|
+
* 2026-07-28): when the response is an `input_required` result, hand it
|
|
1836
|
+
* back to the caller instead of auto-fulfilling it (or raising a typed
|
|
1837
|
+
* error). The resolved value is the neutral input-required shape
|
|
1838
|
+
* (`resultType: 'input_required'`, `inputRequests?`, `requestState?`);
|
|
1839
|
+
* wrap the result schema with `withInputRequired()` on the explicit
|
|
1840
|
+
* schema path to type both outcomes. The caller is then responsible for
|
|
1841
|
+
* gathering the requested input and retrying the original request with
|
|
1842
|
+
* `inputResponses` / `requestState` params and a fresh request.
|
|
1843
|
+
*
|
|
1844
|
+
* Default: `false`.
|
|
1845
|
+
*/
|
|
1846
|
+
allowInputRequired?: boolean;
|
|
1847
|
+
} & TransportSendOptions;
|
|
1848
|
+
/**
|
|
1849
|
+
* Flow context handed to {@linkcode Protocol._resolveNonCompleteResult}: the
|
|
1850
|
+
* originating request, its options, the wire codec that decoded the response,
|
|
1851
|
+
* the timestamp the originating leg was issued at (for whole-flow timeout
|
|
1852
|
+
* accounting), and a `retry` closure that re-enters the request funnel with
|
|
1853
|
+
* fresh params on a fresh request id.
|
|
1854
|
+
*/
|
|
1855
|
+
interface NonCompleteResultFlow<T$1 extends StandardSchemaV1 = StandardSchemaV1> {
|
|
1856
|
+
codec: WireCodec;
|
|
1857
|
+
request: Request;
|
|
1858
|
+
resultSchema: T$1;
|
|
1859
|
+
options: RequestOptions | undefined;
|
|
1860
|
+
flowStartedAt: number;
|
|
1861
|
+
/** Re-issue the originating request with the given params and per-leg options. */
|
|
1862
|
+
retry(params: Record<string, unknown> | undefined, legOptions: RequestOptions): Promise<unknown>;
|
|
1863
|
+
}
|
|
1864
|
+
/**
|
|
1865
|
+
* Options that can be given per notification.
|
|
1866
|
+
*/
|
|
1867
|
+
type NotificationOptions = {
|
|
1868
|
+
/**
|
|
1869
|
+
* May be used to indicate to the transport which incoming request to associate this outgoing notification with.
|
|
1870
|
+
*/
|
|
1871
|
+
relatedRequestId?: RequestId;
|
|
1872
|
+
};
|
|
1873
|
+
/**
|
|
1874
|
+
* The type of `ctx.mcpReq.requestState`. The type parameter is
|
|
1875
|
+
* caller-asserted (no validation, like the two-argument `acceptedContent<T>`)
|
|
1876
|
+
* — pair with `createRequestStateCodec<T>` so the claim is backed by the
|
|
1877
|
+
* codec's verification.
|
|
1878
|
+
*/
|
|
1879
|
+
type RequestStateAccessor = <T$1 = unknown>() => T$1 | undefined;
|
|
1880
|
+
/**
|
|
1881
|
+
* Base context provided to all request handlers.
|
|
1882
|
+
*/
|
|
1883
|
+
type BaseContext = {
|
|
1884
|
+
/**
|
|
1885
|
+
* The session ID from the transport, if available.
|
|
1886
|
+
*/
|
|
1887
|
+
sessionId?: string;
|
|
1888
|
+
/**
|
|
1889
|
+
* Information about the MCP request being handled.
|
|
1890
|
+
*/
|
|
1891
|
+
mcpReq: {
|
|
1892
|
+
/**
|
|
1893
|
+
* The JSON-RPC ID of the request being handled.
|
|
1894
|
+
*/
|
|
1895
|
+
id: RequestId;
|
|
1896
|
+
/**
|
|
1897
|
+
* The method name of the request (e.g., 'tools/call', 'ping').
|
|
1898
|
+
*/
|
|
1899
|
+
method: string;
|
|
1900
|
+
/**
|
|
1901
|
+
* Metadata from the original request, with the reserved
|
|
1902
|
+
* `io.modelcontextprotocol/*` envelope keys already lifted out
|
|
1903
|
+
* (readable via `ctx.mcpReq.envelope`).
|
|
1904
|
+
*/
|
|
1905
|
+
_meta?: RequestMeta;
|
|
1906
|
+
/**
|
|
1907
|
+
* The per-request `_meta` envelope (protocol revision 2026-07-28):
|
|
1908
|
+
* the reserved `io.modelcontextprotocol/*` keys carried by the
|
|
1909
|
+
* request, lifted out of the `_meta` the handler sees. Surfaced as
|
|
1910
|
+
* received — `Partial` because only the keys the request actually
|
|
1911
|
+
* carried are present (envelope requiredness is enforced per request
|
|
1912
|
+
* at dispatch time, not by the lift); only present at all when the
|
|
1913
|
+
* request carried envelope keys.
|
|
1914
|
+
*/
|
|
1915
|
+
envelope?: Partial<RequestMetaEnvelope>;
|
|
1916
|
+
/**
|
|
1917
|
+
* Multi-round-trip input responses carried by a retried request
|
|
1918
|
+
* (protocol revision 2026-07-28), lifted out of the params the
|
|
1919
|
+
* handler sees. Entries are the BARE response objects keyed by the
|
|
1920
|
+
* identifiers the server assigned in `inputRequests`; entries that do
|
|
1921
|
+
* not look like bare responses (e.g. a `{method, result}` wrapper)
|
|
1922
|
+
* are dropped and their keys recorded in `droppedInputResponseKeys`.
|
|
1923
|
+
*
|
|
1924
|
+
* The values arrive from the client and are NOT validated by the SDK
|
|
1925
|
+
* — treat them as untrusted input.
|
|
1926
|
+
*/
|
|
1927
|
+
inputResponses?: Record<string, unknown>;
|
|
1928
|
+
/**
|
|
1929
|
+
* Keys of `inputResponses` entries the SDK dropped because they were
|
|
1930
|
+
* not bare response objects (for example the wrapped `{method,
|
|
1931
|
+
* result}` shape some peers emit). Surfaced so a handler can re-issue
|
|
1932
|
+
* the corresponding input request rather than hard-fail.
|
|
1933
|
+
*/
|
|
1934
|
+
droppedInputResponseKeys?: string[];
|
|
1935
|
+
/**
|
|
1936
|
+
* Reads the multi-round-trip request state for the current round:
|
|
1937
|
+
* the value the configured `ServerOptions.requestState.verify` hook
|
|
1938
|
+
* resolved with (e.g. `createRequestStateCodec.verify`'s decoded
|
|
1939
|
+
* payload — `mint<T>`/`requestState<T>()` are the typed pair), the
|
|
1940
|
+
* raw wire string when no hook is configured, or `undefined` when
|
|
1941
|
+
* the round carried no state. The type parameter is a compile-time
|
|
1942
|
+
* cast only.
|
|
1943
|
+
*
|
|
1944
|
+
* SECURITY: `requestState` round-trips through the client and MUST
|
|
1945
|
+
* be treated as attacker-controlled input. The SDK applies no
|
|
1946
|
+
* integrity protection by default — servers whose state influences
|
|
1947
|
+
* authorization or business logic MUST integrity-protect it and
|
|
1948
|
+
* verify via the `requestState.verify` hook (spec:
|
|
1949
|
+
* basic/patterns/mrtr, server requirements 4–5).
|
|
1950
|
+
*/
|
|
1951
|
+
requestState: RequestStateAccessor;
|
|
1952
|
+
/**
|
|
1953
|
+
* An abort signal used to communicate if the request was cancelled from the sender's side.
|
|
1954
|
+
*/
|
|
1955
|
+
signal: AbortSignal;
|
|
1956
|
+
/**
|
|
1957
|
+
* Sends a request that relates to the current request being handled.
|
|
1958
|
+
*
|
|
1959
|
+
* This is used by certain transports to correctly associate related messages.
|
|
1960
|
+
*
|
|
1961
|
+
* For spec methods the result type is inferred from the method name.
|
|
1962
|
+
* For custom (non-spec) methods, pass a result schema as the second argument.
|
|
1963
|
+
*/
|
|
1964
|
+
send: {
|
|
1965
|
+
<M$1 extends RequestMethod>(request: {
|
|
1966
|
+
method: M$1;
|
|
1967
|
+
params?: Record<string, unknown>;
|
|
1968
|
+
}, options?: RequestOptions): Promise<ResultTypeMap[M$1]>;
|
|
1969
|
+
<T$1 extends StandardSchemaV1>(request: Request, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
|
|
1970
|
+
};
|
|
1971
|
+
/**
|
|
1972
|
+
* Sends a notification that relates to the current request being handled.
|
|
1973
|
+
*
|
|
1974
|
+
* This is used by certain transports to correctly associate related messages.
|
|
1975
|
+
*/
|
|
1976
|
+
notify: (notification: Notification) => Promise<void>;
|
|
1977
|
+
};
|
|
1978
|
+
/**
|
|
1979
|
+
* HTTP transport information, only available when using an HTTP-based transport.
|
|
1980
|
+
*/
|
|
1981
|
+
http?: {
|
|
1982
|
+
/**
|
|
1983
|
+
* Information about a validated access token, provided to request handlers.
|
|
1984
|
+
*/
|
|
1985
|
+
authInfo?: AuthInfo;
|
|
1986
|
+
};
|
|
1987
|
+
};
|
|
1988
|
+
/**
|
|
1989
|
+
* Context provided to server-side request handlers, extending {@linkcode BaseContext} with server-specific fields.
|
|
1990
|
+
*/
|
|
1991
|
+
type ServerContext = BaseContext & {
|
|
1992
|
+
mcpReq: {
|
|
1993
|
+
/**
|
|
1994
|
+
* Send a log message notification to the client.
|
|
1995
|
+
* Respects the client's log level filter set via logging/setLevel.
|
|
1996
|
+
*
|
|
1997
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
1998
|
+
* Remains functional during the deprecation window (at least twelve months).
|
|
1999
|
+
* Migrate to stderr logging (STDIO servers) or OpenTelemetry.
|
|
2000
|
+
*/
|
|
2001
|
+
log: (level: LoggingLevel, data: unknown, logger?: string) => Promise<void>;
|
|
2002
|
+
/**
|
|
2003
|
+
* Send an elicitation request to the client, requesting user input.
|
|
2004
|
+
*
|
|
2005
|
+
* @deprecated Throws on a 2026-07-28-era request — return `inputRequired(...)`
|
|
2006
|
+
* (multi-round-trip) from the handler instead. The 2025 push-style server-to-client request model is
|
|
2007
|
+
* replaced by input_required results in the 2026-07-28 protocol. If your factory serves
|
|
2008
|
+
* both eras, this only works on the legacy path.
|
|
2009
|
+
*/
|
|
2010
|
+
elicitInput: (params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions) => Promise<ElicitResult>;
|
|
2011
|
+
/**
|
|
2012
|
+
* Request LLM sampling from the client.
|
|
2013
|
+
*
|
|
2014
|
+
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
|
2015
|
+
* Throws on a 2026-07-28-era request — return `inputRequired(...)` (multi-round-trip)
|
|
2016
|
+
* from the handler instead, or migrate to calling LLM provider APIs directly. The 2025 push-style
|
|
2017
|
+
* server-to-client request model is replaced by input_required results in the 2026-07-28
|
|
2018
|
+
* protocol. If your factory serves both eras, this only works on the legacy path.
|
|
2019
|
+
*/
|
|
2020
|
+
requestSampling: (params: CreateMessageRequest['params'], options?: RequestOptions) => Promise<CreateMessageResult | CreateMessageResultWithTools>;
|
|
2021
|
+
};
|
|
2022
|
+
http?: {
|
|
2023
|
+
/**
|
|
2024
|
+
* The original HTTP request.
|
|
2025
|
+
*/
|
|
2026
|
+
req?: globalThis.Request;
|
|
2027
|
+
/**
|
|
2028
|
+
* Closes the SSE stream for this request, triggering client reconnection.
|
|
2029
|
+
* Only available when using a StreamableHTTPServerTransport with eventStore configured.
|
|
2030
|
+
*/
|
|
2031
|
+
closeSSE?: () => void;
|
|
2032
|
+
/**
|
|
2033
|
+
* Closes the standalone GET SSE stream, triggering client reconnection.
|
|
2034
|
+
* Only available when using a StreamableHTTPServerTransport with eventStore configured.
|
|
2035
|
+
*/
|
|
2036
|
+
closeStandaloneSSE?: () => void;
|
|
2037
|
+
};
|
|
2038
|
+
};
|
|
2039
|
+
/**
|
|
2040
|
+
* Context provided to client-side request handlers.
|
|
2041
|
+
*/
|
|
2042
|
+
type ClientContext = BaseContext;
|
|
2043
|
+
/**
|
|
2044
|
+
* Implements MCP protocol framing on top of a pluggable transport, including
|
|
2045
|
+
* features like request/response linking, notifications, and progress.
|
|
2046
|
+
*
|
|
2047
|
+
* `Protocol` is abstract; `Client` and `Server` are the concrete role-specific
|
|
2048
|
+
* implementations most code should use.
|
|
2049
|
+
*/
|
|
2050
|
+
declare abstract class Protocol<ContextT extends BaseContext> {
|
|
2051
|
+
private _options?;
|
|
2052
|
+
private _transport?;
|
|
2053
|
+
private _requestMessageId;
|
|
2054
|
+
private _requestHandlers;
|
|
2055
|
+
private _requestHandlerAbortControllers;
|
|
2056
|
+
private _notificationHandlers;
|
|
2057
|
+
private _responseHandlers;
|
|
2058
|
+
private _progressHandlers;
|
|
2059
|
+
private _timeoutInfo;
|
|
2060
|
+
private _pendingDebouncedNotifications;
|
|
2061
|
+
/**
|
|
2062
|
+
* The protocol version negotiated for the current connection (`undefined`
|
|
2063
|
+
* before negotiation completes), which determines the wire era this
|
|
2064
|
+
* instance speaks. Set by the SDK's negotiation and initialize paths
|
|
2065
|
+
* (`Client.connect`, `Server._oninitialize`).
|
|
2066
|
+
*/
|
|
2067
|
+
protected _negotiatedProtocolVersion?: string;
|
|
2068
|
+
protected _supportedProtocolVersions: string[];
|
|
2069
|
+
/**
|
|
2070
|
+
* Callback for when the connection is closed for any reason.
|
|
2071
|
+
*
|
|
2072
|
+
* This is invoked when {@linkcode Protocol.close | close()} is called as well.
|
|
2073
|
+
*/
|
|
2074
|
+
onclose?: () => void;
|
|
2075
|
+
/**
|
|
2076
|
+
* Callback for when an error occurs.
|
|
2077
|
+
*
|
|
2078
|
+
* Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
|
|
2079
|
+
*/
|
|
2080
|
+
onerror?: (error: Error) => void;
|
|
2081
|
+
/**
|
|
2082
|
+
* A handler to invoke for any request types that do not have their own handler installed.
|
|
2083
|
+
*/
|
|
2084
|
+
fallbackRequestHandler?: (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>;
|
|
2085
|
+
/**
|
|
2086
|
+
* A handler to invoke for any notification types that do not have their own handler installed.
|
|
2087
|
+
*/
|
|
2088
|
+
fallbackNotificationHandler?: (notification: Notification) => Promise<void>;
|
|
2089
|
+
constructor(_options?: ProtocolOptions | undefined);
|
|
2090
|
+
/**
|
|
2091
|
+
* Builds the context object for request handlers. Subclasses must override
|
|
2092
|
+
* to return the appropriate context type (e.g., ServerContext adds HTTP request info).
|
|
2093
|
+
*/
|
|
2094
|
+
protected abstract buildContext(ctx: BaseContext, transportInfo?: MessageExtraInfo): ContextT;
|
|
2095
|
+
/**
|
|
2096
|
+
* Drop consult for inbound messages whose transport did not classify them
|
|
2097
|
+
* at the edge — long-lived channels such as stdio, where a role class may
|
|
2098
|
+
* need to decline traffic the negotiated era has no answer for (the
|
|
2099
|
+
* client-side inbound-request drop on modern-era connections: the
|
|
2100
|
+
* 2026-07-28 era has no server→client request channel, and on stdio the
|
|
2101
|
+
* client must never write JSON-RPC responses).
|
|
2102
|
+
*
|
|
2103
|
+
* Consulted ONLY when the transport supplied no
|
|
2104
|
+
* {@linkcode MessageExtraInfo.classification}: edge-classified traffic
|
|
2105
|
+
* never reaches the hook. Returning `'drop'` discards the message without
|
|
2106
|
+
* writing any response (requests are surfaced via `onerror`). The base
|
|
2107
|
+
* implementation returns `undefined`: unclassified traffic keeps today's
|
|
2108
|
+
* dispatch path unchanged. Era selection never happens here — era is
|
|
2109
|
+
* instance state, owned by the serving entry that constructed and
|
|
2110
|
+
* connected the instance.
|
|
2111
|
+
*/
|
|
2112
|
+
protected _shouldDropInbound(_message: JSONRPCRequest | JSONRPCNotification): 'drop' | undefined;
|
|
2113
|
+
/**
|
|
2114
|
+
* The per-request `_meta` envelope this instance attaches to every outgoing
|
|
2115
|
+
* request and notification, when one applies. The base implementation
|
|
2116
|
+
* returns `undefined` (no envelope — the 2025-era posture, so legacy-era
|
|
2117
|
+
* outbound traffic is byte-identical to a build without this seam).
|
|
2118
|
+
* `Client` overrides it on a connection that negotiated a modern (2026-07-28+)
|
|
2119
|
+
* era to return the reserved protocol-version / client-info /
|
|
2120
|
+
* client-capabilities keys. User-supplied `_meta` keys take precedence over
|
|
2121
|
+
* the auto-attached ones.
|
|
2122
|
+
*/
|
|
2123
|
+
protected _outboundMetaEnvelope(): Readonly<Record<string, unknown>> | undefined;
|
|
2124
|
+
/**
|
|
2125
|
+
* Attach this instance's outbound `_meta` envelope (when one is configured)
|
|
2126
|
+
* to a request or notification. A no-op when the seam returns `undefined`
|
|
2127
|
+
* — the message returns by reference, so the legacy-era wire stays
|
|
2128
|
+
* byte-identical. User-supplied `_meta` keys are spread last so they win
|
|
2129
|
+
* over the auto-attached envelope keys.
|
|
2130
|
+
*/
|
|
2131
|
+
private _envelopeOutbound;
|
|
2132
|
+
/**
|
|
2133
|
+
* Extension point for non-`complete` decoded results in the response
|
|
2134
|
+
* funnel: a result the wire codec discriminated into a kind other than
|
|
2135
|
+
* `'complete'` or `'invalid'` is handed here for the role class to
|
|
2136
|
+
* resolve. The base default surfaces it as a typed
|
|
2137
|
+
* {@linkcode SdkErrorCode.UnsupportedResultType} error (no retry).
|
|
2138
|
+
*
|
|
2139
|
+
* Intended consumers (named so the seam stays accountable):
|
|
2140
|
+
* - the `Client`'s multi-round-trip auto-fulfilment engine, which fulfils
|
|
2141
|
+
* `'input_required'` results through the registered
|
|
2142
|
+
* elicitation/sampling/roots handlers and retries via `flow.retry`;
|
|
2143
|
+
* - a future client-side terminal-result handler for
|
|
2144
|
+
* `subscriptions/listen`, when the spec defines one.
|
|
2145
|
+
*
|
|
2146
|
+
* `Server` instances never receive `input_required` responses on their
|
|
2147
|
+
* outbound legs and leave the base behavior in place.
|
|
2148
|
+
*/
|
|
2149
|
+
protected _resolveNonCompleteResult<T$1 extends StandardSchemaV1>(decoded: ReturnType<WireCodec['decodeResult']> & {
|
|
2150
|
+
kind: 'input_required';
|
|
2151
|
+
}, flow: NonCompleteResultFlow<T$1>): Promise<unknown>;
|
|
2152
|
+
/**
|
|
2153
|
+
* Protected accessor for a registered request handler. Used by role
|
|
2154
|
+
* classes that dispatch synthesized requests through the same stored
|
|
2155
|
+
* handler chain (e.g. the `Client` fulfilling an embedded multi-round-trip
|
|
2156
|
+
* input request).
|
|
2157
|
+
*/
|
|
2158
|
+
protected _getRequestHandler(method: string): ((request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>) | undefined;
|
|
2159
|
+
private _oncancel;
|
|
2160
|
+
private _setupTimeout;
|
|
2161
|
+
private _resetTimeout;
|
|
2162
|
+
private _cleanupTimeout;
|
|
2163
|
+
/**
|
|
2164
|
+
* Attaches to the given transport, starts it, and starts listening for messages.
|
|
2165
|
+
*
|
|
2166
|
+
* The caller assumes ownership of the {@linkcode Transport}, replacing any callbacks that have already been set, and expects that it is the only user of the {@linkcode Transport} instance going forward.
|
|
2167
|
+
*/
|
|
2168
|
+
connect(transport: Transport): Promise<void>;
|
|
2169
|
+
/**
|
|
2170
|
+
* Transport-close hook. Subclass overrides MUST call `super._onclose()`
|
|
2171
|
+
* after their own cleanup — base teardown (response-handler settlement,
|
|
2172
|
+
* timeout clearing, in-flight request abort) does not run otherwise.
|
|
2173
|
+
*/
|
|
2174
|
+
protected _onclose(): void;
|
|
2175
|
+
private _onerror;
|
|
2176
|
+
/**
|
|
2177
|
+
* Inbound-notification dispatch. Subclass overrides MUST delegate
|
|
2178
|
+
* unmatched traffic to `super._onnotification(rawNotification, extra)` —
|
|
2179
|
+
* an override that consumes only what it owns and falls through to base
|
|
2180
|
+
* dispatch for everything else.
|
|
2181
|
+
*/
|
|
2182
|
+
protected _onnotification(rawNotification: JSONRPCNotification, extra?: MessageExtraInfo): void;
|
|
2183
|
+
private _onrequest;
|
|
2184
|
+
private _onprogress;
|
|
2185
|
+
/**
|
|
2186
|
+
* Inbound-response dispatch. Subclass overrides MUST delegate unmatched
|
|
2187
|
+
* traffic to `super._onresponse(response)` — an override that consumes
|
|
2188
|
+
* only what it owns and falls through to base dispatch for everything
|
|
2189
|
+
* else.
|
|
2190
|
+
*/
|
|
2191
|
+
protected _onresponse(response: JSONRPCResponse | JSONRPCErrorResponse): void;
|
|
2192
|
+
get transport(): Transport | undefined;
|
|
2193
|
+
/**
|
|
2194
|
+
* Closes the connection.
|
|
2195
|
+
*/
|
|
2196
|
+
close(): Promise<void>;
|
|
2197
|
+
/**
|
|
2198
|
+
* A method to check if a capability is supported by the remote side, for the given method to be called.
|
|
2199
|
+
*
|
|
2200
|
+
* This should be implemented by subclasses.
|
|
2201
|
+
*/
|
|
2202
|
+
protected abstract assertCapabilityForMethod(method: RequestMethod | string): void;
|
|
2203
|
+
/**
|
|
2204
|
+
* A method to check if a notification is supported by the local side, for the given method to be sent.
|
|
2205
|
+
*
|
|
2206
|
+
* This should be implemented by subclasses.
|
|
2207
|
+
*/
|
|
2208
|
+
protected abstract assertNotificationCapability(method: NotificationMethod | string): void;
|
|
2209
|
+
/**
|
|
2210
|
+
* A method to check if a request handler is supported by the local side, for the given method to be handled.
|
|
2211
|
+
*
|
|
2212
|
+
* This should be implemented by subclasses.
|
|
2213
|
+
*/
|
|
2214
|
+
protected abstract assertRequestHandlerCapability(method: string): void;
|
|
2215
|
+
/**
|
|
2216
|
+
* Sends a request and waits for a response.
|
|
2217
|
+
*
|
|
2218
|
+
* For spec methods the result schema is resolved automatically from the method name
|
|
2219
|
+
* and the return type is method-keyed. For custom (non-spec) methods, pass a
|
|
2220
|
+
* `resultSchema` as the second argument; the response is validated against it and
|
|
2221
|
+
* the return type is inferred from the schema.
|
|
2222
|
+
*
|
|
2223
|
+
* Do not use this method to emit notifications! Use {@linkcode Protocol.notification | notification()} instead.
|
|
2224
|
+
*/
|
|
2225
|
+
request<M$1 extends RequestMethod>(request: {
|
|
2226
|
+
method: M$1;
|
|
2227
|
+
params?: Record<string, unknown>;
|
|
2228
|
+
}, options?: RequestOptions): Promise<ResultTypeMap[M$1]>;
|
|
2229
|
+
request<T$1 extends StandardSchemaV1>(request: Request, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
|
|
2230
|
+
/**
|
|
2231
|
+
* The wire codec for this instance's negotiated era — the phase-2 truth:
|
|
2232
|
+
* everything an established connection sends and receives resolves
|
|
2233
|
+
* through it. Legacy until a version has been negotiated.
|
|
2234
|
+
*/
|
|
2235
|
+
private _negotiatedWireCodec;
|
|
2236
|
+
/**
|
|
2237
|
+
* Protected accessor for the instance's negotiated wire codec, for role
|
|
2238
|
+
* classes (Client/Server/McpServer) routing era-dependent behavior
|
|
2239
|
+
* through the codec's function-only surface — `samplingResultVariant`,
|
|
2240
|
+
* `outboundEnvelope`, `projectCallToolResult` — instead of branching on
|
|
2241
|
+
* the protocol version themselves.
|
|
2242
|
+
*/
|
|
2243
|
+
protected _wireCodec(): WireCodec;
|
|
2244
|
+
/**
|
|
2245
|
+
* Outbound codec resolution: while the negotiated version is still unset
|
|
2246
|
+
* (the negotiation window), lifecycle messages are bootstrap-pinned BY
|
|
2247
|
+
* METHOD — they self-identify their era (`initialize` IS the legacy
|
|
2248
|
+
* handshake, `server/discover` IS the modern probe). Once a version has
|
|
2249
|
+
* been negotiated, the instance era is authoritative for everything — a
|
|
2250
|
+
* negotiated session never re-routes a method onto the other era.
|
|
2251
|
+
*/
|
|
2252
|
+
private _resolveOutboundCodec;
|
|
2253
|
+
/**
|
|
2254
|
+
* Era gate for outbound requests — deletions are physical in BOTH
|
|
2255
|
+
* directions: sending a spec method that the resolved era does not define
|
|
2256
|
+
* dies locally with a typed error before anything reaches the transport.
|
|
2257
|
+
* Methods outside the spec universe are consumer-owned extension methods
|
|
2258
|
+
* and stay era-blind.
|
|
2259
|
+
*/
|
|
2260
|
+
private _assertOutboundRequestInEra;
|
|
2261
|
+
/**
|
|
2262
|
+
* Sends a request and waits for a response, using the provided schema for
|
|
2263
|
+
* validation instead of the era registry's method-keyed entry.
|
|
2264
|
+
*
|
|
2265
|
+
* This is the internal implementation used by SDK methods whose result
|
|
2266
|
+
* schema cannot be expressed as a method-keyed registry entry — the one
|
|
2267
|
+
* surviving case is `server.createMessage`, whose result schema depends
|
|
2268
|
+
* on the REQUEST params (tools vs no tools) — and by callers passing
|
|
2269
|
+
* explicit compatibility schemas. Spec methods are still era-gated here:
|
|
2270
|
+
* an explicit schema never smuggles a deleted method onto the wire.
|
|
2271
|
+
*/
|
|
2272
|
+
protected _requestWithSchema<T$1 extends StandardSchemaV1>(request: Request, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
|
|
2273
|
+
/**
|
|
2274
|
+
* The request funnel proper, keyed by the resolved era codec: the codec
|
|
2275
|
+
* owns result decoding (raw-first `resultType` discrimination — V-1 —
|
|
2276
|
+
* and the era's lift posture) before the schema validation step.
|
|
2277
|
+
*/
|
|
2278
|
+
private _requestWithSchemaViaCodec;
|
|
2279
|
+
/**
|
|
2280
|
+
* Emits a notification, which is a one-way message that does not expect a response.
|
|
2281
|
+
*/
|
|
2282
|
+
notification(notification: Notification, options?: NotificationOptions): Promise<void>;
|
|
2283
|
+
/**
|
|
2284
|
+
* The notification funnel proper, keyed by the resolved era codec —
|
|
2285
|
+
* direct sends and related notifications (`ctx.mcpReq.notify`) alike
|
|
2286
|
+
* resolve through the instance's negotiated era at send time.
|
|
2287
|
+
*/
|
|
2288
|
+
private _notificationViaCodec;
|
|
2289
|
+
/**
|
|
2290
|
+
* Registers a handler to invoke when this protocol object receives a request with the given method.
|
|
2291
|
+
*
|
|
2292
|
+
* Note that this will replace any previous request handler for the same method.
|
|
2293
|
+
*
|
|
2294
|
+
* For spec methods, pass `(method, handler)`; the request is parsed with the spec
|
|
2295
|
+
* schema and the handler receives the typed `Request`. For custom (non-spec)
|
|
2296
|
+
* methods, pass `(method, schemas, handler)`; `params` are validated against
|
|
2297
|
+
* `schemas.params` and the handler receives the parsed params object directly.
|
|
2298
|
+
* Supplying `schemas.result` types the handler's return value.
|
|
2299
|
+
*
|
|
2300
|
+
* @example Custom request method
|
|
2301
|
+
* ```ts source="./protocol.examples.ts#Protocol_setRequestHandler_customMethod"
|
|
2302
|
+
* const SearchParams = z.object({ query: z.string(), limit: z.number().optional() });
|
|
2303
|
+
* const SearchResult = z.object({ hits: z.array(z.string()) });
|
|
2304
|
+
*
|
|
2305
|
+
* protocol.setRequestHandler('acme/search', { params: SearchParams, result: SearchResult }, async (params, _ctx) => {
|
|
2306
|
+
* return { hits: [`result for ${params.query}`] };
|
|
2307
|
+
* });
|
|
2308
|
+
* ```
|
|
2309
|
+
*/
|
|
2310
|
+
setRequestHandler<M$1 extends RequestMethod>(method: M$1, handler: (request: RequestTypeMap[M$1], ctx: ContextT) => HandlerResultTypeMap[M$1] | Promise<HandlerResultTypeMap[M$1]>): void;
|
|
2311
|
+
setRequestHandler<P extends StandardSchemaV1, R extends StandardSchemaV1 | undefined = undefined>(method: string, schemas: {
|
|
2312
|
+
params: P;
|
|
2313
|
+
result?: R;
|
|
2314
|
+
}, handler: (params: StandardSchemaV1.InferOutput<P>, ctx: ContextT) => InferHandlerResult<R> | Promise<InferHandlerResult<R>>): void;
|
|
2315
|
+
/**
|
|
2316
|
+
* Hook for subclasses to wrap a registered request handler with role-specific
|
|
2317
|
+
* validation or behavior (e.g. `Server` validates `tools/call` results, `Client`
|
|
2318
|
+
* validates `elicitation/create` mode and result). Runs for both the 2-arg and
|
|
2319
|
+
* 3-arg registration paths. The default implementation is identity.
|
|
2320
|
+
*
|
|
2321
|
+
* Subclasses overriding this hook avoid redeclaring `setRequestHandler`'s overload set.
|
|
2322
|
+
*/
|
|
2323
|
+
protected _wrapHandler(_method: string, handler: (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>): (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>;
|
|
2324
|
+
/**
|
|
2325
|
+
* Hook for subclasses to supply the implementation identity the 2026-era
|
|
2326
|
+
* encode seam stamps into outbound result `_meta` under
|
|
2327
|
+
* `io.modelcontextprotocol/serverInfo` (spec PR #3002: servers SHOULD
|
|
2328
|
+
* identify themselves on every response). The default is `undefined` — no
|
|
2329
|
+
* stamp. Only `Server` overrides this: the key identifies the software
|
|
2330
|
+
* producing a response, and the 2025-era codec never stamps anything
|
|
2331
|
+
* regardless (the never-stamp guarantee).
|
|
2332
|
+
*/
|
|
2333
|
+
protected _outboundServerInfo(): Implementation | undefined;
|
|
2334
|
+
/**
|
|
2335
|
+
* Removes the request handler for the given method.
|
|
2336
|
+
*/
|
|
2337
|
+
removeRequestHandler(method: RequestMethod | string): void;
|
|
2338
|
+
/**
|
|
2339
|
+
* Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
|
|
2340
|
+
*/
|
|
2341
|
+
assertCanSetRequestHandler(method: RequestMethod | string): void;
|
|
2342
|
+
/**
|
|
2343
|
+
* Registers a handler to invoke when this protocol object receives a notification with the given method.
|
|
2344
|
+
*
|
|
2345
|
+
* Note that this will replace any previous notification handler for the same method.
|
|
2346
|
+
*
|
|
2347
|
+
* For spec methods, pass `(method, handler)`; the notification is parsed with the
|
|
2348
|
+
* spec schema. For custom (non-spec) methods, pass `(method, schemas, handler)`;
|
|
2349
|
+
* `params` are validated against `schemas.params` and the handler receives the
|
|
2350
|
+
* parsed params object directly. The raw notification is passed as the second
|
|
2351
|
+
* argument; `_meta` is recoverable via `notification.params?._meta` (minus the
|
|
2352
|
+
* reserved `io.modelcontextprotocol/*` envelope keys, which the protocol layer
|
|
2353
|
+
* lifts out before dispatch).
|
|
2354
|
+
*/
|
|
2355
|
+
setNotificationHandler<M$1 extends NotificationMethod>(method: M$1, handler: (notification: NotificationTypeMap[M$1]) => void | Promise<void>): void;
|
|
2356
|
+
setNotificationHandler<P extends StandardSchemaV1>(method: string, schemas: {
|
|
2357
|
+
params: P;
|
|
2358
|
+
}, handler: (params: StandardSchemaV1.InferOutput<P>, notification: Notification) => void | Promise<void>): void;
|
|
2359
|
+
/**
|
|
2360
|
+
* Removes the notification handler for the given method.
|
|
2361
|
+
*/
|
|
2362
|
+
removeNotificationHandler(method: NotificationMethod | string): void;
|
|
2363
|
+
}
|
|
2364
|
+
/**
|
|
2365
|
+
* Schema bundle accepted by {@linkcode Protocol.setRequestHandler | setRequestHandler}'s 3-arg form.
|
|
2366
|
+
*
|
|
2367
|
+
* `params` is required and validates the inbound `request.params`. `result` is optional;
|
|
2368
|
+
* when supplied it types the handler's return value (no runtime validation is performed
|
|
2369
|
+
* on the result).
|
|
2370
|
+
*/
|
|
2371
|
+
interface RequestHandlerSchemas<P extends StandardSchemaV1 = StandardSchemaV1, R extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> {
|
|
2372
|
+
params: P;
|
|
2373
|
+
result?: R;
|
|
2374
|
+
}
|
|
2375
|
+
type InferHandlerResult<R extends StandardSchemaV1 | undefined> = R extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<R> : Result$1;
|
|
2376
|
+
declare function mergeCapabilities(base: ServerCapabilities, additional: Partial<ServerCapabilities>): ServerCapabilities;
|
|
2377
|
+
declare function mergeCapabilities(base: ClientCapabilities, additional: Partial<ClientCapabilities>): ClientCapabilities;
|
|
2378
|
+
//#endregion
|
|
2379
|
+
//#region ../core-internal/src/shared/mediaType.d.ts
|
|
2380
|
+
/**
|
|
2381
|
+
* Whether a raw `Content-Type` header value denotes `application/json`.
|
|
2382
|
+
* Parameters (for example `charset=utf-8`) are allowed and ignored; malformed
|
|
2383
|
+
* parameter sections do not reject a header whose media type is unambiguously
|
|
2384
|
+
* `application/json` (see `mediaTypeEssence` for the exact grammar).
|
|
2385
|
+
*/
|
|
2386
|
+
declare function isJsonContentType(header: string | null | undefined): boolean;
|
|
2387
|
+
//#endregion
|
|
2388
|
+
//#region ../core-internal/src/shared/metadataUtils.d.ts
|
|
2389
|
+
/**
|
|
2390
|
+
* Utilities for working with {@linkcode BaseMetadata} objects.
|
|
2391
|
+
*/
|
|
2392
|
+
/**
|
|
2393
|
+
* Gets the display name for an object with {@linkcode BaseMetadata}.
|
|
2394
|
+
* For tools, the precedence is: `title` → {@linkcode index.ToolAnnotations | annotations}.`title` → `name`
|
|
2395
|
+
* For other objects: `title` → `name`
|
|
2396
|
+
* This implements the spec requirement: "if no title is provided, name should be used for display purposes"
|
|
2397
|
+
*/
|
|
2398
|
+
declare function getDisplayName(metadata: BaseMetadata | (BaseMetadata & {
|
|
2399
|
+
annotations?: {
|
|
2400
|
+
title?: string;
|
|
2401
|
+
};
|
|
2402
|
+
})): string;
|
|
2403
|
+
//#endregion
|
|
2404
|
+
//#region ../core-internal/src/shared/protocolEras.d.ts
|
|
2405
|
+
/**
|
|
2406
|
+
* Protocol-era helpers (pure module). The MCP wire protocol splits into two eras:
|
|
2407
|
+
* legacy (the 2025-11-25 family and earlier; the version is negotiated via the
|
|
2408
|
+
* `initialize` handshake) and modern (2026-07-28 and later; no `initialize` —
|
|
2409
|
+
* servers advertise versions via `server/discover` and every request carries a
|
|
2410
|
+
* `_meta` envelope).
|
|
2411
|
+
*
|
|
2412
|
+
* An operation that belongs to one era must only ever consult that era's subset
|
|
2413
|
+
* of a supported-versions list: `initialize` never accepts or counter-offers a
|
|
2414
|
+
* modern revision, and the `server/discover` advertisement only ever contains
|
|
2415
|
+
* modern revisions.
|
|
2416
|
+
*/
|
|
2417
|
+
/**
|
|
2418
|
+
* The protocol era of a connection: `'legacy'` for the 2025-11-25 family and
|
|
2419
|
+
* earlier (negotiated via `initialize`), `'modern'` for 2026-07-28 and later
|
|
2420
|
+
* (negotiated via `server/discover`; every request carries a `_meta` envelope).
|
|
2421
|
+
*/
|
|
2422
|
+
type ProtocolEra = 'legacy' | 'modern';
|
|
2423
|
+
//#endregion
|
|
2424
|
+
//#region ../core-internal/src/shared/stdio.d.ts
|
|
2425
|
+
declare const STDIO_DEFAULT_MAX_BUFFER_SIZE: number;
|
|
2426
|
+
/**
|
|
2427
|
+
* Buffers a continuous stdio stream into discrete JSON-RPC messages.
|
|
2428
|
+
*/
|
|
2429
|
+
declare class ReadBuffer {
|
|
2430
|
+
private _buffer?;
|
|
2431
|
+
private _maxBufferSize;
|
|
2432
|
+
constructor(options?: {
|
|
2433
|
+
maxBufferSize?: number;
|
|
2434
|
+
});
|
|
2435
|
+
append(chunk: Buffer): void;
|
|
2436
|
+
readMessage(): JSONRPCMessage | null;
|
|
2437
|
+
clear(): void;
|
|
2438
|
+
}
|
|
2439
|
+
declare function deserializeMessage(line: string): JSONRPCMessage;
|
|
2440
|
+
declare function serializeMessage(message: JSONRPCMessage): string;
|
|
2441
|
+
//#endregion
|
|
2442
|
+
//#region ../core-internal/src/shared/uriTemplate.d.ts
|
|
2443
|
+
type Variables = Record<string, string | string[]>;
|
|
2444
|
+
declare class UriTemplate {
|
|
2445
|
+
/**
|
|
2446
|
+
* Returns true if the given string contains any URI template expressions.
|
|
2447
|
+
* A template expression is a sequence of characters enclosed in curly braces,
|
|
2448
|
+
* like `{foo}` or `{?bar}`.
|
|
2449
|
+
*/
|
|
2450
|
+
static isTemplate(str: string): boolean;
|
|
2451
|
+
private static validateLength;
|
|
2452
|
+
private readonly template;
|
|
2453
|
+
private readonly parts;
|
|
2454
|
+
get variableNames(): string[];
|
|
2455
|
+
constructor(template: string);
|
|
2456
|
+
toString(): string;
|
|
2457
|
+
private parse;
|
|
2458
|
+
private getOperator;
|
|
2459
|
+
private getNames;
|
|
2460
|
+
private encodeValue;
|
|
2461
|
+
private expandPart;
|
|
2462
|
+
expand(variables: Variables): string;
|
|
2463
|
+
private escapeRegExp;
|
|
2464
|
+
private partToRegExp;
|
|
2465
|
+
match(uri: string): Variables | null;
|
|
2466
|
+
}
|
|
2467
|
+
//#endregion
|
|
2468
|
+
//#region ../core-internal/src/util/inMemory.d.ts
|
|
2469
|
+
/**
|
|
2470
|
+
* In-memory transport for creating clients and servers that talk to each other within the same process.
|
|
2471
|
+
*
|
|
2472
|
+
* Intended for testing and development. For production in-process connections, use
|
|
2473
|
+
* `StreamableHTTPClientTransport` against a local server URL.
|
|
2474
|
+
*/
|
|
2475
|
+
declare class InMemoryTransport implements Transport {
|
|
2476
|
+
private _otherTransport?;
|
|
2477
|
+
private _messageQueue;
|
|
2478
|
+
private _closed;
|
|
2479
|
+
onclose?: () => void;
|
|
2480
|
+
onerror?: (error: Error) => void;
|
|
2481
|
+
onmessage?: (message: JSONRPCMessage, extra?: {
|
|
2482
|
+
authInfo?: AuthInfo;
|
|
2483
|
+
}) => void;
|
|
2484
|
+
sessionId?: string;
|
|
2485
|
+
/**
|
|
2486
|
+
* Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a {@linkcode @modelcontextprotocol/client!client/client.Client | Client} and one to a {@linkcode @modelcontextprotocol/server!server/server.Server | Server}.
|
|
2487
|
+
*/
|
|
2488
|
+
static createLinkedPair(): [InMemoryTransport, InMemoryTransport];
|
|
2489
|
+
start(): Promise<void>;
|
|
2490
|
+
close(): Promise<void>;
|
|
2491
|
+
/**
|
|
2492
|
+
* Sends a message with optional auth info.
|
|
2493
|
+
* This is useful for testing authentication scenarios.
|
|
2494
|
+
*/
|
|
2495
|
+
send(message: JSONRPCMessage, options?: {
|
|
2496
|
+
relatedRequestId?: RequestId;
|
|
2497
|
+
authInfo?: AuthInfo;
|
|
2498
|
+
}): Promise<void>;
|
|
2499
|
+
}
|
|
2500
|
+
//#endregion
|
|
2501
|
+
//#region ../core-internal/src/wire/preload.d.ts
|
|
2502
|
+
/**
|
|
2503
|
+
* Eagerly builds every lazily-constructed wire-schema layer, so that no later
|
|
2504
|
+
* validation pays schema-construction cost.
|
|
2505
|
+
*
|
|
2506
|
+
* Synchronous and idempotent: every layer is a memo, so the first call does
|
|
2507
|
+
* all the work and subsequent calls return immediately. Reference identity is
|
|
2508
|
+
* unaffected — this forces the same memos every lazy consumer pulls through.
|
|
2509
|
+
*
|
|
2510
|
+
* Call it at module scope on platforms that bill per-request CPU but not
|
|
2511
|
+
* module evaluation (isolate-based edge/serverless runtimes), where deferring
|
|
2512
|
+
* construction would move it into the first request of every fresh isolate:
|
|
2513
|
+
*
|
|
2514
|
+
* ```ts
|
|
2515
|
+
* // from '@modelcontextprotocol/server' or '@modelcontextprotocol/client' —
|
|
2516
|
+
* // each package bundles its own schema copy, so warm the one(s) you import.
|
|
2517
|
+
* preloadSchemas(); // module scope — runs during isolate warm-up
|
|
2518
|
+
* ```
|
|
2519
|
+
*
|
|
2520
|
+
* On Node CLIs and other process-per-invocation runtimes, prefer the lazy
|
|
2521
|
+
* default — there, module-scope construction is pure added boot latency.
|
|
2522
|
+
*/
|
|
2523
|
+
declare function preloadSchemas(): void;
|
|
2524
|
+
//#endregion
|
|
2525
|
+
export { withInputRequired as $, TRACESTATE_META_KEY as $i, Notification as $n, SetLevelRequest as $r, GetTaskResult as $t, SpecTypes as A, UnsubscribeRequest as Ai, ListPromptsRequest as An, RequestTypeMap as Ar, CreateMessageRequestParamsWithTools as At, isJSONRPCNotification as B, INVALID_PARAMS as Bi, ListToolsRequest as Bn, Result$1 as Br, ElicitRequestURLParams as Bt, ServerContext as C, StoredOAuthTokens as Ca, Tool as Ci, JSONRPCResponse as Cn, Request as Cr, CompleteRequestPrompt as Ct, TransportSendOptions as D, ToolListChangedNotification as Di, ListChangedCallback as Dn, RequestMetaObject as Dr, CreateMessageRequest as Dt, Transport as E, ToolExecution as Ei, LegacyTitledEnumSchema as En, RequestMetaEnvelope as Er, ContentBlock as Et, isCallToolResult as F, BAGGAGE_META_KEY as Fi, ListResourcesResult as Fn, ResourceRequestParams as Fr, DiscoverRequest as Ft, parseJSONRPCMessage as G, METHOD_NOT_FOUND as Gi, MessageClassification as Gn, RootsListChangedNotification as Gr, EmptyResult as Gt, isJSONRPCResponse as H, JSONRPC_VERSION as Hi, LoggingLevel as Hn, ResultTypeMap as Hr, ElicitationCompleteNotification as Ht, isInitializeRequest as I, CLIENT_CAPABILITIES_META_KEY as Ii, ListRootsRequest as In, ResourceTemplateReference as Ir, DiscoverResult as It, ResourceNotFoundError as J, RELATED_TASK_META_KEY as Ji, MethodNotFoundError as Jn, SamplingMessageContentBlock as Jr, GetPromptRequestParams as Jt, MissingRequiredClientCapabilityError as K, PARSE_ERROR as Ki, MessageExtraInfo as Kn, SamplingContent as Kr, EnumSchema as Kt, isInitializedNotification as L, CLIENT_INFO_META_KEY as Li, ListRootsResult as Ln, ResourceTemplateType as Lr, ElicitRequest as Lt, specTypeSchemas as M, UnsupportedProtocolVersionErrorData as Mi, ListResourceTemplatesRequest as Mn, ResourceContents as Mr, CreateMessageResultWithTools as Mt, assertCompleteRequestPrompt as N, UntitledMultiSelectEnumSchema as Ni, ListResourceTemplatesResult as Nn, ResourceLink as Nr, CreateTaskResult as Nt, createFetchWithInit as O, ToolResultContent as Oi, ListChangedHandlers as On, RequestMethod as Or, CreateMessageRequestParams as Ot, assertCompleteRequestResourceTemplate as P, UntitledSingleSelectEnumSchema as Pi, ListResourcesRequest as Pn, ResourceListChangedNotification as Pr, Cursor as Pt, InputRequiredOptions as Q, TRACEPARENT_META_KEY as Qi, MultiSelectEnumSchema as Qn, ServerResult as Qr, GetTaskRequest as Qt, isInputRequiredResult as R, DEFAULT_NEGOTIATED_PROTOCOL_VERSION as Ri, ListTasksRequest as Rn, ResourceUpdatedNotification as Rr, ElicitRequestFormParams as Rt, RequestStateAccessor as S, StoredOAuthClientInformation as Sa, TitledSingleSelectEnumSchema as Si, JSONRPCRequest as Sn, RelatedTaskMetadata as Sr, CompleteRequestParams as St, FetchLike as T, ToolChoice as Ti, JSONValue as Tn, RequestMeta as Tr, CompleteResult as Tt, isJSONRPCResultResponse as U, LATEST_PROTOCOL_VERSION as Ui, LoggingMessageNotification as Un, Role as Ur, ElicitationCompleteNotificationParams as Ut, isJSONRPCRequest as V, INVALID_REQUEST as Vi, ListToolsResult as Vn, ResultMetaObject as Vr, ElicitResult as Vt, isTaskAugmentedRequestParams as W, LOG_LEVEL_META_KEY as Wi, LoggingMessageNotificationParams as Wn, Root as Wr, EmbeddedResource as Wt, UrlElicitationRequiredError as X, SUBSCRIPTION_ID_META_KEY as Xi, ModelHint as Xn, ServerNotification as Xr, GetTaskPayloadRequest as Xt, UnsupportedProtocolVersionError as Y, SERVER_INFO_META_KEY as Yi, MissingRequiredClientCapabilityErrorData as Yn, ServerCapabilities as Yr, GetPromptResult as Yt, ProtocolErrorCode as Z, SUPPORTED_PROTOCOL_VERSIONS as Zi, ModelPreferences as Zn, ServerRequest as Zr, GetTaskPayloadResult as Zt, ProgressCallback as _, OAuthProtectedResourceMetadata as _a, TaskStatusNotification as _i, JSONArray as _n, PromptMessage as _r, ClientNotification as _t, ReadBuffer as a, SdkHttpErrorData as aa, SubscriptionFilter as ai, InitializeRequest as an, PaginatedRequestParams as ar, AuthInfo as at, RequestHandlerSchemas as b, OpenIdProviderDiscoveryMetadata as ba, TextResourceContents as bi, JSONRPCMessage as bn, ReadResourceRequestParams as br, CompatibilityCallToolResult as bt, serializeMessage as c, AuthorizationServerMetadata as ca, SubscriptionsListenRequest as ci, InitializedNotification as cn, PingRequest as cr, BooleanSchema as ct, isJsonContentType as d, OAuthClientInformationFull as da, SubscriptionsListenResultMeta as di, InputRequiredResult as dn, ProgressNotification as dr, CallToolResult as dt, checkResourceAllowed as ea, SetLevelRequestParams as ei, HandlerResultTypeMap as en, NotificationMethod as er, StandardSchemaV1 as et, BaseContext as f, OAuthClientInformationMixed as fa, Task as fi, InputResponse as fn, ProgressNotificationParams as fr, CancelTaskRequest as ft, NotificationOptions as g, OAuthMetadata as ga, TaskStatus as gi, InvalidRequestError as gn, PromptListChangedNotification as gr, ClientCapabilities as gt, NonCompleteResultFlow as h, OAuthErrorResponse as ha, TaskMetadata as hi, InvalidParamsError as hn, PromptArgument as hr, CancelledNotificationParams as ht, Variables as i, SdkHttpError as ia, SubscribeRequestParams as ii, Implementation as in, PaginatedRequest as ir, AudioContent as it, isSpecType as j, UnsubscribeRequestParams as ji, ListPromptsResult as jn, Resource as jr, CreateMessageResult as jt, SpecTypeName as k, ToolUseContent as ki, ListChangedOptions as kn, RequestParams as kr, CreateMessageRequestParamsBase as kt, ProtocolEra as l, IdJagTokenExchangeResponse as la, SubscriptionsListenRequestParams as li, InputRequest as ln, PrimitiveSchemaDefinition as lr, CallToolRequest as lt, DEFAULT_REQUEST_TIMEOUT_MSEC as m, OAuthClientRegistrationError as ma, TaskCreationParams as mi, InternalError as mn, Prompt as mr, CancelledNotification as mt, InMemoryTransport as n, SdkError as na, StringSchema as ni, Icons as nn, NotificationTypeMap as nr, StandardSchemaWithJSON as nt, STDIO_DEFAULT_MAX_BUFFER_SIZE as o, OAuthError as oa, SubscriptionsAcknowledgedNotification as oi, InitializeRequestParams as on, PaginatedResult as or, BaseMetadata as ot, ClientContext as p, OAuthClientMetadata as pa, TaskAugmentedRequestParams as pi, InputResponses as pn, ProgressToken as pr, CancelTaskResult as pt, ProtocolError as q, PROTOCOL_VERSION_META_KEY as qi, MetaObject as qn, SamplingMessage as qr, GetPromptRequest as qt, UriTemplate as r, SdkErrorCode as ra, SubscribeRequest as ri, ImageContent as rn, NumberSchema as rr, Annotations as rt, deserializeMessage as s, OAuthErrorCode as sa, SubscriptionsAcknowledgedNotificationParams as si, InitializeResult as sn, ParseError as sr, BlobResourceContents as st, preloadSchemas as t, resourceUrlFromServerUrl as ta, SingleSelectEnumSchema as ti, Icon as tn, NotificationParams as tr, StandardSchemaV1Sync as tt, getDisplayName as u, OAuthClientInformation as ua, SubscriptionsListenResult as ui, InputRequests as un, Progress as ur, CallToolRequestParams as ut, Protocol as v, OAuthTokenRevocationRequest as va, TaskStatusNotificationParams as vi, JSONObject as vn, PromptReference as vr, ClientRequest as vt, mergeCapabilities as w, ToolAnnotations as wi, JSONRPCResultResponse as wn, RequestId as wr, CompleteRequestResourceTemplate as wt, RequestOptions as x, OpenIdProviderMetadata as xa, TitledMultiSelectEnumSchema as xi, JSONRPCNotification as xn, ReadResourceResult as xr, CompleteRequest as xt, ProtocolOptions as y, OAuthTokens as ya, TextContent as yi, JSONRPCErrorResponse as yn, ReadResourceRequest as yr, ClientResult as yt, isJSONRPCErrorResponse as z, INTERNAL_ERROR as zi, ListTasksResult as zn, ResourceUpdatedNotificationParams as zr, ElicitRequestParams as zt };
|
|
2526
|
+
//# sourceMappingURL=index-CHhhk6PQ.d.cts.map
|